/* AI 晨報 — app screen styles
   Direction: tasteskill "editorial-greeting" (seed 650432740): the date is the h1 set in a serif, a centred
   1100px column on a 12-column grid (12 × 77 + 11 × 16 = 1100), spans 3/3/3/3 → 9/3 → 9/3 so every
   internal edge meets one above it, every figure at regular weight on tonal panels, one white inner card
   (the concept bar list). Face: the tonal panel is warm newsprint instead of #f9f9f9. */

/* ---------- tokens ---------- */
:root {
  --ground: #ffffff;
  --surface: #f4f3f0;         /* tonal panel: one level toward newsprint, low chroma */
  --raised: #ffffff;          /* the one white inner card, chips on a panel */
  --active: #ebeae6;          /* active nav pill */
  --border: #e5e4e0;
  --rule: #eae9e5;
  --control: #d4d3cf;
  --text: #1f201d;
  --muted: #636361;
  --faint: #6b6b6b;
  --accent: #1b6e66;
  --primary: #1f201d; --primary-ink: #ffffff;
  --positive: #2e7d32; --negative: #b42318; --warning: #92400e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #fdecea; --pill-negative-ink: #7a1d14;
  --pill-warning-bg: #fffbeb; --pill-warning-ink: #92400e; --notice-border: #fde68a;
  --pill-neutral-bg: #ffffff; --pill-neutral-ink: #3d3d3a;
  --chart-1: #1f201d; --chart-2: #1b6e66; --chart-3: #8c8c88; --chart-muted: #cfccc4;
  --grid: var(--rule); --axis-ink: var(--muted); --ink: var(--text); --chart-span: 0.06;
  --track-app: #1b6e66; --track-arch: #7a5c2e; --track-industry: #6b6b66;
  --seg-off: #e2e1dc;

  --font: "Instrument Sans", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Instrument Serif", "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
  --fs-title: 48px; --fs-h1: 24px; --fs-section: 14px; --fs-kpi: 24px; --fs-kpi-lead: 32px; --fs-body: 14px; --fs-small: 12px;

  --sidebar-width: 224px;
  --col: 1100px;
  --gap: 16px; --pad: 24px; --card-pad: 20px;
  --radius-card: 22px; --radius-inner: 12px; --radius-control: 999px;
  --control-height: 38px; --nav-row: 32px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 120ms; --t-hover: 150ms; --t-ui: 200ms;
}
:root[data-theme="dark"] {
  --ground: #121212; --surface: #1b1b1a; --raised: #262625; --active: #2a2a29;
  --border: #2e2e2d; --rule: #262625; --control: #4a4a48;
  --text: #f2f2f2; --muted: #b4b4b4; --faint: #949494;
  --accent: #5fb8ad;
  --primary: #f2f2f2; --primary-ink: #121212;
  --positive: #3fc07a; --negative: #e5566f; --warning: #e5a93b;
  --pill-positive-bg: #172a1d; --pill-positive-ink: #3fc07a;
  --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f;
  --pill-warning-bg: #2b2414; --pill-warning-ink: #e5a93b; --notice-border: #4a3c14;
  --pill-neutral-bg: #262625; --pill-neutral-ink: #f2f2f2;
  --chart-1: #f2f2f2; --chart-2: #5fb8ad; --chart-3: #8c8c88; --chart-muted: #4a4a48;
  --grid: #2b2b2b; --chart-span: 0.12;
  --track-app: #5fb8ad; --track-arch: #c9a35c; --track-industry: #9a9a98;
  --seg-off: #333332;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121212; --surface: #1b1b1a; --raised: #262625; --active: #2a2a29;
    --border: #2e2e2d; --rule: #262625; --control: #4a4a48;
    --text: #f2f2f2; --muted: #b4b4b4; --faint: #949494;
    --accent: #5fb8ad;
    --primary: #f2f2f2; --primary-ink: #121212;
    --positive: #3fc07a; --negative: #e5566f; --warning: #e5a93b;
    --pill-positive-bg: #172a1d; --pill-positive-ink: #3fc07a;
    --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f;
    --pill-warning-bg: #2b2414; --pill-warning-ink: #e5a93b; --notice-border: #4a3c14;
    --pill-neutral-bg: #262625; --pill-neutral-ink: #f2f2f2;
    --chart-1: #f2f2f2; --chart-2: #5fb8ad; --chart-3: #8c8c88; --chart-muted: #4a4a48;
    --grid: #2b2b2b; --chart-span: 0.12;
    --track-app: #5fb8ad; --track-arch: #c9a35c; --track-industry: #9a9a98;
    --seg-off: #333332;
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, table, .kpi-value { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- shell: open plane ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; }
.topbar { display: none; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 2px; padding: 20px 12px 16px; border-right: 1px solid var(--border); overflow: auto; }
.brand { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; margin-bottom: 18px; color: var(--text); font-weight: 600; font-size: 15px; }
.brand .mark { color: var(--accent); flex: none; }
.group-label { margin: 22px 8px 6px; font-size: var(--fs-small); color: var(--faint); }
.nav-item { display: flex; align-items: center; gap: 10px; height: var(--nav-row); padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--muted); text-align: left; width: 100%; cursor: pointer; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.nav-item svg { width: 16px; height: 16px; flex: none; stroke-width: 1.5; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--active); color: var(--text); }
.sidebar .bottom { margin-top: auto; display: grid; gap: 2px; }
.canvas { min-width: 0; padding: 36px var(--pad) 96px; }
.col { max-width: var(--col); margin: 0 auto; display: grid; gap: 24px; }
.col.narrow { max-width: 420px; margin-top: 10vh; }
.loading { padding: 8px 0; }

/* ---------- the 12-column grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.grid.top { align-items: start; }
.span-9 { grid-column: span 9; min-width: 0; }
.span-3 { grid-column: span 3; min-width: 0; }

/* ---------- greeting (the h1) ---------- */
.greeting h1.serif { font-family: var(--serif); font-size: var(--fs-title); line-height: 1.1; font-weight: 400; letter-spacing: -0.01em; }
.finding { margin-top: 12px; font-size: 16px; line-height: 1.6; max-width: 40em; }
.stamp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.stamp { color: var(--faint); font-size: var(--fs-small); }
.daynav { display: flex; gap: 8px; }

/* other screens' title */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.title-row h1 { font-size: var(--fs-h1); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.title-row .sub { margin-top: 6px; color: var(--muted); }

/* ---------- notice ---------- */
.notice { padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-inner); background: var(--surface); font-size: 13px; line-height: 20px; }
.notice.warn { background: var(--pill-warning-bg); border-color: var(--notice-border); color: var(--pill-warning-ink); }

/* ---------- reading track: the product's own element ---------- */
.track { display: flex; align-items: center; gap: 14px; margin-top: -8px; }
.track-segs { flex: 1; display: flex; gap: 3px; height: 10px; }
.track .seg { display: block; flex: 1 1 0; min-width: 6px; height: 100%; border-radius: 999px; background: var(--seg-off); transition: background-color var(--t-ui) ease, transform var(--t-press) var(--ease-out); }
.track .seg:hover { transform: scaleY(1.4); }
.track .seg.done { background: var(--accent); }
.track-label { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- KPIs: one divided panel ---------- */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border-radius: var(--radius-card); }
.kpi { padding: 16px var(--card-pad); }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi-label { color: var(--muted); }
.kpi-value { margin-top: 6px; font-size: var(--fs-kpi); line-height: 1.15; font-weight: 400; letter-spacing: -0.01em; }
.kpi.lead .kpi-value { font-size: var(--fs-kpi-lead); }
.kpi-value small { font-size: 0.5em; color: var(--muted); font-weight: 400; margin-left: 4px; }
.delta { margin-top: 4px; font-size: var(--fs-small); color: var(--muted); }

/* ---------- section heads sit outside the panels ---------- */
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; min-height: 20px; }
.section-head h2 { font-size: var(--fs-section); line-height: 20px; font-weight: 600; }
.section-head .meta { color: var(--faint); font-size: var(--fs-small); }
.section-head > :last-child:not(h2):not(.meta) { margin-left: auto; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.inner-card { background: var(--raised); border-radius: var(--radius-inner); padding: 12px 14px; }
.card-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--text); font-weight: 500; font-size: 13px; cursor: pointer; text-underline-offset: 3px; }
.card-link:hover { text-decoration: underline; }
.rail { display: grid; gap: 20px; align-content: start; }
.rail .panel p + p { margin-top: 4px; }
.rows.plain { display: grid; }
.row-item { display: grid; gap: 2px; padding: 8px 0; }
.row-item:first-child { padding-top: 0; }
.row-item:last-child { padding-bottom: 0; }
.row-item + .row-item { border-top: 1px solid var(--rule); }
.row-item a { font-weight: 500; }
.row-item .sub { color: var(--faint); font-size: var(--fs-small); }

/* ---------- picks ---------- */
.picks { display: grid; gap: var(--gap); }
.pick { background: var(--surface); border-radius: var(--radius-card); padding: var(--card-pad); transition: opacity var(--t-ui) ease; }
.pick.read { opacity: 0.55; }
.pick.read:hover, .pick.read:focus-within { opacity: 1; }
.pick-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pick-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-small); line-height: 16px; min-width: 0; }
.pick-meta .sep { color: var(--control); }
.pick-meta .src { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--track-industry); flex: none; }
.track-dot.t-app { background: var(--track-app); }
.track-dot.t-arch { background: var(--track-arch); }
.readlabel { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; user-select: none; }
.readbox { appearance: none; width: 18px; height: 18px; margin: 0; border: 2px solid var(--control); border-radius: 4px; background: var(--raised); display: grid; place-items: center; cursor: pointer; transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease; }
.readbox:checked { background: var(--text); border-color: var(--text); }
.readbox:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--ground); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.pick h3 { font-size: 17px; line-height: 1.45; font-weight: 500; }
.pick h3 a:hover, .deep h3 a:hover, .other a:hover { text-decoration: underline; text-underline-offset: 3px; }
.orig { margin-top: 4px; color: var(--faint); font-size: var(--fs-small); line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary { margin-top: 10px; font-size: 15px; line-height: 1.75; max-width: 40em; }
.why { margin-top: 8px; font-size: 14px; line-height: 1.6; max-width: 42em; }
.why-k { color: var(--muted); font-weight: 500; }
.why-k::after { content: "："; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); font-size: var(--fs-small); font-weight: 500; white-space: nowrap; transition: background-color var(--t-hover) ease; }
.chip:hover { background: var(--active); }
.chip.src { color: var(--muted); font-weight: 400; }
.chip.src::before { content: "↗ "; }

/* ---------- deep read and others ---------- */
.deep h3 { margin-top: 8px; font-size: 20px; line-height: 1.4; font-weight: 500; }
.deep-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; margin-top: 14px; }
.deep-teaser { display: grid; gap: 6px; }
.deep-teaser .t { font-weight: 500; line-height: 20px; }
.deep-teaser .sub { color: var(--muted); font-size: 13px; line-height: 18px; }
.deep-text p { font-size: 16px; line-height: 1.8; max-width: 40em; }
.deep-text p + p { margin-top: 12px; }
.takeaways { padding: 14px 16px; background: var(--raised); border-radius: var(--radius-inner); align-self: start; }
.takeaways h4 { font-size: var(--fs-section); font-weight: 600; margin-bottom: 8px; }
.takeaways ol { padding-left: 1.3em; margin: 0; font-size: 14px; line-height: 1.6; display: grid; gap: 6px; }
.deep-foot { margin-top: 16px; }
.others { display: grid; }
.other { display: grid; gap: 2px; padding: 8px 0; }
.other:first-child { padding-top: 0; }
.other + .other { border-top: 1px solid var(--rule); }
.other a { line-height: 20px; }
.other .src { color: var(--faint); font-size: var(--fs-small); }
.more { margin-top: 10px; }
.more summary { cursor: pointer; font-weight: 500; font-size: 13px; list-style: none; color: var(--text); }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: " ›"; }
.more[open] summary::after { content: " ˅"; }
.more .others { margin-top: 8px; }

/* ---------- long-form: topics, concept cards, weekly ---------- */
.stack { display: grid; gap: 20px; align-content: start; }
.article .prose + .prose-section, .prose-section + .prose-section { margin-top: 32px; }
.prose { max-width: 42em; overflow-wrap: anywhere; }
.article { min-width: 0; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 18px; line-height: 1.4; font-weight: 600; margin: 32px 0 10px; }
.prose h3 { font-size: 16px; line-height: 1.5; font-weight: 600; margin: 22px 0 8px; }
.prose h4 { font-size: 15px; font-weight: 600; margin: 16px 0 6px; }
.prose p, .prose li { font-size: 16px; line-height: 1.8; }
.prose p + p { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 10px 0; display: grid; gap: 6px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--control); }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 14px 0; padding: 10px 16px; background: var(--raised); border-radius: var(--radius-inner); color: var(--muted); }
.prose code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9em; background: var(--raised); padding: 1px 5px; border-radius: 4px; }
.prose pre { margin: 12px 0; padding: 14px 16px; background: var(--raised); border-radius: var(--radius-inner); overflow-x: auto; font-size: 13px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.prose th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border); }
.prose td { padding: 8px 8px 8px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.prose img { border-radius: var(--radius-inner); }
.prose hr { border: 0; height: 24px; }
.prose-section h2 { font-size: 18px; line-height: 1.4; font-weight: 600; margin: 0 0 10px; }
.sources { padding-left: 1.4em; margin: 0; display: grid; gap: 6px; font-size: 14px; line-height: 1.6; }
.sources a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--control); word-break: break-all; }
.related .other .src { word-break: keep-all; }
.toc h2 { font-size: var(--fs-section); font-weight: 600; margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: 13px; line-height: 18px; }
.toc a:hover { background: var(--active); color: var(--text); }
.panel.sticky { position: sticky; top: 24px; }
.topic-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.topic-main { display: grid; gap: 2px; min-width: 0; }
.topic-title { font-size: 16px; font-weight: 500; line-height: 1.5; }
.topic-meta { display: grid; gap: 6px; justify-items: end; flex: none; }
.statement { font-size: 17px; line-height: 1.75; max-width: 42em; }
.ranked { padding-left: 1.6em; margin: 0; display: grid; gap: 12px; }
.ranked li { padding-left: 4px; }
.ranked li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.ranked-title { display: block; font-weight: 500; line-height: 1.5; }
.ranked .sub { display: block; color: var(--muted); font-size: 13px; line-height: 18px; margin-top: 2px; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.controls .input { max-width: 360px; height: var(--control-height); }
.switch-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.switch-chips button { height: 28px; padding: 0 12px; border: 1px solid var(--control); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.switch-chips button[aria-pressed="true"] { background: var(--text); color: var(--ground); border-color: var(--text); }
.chart-card { padding: 12px 8px 4px; }
.concepts-table td:first-child { max-width: 0; width: 55%; }
.concept-name { font-weight: 500; }
.concepts-table .sub { color: var(--muted); font-size: 13px; line-height: 18px; margin-top: 2px; }
.topic-cell { margin-bottom: 8px; }
.facts { display: grid; gap: 12px; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.fact { font-size: 20px; }

/* ---------- pills, controls ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-small); font-weight: 500; background: var(--active); color: var(--pill-neutral-ink); white-space: nowrap; flex: none; }
:root[data-theme="dark"] .pill, :root:not([data-theme="light"]) .pill { color: var(--text); }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 16px; border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--ground); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.btn:hover { background: var(--surface); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.primary:hover { background: var(--primary); opacity: 0.9; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.segmented { display: inline-flex; width: max-content; max-width: 100%; padding: 3px; border-radius: 999px; background: var(--surface); }
.segmented button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.segmented button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 500; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 500; }
.input { height: 38px; padding: 0 14px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--ground); width: 100%; }
.input::placeholder { color: var(--faint); }
.empty { display: grid; place-items: center; min-height: 96px; padding: 16px; border: 1px dashed var(--control); border-radius: var(--radius-inner); color: var(--muted); text-align: center; }

/* ---------- login ---------- */
body.is-login .sidebar, body.is-login .topbar { display: none; }
body.is-login .app { grid-template-columns: minmax(0, 1fr); }
.login { display: grid; gap: 16px; }
.login h1 { font-size: var(--fs-h1); font-weight: 600; }
.form-error { color: var(--negative); font-size: 13px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.table th { text-align: left; font-weight: 400; color: var(--muted); font-size: var(--fs-small); padding: 0 12px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px 10px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.table tr:first-child td { border-top: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.table tr.disabled td { color: var(--faint); }
.table td a:hover { text-decoration: underline; text-underline-offset: 3px; }
.budget-row { display: flex; justify-content: space-between; gap: 12px; font-size: 20px; margin-bottom: 10px; }
.budget-row .muted { font-size: 14px; align-self: flex-end; }
.bar { position: relative; height: 8px; border-radius: 999px; background: var(--seg-off); margin-bottom: 12px; }
.bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); min-width: 0; }
.bar .tick { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--text); }

/* ---------- phone and tablet: the navigation folds ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 4px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--ground); z-index: 10; }
  .topbar-title { font-weight: 600; }
  .menu-toggle { width: 40px; padding: 0; }
  .sidebar { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; background: var(--ground); border-right: 0; transform: translateX(-100%); transition: transform var(--t-ui) var(--ease-out); }
  .sidebar.open { transform: none; }
  .canvas { padding: 20px 16px 64px; }
  .col { gap: 24px; }
  .grid > * { grid-column: 1 / -1 !important; }
  .greeting h1.serif { font-size: 28px; }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .kpi:nth-child(2n) { border-left: 1px solid var(--border); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .deep-body { grid-template-columns: minmax(0, 1fr); }
  .title-row { flex-wrap: wrap; align-items: flex-start; }
  .section-head { flex-wrap: wrap; }
  .table { display: block; overflow-x: auto; }
}
@media (max-width: 480px) {
  .greeting h1.serif { font-size: 26px; }
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; padding: 0 6px; }
  .stamp-row { align-items: flex-start; }
  .daynav .btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; } }
