/* Shared app and site components (audit A6). Loaded after tokens.css; uses
   existing tokens only. Icons: <svg class="icon"><use href="/site/ui/icons.svg#i-check"/></svg>. */

/* — icons — */
.icon { width: 24px; height: 24px; flex: none; display: block; fill: none; stroke: currentColor; }
.icon--40 { width: 40px; height: 40px; stroke-width: 2px; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: var(--touch-min); height: var(--touch-min); padding: 0;
  color: var(--color-text); background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-control); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-in-out), transform var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.icon-btn:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); transform: scale(0.98); transition-duration: var(--dur-instant); }

/* — container, 12-column grid, page header —
   Container: 1240px of content plus a fluid gutter, so content keeps its width at 1920 (content-box). */
.container { box-sizing: content-box; max-width: var(--container, 1240px); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); display: flex; flex-direction: column; gap: var(--space-8); }
.grid-12 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter, 24px); }
@media (min-width: 1024px) { .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.page-header h1 { margin: 0; min-width: 0; font-family: var(--font-heading); font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }
.page-header__title { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.page-header__meta { display: block; margin: 0; line-height: normal; font-family: var(--font-mono); font-size: 13px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.page-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* — chip extras: the chip itself (size, selected, hover, disabled) is in tokens.css. A row of them, and the count
   and label parts a filter chip carries. — */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip__count { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.chip[aria-pressed="true"] .chip__count, .chip[aria-current="page"] .chip__count { color: inherit; opacity: 0.7; }
.chip__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }

/* — breadcrumbs: the last crumb is the page, ink and 600, one line, cut at 28 characters (full name in
   its title attribute and as the H1). Earlier crumbs never shrink. Links have a 24px hit area. — */
.breadcrumbs { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--color-text-muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.breadcrumbs li:not(:last-child) { flex: none; }
.breadcrumbs li + li::before { content: "/"; color: var(--color-text-muted); flex: none; }
.breadcrumbs a { display: inline-flex; align-items: center; flex: none; min-height: 24px; color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-text); text-decoration: underline; text-decoration-color: var(--color-highlight); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.breadcrumbs [aria-current="page"] { display: block; min-width: 0; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); font-weight: var(--weight-semibold); }

/* — status line: "Saved · 12:04" beside the control that did it. No colour, no tick. — */
.status-line { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }

/* — pagination: Previous / Next pill buttons with the page text between. One page or fewer hides it. — */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.pagination__status { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }

/* — form states (Foundations: invalid, helper, read-only, disabled, busy) —
   The input itself, invalid, read-only, disabled and .field-error are in tokens.css. Here: the alert icon beside
   the message, a textarea that grows with its text, the select chevron and the label of a disabled field. A valid
   field simply looks normal: no tick, no success message. */
textarea.input { max-height: calc(6 * 1.45em + 24px); overflow-y: auto; field-sizing: content; }
.field-error .icon { width: 16px; height: 16px; margin-top: 1px; stroke-width: 2.2px; }
/* A select keeps the input shape; the chevron is an ink icon laid over it. */
.select-wrap { position: relative; }
select.input { appearance: none; -webkit-appearance: none; padding-inline-end: 40px; }
.select-wrap > .icon { position: absolute; inset-inline-end: 12px; top: 15px; width: 18px; height: 18px; stroke-width: 2.2px; pointer-events: none; }
.field > label:has(+ .input:disabled) { color: var(--color-text-muted); }

/* Busy: keeps its fill, size and position; clicks are ignored (the label becomes "Saving…"). */
.btn[aria-busy="true"] { pointer-events: none; cursor: progress; }

/* A locked item (a feature above the plan, a viewer's action): a dashed row, the reason as one sentence
   and the plan as a text tag. Not removed, not hidden. */
.locked { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 14px 16px; border: 1px dashed var(--color-border-control); border-radius: var(--radius-control); color: var(--color-text-muted); }
.locked__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.locked__title { font-size: 15px; font-weight: var(--weight-semibold); }
.locked__reason { font-size: 13px; }

/* — tags (11px mono, never wrap, never a colour besides the highlighter fill and ink) — */
.tag { padding: 3px 8px; border: 1px solid var(--color-line); border-radius: 8px; font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-medium); letter-spacing: 0; color: var(--color-text-muted); white-space: nowrap; }
.tag.tag-neutral { background: var(--color-neutral-100); border-color: var(--color-line); color: var(--color-neutral-800); }
.tag.tag-outline { border-color: var(--color-border-control); color: var(--color-text); }
.tag.mark--tag { margin: 0; padding: 3px 8px; font-size: 11px; font-weight: var(--weight-medium); line-height: inherit; background: var(--color-highlight); border-color: var(--color-highlight); color: var(--color-on-highlight); }
.tag--soon { border-style: dashed; }
.tag--ink { background: var(--color-text); border-color: var(--color-text); color: var(--color-bg); }
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* — long content: what truncates, what wraps, where the full value lives — */
.truncate { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.wrap-anywhere { overflow-wrap: anywhere; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* Present for a screen reader, invisible and out of the layout (an action column's header, a disabled button's reason). */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* — form group and login — */
.form-group { display: flex; flex-direction: column; gap: var(--space-4); }
.form-group .field > label { font-size: 14px; font-weight: var(--weight-medium); color: var(--color-text-muted); }
.form-hint { margin-top: 6px; font-size: 13px; color: var(--color-text-muted); }
.form-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.form-actions .btn { width: 100%; }
@media (min-width: 721px) { .form-actions { flex-direction: row; justify-content: flex-end; } .form-actions .btn { width: auto; } }
.login-card {
  width: min(400px, 100%); margin-inline: auto; display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-6); background: var(--color-surface); border-radius: var(--radius-card); box-shadow: var(--shadow-1);
}
.login-card h1 { margin: 0; font-size: 24px; font-weight: var(--weight-bold); line-height: 1.2; }
.login-card__foot { font-size: 14px; }
.login-card__foot a { display: inline-flex; align-items: center; min-height: var(--touch-min); }

/* — codes list extras — */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.filter-row .field { flex: 1; min-width: 200px; }
.stat-row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: 0; font-size: 14px; }
.stat-row dt { color: var(--color-text-muted); }
.stat-row dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.stat-row > div { display: flex; gap: var(--space-2); }

/* — tabs: the current tab is ink with a 2px ink underline; hover is ink; muted otherwise. Tabs never wrap.
   More than 3 tabs at 720px and below are ONE row that scrolls sideways (R34): 44px tabs, snap on every
   tab, no visible scrollbar, a 24px fade on each side that has more (data-edge="middle" | "end" | "none" set by
   the Tabs component; without it the fade is on the right). At 721px and up the row never scrolls. — */
.tabs { position: relative; display: flex; flex-wrap: nowrap; gap: var(--space-1); overflow-x: auto; border-bottom: 1px solid var(--color-line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; flex: none; min-height: var(--touch-min);
  padding: 0 14px; font: inherit; font-size: 14.5px; font-weight: var(--weight-semibold); white-space: nowrap;
  color: var(--color-text-muted); background: transparent; border: 0; cursor: pointer; text-decoration: none;
  transition: color var(--dur-fast) var(--ease-in-out);
}
.tab:hover { color: var(--color-text); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--color-text); }
.tab::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: -1px; height: 2px; border-radius: 1px;
  background: var(--color-text); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { transform: scaleX(1); }
@media (max-width: 720px) {
  .tabs--scroll, .tabs:has(> .tab:nth-child(4)) {
    scroll-snap-type: x mandatory;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
  }
  .tabs--scroll[data-edge="middle"], .tabs:has(> .tab:nth-child(4))[data-edge="middle"] {
    -webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
  }
  .tabs--scroll[data-edge="end"], .tabs:has(> .tab:nth-child(4))[data-edge="end"] {
    -webkit-mask-image: linear-gradient(to left, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(to left, black calc(100% - 24px), transparent);
  }
  .tabs--scroll[data-edge="none"], .tabs:has(> .tab:nth-child(4))[data-edge="none"] { -webkit-mask-image: none; mask-image: none; }
  .tabs--scroll > .tab, .tabs:has(> .tab:nth-child(4)) > .tab { scroll-snap-align: center; }
}
@media (min-width: 721px) { .tabs--scroll { overflow-x: visible; } }

/* — tables (R33): one rule for every table. 721px and up it is a table: a mono 11.5px caps header row,
   12 x 14px cells, 1px lines between rows, a paper wash on row hover. At 720px and below a .table--stack
   table becomes a stack of row cards: the first column is the card title (two lines at most), every
   other column ONE line, "Label: value", the label drawn from the cell's data-label. The header row stays
   for screen readers. Never a sideways scroll, never a clipped column. — */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--color-line); border-radius: var(--radius-box); background: var(--color-surface); }
.table { font-size: 14.5px; }
.table th, .table td { padding: 12px 14px; text-align: start; vertical-align: top; border-top: 1px solid var(--color-line); border-bottom: 0; overflow-wrap: anywhere; }
.table thead th {
  border-top: 0; font-family: var(--font-mono); font-size: 11.5px; font-weight: var(--weight-medium);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-caption);
}
.table tbody th { font-size: inherit; font-weight: var(--weight-semibold); color: var(--color-text); }
@media (hover: hover) { .table tbody tr:hover { background: var(--color-bg); } }
.table .num, .table td.num { text-align: end; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.table .nw { white-space: nowrap; }
.table .act { text-align: end; }
.table-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: 22px 14px; border-top: 1px solid var(--color-line); text-align: center; font-size: 15px; font-weight: var(--weight-semibold); color: var(--color-text); }
@media (max-width: 720px) {
  .table-wrap:has(> .table--stack) { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack th, .table--stack td { display: block; }
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tr { margin-bottom: 10px; padding: 14px 16px; border: 1px solid var(--color-line); border-radius: var(--radius-box); background: var(--color-surface); }
  .table--stack tbody tr:hover { background: var(--color-surface); }
  .table--stack tbody th { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; padding: 0 0 6px; border: 0; font-size: 16px; }
  .table--stack td { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 5px 0; border: 0; font-size: 14px; text-align: start; }
  .table--stack td[data-label]::before { content: attr(data-label) ":"; font-family: var(--font-body); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
  .table--stack td.num { font-size: 14px; }
  .table--stack td.act { justify-content: flex-end; }
  .table--stack td.act::before { content: none; }
  .table--stack td.act > .btn-icon, .table--stack td.act > .icon-btn { width: 40px; height: 40px; min-height: 40px; }
}

/* — dialog (R37): centred, 440px at most, 20px radius, 24px padding, on --color-backdrop. Title Bricolage 700
   22px, one sentence of consequence, two buttons right-aligned: the safe one (Cancel) first, the destructive
   one a rust outline named for what it does. At 720px and below it is a bottom sheet: full width, 20px top
   corners, a grab line, buttons stacked full width with the destructive one first and Cancel last (nearest
   the thumb), the close button dropped, content taller than 80% of the screen scrolls with the buttons
   pinned. Works on a native <dialog> (focus return, Esc, trap) and on a div inside .dialog-backdrop. — */
.dialog {
  gap: 14px; padding: 24px; width: 100%; max-width: 440px; border: 1px solid var(--color-line);
  color: var(--color-text); animation: ui-rise var(--dur-base) var(--ease-out);
}
div.dialog { position: relative; }
dialog.dialog { margin: auto; max-height: calc(100dvh - 32px); overflow: auto; }
dialog.dialog:not([open]) { display: none; }
dialog.dialog::backdrop { background: var(--color-backdrop); }
.dialog:focus { outline: none; }
.dialog-title { margin: 0; padding-inline-end: 44px; font-size: 22px; font-weight: var(--weight-bold); letter-spacing: -0.02em; line-height: 1.15; }
.dialog-body { margin: 0; font-size: 15px; line-height: 1.5; color: var(--color-text-muted); }
.dialog-body > p { margin: 0; }
.dialog-actions { gap: 10px; flex-wrap: wrap; margin-top: 0; }
.dialog__close {
  position: absolute; top: 12px; inset-inline-end: 12px; display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0; color: var(--color-text); background: transparent; border: 0; border-radius: var(--radius-pill); cursor: pointer;
}
.dialog__grab { display: none; align-self: center; width: 40px; height: 4px; border-radius: var(--radius-pill); background: var(--color-border-control); opacity: 0.6; }
@keyframes ui-rise { from { opacity: 0; transform: translateY(var(--lift)); } }
@keyframes ui-sheet { from { transform: translateY(100%); } }
@media (max-width: 720px) {
  .dialog-backdrop:has(> .dialog) { align-items: end; padding: 0; }
  .dialog { max-width: none; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; max-height: 80dvh; overflow: auto; animation: ui-sheet var(--dur-slow) var(--ease-out); }
  dialog.dialog { margin: auto 0 0; width: 100%; max-width: none; max-height: 80dvh; }
  .dialog__grab { display: block; }
  .dialog__close { display: none; }
  .dialog-title { padding-inline-end: 0; }
  .dialog-actions { position: sticky; bottom: 0; flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; flex: 1 1 100%; }
}

/* — toast (R37): a pill, ink fill, paper text, centred 16px above the bottom edge (above the Download strip on
   the generator), role="status". Gone after 4 seconds, 8 if it has an action; hover and focus keep it. One at
   a time. Confirms a thing already done; never the only record of an error. — */
.toast {
  position: fixed; inset-inline: 0; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; width: fit-content;
  max-width: min(440px, calc(100vw - 32px)); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 12px 16px;
  font-size: 14px; font-weight: var(--weight-medium); color: var(--color-bg); background: var(--color-text);
  border-radius: var(--radius-pill); box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.4);
  animation: ui-rise var(--dur-base) var(--ease-out);
}
.toast:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
.toast--static { position: static; margin-inline: 0; animation: none; }
.toast__action, .toast .btn {
  min-height: 32px; padding: 0 4px; font: inherit; font-weight: var(--weight-semibold); color: inherit; background: transparent; border: 0; border-radius: 0;
  text-decoration: underline; text-decoration-color: var(--color-highlight); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer;
}

/* — loading: static --line bars with the shape of the content; no shimmer and no spinner, so nothing moves
   and there is no loop to pause. Shown after a 150ms delay so a fast load never flashes. The region carries
   aria-busy="true"; the real content replaces it in place. Lists show 3 rows, tables 5. — */
.skeleton { display: block; height: 12px; min-height: 0; background: var(--color-line); border-radius: 6px; opacity: 0; animation: ui-reveal 0s linear 150ms forwards; }
.skeleton--row { height: 76px; border-radius: var(--radius-box); }
.skeleton--line { height: 12px; border-radius: 6px; }
.skeleton--title { height: 16px; }
.skeleton--button { height: 40px; margin-top: var(--space-1); border-radius: var(--radius-pill); }
.skeleton--thumb { width: 44px; height: 44px; border-radius: var(--radius-mark); }
.skeleton--w-46 { width: 46%; }
.skeleton--w-62 { width: 62%; }
.skeleton--w-78 { width: 78%; }
.skeleton-card { display: flex; flex-direction: column; gap: 10px; padding: var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius-box); background: var(--color-surface); }
@keyframes ui-reveal { to { opacity: 1; } }

/* — progress: a determinate 8px track (--color-line) with an ink fill and a mono count beside the title.
   Native <progress class="progress"> or a div with .progress__fill (width from --w). At 100% it turns into
   the result notice. — */
.progress-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius-box); background: var(--color-surface); }
.progress-card__head { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 14px; }
.progress-card__title { font-weight: var(--weight-semibold); }
.progress-card__count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.progress { display: block; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: var(--radius-pill); background: var(--color-line); appearance: none; -webkit-appearance: none; }
.progress::-webkit-progress-bar { background: var(--color-line); border-radius: var(--radius-pill); }
.progress::-webkit-progress-value { background: var(--color-text); border-radius: var(--radius-pill); }
.progress::-moz-progress-bar { background: var(--color-text); border-radius: var(--radius-pill); }
.progress__fill { display: block; height: 100%; width: var(--w, 0%); background: var(--color-text); border-radius: var(--radius-pill); }

/* — empty state: first-use only, and the one primary action on the page. A 1.5px dashed panel, a 28px line
   icon, a Bricolage 700 20px title, one sentence, one action. — */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: var(--space-8) var(--space-4); text-align: center; }
.empty-state__title { margin: 0; font-family: var(--font-heading); font-size: 20px; font-weight: var(--weight-bold); letter-spacing: -0.02em; line-height: 1.2; }
.empty-state__text { margin: 0; max-width: 36ch; font-size: 14.5px; line-height: 1.5; color: var(--color-text-muted); }
.empty-dashed, .retry-panel {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 20px; text-align: center;
  border: 1.5px dashed var(--color-border-control); border-radius: var(--radius-well);
}
.empty-dashed > .icon, .retry-panel > .icon { width: 28px; height: 28px; stroke-width: 1.8px; color: var(--color-text-muted); }
.empty-dashed > .btn, .retry-panel > .btn { margin-top: 6px; }
/* The retry panel: same layout, a solid 1px line and surface fill, neutral (never red). It says what happened
   to the data ("Nothing was changed"), offers Try again and a short reference for support, and replaces the
   failed region only, not the page. */
.retry-panel { border: 1px solid var(--color-line); background: var(--color-surface); }
.retry-panel__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: 6px; }
.retry-panel__ref { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--color-text-muted); }

/* — notice (R3): 1.5px ink border, surface fill, 14px radius, 16 x 18px padding, a 15px title, one or two
   lines of body, at most one action. Billing states (failed card, ending, cancelled, paused editing) use this
   neutral notice, never red. It sits under the page title and pushes content down; it never floats over it.
   --quiet is a 1px line for information that needs no action; --invalid is the only red, validation only
   (a blocked export, an invalid batch). — */
.notice { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--color-surface); border: 1.5px solid var(--color-text); border-radius: var(--radius-box); }
.notice--quiet { border: 1px solid var(--color-line); }
.notice--invalid { background: var(--color-invalid-soft); border-color: var(--color-invalid-border); }
.notice__title { margin: 0; font-size: 15px; font-weight: var(--weight-semibold); }
.notice__body { margin: 0; font-size: 14px; line-height: 1.5; color: var(--color-text-muted); }
.notice__action { margin-top: 6px; }
.notice--invalid .notice__title { color: var(--color-invalid); }
.notice--invalid .notice__body { color: var(--color-text); }

/* — menu and listbox: the kebab button and its open panel (or a select's open list). 14px radius, 44px items,
   paper wash on hover or arrow-key focus, delete in rust below a rule. --static draws the open panel in the flow
   (a specimen, a screenshot) instead of floating under its button; --hot is the item the arrow keys are on. — */
.popmenu { position: relative; display: inline-flex; }
.popmenu__button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: var(--color-text-muted); background: transparent; border: 0; border-radius: var(--radius-pill); cursor: pointer; }
.popmenu__button:hover, .popmenu__button[aria-expanded="true"] { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.popmenu__button--label { width: auto; padding: 0 var(--space-4); min-height: var(--touch-min); font: inherit; font-weight: var(--weight-semibold); font-size: 14px; color: var(--color-text); border: 1px solid var(--color-line); background: var(--color-surface); }
.popmenu__panel { position: absolute; top: calc(100% + 6px); z-index: 50; display: flex; flex-direction: column; min-width: 200px; max-width: calc(100vw - 32px); padding: 6px; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-box); box-shadow: var(--shadow-raised); }
.popmenu__panel--end { inset-inline-end: 0; }
.popmenu__panel--start { inset-inline-start: 0; }
.popmenu__panel--up { top: auto; bottom: calc(100% + 6px); }
.popmenu__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--touch-min); padding: 0 var(--space-3); font: inherit; font-size: 14.5px; font-weight: var(--weight-medium); color: var(--color-text); text-align: start; text-decoration: none; background: transparent; border: 0; border-radius: var(--radius-item); cursor: pointer; }
.popmenu__item:hover, .popmenu__item:focus-visible { background: var(--color-bg); }
.popmenu__item[aria-disabled="true"] { color: var(--color-text-muted); cursor: not-allowed; }
.popmenu__tag { display: inline-flex; align-items: center; padding: 3px 8px; font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); border: 1px solid var(--color-line); border-radius: var(--radius-mark); }
.popmenu__rule { height: 1px; margin: 4px 0; background: var(--color-line); }
.popmenu__panel--static { position: static; min-width: 0; max-width: none; }
.popmenu__item--hot { background: var(--color-bg); }
/* Listbox panel (ui/Listbox.tsx) */
.listbox__panel { width: 300px; padding: 0; overflow: hidden; line-height: normal; }
.listbox__list { display: flex; flex-direction: column; max-height: 312px; overflow: auto; padding: 6px; }
.listbox__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listbox__end { display: inline-flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.listbox__end .icon { width: 16px; height: 16px; stroke-width: 2.4px; }
.listbox__count { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.listbox__footer { padding: 6px; border-top: 1px solid var(--color-line); }
.listbox__more { font-weight: var(--weight-semibold); }
.listbox__more .icon { width: 14px; height: 14px; stroke-width: 2.4px; }

/* — tooltip / chart readout: ink fill, paper text, 12.5px, radius 10, no arrow. The same text is always in
   the table below the chart. — */
.tooltip { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 12.5px; color: var(--color-bg); background: var(--color-text); border-radius: var(--radius-item); box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.4); }
.tooltip__label { color: color-mix(in oklab, var(--color-bg) 70%, var(--color-text)); }
.tooltip__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* — copy button: a small secondary pill that copies a value. The default and copied labels sit in one grid
   cell so the button keeps its width when the label changes; data-state="copied" shows the second label. — */
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); flex: none; min-height: 40px; padding: 0 16px;
  font: inherit; font-size: 14px; font-weight: var(--weight-semibold); line-height: 1.2; white-space: nowrap;
  color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-pill); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-in-out), border-color var(--dur-fast) var(--ease-in-out), transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .copy-btn:hover { transform: translateY(calc(var(--lift-hover) * -1)); } }
.copy-btn:active { background: var(--color-bg); transform: none; transition-duration: var(--dur-instant); }
.copy-btn__labels { display: inline-grid; }
.copy-btn__label { grid-area: 1 / 1; }
.copy-btn__label--done { visibility: hidden; }
.copy-btn[data-state="copied"] { border-color: var(--color-text); }
.copy-btn[data-state="copied"] .copy-btn__label--idle { visibility: hidden; }
.copy-btn[data-state="copied"] .copy-btn__label--done { visibility: visible; }
.copy-btn[aria-disabled="true"], .copy-btn[aria-disabled="true"]:hover, .copy-btn:disabled {
  color: var(--color-text-muted); background: transparent; border: 1px dashed var(--color-border-control); transform: none; cursor: not-allowed;
}

/* — analytics: chart in ink and neutrals, table below — */
.chart { display: block; width: 100%; height: auto; color: var(--color-text); }
.chart__grid { stroke: var(--color-border-control); stroke-width: 1; fill: none; }
.chart__line { stroke: var(--color-text); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--2 { stroke: var(--color-neutral-600); stroke-dasharray: 6 4; }
.chart__label { fill: var(--color-text-muted); font-family: var(--font-mono); font-size: 12px; }

/* — settings rows — */
.settings-list { margin: 0; padding: 0; list-style: none; }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 64px; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-line); }
.settings-row__label { font-size: 15px; font-weight: var(--weight-semibold); }
.settings-row__value { font-size: 14px; color: var(--color-text-muted); }

/* — location currency (D53) —
   Every price is five spans, one per currency (scripts/lib/money.mjs, app/components/ui/Money.tsx). The non-fallback spans carry
   `hidden`, so with no script one price shows. site/ui/currency.generated.js sets html[data-cur] in <head>: once it is set,
   every span is hidden and the one matching it is shown. `.money--fixed` is a subscribed account's charged currency and always shows. */
html[data-cur] .money { display: none; }
html[data-cur] .money--fixed,
html[data-cur=GBP] .money[data-cur=GBP],
html[data-cur=USD] .money[data-cur=USD],
html[data-cur=EUR] .money[data-cur=EUR],
html[data-cur=CAD] .money[data-cur=CAD],
html[data-cur=AUD] .money[data-cur=AUD] { display: inline; }

/* — password field: Show/Hide text button inside the input's trailing edge (board: Auth). The input reserves the
     button's width in both states, so toggling never moves layout. — */
.pw { position: relative; }
.pw > .input { padding-inline-end: 76px; }
.pw__toggle {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  min-height: 32px; min-width: 56px; padding: 0 10px; border: 0; background: none;
  color: var(--color-text); font: inherit; font-size: 14px; font-weight: var(--weight-semibold, 600);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: var(--radius-mark);
}

/* — code field: six equal boxes over one real input (boards: AuthCode, AuthReset; D96). The input is transparent
     and covers the boxes; the boxes only render its value. — */
.otp { position: relative; display: flex; justify-content: space-between; gap: 10px; width: 100%; }
.otp__boxes { display: contents; }
.otp__box {
  flex: 1 1 0; min-width: 0; height: 56px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-control); border: 1.5px solid var(--color-border-control);
  background: var(--color-surface); color: var(--color-text);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 500; line-height: 1;
}
.otp__box.is-active { border-color: var(--color-text); box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-text); }
.otp.is-invalid .otp__box { border-color: var(--color-invalid-border); }
.otp__input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;
  background: transparent; color: transparent; caret-color: transparent; font-size: 16px; opacity: .01;
}
@media (max-width: 390px) { .otp__box { height: 52px; } }
