/* SWC Venture Board — design tokens + mobile-first shell (Phase 4)
   Zero dependency. Lifted from the approved prototype canvas (design/*.dc.html).
   Layout tiers: <768 bottom tab bar · 768–1024 top segmented · >1024 left rail. */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  /* light — the base palette, always defined here so nothing inherits the host theme */
  --bg:            #f2f2f7;
  --bg-elevated:   #ffffff;
  --bg-sunken:     #e9e9ee;
  --fill:          rgba(120, 120, 128, 0.12);
  --fill-strong:   rgba(120, 120, 128, 0.20);
  --label:         #1c1c1e;
  --label-2:       #6e6e73;
  --label-3:       #8a8a8e;
  --separator:     #e5e5ea;
  --hairline:      #ededf0;

  --blue:          #007aff;
  --blue-ink:      #0059c1;
  --green:         #34c759;
  --green-ink:     #248a3d;
  --amber:         #ff9500;
  --amber-ink:     #c77700;
  --red:           #ff3b30;
  --red-ink:       #d7362b;
  --indigo:        #5856d6;

  --scrim:         rgba(0, 0, 0, 0.28);
  --shadow-card:   0 1px 2px rgba(17, 17, 26, 0.04), 0 0 0 0.5px rgba(17, 17, 26, 0.03);
  --shadow-sheet:  0 -8px 40px rgba(0, 0, 0, 0.22);
  --shadow-bar:    0 -0.5px 0 #d1d1d6;

  /* radii */
  --r-card: 16px;
  --r-chip: 20px;
  --r-sheet: 20px;
  --r-control: 12px;

  /* type */
  --font: -apple-system, "SF Pro Text", "SF Pro Display", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --t-large: 34px;
  --t-title: 20px;
  --t-body: 17px;
  --t-sub: 13px;
  --t-foot: 11.5px;

  /* motion — iOS-inspired, from PLAN v2 §5 */
  --ease-standard: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-decel:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001);
  --dur-fast:  180ms;
  --dur-base:  280ms;
  --dur-sheet: 420ms;

  /* safe-area passthroughs */
  --sa-top:    env(safe-area-inset-top, 0px);
  --sa-bottom: env(safe-area-inset-bottom, 0px);
  --sa-left:   env(safe-area-inset-left, 0px);
  --sa-right:  env(safe-area-inset-right, 0px);

  --rail-w: 264px;
  --content-max: 900px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #000000;
    --bg-elevated: #1c1c1e;
    --bg-sunken:   #0e0e10;
    --fill:        rgba(120, 120, 128, 0.24);
    --fill-strong: rgba(120, 120, 128, 0.34);
    --label:       #ffffff;
    --label-2:     #98989f;
    --label-3:     #8d8d93;
    --separator:   #38383a;
    --hairline:    #2c2c2e;
    --blue:        #0a84ff;
    --blue-ink:    #409cff;
    --green:       #30d158;
    --green-ink:   #30d158;
    --amber:       #ff9f0a;
    --amber-ink:   #ffb340;
    --red:         #ff453a;
    --red-ink:     #ff6961;
    --indigo:      #5e5ce6;
    --scrim:       rgba(0, 0, 0, 0.5);
    --shadow-card: 0 0 0 0.5px rgba(255, 255, 255, 0.06);
    --shadow-bar:  0 -0.5px 0 #38383a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #000000;
  --bg-elevated: #1c1c1e;
  --bg-sunken:   #0e0e10;
  --fill:        rgba(120, 120, 128, 0.24);
  --fill-strong: rgba(120, 120, 128, 0.34);
  --label:       #ffffff;
  --label-2:     #98989f;
  --label-3:     #8d8d93;
  --separator:   #38383a;
  --hairline:    #2c2c2e;
  --blue:        #0a84ff;
  --blue-ink:    #409cff;
  --green:       #30d158;
  --green-ink:   #30d158;
  --amber:       #ff9f0a;
  --amber-ink:   #ffb340;
  --red:         #ff453a;
  --red-ink:     #ff6961;
  --indigo:      #5e5ce6;
  --scrim:       rgba(0, 0, 0, 0.5);
  --shadow-card: 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  --shadow-bar:  0 -0.5px 0 #38383a;
}

/* ---------------------------------------------------------------- reset */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--t-body);
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-ink); }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------- app grid */
.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "hd" "mn" "tb";
  min-height: 100dvh;
}
.app[data-booting] .mn::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--bg);
}

/* ---------------------------------------------------------------- header / large title */
.hd {
  grid-area: hd;
  padding: calc(var(--sa-top) + 6px) calc(20px + var(--sa-right)) 8px calc(20px + var(--sa-left));
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.hd-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-height: 44px;
}
.hd-title { padding-top: 4px; }
.hd-title h1 {
  font-size: var(--t-large); font-weight: 700; letter-spacing: -0.5px; line-height: 1.1;
  transform-origin: left center;
  transition: transform var(--dur-fast) var(--ease-standard);
}
.hd-sub { font-size: var(--t-sub); color: var(--label-3); margin-top: 2px; }
/* collapse: motion.js sets --collapse 0..1 on .hd (or scroll-timeline where supported) */
.hd { --collapse: 0; }
.hd-title h1 { transform: scale(calc(1 - 0.44 * var(--collapse))); }
.hd-sub { opacity: calc(1 - var(--collapse)); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 12px;
  background: var(--fill); border-radius: var(--r-chip);
  font-size: 14px; font-weight: 600; color: var(--label);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.chip:active { transform: scale(0.96); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.chip--scenario .chip-dot { background: var(--blue); }
.chip-chev { stroke-width: 3; color: var(--label-3); }
.chip-label { white-space: nowrap; }

/* ---------------------------------------------------------------- main / panels */
.mn {
  grid-area: mn;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px calc(20px + var(--sa-right)) calc(28px + var(--sa-bottom)) calc(20px + var(--sa-left));
  scrollbar-width: none;
}
.mn::-webkit-scrollbar { display: none; }
.panel { max-width: var(--content-max); margin: 0 auto; }

.stagger > * {
  animation: rise var(--dur-base) var(--ease-decel) both;
  animation-delay: calc(min(var(--i, 0), 8) * 30ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- cards / kpi */
.card {
  background: var(--bg-elevated);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
}
.card + .card, .kpi-grid + .card, .card + .kpi-grid { margin-top: 14px; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--label-3); text-transform: uppercase;
}
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: var(--bg-elevated); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 14px;
}
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-status { width: 8px; height: 8px; border-radius: 50%; margin-top: 3px; }
.kpi-status.ok  { background: var(--green); }
.kpi-status.warn { background: var(--amber); }
.kpi-status.bad { background: var(--red); }
.kpi-value { font-size: 26px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -0.5px; }
.kpi-value small { font-size: 15px; font-weight: 600; color: var(--label-3); }
.kpi-cap { font-size: var(--t-foot); color: var(--label-3); }
.kpi-cap.warn { color: var(--amber-ink); }

.chart-wrap { margin-top: 8px; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }

.placeholder {
  text-align: center; color: var(--label-3);
  padding: 44px 20px; border: 1px dashed var(--separator); border-radius: var(--r-card);
  font-size: var(--t-sub); line-height: 1.5;
}
.placeholder strong { color: var(--label-2); display: block; font-size: 15px; margin-bottom: 6px; }
.placeholder a { font-weight: 600; }

/* ---------------------------------------------------------------- Phase 5 panels */
.sec { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 4px 8px; }
.sec:first-child { margin-top: 4px; }
.sec h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.sec .sub { font-size: 12px; color: var(--label-3); margin-top: 1px; }
.cmt-btn {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 28px; padding: 0 10px; border-radius: 14px;
  background: var(--fill); color: var(--label-2); font-size: 12px; font-weight: 600;
}
.cmt-btn svg { width: 14px; height: 14px; }
.cmt-btn.has { color: var(--blue); }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 7px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag.ok   { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green-ink); }
.tag.warn { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber-ink); }
.tag.bad  { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red-ink); }
.tag.info { background: var(--fill); color: var(--label-2); }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 11px 12px; align-items: baseline; }
.kv .k { color: var(--label-2); font-size: 13.5px; }
.kv .v { font-size: 13.5px; font-weight: 600; text-align: right; }
.kv .full { grid-column: 1 / -1; }
.kv .hr { grid-column: 1 / -1; height: 0.5px; background: var(--hairline); margin: 2px 0; }

.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-card); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; background: var(--bg-elevated); }
.tbl th, .tbl td { padding: 10px 12px; text-align: right; border-top: 0.5px solid var(--hairline); font-variant-numeric: tabular-nums; }
.tbl thead th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--label-3); border-top: 0; font-weight: 600; }
.tbl th:first-child, .tbl td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-elevated); font-variant-numeric: normal; }
.tbl tr.total td { font-weight: 700; border-top: 1px solid var(--separator); }
.tbl td.pos { color: var(--green-ink); }
.tbl td.neg { color: var(--red-ink); }

.wf-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 0.5px solid var(--hairline); }
.wf-row:first-child { border-top: 0; }
.wf-row .lab { width: 128px; font-size: 12.5px; color: var(--label-2); flex: none; }
.wf-row .bar-cell { flex: 1; height: 18px; position: relative; }
.wf-row .bar { position: absolute; top: 3px; height: 12px; border-radius: 3px; }
.wf-row .amt { width: 92px; text-align: right; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }

.tranche { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-top: 0.5px solid var(--hairline); }
.tranche:first-child { border-top: 0; }
.tranche .n { width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.tranche .body { flex: 1; min-width: 0; }
.tranche .t { font-size: 13.5px; font-weight: 600; }
.tranche .d { font-size: 11.5px; color: var(--label-3); margin-top: 2px; }
.tranche .p { font-size: 11.5px; color: var(--label-2); margin-top: 4px; line-height: 1.4; }
.tranche .amt { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }

.buildup { height: 8px; border-radius: 4px; background: var(--fill-strong); overflow: hidden; display: flex; }
.buildup span { height: 8px; }

.seg-inline { display: inline-flex; gap: 2px; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg-inline button { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--label-2); }
.seg-inline button[aria-pressed="true"] { background: var(--bg-elevated); color: var(--label); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.band-row { padding: 13px 0; border-top: 0.5px solid var(--hairline); }
.band-row:first-child { border-top: 0; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.band-head .r { font-size: 13px; font-weight: 600; }
.band-head .m { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.track { position: relative; height: 6px; border-radius: 3px; background: var(--fill-strong); }
.track .fill { position: absolute; left: 0; top: 0; height: 6px; border-radius: 3px; background: var(--blue); }
.track .knob { position: absolute; top: 50%; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-elevated); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.04); transform: translate(-50%, -50%); }
.slider { margin-bottom: 20px; }
.slider .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 11px; }
.slider .row .n { font-size: 13.5px; font-weight: 600; }
.slider .row .n span { color: var(--label-3); font-weight: 400; }
.slider .row .v { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

input[type="range"].sl {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  border-radius: 3px; background: var(--fill-strong); outline: none; margin: 6px 0;
}
input[type="range"].sl::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-elevated); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  cursor: pointer; margin-top: -10px;
}
input[type="range"].sl::-moz-range-thumb {
  width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: var(--bg-elevated); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); cursor: pointer;
}
input[type="range"].sl::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; }
input[type="range"].sl::-moz-range-track { height: 6px; border-radius: 3px; background: transparent; }
input[type="range"].sl:disabled { cursor: default; }

.alert-row { display: flex; gap: 11px; align-items: flex-start; padding: 12px 0; border-top: 0.5px solid var(--hairline); text-align: left; width: 100%; }
.alert-row:first-child { border-top: 0; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.alert-row .m { font-size: 13px; line-height: 1.4; }
.alert-row .s { font-size: 11.5px; color: var(--label-3); margin-top: 2px; }

.thread { max-height: 46vh; overflow-y: auto; }
.thread .c { padding: 12px 0; border-top: 0.5px solid var(--hairline); font-size: 13.5px; line-height: 1.45; }
.thread .c:first-child { border-top: 0; }
.thread .c .meta { font-size: 11px; color: var(--label-3); margin-top: 4px; }
.cmt-form { display: flex; gap: 8px; margin-top: 12px; }
.cmt-form textarea {
  flex: 1; font: inherit; font-size: 16px; resize: none; min-height: 42px;
  padding: 10px 12px; border-radius: 12px; border: 0.5px solid var(--separator);
  background: var(--bg-elevated); color: var(--label);
}
.cmt-form button { align-self: flex-end; padding: 11px 16px; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 600; font-size: 14px; }

/* ---------------------------------------------------------------- tab bar (mobile: bottom) */
.tb {
  grid-area: tb;
  display: flex;
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-bar);
  padding: 8px calc(var(--sa-right)) calc(8px + var(--sa-bottom)) calc(var(--sa-left));
  z-index: 20;
}
.tb-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 48px; padding: 4px 2px;
  color: var(--label-3); font-size: 10px; font-weight: 500;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.tb-item:active { transform: scale(0.92); }
.tb-item svg { width: 25px; height: 25px; }
.tb-item[aria-current="page"] { color: var(--blue); font-weight: 600; }
.tb-item .dot3 { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- sheets */
.sheet-host {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-scrim {
  position: absolute; inset: 0;
  background: var(--scrim);
  -webkit-backdrop-filter: saturate(180%) blur(2px);
  backdrop-filter: saturate(180%) blur(2px);
  opacity: 0; transition: opacity var(--dur-base) var(--ease-standard);
}
.sheet {
  position: relative; width: 100%; max-width: 560px;
  background: var(--bg);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: var(--shadow-sheet);
  padding: 10px calc(20px + var(--sa-right)) calc(20px + var(--sa-bottom)) calc(20px + var(--sa-left));
  transform: translateY(100%);
  transition: transform var(--dur-sheet) var(--ease-standard);
}
.sheet-host.in .sheet-scrim { opacity: 1; }
.sheet-host.in .sheet { transform: none; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-strong); margin: 2px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h2 { font-size: var(--t-title); font-weight: 700; letter-spacing: -0.3px; }
.sheet-close {
  width: 30px; height: 30px; border-radius: 50%; background: var(--fill);
  display: flex; align-items: center; justify-content: center; color: var(--label-3);
}
.sheet-list { background: var(--bg-elevated); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-card); }
.sheet-row {
  display: flex; align-items: center; gap: 13px;
  width: 100%; padding: 14px 16px; text-align: left;
  border-top: 0.5px solid var(--hairline);
}
.sheet-row:first-child { border-top: 0; }
.sheet-row-sq { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.sheet-row-main { flex: 1; }
.sheet-row-main .t { font-size: 15px; font-weight: 600; }
.sheet-row-main .s { font-size: 12px; color: var(--label-3); }
.sheet-row .check { color: var(--blue); stroke-width: 2.6; }
.sheet-note { font-size: var(--t-foot); color: var(--label-3); text-align: center; margin: 14px 0 4px; line-height: 1.45; }
.seg {
  display: flex; gap: 2px; background: var(--fill); border-radius: 10px; padding: 2px; margin-top: 4px;
}
.seg button {
  flex: 1; text-align: center; font-size: 13px; padding: 9px 0; border-radius: 8px;
  color: var(--label-2); font-weight: 500;
}
.seg button[aria-pressed="true"] {
  background: var(--bg-elevated); color: var(--label); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--sa-bottom)); transform: translateX(-50%);
  background: var(--label); color: var(--bg-elevated);
  font-size: 13px; font-weight: 600; padding: 10px 16px; border-radius: 20px;
  z-index: 50; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

/* ---------------------------------------------------------------- tier: 768–1024 top segmented */
@media (min-width: 768px) {
  .app { grid-template-rows: auto auto 1fr; grid-template-areas: "tb" "hd" "mn"; }
  .hd { position: static; }
  .tb {
    justify-content: center; gap: 4px;
    padding: calc(10px + var(--sa-top)) 20px 10px;
    box-shadow: 0 0.5px 0 var(--separator);
  }
  .tb-item {
    flex: 0 0 auto; flex-direction: row; gap: 7px;
    min-height: 40px; padding: 8px 14px; border-radius: 10px;
    font-size: 13px; background: var(--fill);
  }
  .tb-item svg { width: 18px; height: 18px; }
  .tb-item[aria-current="page"] { background: var(--bg-elevated); box-shadow: var(--shadow-card); color: var(--label); }
  .tb-item[aria-current="page"] svg { color: var(--blue); }
  .mn { padding-top: 12px; }
}

/* ---------------------------------------------------------------- tier: >1024 left rail */
@media (min-width: 1024px) {
  .app {
    grid-template-columns: var(--rail-w) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "tb hd" "tb mn";
  }
  .tb {
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: calc(24px + var(--sa-top)) 12px 24px calc(12px + var(--sa-left));
    border-right: 0.5px solid var(--separator);
    box-shadow: none;
  }
  .tb-item {
    width: 100%; justify-content: flex-start; gap: 12px;
    padding: 10px 12px; font-size: 14px; background: none;
  }
  .tb-item svg { width: 20px; height: 20px; }
  .tb-item[aria-current="page"] { background: var(--fill); box-shadow: none; }
  .hd { padding-left: 32px; }
  .mn { padding-left: 32px; }
  .sheet-host { align-items: center; }
  .sheet { border-radius: var(--r-sheet); max-width: 440px; transform: translateY(16px) scale(0.98); }
  .sheet-host.in .sheet { transform: none; }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0.01ms; --dur-base: 0.01ms; --dur-sheet: 0.01ms; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .stagger > * { animation: none; opacity: 1; transform: none; }
}
::view-transition-group(*) { animation-duration: var(--dur-base); }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
