/* Ridge Academy. Layout: an app shell (black header, phone tab bar) around a single reading column for
   lessons and a wider grid for the curriculum map.
   Brand: Rocky Ridge Brand Guide v1. Black and white first; the green suite for the interface (Green 4 for
   actions on light, Green 3 only on black, Green 5 on tints); core-range beer colours as track colours.
   Type: Futura Now is licensed, so the screen uses free stand-ins served from /fonts: Jost for Futura Now
   Text, and Barlow Condensed ExtraBold for Futura Now Headline Condensed Extra Bold (page titles and the
   motto, always in capitals). Machines with Futura Now installed use it. */
@font-face {
  font-family: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/jost-latin-var.woff2) format("woff2-variations"), url(../fonts/jost-latin-var.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-800.woff2) format("woff2");
}

:root {
  --bg: #f2f3f0;
  --paper: #ffffff;
  --ink: #121512;
  --ink-2: #3b403c;
  --muted: #5d645e;
  --line: #e0e3dd;
  --line-2: #c8cdc5;
  --brand: #00823e;          /* Green 4: actions on light */
  --brand-press: #006b33;
  --brand-ink: #004820;      /* Green 5: text on tints */
  --brand-hi: #03af4b;       /* Green 3: only on black */
  --brand-soft: #e4f2e7;
  --on-brand: #ffffff;
  --black: #000000;          /* brand black: header, sign-in, Rocky Ridge panels */
  --on-black: #ffffff;
  --on-black-2: rgba(255, 255, 255, .68);
  --black-line: rgba(255, 255, 255, .16);
  --focus: #00823e;
  --safety: #b84a12;
  --safety-soft: #fcebe0;
  --gold-soft: #f8efd4;
  --t-safety: #f4772b;       /* Ace IPA orange */
  --t-hygiene: #00aacc;      /* Cali IPA blue */
  --t-materials: #e2b649;    /* Draught gold */
  --t-ferment: #00a94f;      /* Jindong Juicy green */
  --t-cellar: #347c9d;       /* Crisp blue */
  --t-quality: #e8669e;      /* Cali IPA pink */
  --t-service: #a8d166;      /* Juicy Mid lime */
  --t-styles: #626569;       /* Stout grey */
  --t-planet: #004820;       /* Green 5 */
  --t-business: #8a6d2f;
  --t-engineering: #6f7a80;  /* steel */
  --t-welcome: #03af4b;      /* Green 3 */
  --on-ink-hi: #03af4b;      /* green that reads on black */
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .08);
  --font: "Futura Now Text", "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 8px;
  --r-ctl: 6px;
  --r-chip: 4px;
  --tabbar: 64px;
  --head: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c0b; --paper: #151917; --ink: #eef2ee; --ink-2: #c9d0ca; --muted: #9aa39c;
    --line: #252b27; --line-2: #37413a; --brand: #2bc66a; --brand-press: #3ad27a; --brand-ink: #b3e5bb;
    --brand-soft: #11301e; --on-brand: #04130a; --focus: #3ad27a; --safety: #ff9a63; --safety-soft: #301a0e; --gold-soft: #2c2410;
    --t-planet: #6fd39a; --t-business: #d7b46a; --t-engineering: #a7b2b8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c0b; --paper: #151917; --ink: #eef2ee; --ink-2: #c9d0ca; --muted: #9aa39c;
  --line: #252b27; --line-2: #37413a; --brand: #2bc66a; --brand-press: #3ad27a; --brand-ink: #b3e5bb;
  --brand-soft: #11301e; --on-brand: #04130a; --focus: #3ad27a; --safety: #ff9a63; --safety-soft: #301a0e; --gold-soft: #2c2410;
  --t-planet: #6fd39a; --t-business: #d7b46a; --t-engineering: #a7b2b8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: "kern"; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--black); }
[hidden] { display: none !important; }
a { color: var(--brand); text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.3; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(34px, 7vw, 48px); line-height: .95; letter-spacing: .005em; }
h2 { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -.005em; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
b, strong { font-weight: 600; }

/* ---------- shell */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--black); color: var(--on-black);
  border-bottom: 1px solid var(--black-line); --focus: var(--brand-hi);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.top-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 16px; min-height: var(--head); }
.lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--on-black); flex: none; }
.lockup-logo { display: block; height: 24px; width: auto; }
.lockup-word { font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.lockup-sub { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; color: var(--brand-hi);
  padding-left: 12px; border-left: 1px solid var(--black-line); padding-block: 3px 1px; }
.tabs { display: none; align-self: stretch; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 0 12px; display: flex; align-items: center; white-space: nowrap; font-size: 15px; font-weight: 500; color: var(--on-black-2); cursor: pointer; box-shadow: inset 0 -3px 0 transparent; }
.tab:hover { color: var(--on-black); }
.tab[aria-current="page"] { color: var(--on-black); box-shadow: inset 0 -3px 0 var(--brand-hi); }
.tab .count { margin-left: 6px; }
.xp-pill { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--black-line); border-radius: 999px; padding: 4px 5px 4px 12px; background: transparent; color: var(--on-black); cursor: pointer; flex: none; }
.xp-pill:hover { border-color: var(--on-black-2); }
.xp-pill .lvl { font-weight: 600; font-size: 13px; }
.xp-pill .xp { font-size: 12px; font-weight: 600; background: var(--brand-hi); color: var(--black); border-radius: 999px; padding: 2px 9px; }
.notice {
  background: var(--gold-soft); color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line);
  padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.notice-in { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.notice-in button { border: 1px solid var(--line-2); background: var(--paper); border-radius: var(--r-ctl); padding: 2px 10px; font-size: 13px; cursor: pointer; }
main {
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 24px calc(var(--tabbar) + 32px + env(safe-area-inset-bottom, 0px));
}
.wrap { max-width: 1080px; margin: 0 auto; display: grid; gap: 20px; }
.read { max-width: 720px; margin: 0 auto; display: grid; gap: 20px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--paper); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px));
}
.tabbar button { position: relative; border: 0; background: none; padding: 10px 4px; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; min-height: var(--tabbar); }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button[aria-current="page"] { color: var(--brand); font-weight: 600; }
.tabbar button[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 26%; right: 26%; height: 2px; background: var(--brand); }
.tabbar .count { position: absolute; top: 6px; left: calc(50% + 7px); font-size: 11px; padding: 0 6px; line-height: 17px; }
@media (max-width: 380px) { .lockup-logo { height: 21px; } .lockup-sub { font-size: 18px; padding-left: 10px; } .lockup { gap: 10px; } }
@media (min-width: 760px) {
  .tabs { display: flex; }
  .tabbar { display: none; }
  main { padding-block: 36px 72px; }
  .wrap { gap: 24px; }
}

/* ---------- surfaces */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.split { display: grid; gap: 20px; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: 24px; } }
.btn { border: 0; border-radius: var(--r-ctl); padding: 10px 18px; font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer; background: var(--brand); color: var(--on-brand); }
.btn:hover { background: var(--brand-press); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--bg); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1.4; border-radius: var(--r-chip); padding: 2px 8px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--paper); white-space: nowrap; }
.chip.draft { border-color: transparent; background: var(--gold-soft); color: var(--ink); }
.chip.outline { border-style: dashed; }
.chip.done { border-color: transparent; background: var(--brand-soft); color: var(--brand-ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ---------- home */
.hello { display: grid; gap: 8px; }
.hello p { max-width: 62ch; }
.process { width: 100%; height: auto; display: block; overflow: visible; }
.process text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.process .on text { fill: var(--ink); font-weight: 600; }
.next { display: grid; gap: 12px; }
.next .track-line { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.journey-list { display: grid; gap: 14px; }
.journey-item { display: grid; gap: 6px; }
.journey-item .row { justify-content: space-between; }
.badge-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.badge { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 500; line-height: 1.25; }
.badge svg { width: 64px; height: 64px; }
.badge.locked { opacity: .38; }
.admin { display: grid; gap: 14px; }
.admin-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.admin-head .chip { background: var(--black); color: var(--on-black); border-color: var(--black); }
.admin-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.admin-links button { border: 0; background: var(--paper); text-align: left; padding: 14px 16px; display: grid; gap: 2px; cursor: pointer; min-width: 0; }
.admin-links button:hover { background: var(--bg); }
.admin-links b { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.admin-links .d { font-size: 13px; color: var(--muted); }

/* ---------- map */
.tier { display: grid; gap: 14px; }
.tier-head { display: grid; gap: 4px; }
.tier-head .equiv { font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); }
.tile { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; min-width: 0; }
.tile:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.tile .code { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.tile .t { font-weight: 600; font-size: 16px; line-height: 1.25; }
.tile .foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.tile.is-done { background: var(--brand-soft); border-color: transparent; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { border: 1px solid var(--line-2); background: var(--paper); border-radius: var(--r-ctl); padding: 5px 12px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- module */
.mod-head { display: grid; gap: 10px; }
.outcomes { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps button { border: 1px solid var(--line-2); background: var(--paper); border-radius: var(--r-ctl); padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.steps button[aria-current="step"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.steps button.done { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.lesson { display: grid; gap: 16px; }
.lesson .prose { display: grid; gap: 12px; max-width: 66ch; }
.lesson ul, .lesson ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.callout { border-radius: var(--r-ctl); padding: 14px 16px; display: grid; gap: 6px; }
.callout .label { font-size: 13px; font-weight: 600; }
.callout.why { background: var(--brand-soft); }
.callout.why .label { color: var(--brand-ink); }
.callout.safety { background: var(--safety-soft); }
.callout.safety .label { color: var(--safety); }
.callout.try { border: 1px dashed var(--line-2); }
.callout.rr { background: var(--black); color: var(--on-black); --focus: var(--brand-hi); }
.callout.rr .label { color: var(--on-ink-hi); }
.callout.rr a { color: var(--on-ink-hi); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fact { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px; display: grid; gap: 2px; }
.fact .v { font-size: 22px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.fact .l { font-size: 13px; color: var(--muted); }
.motto { background: var(--black); color: var(--on-black); border-radius: var(--radius); padding: 26px 22px; }
.motto p, .motto-lockup { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: .95; letter-spacing: .005em; text-wrap: balance; }
.motto p { font-size: clamp(34px, 8vw, 56px); }
.motto span, .motto-lockup span { display: block; }
.motto span + span, .motto-lockup span + span { color: var(--on-ink-hi); }
.pillars { display: grid; gap: 12px; }
.pillar { border: 1px solid var(--line); border-top: 3px solid var(--black); border-radius: var(--r-ctl); padding: 14px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.pillar h3 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 28px; line-height: 1; letter-spacing: .01em; }
.pillar .pl { margin: 0; font-weight: 600; }
.pillar ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.pillar .shift { background: var(--brand-soft); border-radius: var(--r-ctl); padding: 10px 12px; }
.pillar .shift .label { display: block; font-size: 13px; font-weight: 600; color: var(--brand-ink); margin-bottom: 2px; }
.pillar .shift p { margin: 0; }
.intro { background: var(--black); color: var(--on-black); border-color: var(--black); padding: 24px 22px; --focus: var(--brand-hi); }
.intro .eyebrow { color: var(--on-black-2); }
.intro .lede { color: var(--on-black-2); margin: 0; max-width: 52ch; }
.intro-grid { display: grid; gap: 22px; }
.intro-grid > * { min-width: 0; display: grid; gap: 12px; align-content: start; }
.motto-lockup { font-size: clamp(36px, 7vw, 52px); }
.pillar-mini { display: grid; gap: 12px; }
.pillar-mini div { border-left: 2px solid var(--on-ink-hi); padding-left: 12px; display: grid; gap: 2px; }
.pillar-mini b { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 20px; line-height: 1.05; letter-spacing: .01em; }
.pillar-mini span { font-size: 14px; color: var(--on-black-2); }
.intro .btn { background: var(--brand-hi); color: var(--black); }
.intro .btn:hover { background: #2bc66a; }
.intro .btn.ghost { color: var(--on-black); border: 1px solid var(--on-black-2); background: transparent; }
.intro .btn.ghost:hover { border-color: var(--on-black); }
@media (min-width: 760px) { .intro { padding: 32px; } .intro-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 32px; } }
.q { display: grid; gap: 10px; padding-block: 16px; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; padding-top: 0; }
.q .prompt { font-weight: 600; }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; cursor: pointer; background: var(--paper); }
.opt input { margin-top: 5px; accent-color: var(--brand); }
.opt.right { border-color: var(--brand); background: var(--brand-soft); }
.opt.wrong { border-color: var(--safety); background: var(--safety-soft); }
.explain { font-size: 14px; color: var(--ink-2); }
.result { display: grid; gap: 8px; }
.practical ul { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.sources { display: grid; gap: 10px; }
.src { display: grid; gap: 2px; font-size: 14px; }
.src .o { color: var(--muted); font-size: 13px; }
.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 20px; display: grid; gap: 8px; color: var(--ink-2); }

/* ---------- record */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.stat .v { font-size: 28px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 500; border-bottom-color: var(--line-2); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- brand kit */
.kit { display: grid; gap: 14px; }
.kit h2 { margin: 0; }
.kit-rules { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.kit-files { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.kit-file { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 14px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.kit-file-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kit-file .btn { justify-self: start; margin-top: 4px; }
.kit-name { overflow-wrap: anywhere; }
.kit-group { display: grid; gap: 8px; }
.kit-group h3 { margin: 0; font-size: 15px; }
.swatches { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.swatch { text-align: left; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: var(--r-ctl); padding: 8px; display: grid; gap: 4px; cursor: pointer; font: inherit; }
.swatch .chipcol { height: 48px; border-radius: var(--r-chip); border: 1px solid var(--line); }
.kit-links { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ---------- journeys */
.pathway-group { display: grid; gap: 8px; }
.pathway-group h3 { margin: 6px 0 0; }
.pathway-group p { margin: 0; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; }
.stage { position: relative; padding: 0 0 24px 46px; display: grid; gap: 8px; min-width: 0; }
.stage::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 2px; background: var(--line-2); }
.stage:last-child { padding-bottom: 0; }
.stage:last-child::before { display: none; }
.stage.done::before { background: var(--brand); }
.stage-n { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--paper); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.stage.done .stage-n { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.stage.here .stage-n { border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 4px var(--brand-soft); }
.stage-head { display: grid; gap: 2px; padding-top: 4px; }
.stage-head .row { gap: 8px; flex-wrap: wrap; }
.stage-head b { font-size: 16px; }
.stage-head p { margin: 0; }
.stage-mods { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stage-mods li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.linkish:hover, .linkish:focus-visible { text-decoration: underline; }
.stage-pracs { background: var(--brand-soft); border-radius: var(--r-ctl); padding: 8px 12px; }
.stage-pracs .label { font-size: 13px; font-weight: 600; color: var(--brand-ink); }
.stage-pracs ul { margin: 4px 0 0; padding-left: 18px; }
.chip.here { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.choice { text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); padding: 14px; display: grid; gap: 4px; cursor: pointer; }
.choice b { font-size: 15px; }
.choice span { font-size: 13px; color: var(--muted); }
.choice[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }

/* ---------- toast */
.toasts {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: min(92vw, 420px);
}
@media (min-width: 760px) { .toasts { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); } }
.toast { background: var(--black); color: var(--on-black); border: 1px solid var(--black-line); border-radius: var(--radius); padding: 12px 14px; font-weight: 500; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); animation: rise .25s ease-out; }
.toast b { color: var(--on-ink-hi); }
.toast .mono { color: var(--brand-hi); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- sign-in */
.gate {
  min-height: 100vh; min-height: 100dvh; background: var(--black); color: var(--on-black); --focus: var(--brand-hi);
  display: grid; grid-template-columns: minmax(0, 400px); justify-content: center; align-content: center; gap: 28px;
  padding-block: max(32px, env(safe-area-inset-top, 0px)) max(32px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.gate .lockup { justify-self: start; }
.gate .lockup-logo { height: 30px; }
.gate .lockup-sub { font-size: 24px; padding-left: 14px; }
.gate-card { width: 100%; min-width: 0; background: var(--paper); color: var(--ink); border-radius: 10px; padding: 28px 24px; display: grid; gap: 18px; --focus: var(--brand); }
.gate-card h1 { font-size: 34px; }
.gate-card p { overflow-wrap: anywhere; }
.gate form { display: grid; gap: 14px; min-width: 0; }
.gate .field { max-width: none; min-width: 0; }
.gate .field input { width: 100%; min-width: 0; }
.gate .btn { width: 100%; justify-content: center; text-align: center; padding-block: 12px; }
.gate .btn-row .btn { width: auto; flex: 1 1 auto; }
.gate-foot { font-size: 13px; color: var(--on-black-2); }
.code-input { font-family: var(--font) !important; font-weight: 600; font-size: 28px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; padding-left: calc(12px + .3em) !important; }
.or { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); }
.btn.google { background: var(--paper); color: var(--ink); border: 1px solid var(--line-2); display: inline-flex; gap: 10px; align-items: center; justify-content: center; }
.btn.google:hover { background: var(--bg); }
.btn.google svg { width: 18px; height: 18px; }
.form-error { color: var(--safety); font-size: 14px; font-weight: 500; }
.form-note { color: var(--muted); font-size: 13px; }

/* ---------- forms */
.field { display: grid; gap: 6px; max-width: 360px; }
.field label b { font-size: 14px; }
.field input, .field select, .field textarea { font: inherit; padding: 10px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
.field textarea { min-height: 110px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--muted); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.checks { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.check { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 10px; cursor: pointer; background: var(--paper); font-size: 14px; }
.check input { margin-top: 4px; accent-color: var(--brand); }
.check.tick-done { border-color: var(--brand); background: var(--brand-soft); }
.btn.danger { background: transparent; color: var(--safety); border: 1px solid var(--safety); }
.btn.danger:hover { background: var(--safety-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- team */
.team-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.team-tools .field { max-width: 260px; }
.person-cell { display: grid; gap: 2px; min-width: 160px; }
.person-cell .linkish { font-weight: 600; }
.chip.role { background: var(--paper); }
.chip.off { border-style: dashed; color: var(--muted); }
.chip.warn { border-color: transparent; background: var(--gold-soft); color: var(--ink); }
.chip.bad { border-color: transparent; background: var(--safety-soft); color: var(--safety); }
.queue { display: grid; gap: 12px; }
.q-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; background: var(--paper); }
.q-item.ready { border-left: 3px solid var(--brand); }
.q-item h3 { font-size: 16px; }
.q-item ul.crit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.invite-result { display: grid; gap: 6px; }
.copybox { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- review */
.review-panel { border: 2px solid var(--brand); }
.review-panel textarea { width: 100%; }
.preview-note { background: var(--gold-soft); border-radius: var(--r-ctl); padding: 10px 12px; font-size: 14px; }
.opt.key { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

/* ---------- more sheet (phone) */
.sheet-back { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .5); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 36; background: var(--paper); border-radius: 12px 12px 0 0; box-shadow: var(--shadow);
  padding-block: 10px calc(16px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 2px; }
.sheet .grab { width: 36px; height: 4px; border-radius: 999px; background: var(--line-2); justify-self: center; margin-bottom: 8px; }
.sheet button { border: 0; background: none; text-align: left; padding: 13px 8px; font-size: 16px; font-weight: 500; border-radius: var(--r-ctl); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.sheet button:hover { background: var(--bg); }
.sheet .sheet-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.count { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--brand); color: var(--on-brand); border-radius: 999px; padding: 1px 8px; }
.top .count { background: var(--brand-hi); color: var(--black); }
.org-line { font-size: 12px; color: var(--muted); padding: 8px 8px 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.q-fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.q-fold > summary { padding: 12px 14px; cursor: pointer; display: block; }
.q-fold > summary::-webkit-details-marker { display: none; }
.q-fold > summary::before { content: "+"; font-weight: 600; color: var(--brand); margin-right: 8px; }
.q-fold[open] > summary::before { content: "\2212"; }
.q-fold > .q-item { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
