/* Semantic workspace palette, 30 October 2026. No business logic. */
html:root[data-theme=light]{--bg:#fcfbf0;--surface:#fff;--ink:#0d1a37;--muted:#64655f;--line:#e4e1d7;--ui-soft:#f5f4eb;--ui-accent:#365fbf;--ui-on-accent:#fff;--ui-accent-soft:#edf1fc;--ui-ok:#2f7150;--ui-ok-bg:#e8f2eb;--ui-warn:#664810;--ui-warn-bg:#f6edcf;--ui-error:#983e2d;--ui-error-bg:#f9e6df;--ui-hover:#f0f1eb;--green:#365fbf;--yellow:#365fbf;--mint:#edf1fc;--amber:#664810;color-scheme:light}
html:root[data-theme=dark]{--bg:#0b1213;--surface:#121b1d;--ink:#eaf2f2;--muted:#a8babb;--line:#2b3b3e;--ui-soft:#202b2d;--ui-accent:#55a09c;--ui-on-accent:#062725;--ui-accent-soft:#142e2e;--ui-ok:#8ad0a5;--ui-ok-bg:#1a3028;--ui-warn:#e8c779;--ui-warn-bg:#322b1b;--ui-error:#ffafa2;--ui-error-bg:#392421;--ui-hover:#1c2b2e;--green:#55a09c;--yellow:#55a09c;--mint:#1a3434;--amber:#e8c779;color-scheme:dark}
html:root[data-theme] body,html:root[data-theme] .main{background:var(--bg);color:var(--ink)}
html:root[data-theme] :is(.sidebar,.main>header,.workspace,dialog,.notices-panel){background:var(--surface);color:var(--ink);border-color:var(--line)}
html:root[data-theme] :is(.brand,.breadcrumbs b,.project-id,.project-card h3,.project-name,.stat strong){color:var(--ink)}
html:root[data-theme] :is(.brand-wordmark small,.nav-label,.private-mark,.profile small,.breadcrumbs,.local-status,.caption,.context,.row-note,.field,.form-section,.project-card small,.project-card-meta,.empty,footer,.analytics-note,.metric-explainer p,.chart-legend,.archive-row,.notice-item small,.notices-panel>small){color:var(--muted)}
html:root[data-theme] :is(.profile,.panel-head,.attention-row,.team-card .metrics,.setting-row,.archive-row,.modal-head,.modal-foot,.project-card-bottom,.project-card-foot,.project-card .card-details,.toolbar){border-color:var(--line)}
html:root[data-theme] :is(.workspace-icon,.avatar,.project-icon,.direction-all){background:var(--ui-soft);color:var(--ui-accent);border-color:var(--line)}
html:root[data-theme] nav a{color:var(--muted)}
html:root[data-theme] nav a:hover{background:var(--ui-hover);color:var(--ink)}
html:root[data-theme] nav a.active{background:var(--ui-accent-soft);color:var(--ui-accent)}
html:root[data-theme] :is(.main,dialog) :is(.panel,.team-card,.stat,.project-card,.channel-tile,.status-chip,.view-switch,.card-summary){background:var(--surface);color:var(--ink);border-color:var(--line)}
html:root[data-theme] :is(.main,dialog) :is(.button,.icon-btn,.card-open){background:var(--surface);color:var(--ink);border-color:var(--line);min-height:44px}
html:root[data-theme] :is(.main,dialog) .button.primary{background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-accent)}
html:root[data-theme] :is(.main,dialog) .button.primary:hover{background:var(--ui-accent);filter:brightness(1.07)}
html:root[data-theme] :is(.main,dialog) :is(.text-link,.text-button,.cabinet-link,.reset-filters,.project-number,.form-section){color:var(--ui-accent)}
html:root[data-theme] :is(.main,dialog) :is(.channel-tile.selected,.channel-tile.active,.status-chip.selected,.status-chip.active,.view-switch .selected,.view-switch .active){background:var(--ui-accent-soft);color:var(--ui-accent);border-color:var(--ui-accent)}
html:root[data-theme] :is(.tile-check,.case-tip,.split-label,.pill){color:var(--ui-accent)}
html:root[data-theme] :is(.toolbar input,.toolbar select,.date-input,.field input,.field select,.field textarea,.project-tools select,.analytics-controls select,.analytics-controls input,.project-search,dialog input,dialog select,dialog textarea){background:var(--surface);color:var(--ink);border-color:var(--muted);color-scheme:inherit}
html:root[data-theme] :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
html:root[data-theme] .project-search input{background:transparent;color:var(--ink)}
html:root[data-theme] :is(.main,dialog) th{background:var(--ui-soft);color:var(--ink);border-color:var(--line)}
html:root[data-theme] :is(.main,dialog) td{color:var(--ink);border-color:var(--line)}
html:root[data-theme] :is(.main,dialog) tbody tr:hover{background:var(--ui-hover)}
html:root[data-theme] .main .project-register :is(th,td):first-child,html:root[data-theme] #daily-history :is(th,td):first-child{background:var(--surface);color:var(--ink)}
html:root[data-theme] #daily-history tbody tr:nth-child(even){background:var(--ui-soft)}
html:root[data-theme] #daily-history tbody tr:hover{background:var(--ui-hover)}
html:root[data-theme] :is(.main,dialog) :is(.notice,.demo-banner,.role-notice){background:var(--ui-soft);color:var(--ink);border-color:var(--line)}
html:root[data-theme] :is(.notice,.demo-banner) :is(b,a){color:inherit}
html:root[data-theme] :is(.server-warning,.notice-item.important){background:var(--ui-warn-bg);color:var(--ui-warn);border-color:var(--ui-warn)}
html:root[data-theme] :is(.notice-item.critical,[role=alert]){color:var(--ui-error);background:var(--ui-error-bg);border-color:var(--ui-error)}
html:root[data-theme] .notice-item{background:var(--surface);color:var(--ink);border-color:var(--line)}
html:root[data-theme] :is(.main,dialog) .tag{background:var(--ui-soft);color:var(--muted)}
html:root[data-theme] :is(.main,dialog) .tag.green{background:var(--ui-ok-bg);color:var(--ui-ok)}
html:root[data-theme] :is(.main,dialog) .tag.amber{background:var(--ui-warn-bg);color:var(--ui-warn)}
html:root[data-theme] :is(.main,dialog) .tag.red{background:var(--ui-error-bg);color:var(--ui-error)}
html:root[data-theme] :is(.main,dialog) .tag.gray{background:var(--ui-soft);color:var(--muted)}
html:root[data-theme] :is(.mini-report,.report-button){background:var(--ui-soft);color:var(--ink);border-color:var(--line)}
html:root[data-theme] :is(.mini-report.done,.report-button.done){background:var(--ui-ok-bg);color:var(--ui-ok);border-color:var(--ui-ok)}
html:root[data-theme] .main .mini-report.video-state-overdue,html:root[data-theme] .video-report-grid .notice.video-state-overdue{background:var(--ui-error-bg);color:var(--ui-error);border-color:var(--ui-error)}
html:root[data-theme] .main .mini-report.video-state-due,html:root[data-theme] .video-report-grid .notice.video-state-due{background:var(--ui-warn-bg);color:var(--ui-warn);border-color:var(--ui-warn)}
html:root[data-theme] .video-report-grid .notice:is(.video-state-upcoming,.video-state-done,.video-state-paused,.video-state-inactive,.video-state-missing){background:var(--surface);color:var(--ink);border-color:var(--line)}
html:root[data-theme] .video-report-grid .video-state-done .video-state-label{color:var(--ui-ok)}
html:root[data-theme] .main .stat.accent{background:var(--surface);color:var(--ink);border-color:var(--line)}
html:root[data-theme] .main .stat.accent :is(strong,.caption,.context){color:var(--ink)}
html:root[data-theme] .main .brand-hero{background:var(--surface);color:var(--ink);border-color:var(--line)}
html:root[data-theme] .brand-hero :is(p,.hero-eyebrow,.hero-index){color:var(--muted)}
html:root[data-theme] .brand-hero h1 span{color:var(--ui-accent)}
html:root[data-theme] .hero-monogram{color:var(--ui-accent);text-shadow:none;opacity:.06}
html:root[data-theme] :is(.trend-new,.chart-legend i:first-of-type,.bar-fill){background:var(--ui-accent)}
html:root[data-theme] :is(.trend-lost,.chart-legend i){background:var(--muted)}
html:root[data-theme] :is(.bar-track,.view-switch){background:var(--ui-soft)}
html:root[data-theme] .bar-fill.over{background:var(--amber)}
html:root[data-theme] .main .daily-costs strong{color:var(--ink)}
html:root[data-theme] :is(.floating-case,.card-summary){background:var(--surface);color:var(--ink);border-color:var(--line)}
html:root[data-theme] #toast{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
html:root[data-theme] :focus-visible{outline:3px solid var(--ui-accent);outline-offset:3px}
html:root[data-theme] input[type=checkbox]{accent-color:var(--ui-accent)}
html:root[data-theme] *{scrollbar-color:var(--muted) var(--surface)}
@media(max-width:720px){html:root[data-theme] .main>header{align-items:center}html:root[data-theme] .main>header .button{max-width:100%;min-height:44px}html:root[data-theme] dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}}
@media(prefers-reduced-motion:reduce){html:root[data-theme] *{scroll-behavior:auto}}
.skip-to-content{position:fixed;top:8px;left:8px;z-index:2000;padding:12px 18px;background:var(--surface);color:var(--ink);border:2px solid var(--ui-accent);border-radius:8px;transform:translateY(-200%)}
.skip-to-content:focus{transform:translateY(0)}
html:root[data-theme] [data-own-result][data-state=error]{color:var(--ui-error);background:var(--ui-error-bg);padding:10px;border-radius:6px}
html:root[data-theme] [data-own-result][data-state=saved]{color:var(--ui-ok);background:var(--ui-ok-bg);padding:10px;border-radius:6px}
html:root[data-theme] [data-own-result][data-state=saving]{color:var(--muted)}
/* A local checkbox is not a server confirmation while saving or blocked. */
html:root[data-theme][data-save-state=saving] :is(.mini-report.done,.report-button.done),html:root[data-theme][data-save-state=error] :is(.mini-report.done,.report-button.done){background:var(--ui-soft);color:var(--muted);border-color:var(--line)}
html:root[data-theme][data-save-state=saving] .video-report-grid .video-state-done .video-state-label,html:root[data-theme][data-save-state=error] .video-report-grid .video-state-done .video-state-label{color:var(--muted)}
html:root[data-theme] .main>header{height:auto;min-height:74px;flex-wrap:wrap;gap:10px;padding-block:12px}
html:root[data-theme] .main>header .local-status{max-width:260px;overflow-wrap:anywhere;line-height:1.45}
html:root[data-theme][data-save-state=error] .server-warning{background:var(--ui-error-bg);color:var(--ui-error);border-color:var(--ui-error)}

html:root[data-theme] [data-workflow-result][data-state=error]{color:var(--ui-error);background:var(--ui-error-bg);padding:10px;border-radius:8px}
html:root[data-theme] [data-workflow-result][data-state=saved]{color:var(--ui-ok)}
html:root[data-theme] [data-workflow-result][data-state=saving]{color:var(--muted)}

/* Readable statistics: separate current stock, monthly flows and incomplete data. */
.analytics-workload{padding:24px;margin:24px 0;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.analytics-section-head{display:flex;justify-content:space-between;align-items:baseline;gap:16px;flex-wrap:wrap;margin-bottom:12px}
.analytics-section-head h2,.analytics-period-heading{font-size:22px;line-height:1.35;margin:0}
.analytics-workload p,.analytics-quality-note p{font-size:15px;line-height:1.65;margin:8px 0 16px;max-width:90ch}
.analytics-workload .stats{margin:20px 0;gap:16px}
.analytics-count-note{color:var(--muted)}
.analytics-quality-note{padding:16px 20px;margin:16px 0 24px;border:1px solid var(--ui-warn);border-radius:10px;color:var(--ui-warn);background:var(--ui-warn-bg);font-size:15px;line-height:1.6}
.analytics-quality-note p{margin:8px 0 0}
.analytics-period-heading{margin:28px 0 16px}
html:root[data-theme] .analytics-workload .stat .caption{font-size:14px;line-height:1.5}
html:root[data-theme] .analytics-workload .stat .context{font-size:13px;line-height:1.55;margin-top:8px}
@media(max-width:600px){.analytics-workload{padding:16px}.analytics-quality-note{padding:14px}.analytics-workload .stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:380px){.analytics-workload .stats{grid-template-columns:1fr}}

.analytics-period-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.analytics-controls label{display:flex;gap:8px;align-items:center;flex-wrap:wrap}@media(max-width:760px){.analytics-period-stats{grid-template-columns:1fr}}
.analytics-page{min-width:0}
.analytics-controls{display:flex;flex-wrap:wrap;gap:16px;align-items:end}
.analytics-controls label{min-width:0;max-width:100%}
.analytics-controls select,.analytics-controls input{max-width:100%;min-width:0}
@media(max-width:600px){.analytics-controls label{width:100%;display:grid;gap:8px}.analytics-controls select,.analytics-controls input{width:100%;box-sizing:border-box}}
.analytics-page .page-head{flex-wrap:wrap;gap:16px}
.analytics-page .page-head>div{min-width:0}
.analytics-page .page-head>.button{max-width:100%;white-space:normal;text-align:left}
.analytics-page .analytics-controls{display:flex;flex-wrap:wrap;gap:16px;align-items:end}
.analytics-page .analytics-controls label{min-width:0;max-width:100%}
.analytics-page .analytics-controls select,.analytics-page .analytics-controls input{max-width:100%;min-width:0}
@media(max-width:600px){.analytics-page .page-head{display:flex;flex-direction:column;align-items:stretch}.analytics-page .analytics-controls label{width:100%;display:grid;gap:8px}.analytics-page .analytics-controls select,.analytics-page .analytics-controls input{width:100%;box-sizing:border-box}.analytics-page .panel-head{flex-wrap:wrap;gap:8px}}

/* Keep scrolling inside an open form instead of moving the page behind it. */
dialog[open], dialog[open] .modal-body { overscroll-behavior: contain; }
