/* kindly – calm, warm, readable. Styles plain HTML elements so allauth's
   templates look right without overriding each of them. */

:root {
  --bg: #fbf8f4;
  --surface: #ffffff;
  --text: #2b2a28;
  --muted: #6b6760;
  --accent: #3f7d6e;
  --accent-strong: #2f6457;
  --series: #0e8a6f;  /* charts: checked with the dataviz validator (chroma, lightness band, 3:1) */
  /* the comparison chart: categorical slots 1-4 in fixed order (dataviz default palette, validated
     against both surfaces; light mode below 3:1 for 2-4, so the chips name every line and the
     tooltip gives every value) */
  --cat-1: #257de0; --cat-2: #f47230; --cat-3: #00b894; --cat-4: #f2a600;
  --border: #e4ddd3;
  --error: #a33a2b;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1c1a;
    --surface: #262522;
    --text: #ece8e1;
    --muted: #a8a299;
    --accent: #6fb3a2;
    --accent-strong: #8cc7b8;
    --series: #2ab08f;
    --cat-1: #338ced; --cat-2: #e76624; --cat-3: #00a888; --cat-4: #d28e05;
    --border: #3a3834;
    --error: #e0897c;
  }
}

* { box-sizing: border-box; }
body { margin: 0; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font-weight: 700; font-size: 1.3rem; color: var(--accent); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--accent-strong); }

.content { max-width: 40rem; margin: 2rem auto; padding: 0 1.5rem; }
h1 { font-size: 1.6rem; margin-top: 0; }
h2 { font-size: 1.2rem; }
a { color: var(--accent-strong); }

form p { margin: 0 0 1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input[type="checkbox"] + label, input[type="radio"] + label { display: inline; font-weight: normal; margin-left: 0.4rem; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button, input[type="submit"] {
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin: 0 0.5rem 0.5rem 0;
}
button:hover, input[type="submit"]:hover { background: var(--accent-strong); }

ul.errorlist, .errorlist { color: var(--error); padding-left: 1.2rem; }
.messages { list-style: none; padding: 0; }
.message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 0.5rem;
}
.message-error { border-color: var(--error); color: var(--error); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }
code, pre { font-family: ui-monospace, monospace; }

/* Data sources */
.source {
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.source h2 { margin-top: 0; }
.source table { margin: 1rem 0; font-size: 0.95rem; }
.actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem; margin-top: 1rem; }
.actions form { margin: 0; }
details { margin: 0.75rem 0; }
form ul { list-style: none; padding-left: 0; }
form ul label { font-weight: normal; }

/* Admin accounts (ADR-0012): same look, opposite colour scheme, so it is
   always obvious that one is in the administration (see admin.css). */
html.admin-mode {
  --bg: #1d1c1a; --surface: #262522; --text: #ece8e1; --muted: #a8a299;
  --accent: #6fb3a2; --accent-strong: #8cc7b8; --border: #3a3834; --error: #e0897c;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html.admin-mode {
    --bg: #fbf8f4; --surface: #ffffff; --text: #2b2a28; --muted: #6b6760;
    --accent: #3f7d6e; --accent-strong: #2f6457; --border: #e4ddd3; --error: #a33a2b;
    color-scheme: light;
  }
}
html.admin-mode, html.admin-mode body { background: var(--bg); color: var(--text); }
.site-header--admin { border-bottom: 2px solid var(--accent); }
.brand-mode {
  font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; vertical-align: middle;
  margin-left: 0.4rem; padding: 0.15rem 0.5rem; border-radius: 4px; background: var(--accent); color: var(--bg);
}

/* kindly's administration pages (accounts/administration.py) */
.content--wide { max-width: 64rem; }
html.admin-mode button, html.admin-mode input[type="submit"] { color: var(--bg); }
button.danger { background: var(--error); }
button.danger:hover { background: var(--error); filter: brightness(0.9); }
.secondary-link { font-size: 0.9rem; color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.figure { padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.figure strong { display: block; font-size: 1.8rem; line-height: 1.2; color: var(--accent-strong); }
.figure span { color: var(--muted); font-size: 0.9rem; }
.badge { display: inline-block; font-size: 0.8rem; padding: 0.05rem 0.45rem; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); }
.badge--warn { border-color: var(--error); color: var(--error); }
.badge--ok { border-color: var(--accent); color: var(--accent-strong); }
.search { display: flex; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.search input { max-width: 24rem; }
.search button { margin: 0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.action-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.action-row p { margin: 0; flex: 1 1 18rem; }
.action-row form { margin: 0; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.action-row button { margin: 0; }

/* Analysis results: short lines, numbers on demand */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.run-meta, .note { color: var(--muted); font-size: 0.95rem; }
.lead { font-size: 1.15rem; }
.finding-group { margin: 1.75rem 0; }
.finding-group h2, .finding-group h3, .secondary-heading { font-size: 1.05rem; margin-bottom: 0.25rem; }
.secondary-heading { margin-top: 2.5rem; color: var(--muted); }
ul.findings { list-style: none; padding: 0; margin: 0; }
.finding { margin: 0; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.finding summary {
  display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; align-items: baseline;
  cursor: pointer; list-style: none;
}
.finding summary::-webkit-details-marker { display: none; }
.finding summary .finding-text::before { content: "▸"; display: inline-block; width: 1rem; color: var(--muted); }
.finding[open] summary .finding-text::before { content: "▾"; }
.finding dl {
  display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 1rem;
  margin: 0.5rem 0 0 1rem; font-size: 0.9rem; color: var(--muted);
}
.finding dd { margin: 0; }
.strength { white-space: nowrap; font-size: 0.9rem; color: var(--muted); }
.strength .bars { display: inline-flex; gap: 2px; vertical-align: middle; }
.strength .bars i { width: 6px; height: 14px; border-radius: 2px; background: var(--border); }
.strength-1 .bars i:nth-child(-n+1), .strength-2 .bars i:nth-child(-n+2),
.strength-3 .bars i:nth-child(-n+3), .strength-4 .bars i:nth-child(-n+4) { background: var(--accent); }
.run-settings { margin-top: 3rem; color: var(--muted); font-size: 0.95rem; }

/* My values: tiles with small charts, filters, the large chart (dataviz rules:
   one accent series, recessive grid, 2px lines, ringed end dot, texts in text colours) */
.lead-muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 1.25rem 0 1.5rem; }
.filters[hidden], [data-filters][hidden], [data-chart-controls][hidden] { display: none; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
button.chip, a.chip {
  display: inline-block; text-decoration: none; line-height: 1.4; margin: 0.1rem 0;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.3rem 0.8rem; font: inherit; font-size: 0.9rem; cursor: pointer;
}
button.chip:hover, a.chip:hover { background: var(--surface); border-color: var(--accent); color: var(--text); }
button.chip[aria-pressed="true"], a.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
input.filter-search { width: auto; min-width: 12rem; flex: 1 1 12rem; max-width: 18rem; padding: 0.35rem 0.75rem; border-radius: 999px; }

.key-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.75rem; margin-bottom: 2rem; }
.area { margin: 2rem 0; }
.area h2 { margin-bottom: 0.75rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.75rem; }
.tile {
  display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 0.15rem;
  padding: 0.85rem 1rem 0.7rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; min-height: 9.5rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.tile:hover, .tile:focus-visible { border-color: var(--accent); box-shadow: 0 2px 10px rgb(0 0 0 / 0.06); }
.tile[hidden] { display: none; }
.tile-label { font-size: 0.88rem; color: var(--muted); line-height: 1.3; }
.tile-value { font-size: 1.45rem; font-weight: 600; line-height: 1.2; }
.tile--big .tile-value { font-size: 1.9rem; }
.tile-unit { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.tile-delta { font-size: 0.8rem; color: var(--muted); min-height: 1.1em; }
.tile-meta { font-size: 0.8125rem; color: var(--muted); }
.tile--stale { opacity: 0.6; }
.spark { display: block; height: 44px; margin: 0.3rem 0 0.2rem; }
.spark-svg { width: 100%; height: 44px; overflow: visible; display: block; }
.spark-line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-median { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--series); }
.spark-end { fill: var(--series); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-cross { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.empty-filter[hidden], .area[hidden], .key-values[hidden] { display: none; }

.chart { margin: 0.5rem 0 1.5rem; min-height: 280px; }
.chart-svg { display: block; max-width: 100%; height: auto; font-family: inherit; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-baseline { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
.chart-axis { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-band { fill: var(--series); opacity: 0.1; }
.chart-line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line--context { stroke: var(--muted); stroke-width: 1.25; opacity: 0.45; }
.chart-line--mean { stroke: var(--series); stroke-width: 2.5; }
.chart-dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart-dot--context { fill: var(--muted); opacity: 0.5; stroke: none; }
.chart-end { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart-cross { stroke: var(--muted); stroke-width: 1; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-legend { margin: 0; font-size: 0.85rem; color: var(--muted); }
.legend-line { display: inline-block; width: 1.2rem; height: 0; border-top: 2px solid var(--series); vertical-align: middle; margin: 0 0.2rem 0 0.6rem; }
.legend-line--context { border-top: 1px solid var(--muted); opacity: 0.6; }
.legend-line--mean { border-top-width: 3px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--series); margin: 0 0.2rem 0 0.6rem; }
.legend-band { display: inline-block; width: 1rem; height: 0.7rem; background: var(--series); opacity: 0.18; vertical-align: middle; margin: 0 0.2rem 0 0.6rem; }
.value-table { margin: 1.5rem 0; }
.value-table summary { cursor: pointer; font-weight: 600; }

.chart-tooltip {
  position: absolute; z-index: 10; pointer-events: none; padding: 0.4rem 0.6rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 14px rgb(0 0 0 / 0.12); font-size: 0.85rem;
}
.chart-tooltip[hidden] { display: none; }
.tt-value { font-weight: 600; color: var(--text); }
.tt-label { color: var(--muted); }
.tt-key { display: inline-block; width: 0.9rem; height: 0; border-top: 2px solid var(--series); vertical-align: middle; margin-right: 0.35rem; }
.tt-key--daily { border-top: 1px solid var(--muted); }
.filter-hint { flex-basis: 100%; order: 3; margin: 0; font-size: 0.8rem; color: var(--muted); }

/* Analysis page (ADR-0020): connection cards with a dot chart, the comparison chart,
   compact recipes with an info box */
.lead-small { color: var(--muted); margin-top: -0.5rem; }
.analysis-section { margin: 2rem 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.section-head h2 { margin-bottom: 0; }
.section-head .run-meta { margin: 0; font-size: 0.85rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 0.9rem; margin: 1rem 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem 0.7rem;
        display: flex; flex-direction: column; gap: 0.35rem; }
.card-text { margin: 0; line-height: 1.4; }
.card-links { margin: auto 0 0; font-size: 0.9rem; }
.card-note { margin: 0; font-size: 0.8rem; color: var(--muted); }
.dotplot { margin: 0.25rem 0 0; }
.dotplot svg { display: block; width: 100%; height: auto; max-width: 22rem; font-family: inherit; }
.dotplot figcaption { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.dot-mean { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.dot-range { stroke: var(--series); stroke-width: 2; stroke-linecap: round; opacity: 0.45; }
.dot-value { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot-highlight { fill: var(--series); opacity: 0.08; }
.dot--latest .dot-name { fill: var(--text); font-weight: 600; }
.dot-latest-text { color: var(--text); }
.legend-dot--context { background: var(--muted); opacity: 0.6; }

.series-key { display: inline-block; width: 1rem; height: 0; border-top: 3px solid; border-radius: 2px; }
.series-key--1, .tt-key--cmp-1 { border-color: var(--cat-1); }
.series-key--2, .tt-key--cmp-2 { border-color: var(--cat-2); }
.series-key--3, .tt-key--cmp-3 { border-color: var(--cat-3); }
.series-key--4, .tt-key--cmp-4 { border-color: var(--cat-4); }
.cmp-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cmp--1 { stroke: var(--cat-1); } .cmp--2 { stroke: var(--cat-2); } .cmp--3 { stroke: var(--cat-3); } .cmp--4 { stroke: var(--cat-4); }
.cmp-dot.cmp--1, .cmp-marker.cmp--1 { fill: var(--cat-1); }
.cmp-dot.cmp--2, .cmp-marker.cmp--2 { fill: var(--cat-2); }
.cmp-dot.cmp--3, .cmp-marker.cmp--3 { fill: var(--cat-3); }
.cmp-dot.cmp--4, .cmp-marker.cmp--4 { fill: var(--cat-4); }
.cmp-dot, .cmp-marker { stroke: var(--surface); stroke-width: 2; }
.chart-line--context.cmp--1, .chart-line--context.cmp--2, .chart-line--context.cmp--3, .chart-line--context.cmp--4 { stroke: var(--muted); }
.chart-panel-label { fill: var(--text); font-size: 12px; font-weight: 600; }

.recipes { list-style: none; padding: 0; margin: 0.5rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.recipe { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.4rem 0.3rem 0.75rem;
          border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 0.92rem; }
.recipe-name { text-decoration: none; }
.recipe-name:hover { text-decoration: underline; }
.info-button { width: 1.45rem; height: 1.45rem; padding: 0; border-radius: 50%; font-size: 0.8rem; font-weight: 700;
               font-style: italic; font-family: Georgia, serif; line-height: 1; background: var(--bg); color: var(--muted);
               border: 1px solid var(--border); cursor: pointer; }
.info-button:hover, .info-button:focus-visible { color: var(--text); border-color: var(--accent); }
.info-pop { max-width: min(26rem, calc(100vw - 16px)); padding: 0.75rem 0.9rem; border: 1px solid var(--border);
            border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 0.85rem; line-height: 1.45;
            box-shadow: 0 6px 22px rgb(0 0 0 / 0.16); }
.info-pop p { margin: 0 0 0.45rem; }
.info-pop ul { margin: 0; padding-left: 1.1rem; }
.info-method { color: var(--muted); }
.info-sources { margin-bottom: 0.15rem !important; font-weight: 600; }
.orders summary { cursor: pointer; font-weight: 600; }

/* Analysis workspace (ADR-0021): tabs, periods as chips, a grid of chart cards, the editor */
.content--full { max-width: 92rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.25rem; }
.page-head h1 { margin-bottom: 0.25rem; }
.page-head .lead-small { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.15rem; border-bottom: 1px solid var(--border); margin: 1rem 0 1.25rem; }
.tab { display: inline-block; padding: 0.5rem 0.9rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
       background: none; color: var(--muted); text-decoration: none; font: inherit; font-size: 0.95rem; border-radius: 6px 6px 0 0; cursor: pointer; }
.tab:hover { color: var(--text); background: var(--surface); }
.tab--active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab--add { font-size: 1.1rem; line-height: 1; padding: 0.45rem 0.75rem; }
.tab--add:hover { background: var(--surface); color: var(--text); }
.tab-new { margin: 0; }

.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.board-periods { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.board-actions { display: flex; gap: 0.4rem; align-items: center; }
button.period-chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.75rem; border-radius: 999px;
                     border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.88rem; font-weight: 500; }
button.period-chip:hover { border-color: var(--accent); background: var(--surface); }
button.period-chip--add { color: var(--muted); border-style: dashed; }
.button-secondary, button.button-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border);
                                             padding: 0.35rem 0.8rem; border-radius: 8px; font-size: 0.9rem; cursor: pointer; }
.button-secondary:hover, button.button-secondary:hover { border-color: var(--accent); background: var(--surface); }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 17rem; padding: 0.8rem; background: var(--surface);
             border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 22px rgb(0 0 0 / 0.16); }
.menu-form { display: flex; flex-direction: column; gap: 0.4rem; margin: 0 0 0.6rem; }
.menu-form:last-child { margin: 0; }
.board-status { min-height: 1.2em; margin: -0.5rem 0 0.25rem; font-size: 0.85rem; color: var(--muted); }

.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 0.9rem 0.6rem; min-width: 0; }
.board-card--w2 { grid-column: span 2; }
.board-card--w3 { grid-column: 1 / -1; }
@media (max-width: 64rem) { .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .board-card--w3, .board-card--w2 { grid-column: 1 / -1; } }
@media (max-width: 40rem) { .board-grid { grid-template-columns: minmax(0, 1fr); } .board-card { grid-column: 1 / -1; } }
.board-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.board-card-title { font-size: 1rem; margin: 0; line-height: 1.3; }
.board-card-sub { margin: 0.1rem 0 0; font-size: 0.8rem; color: var(--muted); }
.board-card-actions { display: flex; gap: 0.1rem; opacity: 0.55; transition: opacity 0.15s; }
.board-card:hover .board-card-actions, .board-card:focus-within .board-card-actions { opacity: 1; }
button.icon-button { background: none; color: var(--muted); border: 1px solid transparent; border-radius: 6px; padding: 0.1rem 0.4rem;
                     font-size: 0.95rem; line-height: 1.4; cursor: pointer; }
button.icon-button:hover, button.icon-button:focus-visible { color: var(--text); border-color: var(--border); background: var(--bg); }
.board-card-body { min-height: 6rem; }
.board-note { margin: 0.3rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.board-legend { margin: 0 0 0.3rem; font-size: 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.board-empty { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.cmp-bar { stroke: none; }
.cmp-fill--1 { fill: var(--cat-1); } .cmp-fill--2 { fill: var(--cat-2); } .cmp-fill--3 { fill: var(--cat-3); } .cmp-fill--4 { fill: var(--cat-4); }
.scatter-dot { opacity: 0.7; stroke: var(--surface); stroke-width: 1; }
.scatter-trend { stroke-width: 2.5; stroke-linecap: round; }
.scatter-ring { fill: none; stroke: var(--text); stroke-width: 1.5; }
.scatter-stats { list-style: none; padding: 0; margin: 0.3rem 0 0; font-size: 0.82rem; }
.scatter-stats li { display: flex; align-items: center; gap: 0.4rem; }
.chart-axis-title { fill: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
.board-table { width: 100%; font-size: 0.85rem; margin: 0; }
.board-table th, .board-table td { padding: 0.3rem 0.5rem; }
.board-table th[scope="row"] { font-weight: 500; white-space: nowrap; }
.board-table th[scope="row"] .series-key { margin-right: 0.4rem; }
.board-table .delta { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
button.link-button { background: none; border: 0; padding: 0; color: var(--accent-strong); text-decoration: underline; font: inherit; cursor: pointer; }
button.link-button:hover { background: none; color: var(--text); }

dialog.editor { width: min(38rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1.2rem 1.4rem; border: 1px solid var(--border);
                border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgb(0 0 0 / 0.25); }
dialog.editor--small { width: min(26rem, calc(100vw - 2rem)); }
dialog.editor::backdrop { background: rgb(20 18 15 / 0.45); }
dialog.editor h2 { margin: 0 0 0.8rem; font-size: 1.15rem; }
dialog.editor p { margin: 0 0 0.7rem; }
dialog.editor label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.2rem; }
dialog.editor input[type="text"], dialog.editor input[type="date"], dialog.editor select { width: 100%; }
dialog.editor [hidden] { display: none !important; }
.editor-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem !important; }
.editor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0 0.8rem; margin-top: 0.6rem; }
.editor-buttons { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.9rem; }
.editor-buttons .spacer { flex: 1; }
.value-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 0.4rem; margin-bottom: 0.4rem; align-items: center; }
.value-row:not(:has(button)) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
fieldset.segmented { border: 0; padding: 0; margin: 0 0 0.8rem; display: flex; gap: 0; }
fieldset.segmented legend { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; padding: 0; }
fieldset.segmented label { margin: 0; flex: 1; }
fieldset.segmented input { position: absolute; opacity: 0; pointer-events: none; }
fieldset.segmented span { display: block; text-align: center; padding: 0.45rem 0.5rem; border: 1px solid var(--border); color: var(--text);
                          font-size: 0.9rem; cursor: pointer; background: var(--bg); }
fieldset.segmented label:first-of-type span { border-radius: 8px 0 0 8px; }
fieldset.segmented label:last-of-type span { border-radius: 0 8px 8px 0; }
fieldset.segmented label + label span { border-left: 0; }
fieldset.segmented input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
fieldset.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset.presets { border: 0; padding: 0; margin: 0 0 0.4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 0.8rem; }
fieldset.presets label.preset { color: var(--text); font-size: 0.92rem; margin: 0; padding: 0.2rem 0; cursor: pointer; }
.board-table th.num, .board-table td.num { text-align: right; }

/* Exploring freely (ADR-0023): values with check boxes on the left, sliders above the chart */
.explore { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 52rem) { .explore { grid-template-columns: minmax(0, 1fr); } }
.explore-values { position: sticky; top: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
                  padding: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; max-height: calc(100vh - 2rem); }
.explore-heading { font-size: 1rem; margin: 0; display: flex; justify-content: space-between; align-items: baseline; }
.explore-count { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.explore-values input[type="search"] { width: 100%; }
.explore-list { overflow-y: auto; margin: 0 -0.3rem; padding: 0 0.3rem; }
.explore-area { margin: 0.6rem 0 0.15rem; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.explore-value { display: flex; align-items: center; gap: 0.45rem; padding: 0.22rem 0.35rem; border-radius: 6px; font-size: 0.86rem;
                 line-height: 1.3; cursor: pointer; color: var(--text); }
.explore-value:hover { background: var(--bg); }
.explore-value--on { background: var(--bg); font-weight: 600; }
.explore-value input { margin: 0; accent-color: var(--accent); flex: none; }
.explore-value input:disabled + .series-key + .explore-name { color: var(--muted); }
.series-key--off { border-color: transparent; }
.explore-value .series-key { flex: none; }
.explore-main { min-width: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.explore-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem; background: var(--surface);
                    border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 0.9rem; }
fieldset.segmented--inline { margin: 0; flex: none; }
fieldset.segmented--inline span { padding: 0.35rem 0.8rem; }
.slider { display: grid; grid-template-columns: auto; gap: 0.1rem; min-width: 11rem; }
.slider label { font-size: 0.78rem; color: var(--muted); }
.slider input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0; }
.slider output { font-size: 0.82rem; font-variant-numeric: tabular-nums; color: var(--text); }
.slider[hidden], .explore-selects [hidden] { display: none; }
label.check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.86rem; cursor: pointer; }
label.check input { accent-color: var(--accent); margin: 0; }
label.check:has(input:disabled) { color: var(--muted); cursor: default; }
.explore-selects { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.explore-selects label { font-size: 0.78rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.1rem; }
.explore-selects select { font-size: 0.86rem; padding: 0.25rem 0.4rem; }
.explore-hint { margin: 0; min-height: 1.2em; font-size: 0.88rem; color: var(--muted); }
.explore-chart .board-card-body { min-height: 18rem; transition: opacity 0.15s; }
.explore-chart .board-card-body.is-loading { opacity: 0.55; }
.explore-save { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.explore-save label { font-size: 0.86rem; color: var(--muted); }
.explore-save input[type="text"] { width: 14rem; }
fieldset.segmented--inline span { white-space: nowrap; }
.explore-controls [hidden] { display: none; }
/* folding areas in the list of values */
details.explore-group { margin: 0; }
details.explore-group > summary.explore-area { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.35rem;
                                               padding: 0.3rem 0.2rem; margin: 0.15rem 0 0; border-radius: 6px; }
details.explore-group > summary.explore-area::-webkit-details-marker { display: none; }
details.explore-group > summary.explore-area::before { content: "▸"; font-size: 0.8rem; color: var(--muted); width: 0.8rem; }
details.explore-group[open] > summary.explore-area::before { content: "▾"; }
details.explore-group > summary.explore-area:hover { background: var(--bg); color: var(--text); }
.explore-tip { font-size: 0.8rem; }
.explore-hint > span + span { margin-left: 0.6rem; }
.explore-chart .board-card-body { min-height: 26rem; }
.explore-table[hidden] { display: none; }
/* zoom and patterns */
.chart-hit--zoom { cursor: col-resize; }
.zoom-band { fill: var(--accent); opacity: 0.12; pointer-events: none; }
.change-line { stroke: var(--text); stroke-width: 1.25; stroke-dasharray: 4 3; opacity: 0.7; }
.pattern-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem 1.5rem; }
.pattern-panel { min-width: 0; }
.pattern-panel--wide { grid-column: 1 / -1; }
.pattern-title { font-size: 0.92rem; margin: 0 0 0.3rem; }
.acf-bar { fill: var(--muted); opacity: 0.55; }
.acf-bar--peak { fill: var(--series); opacity: 1; }
/* the time window: two handles on one track, quick choices, zoom and pan */
.window { display: flex; flex-direction: column; gap: 0.3rem; min-width: 20rem; flex: 1 1 22rem; }
.window-head { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; color: var(--muted); }
.window-head output { color: var(--text); font-variant-numeric: tabular-nums; }
.dual-range { position: relative; height: 1.75rem; }  /* touch targets of 24 px at least (WCAG 2.5.8) */
.dual-range::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--border); }
.dual-range input[type="range"] { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; background: none;
                                  pointer-events: none; -webkit-appearance: none; appearance: none; }
.dual-range input[type="range"]::-webkit-slider-runnable-track { background: none; }
.dual-range input[type="range"]::-moz-range-track { background: none; }
.dual-range input[type="range"]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 24px; height: 24px;
                                                        border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
                                                        box-shadow: 0 0 0 1px var(--accent); cursor: grab; margin-top: 0; }
.dual-range input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 20px; height: 20px; border-radius: 50%;
                                                    background: var(--accent); border: 2px solid var(--surface); cursor: grab; }
.dual-range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.window-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.4rem; }
.window-row button.chip { padding: 0.15rem 0.55rem; font-size: 0.8rem; }
.window-buttons { display: inline-flex; gap: 0.15rem; }
.window-buttons .icon-button { border-color: var(--border); background: var(--surface); min-width: 2rem; }
.dual-fill { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--accent); }
.mini { display: block; width: 100%; height: auto; max-width: 22rem; font-family: inherit; }
.mini-line { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: 0.7; }
.mini-steps { fill: none; stroke: var(--series); stroke-width: 2.5; stroke-linecap: round; }

/* Start page (ADR-0024): widgets on a grid of 12 columns, arranged in edit mode */
.home-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.home-head h1 { margin: 0.5rem 0; }
.home-actions { display: flex; gap: 0.5rem; }
.home-actions[hidden], .home-actions [hidden] { display: none; }
button[data-edit][aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.home-edit-hint { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.5rem; }
.home-grid { --row-height: 76px; position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
             grid-auto-rows: var(--row-height); grid-template-rows: repeat(var(--rows, 1), var(--row-height)); gap: 12px; margin-top: 0.75rem; }
/* Outside the arranging, a row grows with its content: on a tablet a value
   tile's text wraps, and its small chart was cut off (Ben, 2026-12-05). */
body:not(.home-editing) .home-grid { grid-auto-rows: minmax(var(--row-height), auto);
                              grid-template-rows: repeat(var(--rows, 1), minmax(var(--row-height), auto)); }
.home-cells { display: none; position: absolute; inset: 0; grid-template-columns: repeat(12, minmax(0, 1fr));
              grid-auto-rows: var(--row-height); gap: 12px; pointer-events: none; }
.home-editing .home-cells { display: grid; }
.home-cells span { border: 1px dashed var(--border); border-radius: 6px; background: var(--surface); opacity: 0.55; }
.widget { grid-column: var(--x, auto) / span var(--w, 12); grid-row: var(--y, auto) / span var(--h, 3); position: relative; z-index: 1;
          display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface);
          border: 1px solid var(--border); border-radius: var(--radius); padding: 0.55rem 0.8rem 0.6rem; overflow: hidden; }
.widget-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.3rem; }
.widget-title { font-size: 0.9rem; margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-tools { display: none; gap: 0.1rem; }
.home-editing .widget-tools { display: inline-flex; }
.home-editing .widget { border-color: var(--accent); box-shadow: 0 2px 10px rgb(0 0 0 / 0.06); }
.home-editing .widget-bar { cursor: grab; user-select: none; touch-action: none; background: var(--bg); margin: -0.55rem -0.8rem 0.3rem;
                            padding: 0.35rem 0.8rem; border-bottom: 1px solid var(--border); }
.widget.is-moving, .widget.is-resizing { z-index: 5; box-shadow: 0 10px 30px rgb(0 0 0 / 0.18); opacity: 0.95; }
.widget.is-moving .widget-bar { cursor: grabbing; }
.widget-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; font-size: 0.88rem; }
.widget-resize { display: none; position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; cursor: nwse-resize;
                 touch-action: none; border-right: 3px solid var(--accent); border-bottom: 3px solid var(--accent); border-radius: 0 0 6px 0; }
.home-editing .widget-resize { display: block; }
.w-value-link { display: flex; flex-direction: column; flex: 1; min-height: 0; text-decoration: none; color: inherit; }
.w-value { font-size: 1.7rem; font-weight: 600; line-height: 1.15; }
.w-meta, .w-label { font-size: 0.78rem; color: var(--muted); }
.w-rating { font-size: 0.82rem; line-height: 1.3; }
.w-rating--attention, .tile-rating--attention { font-weight: 600; }
.w-rating--attention::before, .tile-rating--attention::before { content: "● "; color: var(--cat-4); }
.w-rating--good::before, .tile-rating--good::before { content: "● "; color: var(--accent); }
.spark-band { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.w-spark { display: block; flex: 1 0 40px; min-height: 40px; margin-top: 0.2rem; }
.w-chart { flex: 1; min-height: 0; }
.w-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.w-list li { line-height: 1.35; }
.w-sub { margin: 0 0 0.25rem; font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.w-sub + .w-list { margin-bottom: 0.6rem; }
.w-foot { margin: auto 0 0; padding-top: 0.4rem; font-size: 0.82rem; }
.w-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--error); margin-right: 0.35rem; }
.w-dot--ok { background: var(--series); }
.w-form { display: flex; flex-direction: column; gap: 0.5rem; }
.w-form label { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--muted); gap: 0.15rem; }
.w-form input, .w-form select { font-size: 0.92rem; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.w-form label { min-width: 0; }
.w-form input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-height: 2.6rem; }
.w-form-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.w-note { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0; }
.w-form-row > label { flex: 1 1 8rem; }
.catalog { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.5rem; }
.catalog form { margin: 0; }
button.catalog-item { width: 100%; height: 100%; text-align: left; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.6rem 0.75rem;
                      background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); }
button.catalog-item:hover { border-color: var(--accent); background: var(--surface); }
button.catalog-item span { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
@media (max-width: 50rem) {
  .home-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: auto; }
  .widget { grid-column: 1 / -1; grid-row: auto; }
  .widget-body { overflow: visible; }
  .w-chart { min-height: 260px; }
}

/* --- Layers over a line chart, boxplots, distributions, calendar (ADR-0025) --- */
.tt-sub { color: var(--muted); font-size: 0.8rem; }
.cmp-line.is-faint { stroke-width: 1.25; opacity: 0.35; }
.cmp-dot.is-faint, .cmp-bar.is-faint { opacity: 0.35; }
.layer-ma, .layer-curve { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.layer-ma--1 { stroke-width: 2.5; }
.layer-ma--2 { stroke-width: 2.5; stroke-dasharray: 8 4; }
.layer-curve { stroke-width: 5; opacity: 0.45; }
.layer-curve--edge { stroke-dasharray: 3 5; opacity: 0.3; }
.layer-trend { stroke-width: 2; stroke-dasharray: 1 5; stroke-linecap: round; }
.layer-trend--none { opacity: 0.55; }
.layer-legend { gap: 0.25rem 0.9rem; margin-top: 0.4rem; }
.layer-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.layer-sample { display: inline-block; vertical-align: middle; }
.layer-sample path, .layer-sample line { fill: none; stroke: var(--text); }
.layer-sample .raw { stroke-width: 1.25; opacity: 0.35; }
.layer-sample .layer-trend { stroke-width: 2; }
fieldset.layers { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.8rem 0.6rem; margin: 0.75rem 0; }
fieldset.layers legend { font-size: 0.86rem; color: var(--muted); padding: 0 0.3rem; }
.layers-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: 0.3rem 0; }
.layers-label { font-size: 0.86rem; color: var(--muted); }
label.chip--check { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px;
                    padding: 0.15rem 0.6rem; font-size: 0.82rem; cursor: pointer; background: var(--surface); }
label.chip--check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.chip--check:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
label.chip--check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.box-whisker { stroke-width: 1.5; }
.box-body { fill-opacity: 0.22; stroke-width: 1.5; }
.box-median { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.box-outlier { fill: var(--surface); stroke-width: 1.25; }
.hist-median { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 4 3; }

.calendar-year { font-size: 0.9rem; margin: 0.8rem 0 0.2rem; color: var(--muted); font-weight: 600; }
.calendar-label { font-size: 9.5px; }
.heat { stroke: none; }
.heat-0 { fill: none; stroke: var(--border); stroke-width: 1; }
.heat-1 { fill: color-mix(in oklab, var(--cat-1) 20%, var(--surface)); }
.heat-2 { fill: color-mix(in oklab, var(--cat-1) 33%, var(--surface)); }
.heat-3 { fill: color-mix(in oklab, var(--cat-1) 46%, var(--surface)); }
.heat-4 { fill: color-mix(in oklab, var(--cat-1) 59%, var(--surface)); }
.heat-5 { fill: color-mix(in oklab, var(--cat-1) 72%, var(--surface)); }
.heat-6 { fill: color-mix(in oklab, var(--cat-1) 86%, var(--surface)); }
.heat-7 { fill: var(--cat-1); }
.heat-key { display: inline-block; width: 0.85rem; height: 0.85rem; border-radius: 2px; }
.heat-key.heat-0 { border: 1px solid var(--border); }
.heat-key--gap { margin-left: 0.8rem; }
.heat-key.heat-1 { background: color-mix(in oklab, var(--cat-1) 20%, var(--surface)); }
.heat-key.heat-2 { background: color-mix(in oklab, var(--cat-1) 33%, var(--surface)); }
.heat-key.heat-3 { background: color-mix(in oklab, var(--cat-1) 46%, var(--surface)); }
.heat-key.heat-4 { background: color-mix(in oklab, var(--cat-1) 59%, var(--surface)); }
.heat-key.heat-5 { background: color-mix(in oklab, var(--cat-1) 72%, var(--surface)); }
.heat-key.heat-6 { background: color-mix(in oklab, var(--cat-1) 86%, var(--surface)); }
.heat-key.heat-7 { background: var(--cat-1); }
.heat-legend { gap: 2px; align-items: center; }
.layer-trend.pattern-trend { stroke: var(--series); }
.explore-chart .board-card-body.is-compact { min-height: 0; }

/* --- Trends tab (ADR-0026) --- */
.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 34rem), 1fr)); gap: 1rem; margin: 1rem 0; }
.trend-box { display: flex; flex-direction: column; gap: 0.4rem; }
.trend-text { line-height: 1.4; }
.trend-periods button.chip { padding: 0.15rem 0.55rem; font-size: 0.8rem; }
.trend-badge { font-size: 0.8rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.1rem 0.55rem; }
.button-small { padding: 0.25rem 0.7rem; font-size: 0.85rem; }
.trend-add { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 1rem 0; }
.trend-add select { width: auto; min-width: 10rem; }
.trend-box .board-card-body.is-loading { opacity: 0.55; }
.recipe-when { font-size: 0.8rem; color: var(--muted); padding-right: 0.4rem; }

/* --- Widgets for trends, HRV, sleep regularity, own analyses (ADR-0026) --- */
.w-text { margin: 0 0 0.4rem; line-height: 1.4; }
.w-text--attention { font-weight: 600; }
.w-trends li { display: flex; flex-direction: column; gap: 0.25rem; }
.mini--row { max-width: none; width: 100%; height: 2.75rem; }
.mini--row path { vector-effect: non-scaling-stroke; }
.w-bars { list-style: none; padding: 0; margin: 0.2rem 0; display: flex; flex-direction: column; gap: 0.25rem; }
.w-bars li { display: grid; grid-template-columns: 4.5rem 1fr 2rem; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.w-bars meter { width: 100%; height: 0.6rem; accent-color: var(--accent); }
.w-bar-label { color: var(--muted); font-variant-numeric: tabular-nums; }
.w-bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.w-findings { margin: 0; }

/* Normal ranges (ADR-0028): a value outside on its unfavourable side, and the
   note when several are; marked by a bar and words, not by colour alone. */
.card--attention { border-left: 4px solid var(--text); }
.callout { margin: 0 0 1rem; padding: 0.75rem 1rem; border: 1px solid var(--border); border-left: 4px solid var(--text);
           border-radius: var(--radius); background: var(--surface); line-height: 1.45; }
.muted { color: var(--muted); }
.band-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; }
.chart-dot--unusual { fill: none; stroke: var(--text); stroke-width: 1.5; }
.legend-dot--unusual { display: inline-block; width: 0.6rem; height: 0.6rem; border: 1.5px solid var(--text); border-radius: 50%; margin: 0 0.3rem 0 0.8rem; }
/* A day held across all charts of a page (click; Escape lets go) */
.chart-cross--locked { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-pin { font-size: 11px; font-weight: 600; fill: var(--text); }
/* Named periods (ADR-0028) */
.named-row { align-items: center; }
.named-row .chips:empty { display: none; }
.chip-group { display: inline-flex; }
.chip-group .chip:first-child:not(:only-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip-remove { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; padding-inline: 0.45rem; }
.named-save { margin-left: 0; }
.named-row { flex-wrap: wrap; gap: 0.4rem; }
.compare-with { display: inline-flex; align-items: center; gap: 0.4rem; }
/* Tables (ADR-0028): per day or sum, coverage of a row */
.th-sub { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--muted); }
.row-cover { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--muted); }

/* Month calendar (health:month) */
.month-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 1rem 0; }
.month-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.month-pick-form { display: grid; gap: 0.35rem; max-height: 60vh; overflow-y: auto; min-width: 16rem; }
.month { width: 100%; border-collapse: collapse; table-layout: fixed; }
.month th { font-size: 0.85rem; font-weight: 600; text-align: left; padding: 0.35rem 0.45rem; color: var(--muted); }
.month td { vertical-align: top; background: var(--surface); border: 1px solid var(--border); padding: 0.35rem 0.45rem; }
.month-date { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.2rem; }
.month-day--outside { background: var(--bg) !important; }
.month-day--outside .month-date, .month-day--outside .month-values { opacity: 0.8; }
.month-day--today { outline: 2px solid var(--accent); outline-offset: -2px; }
.month-week { background: var(--bg) !important; border-left-width: 3px !important; }
.month-values { margin: 0; display: grid; gap: 0.1rem; }
.month-values > div { display: flex; justify-content: space-between; gap: 0.35rem; font-size: 0.8rem; line-height: 1.3; }
.month-values dt { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-values dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.month-cover { display: block; font-size: 0.8125rem; color: var(--muted); }
.month-none { font-size: 0.8125rem; }
@media (max-width: 52rem) {
  .month:not(.women-month), .month:not(.women-month) tbody, .month:not(.women-month) tr, .month:not(.women-month) td { display: block; width: auto; }
  .month:not(.women-month) thead { display: none; }
  .month:not(.women-month) tr { margin-bottom: 1rem; }
  .month:not(.women-month) td { border-bottom-width: 0; }
  .month:not(.women-month) td:last-child { border-bottom-width: 1px; }
  .month:not(.women-month) .month-day--outside:not(:has(dl)) { display: none; }
  .women-month td { padding: 0.3rem 0.2rem; font-size: 0.85rem; }  /* the cycle stays a grid: its pattern is the point */
}
.month-cover--inline { display: inline; font-weight: 400; font-size: 0.8125rem; }
.callout--problem { border-left-color: var(--error); }
.callout--problem p { margin: 0.25rem 0; }
.state-failed { color: var(--error); font-weight: 600; }
.data-types { margin: 1rem 0; }
.data-type-list { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.6rem; }
.data-type-text { display: block; margin-left: 1.6rem; font-size: 0.9rem; color: var(--muted); }
.data-type-text em { font-style: normal; color: var(--text); }
.source-order { list-style: none; padding-left: 0; display: grid; gap: 0.4rem; }
.source-order li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; }
.source-order-buttons { display: flex; gap: 0.35rem; }
.source-order-buttons form { margin: 0; }

/* Source modules (ADR-0031) */
a.button { display: inline-block; padding: 0.6rem 1.2rem; font-weight: 600; color: #fff; background: var(--accent);
  border-radius: var(--radius); text-decoration: none; margin: 0 0.5rem 0.5rem 0; }
a.button:hover { background: var(--accent-strong); }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin: 0.75rem 0 2rem; }
.module { display: flex; gap: 0.9rem; align-items: flex-start; padding: 1rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; }
.module:hover, .module:focus-visible { border-color: var(--accent); box-shadow: 0 2px 10px rgb(0 0 0 / 0.06); }
.module--failing, .module--attention { border-left: 4px solid var(--error); }
.module-logo { flex: none; width: 3rem; height: 3rem; border-radius: 0.6rem; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--border); font-weight: 700; font-size: 1.1rem; color: var(--accent-strong); overflow: hidden; }
.module-logo img { width: 100%; height: 100%; object-fit: contain; padding: 0.3rem; }
.module-body { display: grid; gap: 0.25rem; min-width: 0; }
.module-name { font-weight: 600; font-size: 1.05rem; }
.module-summary { font-size: 0.9rem; color: var(--muted); }
.module-meta { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.module-status { font-size: 0.85rem; font-weight: 600; }
.module-status--ok { color: var(--accent-strong); }
.module-status--failing, .module-status--attention { color: var(--error); }
.module-status--pending, .module-status--available { color: var(--muted); }
.module-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.module-head h1 { margin: 0; }
.module-head p { margin: 0.1rem 0 0.25rem; }
.module-head .module-logo { width: 4rem; height: 4rem; font-size: 1.4rem; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 100%; }
.sync-table td, .sync-table th { white-space: nowrap; }
.sync-table td:first-child { white-space: normal; }
.run-list { padding-left: 1.2rem; font-size: 0.9rem; }
.run-solved { color: var(--muted); }
.run-solved__note { color: var(--ok); font-size: 0.85rem; }

/* Profile and settings (ADR-0032) */
.site-header nav { flex: 1; }
.profile-menu { position: relative; margin-left: auto; }
.profile-menu summary { list-style: none; display: flex; align-items: center; gap: 0.55rem; cursor: pointer; padding: 0.2rem 0.4rem;
  border-radius: 999px; color: var(--text); }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary:hover, .profile-menu[open] summary { background: var(--bg); }
.profile-name { font-size: 0.95rem; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-body { position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 20; min-width: 14rem; display: grid;
  padding: 0.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.08); }
.profile-menu-body a { padding: 0.5rem 0.75rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.profile-menu-body a:hover, .profile-menu-body a:focus-visible { background: var(--bg); }
.avatar { flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--big { width: 4.5rem; height: 4.5rem; font-size: 1.6rem; }
.content--settings { max-width: 64rem; display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: 2.5rem; align-items: start; }
.content--settings > :not(.settings-nav) { grid-column: 2; }
.settings-nav { grid-column: 1; grid-row: 1 / span 40; display: grid; gap: 0.1rem; position: sticky; top: 1rem; }
.settings-nav a { padding: 0.4rem 0.7rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 0.95rem; }
.settings-nav a:hover { background: var(--surface); }
.settings-nav a[aria-current="page"] { background: var(--surface); color: var(--accent-strong); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent); }
.settings-nav-title { font-weight: 700; margin: 0 0 0.4rem 0.7rem; }
.settings-nav-group { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.9rem 0 0.2rem 0.7rem; }
.profile-card { display: flex; gap: 1.1rem; align-items: center; padding: 1rem 1.2rem; margin-bottom: 1.5rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); }
.profile-card p { margin: 0.1rem 0; }
.profile-card-name { font-size: 1.15rem; font-weight: 600; }
@media (max-width: 48rem) {
  .content--settings { display: block; }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1.25rem; }
  .settings-nav-title, .settings-nav-group { display: none; }
  .settings-nav a { background: var(--surface); border: 1px solid var(--border); font-size: 0.85rem; }
  .profile-name { display: none; }
}

/* Source tiles with the makers' logos (ADR-0032) */
.module { flex-direction: column; }
.module .module-logo, .module-head .module-logo { width: 100%; max-width: 10rem; height: 3.5rem; border: none; background: transparent;
  display: flex; align-items: center; justify-content: flex-start; overflow: visible; font-size: 1.3rem; }
.module-head .module-logo { width: 10rem; }
.module .module-logo img, .module-head .module-logo img { box-sizing: border-box; display: block; width: auto; height: auto;
  max-width: 100%; max-height: 100%; padding: 0; object-fit: contain; }
@media (prefers-color-scheme: dark) { .module .module-logo img, .module-head .module-logo img { background: #fff; border-radius: 6px; padding: 0.3rem 0.5rem; } }

/* Greeting on the start page (ADR-0032) */
.greeting { margin: 0 0 0.2rem; }
.greeting-sub { margin: 0 0 1.2rem; color: var(--muted); }
.day-statement { margin: 0.2rem 0 1.2rem; font-size: 1.05rem; line-height: 1.45; max-width: 46rem; }
.day-statement strong { font-weight: 600; }
.profile-menu-body hr { border: none; border-top: 1px solid var(--border); margin: 0.3rem 0; }
.entrance-welcome { color: var(--muted); margin: 0 0 1.5rem; }
.entrance-foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); }
.inline-label { display: inline; font-weight: normal; }

/* Sharing (ADR-0033) */
.relation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.relation { display: block; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-weight: 600; }
.relation:hover, .relation:focus-visible { border-color: var(--accent); }
.share-form fieldset { border: none; padding: 0; margin: 0 0 1.2rem; }
.share-form legend { font-weight: 600; margin-bottom: 0.4rem; }
.share-form ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; }
.share-form ul label { font-weight: normal; display: inline; }
.choice-card { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.8rem 1rem; margin-bottom: 0.5rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); font-weight: normal; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.choice-card small { display: block; color: var(--muted); margin-top: 0.2rem; }
.share-form:has(input[name="kind"][value="link"]:checked) .only-account { display: none; }
.share-form:has(input[name="kind"][value="account"]:checked) .only-link { display: none; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; margin: 0.75rem 0 1.5rem; }
.share-card { padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.share-card h3 { margin: 0 0 0.3rem; }
.share-card--ended { opacity: 0.75; }
.share-tags { margin: 0 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag { font-size: 0.78rem; padding: 0.1rem 0.5rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.tag--ok { color: var(--accent-strong); border-color: var(--accent); }
.share-who { margin: 0 0 0.5rem; }
.ended-shares summary { cursor: pointer; color: var(--muted); margin: 1rem 0; }
.link-box { padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 1rem 0; }
.link-code-label { font-weight: 600; margin: 1rem 0 0.2rem; }
.link-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.6rem; letter-spacing: 0.12em; margin: 0; }
.person-card { display: flex; gap: 0.9rem; align-items: center; padding: 1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); text-decoration: none; }
.person-card:hover, .person-card:focus-visible { border-color: var(--accent); }
.person-name { display: block; font-weight: 600; }
.person-meta { display: block; font-size: 0.85rem; color: var(--muted); }
.avatar--person { background: var(--bg); color: var(--accent-strong); border: 1px solid var(--border); width: 2.8rem; height: 2.8rem; }
.avatar--person.avatar--big { width: 4rem; height: 4rem; }
.person-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.75rem; }
.person-head h1 { margin: 0; }
.person-head p { margin: 0.2rem 0 0; }
.guest-banner { padding: 0.6rem 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); }
.small { font-size: 0.85rem; }
.normal-list { padding-left: 1.2rem; }
.spark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.spark-card { margin: 0; color: var(--series); }
.spark-card figcaption { color: var(--text); font-size: 0.9rem; margin-bottom: 0.2rem; }
.spark-card svg { width: 100%; height: 44px; display: block; }
.day-table th, .day-table td { white-space: nowrap; }

/* Suggestions (ADR-0034) */
.advice-title { font-size: 1rem; margin: 0 0 0.3rem; }
.advice-more summary { cursor: pointer; color: var(--accent-strong); font-size: 0.9rem; margin-top: 0.4rem; }
.advice-more p { font-size: 0.9rem; }
.advice-sources { padding-left: 1.1rem; font-size: 0.8rem; color: var(--muted); }
.advice-sources a { word-break: break-all; }
a.figure { text-decoration: none; color: inherit; display: block; } a.figure:hover { border-color: var(--accent); }
.inline-form { display: inline; }
.focus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem; }
.focus-card { padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--series); }
.focus-card p { margin: 0.1rem 0; color: var(--text); }
.focus-card .muted { color: var(--muted); }
.focus-card--note { border-left: 4px solid var(--text); }
.focus-name { font-size: 0.9rem; }
.focus-value { font-size: 1.4rem; font-weight: 600; }
.focus-card svg { width: 100%; height: 36px; display: block; margin: 0.3rem 0; }
/* Professional start page (ADR-0035) */
.w-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.w-people a { display: flex; gap: 0.6rem; align-items: center; color: var(--text); text-decoration: none; }
.w-people a:hover strong { color: var(--accent-strong); }
.w-people .avatar--person { width: 2.2rem; height: 2.2rem; font-size: 0.8rem; }
.w-people .note { display: block; }
.w-overview { width: 100%; font-size: 0.9rem; }
.w-overview th, .w-overview td { white-space: nowrap; }
.w-state { font-weight: 700; }

/* ADR-0036: a professional's own focus */
.focus-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.focus-actions p { margin: 0; }
.focus-table select, .focus-table input[type="text"] { width: 100%; min-width: 12rem; }
.focus-table td small { display: block; }
.focus-form > button { margin-top: 0.5rem; }

/* ADR-0037: whole areas or chosen values */
.scope { margin: 0.5rem 0 1rem; }
.scope > summary { cursor: pointer; font-weight: 600; }
.scope-area { margin: 0.5rem 0; }
.scope-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.15rem 1rem; }

/* Own measurements (ADR-0039) */
.entry-area { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 1rem; margin-bottom: 0.75rem; background: var(--surface, #fff); }
.entry-area > summary { cursor: pointer; padding: 0.2rem 0; }
.entry-area > summary .muted { font-size: 0.9rem; margin-left: 0.4rem; }
.entry-area[open] > summary { margin-bottom: 0.75rem; }
.entry-form fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 1rem; margin: 0 0 1rem; }
.entry-form legend { font-weight: 600; padding: 0 0.3rem; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0 1.25rem; }
.entry-grid p { margin: 0.3rem 0; }
.entry-grid label { display: block; font-size: 0.9rem; }
.entry-sub { margin: 0 0 1rem; }
.entry-sub > summary { cursor: pointer; font-weight: 600; }
.entry-form .hint { color: var(--muted); font-size: 0.9rem; }
.own-when { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; margin-bottom: 1rem; }
.own-when input:not([type="checkbox"]):not([type="radio"]) { width: auto; }
.own-when label { margin: 0; }
.energy-value { font-size: 1.4rem; font-weight: 600; }
.content--settings .helptext { display: block; color: var(--muted); font-size: 0.9rem; }
.profile-body { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 1rem; margin: 1rem 0; }
.profile-body legend { font-weight: 600; padding: 0 0.3rem; }
/* Diary (ADR-0041) */
.diary-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 1.1rem; margin-bottom: 1.25rem; background: var(--surface, #fff); }
.diary-card > summary { cursor: pointer; }
.diary-card > summary h2 { display: inline; font-size: 1.2rem; }
.diary-card h2 { margin-top: 0.2rem; }
.scale-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.5rem 2rem; margin-bottom: 0.75rem; }
.scale label { font-weight: 600; }
.scale-input { accent-color: var(--accent); }
.scale-input:not([type="checkbox"]):not([type="radio"]) { padding: 0; border: 0; background: none; }
.scale-input.is-unset { opacity: 0.35; }
.scale-anchors { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.85rem; color: var(--muted); }
.scale-anchors output { font-weight: 600; color: var(--text); font-size: 1rem; }
.scale-reset { font-size: 0.8rem; }
.diary-more { margin: 0.4rem 0; }
.diary-more > summary { cursor: pointer; color: var(--accent-strong); }
.feeling-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.5rem 1rem; margin-top: 0.5rem; }
.feeling-groups fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.8rem; }
.feeling-groups legend { font-size: 0.85rem; color: var(--muted); }
.tag-list { margin-top: 0.5rem; }
label.tag-choice { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: normal; margin: 0.15rem 0.8rem 0.15rem 0; }
.diary-day { font-size: 1rem; margin: 1rem 0 0.4rem; }
.diary-entries { list-style: none; padding: 0; margin: 0; }
.diary-entry { border-left: 3px solid var(--border); padding: 0.3rem 0.8rem; margin-bottom: 0.5rem; }
.diary-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1rem; }
.diary-entry-head .inline-form { margin-left: auto; }
.diary-tags { margin: 0.3rem 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag--context { border-style: dashed; }
.diary-note { margin: 0.3rem 0; white-space: normal; }
.help-box { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1rem; font-size: 0.92rem; }
.topic-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.topic-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 1rem; background: var(--surface, #fff); }
.topic-card h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.w-checkin .scale { margin-bottom: 0.4rem; }
.help-box a[href^="tel:"] { white-space: nowrap; }
/* Diary topics (ADR-0042) */
.diary-tools { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: -0.5rem 0 1.2rem; }
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.5rem 1rem; margin-top: 0.5rem; }
.skill-groups fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.8rem; }
.skill-groups legend { font-size: 0.85rem; color: var(--muted); }
.helped-row { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: center; }
.helped-row label, .level-options label { display: inline-flex; gap: 0.25rem; font-weight: normal; margin: 0; }
.diary-levels { border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 1rem; margin: 0 0 1rem; }
.diary-levels legend { font-size: 0.9rem; color: var(--muted); }
.level-row { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; align-items: baseline; padding: 0.3rem 0; border-bottom: 1px dashed var(--border); }
.level-row:last-child { border-bottom: 0; }
.level-label { flex: 1 1 16rem; }
.level-options { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; align-items: baseline; }
.level-anchor { font-size: 0.8rem; }
.tag--skill { border-color: var(--accent); color: var(--accent-strong); }
.topic-card--on { border-color: var(--accent); }
.topic-state { color: var(--accent-strong); }
.consent { font-size: 0.9rem; }
.limits-form, .add-skill, .plan-form, .activity-done { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; }
.limits-form input[type="number"]:not([type="checkbox"]) { width: 5rem; }
.add-skill input[type="text"]:not([type="checkbox"]), .plan-form input[type="text"]:not([type="checkbox"]) { flex: 1 1 18rem; width: auto; }
.add-skill select, .plan-form select, .plan-form input[type="date"]:not([type="checkbox"]), .activity-done select { width: auto; }
.skill-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.8rem; }
.skill-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.9rem; background: var(--surface, #fff); }
.skill-card h3 { font-size: 1rem; margin: 0 0 0.3rem; }
.skill-card p { margin: 0.3rem 0; font-size: 0.92rem; }
.caution { color: var(--muted); font-size: 0.85rem; }
.skill-zone h2 { font-size: 1.1rem; }
.activity { border-left: 3px solid var(--accent); padding: 0.2rem 0.8rem; margin-bottom: 0.8rem; }
.activity p { margin: 0.2rem 0; }
.activity-done label { display: inline-flex; gap: 0.3rem; align-items: center; font-weight: normal; margin: 0; }
.crisis-numbers { border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 1rem; margin-bottom: 1rem; }
.crisis-numbers a { white-space: nowrap; }
.crisis-plan h2 { font-size: 1rem; margin-bottom: 0.2rem; }
.week-summary { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin-bottom: 0.8rem; }
.week-card th, .week-card td { text-align: center; padding: 0.3rem 0.5rem; }
.week-card th[scope="row"] { text-align: left; font-weight: normal; }
.week-context th, .week-context td { color: var(--muted); }
.table-scroll { overflow-x: auto; }
.breath { display: flex; flex-direction: column; align-items: center; margin: 2rem 0; min-height: 18rem; position: relative; }
.breath-circle { width: 12rem; height: 12rem; border-radius: 50%; background: var(--accent); opacity: 0.35; animation: breath 10s ease-in-out infinite; }
.breath-in, .breath-out { position: absolute; top: 5.2rem; font-size: 1.2rem; margin: 0; }
.breath-in { animation: breath-in 10s step-end infinite; }
.breath-out { animation: breath-out 10s step-end infinite; }
@keyframes breath { 0%, 100% { transform: scale(0.55); } 50% { transform: scale(1); } }
@keyframes breath-in { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes breath-out { 0% { opacity: 0; } 50% { opacity: 1; } }
@media print { .site-header, .no-print, .messages { display: none; } }
/* Diary, calmer layout (ADR-0042) */
.diary-title { font-size: 1.6rem; margin: 0 0 0.5rem; }
.diary-extras { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.3rem 1.2rem; margin: 0.2rem 0 0.8rem; }
.diary-extras > details { flex: 0 1 auto; }
.diary-extras > details[open] { flex: 1 1 100%; }
.diary-extras .diary-more { margin: 0; }
.h2-like { font-size: 1.2rem; margin-right: 0.6rem; }
.diary-review-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; }
.diary-review-summary .muted { font-size: 0.9rem; }
.diary-today h2 { font-size: 1.1rem; }
.diary-time { color: var(--muted); min-width: 4.5rem; }
.diary-rating--quiet { color: var(--muted); font-size: 0.9rem; }
.diary-entry--review { border-left-color: var(--accent); }
.diary-delete { margin-left: auto; font-size: 0.85rem; }
.diary-delete .link-button { color: var(--muted); }
.diary-day-link { display: block; color: inherit; text-decoration: none; min-height: 4.5rem; }
.diary-day-link:hover { background: var(--bg); }
.diary-day-marks { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 0.2rem; }
.month-title { margin: 0; font-size: 1.2rem; }
/* Address book (ADR-0043) */
.contact-results { list-style: none; padding: 0; margin: -0.4rem 0 0.8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface, #fff); }
.contact-results li + li { border-top: 1px solid var(--border); }
button.contact-result { display: flex; flex-direction: column; align-items: flex-start; width: 100%; background: none; color: var(--text); border: 0; border-radius: 0; padding: 0.5rem 0.8rem; text-align: left; font-weight: 600; }
button.contact-result:hover { background: var(--bg); }
button.contact-result .muted { font-weight: normal; font-size: 0.85rem; }
.contact-chosen { padding: 0.5rem 0.8rem; border: 1px solid var(--accent); border-radius: 8px; }
.contact-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.8rem; }
.contact-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 1rem; background: var(--surface, #fff); }
.contact-card p { margin: 0.25rem 0; }
.contact-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.contact-head h3 { margin: 0; font-size: 1.05rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.home-notice { margin: 0 0 1rem; }
/* Documents (ADR-0044) */
nav.filter-row { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 1rem 0; }
nav.filter-row a[aria-current="page"] { font-weight: 600; color: var(--text); text-decoration: none; }
.document-list td, .document-list th { padding: 0.45rem 0.5rem; }
.document-view { display: grid; grid-template-columns: minmax(14rem, 22rem) 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 48rem) { .document-view { grid-template-columns: 1fr; } }
.document-preview img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.document-pdf { display: flex; align-items: center; justify-content: center; height: 12rem; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 1.4rem; }
.lab-found td, .lab-found th { padding: 0.3rem 0.4rem; }
.lab-found input[type="text"]:not([type="checkbox"]) { width: 6rem; }
.lab-found select { width: auto; max-width: 16rem; }
.line-source { font-weight: normal; font-size: 0.8125rem; }
.nowrap { white-space: nowrap; }
/* Psyche (ADR-0045) */
.psyche-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 0.8rem; }
.psyche-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.psyche-nav a { padding: 0.5rem 0.85rem; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--muted); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.psyche-nav a:hover { color: var(--text); }
.psyche-nav a[aria-current="page"] { color: var(--text); background: var(--surface, #fff); border-color: var(--border); font-weight: 600; }
.crisis-button { margin-bottom: 0.4rem; padding: 0.3rem 0.8rem; border: 1px solid var(--accent); border-radius: 999px; text-decoration: none; color: var(--accent-strong); font-size: 0.9rem; }
.crisis-button:hover, .crisis-button.is-current { background: var(--accent); color: var(--bg); }
.psyche-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 52rem) { .psyche-grid { grid-template-columns: 1fr; } }
.week-facts { display: grid; gap: 0.3rem; margin: 0 0 0.6rem; }
.week-facts > div { display: flex; justify-content: space-between; }
.week-facts dd { margin: 0; font-weight: 600; }
.psyche-title { font-size: 1.6rem; margin: 0 0 0.5rem; }
/* Calendar (ADR-0045) */
.plan-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.5rem; }
@media (max-width: 64rem) { .plan-week { grid-template-columns: 1fr; } }
.plan-day { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.6rem; min-height: 10rem; }
.plan-day--today { outline: 2px solid var(--accent); outline-offset: -2px; }
.plan-day h3 { font-size: 0.95rem; margin: 0 0 0.4rem; }
.plan-day ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.plan-item { border-left: 3px solid var(--border); padding: 0.2rem 0.4rem; display: flex; flex-wrap: wrap; gap: 0 0.4rem; font-size: 0.9rem; }
.plan-item--appointment { border-left-color: var(--accent-strong); }
.plan-item--activity { border-left-color: var(--accent); }
.plan-item--suggested { border: 1px dashed var(--accent); border-left-width: 3px; }
.plan-item--done .plan-title, .plan-item--skipped .plan-title { color: var(--muted); }
.plan-item--skipped .plan-title { text-decoration: line-through; }
.plan-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.plan-title { flex: 1 1 100%; }
.plan-meta { font-size: 0.8125rem; color: var(--muted); }
.plan-actions { display: flex; gap: 0.5rem; margin-left: auto; align-items: center; }
.plan-actions .link-button { color: var(--muted); }
.time-span { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.time-span input[type="time"] { min-width: 0; flex: 0 1 8.5rem; }
.time-span input:not([type="checkbox"]) { width: auto; }
.plan-empty { font-size: 0.8rem; }
.plan-item { min-width: 0; overflow-wrap: anywhere; }
.plan-item--suggested .plan-actions { flex-wrap: wrap; margin-left: 0; }
.plan-actions .button-small { padding: 0.15rem 0.6rem; }
/* Calendar grid (ADR-0045) */
.cal-views { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cal-views a { padding: 0.25rem 0.8rem; text-decoration: none; color: var(--muted); font-size: 0.9rem; }
.cal-views a[aria-current="page"] { background: var(--accent); color: var(--bg); }
.cal-strip { display: grid; grid-template-columns: 2.5rem repeat(7, 1fr); align-items: center; margin: 0 0 0.8rem; text-align: center; }
.cal-strip a { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.3rem 0; text-decoration: none; color: var(--text); border-radius: 8px; position: relative; }
.cal-strip a span { font-size: 0.8125rem; color: var(--muted); }
.cal-strip a strong { width: 2.2rem; height: 2.2rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 600; }
.cal-strip a.is-chosen strong { background: var(--accent); color: var(--bg); }
.cal-strip a.is-today:not(.is-chosen) strong { outline: 2px solid var(--accent); }
.cal-strip a i { width: 0.3rem; height: 0.3rem; border-radius: 50%; background: var(--muted); }
.cal-strip-week { font-size: 0.8rem; }
.cal-grid { --cal-hour: 48px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface, #fff); overflow: hidden; margin-bottom: 1rem; }
.cal-head, .cal-allday, .cal-body { display: grid; grid-template-columns: 3.5rem repeat(var(--cal-days, 7), minmax(0, 1fr)); }
.cal-grid--day .cal-head, .cal-grid--day .cal-allday, .cal-grid--day .cal-body { grid-template-columns: 3.5rem 1fr; }
.cal-head { border-bottom: 1px solid var(--border); }
.cal-head a { padding: 0.4rem; text-align: center; text-decoration: none; color: var(--muted); font-size: 0.9rem; }
.cal-head a.is-today { color: var(--accent-strong); }
.cal-allday { border-bottom: 1px solid var(--border); min-height: 2rem; }
.cal-label { font-size: 0.8125rem; color: var(--muted); padding: 0.3rem; }
.cal-allday-cell { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.2rem; border-left: 1px solid var(--border); }
.cal-chip { font-size: 0.78rem; padding: 0.1rem 0.4rem; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-body { max-height: 70vh; overflow-y: auto; position: relative; }
.cal-hours { display: flex; flex-direction: column; }
.cal-hour { height: var(--cal-hour); box-sizing: border-box; font-size: 0.8125rem; color: var(--muted); text-align: right; padding: 0 0.4rem; transform: translateY(-0.45rem); }
.cal-col { position: relative; border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--cal-hour) - 1px), var(--border) calc(var(--cal-hour) - 1px), var(--border) var(--cal-hour)); }
.cal-col.is-today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.cal-event { position: absolute; box-sizing: border-box; margin-left: 1px; padding: 0.15rem 0.35rem; border-radius: 4px; overflow: hidden; font-size: 0.8rem; line-height: 1.2; display: flex; flex-direction: column; }
.cal-event.is-short { flex-direction: row; gap: 0.4rem; align-items: baseline; }
.cal-event-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event-time { font-size: 0.8125rem; opacity: 0.85; white-space: nowrap; }
.cal-kind--appointment { background: color-mix(in srgb, var(--accent-strong) 22%, var(--surface, #fff)); border-left: 3px solid var(--accent-strong); }
.cal-kind--activity { background: color-mix(in srgb, var(--accent) 18%, var(--surface, #fff)); border-left: 3px solid var(--accent); }
.cal-kind--routine { background: color-mix(in srgb, var(--muted) 14%, var(--surface, #fff)); border-left: 3px solid var(--muted); }
.cal-kind--rest { background: color-mix(in srgb, var(--accent) 7%, var(--surface, #fff)); border-left: 3px dotted var(--accent); }
.cal-kind--other { background: var(--bg); border-left: 3px solid var(--border); }
.is-suggested { border: 1px dashed var(--accent); background: var(--surface, #fff); }
.is-done { opacity: 0.55; }
.cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--accent-strong); z-index: 2; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-strong); }
a.cal-event, a.cal-chip { color: var(--text); text-decoration: none; }
a.cal-event:hover, a.cal-chip:hover { filter: brightness(0.96); }
a.cal-event[data-movable] { cursor: grab; }
.cal-event.is-dragging { cursor: grabbing; opacity: 0.85; z-index: 3; box-shadow: 0 4px 12px rgb(0 0 0 / 0.18); }
.cal-col { cursor: cell; }
.cal-hint { margin: 0 0 0.4rem; }
.plan-suggest-list { list-style: none; padding: 0; display: grid; gap: 0.4rem; }
.plan-suggest-list li { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; }
.plan-suggest-list form { margin-left: auto; }
.cal-day-list ul { list-style: none; padding: 0; display: grid; gap: 0.4rem; }
.cal-day-list h3 { font-size: 1rem; }

/* --- Simple and detailed view (ADR-0047) --------------------------------------------------------- */
.view-switch { display: flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.75rem; font-size: 0.9rem; }
.view-switch span { color: var(--muted); margin-right: auto; }
.view-switch button { padding: 0.15rem 0.6rem; font-size: 0.85rem; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 999px; }
.view-switch button[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.mode-simple [data-advanced] { display: none !important; }
.mode-simple .widget-tools, .mode-simple .widget-resize { display: none; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.folder-tile { display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface, #fff); color: var(--text); text-decoration: none; }
.folder-tile:hover { border-color: var(--accent); }
.folder-tile strong { font-size: 1.05rem; }
.folder-tile .muted { font-size: 0.88rem; }
.today-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.today-list li { display: flex; gap: 0.5rem; align-items: baseline; }
.today-list .plan-time { min-width: 3rem; color: var(--muted); font-size: 0.85rem; }
.today-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.due-badge { font-size: 0.8rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--accent-strong); color: var(--bg); text-decoration: none; margin-left: 0.4rem; }
.today-list form { display: inline; margin-left: auto; }
.med-card h3 { margin: 0 0 0.3rem; }
.med-card p { margin: 0.2rem 0; }
.inline-details { display: inline-block; }
.inline-details > summary { list-style: none; cursor: pointer; display: inline-block; }
.inline-details[open] { display: block; width: 100%; }
.questionnaire .q-item { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; margin: 0 0 0.7rem; }
.questionnaire .q-item legend { font-weight: 600; padding: 0 0.3rem; }
.q-option { display: block; padding: 0.25rem 0; cursor: pointer; }
.q-score { font-size: 1.2rem; }
.q-score strong { font-size: 2rem; }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.task-forms { display: grid; gap: 0.5rem; }
.task-forms label { display: block; }
.report { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; }
.report section { margin: 1rem 0; }
.report h3 { font-size: 1.05rem; border-bottom: 1px solid var(--border); padding-bottom: 0.2rem; }
.report-head h2 { margin: 0; }
.emergency-card { border: 2px solid var(--error, #b00); border-radius: 10px; padding: 0.8rem 1rem; max-width: 34rem; background: var(--surface, #fff); }
.emergency-card h2 { color: var(--error, #b00); margin: 0 0 0.3rem; font-size: 1.1rem; }
.emergency-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.8rem; margin: 0.5rem 0 0; }
.emergency-card dt { font-weight: 600; }
.emergency-card dd { margin: 0; }
@media print {
  .site-header, .messages, .no-print, [data-print] { display: none !important; }
  body, .report { background: #fff; color: #000; border: 0; }
  .content { max-width: none; padding: 0; }
  .emergency-card { width: 8.5cm; font-size: 8pt; }
}
.women-month td.is-period { background: color-mix(in srgb, #c0392b 22%, var(--surface, #fff)); }
.women-month td.is-spotting { background: color-mix(in srgb, #c0392b 9%, var(--surface, #fff)); }
.women-month td.is-predicted { box-shadow: inset 0 0 0 2px color-mix(in srgb, #c0392b 45%, transparent); }
.legend-box { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 3px; vertical-align: middle; margin-left: 0.5rem; }
.legend-box.is-period { background: color-mix(in srgb, #c0392b 22%, #fff); }
.legend-box.is-spotting { background: color-mix(in srgb, #c0392b 9%, #fff); }
.legend-box.is-predicted { box-shadow: inset 0 0 0 2px color-mix(in srgb, #c0392b 45%, transparent); }
.phase-choice { margin: 0 0 1rem; }
.load-chart { width: 100%; height: 120px; }
.load-chart polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.load-ctl { stroke: var(--accent-strong); }
.load-atl { stroke: var(--muted); stroke-dasharray: 4 3; }
.load-legend-ctl { --series: var(--accent-strong); }
.load-legend-atl { --series: var(--muted); }
.exercise-rows input { width: 100%; box-sizing: border-box; }
.exercise-rows td:first-child { width: 50%; }
.exercise-list { margin: 0.2rem 0; padding-left: 1.2rem; }
.meals .meal-row th, .meals .meal-total th { text-align: left; }
.meals .meal-total { border-top: 2px solid var(--border); font-weight: 600; }
.proxy-banner { display: flex; gap: 1rem; align-items: center; justify-content: center; padding: 0.5rem 1rem; background: var(--accent-strong); color: var(--bg); font-weight: 600; }
.proxy-banner form { margin: 0; }
.today-actions { align-items: center; }
.today-actions form { margin: 0; }

/* --- Icons, modules and packages (ADR-0058) ------------------------------------------------------- */
.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.8rem; margin: 0.8rem 0 1.5rem; }
.package-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface, #fff); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.package-card h3, .package-card h2 { margin: 0; font-size: 1.05rem; display: flex; gap: 0.45rem; align-items: center; }
.package-card p { margin: 0; }
.package-card form { margin-top: auto; }
.package-card.is-complete { background: color-mix(in srgb, var(--accent) 6%, var(--surface, #fff)); }
.package-card.is-highlight { outline: 2px solid var(--accent); }
.chips-line { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.chip-static { font-size: 0.8rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }
.module-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 1rem 0.8rem; margin: 0 0 0.8rem; background: var(--surface, #fff); }
.module-group legend { font-weight: 600; padding: 0 0.3rem; display: flex; gap: 0.4rem; align-items: center; }
.module-row { display: grid; grid-template-columns: auto auto 1fr; gap: 0.6rem; align-items: start; padding: 0.45rem 0; border-top: 1px solid var(--border); cursor: pointer; }
.module-row:first-of-type { border-top: 0; }
.module-icon { color: var(--accent-strong); }
.recommend { display: grid; gap: 0.4rem; }

/* --- Design system and navigation (ADR-0059) ------------------------------------------------------ */
:root { --border-field: #8f877b; --area-psyche: #6b5ca5; --area-body: #b25b3c; --area-women: #b0466e; --area-meds: #2f6f8f;
  --area-activity: #3f7d6e; --area-organise: #8a6d1f; --area-insight: #555; }
@media (prefers-color-scheme: dark) { :root { --border-field: #8a847b; } }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { border-color: var(--border-field); }
input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); vertical-align: -0.2em; }
/* targets of at least 24 px (WCAG 2.5.8) */
button.link-button, .link-button { min-height: 24px; min-width: 24px; padding: 0.15rem 0.25rem; }
.info-button, .icon-button { min-width: 28px; min-height: 28px; }
/* destructive actions: red, and asked once more (static/js/confirm.js) */
button[value="delete"], button[value="remove"], button[value="unlink"], .button-danger { color: var(--error) !important; }
button.button-danger { background: var(--error); color: #fff !important; }
.small, small { font-size: 0.875rem; }
.muted.small { font-size: 0.875rem; }

.site-header { gap: 0.75rem 1.25rem; padding: 0.7rem 1.5rem; position: sticky; top: 0; z-index: 30; }
.main-nav { display: flex; flex-wrap: nowrap; gap: 0.15rem; flex: 1; min-width: 0; }
.site-header { flex-wrap: nowrap; }
.site-header .brand { flex-shrink: 0; }
.site-header .main-nav a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.7rem; border-radius: 999px; white-space: nowrap;
  color: var(--text); text-decoration: none; position: relative; }
.site-header .main-nav a .icon { color: var(--accent); }
.site-header .main-nav a:hover { background: var(--bg); }
.site-header .main-nav a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent-strong); font-weight: 600; }
.entry-button { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1rem; border-radius: 999px; background: var(--accent);
  color: #fff; text-decoration: none; font-weight: 600; }
.entry-button:hover, .entry-button.is-current { background: var(--accent-strong); color: #fff; }
.entry-button { white-space: nowrap; flex-shrink: 0; }
.crisis-link { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; color: var(--text); text-decoration: none;
  padding: 0.4rem 0.6rem; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.crisis-link .icon { color: var(--accent-strong); }  /* calm, not an alarm (ADR-0071) */
.crisis-link:hover { background: color-mix(in srgb, var(--error) 8%, var(--surface)); }
.profile-menu { flex-shrink: 0; }
.profile-name { white-space: nowrap; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; }
/* narrower desktops and tablets in landscape: the crisis link and the profile without words */
@media (max-width: 75rem) { .crisis-link span, .profile-name { display: none; } .crisis-link { padding: 0.45rem; } }
.due-dot { font-size: 0.75rem; line-height: 1; padding: 0.2rem 0.4rem; border-radius: 999px; background: var(--accent-strong); color: #fff; font-weight: 600; }
.profile-menu-body a { display: flex; align-items: center; gap: 0.5rem; }
.profile-menu-body a .icon { color: var(--muted); }

.hub-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin: -0.5rem 0 1.25rem; scrollbar-width: thin; }
.hub-tabs a { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.55rem 0.8rem; white-space: nowrap; color: var(--muted);
  text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.hub-tabs a:hover { color: var(--text); }
.hub-tabs a[aria-current="page"] { color: var(--accent-strong); border-bottom-color: var(--accent); font-weight: 600; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; margin: 1rem 0 1.5rem; }
.hub-tile { display: flex; gap: 0.8rem; align-items: center; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none; min-height: 4.5rem; }
.hub-tile:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgb(0 0 0 / 0.06); }
.hub-tile strong { display: block; }
.hub-icon { display: inline-flex; width: 2.6rem; height: 2.6rem; border-radius: 12px; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent-strong); flex-shrink: 0; }
.hub-icon .icon { width: 1.4rem; height: 1.4rem; }

.tabbar { display: none; }
@media (max-width: 60rem) {
  .site-header { padding: 0.6rem 1rem; }
  .site-header .main-nav, .site-header .entry-button { display: none; }
  .crisis-link span, .profile-name { display: none; }
  .crisis-link { margin-left: auto; order: 2; }
  .profile-menu { margin-left: 0.5rem; order: 3; }
  body { padding-bottom: 4.5rem; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border); padding: 0.3rem 0.2rem calc(0.3rem + env(safe-area-inset-bottom)); }
  .tabbar > a, .tabbar-more > summary { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.8125rem;
    color: var(--muted); text-decoration: none; padding: 0.25rem 0; position: relative; list-style: none; cursor: pointer; min-height: 44px; }
  .tabbar-more > summary::-webkit-details-marker { display: none; }
  .tabbar .icon { width: 1.4rem; height: 1.4rem; }
  .tabbar > a[aria-current="page"] { color: var(--accent-strong); font-weight: 600; }
  .tabbar-entry .icon { background: var(--accent); color: #fff; border-radius: 999px; padding: 0.2rem; width: 1.9rem; height: 1.9rem; }
  .tabbar .due-dot { position: absolute; top: 0; right: 22%; font-size: 0.7rem; }
  .tabbar-more { position: relative; margin: 0; }
  .tabbar-more-body { position: absolute; bottom: calc(100% + 0.4rem); right: 0.3rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 6px 20px rgb(0 0 0 / 0.15); display: grid; min-width: 14rem; padding: 0.3rem; }
  .tabbar-more-body a { display: flex; gap: 0.5rem; align-items: center; padding: 0.7rem 0.8rem; color: var(--text); text-decoration: none; border-radius: 8px; }
  .hub-tabs { margin-top: -1rem; }
}
@media print { .tabbar, .hub-tabs, .entry-button, .crisis-link { display: none !important; } }
.help-line { margin: 2rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--border); font-size: 0.9rem; }
.help-line .icon { color: var(--error); }
/* Tabs: wrap into a second row on a tablet, scroll sideways on a phone
   with a fading edge while there is more (tabs.js). */
@media (max-width: 37.5rem) {
  .hub-tabs { flex-wrap: nowrap; scrollbar-width: none; }
  .hub-tabs::-webkit-scrollbar { display: none; }
  .hub-tabs.more-right { mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
  .hub-tabs.more-left { mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); }
  .hub-tabs.more-left.more-right { mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent); }
}
.sub-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: -0.5rem 0 1.25rem; }
.sub-tabs a { padding: 0.35rem 0.8rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); text-decoration: none;
  font-size: 0.9rem; min-height: 2.2rem; display: inline-flex; align-items: center; }
.sub-tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.entry-button .icon, .entry-button span { color: #fff; }
.site-header .button { margin: 0; }
.share-grid { grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); }
.share-card dl.facts { grid-template-columns: 1fr; gap: 0.15rem; }
.share-card dl.facts dt { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.5rem; }
.w-form-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.w-form-row button { margin: 0; }
.actions-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.actions-row .button-small { text-decoration: none; }

/* packages: which of their modules are on, switch on and off (Ben, 2026-12-04) */
.chip-static.is-on { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-strong); }
.chip-static .icon { width: 0.85rem; height: 0.85rem; margin-right: 0.15rem; vertical-align: -0.1rem; }
.package-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: auto; padding-top: 0.4rem; }
.package-actions button { margin: 0; }
.package-state { color: var(--muted); }
/* skills kit (Ben, 2026-12-04) */
.kit-hints { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-radius: var(--radius); padding: 0.8rem 1rem; margin: 1rem 0 1.5rem; }
.kit-hints h2 { margin-top: 0; font-size: 1.1rem; display: flex; gap: 0.4rem; align-items: center; }
.kit-hint-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.kit-hint-list li { display: flex; gap: 0.8rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.kit-hint-list form { margin: 0; }
.kit h2, .kit-hints h2 { display: flex; gap: 0.45rem; align-items: center; }
.kit-zone { font-size: 1rem; margin: 1rem 0 0.4rem; color: var(--muted); }
.skill-card h4 { font-size: 1rem; margin: 0 0 0.3rem; }
.skill-card.is-kit { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.skill-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.4rem; }
.skill-card-actions button { margin: 0; }
.skill-seen { color: var(--muted); font-size: 0.8125rem !important; }
.skill-zone > summary { cursor: pointer; padding: 0.4rem 0; }
.h3-like { font-size: 1.05rem; font-weight: 600; }
.limits-box { margin-top: 1.5rem; }
.limits-box > summary { cursor: pointer; }
/* correcting how recordings are grouped: quiet, one place per card */
.fix-box { margin-top: 0.6rem; font-size: 0.9rem; }
.fix-box > summary { cursor: pointer; color: var(--muted); display: inline-flex; gap: 0.35rem; align-items: center; }
.fix-box > summary:hover { color: var(--text); }
.fix-box .fix-option { margin: 0.6rem 0 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--border); }
.fix-box .fix-option p { margin: 0 0 0.4rem; }
.fix-box .action-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fix-box button { margin: 0; }
.linking-note { color: var(--muted); font-size: 0.8125rem; }
/* choosing values: quick choices as chips, the rest in grouped lists (Ben, 2026-12-04) */
.outcome-pick { border: none; padding: 0; margin: 0.5rem 0 1rem; }
.outcome-pick legend { font-weight: 600; padding: 0; margin-bottom: 0.3rem; }
.tag-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.3rem 0 0.8rem; }
.tag-choices label.tag-choice { border: 1px solid var(--border-field); border-radius: 999px; padding: 0.35rem 0.8rem; margin: 0; cursor: pointer; min-height: 32px; }
.tag-choices label.tag-choice:has(input:checked) { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-color: var(--accent); color: var(--accent-strong); }
.outcome-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0 1rem; }
.outcome-more select { width: 100%; }

/* Menopause (ADR-0062) */
.compact-list { margin: 0.3rem 0 0.6rem; padding-left: 1.2rem; }
.compact-list li { margin: 0.15rem 0; }
fieldset.trigger-pick { border: 0; padding: 0; margin: 0 0 0.8rem; }
fieldset.trigger-pick legend { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; padding: 0; }
.reminder-pick { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.reminder-pick form { margin: 0; }
.preset-line { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin: 0.3rem 0 0.8rem; }
.report-suggest { list-style: none; padding: 0; margin: 0.3rem 0; }
.report-suggest li { display: flex; gap: 0.6rem; align-items: baseline; justify-content: space-between; padding: 0.2rem 0; border-bottom: 1px solid var(--border); }
.fact-line { margin: 0 0 0.2rem; }
details.more-info { margin: 0 0 0.8rem; }
details.more-info > summary { font-size: 0.85rem; color: var(--muted); cursor: pointer; }
details.more-entry { margin: 0 0 0.8rem; }
details.more-entry > summary { cursor: pointer; margin-bottom: 0.5rem; }
fieldset.segmented--wrap span { overflow-wrap: anywhere; hyphens: auto; padding-left: 0.25rem; padding-right: 0.25rem; }
.compare-table { width: auto; min-width: 16rem; }
@media (max-width: 30rem) {
  .hub-tabs--compact a { padding: 0.55rem 0.5rem; }
  .hub-tabs--compact a .icon { display: none; }
}
fieldset.segmented--wrap label { display: flex; }
fieldset.segmented--wrap span { flex: 1; display: flex; align-items: center; justify-content: center; line-height: 1.2; }

/* Supplements (ADR-0063) */
tr.group-row th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 600; padding-top: 0.9rem; border-bottom: 1px solid var(--border); }
.add-line { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 1rem; }
details.more-fields { margin: 0.4rem 0 0.9rem; }
details.more-fields > summary { cursor: pointer; color: var(--muted); font-size: 0.92rem; margin-bottom: 0.5rem; }
/* Package photo (ADR-0064) */
.med-card::after { content: ""; display: block; clear: both; }
.package-link { float: right; margin: 0 0 0.5rem 0.8rem; }
.package-thumb { width: 5.5rem; height: 5.5rem; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.photo-field { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-start; }
.photo-field p { flex: 1 1 16rem; margin-top: 0; }
.photo-field input[type="file"] { max-width: 100%; }
/* Package reading and lookup (ADR-0065) */
.photo-help { border: 1px dashed var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; margin: 0.4rem 0 0.9rem; }
.photo-help:empty { display: none; }
.line-picks { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.3rem 0 0.6rem; }
.line-picks form { margin: 0; }
.lookup-result { background: var(--surface); border-radius: 8px; padding: 0.5rem 0.7rem; margin: 0.4rem 0; }
.lookup-result p { margin: 0.2rem 0; }
.lookup-ask { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; margin: 0.4rem 0 0; }
/* Stress and mindfulness (ADR-0066) */
.calm-list { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); margin: 1rem 0; }
.calm-card { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; background: var(--surface); color: var(--text); text-decoration: none; }
.calm-card:hover { border-color: var(--accent); }
.calm-steps { font-size: 1.05rem; line-height: 1.6; padding-left: 1.4rem; margin: 1rem 0; }
.calm-steps li { margin: 0.5rem 0; }
.calm-anchors { display: flex; justify-content: space-between; margin: -0.5rem 0 1rem; }
.calm-timer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 1rem 0 1.4rem; }
.calm-timer select { width: auto; }
.calm-clock { font-size: 1.6rem; font-variant-numeric: tabular-nums; min-width: 4ch; }
.calm-timer [data-done] { flex-basis: 100%; margin: 0; }
.calm-actions { display: flex; gap: 1rem; align-items: center; }

/* My topics (ADR-0067) */
.plain-list { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.plain-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.theme-numbers h2 { margin-top: 0; }

/* All own entries (ADR-0059, Nachtrag 3) */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.journal-day h2 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.journal { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.journal li + li { border-top: 1px solid var(--border); }
.journal li > a, .journal li > .journal-icon { color: inherit; text-decoration: none; }
.journal li > a, .journal li { display: flex; gap: 0.7rem; align-items: flex-start; }
.journal li { padding: 0; }
.journal li > a { flex: 1; padding: 0.6rem 0.8rem; }
.journal li > a:hover { background: var(--bg); }
.journal-icon { color: var(--accent-strong); flex-shrink: 0; padding-top: 0.15rem; }
.journal-body { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.preset-goals .preset-line { margin: 0 0 0.4rem; }
.preset-goal { display: inline-block; min-width: 9rem; font-weight: 600; font-size: 0.9rem; margin-right: 0.3rem; }

/* Self-care in midlife (ADR-0068) */
.checkup-list { list-style: none; padding: 0; margin: 0 0 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.checkup { padding: 0.7rem 0.9rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; justify-content: space-between; }
.checkup + .checkup { border-top: 1px solid var(--border); }
.checkup-main { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 18rem; min-width: 0; }
.checkup.is-due { border-left: 4px solid var(--accent); }
.checkup-state { color: var(--muted); }
.checkup.is-due .checkup-state strong { color: var(--accent-strong); }
.checkup-actions { flex: 0 1 auto; }
.checkup-actions .inline-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0; }
.input-short { width: 7rem; display: inline-block; }
.bp-table { width: 100%; }
.bp-table td, .bp-table th { text-align: left; padding: 0.3rem 0.4rem; }
.bp-average { font-size: 1.6rem; font-weight: 600; }
.bp-readings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.8rem; max-width: 30rem; }
.bp-readings input { width: 100%; min-width: 0; box-sizing: border-box; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.6rem; }
.time-grid input { width: 100%; min-width: 0; box-sizing: border-box; }
.package-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 0 0.6rem; padding: 0 0.9rem; }
.package-group > summary { cursor: pointer; padding: 0.8rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; list-style-position: inside; }
.package-group > summary .muted { flex: 1 1 100%; padding-left: 1.6rem; }
.package-group[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 0.8rem; }
.package-group .package-grid { margin-bottom: 0.9rem; }
.guided .tag-choices { margin-bottom: 0.5rem; }
.package-group .module-group { border: 0; padding: 0; margin: 0 0 0.6rem; }
/* Building blocks in a package card can be switched on their own (ADR-0070) */
.chip-toggle { font: inherit; font-size: 0.85rem; padding: 0.3rem 0.7rem; min-height: 2.2rem; border-radius: 999px; cursor: pointer;
  background: var(--bg); color: var(--muted); border: 1px dashed var(--border); margin: 0 0.3rem 0.35rem 0; display: inline-flex; align-items: center; gap: 0.2rem; }
.chip-toggle.is-on { border-style: solid; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-strong); }
.chip-toggle:hover { border-color: var(--accent); }
.chip-toggle .icon { width: 0.9rem; height: 0.9rem; }
form.chips-line { margin: 0 0 0.4rem; }

/* ADR-0071: a connection with a therapy value always carries this hint */
.therapy-hint { display: block; margin-top: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.home-view-switch { margin: 0; }
.band-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; list-style: none; padding: 0; margin: 0.4rem 0 0; font-size: 0.78rem; color: var(--muted); }
.band-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.band-key { display: inline-block; width: 14px; height: 10px; }
.band-key--band { background: color-mix(in srgb, var(--series) 18%, transparent); }
.band-key--mean { height: 2px; background: var(--series); }
.band-key--daily { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.band-key--unusual { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--text); }
.message--leaving { opacity: 0; transition: opacity 0.4s; }
.layer-sample--1 path, .layer-sample--1 line { stroke: var(--cat-1); }
.layer-sample--2 path, .layer-sample--2 line { stroke: var(--cat-2); }
.layer-sample--3 path, .layer-sample--3 line { stroke: var(--cat-3); }
.layer-sample--4 path, .layer-sample--4 line { stroke: var(--cat-4); }
.chart-data { margin-top: 0.4rem; font-size: 0.82rem; }
.chart-data summary { cursor: pointer; color: var(--muted); }
.chart-data[open] { max-height: 18rem; overflow: auto; }
.chart-data-table { border-collapse: collapse; width: 100%; }
.chart-data-table th, .chart-data-table td { padding: 0.15rem 0.5rem; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.chart-data-table th[scope="row"], .chart-data-table thead th:first-child { text-align: left; }
.nav-intro { margin: 0 0 1rem; max-width: 46rem; }
.nav-intro-title { font-size: 1rem; margin: 0 0 0.4rem; }
.nav-intro-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; margin: 0 0 0.6rem; font-size: 0.9rem; }
.nav-intro-list dt { font-weight: 600; }
.nav-intro-list dd { margin: 0; }
@media (max-width: 30rem) { .nav-intro-list { grid-template-columns: 1fr; } .nav-intro-list dd { margin-bottom: 0.3rem; } }

/* Beta banner and reports (ADR-0074): one calm line, never covering content. */
.beta-banner { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; justify-content: center;
  padding: 0.35rem 1rem; font-size: 0.9rem; color: var(--text); background: var(--surface);
  border-bottom: 1px solid var(--border); text-align: center; }
.beta-banner strong { color: var(--accent-strong); }
.beta-banner .button-small { min-height: 24px; }
.feedback-dialog textarea { width: 100%; box-sizing: border-box; font: inherit; }
dialog.editor .feedback-check { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.8rem; font-size: 0.95rem;
  color: var(--text); }
.feedback-hint { font-size: 0.85rem; color: var(--muted); }
.feedback-status:empty { display: none; }
.feedback-dialog .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Administration: invitation links and reports. */
.copy-field { display: flex; gap: 0.4rem; align-items: center; min-width: 16rem; }
.copy-field input { flex: 1; min-width: 0; font-size: 0.85rem; }
.copy-field--large input { font-size: 1rem; }
tr.is-new { outline: 2px solid var(--accent); }
.feedback-text { white-space: pre-wrap; }
.feedback-frame { max-width: none; height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.feedback-frame-wrap { overflow: auto; }
.status-filter { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 1rem; }
.entrance-invited { padding: 0.6rem 0.9rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: var(--radius); }
