/* ==========================================================================
   SteadyWeight — one stylesheet.

   Tokens follow the data-viz reference palette so the app chrome and the
   charts are one system rather than two that happen to sit together. Dark
   mode is a *selected* set of steps against the dark surface, not an
   inversion of the light one.
   ========================================================================== */

:root {
  color-scheme: light;

  --plane: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --hairline: rgba(11, 11, 11, 0.1);
  --hairline-strong: rgba(11, 11, 11, 0.16);

  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-wash: rgba(42, 120, 214, 0.09);

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-text: #006300;
  --warning-text: #7a5300;
  --serious-text: #9b3f14;
  --critical-text: #a62222;

  --viz-series: #2a78d6;
  --viz-dot: #898781;
  --viz-corridor: rgba(137, 135, 129, 0.16);
  --viz-plan: #a9a7a0;

  --shadow-1: 0 1px 2px rgba(11, 11, 11, 0.05), 0 1px 1px rgba(11, 11, 11, 0.03);
  --shadow-2: 0 6px 24px rgba(11, 11, 11, 0.1), 0 2px 6px rgba(11, 11, 11, 0.06);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --tap: 44px;
  --gutter: 16px;
  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --plane: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232322;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --hairline: rgba(255, 255, 255, 0.1);
    --hairline-strong: rgba(255, 255, 255, 0.16);

    --accent: #3987e5;
    --accent-ink: #06121f;
    --accent-wash: rgba(57, 135, 229, 0.16);

    --good-text: #0ca30c;
    --warning-text: #fab219;
    --serious-text: #ec835a;
    --critical-text: #e07a7a;

    --viz-series: #3987e5;
    --viz-dot: #898781;
    --viz-corridor: rgba(137, 135, 129, 0.2);
    --viz-plan: #6e6d68;

    --shadow-1: none;
    --shadow-2: 0 10px 34px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --plane: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  --accent: #3987e5;
  --accent-ink: #06121f;
  --accent-wash: rgba(57, 135, 229, 0.16);

  --good-text: #0ca30c;
  --warning-text: #fab219;
  --serious-text: #ec835a;
  --critical-text: #e07a7a;

  --viz-series: #3987e5;
  --viz-dot: #898781;
  --viz-corridor: rgba(137, 135, 129, 0.2);
  --viz-plan: #6e6d68;

  --shadow-1: none;
  --shadow-2: 0 10px 34px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

/* Several components set `display` in a class rule, which outranks the UA
   stylesheet's `[hidden] { display: none }`. Without this, `el.hidden = true`
   silently does nothing. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--plane);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------- layout ---------------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) var(--gutter) 10px;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}

.appbar.is-scrolled {
  border-bottom-color: var(--hairline);
}

.appbar-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.appbar-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:active {
  background: var(--surface-2);
}

.view {
  flex: 1;
  padding: 4px var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.view:focus {
  outline: none;
}

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
  background: color-mix(in srgb, var(--plane) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--hairline);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 50px;
  padding: 6px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.tab[aria-current='page'] {
  color: var(--accent);
}

.tab:active {
  background: var(--surface-2);
}

/* ---------------- cards & primitives ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-1);
}

.card--flush {
  padding: 16px 12px 12px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-note {
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.06s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--ghost {
  background: transparent;
  border-color: var(--hairline-strong);
  color: var(--ink-2);
}

.btn--danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--critical) 45%, transparent);
  color: var(--critical-text);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
  border-radius: var(--r-sm);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-row .btn {
  flex: 1 1 auto;
}

/* chips */

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chips--segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: 999px;
}

.chips--segmented .chip {
  border: 0;
  background: transparent;
  min-height: 34px;
}

.chips--segmented .chip[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* The selected segment needs to sit *above* the track in dark mode, where the
   normal surface is darker than the track it sits on. */
:root[data-theme='dark'] .chips--segmented .chip[aria-pressed='true'] {
  background: #35352f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .chips--segmented .chip[aria-pressed='true'] {
    background: #35352f;
  }
}

/* ---------------- status ---------------- */

.status {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.status-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.tone-good .status-badge {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good-text);
}
.tone-warning .status-badge {
  background: color-mix(in srgb, var(--warning) 22%, transparent);
  color: var(--warning-text);
}
.tone-serious .status-badge {
  background: color-mix(in srgb, var(--serious) 22%, transparent);
  color: var(--serious-text);
}
.tone-critical .status-badge {
  background: color-mix(in srgb, var(--critical) 16%, transparent);
  color: var(--critical-text);
}
.tone-neutral .status-badge {
  background: var(--surface-2);
  color: var(--ink-2);
}

.status-headline {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.status-detail {
  margin-top: 3px;
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* The remediation verdict. Set off by a rule rather than a box: it is a second
   voice on the same status, not a separate card. */
.status-credit {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* hero figure */

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-value {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero-sub {
  font-size: 0.85rem;
  color: var(--ink-2);
}

.hero-side {
  text-align: right;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.hero-side b {
  display: block;
  font-size: 1.05rem;
  color: var(--ink);
}

/* stat tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tile {
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.tile-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tile-value {
  margin-top: 2px;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.tile-note {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}

/* ---------------- weight entry ---------------- */

.logger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.step-btn {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.06s ease;
}

.step-btn:active {
  transform: scale(0.93);
  background: var(--accent-wash);
}

.weight-field {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.weight-input {
  width: 100%;
  max-width: 170px;
  border: 0;
  border-bottom: 2px dotted transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-align: center;
  padding: 0;
  min-width: 0;
}

.weight-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.weight-input::-webkit-outer-spin-button,
.weight-input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.weight-unit {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
}

.log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.date-input {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 7px 10px;
  min-height: 36px;
}

/* ---------------- charts ---------------- */

.viz {
  position: relative;
  width: 100%;
}

.viz-svg {
  display: block;
  overflow: visible;
  touch-action: pan-y;
}

.viz-grid {
  stroke: var(--grid);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.viz-axis {
  stroke: var(--axis);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.viz-zero-line {
  stroke: var(--axis);
  stroke-width: 1.5;
}

.viz-tick {
  fill: var(--muted);
  font-size: 10.5px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.viz-anno {
  fill: var(--muted);
  font-size: 10.5px;
  font-family: var(--font);
  font-weight: 600;
}

.viz-empty {
  fill: var(--muted);
  font-size: 13px;
  font-family: var(--font);
}

.viz-corridor {
  fill: var(--viz-corridor);
}

.viz-plan-line {
  fill: none;
  stroke: var(--viz-plan);
  stroke-width: 1.5;
}

.viz-goal-line {
  stroke: var(--viz-plan);
  stroke-width: 1.5;
}

.viz-dots circle {
  fill: var(--viz-dot);
  opacity: 0.55;
}

.viz-trend {
  fill: none;
  stroke: var(--viz-series);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.viz-spark-line {
  stroke-width: 2;
}

.viz-trend-cap {
  fill: var(--viz-series);
  stroke: var(--surface);
  stroke-width: 2;
}

/* Dashing here carries meaning — this section of the line is a projection,
   not a measurement. Gridlines stay solid for exactly the same reason. */
.viz-projection {
  fill: none;
  stroke: var(--viz-series);
  stroke-width: 2;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
  opacity: 0.5;
}

.viz-crosshair {
  stroke: var(--axis);
  stroke-width: 1;
}

.viz-tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto;
  gap: 1px 12px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  font-size: 0.76rem;
  color: var(--ink-2);
  pointer-events: none;
  white-space: nowrap;
}

.viz-tooltip b {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.viz-tooltip .v {
  text-align: right;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 10px;
  font-size: 0.74rem;
  color: var(--ink-2);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--viz-series);
}

.swatch--dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--viz-dot);
  opacity: 0.6;
}

.swatch--band {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: var(--viz-corridor);
  border: 1px solid var(--viz-plan);
}

.swatch--dash {
  width: 14px;
  height: 0;
  border-top: 2px dashed var(--viz-series);
  opacity: 0.6;
  background: none;
}

/* data table (the WCAG-clean twin of every chart) */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.data-table th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 4px;
  border-bottom: 1px solid var(--hairline);
}

.data-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-2);
}

.data-table td:first-child {
  color: var(--ink);
}

.data-table .num {
  text-align: right;
}

.table-scroll {
  max-height: 320px;
  overflow-y: auto;
}

/* ---------------- coach ---------------- */

.capacity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.capacity-bar {
  flex: 1;
  display: flex;
  gap: 3px;
  height: 10px;
}

.capacity-cell {
  flex: 1;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

.capacity-cell.is-used {
  background: var(--accent);
  border-color: var(--accent);
}

.capacity-cell.is-full {
  background: var(--serious);
  border-color: var(--serious);
}

.capacity-note {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rem-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rem {
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.rem-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rem-label {
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}

.rem-detail {
  margin-top: 3px;
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.45;
}

/* Whether the change is working. Colour carries the verdict, but so does the
   sentence — the status word is never colour-alone. */
.rem-verdict {
  margin-top: 8px;
  padding-left: 9px;
  border-left: 2px solid var(--hairline-strong);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.rem-verdict.is-good {
  border-left-color: var(--good);
  color: var(--good-text);
}

.rem-verdict.is-flat {
  border-left-color: var(--serious);
  color: var(--serious-text);
}

.rem-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-size: 0.7rem;
}

.pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pill--accent {
  background: var(--accent-wash);
  border-color: transparent;
  color: var(--accent);
}

.rem-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.rem-actions .btn {
  flex: 1;
}

.action-card {
  border-left: 3px solid var(--accent);
}

.action-card.tone-serious {
  border-left-color: var(--serious);
}

.action-card.tone-critical {
  border-left-color: var(--critical);
}

.action-card.tone-good {
  border-left-color: var(--good);
}

.action-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.85rem;
}

.history-item:last-child {
  border-bottom: 0;
}

.outcome {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.outcome--graduated {
  color: var(--good-text);
}

.outcome--dropped {
  color: var(--muted);
}

/* ---------------- forms ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 650;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.text-input {
  width: 100%;
  min-height: var(--tap);
  padding: 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type='range'] {
  flex: 1;
  appearance: none;
  height: 28px;
  background: transparent;
  cursor: pointer;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-1);
}

input[type='range']::-moz-range-track {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-2);
}

input[type='range']::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
}

.rate-readout {
  min-width: 92px;
  text-align: right;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.callout {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  line-height: 1.45;
}

.callout--warning {
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  color: var(--warning-text);
}

.callout--info {
  background: var(--accent-wash);
  color: var(--ink-2);
}

.callout b {
  color: inherit;
}

/* ---------------- sheet / dialog ---------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(11, 11, 11, 0.42);
  animation: fade 0.16s ease;
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 18px var(--gutter) calc(env(safe-area-inset-bottom) + 18px);
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-2);
  animation: rise 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.sheet-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.sheet-body {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.5;
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.sheet-actions .btn {
  flex: 1;
}

@keyframes rise {
  from {
    transform: translateY(18px);
    opacity: 0.4;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 78px);
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--plane);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  animation: fade 0.16s ease;
}

/* ---------------- onboarding ---------------- */

.onboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.onboard-hero {
  text-align: center;
  padding: 12px 0 4px;
}

.onboard-hero img {
  width: 66px;
  height: 66px;
  border-radius: 16px;
}

.onboard-hero h2 {
  margin-top: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.onboard-hero p {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.5;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mode-btn {
  padding: 14px 8px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
}

.mode-btn[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.mode-btn b {
  display: block;
  font-size: 0.95rem;
}

.mode-btn span {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

/* ---------------- misc ---------------- */

.empty-state {
  text-align: center;
  padding: 26px 14px;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.list-reset {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.9rem;
}

.entry-row:last-child {
  border-bottom: 0;
}

.entry-row .num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.link-btn {
  border: 0;
  background: none;
  padding: 4px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.disclosure > summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ink-2);
  padding: 8px 0;
  list-style: none;
}

.disclosure > summary::-webkit-details-marker {
  display: none;
}

.disclosure > summary::before {
  content: '▸ ';
  color: var(--muted);
}

.disclosure[open] > summary::before {
  content: '▾ ';
}

.disclosure-body {
  font-size: 0.84rem;
  color: var(--ink-2);
  line-height: 1.55;
  padding-bottom: 6px;
}

.disclosure-body p + p {
  margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
