/* Health AIO design kit: components. Part of the kit (see docs/DESIGN_KIT.md).
   Every colour comes from tokens.css, and so does every margin, padding and gap that is a step of the space scale
   (tests/test_kit.py checks both). Other sizes are plain numbers: the fixed heights of controls (30px pills, 24px
   chips), insets off the scale (2, 3, 5, 6, 9, 10, 14px), corners of 3, 4 and 6px and the demo badge's 11px type.
   Nothing here names a Health AIO page.
   Every group starts with a comment "@component <class> <one line>"; `healthaio kit json` lists them and the
   gallery (#kit) shows each one. Page-only rules live in the app's own stylesheet (Health AIO: app.css). */

/* ---- base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--t-md)/1.5 var(--font); letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* @component .sr Text for screen readers only (the sentence under a chart that only has marks). */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the shell: header and page column ---- */
/* @component .top The sticky see-through header bar (.top-in holds its row: brand, menu, tools). */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--header); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1320px; margin: 0 auto; padding: 10px var(--s-6);
  display: flex; align-items: center; gap: var(--s-5);
}
@media (max-width: 640px) { .top-in { padding: var(--s-2) var(--s-4); gap: 10px; flex-wrap: wrap; } }

/* @component .brand The logo and the app's name; on phones only the logo stays. */
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; font-size: var(--t-md); }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
@media (max-width: 640px) { .brand span { display: none; } }

/* @component .nav The page menu: pills that scroll sideways; the current page (aria-current) is an inverted pill. */
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 6px var(--s-3); border-radius: var(--r-pill); color: var(--ink-2); font-size: var(--t-sm); font-weight: 550;
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
@media (max-width: 640px) { .nav { order: 3; flex-basis: 100%; } }

/* @component .side The page menu beside the page: a left sidebar from 900px (232px; html.side-folded narrows it to a 64px icon rail), below that a bottom tab bar under a row with the brand and the tools. */
/* Holds .side-head (.brand and a .side-fold button), .side-nav (links with an icon and a <span> label; a .side-sub
   link is a page inside the item above it; an item with pages ends in a .side-caret and carries aria-expanded,
   and its .side-sub links are [hidden] while it is closed) and .side-tools. As a direct child of <body> it is fixed
   in place; anywhere else (the gallery) it is a plain column. */
.side { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: 0 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: var(--s-3); min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-md);
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 550; white-space: nowrap;
}
.side-nav a svg { width: 18px; height: 18px; flex: none; }
.side-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.side-nav a[aria-current="page"] svg { color: var(--accent); }
.side-nav a.side-sub { min-height: 34px; padding-left: 42px; font-weight: 550; }
.side-nav a.side-sub[hidden] { display: none; }
/* an item that opens and closes its list of pages: a caret at the end, turned down while open */
.side-nav a .side-caret, .side-nav a[aria-current="page"] .side-caret { width: 12px; height: 12px; margin-left: auto; color: var(--ink-3); transition: transform .15s var(--ease); }
.side-nav a[aria-expanded="true"] .side-caret { transform: rotate(90deg); }
/* an item whose pages are listed under it: only the current page is highlighted (closed, the item itself is) */
.side-nav a[aria-current="page"]:has(+ .side-sub:not([hidden])) { background: none; }
.side-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.side-fold {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--ink-3); cursor: pointer;
  display: none; place-items: center; flex: none;
}
.side-fold:hover { background: var(--surface-2); color: var(--ink); }
.side-fold svg { width: 18px; height: 18px; }
@media (min-width: 900px) {
  body:has(> .side) { padding-left: 232px; transition: padding-left .18s var(--ease); }
  body > .side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 20; width: 232px; overflow-y: auto; overscroll-behavior: contain;
    padding: var(--s-5) var(--s-3) 14px; background: var(--surface); border-right: 1px solid var(--line); transition: width .18s var(--ease);
  }
  body > .side .side-fold { display: grid; }
  body > .side .side-tools { margin-top: auto; padding: var(--s-2); border-radius: var(--r-md); background: var(--surface-2); }
  /* the sidebar lists a menu item's pages, so the switch above the page title is not needed */
  html:not(.side-folded) body:has(> .side) .subnav { display: none; }
  /* folded: icons only; the brand's logo unfolds it (the app makes it a button), sub-pages and labels hide */
  html.side-folded body:has(> .side) { padding-left: 64px; }
  html.side-folded body > .side { width: 64px; align-items: center; padding: var(--s-5) var(--s-2) 14px; }
  html.side-folded body > .side .side-head { padding: 0; }
  html.side-folded body > .side .brand span, html.side-folded body > .side .side-nav a span,
  html.side-folded body > .side .side-sub, html.side-folded body > .side .side-fold, html.side-folded body > .side .side-caret { display: none; }
  html.side-folded body > .side .brand { padding: 3px; border-radius: var(--r-sm); cursor: pointer; }
  html.side-folded body > .side .brand:hover { background: var(--surface-2); }
  html.side-folded body > .side .side-nav a { width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  html.side-folded body > .side .side-nav a[aria-current="page"]:has(+ .side-sub) { background: var(--accent-soft); }  /* its pages are hidden */
  html.side-folded body > .side .side-tools { flex-direction: column; flex-wrap: nowrap; padding: 6px 0; background: none; }
  html.side-folded body > .side .demo-badge { writing-mode: vertical-rl; padding: var(--s-2) 3px; }
}
@media (max-width: 899px) {
  body:has(> .side) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body > .side {
    flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--line);
  }
  body > .side .side-head { padding: 0; }
  body > .side .side-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
    padding: var(--s-1) var(--s-1) calc(var(--s-1) + env(safe-area-inset-bottom));
    background: var(--header); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); border-top: 1px solid var(--line);
  }
  body > .side .side-nav a {
    flex-direction: column; justify-content: center; gap: 3px; min-height: 50px; padding: var(--s-1) 0; border-radius: 10px;
    font-size: 10.5px; font-weight: 600; min-width: 0;
  }
  body > .side .side-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  body > .side .side-nav a svg { width: 22px; height: 22px; }
  body > .side .side-nav a[aria-current="page"] { background: none; }
  body > .side .side-sub, body > .side .side-caret { display: none; }
}

/* @component .tool A 30px outlined pill button (language, light / dark); a row of them sits in .tools. */
.tools { display: flex; align-items: center; gap: 6px; }
.tool {
  height: 30px; min-width: 30px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: transparent; color: var(--ink-2); font-size: var(--t-xs); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tool:hover { color: var(--ink); border-color: var(--ink-3); }
.tool svg { width: 15px; height: 15px; }

/* @component .demo-badge An uppercase pill in the watch colours that says the numbers are made up. */
.demo-badge {
  font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--watch-ink); background: var(--watch-soft); padding: 3px var(--s-2); border-radius: var(--r-pill);
}

/* the page column: 1320px wide at most, a 16px gutter on phones */
main { max-width: 1320px; margin: 0 auto; padding: var(--s-6) var(--s-6) var(--s-8); }
@media (max-width: 640px) { main { padding: var(--s-4) var(--s-4) var(--s-7); } }

/* @component .head The page title row: h1, a .sub line under it, a stepper on the right. */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.head h1 { margin: 0; font-size: var(--t-2xl); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.head .sub { color: var(--ink-3); font-size: var(--t-sm); margin-top: var(--s-1); }
@media (max-width: 640px) { .head h1 { font-size: var(--t-xl); } }

/* @component .stepper Earlier / later pills; a span with aria-disabled="true" is a step that is not there. */
/* a pill never breaks inside: in a narrow box the row wraps instead */
.stepper { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); }
.stepper a, .stepper span {
  height: 30px; padding: 0 var(--s-3); display: inline-flex; align-items: center; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.stepper a:hover { text-decoration: none; color: var(--ink); border-color: var(--ink-3); }
.stepper span[aria-disabled="true"] { opacity: .4; }

/* @component .grid A 12-column grid with .span-12 / 8 / 7 / 6 / 5 / 4; at 1080px and narrower every span is full width. */
.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
@media (max-width: 1080px) { .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } }

/* @component .col Stacks cards inside one grid column, so no card stretches over empty space. */
.col { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }

/* @component .card The surface for one topic; its h2 (or a .section-title) is a small label row with an .aside on the right. */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-5); box-shadow: var(--shadow); min-width: 0;
}
.card > h2, .section-title {
  margin: 0 0 var(--s-3); flex-wrap: wrap; row-gap: var(--s-2); font-size: var(--t-sm); font-weight: 650; color: var(--ink-2);
  letter-spacing: .02em; display: flex; align-items: center; gap: var(--s-2); justify-content: space-between;
}
.card > h2 .aside, .section-title .aside { font-weight: 500; color: var(--ink-3); font-size: var(--t-xs); letter-spacing: 0; }
@media (max-width: 640px) { .card { padding: var(--s-4); } }

/* @component .lede Text: .lede is the verdict sentence; .muted, .small, .xs and .num (tabular figures) go anywhere. */
.lede { font-size: var(--t-xl); font-weight: 650; line-height: 1.3; margin: 0 0 6px; text-wrap: balance; letter-spacing: -.005em; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.xs { font-size: var(--t-xs); }
.num { font-variant-numeric: tabular-nums; }

/* @component .stack Layout helpers: .stack is a column, .row a wrapping row, .spacer pushes what follows to the end. */
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.spacer { flex: 1; }

/* @component .eyebrow A small uppercase label above a verdict. */
.eyebrow { font-size: var(--t-xs); font-weight: 650; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }

/* @component .hero-num The one big number on a card. */
.hero-num { font-size: var(--t-3xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; margin: var(--s-1) 0 6px; }

/* @component .chip A 24px state pill: plain = neutral, .good / .bad / .watch for a state (always with its word), .accent to point out. */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: var(--t-xs); font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; flex: none; display: inline; }
.chip.good { background: var(--good-soft); color: var(--good-ink); border-color: transparent; }
.chip.bad { background: var(--off-soft); color: var(--off-ink); border-color: transparent; }
.chip.watch { background: var(--watch-soft); color: var(--watch-ink); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* @component .dot An 8px round colour swatch, coloured inline. */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* @component .legend A wrapping row of .key items; .key i is a 10px swatch coloured inline, .key i.hatch the stripes of a lanes() hatch part in its color (ink unless set) (legendKey() draws mark-shaped keys). */
.key { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-2); }
.key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key i.hatch { color: var(--ink); background: repeating-linear-gradient(-45deg, currentColor 0 1.4px, transparent 1.4px 3.6px); box-shadow: inset 0 0 0 .8px currentColor; }
.legend { display: flex; gap: var(--s-4); flex-wrap: wrap; }

/* @component .ring The box for dayRing(): square, 360px at most, centred over its legend in a .ring-wrap. */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.ring { width: 100%; max-width: 360px; aspect-ratio: 1; }
.ring text { font-family: var(--font); }

/* @component .agenda A list with a time column: li holds .when, .what (b + a .muted line) and an optional chip. */
.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.agenda li { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: var(--s-3); padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline; }
.agenda li:first-child { border-top: 0; }
.agenda .when { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; }
.agenda .what { min-width: 0; }
.agenda .what b { font-weight: 600; }
.agenda .what .muted { display: block; font-size: var(--t-xs); }
@media (max-width: 640px) {
  .agenda li { grid-template-columns: 86px minmax(0, 1fr); }
  .agenda li .chip { grid-column: 2; justify-self: start; }
}

/* @component .tonight A row of three small stats: each div holds a span label over a big b value. */
.tonight { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-4); }
.tonight div { background: var(--surface-2); border-radius: var(--r-md); padding: 10px var(--s-3); }
.tonight b { display: block; font-size: var(--t-lg); font-variant-numeric: tabular-nums; font-weight: 650; }
.tonight span { font-size: var(--t-xs); color: var(--ink-3); }

/* @component .tiles A grid of metric tiles; a .tile holds .label (name + chip), .value, a chart slot and .note. .tiles.two = two columns, .tiles.aligned = five shared rows. */
.tiles { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tile { --halo: var(--surface-2); background: var(--surface-2); border-radius: var(--r-md); padding: 14px 14px 10px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
/* the name wraps beside its chip down to its longest word; past that the chip goes under the name, never over it
   (basis 0 + the automatic minimum = a line holds them when the longest word and the chip fit) */
.tile .label { font-size: var(--t-xs); color: var(--ink-2); font-weight: 600; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-2); align-items: flex-start; }
.tile .label > span:first-child { padding-top: 3px; flex: 1 1 0; }
.tile .label > .chip { flex: none; }
.tile .value { font-size: var(--t-xl); font-weight: 680; letter-spacing: -.01em; line-height: 1.15; }
.tile .value small { font-size: var(--t-sm); font-weight: 550; color: var(--ink-3); margin-left: 3px; }
.tile .note { font-size: var(--t-xs); color: var(--ink-3); }
.tile .spk svg, .tile .bul svg, .tile .dots svg { width: 100%; display: block; overflow: visible; }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* tiles made of the same five parts share their rows, so a name that wraps (or a chip that drops under it)
   never pushes one value below its neighbour's */
.tiles.aligned > .tile { display: grid; grid-template-columns: minmax(0, 1fr); grid-row: span 5; grid-template-rows: subgrid; row-gap: 6px; align-content: start; }
@media (max-width: 360px) { .tiles.two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .tile .value { font-size: var(--t-lg); } .hero-num { font-size: var(--t-2xl); } }

/* @component .seg A segmented switch: buttons on a track, the chosen one (aria-pressed="true") raised. */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: var(--s-1) var(--s-3); border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: var(--seg-on-edge); }

/* @component .subnav A small switch between pages that share a menu item; use it as class="subnav seg" with links. */
.subnav { display: inline-flex; margin-bottom: var(--s-4); }
.subnav a { padding: 5px 14px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 650; color: var(--ink-2); }
.subnav a:hover { text-decoration: none; color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--seg-on); color: var(--ink); box-shadow: var(--seg-on-edge); }

/* @component .how The "How this is worked out" fold: details.how with a summary and short paragraphs. */
details.how { margin-top: var(--s-3); font-size: var(--t-xs); color: var(--ink-3); }
details.how summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
details.how p { margin: 6px 0 0; max-width: 72ch; }

/* @component .empty A dashed box that says there is nothing to show yet. */
.empty { padding: var(--s-5); border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--ink-3); font-size: var(--t-sm); }

/* @component .foot The quiet row at the end of a page. */
.foot { margin-top: var(--s-6); color: var(--ink-3); font-size: var(--t-xs); display: flex; gap: var(--s-4); flex-wrap: wrap; }
.foot a { color: var(--ink-2); }

/* @component .tip The one tooltip of the page (installTooltip()); any element with data-tip shows it. */
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--bg);
  font-size: var(--t-xs); padding: 6px 9px; border-radius: var(--r-sm); max-width: 260px; line-height: 1.4;
  opacity: 0; transform: translateY(4px); transition: opacity .12s var(--ease), transform .12s var(--ease);
}
.tip.on { opacity: 1; transform: none; }

/* @component .catbar Shares of a whole as one bar: a span per part, sized with flex and coloured inline. */
.catbar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--c-band); }
.catbar span { display: block; min-width: 2px; }

/* @component .hbar A thin bar for one amount: the inner span sets its width and colour inline. */
.hbar { height: 8px; border-radius: 4px; background: var(--c-band); overflow: hidden; }
.hbar span { display: block; height: 100%; border-radius: 4px; }

/* @component .progress How far along a plan is, in the accent colour: the inner span sets the width. */
.progress { height: 8px; border-radius: 4px; background: var(--c-band); margin-top: var(--s-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* @component .mark A round check mark: .good (✓), .bad (✗), plain for unknown (–). */
.mark { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-3); background: var(--surface-2); font-size: var(--t-xs); }
.mark.good { background: var(--good-soft); color: var(--good-ink); } .mark.bad { background: var(--off-soft); color: var(--off-ink); }

/* @component .facts Label and value rows (a dl of divs, each with dt and dd), split by hairlines. */
.facts { margin: var(--s-4) 0 0; display: flex; flex-direction: column; }
.facts div { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.facts dt { color: var(--ink-2); } .facts dd { margin: 0; font-weight: 600; text-align: right; }

/* @component table Tables split by hairlines, in a .table-wrap that scrolls sideways; table.sectioned tr.sec is a section heading row. */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
table th, table td { text-align: left; padding: var(--s-2) 10px var(--s-2) 0; border-top: 1px solid var(--line); vertical-align: middle; }
table thead th { border-top: 0; font-size: var(--t-xs); color: var(--ink-3); font-weight: 600; }
table th[scope="row"] { font-weight: 550; }
table.sectioned tr.sec th { padding-top: var(--s-4); font-size: var(--t-xs); color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; border-top: 0; }

/* @component .code Monospace: inline code, and .code for a block. */
code, .code { font-family: var(--mono); font-size: var(--t-xs); }
.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) 14px; overflow-x: auto; color: var(--ink-2); line-height: 1.6; margin: 0 0 10px; }

/* @component .chart The box a chart from charts.js is drawn into (draw()); its svg is a block that never overflows. */
.chart svg { display: block; max-width: 100%; }
.dots svg, .cov svg { width: 100%; display: block; }

/* @component .ph A phrase that stays on one line, so Chinese text breaks between phrases before it breaks inside one. */
.ph { display: inline-block; }
