:root {
    color-scheme: light;
    --page: #f5f7fb;
    --surface: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #e4e7ec;
    --accent: #3157d5;
    --accent-soft: #edf1ff;
    font-family: "Segoe UI", system-ui, sans-serif;
}

html, body { margin: 0; min-height: 100%; background: var(--page); color: var(--ink); }
body { min-width: 320px; }
.app-shell { min-height: 100vh; }
.app-header { height: 72px; padding: 0 5vw; display: flex; align-items: center; gap: 14px; background: #fff; border-bottom: 1px solid var(--line); }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; }
.brand-title { font-weight: 700; font-size: 18px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.app-content { width: min(1180px, 90vw); margin: 0 auto; padding: 48px 0 80px; }
.app-footer { width: min(1180px, 90vw); margin: 0 auto; padding: 0 0 24px; color: #98a2b3; font-size: 11px; text-align: right; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 28px; }
.page-heading h1 { margin: 6px 0 8px; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; }
.page-heading p, .list-card p, .item-card p, .empty-state p { color: var(--muted); margin: 0; }
.basket-summary { min-width: 180px; padding: 14px 18px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; background: #ecfdf3; border: 1px solid #abefc6; border-radius: 12px; }
.basket-summary span { color: #067647; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.basket-summary strong { color: #05603a; font-size: 20px; }
.basket-summary small { max-width: 220px; color: #667085; text-align: right; }
.version-label { display: inline-block; margin-top: 12px; padding: 4px 9px; color: #344054; background: #eaecf0; border-radius: 999px; font-size: 12px; font-weight: 650; }
.editor-card, .list-card, .item-card, .empty-state { padding: 24px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(16, 24, 40, .05); }
.editor-card { margin-bottom: 28px; }
.editor-card h2, .empty-state h2 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0 22px; }
.single-column { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 650; }
.field fluent-text-field, .field fluent-number-field { width: 100%; }
.number-input { box-sizing: border-box; width: 100%; min-height: 32px; padding: 6px 10px; color: var(--ink); background: #fff; border: 1px solid #929292; border-radius: 4px; font: inherit; }
.number-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.full-width { grid-column: 1 / -1; }
.validation-message { color: #b42318; font-size: 12px; }
.error-banner { padding: 14px 16px; margin-bottom: 20px; color: #912018; background: #fef3f2; border: 1px solid #fecdca; border-radius: 10px; }
.fatal-error { display: flex; flex-direction: column; gap: 10px; padding: 20px; color: #912018; background: #fef3f2; border: 2px solid #f04438; border-radius: 12px; }
.form-error { display: flex; flex-direction: column; gap: 4px; }
.validation-summary { margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; background: #fff6ed; color: #9a3412; }
.validation-summary:empty { display: none; }
.validation-summary ul { margin: 0; padding-left: 20px; }
.loading-state, .boot-state { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.list-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.card-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.list-card h2, .item-card h3 { margin: 0 0 5px; }
.list-card h2 { font-size: 18px; }
.empty-state { text-align: center; padding: 58px 24px; }
.back-link { display: inline-block; margin-bottom: 24px; }
.detail-layout { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 24px; align-items: start; }
.sticky-card { position: sticky; top: 20px; margin: 0; }
.item-list { display: flex; flex-direction: column; gap: 12px; }
.item-card { display: grid; grid-template-columns: auto minmax(140px, 1fr) minmax(90px, 120px) minmax(110px, 140px) auto; gap: 15px; align-items: center; }
.item-check { width: 26px; height: 26px; border: 2px solid #98a2b3; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #fff; }
.item-main h3 { font-size: 16px; }
.item-price { font-weight: 700; white-space: nowrap; }
.basket-check { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #344054; font-size: 11px; font-weight: 650; cursor: pointer; }
.basket-check input { width: 26px; height: 26px; margin: 0; accent-color: var(--accent); }
.inline-editor { display: flex; flex-direction: column; gap: 4px; color: #667085; font-size: 11px; font-weight: 650; }
.inline-number { box-sizing: border-box; width: 100%; min-height: 34px; padding: 5px 8px; border: 1px solid #98a2b3; border-radius: 5px; font: inherit; color: var(--ink); }
.inline-number:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.item-total { margin-top: 3px; color: #067647; font-size: 12px; white-space: nowrap; }
.item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.item-actions label { display: inline-flex; align-items: center; gap: 6px; color: #475467; font-size: 12px; white-space: nowrap; cursor: pointer; }
.item-actions input { width: 15px; height: 15px; accent-color: var(--accent); }
.item-ignored { background: #f2f4f7; border-color: #d0d5dd; color: #98a2b3; }
.item-ignored > :not(.item-actions), .item-ignored .item-actions fluent-button { opacity: .48; }
.item-ignored .item-actions label { color: #475467; font-weight: 650; }
.item-ignored input:disabled { cursor: not-allowed; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 14px; background: #fef3f2; color: #912018; text-align: center; }

@media (max-width: 760px) {
    .app-content { padding-top: 30px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .basket-summary { box-sizing: border-box; width: 100%; align-items: flex-start; }
    .basket-summary small { text-align: left; }
    .detail-layout { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: auto; }
    .list-card { grid-template-columns: auto 1fr; }
    .list-card fluent-button { grid-column: 1 / -1; }
    .item-card { grid-template-columns: auto 1fr auto; }
    .inline-editor { grid-column: span 1; }
    .item-actions { grid-column: 2 / -1; justify-self: end; }
}

.auth-card { max-width: 460px; margin: 36px auto; padding: 28px; background: white; border: 1px solid #d0d5dd; border-radius: 12px; }
.auth-card .field { margin-bottom: 18px; }
.auth-card form { margin-bottom: 16px; }
.auth-card .number-input { width: 100%; box-sizing: border-box; }
.account-nav { margin-left: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.account-nav a { overflow-wrap: anywhere; }
.success-message { color: #067647; }
@media (max-width: 760px) { .app-header { flex-wrap: wrap; gap: 12px; } .account-nav { width: 100%; margin-left: 0; } .auth-card { padding: 20px; } }
