@font-face { font-family: "Outfit";  font-weight: 600; font-display: swap; src: url("../assets/fonts/outfit-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit";  font-weight: 700; font-display: swap; src: url("../assets/fonts/outfit-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("../assets/fonts/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url("../assets/fonts/manrope-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../assets/fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../assets/fonts/manrope-latin-700-normal.woff2") format("woff2"); }

:root {
  /* Layout idea: one centered 480px column, navy surfaces, pink only for actions/progress/done. */
  --bg:        #070D1F;  /* page */
  --surface:   #0E1733;  /* cards */
  --raised:    #16214A;  /* chips, pressed, inputs */
  --line:      #24315E;  /* borders, empty days */
  --text:      #F2F4FB;
  --muted:     #9BA6C8;
  --pink:      #FF5DA2;  /* primary accent */
  --pink-soft: #FF8CC0;
  --on-pink:   #2A0717;  /* text on pink */
  --blue:      #5B8CFF;  /* secondary: today ring, links */
  --gold:      #FFC94D;  /* milestones only */
  --danger:    #FF6B6B;  /* reset confirm only */
  --display: "Outfit", "Arial Narrow", system-ui, sans-serif;
  --body:    "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-card: 18px; --r-btn: 14px; --r-pill: 999px;
  --gap: 16px;
  color-scheme: dark;
}
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
body { font-weight: 500; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
a { color: var(--blue); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.pink { color: var(--pink); }
.center { text-align: center; }
.tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ layout */
#app { min-height: 100%; }
.view {
  max-width: 480px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) calc(20px + env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: var(--gap);
}
.view.no-nav { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.header { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.wordmark { white-space: nowrap; display: inline-flex; align-items: center; min-height: 48px; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text); text-decoration: none; font-size: 18px; line-height: 1; }
.wordmark .pink { color: var(--pink); }
.wordmark.big { font-size: 40px; line-height: 1.02; display: block; text-align: center; }
.wordmark.big span { display: block; }

.screen-title { font-size: 28px; }
.card-title { font-size: 22px; }
.eyebrow { font: 700 12px/1.4 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.eyebrow-plain { text-transform: none; letter-spacing: 0; font-weight: 500; }
.body-lg { font-size: 17px; }
.small { font-size: 14px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 20px; border-radius: var(--r-btn);
  font: 700 17px/1.2 var(--body); text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: background-color .15s ease-out, border-color .15s ease-out, transform .15s ease-out;
  touch-action: manipulation;
}
.btn-primary { background: var(--pink); color: var(--on-pink); }
.btn-primary:active { background: var(--pink-soft); }
.btn-secondary { background: transparent; border-color: var(--line); color: var(--text); }
.btn-secondary:active { background: var(--raised); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger.solid { background: var(--danger); color: #2A0707; }
.btn-danger.solid:disabled { opacity: .4; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; }

.icon-btn {
  width: 48px; height: 48px; border-radius: 12px; display: inline-grid; place-items: center;
  background: transparent; border: 0; color: var(--text); cursor: pointer; text-decoration: none;
}
.icon-btn:active { background: var(--raised); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon { width: 24px; height: 24px; flex: none; }
.icon-sm { width: 18px; height: 18px; flex: none; }

.link-btn { background: none; border: 0; padding: 12px 4px; color: var(--blue); font: 600 15px var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 48px; }

/* ------------------------------------------------------------------ card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card.tight { gap: 8px; }

/* ------------------------------------------------------------------ chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); background: var(--raised);
  border: 1.5px solid transparent; color: var(--text); font: 600 15px var(--body); cursor: pointer;
  transition: border-color .15s ease-out, color .15s ease-out;
}
.chip[aria-pressed="true"] { border-color: var(--pink); color: var(--pink); }
.pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--raised); font-size: 13px; font-weight: 600; color: var(--muted); }

/* ------------------------------------------------------------------ Jay + bubble */
.jay-row { display: flex; align-items: center; gap: 12px; }
.jay-row.top { align-items: flex-start; }
.jay { flex: none; display: grid; place-items: center; line-height: 0; }
.jay svg { display: block; overflow: visible; }
.jay.bounce { animation: jay-bounce .25s ease-out; }
.jay.pop { animation: jay-pop .35s ease-out; }
@keyframes jay-bounce { 0% { transform: translateY(0); } 40% { transform: translateY(-6px); } 100% { transform: translateY(0); } }
@keyframes jay-pop { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }

.bubble {
  position: relative; background: var(--raised); border-radius: 14px; padding: 12px 14px;
  font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--text);
}
.bubble::before {
  content: ""; position: absolute; left: -7px; top: 50%; margin-top: -7px;
  border-style: solid; border-width: 7px 8px 7px 0; border-color: transparent var(--raised) transparent transparent;
}
.bubble.up::before { left: 50%; top: auto; bottom: -7px; margin: 0 0 0 -8px; border-width: 8px 8px 0 8px; border-color: var(--raised) transparent transparent transparent; }
.jay-stack { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.jay-stack .bubble { max-width: 340px; }

/* ------------------------------------------------------------------ streak */
.streak-chip { display: inline-flex; align-items: center; gap: 8px; }
.streak-chip .flame { color: var(--pink); width: 26px; height: 26px; }
.streak-chip .num { font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.streak-chip.pop { animation: jay-pop .35s ease-out; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.week-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); }
.week-dot.counted { background: var(--pink); border-color: var(--pink); }
.week-dot.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }

/* ------------------------------------------------------------------ countdowns / clock */
.big-countdown { font: 700 40px/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.session-clock { font: 700 72px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ------------------------------------------------------------------ powered by */
.powered { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 0; text-decoration: none; min-height: 48px; }
.powered span { font: 500 13px var(--body); color: var(--muted); }
.powered img { height: 15px; width: auto; display: block; }

/* ------------------------------------------------------------------ GrindSplit card */
.gs-card .gs-copy { display: flex; align-items: center; gap: 14px; }
.gs-card .gs-mark { height: 32px; width: auto; flex: none; margin: 4px; }
.gs-card .gs-eyebrow { color: var(--gold); }

/* ------------------------------------------------------------------ bottom nav */
#bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(7, 13, 31, .96); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#bottom-nav .nav-inner { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); height: 64px; }
#bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font: 700 12px var(--body); }
#bottom-nav a[aria-current="page"] { color: var(--pink); }

/* ------------------------------------------------------------------ splash + onboarding */
#splash {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  padding: env(safe-area-inset-top) 20px calc(24px + env(safe-area-inset-bottom));
  transition: opacity .25s ease-out;
}
#splash.out { opacity: 0; pointer-events: none; }
#splash .powered { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); left: 0; right: 0; }

#onboarding { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; }
.ob-top { display: flex; justify-content: flex-end; padding: calc(env(safe-area-inset-top) + 8px) 12px 0; max-width: 480px; width: 100%; margin: 0 auto; }
.ob-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ob-track::-webkit-scrollbar { display: none; }
.ob-card { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 0 28px; text-align: center; }
.ob-card .inner { max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ob-card p.body-lg { color: var(--muted); }
.ob-bottom { max-width: 480px; width: 100%; margin: 0 auto; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; align-items: center; }
.dots { display: flex; gap: 8px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background-color .2s ease-out, width .2s ease-out; }
.dots span.on { background: var(--pink); width: 22px; border-radius: 4px; }

/* ------------------------------------------------------------------ today card */
.time-left { font-size: 14px; color: var(--muted); text-align: center; }
.banner-warn { display: flex; align-items: center; gap: 12px; }

/* ------------------------------------------------------------------ session overview */
.ov-group { display: flex; flex-direction: column; gap: 4px; }
.ov-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ov-group .ov-row:last-child { border-bottom: 0; }
.ov-num { width: 28px; height: 28px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; font: 700 14px var(--display); flex: none; }
.ov-name { font-weight: 700; }
.ov-len { font-size: 14px; color: var(--muted); white-space: nowrap; }
.sticky-bottom {
  position: sticky; bottom: 0; z-index: 5; margin: 0 -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(7,13,31,0), var(--bg) 24px);
}

/* ------------------------------------------------------------------ player */
.player-top {
  position: sticky; top: 0; z-index: 10; margin: calc(-12px - env(safe-area-inset-top)) -20px 0;
  padding: calc(env(safe-area-inset-top) + 8px) 20px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.clock-row { display: flex; align-items: baseline; gap: 10px; }
.clock-row .of { font: 600 18px var(--display); color: var(--muted); }
.clock-row .menu { margin-left: auto; align-self: center; }
.clock-row.paused .session-clock { color: var(--muted); }
.progress { display: flex; gap: 4px; }
.progress span { flex: 1; height: 6px; border-radius: 3px; background: var(--raised); }
.progress span.done { background: var(--pink); }
.progress span.skipped { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.progress span.current { background: var(--pink-soft); opacity: .5; animation: seg-pulse 1.6s ease-in-out infinite; }
@keyframes seg-pulse { 0%, 100% { opacity: .5; } 50% { opacity: .3; } }

.ex-card .ex-head { display: flex; flex-direction: column; gap: 4px; }
.ex-meta { color: var(--muted); font-size: 15px; }
.instr { display: flex; flex-direction: column; gap: 14px; }
.instr h3 { font: 700 13px var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.instr ol, .instr ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.instr li::marker { color: var(--pink); font-weight: 700; }
.note-row { display: flex; gap: 10px; align-items: flex-start; }
.note-row .icon { color: var(--pink); margin-top: 1px; }
.note-row.warn .icon { color: var(--gold); }

.action-dock {
  position: sticky; bottom: 0; z-index: 5; margin: 0 -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(7,13,31,0), var(--bg) 20px); display: grid; place-items: center;
}
.ring { position: relative; width: 148px; height: 148px; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring .ring-num { position: absolute; inset: 0; display: grid; place-items: center; font: 700 44px/1 var(--display); font-variant-numeric: tabular-nums; }
.ring .ring-prog { transition: stroke-dashoffset .2s linear; }
.ring.paused .ring-num { color: var(--muted); }
.ring .ring-label { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; font: 700 11px var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ctrl { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; border-radius: var(--r-btn); background: var(--surface); border: 1px solid var(--line); color: var(--text); font: 700 15px var(--body); cursor: pointer; }
.ctrl:active { background: var(--raised); }
.ctrl:disabled { opacity: .4; cursor: default; }

.switch-banner {
  position: fixed; left: 0; right: 0; top: 40%; z-index: 40; background: var(--pink); color: var(--on-pink);
  font: 700 32px/1 var(--display); text-align: center; padding: 28px 20px; text-transform: uppercase; letter-spacing: .02em;
  animation: banner-in .2s ease-out;
}
@keyframes banner-in { from { transform: scaleY(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ done */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat .v { font: 700 28px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat .k { font: 700 12px var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.feel-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.feel-btn { min-height: 64px; border-radius: var(--r-btn); background: var(--raised); border: 1.5px solid transparent; font: 700 17px var(--body); color: var(--text); cursor: pointer; }
.feel-btn[aria-pressed="true"] { background: var(--pink); color: var(--on-pink); }
.feel-btn:disabled:not([aria-pressed="true"]) { opacity: .45; cursor: default; }

/* ------------------------------------------------------------------ calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 0; justify-items: center; }
.cal-wd { font: 700 12px var(--body); color: var(--muted); height: 24px; }
.cal-day {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  font: 700 15px var(--body); color: var(--text); cursor: pointer; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.cal-day.past { color: var(--muted); }
.cal-day.started { box-shadow: inset 0 0 0 2px var(--pink); color: var(--text); }
.cal-day.counted { background: var(--pink); color: var(--on-pink); box-shadow: none; }
.cal-day.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }
.cal-day.today.started { box-shadow: inset 0 0 0 2px var(--pink), 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }
.cal-day.future { opacity: .4; }
.cal-day.milestone::after { content: ""; position: absolute; bottom: -7px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--gold); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ------------------------------------------------------------------ learn */
.search { width: 100%; min-height: 48px; border-radius: 12px; background: var(--raised); border: 1.5px solid var(--line); color: var(--text); padding: 0 16px; font: 500 16px var(--body); }
.search:focus-visible { border-color: var(--pink); outline: none; }
.lib-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; min-height: 48px; }
.lib-row:last-child { border-bottom: 0; }
.lib-row .chev { color: var(--muted); margin-left: auto; }
.block-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.block-item:last-child { border-bottom: 0; }
details { border-top: 1px solid var(--line); padding-top: 8px; }
summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; margin-left: auto; font: 700 22px var(--display); color: var(--pink); }
details[open] summary::after { content: "–"; }
.sources { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.sources a { word-break: break-word; }
.option-block { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.gs-logo { width: 120px; height: auto; display: block; }
@media (max-width: 360px) { .cal-day { width: 34px; height: 34px; font-size: 14px; } }
.footer { font-size: 13px; color: var(--muted); text-align: center; }

/* ------------------------------------------------------------------ settings */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.toggle { position: relative; width: 52px; height: 32px; border-radius: 16px; background: var(--line); border: 0; cursor: pointer; flex: none; transition: background-color .15s ease-out; }
.toggle::before { content: ""; position: absolute; inset: -8px -4px; } /* 48px tap area */
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform .15s ease-out; }
.toggle[aria-checked="true"] { background: var(--pink); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); background: var(--on-pink); }
.code { font: 700 32px/1 var(--display); letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 6px; box-shadow: inset 0 0 0 2px var(--pink); }
.status-dot.done { background: var(--pink); }
.id-box { background: var(--raised); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.steps-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }

/* ------------------------------------------------------------------ sheet */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .5); animation: fade-in .2s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line);
  animation: sheet-in .25s ease-out;
}
.sheet-inner { max-width: 480px; margin: 0 auto; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet.closing { animation: sheet-out .2s ease-out forwards; }
.scrim.closing { animation: fade-out .2s ease-out forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet input[type="text"] { width: 100%; min-height: 52px; border-radius: 12px; background: var(--raised); border: 1.5px solid var(--line); color: var(--text); padding: 0 16px; font: 700 18px var(--body); letter-spacing: .1em; }

/* ------------------------------------------------------------------ toast */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 20px; }
body.no-nav #toast-root { bottom: calc(24px + env(safe-area-inset-bottom)); }
.toast { max-width: 440px; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: toast-in .2s ease-out; display: flex; align-items: center; gap: 12px; }
.toast.out { animation: fade-out .2s ease-out forwards; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ------------------------------------------------------------------ 404 */
.nf { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 20px; text-align: center; max-width: 480px; margin: 0 auto; }

/* ------------------------------------------------------------------ legal pages */
.view.doc { max-width: 720px; }
.doc-body { display: flex; flex-direction: column; gap: 24px; }
.doc-sec { scroll-margin-top: 16px; }
.doc-sec h2 { font-size: 20px; margin-bottom: 8px; }
.doc-sec p, .doc-sec li { line-height: 1.65; }
.doc-sec p + p, .doc-sec ul + p, .doc-sec p + ul { margin-top: 10px; }
.doc-sec ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.doc-sec li::marker { color: var(--pink); }
.doc a, .doc-sec a { overflow-wrap: anywhere; }
.doc-toc { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 24px; }
.doc-toc a { display: block; padding: 6px 0; text-decoration: none; color: var(--text); font-weight: 600; font-size: 15px; }
.doc-toc a:hover { color: var(--pink); }
.doc-table { margin-top: 4px; }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th { text-align: left; font: 700 12px var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 640px) {
  .doc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc-table tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px; margin-bottom: 10px; }
  .doc-table td { display: block; border: 0; padding: 6px 0; }
  .doc-table td::before { content: attr(data-label); display: block; font: 700 11px var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
}
.inline-tap { display: inline-block; padding: 12px 0; }
.legal-links { font-size: 14px; text-align: center; color: var(--muted); }
.legal-links a { display: inline-block; padding: 12px 6px; }
.agree { font-size: 13px; color: var(--muted); text-align: center; max-width: 360px; }
.agree a { display: inline-block; padding: 8px 0; }

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
