/* Classic remains the original stylesheet. New palettes also change shape, light and depth. */
:root {
  --theme-accent: #0f766e; --theme-on-accent: #fff; --theme-soft: #dcefeb;
  --theme-ink: #16272f; --theme-muted: #5e7078; --theme-surface: #fff;
  --theme-line: #d4dfe2; --theme-shadow: 0 20px 60px #163a4724;
}
:root[data-theme="business"] {
  --ink: #142c49; --muted: #526984; --paper: #edf3fa; --surface: #fff; --line: #d2dfee;
  --green: #215ea8; --green-deep: #164b8a; --green-soft: #e1edfc;
  --gold: #395f91; --gold-soft: #fff0d4; --blue-soft: #e5f1ff;
  --danger: #b42318; --danger-soft: #fee7e4; --surface-soft: #f2f6fc;
  --sidebar-bg: linear-gradient(165deg,#102a4c,#173e6a); --sidebar-ink: #e2ecfa; --sidebar-muted: #b8cce4;
  --topbar-bg: #edf3faf5; --hero-bg: linear-gradient(120deg,#123458,#235a99 70%,#467faf);
  --hero-ink: #fff; --hero-muted: #e1ecfa; --card-radius: 12px; --control-radius: 8px;
  --card-shadow: 0 6px 20px #204a7a0a; --shadow: 0 18px 55px #204a7a1a;
  --page-glow: radial-gradient(ellipse at 96% 0%,#dae9fc 0,transparent 48%);
  --focus-ring: #296bc2; --hint-ink: #73531b; --hint-bg: #fff3d9;
  --on-accent: #fff; --solid-danger: #b42318;
}
:root[data-theme="warm"] {
  --ink: #4b4142; --muted: #6e6165; --paper: #f2eee9; --surface: #f8f5f1; --line: #d9cdcc;
  --green: #8b5365; --green-deep: #784657; --green-soft: #eae0e3;
  --gold: #79633e; --gold-soft: #eae3d3; --blue-soft: #e8e3e9;
  --danger: #a5322c; --danger-soft: #f0ddda; --surface-soft: #eee8e3;
  --sidebar-bg: linear-gradient(165deg,#e9dfe0,#e8e1d4); --sidebar-ink: #5d4650; --sidebar-muted: #705a63;
  --topbar-bg: #f2eee9f5; --hero-bg: linear-gradient(115deg,#eadfe2,#e9e3d4);
  --hero-ink: #59414b; --hero-muted: #705762; --card-radius: 20px; --control-radius: 12px;
  --card-shadow: 0 4px 16px #67545609; --shadow: 0 16px 40px #67545616;
  --page-glow: linear-gradient(120deg,#e9e0e338,transparent 65%);
  --focus-ring: #8b5365; --hint-ink: #6b5534; --hint-bg: #eae3d3;
  --on-accent: #fff; --solid-danger: #b22d25;
}
:root[data-theme="black"] {
  --ink: #eeeef0; --muted: #b0b4bd; --paper: #141519; --surface: #202227; --line: #3d414a;
  --green: #cbd3df; --green-deep: #e1e6ee; --green-soft: #343b47;
  --gold: #d6c29e; --gold-soft: #41382a; --blue-soft: #2e3949;
  --danger: #ffa294; --danger-soft: #492c2c; --surface-soft: #282b31;
  --sidebar-bg: linear-gradient(180deg,#111216,#1a1b20); --sidebar-ink: #e2e4ea; --sidebar-muted: #b0b4bf;
  --topbar-bg: #191b20f5; --hero-bg: linear-gradient(125deg,#2c3039,#1d2026 65%,#393a3e);
  --hero-ink: #f2f3f5; --hero-muted: #c9cbd2; --card-radius: 7px; --control-radius: 6px;
  --card-shadow: 0 4px 12px #00000018; --shadow: 0 20px 55px #0005;
  --page-glow: linear-gradient(120deg,#24272e60,transparent 60%);
  --focus-ring: #d6c29e; --hint-ink: #edce96; --hint-bg: #3b3327;
  --on-accent: #1c2737; --solid-danger: #a82d25;
}
:root[data-theme="mist"] {
  --ink: #344756; --muted: #5e6b78; --paper: #edf0f3; --surface: #f8fafb; --line: #cdd8e0;
  --green: #496982; --green-deep: #39566f; --green-soft: #dfe8ef;
  --gold: #885c69; --gold-soft: #eee6d8; --blue-soft: #dfe8ef;
  --danger: #aa332b; --danger-soft: #f3e0dc; --surface-soft: #e9eef2;
  --sidebar-bg: linear-gradient(170deg,#d8e3ec,#e2e3ea); --sidebar-ink: #354b60; --sidebar-muted: #52687b;
  --topbar-bg: #edf0f3f5; --hero-bg: linear-gradient(115deg,#dbe5ec,#eadfe3);
  --hero-ink: #354d62; --hero-muted: #596877; --card-radius: 18px; --control-radius: 10px;
  --card-shadow: 0 5px 18px #3d58740b; --shadow: 0 16px 40px #3d587419;
  --page-glow: linear-gradient(135deg,#dce5ec50,transparent 65%);
  --focus-ring: #496982; --hint-ink: #6b573c; --hint-bg: #eee6d8;
  --on-accent: #fff; --solid-danger: #aa332b;
}
:root[data-theme="sage"] {
  --ink: #304943; --muted: #596d65; --paper: #e9efeb; --surface: #f6f9f6; --line: #cad7d0;
  --green: #356762; --green-deep: #2c5752; --green-soft: #dce8e2;
  --gold: #855b4e; --gold-soft: #eae5d5; --blue-soft: #deebea;
  --danger: #aa332b; --danger-soft: #f1dfda; --surface-soft: #e5ede7;
  --sidebar-bg: linear-gradient(165deg,#284a49,#345853); --sidebar-ink: #e2ece5; --sidebar-muted: #c1d3c9;
  --topbar-bg: #e9efebf5; --hero-bg: linear-gradient(115deg,#d8e4df,#e2e5d9);
  --hero-ink: #324c42; --hero-muted: #576c60; --card-radius: 22px; --control-radius: 10px;
  --card-shadow: 0 5px 18px #3255490a; --shadow: 0 16px 40px #32554916;
  --page-glow: linear-gradient(145deg,#dce7df55,transparent 65%);
  --focus-ring: #356762; --hint-ink: #695a37; --hint-bg: #eae5d5;
  --on-accent: #fff; --solid-danger: #aa332b;
}
:root[data-theme="sand"] {
  --ink: #37464b; --muted: #606c70; --paper: #eeece7; --surface: #f8f7f3; --line: #d4d2c9;
  --green: #245e72; --green-deep: #1e4d5f; --green-soft: #dee8e9;
  --gold: #796352; --gold-soft: #eae2d3; --blue-soft: #dce7ed;
  --danger: #a53127; --danger-soft: #f1ded7; --surface-soft: #e8e7e0;
  --sidebar-bg: linear-gradient(170deg,#e0d8d0,#d9d9d1); --sidebar-ink: #514942; --sidebar-muted: #665d55;
  --topbar-bg: #eeece7f5; --hero-bg: linear-gradient(115deg,#ded8cf,#d9e4e5);
  --hero-ink: #284a58; --hero-muted: #526775; --card-radius: 9px; --control-radius: 6px;
  --card-shadow: 0 2px 7px #514d4308; --shadow: 0 12px 30px #514d4315;
  --page-glow: linear-gradient(120deg,#e3e0d940,transparent 65%);
  --focus-ring: #245e72; --hint-ink: #695236; --hint-bg: #eae2d3;
  --on-accent: #fff; --solid-danger: #a53127;
}
:root[data-theme="navy"] {
  --ink: #263d4b; --muted: #5b6975; --paper: #e9edf0; --surface: #f7f8f8; --line: #cbd4db;
  --green: #234c68; --green-deep: #1c3f57; --green-soft: #dfe7ed;
  --gold: #874741; --gold-soft: #eae3d6; --blue-soft: #e0e7ee;
  --danger: #b42318; --danger-soft: #f3dfdc; --surface-soft: #e7ecee;
  --sidebar-bg: linear-gradient(175deg,#142c40,#1b394b); --sidebar-ink: #e2e7eb; --sidebar-muted: #bdcbd5;
  --topbar-bg: #e9edf0f5; --hero-bg: linear-gradient(115deg,#18394f,#25495b);
  --hero-ink: #f0f3f4; --hero-muted: #d0dde3; --card-radius: 11px; --control-radius: 7px;
  --card-shadow: 0 3px 0 #cbd4db60,0 6px 16px #233f5709; --shadow: 0 16px 36px #233f5719;
  --page-glow: linear-gradient(135deg,#dde5ea55,transparent 65%);
  --focus-ring: #234c68; --hint-ink: #6b5839; --hint-bg: #eae3d6;
  --on-accent: #fff; --solid-danger: #b42318;
}
html[data-theme]:not([data-theme="classic"]) {
  --theme-accent: var(--green); --theme-on-accent: var(--on-accent); --theme-soft: var(--green-soft);
  --theme-ink: var(--ink); --theme-muted: var(--muted); --theme-surface: var(--surface);
  --theme-line: var(--line); --theme-shadow: var(--shadow); --border: var(--line);
  color: var(--ink); background: var(--paper); accent-color: var(--green);
}
html[data-theme]:not([data-theme="classic"]) body { color: var(--ink); background: var(--page-glow),var(--paper); }
html[data-theme]:not([data-theme="classic"]) :is(.sidebar) { background: var(--sidebar-bg); color: var(--sidebar-ink); border-right: 1px solid var(--line); }
html[data-theme]:not([data-theme="classic"]) .sidebar :is(nav button,.brand small,.privacy-note span) { color: var(--sidebar-muted); }
html[data-theme]:not([data-theme="classic"]) .sidebar nav :is(button:hover,button.active) { color: var(--sidebar-ink); background: #ffffff14; box-shadow: inset 3px 0 var(--sidebar-ink); }
html[data-theme]:not([data-theme="classic"]) .privacy-note strong { color: var(--sidebar-ink); }
html[data-theme]:not([data-theme="classic"]) .topbar { background: var(--topbar-bg); }
html[data-theme]:not([data-theme="classic"]) :is(.stat-card,.panel,.case-card,.consultant-card,.library-portal-card,.enforcement-card,.knowledge-topic-card,.criminal-deadline-card,.login-card) { border-radius: var(--card-radius); box-shadow: var(--card-shadow); border-color: var(--line); }
html[data-theme]:not([data-theme="classic"]) :is(.button,.icon-button,input,select,textarea) { border-radius: var(--control-radius); }
html[data-theme]:not([data-theme="classic"]) :is(label,.stage-field legend,dialog,.fee-source blockquote) { color: var(--ink); }
html[data-theme]:not([data-theme="classic"]) :is(input,select,textarea,.global-search>input,.library-portal-card,.knowledge-document-menu,.tender-menu,.enforcement-document,.enforcement-file-more>div,.stage-choice,.queue-complete,.login-card) { background: var(--surface); border-color: var(--line); }
html[data-theme]:not([data-theme="classic"]) :is(input,select,textarea) { color: var(--ink); }
html[data-theme]:not([data-theme="classic"]) input::placeholder,
html[data-theme]:not([data-theme="classic"]) textarea::placeholder { color: var(--muted); opacity: 1; }
html[data-theme]:not([data-theme="classic"]) :is(input,select,textarea):focus { border-color: var(--focus-ring); box-shadow: 0 0 0 3px var(--green-soft); }
html[data-theme]:not([data-theme="classic"]) :is(button,a,[tabindex]):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
html[data-theme]:not([data-theme="classic"]) :is(.button.primary,#toast,.brand-mark) { color: var(--on-accent); background: var(--green); }
html[data-theme]:not([data-theme="classic"]) :is(.button.danger-solid,#toast.error) { background: var(--solid-danger); color: #fff; border-color: var(--solid-danger); }
html[data-theme]:not([data-theme="classic"]) .brand-mark { box-shadow: 5px 5px 0 var(--line); }
html[data-theme]:not([data-theme="classic"]) .hint { color: var(--hint-ink); background: var(--hint-bg); }
html[data-theme]:not([data-theme="classic"]) :is(.badge.warn,.days-chip.today,.domain-chip:not(.confirmed):not(.unclassified),.tender-status.pending) { color: var(--hint-ink); background: var(--hint-bg); }
html[data-theme]:not([data-theme="classic"]) :is(.badge.red,.danger-hint,.timeline-item.pending .timeline-state,.tender-status.failed) { color: var(--danger); background: var(--danger-soft); }
html[data-theme]:not([data-theme="classic"]) :is(.finance-metrics div,.fee-source,.billing-attachments,.analysis,.procedure-section,.timeline-hearing-entry,.global-search kbd,.reader-layout aside,.document-preview-text,.document-category-row,.document-subcategory-row td,.enforcement-card,.knowledge-topic-card,.criminal-deadline-card,.collection-case-summary,.tender-file-icon,.tender-status,.domain-chip.unclassified,.list-item.is-completed) { background: var(--surface-soft); border-color: var(--line); }
html[data-theme]:not([data-theme="classic"]) :is(.search-result:hover,.search-result:focus-visible,.queue-item:hover,.tender-menu .button:hover,.tender-more[open]>summary,.tender-view-tabs button.active,.tender-connect-icon,.stage-choice:has(input:checked)) { background: var(--green-soft); color: var(--green-deep); }
html[data-theme]:not([data-theme="classic"]) :is(th,td,.list-item,.queue-item,.collection-candidate,.collection-task,.federation-peer,.federation-scope,.active-filter-note) { border-color: var(--line); }
html[data-theme]:not([data-theme="classic"]) :is(.criminal-deadline-date,.collection-times summary,.tender-connect-icon,.knowledge-upload-progress .upload-success small) { color: var(--green-deep); }
html[data-theme]:not([data-theme="classic"]) .knowledge-upload-progress .upload-failed small { color: var(--danger); }
html[data-theme]:not([data-theme="classic"]) :is(.knowledge-upload-progress progress,.federation-peer progress) { accent-color: var(--green); }
html[data-theme]:not([data-theme="classic"]) .tender-file-icon { color: var(--muted); }
html[data-theme]:not([data-theme="classic"]) .knowledge-home-hero { color: var(--hero-ink); background: var(--hero-bg); border: 1px solid var(--line); border-radius: var(--card-radius); box-shadow: var(--shadow); }
html[data-theme]:not([data-theme="classic"]) .knowledge-home-hero :is(p,.knowledge-home-stat span) { color: var(--hero-muted); }
html[data-theme]:not([data-theme="classic"]) .login-shell { background: var(--page-glow),var(--paper); }
html[data-theme]:not([data-theme="classic"]) :is(.case-card,.consultant-card,.library-portal-card,.stat-link):hover { border-color: var(--green); box-shadow: var(--shadow); }
html[data-theme]:not([data-theme="classic"]) .library-portal-card > * { position: relative; z-index: 1; }
html[data-theme]:not([data-theme="classic"]) .library-portal-card::after { pointer-events: none; }
html[data-theme]:not([data-theme="classic"]) :is(.search-result mark,.reader-layout mark) { color: #483410; background: #ffe08a; }
html[data-theme="business"] :is(.topbar h1,.section-head h2,.page-actions h2,.library-portal-card strong) { font-family: inherit; }
html[data-theme="business"] .stat-card::after { border-radius: 14px; transform: rotate(35deg); background: linear-gradient(135deg,#d5e8ff,#edf5ff); }
html[data-theme="business"] .library-portal-card::after { border-radius: 20px; transform: rotate(32deg); }
html[data-theme="business"] .library-portal-card { --portal: #245e9e; --portal-soft: #e4effb; }
html[data-theme="business"] .library-portal-card:nth-child(2n) { --portal: #376c8f; --portal-soft: #e6f2f8; }
html[data-theme="warm"] .sidebar nav :is(button:hover,button.active) { background: #ffffff99; }
html[data-theme="warm"] .sidebar nav button span { background: #ffffff70; }
html[data-theme="warm"] .privacy-note { border-color: #d3c4c8; background: #f8f5f14d; }
html[data-theme="warm"] .brand-mark { border-radius: 50%; box-shadow: 4px 4px 0 #dcd3bc; }
html[data-theme="warm"] .stat-card::after { background: linear-gradient(145deg,#e6d9df,#e6dfcf); width: 90px; height: 90px; }
html[data-theme="warm"] .library-portal-card { --portal: #8b5365; --portal-soft: #ece2e5; }
html[data-theme="warm"] .library-portal-card:nth-child(2n) { --portal: #80673f; --portal-soft: #eae4d7; }
html[data-theme="warm"] .knowledge-home-stat { border-color: #c9b9bc; background: #f8f5f159; }
/* Reference palettes: muted large surfaces, stronger colors confined to small accents. */
html[data-theme="mist"] .sidebar nav :is(button:hover,button.active),
html[data-theme="sand"] .sidebar nav :is(button:hover,button.active) { background: #f8f9f880; }
html[data-theme="mist"] .sidebar nav button span,
html[data-theme="sand"] .sidebar nav button span { background: #f8f9f860; }
html[data-theme="mist"] .privacy-note,
html[data-theme="sand"] .privacy-note { background: #f8f9f840; border-color: var(--line); }
html[data-theme="mist"] .library-portal-card { --portal: #496982; --portal-soft: #e0e8ee; }
html[data-theme="mist"] .library-portal-card:nth-child(2n) { --portal: #885c69; --portal-soft: #ece0e4; }
html[data-theme="mist"] .stat-card::after { background: transparent; border: 14px solid #dce5ed; width: 98px; height: 98px; }
html[data-theme="mist"] .library-portal-card::after { background: transparent; border: 22px solid var(--portal-soft); }
html[data-theme="sage"] .library-portal-card { --portal: #356762; --portal-soft: #dce8e2; }
html[data-theme="sage"] .library-portal-card:nth-child(2n) { --portal: #6a7150; --portal-soft: #e5e7d8; }
html[data-theme="sage"] :is(.stat-card,.library-portal-card)::after { border-radius: 80% 0 80% 0; background: #dde7de; transform: rotate(-18deg); }
html[data-theme="sage"] .library-portal-icon { border-radius: 16px 5px 16px 5px; }
html[data-theme="sand"] .library-portal-card { --portal: #245e72; --portal-soft: #dce5e7; }
html[data-theme="sand"] .library-portal-card:nth-child(2n) { --portal: #796352; --portal-soft: #e7e1d8; }
html[data-theme="sand"] :is(.stat-card,.library-portal-card)::after { right: 16px; bottom: 0; height: 3px; width: 48px; border-radius: 0; background: #6592a0; }
html[data-theme="sand"] .library-portal-icon { border-radius: 6px; }
html[data-theme="sand"] :is(.topbar h1,.section-head h2,.library-portal-card strong) { font-family: inherit; }
html[data-theme="navy"] .library-portal-card { --portal: #234c68; --portal-soft: #dde5eb; }
html[data-theme="navy"] .library-portal-card:nth-child(2n) { --portal: #874741; --portal-soft: #e9dddb; }
html[data-theme="navy"] :is(.stat-card,.library-portal-card)::after { right: 14px; bottom: -12px; width: 60px; height: 60px; border: 1px solid #8e606050; border-radius: 4px; background: transparent; box-shadow: 6px -6px 0 #e7dddd; transform: rotate(-8deg); }
html:is([data-theme="mist"],[data-theme="sage"],[data-theme="sand"]) .knowledge-home-stat { border-color: var(--line); background: #f8f9f640; }
html[data-theme="black"] :is(.topbar h1,.page-actions h2,.section-head h2,.library-portal-card strong,.case-card h3,.consultant-card h3) { font-family: inherit; }
html[data-theme="black"] .stat-card::after { right: 0; bottom: 0; width: 60%; height: 3px; border-radius: 0; background: linear-gradient(90deg,transparent,#9da9bb); }
html[data-theme="black"] .library-portal-card { --portal: #c4cfdf; --portal-soft: #343c4b; }
html[data-theme="black"] .library-portal-card:nth-child(2n) { --portal: #d6c29e; --portal-soft: #3c3832; }
html[data-theme="black"] .library-portal-icon { color: #202630; border-radius: 6px; }
html[data-theme="black"] .library-portal-card::after { width: 120px; height: 2px; right: 0; bottom: 0; border-radius: 0; }
html[data-theme="black"] :is(.button,.case-card,.consultant-card,.stat-link,.library-portal-card):hover { transform: none; }
html[data-theme="black"] .tender-status.ready { color: #a7ddbd; background: #273e32; }
html[data-theme="black"] .brand-mark { border-radius: 5px; box-shadow: 4px 4px 0 #555e6a; }
html[data-theme]:not([data-theme="classic"]) .document-category-row td { background: var(--surface-soft); border-color: var(--line); }
html[data-theme]:not([data-theme="classic"]) .duplicate-fact { background: var(--hint-bg); border-color: var(--line); }
html[data-theme]:not([data-theme="classic"]) .version-tag { color: var(--green-deep); }
html[data-theme]:not([data-theme="classic"]) #toast .toast-action { color: var(--on-accent); border-color: currentColor; }
html[data-theme]:not([data-theme="classic"]) #toast.error .toast-action { color: #fff; }
html[data-theme]:not([data-theme="classic"]) .sidebar .nav-btn { color: var(--sidebar-muted); }
html[data-theme]:not([data-theme="classic"]) .sidebar .nav-btn:hover { color: var(--sidebar-ink); }
/* The switcher is self-contained, including on the separate camera and login pages. */
.theme-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--theme-line); border-radius: var(--control-radius,9px); color: var(--theme-ink); background: var(--theme-surface); font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; cursor: pointer; }
.theme-trigger svg { flex: 0 0 auto; color: var(--theme-accent); }
.theme-trigger:hover { border-color: var(--theme-accent); background: var(--theme-soft); }
.theme-trigger-login { margin-top: 24px; width: 100%; }
.user-menu { flex-wrap: wrap; justify-content: flex-end; }
.user-menu > button { white-space: nowrap; }
.topbar .global-search { min-width: 160px; }
.theme-dialog { box-sizing: border-box; width: min(1120px,calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--theme-line); border-radius: 22px; color: var(--theme-ink); background: var(--theme-surface); box-shadow: var(--theme-shadow); font-family: "Microsoft YaHei","PingFang SC",sans-serif; overflow: hidden; }
.theme-dialog[open] { display: flex; flex-direction: column; }
.theme-dialog::backdrop { background: #101c2c80; backdrop-filter: blur(5px); }
.theme-heading { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 28px 20px; }
.theme-heading h2 { margin: 6px 0 9px; font-size: 24px; line-height: 1.5; }
.theme-eyebrow { margin: 0; font-size: 10px; letter-spacing: .17em; font-weight: 800; color: var(--theme-accent); }
#theme-description { margin: 0; font-size: 13px; color: var(--theme-muted); line-height: 1.7; }
.theme-close { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 1px solid var(--theme-line); border-radius: 50%; font: 24px/1 sans-serif; color: var(--theme-ink); background: var(--theme-surface); cursor: pointer; }
.theme-options-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.theme-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; border: 0; margin: 0; padding: 4px 28px 22px; min-width: 0; }
.theme-option { display: flex; flex-direction: column; position: relative; gap: 0; min-width: 0; padding: 12px; border: 2px solid var(--theme-line); border-radius: 15px; background: var(--theme-surface); color: var(--theme-ink); cursor: pointer; font-weight: 400; transition: border-color .18s,box-shadow .18s; }
.theme-option:has(input:checked) { border-color: var(--theme-accent); box-shadow: 0 0 0 2px var(--theme-soft); }
.theme-option:has(input:focus-visible) { outline: 3px solid var(--theme-accent); outline-offset: 3px; }
.theme-option input,.theme-sr-only { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; clip: rect(0,0,0,0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.theme-option-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 13px 2px 5px; font-size: 15px; }
.theme-option-description { font-size: 12px; line-height: 1.7; color: var(--theme-muted); margin: 0 2px; }
.theme-option-effect { font-size: 11px; color: var(--theme-accent); margin: 9px 2px 2px; }
.theme-check { visibility: hidden; display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 auto; border-radius: 50%; color: var(--theme-on-accent); background: var(--theme-accent); }
.theme-option:has(input:checked) .theme-check { visibility: visible; }
.theme-mini { display: flex; flex: 0 0 auto; gap: 10px; height: 86px; overflow: hidden; border: 1px solid #0000000c; border-radius: 8px; background: var(--mini-bg); }
.theme-mini-nav { display: flex; flex-direction: column; gap: 8px; width: 21%; flex: 0 0 21%; padding: 13px 9px; background: var(--mini-nav); }
.theme-mini-nav i { height: 5px; border-radius: 3px; background: var(--mini-nav-line,#ffffff80); }
.theme-mini-nav i:first-child { height: 13px; width: 15px; margin-bottom: 8px; background: var(--mini-accent); border-radius: var(--mini-radius,4px); }
.theme-mini-work { flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 12px 10px 12px 0; }
.theme-mini-bar { width: 43%; height: 5px; border-radius: 2px; background: var(--mini-accent); }
.theme-mini-hero { height: 30px; border-radius: var(--mini-radius,5px); background: var(--mini-hero); }
.theme-mini-grid { display: flex; gap: 6px; flex: 1; }
.theme-mini-grid i { flex: 1; border-radius: var(--mini-radius,5px); background: var(--mini-card); box-shadow: var(--mini-shadow,0 2px 5px #0000000a); border: 1px solid var(--mini-line,transparent); }
[data-preview="classic"] { --mini-bg: #eef3f4; --mini-nav: #123f45; --mini-accent: #0f766e; --mini-hero: linear-gradient(120deg,#17574f,#a9863d); --mini-card: #fff; }
[data-preview="business"] { --mini-bg: #e8f1fc; --mini-nav: #123458; --mini-accent: #4587cb; --mini-hero: linear-gradient(120deg,#204b7a,#6fa3d3); --mini-card: #fff; --mini-radius: 3px; --mini-shadow: 2px 3px 0 #cbdcf0; }
[data-preview="warm"] { --mini-bg: #f2eee9; --mini-nav: #e9dfe0; --mini-accent: #8b5365; --mini-nav-line: #705a6380; --mini-hero: linear-gradient(120deg,#eadfe2,#e9e3d4); --mini-card: #f8f5f1; --mini-radius: 10px; --mini-shadow: 0 2px 5px #67545612; }
[data-preview="black"] { --mini-bg: #191b20; --mini-nav: #101115; --mini-accent: #cbd3df; --mini-hero: linear-gradient(120deg,#343b48,#48484a); --mini-card: #282c34; --mini-radius: 2px; --mini-line: #4a505b; }
[data-preview="mist"] { --mini-bg: #edf0f3; --mini-nav: #d8e3ec; --mini-accent: #496982; --mini-nav-line: #52687b80; --mini-hero: linear-gradient(120deg,#dbe5ec,#eadfe3); --mini-card: #f8fafb; --mini-radius: 8px; }
[data-preview="sage"] { --mini-bg: #e9efeb; --mini-nav: #284a49; --mini-accent: #8bb4a4; --mini-hero: linear-gradient(120deg,#d8e4df,#e2e5d9); --mini-card: #f6f9f6; --mini-radius: 8px 2px 8px 2px; }
[data-preview="sand"] { --mini-bg: #eeece7; --mini-nav: #e0d8d0; --mini-accent: #245e72; --mini-nav-line: #665d5580; --mini-hero: linear-gradient(120deg,#ded8cf,#d9e4e5); --mini-card: #f8f7f3; --mini-radius: 2px; --mini-shadow: 0 2px 0 #6592a080; }
[data-preview="navy"] { --mini-bg: #e9edf0; --mini-nav: #142c40; --mini-accent: #b98c84; --mini-hero: linear-gradient(120deg,#18394f,#25495b); --mini-card: #f7f8f8; --mini-radius: 3px; --mini-shadow: 0 2px 0 #cbd4db; }
.theme-footer { display: flex; flex: 0 0 auto; align-items: center; flex-wrap: wrap; gap: 10px; padding: 17px 28px 22px; border-top: 1px solid var(--theme-line); }
.theme-footer p { flex: 1 1 100%; margin: 0 0 7px; font-size: 12px; color: var(--theme-muted); line-height: 1.7; }
.theme-footer button { padding: 9px 15px; font: inherit; font-size: 13px; border: 1px solid var(--theme-line); border-radius: 9px; background: var(--theme-surface); color: var(--theme-ink); cursor: pointer; }
.theme-footer .theme-done { margin-left: auto; background: var(--theme-accent); color: var(--theme-on-accent); border-color: var(--theme-accent); }
.theme-dialog button:focus-visible,.theme-trigger:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 3px; }
/* The separate case-camera authorization page follows the same saved palette. */
.theme-camera header { flex-wrap: wrap; }
html[data-theme]:not([data-theme="classic"]) .theme-camera :is(#workspace,button,input) { background: var(--surface); color: var(--ink); border-color: var(--line); }
html[data-theme]:not([data-theme="classic"]) .theme-camera :is(header,.intro p:not(.eyebrow),.case-row small,.grant p) { color: var(--muted); }
html[data-theme]:not([data-theme="classic"]) .theme-camera a { color: var(--green-deep); }
html[data-theme]:not([data-theme="classic"]) .theme-camera .result { background: var(--surface-soft); }
html[data-theme]:not([data-theme="classic"]) .theme-camera :is(.cases,.case-row,.grant) { border-color: var(--line); }
html[data-theme]:not([data-theme="classic"]) .theme-camera .primary { color: var(--on-accent); background: var(--green); }
html[data-theme]:not([data-theme="classic"]) .theme-camera #error { color: var(--danger); background: var(--danger-soft); }
@media (max-width:1200px) and (min-width:761px) { .topbar { flex-wrap: wrap; }.topbar .user-menu { margin-left: auto; }.topbar .global-search { flex: 1; } }
@media (max-width:760px) { .topbar .user-menu { flex-wrap: wrap; gap: 8px; }.theme-trigger { padding: 8px 10px; font-size: 12px; } }
@media (max-width:960px) { .theme-options { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { .theme-heading { padding: 20px 18px 16px; }.theme-heading h2 { font-size: 20px; }.theme-options { padding: 0 18px 20px; gap: 12px; grid-template-columns: 1fr; }.theme-option { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 4px 12px; padding: 12px; }.theme-mini { grid-row: 1 / 4; height: 100%; min-height: 96px; gap: 5px; }.theme-mini-nav { padding: 12px 4px; }.theme-mini-work { padding-right: 5px; gap: 7px; }.theme-option-title { margin: 0; font-size: 14px; gap: 4px; }.theme-option-description { font-size: 11px; margin: 0; }.theme-option-effect { font-size: 10px; margin: 2px 0 0; }.theme-footer { padding: 16px 18px 20px; }.theme-check { width: 18px; height: 18px; }.theme-mini-grid { gap: 3px; } }
@media (prefers-reduced-motion:reduce) { .theme-option { transition: none; }html[data-theme] :is(.button,.case-card,.consultant-card,.library-portal-card,.stat-link):hover { transform: none; } }
@media (max-height:600px) { .theme-heading { padding-top: 14px; padding-bottom: 10px; }.theme-heading h2 { font-size: 18px; margin: 3px 0; }.theme-footer { padding-top: 9px; padding-bottom: 10px; }.theme-footer p { margin-bottom: 0; }.theme-eyebrow { display: none; } }
@media (max-height:600px) and (min-width:561px) { .theme-option { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 3px 10px; }.theme-mini { grid-row: 1 / 4; height: 100%; min-height: 72px; gap: 4px; }.theme-mini-nav { padding: 9px 4px; }.theme-mini-work { padding-right: 5px; gap: 5px; }.theme-mini-grid { gap: 3px; }.theme-option-title { margin: 0; font-size: 13px; }.theme-option-description { font-size: 11px; }.theme-option-effect { font-size: 10px; margin-top: 2px; } }
