/* CA Automat: the one stylesheet.
   Order: tokens, base, layout, components, pages, calendar, portal, sign-in, motion.
   Light by default; dark when <html data-theme="dark">. No images, fonts or files from elsewhere. */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --text: #121826;
  --muted: #5a6475;
  --border: #e3e8ef;
  --border-strong: #c9d1dc;
  --accent: #1f4fbf;
  --accent-hover: #183e98;
  --accent-soft: #e9f0fd;
  --accent-fill: #1f4fbf;
  --on-accent: #ffffff;
  --good: #157347;
  --good-bg: #e5f4ec;
  --warn: #965a00;
  --warn-bg: #fdf2dc;
  --bad: #b3261e;
  --bad-bg: #fcebe9;
  --danger: #b3261e;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --cal-idle: #7a8291;
  --cal-waiting: #b47a00;
  --cal-ready: #2f5fd0;
  --cal-filed: #22805a;
  --cal-late: #c63d2f;
  --cal-line: #e3e8ef;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --side-w: 232px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1218;
  --surface: #171b23;
  --surface-2: #1f242e;
  --text: #e8ebf0;
  --muted: #9ba4b4;
  --border: #2a303c;
  --border-strong: #3c4453;
  --accent: #93b4ff;
  --accent-hover: #b4cbff;
  --accent-soft: #1b2742;
  --accent-fill: #3763d8;
  --on-accent: #ffffff;
  --good: #7fcaa3;
  --good-bg: #1b2e25;
  --warn: #e2b662;
  --warn-bg: #322810;
  --bad: #f09a8e;
  --bad-bg: #391f1b;
  --danger: #f09a8e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --cal-idle: #8d909a;
  --cal-waiting: #d9a53a;
  --cal-ready: #8fb0ff;
  --cal-filed: #6fbf95;
  --cal-late: #e8776a;
  --cal-line: #2a303c;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.3; }
h1 { font-size: 22px; letter-spacing: -.015em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; margin: 18px 0 6px; }
p { margin: 0 0 10px; }
ul, ol { margin: 0 0 10px; padding-left: 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12.5px var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
s { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ok { color: var(--good); }
.error { color: var(--bad); }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -48px; z-index: 50; padding: 8px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.skip:focus { top: 8px; }
ul.plain { margin: 0 0 8px; padding-left: 18px; }
.reasons { margin: 4px 0; padding-left: 18px; }
details > summary { cursor: pointer; }
details[open] > summary { margin-bottom: 10px; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.bare:disabled { opacity: .75; }

/* ---------- 3. Layout: sidebar and content ---------- */
.demo-banner { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--border); font-size: 13px; text-align: center; padding: 6px 16px; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--surface) calc(var(--side-w) - 1px), var(--border) 0 var(--side-w), transparent 0); }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; padding: 16px 12px 12px;
  background: var(--surface); border-right: 1px solid var(--border);
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { flex: none; }
.brand-mark .ring { fill: var(--accent-fill); }
.brand-mark .tick { fill: none; stroke: var(--on-accent); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label { padding: 0 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius); color: var(--muted); font-weight: 500; }
.nav svg, .theme-toggle svg, .menu-btn svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav.active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-fill); }
.side-foot { border-top: 1px solid var(--border); padding: 12px 8px 0; display: grid; gap: 8px; font-size: 13px; }
.who { display: grid; min-width: 0; }
.who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; margin-left: -8px; border: 0; background: none; color: var(--muted); font-size: 13px; min-height: 0; }
.theme-toggle:hover { color: var(--text); background: var(--surface-2); border: 0; }
.theme-toggle .to-light, :root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline-flex; align-items: center; gap: 6px; }
.theme-toggle .to-dark { display: inline-flex; align-items: center; gap: 6px; }
html:not(.js) .theme-toggle { display: none; }
.main { min-width: 0; }
.page { max-width: 1320px; margin: 0 auto; padding: 28px 36px 56px; }
.page > * + * { margin-top: 20px; }
.page > script, .page > .page-busy { margin: 0; }

/* Pages with nobody signed in (invite link, errors): brand bar and a centred card. */
.bare-top { display: flex; align-items: center; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.narrow, .welcome-card { max-width: 460px; margin-left: auto; margin-right: auto; }
.narrow { margin-top: 40px; }
.welcome-card { margin-top: 40px; }
.narrow h1, .welcome-card h1 { margin-bottom: 8px; }

@media (max-width: 900px) {
  .shell { display: block; background: none; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; max-height: 100vh; padding: 10px 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side-top { padding: 0 4px; }
  .js .menu-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; }
  .js .sidebar:not(.open) .side-nav, .js .sidebar:not(.open) .side-foot { display: none; }
  .nav { padding: 10px 8px; }
  .page { padding: 16px 16px 40px; }
}

/* ---------- 4. Components ---------- */

/* Page header: title, one line under it, actions on the right. */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.page-head-main { min-width: 0; flex: 1 1 320px; }
.page-head h1 { overflow-wrap: anywhere; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); max-width: 78ch; }
.crumb { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.page-actions, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Columns: main object plus a side column. */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cols.wide-side { grid-template-columns: minmax(0, 1fr) 380px; }
.col { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 1180px) { .cols, .cols.wide-side { grid-template-columns: minmax(0, 1fr); } }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child, .card > details > summary + * { margin-top: 0; }
.card > h2 { margin-bottom: 10px; }
.card h2 + h2, .card p + h2, .card table + h2, .card .table-wrap + h2, .card details + h2, .card ul + h2, .card form + h2 { margin-top: 22px; margin-bottom: 8px; }
.muted-card { opacity: .72; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.head-row h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) { .card { padding: 14px; } }

/* Buttons */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px; font: 500 14px/1.2 var(--font);
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s ease, border-color .12s ease;
}
button:hover, .button:hover { background: var(--surface-2); text-decoration: none; }
button:disabled { cursor: default; opacity: .7; }
button.primary, .button.primary, a.button:not(.ghost):not(.small) { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
button.primary:hover, .button.primary:hover, a.button:not(.ghost):not(.small):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
:root[data-theme="dark"] button.primary:hover, :root[data-theme="dark"] .button.primary:hover, :root[data-theme="dark"] a.button:not(.ghost):not(.small):hover { background: #4a74e6; border-color: #4a74e6; }
button.small, .button.small { min-height: 28px; padding: 3px 10px; font-size: 13px; }
button.quiet, .button.ghost { background: transparent; }
button.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.danger:hover { background: var(--bad-bg); }
button.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 400; }
button.link:hover { background: none; text-decoration: underline; }
form.inline { display: inline; }
a > button { pointer-events: none; }

/* Form fields: label above, help and error text under. */
label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 4px; }
label .muted { font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 34px; padding: 6px 10px; font: 14px/1.4 var(--font);
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
textarea { line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[readonly] { background: var(--surface-2); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--accent-fill); }
input[type=file] { padding: 5px; font-size: 13px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 4px 10px; font: 500 13px var(--font); color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 4px; cursor: pointer; }
.field { min-width: 0; }
.field p.small, .help { margin: 4px 0 0; font-size: 13px; }
.form-grid, .upload { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .wide, .upload .wide { grid-column: 1 / -1; }
.col-side .upload, .upload.one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 600px) { .form-grid, .upload { grid-template-columns: minmax(0, 1fr); } }
label.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; font-weight: 400; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; white-space: nowrap; }
form.stack { display: grid; gap: 12px; max-width: 460px; }
form.stack label { display: grid; gap: 4px; margin: 0; }
form.stack label:has(> input[type=checkbox]) { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; }
form.stack button { justify-self: start; }
.reason-form, .copy-row, .mark-form, .link-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reason-form, .copy-row { margin-top: 12px; }
.link-form { margin-top: 6px; }
.reason-form input:not([type=date]), .copy-row input, .mark-form input:not([type=checkbox]) { flex: 1 1 200px; width: auto; }
.reason-form input[type=date] { width: auto; }
.mark-form select, .link-form select { width: auto; max-width: 100%; flex: 0 1 auto; }
.link-box { width: min(100%, 640px); font: 13px var(--mono); }
.month-pick { display: flex; align-items: center; gap: 8px; }
.month-pick select { width: auto; }
.form-end { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Data table */
.table-wrap { margin: 0 -20px; overflow-x: auto; }
.card > .table-wrap:last-child { margin-bottom: -6px; }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.4; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap table.list th:first-child, .table-wrap table.list td:first-child { padding-left: 20px; }
.table-wrap table.list th:last-child, .table-wrap table.list td:last-child { padding-right: 20px; }
table.list thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; border-bottom-color: var(--border-strong);
}
table.list tbody tr:last-child > td, table.list tbody tr:last-child > th { border-bottom: 0; }
table.list tbody tr:hover > td { background: var(--surface-2); }
table.list th.r, table.list td.r { text-align: right; }
table.list td .meta, .meta { display: block; color: var(--muted); font-size: 12px; }
table.list tr.muted td { color: var(--muted); }
table.facts th { width: 38%; max-width: 240px; font-weight: 400; color: var(--muted); }
table.facts tr:hover > td, table.facts tr:hover > th { background: none; }
table.facts td input { max-width: 320px; }
table.checklist td { vertical-align: middle; }
.row-actions { white-space: nowrap; }
.row-actions form + form { margin-left: 10px; }
@media (max-width: 900px) {
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap table.list { min-width: 560px; }
  .table-wrap table.facts, .table-wrap table.compact { min-width: 0; }
}
@media (max-width: 600px) {
  .table-wrap { margin: 0 -14px; }
  .table-wrap table.list th:first-child, .table-wrap table.list td:first-child { padding-left: 14px; }
  .table-wrap table.list th:last-child, .table-wrap table.list td:last-child { padding-right: 14px; }
}

/* Status badge: a dot and a word. */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; color: var(--text); }
.chip::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.chip.good, .chip.ok { color: var(--good); background: var(--good-bg); } .chip.good::before, .chip.ok::before { background: var(--good); }
.chip.warn { color: var(--warn); background: var(--warn-bg); } .chip.warn::before { background: var(--warn); }
.chip.bad { color: var(--bad); background: var(--bad-bg); } .chip.bad::before { background: var(--bad); }
.chip.busy { color: var(--accent); background: var(--accent-soft); } .chip.busy::before { background: var(--accent); }
.chip:has(.chip-tick)::before { display: none; }
.chip-row { display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 0 0 12px; }

/* Progress meter */
span.progress { display: block; width: 120px; max-width: 100%; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--border); overflow: hidden; }
span.progress.wide { width: 100%; margin-top: 10px; }
span.progress > span { display: block; height: 100%; background: var(--accent-fill); transition: width .6s ease-out; }
span.progress.good > span { background: var(--good); }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); min-width: 0; }
a.tile:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.tile.attn { border-top: 3px solid var(--bad); padding-top: 14px; }
.tile.attn.soft { border-top-color: var(--warn); }
.tile .cap { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile .num { font-size: 30px; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; }
.tile .num small { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.tile .ctx { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Segmented control and tabs */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; font-size: 13px; background: var(--surface); }
.seg > a, .seg > strong { padding: 4px 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.seg > * + * { border-left: 1px solid var(--border-strong); }
.seg > a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.seg > strong { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); }
nav.tabs .tab { padding: 8px 12px; margin-bottom: -1px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs .tab:hover { color: var(--text); text-decoration: none; }
nav.tabs .tab.on { color: var(--accent); border-bottom-color: var(--accent); }

/* Filter bar and pagination */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; margin: 0; flex: 1 1 140px; min-width: 130px; color: var(--muted); }
.filter-bar label.grow { flex: 2 1 220px; }
.filter-bar label.check { flex: 0 0 auto; min-width: 0; flex-direction: row; align-items: center; gap: 6px; min-height: 34px; margin: 0; color: var(--text); }
.filter-bar a.small { align-self: center; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 14px; font-size: 13px; }
@media (max-width: 600px) { .filter-bar label { flex: 1 1 100%; } }

/* Alert banners */
.alert { padding: 10px 14px; border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: var(--radius); background: var(--surface); }
.alert > :last-child { margin-bottom: 0; }
.alert p { margin: 0 0 6px; }
.alert.info { border-left-color: var(--accent); background: var(--accent-soft); }
.alert.ok { border-left-color: var(--good); background: var(--good-bg); }
.alert.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.alert.problem { border-left-color: var(--bad); background: var(--bad-bg); }
.alert + .alert { margin-top: 8px; }
.alert .ok, .alert .error { color: var(--text); }
.demo-hint { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); font-size: 13px; }

/* Empty state */
.empty { margin: 0; padding: 20px 16px; text-align: center; color: var(--muted); background: var(--surface-2); border-radius: var(--radius); }

/* Steps of one file (document page) */
ol.progress { list-style: none; padding: 0; margin: 0; }
ol.progress .step { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 10px; padding-bottom: 12px; }
ol.progress .step:last-child { padding-bottom: 0; }
ol.progress .step:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1px; background: var(--border-strong); }
ol.progress .mark { grid-row: 1 / span 3; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; line-height: 1; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-strong); }
ol.progress .name { font-weight: 600; font-size: 13px; }
ol.progress .what, ol.progress .when { grid-column: 2; font-size: 13px; }
ol.progress .done .mark { background: var(--good-bg); color: var(--good); border-color: var(--good); }
ol.progress .waiting .mark { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
ol.progress .problem .mark { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
ol.progress .problem .what { color: var(--bad); }
ol.progress .todo .name, ol.progress .skipped .name { color: var(--muted); font-weight: 500; }

/* ---------- 5. Page-specific ---------- */
.refreshing { display: flex; align-items: center; gap: 8px; margin: 0; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: dot 1.2s ease-in-out infinite; }
.due-cell { white-space: nowrap; }
table.compact td { padding-top: 7px; padding-bottom: 7px; }
table.compact td:first-child a { font-weight: 500; overflow-wrap: anywhere; }
.card-foot { margin: 12px 0 0; font-size: 13px; }
pre.reminder-text { white-space: pre-wrap; font: inherit; margin: 6px 0 0; }
.reminder-form { display: grid; gap: 12px; }
.checklist-index { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 0; }
.checklist-index li { display: inline-flex; align-items: center; gap: 8px; }
.add-doc { margin-top: 12px; }
.service-settings { margin-top: 14px; font-size: 13px; }
ol.steps { padding-left: 20px; }
ol.steps li { margin-bottom: 4px; }
details.mark summary { color: var(--accent); font-size: 13px; }
ul.checklist-plain { list-style: none; padding: 0; margin: 0; }
ul.checklist-plain li { padding: 12px 0; border-bottom: 1px solid var(--border); }
ul.checklist-plain li:last-child { border-bottom: 0; }

/* ---------- 6. Calendar ---------- */
.page-busy { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: 4px 16px; text-align: center; font-size: 13px; background: var(--accent-fill); color: var(--on-accent); }
.cal-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.cal-scroll { overflow-x: auto; padding: 0; }
.cal-scroll > p { padding: 12px 20px; }
.cal-grid { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; }
.cal-grid th { padding: 8px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; text-align: left; color: var(--muted); border-bottom: 1px solid var(--cal-line); }
.cal-day { vertical-align: top; height: 96px; padding: 4px; border: 1px solid var(--cal-line); }
.cal-grid tr > :first-child { border-left: 0; } .cal-grid tr > :last-child { border-right: 0; }
.cal-grid tbody tr:last-child > td { border-bottom: 0; }
.cal-day.out { background: var(--surface-2); color: var(--muted); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-date { display: block; padding: 0 2px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cal-day.today .cal-date { color: var(--accent); font-weight: 700; }
.cal-chip { display: block; margin-bottom: 2px; padding: 1px 6px; border-radius: 3px; font-size: 11.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--cal-idle); }
a.cal-chip:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--border-strong); }
.cal-legend .cal-chip { display: inline-block; margin: 0; }
.cal-chip.waiting { background: var(--warn-bg); border-left-color: var(--cal-waiting); }
.cal-chip.ready { background: var(--accent-soft); border-left-color: var(--cal-ready); }
.cal-chip.filed { background: var(--good-bg); border-left-color: var(--cal-filed); }
.cal-chip.late { background: var(--bad-bg); border-left-color: var(--cal-late); }
.cal-chip.custom { background: transparent; border: 1px dashed var(--border-strong); }
.cal-chip.kind-due { font-weight: 600; }
.cal-chip.kind-chase_open { border-left-style: dotted; }
.cal-more { display: block; padding: 0 2px; font-size: 11.5px; }
.agenda-day { padding: 10px 0; border-bottom: 1px solid var(--cal-line); }
.agenda-day:first-child { padding-top: 0; } .agenda-day:last-child { border-bottom: 0; padding-bottom: 0; }
.agenda-day h3 { margin: 0 0 6px; font-size: 13px; }
.agenda-day.today h3 { color: var(--accent); }
.agenda-day ul { list-style: none; padding: 0; margin: 0; }
.agenda-day li { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.agenda-day .cal-chip { margin: 0; max-width: 100%; }
.band-scroll { overflow-x: auto; }
.bands { min-width: 560px; }
.band-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; padding: 4px 0; color: var(--text); font-size: 12.5px; }
.band-row:hover { text-decoration: none; background: var(--surface-2); }
.band-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-track { display: grid; grid-template-columns: repeat(var(--days), 1fr); height: 6px; background: var(--surface-2); border-radius: 3px; }
.band { display: block; height: 6px; border-radius: 3px; background: var(--cal-idle); }
.band.waiting { background: var(--cal-waiting); }
.band.late { background: var(--cal-late); }
@media (max-width: 600px) { .cal-day { height: 76px; } }

/* ---------- 7. Client upload portal (phones; always light) ---------- */
body.portal { font-size: 16px; }
.portal-top { padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-top .brand { font-size: 16px; }
.portal .page { max-width: 640px; padding: 16px 16px 48px; }
.portal h1 { font-size: 22px; }
.portal h2 { font-size: 17px; }
.portal .card { padding: 18px 16px; }
.portal label { font-size: 15px; margin-bottom: 6px; }
.portal input, .portal select { min-height: 48px; font-size: 16px; padding: 10px 12px; }
.portal input[type=file] { padding: 8px; }
.portal input[type=file]::file-selector-button { padding: 8px 14px; font-size: 15px; }
.portal button { min-height: 48px; font-size: 16px; padding: 10px 20px; }
.portal button.primary { width: 100%; }
.portal .upload { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.portal .chip { font-size: 14px; }
.portal .small { font-size: 14px; }
.portal ul.checklist-plain li { display: grid; gap: 2px; padding: 14px 0; }
.portal .item-name { font-weight: 600; }
.portal .head-row { margin-bottom: 4px; }
.portal .narrow { margin-top: 24px; }

/* ---------- 8. Sign-in (the page itself is in signin.css) ---------- */
.field-icon { position: relative; }
.field-icon input { padding-right: 44px; }
.reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--muted); }
.reveal svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
button.primary .spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
button.primary.loading { cursor: progress; }
button.primary.loading .spinner { display: inline-block; }

/* ---------- 9. Motion: short, and only on content that is already right ---------- */
@keyframes new-row { from { background: var(--accent-soft); } to { background: transparent; } }
@keyframes dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes flip { from { transform: rotateX(90deg); } to { transform: none; } }
@keyframes slide-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
tr.is-new > td, tr.changed > td, li.is-new, li.changed { animation: new-row 2.4s ease-out; }
tr.changed .chip, li.changed .chip { animation: flip .4s ease-out; }
.chip.busy::before { animation: dot 1.2s ease-in-out infinite; }
.chip-tick { width: 11px; height: 11px; }
.chip-tick path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 14; stroke-dashoffset: 14; animation: draw .4s ease-out .3s forwards; }
.slide-in { animation: slide-in .25s ease-out; }
.notice.leaving, p.leaving { overflow: hidden; transition: height .35s ease, opacity .35s ease, padding .35s ease, margin .35s ease; height: 0 !important; opacity: 0; padding-top: 0; padding-bottom: 0; margin: 0; }
tr.leaving td { transition: transform .22s ease-in, opacity .22s ease-in; transform: translateX(24px); opacity: 0; }

/* Upload button becomes a progress bar (motion.js). */
button.uploading { flex-direction: column; align-items: stretch; gap: 4px; min-width: 200px; cursor: progress; opacity: 1; }
button.uploading .bar { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
button.uploading .bar > span { display: block; height: 100%; width: 0; background: #fff; transition: width .2s linear; }
button.uploading.done { background: var(--good); border-color: var(--good); color: #fff; }
:root[data-theme="dark"] button.uploading.done { background: #2a7d53; border-color: #2a7d53; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chip-tick path { stroke-dashoffset: 0; }
}
main:focus { outline: none; }

/* ---------- Dashboard (2026-11-11 redesign) ---------- */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin-bottom: 2px; }
.card-head p { margin: 0; }
.card.flush { padding-bottom: 0; }
.card.flush > .empty { margin-bottom: 16px; }
.card.flush > .table-wrap:last-child { margin-bottom: 0; }
table.clients td { vertical-align: middle; }
table.clients .client-cell { min-width: 180px; }
table.clients .client-cell a { font-weight: 600; }
.card-foot .button { width: 100%; white-space: normal; text-align: center; }
table.clients .docs-cell { min-width: 130px; }
table.clients .missing-cell { min-width: 150px; }
table.clients .due-cell .due-date { display: block; font-weight: 500; }
table.clients .due-cell .chip { margin-top: 3px; }
table.clients .remind-cell { width: 1%; }
table.clients .remind-cell .button { white-space: nowrap; }
table.clients .remind-cell .meta { margin-bottom: 6px; }
table.clients tr.quiet-row td { color: var(--muted); }
table.clients tr.quiet-row .chip { background: transparent; padding-left: 0; }
ul.tags { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
ul.tags li { padding: 1px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); font-size: 12px; line-height: 1.6; }
details.more { margin-top: 4px; font-size: 12px; }
details.more > summary { color: var(--accent); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 4px; }
ul.todo-list { list-style: none; margin: 4px 0 0; padding: 0; }
ul.todo-list li + li { border-top: 1px solid var(--border); }
ul.todo-list a { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--text); }
ul.todo-list a:hover { text-decoration: none; color: var(--accent); }
.todo-num { flex: none; display: grid; place-items: center; min-width: 32px; height: 28px; padding: 0 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-weight: 650; }
.todo-num.bad { background: var(--bad-bg); color: var(--bad); }
.todo-num.warn { background: var(--warn-bg); color: var(--warn); }
ul.feed { list-style: none; margin: 0 -20px; padding: 0; }
ul.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--border); }
ul.feed li:hover { background: var(--surface-2); }
.feed-main { min-width: 0; }
.feed-main a { font-weight: 500; overflow-wrap: anywhere; }
.feed-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
details.pop { position: relative; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
details.pop > summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
details.pop[open] > summary { margin-bottom: 0; }
.pop-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(380px, calc(100vw - 32px)); box-shadow: 0 12px 32px rgba(16, 24, 40, .16); }
@media (max-width: 600px) {
  ul.feed { margin: 0 -14px; }
  ul.feed li { padding: 10px 14px; }
  .pop-panel { right: auto; left: 0; }
}

/* Review page: a row's actions sit side by side, not stacked. */
.row-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.row-btns .link-form { margin: 0; }

/* ---------- 10. Status mark (inspired by React Bits "StatusMark") ----------
   A ring before a status word. Changing data-status morphs it in place:
   dashes fuse into a spinning arc, the arc closes into a ring, then a tick or cross draws.
   Markup: _status_mark.html. The word beside it always carries the meaning. */
.sm { flex: none; width: 14px; height: 14px; overflow: visible; color: inherit; }
.sm circle, .sm path { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sm .sm-track { fill: currentColor; fill-opacity: 0; stroke-opacity: 0; transition: fill-opacity .18s ease, stroke-opacity .2s ease; }
.sm-ring {
  transform-box: fill-box; transform-origin: center; transform: rotate(-90deg);
  stroke-dasharray: 3.75 8.75; opacity: .6;
  transition: stroke-dasharray .3s cubic-bezier(.77, 0, .175, 1), opacity .2s ease;
}
.sm-check, .sm-cross, .sm-bang {
  stroke-dasharray: 1 2; stroke-dashoffset: 1.05; opacity: 0;
  transition: stroke-dashoffset .16s cubic-bezier(.23, 1, .32, 1), opacity 0s linear .16s;
}
.sm[data-status="running"] .sm-ring { stroke-dasharray: 68 32; opacity: 1; animation: sm-spin 1.1s linear infinite; }
.sm[data-status="running"] .sm-track { stroke-opacity: .2; }
.sm[data-status="done"] .sm-ring, .sm[data-status="failed"] .sm-ring, .sm[data-status="attention"] .sm-ring { stroke-dasharray: 100 0; opacity: 1; }
.sm[data-status="done"] .sm-track, .sm[data-status="failed"] .sm-track, .sm[data-status="attention"] .sm-track { fill-opacity: .12; }
.sm[data-status="done"] .sm-check, .sm[data-status="failed"] .sm-cross,
.sm[data-status="cancelled"] .sm-cross, .sm[data-status="attention"] .sm-bang {
  stroke-dashoffset: 0; opacity: 1;
  transition: stroke-dashoffset .24s cubic-bezier(.23, 1, .32, 1) .12s, opacity 0s linear .12s;
}
.sm[data-status="cancelled"] { opacity: .7; }
@keyframes sm-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes sm-breathe { 50% { opacity: .45; } }
.chip.has-mark { padding-left: 6px; }
.chip.has-mark::before { display: none; }
.mark-word { display: inline-flex; align-items: center; gap: 6px; }
.mark-word.warn { color: var(--warn); }
.mark-word.muted { color: var(--muted); }
.file-line { display: inline-flex; align-items: center; gap: 8px; }
.file-line .sm { width: 16px; height: 16px; color: var(--warn); }
@media (prefers-reduced-motion: reduce) {
  .sm[data-status="running"] .sm-ring { animation: sm-breathe 1.4s ease-in-out infinite !important; }
  .sm-check, .sm-cross, .sm-bang { stroke-dashoffset: 0; }
}

/* ---------- 11. Flip headings and discover links (inspired by React Bits) ---------- */
/* motion.js splits a heading into letters; on hover each letter rolls up to a copy of itself. */
.ft-word { display: inline-block; white-space: nowrap; }
.ft-c { display: inline-block; overflow: hidden; height: 1.2em; line-height: 1.2; vertical-align: bottom; }
.ft-c > span { display: flex; flex-direction: column; transition: transform .42s cubic-bezier(.77, 0, .175, 1); transition-delay: calc(var(--i) * 12ms); }
.ft-c > span > span { display: block; height: 1.2em; }
[data-flip].ft-ready:hover .ft-c > span { transform: translateY(-50%); }
[data-flip].ft-ready .ft-c > span > span + span { color: var(--accent); }
.signin [data-flip].ft-ready .ft-c > span > span + span { color: #ffd2ad; }

/* A link with a round arrow that swaps on hover. */
a.discover { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
a.discover:hover { text-decoration: none; }
.dc-arrow { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); overflow: hidden; transition: background .2s ease, color .2s ease, transform .2s ease; }
.dc-arrow svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .32s cubic-bezier(.77, 0, .175, 1); }
.dc-arrow svg + svg { position: absolute; transform: translateX(-180%); }
a.discover:hover .dc-arrow { background: var(--accent-fill); color: var(--on-accent); transform: scale(1.1); }
a.discover:hover .dc-arrow svg:first-child { transform: translateX(180%); }
a.discover:hover .dc-arrow svg + svg { transform: none; }

/* ---------- 12. Dashboard look (inspired by "Dashboard Shell" and "Analytics Dashboard") ---------- */
:root { --radius-lg: 14px; --glow: rgba(31, 79, 191, .08); }
:root[data-theme="dark"] { --glow: rgba(147, 180, 255, .07); }

/* Sidebar: a soft wash, rounded active pill with an inner edge. */
.sidebar { background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 70%, var(--surface-2) 100%); }
.nav { border-radius: 10px; transition: background .15s ease, color .15s ease; }
.nav.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.nav.active svg { color: var(--accent); }
.nav:not(.active):hover svg { transform: translateX(1px); }
.nav svg { transition: transform .15s ease; }

/* Cards and tiles: larger radius, quiet glow at the top. */
.card, .tile { border-radius: var(--radius-lg); }
.page-head h1 { font-size: 26px; letter-spacing: -.025em; }
.tile {
  overflow: hidden; padding: 18px 20px;
  background: radial-gradient(120% 90% at 100% 0%, var(--glow) 0%, transparent 55%), var(--surface);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -12px rgba(16, 24, 40, .25); }
.tile-icon { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.tile-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile.attn .tile-icon { background: var(--bad-bg); color: var(--bad); }
.tile.attn.soft .tile-icon { background: var(--warn-bg); color: var(--warn); }
.tile .num { font-size: 32px; }
.tile.attn { border-top-width: 1px; padding-top: 18px; }
.tile.attn::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--bad); }
.tile.attn.soft::after { background: var(--warn); }
span.progress { border-radius: 999px; }
span.progress > span { border-radius: 999px; background: linear-gradient(90deg, var(--accent-fill), color-mix(in srgb, var(--accent-fill) 60%, #7cc4ff)); }
span.progress.good > span { background: linear-gradient(90deg, var(--good), color-mix(in srgb, var(--good) 60%, #9be7c0)); }
.todo-num { border-radius: 8px; }
ul.todo-list a .todo-num { transition: transform .15s ease; }
ul.todo-list a:hover .todo-num { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { a.tile:hover { transform: none; } }

/* ---------- 13. Spring tick-boxes (inspired by React Bits "SpringCheck") ----------
   The fill swells out of the centre with a little overshoot, then the tick draws. */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none;
  position: relative; display: inline-grid; place-items: center;
  width: 18px; height: 18px; border: 0; border-radius: 6px;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border-strong);
  cursor: pointer; vertical-align: middle; transition: box-shadow .12s ease, transform .16s cubic-bezier(.23, 1, .32, 1);
}
input[type=checkbox]:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }
input[type=checkbox]:active { transform: scale(.92); }
input[type=checkbox]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--accent-fill); transform: scale(0);
  transition: transform .34s cubic-bezier(.34, 1.56, .64, 1);
}
input[type=checkbox]::after {
  content: ""; position: relative; width: 12px; height: 12px; background: var(--on-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.25 6.4 4.75 8.9 9.75 3.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.25 6.4 4.75 8.9 9.75 3.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  clip-path: inset(0 100% 0 0); transition: clip-path .1s ease;
}
input[type=checkbox]:checked { box-shadow: none; }
input[type=checkbox]:checked::before { transform: scale(1); }
input[type=checkbox]:checked::after { clip-path: inset(0 0 0 0); transition: clip-path .22s cubic-bezier(.23, 1, .32, 1) .1s; }
input[type=checkbox]:disabled { opacity: .55; cursor: default; }
label.check:has(input[type=checkbox]:checked) { color: var(--text); }

/* ---------- 14. Swipe a row on a phone (inspired by React Bits "SwipeRow") ----------
   Files to review: swipe a row left to show "Set aside". Nothing happens until it is tapped. */
@media (pointer: coarse) { tr[data-swipe] { touch-action: pan-y; } }
tr[data-swipe] > td { transition: transform .3s cubic-bezier(.23, 1, .32, 1); transform: translateX(var(--dx, 0px)); }
tr[data-swipe].dragging > td { transition: none; }
tr[data-swipe] > td:last-child { position: relative; }
.swipe-drawer {
  position: absolute; top: 0; bottom: 0; right: 0; z-index: 2;
  display: none; align-items: stretch; overflow: hidden;
  width: calc(-1 * var(--dx, 0px)); transform: translateX(calc(-1 * var(--dx, 0px)));
  background: var(--warn-bg);
}
tr[data-swipe].swiped .swipe-drawer, tr[data-swipe].dragging .swipe-drawer { display: flex; }
tr[data-swipe]:not(.dragging) .swipe-drawer { transition: width .3s cubic-bezier(.23, 1, .32, 1), transform .3s cubic-bezier(.23, 1, .32, 1); }
.swipe-drawer button {
  flex: 1; min-width: 96px; min-height: 0; border: 0; border-radius: 0;
  background: var(--warn); color: var(--surface); font-size: 12px; font-weight: 600; white-space: normal;
}
.swipe-drawer button:hover { background: var(--warn); filter: brightness(1.08); }

/* ---------- 15. App shell top bar and dashboard charts (inspired by "Dashboard Shell"
   and "Analytics Dashboard") ---------- */
.topbar {
  position: sticky; top: 0; z-index: 9;
  display: flex; align-items: center; gap: 16px;
  height: 58px; padding: 0 36px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; margin: 0; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; }
.crumbs span { overflow: hidden; text-overflow: ellipsis; }
.crumbs svg { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
.crumbs strong { color: var(--text); font-weight: 600; }
.top-search { position: relative; margin-left: auto; width: min(360px, 40vw); }
.top-search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; pointer-events: none; }
.top-search input { min-height: 36px; padding: 6px 34px; border-radius: 10px; background: var(--surface); border-color: var(--border); font-size: 13px; }
.top-search input:focus-visible { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
.top-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; font: 11px/18px var(--mono); color: var(--muted); background: var(--surface-2); }
.top-search input:focus + kbd { display: none; }
.avatar {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-fill), color-mix(in srgb, var(--accent-fill) 55%, #9b7bff));
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border);
}
@media (max-width: 900px) {
  .topbar { display: none; }
}

/* Two charts side by side under the tiles. */
.viz-row { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 16px; }
@media (max-width: 1080px) { .viz-row { grid-template-columns: minmax(0, 1fr); } }
.chart-card, .ring-card { display: flex; flex-direction: column; }
.big-stat { margin: 0; color: var(--muted); font-size: 13px; }
.big-stat b { color: var(--text); font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-right: 4px; }

.day-bars { display: block; width: 100%; height: auto; overflow: visible; margin-top: 4px; }
.bar-axis { stroke: var(--border-strong); }
.bar-grid { stroke: var(--border); stroke-dasharray: 3 4; }
.bar-tick, .bar-label { fill: var(--muted); font-size: 11px; }
.bar-label { font-size: 10.5px; }
.bar .bar-fill {
  fill: color-mix(in srgb, var(--accent) 50%, transparent);
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: bar-grow .6s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i) * 28ms);
  transition: fill .15s ease;
}
.bar.weekend .bar-fill { fill: color-mix(in srgb, var(--accent) 28%, transparent); }
.bar.today .bar-fill { fill: var(--accent); }
.bar.today .bar-label { fill: var(--accent); font-weight: 600; }
.bar-hit { fill: transparent; }
.bar:hover .bar-hit { fill: var(--surface-2); }
.bar:hover .bar-fill { fill: var(--accent); }
.bar-count { fill: var(--text); font-size: 11px; font-weight: 600; opacity: 0; transition: opacity .15s ease; }
.bar:hover .bar-count, .bar.today .bar-count { opacity: 1; }
@keyframes bar-grow { from { transform: scaleY(0); } }

.ring-body { display: flex; align-items: center; gap: 24px; flex: 1; flex-wrap: wrap; justify-content: center; }
.ring-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-svg circle { fill: none; stroke-width: 13; }
.ring-track { stroke: var(--surface-2); }
.ring-arc { stroke-linecap: butt; animation: ring-in .9s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i) * 120ms); }
.ring-arc.good { stroke: var(--good); }
.ring-arc.warn { stroke: var(--warn); }
.ring-arc.bad { stroke: var(--bad); opacity: .8; }
@keyframes ring-in { from { stroke-dasharray: 0 100; } }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; margin: 0; }
.ring-center b { font-size: 28px; font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.ring-center span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ring-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 170px; font-size: 13px; }
.ring-legend li { display: flex; align-items: center; gap: 8px; }
.ring-legend b { margin-left: auto; font-weight: 650; }
.ring-legend .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--border-strong); }
.ring-legend .dot.good { background: var(--good); }
.ring-legend .dot.warn { background: var(--warn); }
.ring-legend .dot.bad { background: var(--bad); opacity: .8; }
@media (prefers-reduced-motion: reduce) { .bar .bar-fill, .ring-arc { animation: none; } }

/* =====================================================================================
   16. Sunrise theme: the whole app in the sign-in page's colours.
   Night (dark, the default): a starry sky, a sunrise glowing at the bottom of the screen,
   glass panels that let the glow through, warm peach / rose / violet accents.
   Dawn (light): the same theme in daylight: warm paper, peach and rose accents.
   ===================================================================================== */
:root {
  --sun: #e0773a; --sun-2: #f2a26b; --rose: #d9507f; --violet: #6a55e8; --gold: #e8a33d;
  --bg: #f8f4f0; --surface: #ffffff; --surface-2: #f7f0ea;
  --text: #1c1713; --muted: #6e635a;
  --border: #ece2d9; --border-strong: #dccdc0;
  --accent: #b9521f; --accent-hover: #9a4318; --accent-soft: #fcebdf; --accent-fill: #c9581f; --on-accent: #ffffff;
  --glass: rgba(255, 255, 255, .78); --glass-line: rgba(120, 80, 50, .12); --glass-shine: rgba(255, 255, 255, .9);
  --glow: rgba(232, 120, 60, .10);
  --shadow: 0 1px 2px rgba(60, 30, 10, .05), 0 8px 24px -16px rgba(60, 30, 10, .18);
}
:root[data-theme="dark"] {
  --sun: #ffb27a; --sun-2: #ffd2ad; --rose: #e8679a; --violet: #7b68ff; --gold: #ffcf8a;
  --bg: #06070c; --surface: #0e1019; --surface-2: #151824;
  --text: #eef0f6; --muted: #9aa2b4;
  --border: #1d2130; --border-strong: #2b3044;
  --accent: #ffb27a; --accent-hover: #ffc89f; --accent-soft: #2a1c17; --accent-fill: #ffb27a; --on-accent: #1a0f0a;
  --good: #86d9ad; --good-bg: #12261c; --warn: #f7c675; --warn-bg: #2b2112; --bad: #f2879b; --bad-bg: #2d1520;
  --glass: rgba(12, 13, 22, .62); --glass-line: rgba(255, 255, 255, .075); --glass-shine: rgba(255, 255, 255, .05);
  --glow: rgba(255, 178, 122, .09);
  --shadow: 0 24px 60px -36px rgba(0, 0, 0, .9);
}

/* ---- The sky behind every screen ---- */
body.app { background: var(--bg); }
.app-sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(130% 70% at 60% 120%, color-mix(in srgb, var(--violet) 14%, transparent) 0%, transparent 60%); }
.sky-stars { position: absolute; inset: 0 0 35% 0; opacity: 0;
  background-image: radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.7), transparent 60%),
                    radial-gradient(1px 1px at 140px 90px, rgba(255,255,255,.45), transparent 60%),
                    radial-gradient(1.4px 1.4px at 90px 160px, rgba(255,236,220,.75), transparent 60%),
                    radial-gradient(1px 1px at 230px 40px, rgba(200,210,255,.6), transparent 60%);
  background-size: 260px 220px;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent); mask-image: linear-gradient(to bottom, #000 30%, transparent); }
:root[data-theme="dark"] .sky-stars { opacity: .5; }
.sky-sun { position: absolute; left: 62%; bottom: -6vh; width: min(1400px, 120vw); aspect-ratio: 2.4 / 1; transform: translateX(-50%);
  background: radial-gradient(18% 30% at 50% 100%, color-mix(in srgb, var(--sun-2) 55%, transparent), transparent 100%),
              radial-gradient(42% 60% at 50% 100%, color-mix(in srgb, var(--sun) 28%, transparent), transparent 100%),
              radial-gradient(70% 90% at 50% 100%, color-mix(in srgb, var(--rose) 16%, transparent), transparent 100%);
  filter: blur(10px); opacity: .55; }
:root[data-theme="dark"] .sky-sun { opacity: .8; }
.sky-planet { position: absolute; left: 62%; top: calc(100% - 4vh); width: max(260vw, 2800px); aspect-ratio: 1; border-radius: 50%; transform: translateX(-50%);
  background: var(--bg);
  box-shadow: 0 -1px 0 color-mix(in srgb, var(--sun-2) 60%, transparent), 0 -10px 40px color-mix(in srgb, var(--sun) 30%, transparent); }
.shell { position: relative; z-index: 1; background: none; }
.main { min-height: 100vh; }

/* ---- Glass: sidebar, top bar, cards, tiles ---- */
.sidebar {
  background: var(--glass); border-right: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
}
.topbar { background: color-mix(in srgb, var(--bg) 55%, transparent); border-bottom-color: var(--glass-line); }
.card, .tile, .pop-panel, .alert {
  background: var(--glass); border-color: var(--glass-line);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 var(--glass-shine), var(--shadow);
}
.card, .tile { border-radius: 18px; }
.empty { background: color-mix(in srgb, var(--text) 4%, transparent); }
.alert.warn { background: color-mix(in srgb, var(--warn-bg) 80%, transparent); }
.alert.problem { background: color-mix(in srgb, var(--bad-bg) 80%, transparent); }
.alert.ok { background: color-mix(in srgb, var(--good-bg) 80%, transparent); }
.alert.info { background: color-mix(in srgb, var(--accent-soft) 80%, transparent); }
table.list thead th { background: color-mix(in srgb, var(--surface-2) 85%, transparent); }
table.list tbody tr:hover > td { background: color-mix(in srgb, var(--sun) 5%, transparent); }
input, select, textarea { background: color-mix(in srgb, var(--surface) 70%, transparent); border-color: var(--border-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--sun); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 20%, transparent); }
select option { background: var(--surface); color: var(--text); }
.top-search input { background: color-mix(in srgb, var(--surface) 60%, transparent); border-color: var(--glass-line); }
:focus-visible { outline-color: var(--sun); }

/* ---- Brand, menu and avatar in sunrise tones ---- */
.brand-mark .ring { fill: var(--sun); }
.brand-mark .tick { stroke: var(--on-accent); }
.nav:hover { background: color-mix(in srgb, var(--sun) 7%, transparent); }
.nav.active {
  color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sun) 22%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sun) 16%, transparent), color-mix(in srgb, var(--rose) 5%, transparent));
}
.nav.active svg { color: var(--sun); }
.nav.active::before { background: linear-gradient(180deg, var(--sun-2), var(--rose)); box-shadow: 0 0 12px var(--sun); }
.avatar { background: linear-gradient(135deg, var(--sun), var(--rose)); color: var(--on-accent); }

/* ---- Buttons: the sign-in page's glass button ---- */
button.primary, .button.primary, a.button:not(.ghost):not(.small) {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sun-2) 16%, transparent), color-mix(in srgb, var(--sun) 9%, transparent));
  border: 1px solid color-mix(in srgb, var(--sun) 35%, transparent); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 22px -14px color-mix(in srgb, var(--sun) 80%, transparent);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
button.primary:hover, .button.primary:hover, a.button:not(.ghost):not(.small):hover,
:root[data-theme="dark"] button.primary:hover, :root[data-theme="dark"] .button.primary:hover, :root[data-theme="dark"] a.button:not(.ghost):not(.small):hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--sun-2) 26%, transparent), color-mix(in srgb, var(--sun) 15%, transparent));
  border-color: color-mix(in srgb, var(--sun) 60%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 10px 28px -12px color-mix(in srgb, var(--sun) 90%, transparent);
}
button.primary:active, .button.primary:active { transform: translateY(1px); }
:root:not([data-theme="dark"]) button.primary, :root:not([data-theme="dark"]) .button.primary, :root:not([data-theme="dark"]) a.button:not(.ghost):not(.small) {
  background: linear-gradient(180deg, #e2783c, #c9581f); border-color: #b9521f; color: #fff;
}
:root:not([data-theme="dark"]) button.primary:hover, :root:not([data-theme="dark"]) .button.primary:hover, :root:not([data-theme="dark"]) a.button:not(.ghost):not(.small):hover {
  background: linear-gradient(180deg, #e8854a, #d0602a); border-color: #a94a1c;
}
button, .button { border-radius: 10px; }
button:not(.primary):not(.link):not(.reveal):not(.theme-toggle):not(.swipe-drawer button), .button:not(.primary) {
  background: color-mix(in srgb, var(--surface) 55%, transparent); border-color: var(--border-strong);
}
button.primary .spinner { border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
/* Glass button with a light on its edge (motion.js turns it toward the mouse). */
.specular::before, .specular::after { content: ""; position: absolute; border-radius: inherit; pointer-events: none; z-index: -1; }
.specular::before {
  inset: -1px; padding: 1.4px;
  background: conic-gradient(from calc(var(--sb-angle, 315deg) - 45deg),
    transparent 0deg, color-mix(in srgb, var(--sun-2) 30%, transparent) 25deg, var(--sun-2) 45deg, color-mix(in srgb, var(--sun-2) 30%, transparent) 65deg, transparent 90deg,
    transparent 190deg, color-mix(in srgb, var(--sun) 45%, transparent) 225deg, transparent 260deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: var(--sb-level, .55);
}
.specular::after { inset: -6px; background: radial-gradient(60% 120% at var(--sb-x, 15%) var(--sb-y, 0%), color-mix(in srgb, var(--sun) 28%, transparent), transparent 70%); filter: blur(6px); opacity: var(--sb-level, .55); }

/* ---- Dashboard: a small Horizon Bloom across the top, tiles resting on the planet's edge ---- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 26px 28px 150px; border-radius: 24px;
  border: 1px solid var(--glass-line);
  background: radial-gradient(120% 120% at 70% 110%, color-mix(in srgb, var(--violet) 22%, transparent) 0%, transparent 60%), color-mix(in srgb, var(--surface) 55%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-shine), var(--shadow);
}
.hero:has(.pop[open]) { overflow: visible; }
.hero-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; border-radius: inherit; }
.hero-stars { position: absolute; inset: 0 0 40% 0; opacity: 0;
  background-image: radial-gradient(1px 1px at 30px 20px, rgba(255,255,255,.8), transparent 60%),
                    radial-gradient(1px 1px at 170px 70px, rgba(255,255,255,.5), transparent 60%),
                    radial-gradient(1.5px 1.5px at 110px 40px, rgba(255,236,220,.85), transparent 60%);
  background-size: 230px 110px; animation: twinkle-app 7s ease-in-out infinite; }
:root[data-theme="dark"] .hero-stars { opacity: .7; }
.hero-planet { position: absolute; left: 68%; top: calc(100% - 96px); width: 300%; aspect-ratio: 1; border-radius: 50%; transform: translateX(-50%);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--violet) 18%, var(--bg)) 0%, var(--bg) 6%);
  box-shadow: inset 0 2px 1px -1px color-mix(in srgb, var(--sun-2) 90%, transparent),
              inset 0 14px 30px -12px color-mix(in srgb, var(--sun) 45%, transparent),
              0 -1px 16px color-mix(in srgb, var(--sun) 50%, transparent),
              0 -20px 70px color-mix(in srgb, var(--rose) 25%, transparent); }
.hero-sun { position: absolute; left: 68%; bottom: 96px; width: min(900px, 110%); aspect-ratio: 2.2 / 1; transform: translateX(-50%); transform-origin: 50% 100%;
  background: radial-gradient(12% 22% at 50% 100%, color-mix(in srgb, var(--sun-2) 95%, white), transparent 100%),
              radial-gradient(30% 45% at 50% 100%, color-mix(in srgb, var(--sun) 70%, transparent), transparent 100%),
              radial-gradient(55% 75% at 50% 100%, color-mix(in srgb, var(--rose) 38%, transparent), transparent 100%),
              radial-gradient(85% 100% at 50% 100%, color-mix(in srgb, var(--violet) 24%, transparent), transparent 100%);
  filter: blur(6px); animation: hero-rise 2.4s cubic-bezier(.16, 1, .3, 1) both, hero-breathe 9s ease-in-out 2.4s infinite; }
.hero-rim { position: absolute; left: 68%; bottom: 95px; width: min(520px, 60%); height: 2px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, #fff 0%, color-mix(in srgb, var(--sun-2) 90%, transparent) 35%, transparent 100%); }
@keyframes hero-rise { from { opacity: 0; transform: translateX(-50%) scaleY(.4) translateY(25%); } }
@keyframes hero-breathe { 50% { opacity: .85; transform: translateX(-50%) scale(1.04); } }
@keyframes twinkle-app { 50% { opacity: .3; } }
:root:not([data-theme="dark"]) .hero { background: radial-gradient(120% 120% at 70% 110%, rgba(255, 190, 150, .35) 0%, transparent 60%), linear-gradient(180deg, #fff, #fff6ef); }
:root:not([data-theme="dark"]) .hero-planet { background: radial-gradient(circle at 50% 0%, #fff3ea 0%, var(--bg) 6%); }
.hero .page-head h1 { font-size: 30px; letter-spacing: -.03em; }
.hero .eyebrow { color: var(--sun); letter-spacing: .08em; }
.hero .refreshing { margin-top: 14px; }
.page > .hero + .tiles { position: relative; z-index: 2; margin-top: -64px; padding: 0 16px; }
@media (max-width: 900px) { .hero { padding: 20px 18px 130px; } .page > .hero + .tiles { padding: 0 8px; } }

/* ---- Tiles, progress and to-do numbers in sunrise tones ---- */
.tile { background: radial-gradient(120% 100% at 100% 0%, var(--glow) 0%, transparent 55%), var(--glass); }
.tile-icon { background: color-mix(in srgb, var(--sun) 14%, transparent); color: var(--sun); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sun) 20%, transparent); }
.tile.attn::after { background: linear-gradient(90deg, var(--rose), var(--bad)); }
.tile.attn.soft::after { background: linear-gradient(90deg, var(--gold), var(--sun)); }
.tile.attn .tile-icon { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); box-shadow: none; }
.tile.attn.soft .tile-icon { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); box-shadow: none; }
a.tile:hover { border-color: color-mix(in srgb, var(--sun) 40%, transparent); box-shadow: inset 0 1px 0 var(--glass-shine), 0 16px 40px -20px color-mix(in srgb, var(--sun) 55%, transparent); }
span.progress { background: color-mix(in srgb, var(--text) 9%, transparent); }
span.progress > span { background: linear-gradient(90deg, var(--rose), var(--sun)); box-shadow: 0 0 10px color-mix(in srgb, var(--sun) 50%, transparent); }
span.progress.good > span { background: linear-gradient(90deg, var(--sun), var(--gold)); }
.todo-num { background: color-mix(in srgb, var(--text) 7%, transparent); }
ul.todo-list a:hover { color: var(--sun); }
.seg { background: color-mix(in srgb, var(--surface) 55%, transparent); border-color: var(--glass-line); border-radius: 10px; }
.seg > * + * { border-left-color: var(--glass-line); }
.seg > strong { background: color-mix(in srgb, var(--sun) 15%, transparent); color: var(--text); }
.dc-arrow { background: color-mix(in srgb, var(--sun) 15%, transparent); color: var(--sun); }
a.discover:hover .dc-arrow { background: var(--sun); color: var(--on-accent); }
[data-flip].ft-ready .ft-c > span > span + span { color: var(--sun); }
input[type=checkbox]::before { background: linear-gradient(135deg, var(--sun), var(--rose)); }
input[type=checkbox]::after { background: var(--on-accent); }

/* ---- Charts: night to sunrise ---- */
.sun-bar-0 { stop-color: var(--rose); stop-opacity: .55; }
.sun-bar-1 { stop-color: var(--sun); stop-opacity: .95; }
.bar .bar-fill, .bar.weekend .bar-fill, .bar:hover .bar-fill { fill: url(#sun-bar); }
.bar.weekend .bar-fill { opacity: .5; }
.bar.today .bar-fill { fill: var(--sun-2); filter: drop-shadow(0 0 8px var(--sun)); }
.bar.today .bar-label, .bar-count { fill: var(--sun); }
.bar:hover .bar-hit { fill: color-mix(in srgb, var(--sun) 6%, transparent); }
.bar-grid { stroke: var(--glass-line); }
.ring-track { stroke: color-mix(in srgb, var(--text) 7%, transparent); }
.ring-svg { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--sun) 25%, transparent)); }
.ring-arc.good { stroke: var(--sun); }
.ring-arc.warn { stroke: var(--rose); }
.ring-arc.bad { stroke: var(--violet); opacity: 1; }
.ring-legend .dot.good { background: var(--sun); }
.ring-legend .dot.warn { background: var(--rose); }
.ring-legend .dot.bad { background: var(--violet); opacity: 1; }
.big-stat b { background: linear-gradient(90deg, var(--sun-2), var(--sun)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-reduced-motion: reduce) { .hero-sun, .hero-stars { animation: none; } }

/* =====================================================================================
   17. Crisp pass: same sunrise theme, less haze. Solid panels with hairline borders,
   no glows on data, the sunrise kept only in the dashboard header.
   ===================================================================================== */
:root { --glass: #ffffff; --glass-line: #ebe3dc; --glass-shine: transparent; --shadow: 0 1px 2px rgba(40, 20, 5, .04); }
:root[data-theme="dark"] { --bg: #08090e; --surface: #0f1118; --surface-2: #141721; --border: #1c1f2b; --border-strong: #272b3a;
  --glass: #0e1017; --glass-line: #1d2030; --glass-shine: transparent; --shadow: none; }

/* Background: plain night (or warm paper), with only a whisper of the sunrise at the bottom. */
.sky-stars, .sky-planet { display: none; }
.sky-sun { opacity: .18 !important; filter: blur(30px); }
.app-sky { background: none; }

/* Panels: solid, hairline borders, no blur. */
.sidebar, .card, .tile, .pop-panel, .alert, .topbar {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.sidebar { background: var(--surface); border-right-color: var(--border); }
.topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.card, .tile, .pop-panel { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); border-radius: 14px; }
.tile { background: var(--surface); padding: 16px 18px; }
.pop-panel { box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .35); }
.alert { box-shadow: none; border-radius: 10px; }
.alert.warn { background: var(--warn-bg); } .alert.problem { background: var(--bad-bg); }
.alert.ok { background: var(--good-bg); } .alert.info { background: var(--accent-soft); }
table.list thead th { background: var(--surface-2); }
table.list th, table.list td { border-bottom-color: var(--border); }
input, select, textarea { background: var(--surface); }
.top-search input { background: var(--surface-2); border-color: var(--border); }

/* Type: tighter, calmer. */
.page-head h1, .hero .page-head h1 { font-size: 26px; font-weight: 650; letter-spacing: -.025em; }
.card > h2, .card-head h2 { font-size: 15px; letter-spacing: -.01em; }
.tile .cap { font-size: 12.5px; }
.tile .num { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.eyebrow, .hero .eyebrow { font-size: 11px; letter-spacing: .07em; }

/* Accents without halos. */
.nav.active { background: color-mix(in srgb, var(--sun) 10%, transparent); box-shadow: none; }
.nav.active::before { box-shadow: none; background: var(--sun); }
.tile-icon { width: 28px; height: 28px; border-radius: 8px; box-shadow: none; background: color-mix(in srgb, var(--sun) 12%, transparent); }
.tile.attn::after { height: 2px; background: var(--bad); }
.tile.attn.soft::after { background: var(--warn); }
a.tile:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--sun) 45%, var(--border)); box-shadow: var(--shadow); }
span.progress { height: 4px; }
span.progress > span { box-shadow: none; background: var(--sun); }
span.progress.good > span { background: var(--good); }
.todo-num { border-radius: 6px; }
button.primary, .button.primary, a.button:not(.ghost):not(.small) { box-shadow: none; }
button.primary:hover, .button.primary:hover, a.button:not(.ghost):not(.small):hover,
:root[data-theme="dark"] button.primary:hover, :root[data-theme="dark"] .button.primary:hover { box-shadow: none; }
.specular::after { display: none; }
.avatar { box-shadow: none; }

/* Dashboard header: the sunrise stays, sharper and smaller. */
.hero { padding: 24px 26px 124px; border-radius: 18px; background: var(--surface); border-color: var(--border); box-shadow: none; }
:root:not([data-theme="dark"]) .hero { background: linear-gradient(180deg, #fff 40%, #fff7f1); }
.hero-stars { opacity: 0 !important; }
:root[data-theme="dark"] .hero-stars { opacity: .35 !important; }
.hero-planet { top: calc(100% - 76px); background: var(--bg);
  box-shadow: inset 0 1.5px 0 -0.5px color-mix(in srgb, var(--sun-2) 85%, transparent),
              0 -1px 10px color-mix(in srgb, var(--sun) 35%, transparent); }
:root:not([data-theme="dark"]) .hero-planet { background: var(--bg); }
.hero-sun { bottom: 76px; filter: blur(2px); opacity: .75; width: min(760px, 90%); }
.hero-rim { bottom: 75px; height: 1.5px; }
.page > .hero + .tiles { margin-top: -54px; }
@media (max-width: 900px) { .hero { padding: 20px 18px 116px; } }

/* Charts: flat fills, hairline grid, no glow. */
.ring-svg { filter: none; }
.ring-svg circle { stroke-width: 10; }
.bar.today .bar-fill { filter: none; fill: var(--sun); }
.sun-bar-0 { stop-color: var(--sun); stop-opacity: .45; }
.sun-bar-1 { stop-color: var(--sun); stop-opacity: .8; }
.bar.weekend .bar-fill { opacity: .45; }
.bar-grid { stroke: var(--border); stroke-dasharray: none; }
.big-stat b { background: none; color: var(--text); -webkit-background-clip: border-box; background-clip: border-box; }
