/* Local appearance candidate. Shared geometry; explicit dark surfaces.
   Load after daylight.css. The published release is unchanged until approval. */
:root {
  --focus-ring: #176e52;
  --accent-soft: #e7f2ec;
  --accent-ink: #12644f;
  --gold: #956321;
}
html { scrollbar-gutter: stable; }
body { font-variant-numeric: tabular-nums; }
.workspace-bar { min-height: 72px; margin-bottom: 24px; }
.workspace-location { min-width: 0; }
.workspace-location strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-actions { flex-shrink: 0; }
.page-header { margin-bottom: 18px; }
.dashboard-context { margin-bottom: 18px; }
.dashboard-filters > label { min-width: 154px; width: 154px; }
.dashboard-filters input[type="date"] { padding-inline: 7px; }
.brief-footer .stock-readiness { flex-shrink: 1; min-width: 0; max-width: 100%; }
.stock-readiness > div { min-width: 0; }
.dashboard-metrics .stat-card { min-height: 140px; min-width: 0; }
.dashboard-metrics .stat-content { min-width: 0; }
/* Financial values must remain complete, including at enlarged text sizes. */
.dashboard-metrics .stat-card strong { white-space: normal; overflow-wrap: anywhere; word-break: normal; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.nav-group-label, .nav-group-label:first-child, .connection, .profile-chip span { font-size: .75rem; }
.sidebar nav a { font-size: .875rem; min-height: 44px; }
.dashboard-section-heading p, .dashboard-section-heading span, .dashboard-context,
.dashboard-metrics .stat-card p, .dashboard-metrics .stat-card small, .quick-action-copy small,
.brief-heading p, .brief-priority small, .stock-readiness small, .brief-action,
.filters > label, .brief-count, .guide-optional { font-size: .8125rem; }
.workspace-brief .eyebrow, .brief-rank, th, .stock-readiness strong { font-size: .75rem; }
.settings-summary :is(span,small), .file-drop span, .launch-plan-card > small, .launch-plan-card > p { font-size: .8125rem; }
.brief-priority strong, .quick-action-copy strong { font-size: .875rem; }
.dashboard-metrics .stat-card p { margin-bottom: 16px; }
.brief-count { color: #5a6138; background: #f2f0df; border-color: #d8d3ae; }
.brief-rank { color: #705529; background: #f1ecd9; }
.appearance-control { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; min-width: 44px; min-height: 44px; color: var(--ink); }
.appearance-control > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; pointer-events: none; z-index: 1; color: var(--accent-ink); }
.appearance-control select { min-height: 44px; width: 190px; padding: 9px 28px 9px 37px; font-size: .8125rem; font-weight: 550; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; }
.appearance-control select:hover { border-color: var(--control-border); }
.appearance-control select:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.login-appearance { position: absolute; right: 24px; top: 22px; z-index: 2; }
.login-panel { position: relative; }
.login-panel .login-form { margin-top: 40px; }
.update-notice .update-notice-eyebrow { font-size: 10px; }
.update-notice .update-notice-detail, .update-notice button { font-size: 12px; }
.update-notice button { min-height: 44px; }
#app-splash { background: var(--workspace-bg); color: var(--ink); }
.app-splash-word { color: var(--ink); }
.app-splash-tag, .app-splash-note { color: var(--muted); }

/* Dark is an intentional forest workspace, with lighter raised surfaces. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --workspace-bg: #101d20;
  --nav-bg: #0c2827;
  --navy: #e5f0e8;
  --navy-2: #c0d7ca;
  --teal: #98e2bc;
  --teal-dark: #b8efd2;
  --teal-soft: #24463b;
  --amber: #e6c38e;
  --red: #ffb4ad;
  --red-soft: #422d30;
  --green: #a3e2ba;
  --green-soft: #254538;
  --blue-soft: #253e4c;
  --ink: #e5f0e8;
  --muted: #adc0b7;
  --line: #3b514e;
  --border: #3b514e;
  --surface: #1b2e30;
  --surface-2: #243a3a;
  --control-border: #75978c;
  --shadow: 0 3px 12px #030b0b16;
  --focus-ring: #afeccb;
  --accent-soft: #264c3f;
  --accent-ink: #afe4c5;
  --gold: #e6c38e;
}
:root[data-theme="dark"] :is(html, body) { background: var(--workspace-bg); color: var(--ink); }
:root[data-theme="dark"] :is(h1,h2,h3,label,.stat-card strong,.panel-title h2) { color: var(--ink); }
:root[data-theme="dark"] :is(input,select,textarea) { background: #132729; color: var(--ink); border-color: var(--control-border); }
:root[data-theme="dark"] :is(input,textarea)::placeholder { color: #aac1b7; }
:root[data-theme="dark"] select option { background: #193233; color: var(--ink); }
:root[data-theme="dark"] :is(input,select,textarea):focus { border-color: var(--teal); box-shadow: 0 0 0 3px #98e2bc20; }
:root[data-theme="dark"] :is(button,a,input,select,textarea,summary):focus-visible { outline-color: var(--focus-ring); }
:root[data-theme="dark"] .btn-primary { color: #123b2b; background: #a6e8c6; border-color: #a6e8c6; box-shadow: none; }
:root[data-theme="dark"] .btn-primary:hover { background: #bdf3d7; border-color: #bdf3d7; }
:root[data-theme="dark"] .btn-secondary { color: #d8e8de; background: #2b4540; border-color: #6b8e7d; }
:root[data-theme="dark"] .btn-secondary:hover { background: #37574d; border-color: #9ec4ad; }
:root[data-theme="dark"] .btn-ghost { color: #b7e2c7; }
:root[data-theme="dark"] .btn-ghost:hover { background: #294d3f; }
:root[data-theme="dark"] .btn-danger { color: #ffc5bc; background: #462f31; border-color: #a97872; }
:root[data-theme="dark"] .btn-danger:hover { background: #5b3c3d; }
:root[data-theme="dark"] .icon-btn { color: #c1dfcc; background: #2c4941; }
:root[data-theme="dark"] .icon-btn:hover { background: #3a5c4e; }
:root[data-theme="dark"] .icon-btn.danger { color: var(--red); background: var(--red-soft); }
:root[data-theme="dark"] .sidebar { background: var(--nav-bg); border-color: #34524a; }
:root[data-theme="dark"] .sidebar-brand { border-color: #335046; }
:root[data-theme="dark"] .tenant-card { background: #173c35; border-color: #42685a; }
:root[data-theme="dark"] .sidebar nav a.active { color: #dff7e6; background: #285b46; box-shadow: inset 3px 0 #dbbc88; }
:root[data-theme="dark"] .sidebar nav a.active svg { color: #bbf0ce; }
:root[data-theme="dark"] .sidebar nav a.active:hover { background: #32694e; }
:root[data-theme="dark"] .profile-chip { background: #204538; }
:root[data-theme="dark"] .workspace-bar { background: #162b2df7; border-color: var(--line); box-shadow: none; }
:root[data-theme="dark"] .workspace-location strong { color: #e2eee5; }
:root[data-theme="dark"] :is(.workspace-location > span,.workspace-location > span::before,.dashboard-context,.dashboard-scope,.dashboard-updated,.filters > label,.page-header p) { color: var(--muted); }
:root[data-theme="dark"] :is(.command-trigger,.guide-help-button,.notif-fab) { color: #cce6d3; background: #243f39; border-color: #62806f; }
:root[data-theme="dark"] :is(.command-trigger,.guide-help-button,.notif-fab):hover { background: #315549; border-color: #9abca5; }
:root[data-theme="dark"] .command-trigger kbd { color: #bfd6c6; background: #1a332d; border-color: #52765e; }
:root[data-theme="dark"] :is(.panel,.card,.stat-card,.entity-card,.document-card,.product-card,.cart-panel,.workspace-brief,.modal,.password-card,.notif-panel,.guide-card) { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
:root[data-theme="dark"] .panel-title > span { color: #bfdab3; background: #344733; }
:root[data-theme="dark"] .stat-card .stat-icon { color: #b4d8a4; background: #314635; }
:root[data-theme="dark"] :is(.stat-card p,.stat-card small,.brief-heading p,.brief-priority small,.quick-action-copy small,.stock-readiness small) { color: var(--muted); }
:root[data-theme="dark"] .stat-grid:not(.operational) > .stat-card:first-child { background: #215b45; border-color: #598969; }
:root[data-theme="dark"] .stat-grid:not(.operational) > .stat-card:first-child :is(strong,p,small) { color: #edf8e9; }
:root[data-theme="dark"] .stat-grid:not(.operational) > .stat-card:first-child .stat-icon { color: #dbf2c4; background: #3b7351; }
:root[data-theme="dark"] .stat-card.stat-warn .stat-icon { color: #efcd91; background: #4b402a; }
:root[data-theme="dark"] :is(.brief-heading h2,.brief-priority strong,.stock-readiness strong,.document-total strong,.line-total,.empty-state strong) { color: var(--ink); }
:root[data-theme="dark"] :is(.eyebrow,.workspace-brief .eyebrow) { color: #c6d0ad; }
:root[data-theme="dark"] .brief-count { color: #efd6a7; background: #493f2e; border-color: #7b6c4b; }
:root[data-theme="dark"] .brief-rank { color: #ebd0a1; background: #423d2c; }
:root[data-theme="dark"] :is(.brief-priority,.brief-clear,.entity-card dl) { border-color: var(--line); }
:root[data-theme="dark"] a.brief-priority:hover { background: #253e35; }
:root[data-theme="dark"] :is(a.brief-priority:hover strong,.brief-action,.brief-clear svg,.linklike) { color: #a9e4ba; }
:root[data-theme="dark"] :is(.brief-clear p,.empty-state,.empty-state p,.empty-state svg) { color: var(--muted); }
:root[data-theme="dark"] .brief-footer { color: var(--ink); background: #243d31; border-color: #496147; }
:root[data-theme="dark"] .stock-readiness .ring-track { stroke: #415c3e; }
:root[data-theme="dark"] .stock-readiness .ring-value { stroke: #b5d494; }
:root[data-theme="dark"] .stock-readiness text { fill: #d3e5b6; }
:root[data-theme="dark"] .dashboard-shortcuts { background: #192f2c; }
:root[data-theme="dark"] :is(.quick-action,.dashboard-shortcuts .quick-action) { color: #e0eddc; background: #243d33; border-color: #517057; }
:root[data-theme="dark"] .quick-action svg { color: #bcdda7; }
:root[data-theme="dark"] .dashboard-shortcuts .quick-action-icon { color: #c2dda6; background: #3a5035; }
:root[data-theme="dark"] .dashboard-shortcuts .quick-action:first-child { background: #304c34; border-color: #7a925c; }
:root[data-theme="dark"] .dashboard-shortcuts .quick-action:first-child .quick-action-icon { color: #d3e9b3; background: #4a6741; }
:root[data-theme="dark"] .quick-action:hover { background: #38583d; border-color: #9bb680; }
:root[data-theme="dark"] th { color: #c0d0b6; background: #21362e; border-color: #476044; }
:root[data-theme="dark"] td { color: #dce8d8; border-color: var(--line); }
:root[data-theme="dark"] td small { color: var(--muted); }
:root[data-theme="dark"] tbody tr:hover { background: #273e32; }
:root[data-theme="dark"] .table-wrap { scrollbar-color: #658163 #20342d; }
:root[data-theme="dark"] .status { color: #d1ddc6; background: #394638; }
:root[data-theme="dark"] :is(.status-active,.status-posted,.status-approved,.status-completed,.status-paid,.status-delivered,.status-received,.status-healthy,.status-ready,.status-resolved,.status-closed) { color: #b7e6bb; background: #2c4b36; }
:root[data-theme="dark"] :is(.status-pending,.status-draft,.status-partial,.status-open,.status-reported,.status-requested,.status-submitted,.status-partially-received,.status-low,.status-credit,.status-worker,.status-trial,.status-action-required) { color: #f0d097; background: #4a412b; }
:root[data-theme="dark"] :is(.status-inactive,.status-rejected,.status-reversed,.status-cancelled,.status-overdue,.status-out,.status-disputed) { color: #f3bdb5; background: #4b3435; }
:root[data-theme="dark"] :is(.status-verified,.status-ordered,.status-dispatched,.status-manager,.status-supervisor) { color: #b6d6ee; background: #2c4253; }
:root[data-theme="dark"] :is(.status-reversal,.status-reopened) { color: #dfc7f3; background: #453b54; }
:root[data-theme="dark"] .alert-row { color: #d2e2c7; background: #2b4331; border-left-color: #9ec67a; }
:root[data-theme="dark"] .alert-row.priority-1 { color: #ecd0a0; background: #443d2e; border-left-color: #d4ab64; }
:root[data-theme="dark"] .alert-action:hover { background: #354e38; }
:root[data-theme="dark"] .alert-action-label { color: #b8e1ac; }
:root[data-theme="dark"] :is(.error-panel,.form-error,.security-remove,.subscription-banner.state-read_only,.subscription-banner.state-suspended,.subscription-banner.state-cancelled) { color: #ffbeb7; background: #402c30; border-color: #93666b; }
:root[data-theme="dark"] :is(.warning-callout,.workspace-offline,.discard-confirmation,.readiness-row.blocked,.subscription-banner.state-past_due,.import-guidance,.note-preview) { color: #f1d3a2; background: #413b2b; border-color: #8a7952; }
:root[data-theme="dark"] :is(.info-callout,.draft-notice,.security-success,.subscription-banner,.readiness-row.ready) { color: #c8e3c8; background: #294534; border-color: #67866a; }
:root[data-theme="dark"] :is(.config-error code,.hash-code,.guide-symbol,.guide-facts span,.guide-count,.guide-topic summary small,.guide-task.is-done .guide-task-check) { color: #c6dfb5; background: #344a32; border-color: #6c8a57; }
:root[data-theme="dark"] .modal { box-shadow: 0 25px 80px #0006; }
:root[data-theme="dark"] .modal-backdrop { background: #071814b3; }
:root[data-theme="dark"] :is(.modal > header,.modal > header h2,.guide-dialog-header,.guide-dialog-footer,.notif-panel > header) { color: var(--ink); background: #233b32; border-color: var(--line); }
:root[data-theme="dark"] .product-card:not(:disabled):hover { background: #2b4537; border-color: #8aa979; }
:root[data-theme="dark"] .product-card:disabled { background: #27352f; }
:root[data-theme="dark"] .product-card b { color: #b7e0b5; }
:root[data-theme="dark"] .category-tag { color: #d5dfb3!important; background: #40462b; }
:root[data-theme="dark"] :is(.cart-line,.line-editor-row,.receive-line,.closing-summary > div,.closing-list > button,.journal-contents > div,.export-card,.settings-summary > div,.security-notice) { color: var(--ink); background: #243a31; border-color: var(--line); }
:root[data-theme="dark"] .stepper button { color: #d1e7c1; background: #365038; border-color: #849f70; }
:root[data-theme="dark"] .checkout-total { color: #e0edd0; background: #304d33; border-color: #728c5f; }
:root[data-theme="dark"] .checkout-total strong { color: #e0edcf; }
:root[data-theme="dark"] .sale-draft-bar { color: #cedac2; background: #25392d; border-color: var(--line); }
:root[data-theme="dark"] .sale-draft-state svg { color: #b2d39b; }
:root[data-theme="dark"] :is(.receive-confirm,.credential-box,.file-input,.verification-card) { color: #d0e4c1; background: #2d4430; border-color: #7c9263; }
:root[data-theme="dark"] .credential-box strong { color: #e2edcd; }
:root[data-theme="dark"] .evidence-photo { background: #243b31; }
:root[data-theme="dark"] .photo-placeholder { border-color: #849773; }
:root[data-theme="dark"] .month-close-hero { background: #254134; color: var(--ink); border-color: #5c7b5b; }
:root[data-theme="dark"] :is(.month-close-icon,.month-journal-stat .stat-icon,.confirmation-emblem,.security-emblem,.brand-mark) { color: #d0e3af; background: #3b5538; border-color: #758e64; }
:root[data-theme="dark"] .readiness-row.blocked > span { color: #f0d49d; background: #594d31; }
:root[data-theme="dark"] .tabs button { color: #b9c9ab; }
:root[data-theme="dark"] .tabs button.active { color: #d7e9c9; background: #3a5737; }
:root[data-theme="dark"] :is(.guide-home,.guide-tour-summary,.guide-tip,.notif-push) { color: #d7e6ca; background: #2b4430; border-color: #5e7950; }
:root[data-theme="dark"] .guide-home-icon { color: #c7dfa4; background: #3e5937; }
:root[data-theme="dark"] :is(.guide-home strong,.guide-dialog h3,.guide-dialog h4,.guide-task strong,.guide-tip p,.guide-tip svg) { color: #d8e7cb; }
:root[data-theme="dark"] :is(.guide-home p,.guide-caption,.guide-tour-summary p:not(.guide-eyebrow),.guide-task p,.guide-optional,.guide-step-meta) { color: #bacbab; }
:root[data-theme="dark"] :is(.guide-eyebrow,.guide-dialog-header .icon-btn) { color: #c7dda7; }
:root[data-theme="dark"] .guide-search { color: #b9d29e; background: #1b3427; border-color: #789465; }
:root[data-theme="dark"] .guide-search input { background: transparent; color: var(--ink); }
:root[data-theme="dark"] :is(.guide-task,.guide-topic) { border-color: #4e6744; }
:root[data-theme="dark"] .guide-task-check { border-color: #849d70; }
:root[data-theme="dark"] .guide-progress, :root[data-theme="dark"] .guide-progress::-webkit-progress-bar { background: #3c5534; }
:root[data-theme="dark"] .guide-progress::-webkit-progress-value { background: #b1d18b; }
:root[data-theme="dark"] .guide-progress::-moz-progress-bar { background: #b1d18b; }
:root[data-theme="dark"] .guide-sync { color: #f1d2a0; background: #4c412b; }
:root[data-theme="dark"] .guide-spotlight { border-color: #bcdda1; box-shadow: 0 0 0 4px #98cd6926; }
:root[data-theme="dark"] :is(.notif-markall,.notif-push.active) { color: #d4e8bf; background: #3b5933; }
:root[data-theme="dark"] .notif-item.unread { background: #2c4530; box-shadow: inset 3px 0 #a1c77e; }
:root[data-theme="dark"] .notif-kind.low_stock { color: #efce95; background: #51452d; }
:root[data-theme="dark"] .notif-kind.morning_briefing { color: #bbd7f0; background: #2e4554; }
:root[data-theme="dark"] .notif-wa { color: #cde7b8!important; background: #365331; }
:root[data-theme="dark"] .notif-wa:hover { background: #42643b; }
:root[data-theme="dark"] :is(.login-screen,.login-panel,.onboarding-screen,.onboarding-panel,.security-challenge-screen) { background: var(--workspace-bg); color: var(--ink); }
:root[data-theme="dark"] .login-form h2 { color: var(--ink); }
:root[data-theme="dark"] :is(.login-form > div > p,.login-form .eyebrow,.password-hint,.auth-legal,.auth-back-link) { color: var(--muted); }
:root[data-theme="dark"] .login-form label { color: #d0dfd0; }
:root[data-theme="dark"] .auth-tabs { background: #1b3129; border-color: #5a7559; }
:root[data-theme="dark"] .auth-tabs button { color: #bdcdae; }
:root[data-theme="dark"] .auth-tabs button.active { color: #e5efd6; background: #3b5835; }
:root[data-theme="dark"] :is(.password-field > svg,.password-field button) { color: #bfd4ac; }
:root[data-theme="dark"] :is(.password-hint.valid,.password-rules li.met,.auth-back-link:hover) { color: #b6dfa5; }
:root[data-theme="dark"] .plan-picker button { color: #d5e5c9; background: #243a2d; border-color: #607c52; }
:root[data-theme="dark"] .plan-picker button.selected { background: #36512f; border-color: #a4c985; }
:root[data-theme="dark"] .plan-picker span { color: #b5d69c; }
:root[data-theme="dark"] :is(.launch-plan-card,.settings-summary article,.file-drop) { color: var(--ink); background: var(--surface); border-color: var(--control-border); }
:root[data-theme="dark"] .launch-plan-card :is(h2,h3,strong) { color: #d7ebc8; }
:root[data-theme="dark"] :is(.launch-plan-card p,.launch-plan-card small,.settings-summary article small,.file-drop small) { color: var(--muted); }
:root[data-theme="dark"] .risk-setting { color: var(--gold); }
:root[data-theme="dark"] :is(.login-form .brand-asset,.password-card > .dweniva-logo .brand-asset,.security-challenge-card .brand-asset) { content: url('/dweniva-ops-logo-inverse.svg'); }
:root[data-theme="dark"] .appearance-control select { background: var(--surface); color: var(--ink); border-color: var(--line); }

/* Receipts are documents: they keep paper colours in either appearance. */
:root[data-theme] .receipt { --ink: #213d32; --muted: #53695d; --line: #d3ddd4; --teal: #165d47; --red: #842f35; --green: #246444; color-scheme: light; color: #213d32; background: white; }
:root[data-theme] .receipt :is(h1,h2,h3,p,dt,dd,strong,th,td) { color: #213d32; }
:root[data-theme] .receipt :is(small,footer) { color: #53695d; }
:root[data-theme] .receipt :is(th,td) { border-color: #d3ddd4; background: white; }
:root[data-theme] .receipt tbody tr:hover { background: white; }
:root[data-theme] .receipt .receipt-warning { color: #842f35; background: #fff4ed; border-color: #d4a1a4; }

@media (max-width: 1280px) {
  .appearance-control select { width: 178px; }
  .dashboard-metrics .stat-card strong { font-size: clamp(1.25rem,1.8vw,1.65rem); }
}
@media (max-width: 980px) {
  :root[data-theme="dark"] .sidebar-scrim { background: #071a19ad; }
  :root[data-theme="dark"] .workspace-bar .mobile-menu { color: #c3e0c2; background: #294432; border-color: #678160; }
  :root[data-theme="dark"] .mobile-quick-nav { color-scheme: dark; background: #1c3430; border-color: #5d7a60; box-shadow: 0 8px 30px #0004; }
  :root[data-theme="dark"] .mobile-quick-nav :is(a,button) { color: #b9d0b2; }
  :root[data-theme="dark"] .mobile-quick-nav .active { color: #e3f0cc; background: #3c5d37; }
}
@media (max-width: 760px) {
  .modal:has(.receipt) .modal-body { padding: 12px; }
  .receipt { padding: 12px; }
  .receipt-lines { table-layout: fixed; width: 100%; }
  .receipt-lines th:first-child { width: 35%; }
  .receipt-lines th:nth-child(2) { width: 14%; }
  .receipt-lines th:nth-child(3) { width: 24%; }
  .receipt-lines th:nth-child(4) { width: 27%; }
  .receipt-lines :is(th,td) { padding-inline: 3px; overflow-wrap: anywhere; }
  .receipt-lines th { font-size: 11px; letter-spacing: 0; }
  .receipt-lines td, .receipt-lines td small { font-size: 12px; line-height: 1.45; }
  .dashboard-filters > label { min-width: 0; width: 100%; }
  .dashboard-filters input[type="date"] { padding-inline: 4px; }
  .appearance-control { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .appearance-control > svg { left: 12px; }
  .appearance-control select { position: absolute; inset: 0; width: 44px; height: 44px; min-height: 44px; padding: 0; opacity: 0; cursor: pointer; }
  .appearance-control:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
  .workspace-bar { min-height: 68px; margin-bottom: 20px; }
  .workspace-location { flex: 1; }
  .workspace-location strong { max-width: 24vw; font-size: .75rem; }
  .workspace-location > span { font-size: .75rem; }
  .dashboard-metrics .stat-card { min-height: 136px; padding: 16px; }
  .dashboard-metrics .stat-card strong { font-size: clamp(1.15rem,4.6vw,1.6rem); }
  .dashboard-metrics .stat-card p { font-size: .8125rem; margin-bottom: 12px; }
  .dashboard-context { font-size: .8125rem; }
  .brief-action { font-size: 0; }
  .brief-count { font-size: .75rem; }
  input,select,textarea { font-size: 16px; }
  .login-appearance { right: 18px; top: 16px; }
  .login-panel .login-form { margin-top: 45px; }
}
@media (max-width: 520px) {
  /* Give amounts a full row before narrow columns would split the digits. */
  .dashboard-metrics .stat-grid.financial { grid-template-columns: minmax(0, 1fr); }
  .dashboard-metrics .stat-card { min-height: 112px; }
}
@media (max-width: 380px) {
  .workspace-location strong { max-width: 55px; }
  .workspace-location > span { display: none; }
  .dashboard-metrics .stat-card { padding: 12px; }
  .dashboard-metrics .stat-card strong { font-size: 1.15rem; }
  .stock-readiness { max-width: 100%; }
  .brief-heading { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; }
  .appearance-control, .appearance-control select { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-theme="dark"] :is(.workspace-bar,.mobile-quick-nav) { background: #1c3430; backdrop-filter: none; }
  :root[data-theme="dark"] .workspace-brief { background: var(--surface); }
}
@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; --workspace-bg: white; --surface: white; --ink: #213d32; --muted: #53695d; --line: #d3ddd4; }
  .appearance-control, .login-appearance { display: none!important; }
  :root[data-theme="dark"] :is(body,.panel,.card,.workspace-brief,.stat-card,.modal) { background: white!important; color: #213d32!important; box-shadow: none!important; }
  :root[data-theme="dark"] :is(.receipt,.receipt th,.receipt td,.receipt strong,.receipt h2,.receipt dt,.receipt dd) { background: white!important; color: #213d32!important; }
}
:root .auth-bot-check { display: grid; gap: .5rem; min-width: 0; }
:root .auth-bot-check small { line-height: 1.5; }
:root .auth-wait-notice { padding: .85rem 1rem; border: 1px solid #ccb790; border-radius: 12px; background: #faf4e8; color: #513c1d; line-height: 1.5; }
:root[data-theme="dark"] .auth-wait-notice { border-color: #8f774f; background: #342f25; color: #f0dcb5; }
:root .auth-attempt-notice { padding: .8rem 1rem; border: 1px solid #d9c69f; border-radius: 12px; background: #fcf7ee; color: #65491e; line-height: 1.5; }
:root .auth-attempt-notice p, :root .auth-wait-notice p { margin: .35rem 0 0; color: inherit; }
:root .auth-attempt-notice strong, :root .auth-wait-notice strong { display: block; color: inherit; font-size: .95rem; }
:root .auth-wait-notice h3 { margin: 0; color: inherit; font-size: 1rem; line-height: 1.4; }
:root .auth-attempt-notice[data-last-attempt="true"] { border-color: #a16d20; }
:root[data-theme="dark"] .auth-attempt-notice { background: #2c2b24; border-color: #77623f; color: #ead3a7; }
:root[data-theme="dark"] .auth-attempt-notice[data-last-attempt="true"] { border-color: #d3ab66; }
:root .auth-wait-notice:focus { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
