/* =========================================================================
   Shopping List — app.css
   Minimalist, modern, compact. Mobile-first (375px) up through desktop
   (1280px+). Light and dark themes via [data-theme] / prefers-color-scheme.
   ========================================================================= */

/* ---------- Font (D38, G14): self-hosted Inter ------------------------------ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable-Italic.woff2") format("woff2");
}

/* ---------- Theme tokens -------------------------------------------------- */

[hidden] {
  display: none !important;
}

:root {
  --fg: #1b1c20;
  --fg-muted: #6c6c76;
  --bg: #ffffff;
  --bg-raised: #f6f7f8;
  --accent: #2e7d5b;
  --accent-fg: #ffffff;
  --line: #e2e2e7;
  --checked: #e8f3ec;
  --danger: #b3413b;
  --danger-solid: #b3413b;
  --frozen: #858a93;
  --font-size: clamp(15px, 2.2vw + 8px, 19px);
  --check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 13 9.5 18.5 20 6'/%3E%3C/svg%3E");
  --check-mask-thin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 13 9.5 18.5 20 6'/%3E%3C/svg%3E");
}

[data-theme="light"] {
  color-scheme: light;
}

[data-theme="dark"] {
  --fg: #e8e8ec;
  --fg-muted: #9a9aa4;
  --bg: #16171b;
  --bg-raised: #202127;
  --accent: #5fbf8f;
  --accent-fg: #0c1310;
  --line: #303138;
  --checked: #223327;
  --danger: #e2827c;
  --danger-solid: #b0433d;
  --frozen: #8d929b;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fg: #e8e8ec;
    --fg-muted: #9a9aa4;
    --bg: #16171b;
    --bg-raised: #202127;
    --accent: #5fbf8f;
    --accent-fg: #0c1310;
    --line: #303138;
    --checked: #223327;
    --danger: #e2827c;
    --danger-solid: #b0433d;
    --frozen: #8d929b;
  }
}

/* ---------- Reset / base -------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: var(--font-size);
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
}

/* Page shell: one column, max-width 42rem, mobile-first gutters */
.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 0.75rem 1.5rem;
}

/* ---------- Icons ---------------------------------------------------------- */

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  vertical-align: -0.22em;
  stroke: currentColor;
  fill: none;
}

/* ---------- Buttons ---------------------------------------------------------- */

button {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.4em 0.6em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 40px;
  min-width: 40px;
}

button:hover {
  background: var(--bg-raised);
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.icon-btn {
  min-width: 40px;
  padding: 0.4em;
}

button.primary {
  background: var(--accent);
  color: var(--accent-fg);
}

button.primary:hover {
  filter: brightness(0.95);
}

button.danger {
  color: var(--danger);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: none;
}

/* ---------- Site navigation -------------------------------------------------- */

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  overflow: hidden;
  /* vertical-only: keeps the horizontal gutter inherited from .page
     instead of overriding it with a shorthand reset */
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.site-nav .brand {
  font-weight: 700;
  margin-right: auto;
  padding: 0.4em 0.2em;
  white-space: nowrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--fg-muted);
  padding: 0.35em 0.5em;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}

@media (max-width: 480px) {
  .site-nav {
    gap: 0.05rem;
  }

  .site-nav .brand {
    display: none;
  }

  .site-nav a {
    padding: 0.35em 0.35em;
  }
}

.site-nav .nav-left {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 38%;
  gap: 0.15rem;
}

/* The right group may wrap onto further rows (long translations at phone
   width) but never overflows: every link must stay reachable. */
.site-nav .nav-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  gap: 0.05rem;
  margin-left: auto;
}

.site-nav .page-title {
  margin: 0;
  font-size: 1.05em;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--bg-raised);
}

.site-nav a[aria-current="page"] {
  color: var(--fg);
  background: var(--bg-raised);
}

/* Icon-only secondary nav links (directory, users, account, logout):
   fixed square touch target, no visible label (title/aria-label carry it),
   keeps the nav on one line at narrow widths. */
.site-nav a.icon-link,
.site-nav button.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 40px;
  min-height: 40px;
  padding: 0.35em;
  color: var(--fg-muted);
}

.site-nav button.icon-link:hover {
  background: var(--bg-raised);
}

/* ---------- Lock indicator --------------------------------------------------- */

#lock-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.1rem;
  color: var(--fg-muted);
  font-size: 0.9em;
}

#lock-indicator[data-locked="false"] {
  display: none;
}

#lock-indicator .icon {
  color: var(--fg-muted);
}

#lock-indicator[data-locked="true"] {
  color: var(--fg);
}

#lock-indicator[data-locked="true"] .icon {
  color: var(--accent);
}

/* ---------- Toolbar (G10-G13) -------------------------------------------------
   .toolbar > .tb-left + .tb-right. When the groups do not fit on one row,
   .tb-right drops to its own row, left-aligned (.wrapped is set by core.js). */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.2rem 0.75rem;
  padding: 0.4rem 0;
}

.tb-left,
.tb-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}

.toolbar.wrapped {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.toolbar.wrapped .tb-right {
  justify-content: flex-start;
  margin-right: auto;
}

.toolbar .spacer {
  flex: 1 1 auto;
}

/* Badge, e.g. pending-proposals counter: [data-count="inbox"] */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 0.3em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1;
}

.badge:empty,
.badge[data-count="0"] {
  display: none;
}

/* ---------- Item list viewer -------------------------------------------------- */

ul.viewer {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

/* Finding #11: while dragging a category/supplier header (page_edit.js),
   item rows are hidden so only headers show, making them easy to reorder;
   restored (class removed) as soon as the drag ends. */
ul.viewer.dragging-headers .row.item {
  display: none;
}

/* ---------- Directory list ---------------------------------------------------- */

.dir-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

/* Row DOM (see ARCHITECTURE section 12): li.row.item, li.row.*-header, each with
   .row-left / .row-right, optional .setup-panel as last child.
   Indentation: 1em per --level (0, 1, 2), set inline by viewer.js (O2, D62). */
.row {
  --level: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.5rem;
  min-height: 40px;
  padding: 0.25rem 0.15rem 0.25rem calc(var(--level) * 1em + 0.15rem);
  container-type: inline-size;
}

.row-left,
.row-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.row-left {
  flex: 1 1 0;
}

.row-right {
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 0.1rem;
}

/* D62: narrower row buttons (height and row height stay 40px). */
.row-right button {
  min-width: 32px;
  padding-left: 0.2em;
  padding-right: 0.2em;
}

/* E1 (G8): with a note the left group keeps its natural width (the name is
   not cut while room remains) and the note takes the squeeze. */
.row-left:has(+ .row-right .note) {
  flex: 0 1 auto;
}

.row-left:has(+ .row-right .note) + .row-right {
  flex: 1 1 0;
}

/* G8: the preview always shows the start of the note; when space runs out
   the name is cut (it keeps min-width 3em) rather than the note vanishing. */
.row-left:has(+ .row-right .note) {
  min-width: 0;
}

.row-right .note {
  flex: 0 1 auto;
}

/* G8: keep >= 25% of the row empty between the left and right groups
   whenever a note is shown; the note is cut with an ellipsis. */
.row-left:has(+ .row-right .note) {
  margin-right: calc(25cqw + (var(--level) * 1em + 0.3rem) * 0.25 + 2px);
}

/* Headers (D53, H2-H4): item font size, no background or border. --level
   (set inline) only indents; --hlevel (0 = supplier/family, 1 = category/
   identifier) sets weight and spacing. */
.row:is(.sup-header, .cat-header, .fam-header, .ident-header, .noident-header) {
  --hlevel: 0;
  font-weight: calc(800 - var(--hlevel) * 150);
  margin-top: calc((2 - var(--hlevel)) * 0.3rem);
  background: none;
  border: none;
}

.row:is(.sup-header, .cat-header, .fam-header, .ident-header, .noident-header):first-child {
  margin-top: 0;
}

.row:is(.sup-header, .cat-header, .fam-header, .ident-header, .noident-header) .name {
  cursor: pointer;
  user-select: none;
}

.row .select-children {
  flex: none;
  color: var(--fg-muted);
  min-width: 32px;
  min-height: 32px;
}

/* checkbox: custom drawn so the pending / shop-checked states can be styled */
.row .check {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 1.3em;
  height: 1.3em;
  margin: 0;
  border: 1.5px solid var(--fg-muted);
  border-radius: 4px;
  background: var(--bg);
  cursor: pointer;
}

.row .check::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--accent-fg);
  -webkit-mask: var(--check-mask) center / contain no-repeat;
  mask: var(--check-mask) center / contain no-repeat;
  transform: scale(0);
}

.row .check:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.row .check:checked::before {
  transform: scale(1);
}

.row .check:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* K7: frozen styling is identical for every user; only the color changes. */
.row.frozen .check:disabled {
  opacity: 1;
}

/* name: primary content */
.row .name {
  flex: 0 1 auto;
  min-width: 3em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item.common .name {
  font-weight: 600;
}

/* proposal indicator (lock owner's shopping page) */
.row .prop-ind {
  flex: none;
  font-size: 0.72em;
  font-weight: 600;
  font-style: italic;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.row .prop-ind[data-prop-type="cancel"] {
  color: var(--danger);
}

.row .qty {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  font-variant-numeric: tabular-nums;
}

.row .qty button {
  min-width: 28px;
  min-height: 28px;
  padding: 0.2em;
}

.row .qty output,
.row .qty .value {
  min-width: 1.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.row .sup {
  flex: none;
  color: var(--fg-muted);
  font-size: 0.85em;
  white-space: nowrap;
}

.row .note {
  flex: 0 1 auto;
  min-width: min(4.5em, 18cqw);
  max-width: 30cqw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
  color: var(--fg-muted);
  font-size: 0.9em;
  text-align: right;
}

.row .setup,
.row .add-notes {
  flex: none;
  color: var(--fg-muted);
}

.row .setup[aria-expanded="true"] {
  color: var(--accent);
  background: var(--bg-raised);
}

.row .handle {
  flex: none;
  color: var(--fg-muted);
  cursor: grab;
  touch-action: none;
}

.row .handle:active {
  cursor: grabbing;
}

/* ---------- Pending proposals (P12) ------------------------------------------- */

.row.pending .name {
  font-weight: 700;
  font-style: italic;
}

/* cancel: no mark, box filled with the danger colour (K9) */
.row.pending[data-prop-type="cancel"] .check,
.row.pending[data-prop-type="cancel"] .check:checked {
  background: var(--danger);
  border-color: var(--danger);
}

.row.pending[data-prop-type="cancel"] .check::before,
.row.pending[data-prop-type="cancel"] .check:checked::before {
  transform: scale(0);
}

/* new: mark in the foreground colour, box filled with the background colour */
.row.pending[data-prop-type="new"] .check,
.row.pending[data-prop-type="new"] .check:checked {
  background: var(--bg);
  border-color: var(--fg);
}

.row.pending[data-prop-type="new"] .check::before {
  background: var(--fg);
  transform: scale(1);
}

/* edit: unchanged */

/* ---------- Setup panel (G16, G17, G18) --------------------------------------- */

/* last child, hidden unless its opener is expanded; no top border, a bottom
   border, and horizontal margins so it is narrower than the row */
.setup-panel {
  display: none;
  flex: none;
  width: calc(100% - 1.8rem);
  order: 99;
  margin: 0.1rem 0.9rem 0.3rem 0.9rem;
  padding: 0 0 0.5rem;
  border: none;
  border-bottom: 1px solid var(--line);
}

.row:has(.setup[aria-expanded="true"]) > .setup-panel,
.row.open > .setup-panel,
.setup-panel.open {
  display: block;
}

.setup-panel .field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  flex-wrap: wrap;
}

/* one label style on select and edit */
.setup-panel .field > label,
.setup-panel .field > .label {
  flex: 0 0 7rem;
  color: var(--fg-muted);
  font-size: 0.85em;
}

.setup-panel input[type="text"],
.setup-panel input[type="number"],
.setup-panel input[type="date"],
.setup-panel select,
.setup-panel textarea {
  flex: 1 1 8rem;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35em 0.5em;
}

.setup-panel textarea {
  resize: vertical;
  min-height: 2.4em;
}

/* Actual field (P12): read-only, possibly multi-line */
.setup-panel .actual {
  flex: 1 1 8rem;
  min-width: 0;
  white-space: pre-line;
  font-size: 0.9em;
  color: var(--fg-muted);
}

.setup-panel .actual b,
.setup-panel .actual strong {
  color: var(--fg);
  font-weight: 600;
}

/* edit setup buttons: outlined; delete in solid red (G18) */
.setup-panel .setup-actions,
.setup-panel .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.4rem;
}

.setup-panel button:not(.icon-btn):not(.danger):not(.qty button) {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
}

.setup-panel button:not(.icon-btn):not(.danger):not(.qty button):hover {
  background: var(--bg-raised);
}

.setup-panel button.danger,
.setup-panel button.danger:hover {
  background: var(--danger-solid);
  border-color: var(--danger-solid);
  color: #ffffff;
}

.setup-panel button.danger:hover {
  filter: brightness(1.08);
}

/* identifier editor (edit setup panel) */
.setup-panel .identifier-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
}

.setup-panel .identifier-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  padding: 0.1em 0.2em 0.1em 0.6em;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9em;
}

.setup-panel .identifier-chip button {
  min-height: 0;
  min-width: 0;
  padding: 0 0.4em;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-size: 1.1em;
  line-height: 1.4;
  cursor: pointer;
}

.setup-panel .identifier-chip button:hover {
  color: var(--danger);
}

.setup-panel .identifier-add {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.setup-panel .identifier-add input {
  flex: 1 1 auto;
  min-width: 0;
}

.setup-panel .field-error {
  color: var(--danger);
  font-size: 0.8em;
  margin-top: 0.2em;
}

/* ---------- Checked styles per page (ARCHITECTURE section 12) ---------------- */

/* shopping (G9): no checkbox border or fill, thin grey check, grey struck name */
.item.checked-shop .check,
.item.checked-shop .check:checked {
  background: transparent;
  border-color: transparent;
}

.item.checked-shop .check::before {
  background: var(--fg-muted);
  -webkit-mask-image: var(--check-mask-thin);
  mask-image: var(--check-mask-thin);
}

.item.checked-shop .name {
  color: var(--fg-muted);
  text-decoration: line-through;
}

.item.checked-shop .note {
  color: var(--fg-muted);
}

/* select_items: normal */

/* frozen items (K7): name and controls in the frozen gray; the checkbox uses
   it where it would use the accent or danger colour. Pending styling keeps its
   shape, drawn in gray. */
.row.frozen .name,
.row.frozen .qty,
.row.frozen .sup,
.row.frozen .setup,
.row.frozen .add-notes,
.row.frozen .remove-item,
.row.frozen .handle,
.row.frozen .prop-ind {
  color: var(--frozen);
}

.row.frozen .check:checked,
.row.frozen.pending[data-prop-type="cancel"] .check,
.row.frozen.pending[data-prop-type="cancel"] .check:checked {
  background: var(--frozen);
  border-color: var(--frozen);
}

.row.frozen.pending[data-prop-type="new"] .check,
.row.frozen.pending[data-prop-type="new"] .check:checked {
  background: var(--bg);
  border-color: var(--frozen);
}

.row.frozen.pending[data-prop-type="new"] .check::before {
  background: var(--frozen);
}

.row.frozen .setup[aria-expanded="true"] {
  color: var(--frozen);
}

/* shopping extras: remove from trip (K-series, C20) */
.row .remove-item {
  flex: none;
  color: var(--fg-muted);
}

/* The edit toolbar has no .tb-right (A2): the left group simply fills the row. */
.toolbar > .tb-left:only-child {
  flex: 1 1 auto;
}

/* edit_list: highlighted background */
.item.checked-edit {
  background: var(--checked);
}

/* ---------- Dialogs ------------------------------------------------------------ */

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: var(--bg);
  color: var(--fg);
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow: auto;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

dialog h2,
dialog .dialog-title {
  font-size: 1.05em;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

/* G19: two-column grid, label and input share a line. dialogs.js renders
   .dialog-grid > label.dialog-field > (.dialog-field-label + control). The
   label column is capped so the inputs always keep a usable width; long
   labels wrap instead of squeezing the input. */
dialog .dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(9rem, 1fr);
  align-items: start;
  gap: 0.5rem 0.75rem;
}

dialog .dialog-grid .dialog-field {
  display: contents;
}

dialog .dialog-grid .dialog-field-label {
  color: var(--fg-muted);
  font-size: 0.9em;
  max-width: 12rem;
  overflow-wrap: anywhere;
  /* label box starts at the input's top; the padding lines up the text */
  padding-top: 0.55em;
}

dialog .dialog-grid input[type="checkbox"] {
  justify-self: start;
  margin: 0.1em 0 0;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

dialog .dialog-grid .dialog-field:has(input[type="checkbox"]) .dialog-field-label {
  padding-top: 0;
}

dialog input:not([type="checkbox"]),
dialog select,
dialog textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45em 0.6em;
  width: 100%;
  min-width: 0;
}

dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ---------- Toast --------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  padding: 0.6em 1em;
  border-radius: 8px;
  font-size: 0.9em;
  max-width: calc(100vw - 2rem);
  z-index: 50;
}

/* ---------- Offline state -------------------------------------------------------- */

.offline-banner {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-raised);
  color: var(--fg-muted);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.85em;
  margin: 0.5rem 0;
}

body.offline .offline-banner {
  display: flex;
}

body.offline [data-online-only] {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Sync indicator -------------------------------------------------------- */

body.syncing::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  animation: sl-sync 1s ease-in-out infinite;
  z-index: 60;
}

@keyframes sl-sync {
  0% { opacity: 0.25; }
  50% { opacity: 1; }
  100% { opacity: 0.25; }
}

/* ---------- Utility ---------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.empty-state {
  padding: 2rem 0.5rem;
  text-align: center;
  color: var(--fg-muted);
}

@media (max-width: 480px) {
  .row .note {
    max-width: 22cqw;
  }
}

/* ---------- Wider screens ------------------------------------------------------------ */

@media (min-width: 720px) {
  .page {
    padding: 0 1rem 2rem;
  }

  /* D62 (L3): keep the icon gap at about half of v3 on desktop too; the
     note-to-button gap is the same flex gap. */
  .row-right {
    gap: 0.3rem;
  }
}

.row.sup-header.selected,
.row.cat-header.selected,
.row.fam-header.selected,
.row.ident-header.selected {
  background: var(--checked);
}
