:root {
  /* Brand — exact, do not drift (docs/brand.md) */
  --chili: #C8102E;
  --rosa: #EC2789;
  --sol: #F2921E;
  --penny: #F5EFE3;
  --tile: #FBF8F0;
  --jet: #211C18;
  --day-chili: #F0506A;

  --canvas: var(--penny);
  --surface: var(--tile);
  --raised: rgb(255 255 255 / .70);
  --ink: var(--jet);
  --muted: #6E645B;
  --quiet: #A2968A;
  --line: rgb(33 28 24 / .16);
  --hairline: rgb(33 28 24 / .09);
  --pressed: rgb(33 28 24 / .06);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --display: "Futura", "Futura PT", "Avenir Next", "Century Gothic", var(--sans);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --radius-flap: 0px;
  --radius-tile: 6px;
  --radius-card: 18px;
}

* { box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { margin: 0; min-width: 320px; }
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--chili); outline-offset: 3px; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .92em; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-chevron { width: 15px; height: 15px; color: var(--quiet); }

/* ── top bar ─────────────────────────────────────────────── */
.prototype-bar {
  min-height: 64px; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(22px) saturate(120%); -webkit-backdrop-filter: blur(22px) saturate(120%);
  position: sticky; top: 0; z-index: 20;
}
.bar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prototype-logo { width: 28px; height: 28px; border-radius: var(--radius-tile); flex: none; }
.prototype-mark { font: 700 21px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.prototype-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.view-switch { display: flex; background: var(--pressed); border: 1px solid var(--hairline); border-radius: 13px; padding: 3px; flex: none; }
.view-switch button { min-height: 36px; border: 0; background: transparent; border-radius: 10px; padding: 0 13px; font-size: 11px; cursor: pointer; white-space: nowrap; transition: background-color 220ms var(--ease), transform 160ms ease; }
.view-switch button:active { transform: scale(.97); }
.view-switch button.is-active { background: white; box-shadow: 0 1px 3px rgb(33 28 24 / .10); font-weight: 620; }

/* ── phone stage ─────────────────────────────────────────── */
.stage { min-height: calc(100vh - 64px); padding: 48px clamp(20px, 6vw, 96px); display: grid; place-items: center; }
.phone {
  width: 402px; height: min(844px, calc(100vh - 112px)); min-height: 660px;
  border: 8px solid #0D0B0A; border-radius: 48px; background: var(--surface);
  position: relative; overflow: hidden;
  box-shadow: 0 30px 90px rgb(33 28 24 / .18), inset 0 0 0 1px rgb(255 255 255 / .4);
}
.screen { height: calc(100% - 78px); overflow: auto; scrollbar-width: none; padding: 24px 18px 30px; }
.screen::-webkit-scrollbar { display: none; }

/* ── splash ──────────────────────────────────────────────── */
.splash-screen { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; overflow: hidden; background: var(--jet); color: white; }
.splash-flap { position: absolute; left: 0; right: 0; top: 46%; transform: translateY(-50%); display: flex; justify-content: center; gap: 5px; }
.splash-flap span {
  width: 52px; height: 68px; display: grid; place-items: center;
  background: #14110F; border-radius: var(--radius-flap);
  font: 700 38px/1 var(--display); letter-spacing: .02em; color: var(--penny);
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / .10);
  position: relative; animation: flap-in 620ms var(--ease) both;
}
.splash-flap span::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgb(0 0 0 / .55); }
.splash-flap span:nth-child(1) { animation-delay: 60ms; }
.splash-flap span:nth-child(2) { animation-delay: 150ms; }
.splash-flap span:nth-child(3) { animation-delay: 240ms; }
.splash-flap span:nth-child(4) { animation-delay: 330ms; }
.splash-flap span:nth-child(5) { animation-delay: 420ms; }
.splash-flap span:nth-child(3) { color: var(--sol); }
.splash-brand { position: absolute; left: 22px; right: 22px; bottom: 104px; text-align: center; }
.splash-brand p { margin: 0; color: rgb(255 255 255 / .58); font-size: 11px; letter-spacing: .04em; }
.splash-enter {
  position: absolute; left: 18px; right: 18px; bottom: 24px; min-height: 56px; padding: 0 17px;
  border: 0; border-radius: 16px; color: white; background: var(--chili);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 620; cursor: pointer;
  transition: transform 160ms ease, filter 180ms ease;
}
.splash-enter:active { transform: scale(.985); filter: brightness(1.08); }

/* ── generic app furniture ───────────────────────────────── */
.app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding-top: 4px; }
.app-header.simple { align-items: center; }
.date { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.app-header h1, .sheet-page h1 { font: 700 30px/1.02 var(--display); letter-spacing: -.01em; margin: 0; }
.app-header.simple h1 { font-size: 27px; }
.avatar, .round-action { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--raised); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); cursor: pointer; flex: none; display: grid; place-items: center; transition: transform 160ms ease; }
.avatar:active, .round-action:active { transform: scale(.94); }
.avatar { font-size: 12px; font-weight: 700; }
.primary-action, .secondary-action { border: 0; min-height: 46px; border-radius: 999px; padding: 0 20px; cursor: pointer; font-size: 12px; font-weight: 640; transition: transform 150ms ease, filter 150ms ease; }
.primary-action { color: white; background: var(--chili); }
.primary-action:active { transform: scale(.985); filter: brightness(1.08); }
.secondary-action { background: var(--pressed); }
.primary-action.wide { width: 100%; margin-top: 18px; }
.support-note { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 12px 0 0; }
.detail-bar { min-height: 44px; display: grid; grid-template-columns: 44px 1fr 60px; align-items: center; text-align: center; margin: -5px 0 8px; font-size: 11px; font-weight: 620; }
.detail-bar button { width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.detail-bar .deadline, .detail-bar .step-count { font: 600 10px/1 var(--mono); color: var(--sol); letter-spacing: .06em; }
.detail-bar .step-count { color: var(--muted); }
.sheet-page { padding-top: 10px; }
.section-block { margin-top: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.section-heading h2 { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin: 0; color: var(--muted); }
.section-heading span, .section-heading button { color: var(--muted); border: 0; background: none; font-size: 10px; cursor: pointer; }
.action-row { width: 100%; min-height: 66px; border: 1px solid var(--hairline); background: var(--raised); border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; text-align: left; cursor: pointer; transition: transform 180ms var(--ease); }
.action-row:active { transform: scale(.985); }
.row-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--pressed); }
.action-row strong { display: block; font-size: 12px; }
.action-row small { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; }
.tier { background: color-mix(in srgb, var(--chili) 12%, white); color: var(--chili); border-radius: 999px; padding: 7px 11px; font-size: 10px; font-weight: 700; white-space: nowrap; }

/* ── flap grammar (La Pizarra) ───────────────────────────── */
.flap-row, .pass-row {
  display: grid; grid-template-columns: 74px 1fr; align-items: stretch;
  background: var(--jet); color: var(--penny); border-radius: var(--radius-flap);
  font: 600 10px/1 var(--mono); letter-spacing: .08em; margin-bottom: 3px; overflow: hidden;
}
.flap-key, .pass-row .flap-key { padding: 12px 10px; background: rgb(255 255 255 / .07); text-transform: uppercase; color: rgb(245 239 227 / .62); }
.flap-val { padding: 12px 10px; position: relative; }
.flap-val::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgb(0 0 0 / .45); }
.flap-row.is-decided .flap-val { color: var(--penny); }
.flap-row.is-voting .flap-val { color: var(--sol); }
.flap-row.is-ghost .flap-val { color: rgb(245 239 227 / .30); }
.flap-row.demo { margin: 0; width: 100%; }

/* ── join card ───────────────────────────────────────────── */
.join-screen { display: grid; align-items: center; }
.join-card { border: 1px solid var(--hairline); border-radius: 22px; overflow: hidden; background: white; box-shadow: 0 12px 40px rgb(33 28 24 / .09); }
.join-poster { height: 148px; position: relative; display: grid; place-items: center; background: linear-gradient(140deg, var(--chili), #8E0B21); color: white; overflow: hidden; }
.join-poster::before { content: ""; position: absolute; width: 230px; height: 230px; border: 1px solid rgb(255 255 255 / .28); border-radius: 50%; transform: translate(-70px, 60px); box-shadow: 0 0 0 14px rgb(255 255 255 / .10), 0 0 0 28px rgb(255 255 255 / .06); }
.poster-letter { font: 700 104px/.8 var(--display); opacity: .95; }
.poster-code { position: absolute; left: 14px; top: 13px; font: 600 9px/1 var(--mono); letter-spacing: .12em; opacity: .85; }
.join-copy { padding: 18px 16px 20px; }
.join-copy h1 { font: 700 34px/1 var(--display); margin: 0 0 6px; }
.join-meta { color: var(--muted); font-size: 11px; margin: 0 0 14px; }
.join-going { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.avatar-stack { display: flex; }
.avatar-stack span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 9px/1 var(--sans); background: var(--jet); color: var(--penny); border: 2px solid white; margin-left: -8px; }
.avatar-stack span:first-child { margin-left: 0; }
.avatar-stack span.is-you { background: var(--chili); }
.join-going small { color: var(--muted); font-size: 10.5px; }
.join-state { margin-bottom: 4px; }
.decline { display: block; width: 100%; margin-top: 12px; border: 0; background: transparent; min-height: 40px; color: var(--muted); font-size: 11.5px; cursor: pointer; }

/* ── vibe check ──────────────────────────────────────────── */
.vibe-group { margin-top: 22px; }
.vibe-label { display: block; color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 9px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: transparent; border-radius: 999px; font-size: 12px; cursor: pointer; transition: transform 150ms ease; }
.chip:active { transform: scale(.96); }
.chip.is-on { background: var(--jet); border-color: var(--jet); color: var(--penny); font-weight: 600; }
.standing-card { margin-top: 26px; padding: 14px; border: 1px solid var(--hairline); border-left: 3px solid var(--sol); border-radius: var(--radius-tile); background: white; display: grid; grid-template-columns: 20px 1fr; gap: 11px; }
.standing-glyph { color: var(--sol); margin-top: 2px; }
.standing-card strong { display: block; font-size: 12px; margin-bottom: 5px; }
.standing-card small { color: var(--muted); font-size: 10px; line-height: 1.5; }

/* ── map + board ─────────────────────────────────────────── */
.map-screen { padding: 0; height: calc(100% - 78px); position: relative; overflow: hidden; }
.trip-map { position: absolute; inset: 0; background: #E9E2D5; }
.map-grid {
  position: absolute; inset: -20%;
  background-image:
    linear-gradient(92deg, transparent 0 6%, #DED6C6 6% 8.4%, transparent 8.4% 27%, #DED6C6 27% 30%, transparent 30% 58%, #DED6C6 58% 60.2%, transparent 60.2% 81%, #DED6C6 81% 84%, transparent 84%),
    linear-gradient(4deg, transparent 0 13%, #DED6C6 13% 15.4%, transparent 15.4% 41%, #DED6C6 41% 44%, transparent 44% 69%, #DED6C6 69% 71.4%, transparent 71.4%),
    radial-gradient(circle at 68% 74%, #D7E4DC 0 16%, transparent 16.4%),
    radial-gradient(circle at 14% 12%, #D7E4DC 0 9%, transparent 9.4%);
  transform: rotate(-4deg);
}
.pin {
  position: absolute; left: var(--x); top: var(--y);
  display: flex; align-items: center; gap: 6px;
  font: 700 8.5px/1 var(--mono); letter-spacing: .05em; white-space: nowrap;
  color: var(--jet); background: rgb(255 255 255 / .93);
  padding: 4px 8px 4px 4px; border-radius: 999px;
  box-shadow: 0 2px 8px rgb(33 28 24 / .22);
}
.pin::before { content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pin::after { content: attr(data-label); }
.pin-decided[data-day="fri"]::before { background: var(--rosa); }
.pin-decided[data-day="sat"]::before { background: var(--sol); }
.pin-idea { color: var(--chili); background: rgb(255 255 255 / .82); }
.pin-idea::before { background: transparent; border: 2px dashed var(--chili); }
.map-locate { position: absolute; right: 14px; bottom: calc(64% + 74px); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hairline); background: rgb(255 255 255 / .92); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px rgb(33 28 24 / .16); z-index: 5; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.trip-chrome { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 4; }
.layer-switch { display: flex; background: rgb(255 255 255 / .82); border: 1px solid var(--hairline); border-radius: 12px; padding: 3px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.layer-switch button { min-height: 34px; padding: 0 14px; border: 0; background: transparent; border-radius: 9px; font-size: 11px; cursor: pointer; }
.layer-switch button.is-active { background: var(--jet); color: var(--penny); font-weight: 620; }
.board-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64%;
  background: var(--jet); color: var(--penny);
  border-radius: 22px 22px 0 0; padding: 8px 16px 96px;
  overflow: auto; scrollbar-width: none;
  box-shadow: 0 -12px 40px rgb(33 28 24 / .3);
}
.board-sheet::-webkit-scrollbar { display: none; }
.sheet-grip { display: block; width: 38px; height: 4px; border-radius: 99px; background: rgb(245 239 227 / .28); margin: 4px auto 12px; }
.sheet-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-heading h2 { font: 700 22px/1 var(--display); margin: 0; }
.sheet-heading .date { color: rgb(245 239 227 / .62); }
.board-sheet .day-rail { opacity: 1; box-shadow: 0 0 10px -1px currentColor; }
.board-row.is-decided { background: rgb(245 239 227 / .14); border-color: rgb(245 239 227 / .22); }
.ghost-btn { border: 1px solid rgb(245 239 227 / .28); color: var(--penny); background: transparent; border-radius: 999px; min-height: 34px; padding: 0 13px; font: 600 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; flex: none; }
.waiting-strip { display: grid; grid-template-columns: 30px 1fr; gap: 11px; align-items: center; padding: 11px 12px; border: 1px solid rgb(242 146 30 / .38); border-radius: var(--radius-tile); background: rgb(242 146 30 / .1); margin-bottom: 18px; }
.waiting-strip small { color: rgb(245 239 227 / .58) !important; }
.waiting-strip strong { display: block; font-size: 12px; }
.waiting-strip small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }

.day-group { position: relative; padding-left: 12px; margin-bottom: 18px; }
.day-rail { position: absolute; left: 0; top: 20px; bottom: 4px; width: 3px; border-radius: 99px; }
.day-rail[data-day="fri"], [data-day="fri"] i, i[data-day="fri"] { background: var(--rosa); }
.day-rail[data-day="sat"], i[data-day="sat"] { background: var(--sol); }
.day-rail[data-day="sun"], i[data-day="sun"] { background: var(--day-chili); }
.day-label { font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: rgb(245 239 227 / .64); margin-bottom: 9px; }
.board-row { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; min-height: 58px; padding: 8px 10px; margin-bottom: 5px; border: 1px solid rgb(245 239 227 / .16); border-radius: var(--radius-tile); background: rgb(245 239 227 / .1); color: var(--penny); text-align: left; cursor: pointer; transition: transform 160ms var(--ease), background-color 180ms ease; }
.board-row:active { transform: scale(.99); }
.board-row:hover { background: rgb(245 239 227 / .14); }
.row-time { font: 600 11px/1 var(--mono); color: rgb(245 239 227 / .62); }
.row-body strong { display: block; font-size: 12.5px; letter-spacing: -.005em; }
.row-body small { display: block; color: rgb(245 239 227 / .66); font-size: 10px; margin-top: 3px; }
.board-row.is-ghost { border-style: dashed; border-color: rgb(245 239 227 / .16); background: transparent; cursor: default; }
.board-row.is-ghost .row-body strong { color: rgb(245 239 227 / .34); }
.board-row.is-ghost .row-body small { font-family: var(--mono); letter-spacing: .1em; color: rgb(245 239 227 / .24); }
.board-row.is-voting { border-color: rgb(242 146 30 / .5); }
.board-row.is-decided .row-time { color: var(--penny); }
.heat-bar { display: flex; gap: 2px; }
.heat-bar i { width: 5px; height: 18px; border-radius: 1px; }
.heat-bar i:nth-child(1) { background: var(--rosa); }
.heat-bar i:nth-child(2) { background: var(--sol); }
.heat-bar i:nth-child(3) { background: var(--chili); }
/* Ideas / Board layers — pins fade rather than vanish, so the graph stays legible */
.trip-map .pin { transition: opacity 260ms var(--ease), transform 260ms var(--ease); }
.trip-map[data-layer="board"] .pin-idea,
.trip-map[data-layer="ideas"] .pin-decided { opacity: .3; transform: scale(.82); box-shadow: none; }

.fab { position: absolute; right: 16px; bottom: calc(64% + 18px); width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--chili); color: white; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgb(200 16 46 / .38); z-index: 5; transition: transform 160ms ease; }
.fab:active { transform: scale(.93); }

/* ── vote ring (El Anillo) ───────────────────────────────── */
.ring { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--rosa) 0 var(--pct, 60%), var(--pressed) var(--pct, 60%) 100%); position: relative; }
.ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; z-index: 1; font: 700 8px/1 var(--mono); }
.ring-3of5 { --pct: 60%; }
.ring-lg { width: 54px; height: 54px; }
.ring-lg b { font-size: 12px; }
.ring-lg::after { inset: 6px; }
.ring-money { background: conic-gradient(var(--sol) 0 var(--pct), var(--pressed) var(--pct) 100%); }
.board-sheet .ring { background: conic-gradient(var(--rosa) 0 var(--pct, 60%), rgb(245 239 227 / .18) var(--pct, 60%) 100%); }
.board-sheet .ring::after { background: #2A2521; }
.waiting-strip .ring::after { background: #34291D; }

/* roster — filled = responded, dashed = the gray ring slot (nudge ladder, rung 1) */
.roster { display: flex; align-items: center; gap: 6px; margin: 0 0 20px; }
.roster-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 9.5px/1 var(--sans); background: var(--jet); color: var(--penny); flex: none; }
.roster-avatar.is-waiting { background: transparent; border: 1.5px dashed var(--quiet); color: var(--quiet); }
.roster-note { margin-left: 6px; font-size: 10.5px; color: var(--muted); line-height: 1.4; }

/* ── vote screen ─────────────────────────────────────────── */
.vote-head { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: center; margin-bottom: 22px; }
.vote-head h1 { font-size: 25px; }
.option-card { border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 14px; background: white; margin-bottom: 10px; }
.option-card.is-leading { border-color: color-mix(in srgb, var(--chili) 40%, transparent); box-shadow: 0 4px 18px rgb(200 16 46 / .07); }
.option-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.option-top strong { font-size: 15px; }
.price { font: 700 15px/1 var(--display); }
.price small { font: 400 10px/1 var(--sans); color: var(--muted); }
.option-why { margin: 9px 0 12px; font-size: 11.5px; line-height: 1.5; color: #4A423B; }
.option-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stamp { font: 600 9px/1 var(--mono); letter-spacing: .06em; color: var(--sol); border: 1px solid color-mix(in srgb, var(--sol) 40%, transparent); border-radius: 999px; padding: 5px 8px; }
.split-note { font-size: 10px; color: var(--muted); }
.fit-note { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); }
.fit-note .icon { width: 14px; height: 14px; color: var(--chili); }
.add-option { width: 100%; min-height: 48px; margin-top: 4px; border: 1px dashed var(--line); border-radius: var(--radius-tile); background: transparent; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11.5px; cursor: pointer; }
.vote-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; margin-top: 22px; }
.vote-btn { min-height: 50px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 620; cursor: pointer; transition: transform 150ms ease; }
.vote-btn:active { transform: scale(.97); }
.vote-in { background: var(--chili); border-color: var(--chili); color: white; }
.vote-concede { border-color: var(--sol); color: #A4610D; }

/* ── result ──────────────────────────────────────────────── */
.result-screen { background: var(--jet); color: var(--penny); display: grid; align-items: center; }
.result-inner { padding: 8px 4px; }
.result-eyebrow { display: block; font: 600 10px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--sol); margin-bottom: 16px; }
.flap-result { display: grid; grid-template-columns: 74px 1fr; background: #14110F; font: 700 13px/1 var(--mono); letter-spacing: .09em; animation: clatter 520ms var(--ease) both; }
.flap-result .flap-key { padding: 16px 10px; background: rgb(255 255 255 / .06); color: rgb(245 239 227 / .55); font-weight: 600; font-size: 10px; text-transform: uppercase; }
.flap-result .flap-val { padding: 16px 10px; color: var(--penny); }
.result-note { color: rgb(245 239 227 / .55); font-size: 11px; margin: 14px 0 26px; }
.unlock-card { border: 1px dashed rgb(242 146 30 / .5); border-radius: var(--radius-tile); padding: 14px; }
.unlock-tag { display: inline-block; font: 600 9px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sol); margin-bottom: 9px; }
.unlock-card strong { display: block; font-size: 14px; margin-bottom: 5px; }
.unlock-card small { color: rgb(245 239 227 / .55); font-size: 10.5px; line-height: 1.5; }
.result-screen .primary-action { margin-top: 26px; }

/* ── propose ─────────────────────────────────────────────── */
.propose-title { margin-bottom: 12px; }
.why-field { border: 1px solid var(--line); border-radius: var(--radius-tile); padding: 13px; background: white; }
.why-field p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; }
.field-count { font: 600 9px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--chili); }
.propose-rows { margin-top: 12px; }
.propose-row { width: 100%; min-height: 62px; border: 1px solid var(--hairline); border-radius: var(--radius-tile); background: white; padding: 10px 12px; margin-bottom: 6px; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; text-align: left; cursor: pointer; }
.propose-row strong { display: block; font-size: 12px; }
.propose-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.propose-row .row-icon { width: 34px; height: 34px; }
.propose-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mode-card { border: 1px solid var(--line); border-radius: var(--radius-tile); padding: 12px; text-align: left; background: transparent; cursor: pointer; }
.mode-card.is-on { border-color: var(--jet); background: var(--jet); color: var(--penny); }
.mode-card strong { display: block; font-size: 12px; margin-bottom: 5px; }
.mode-card small { font-size: 10px; line-height: 1.45; opacity: .7; }

/* ── departures ──────────────────────────────────────────── */
.departures-screen { background: var(--jet); color: var(--penny); padding: 18px 12px 24px; }
.dep-bar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; text-align: center; font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: rgb(245 239 227 / .6); margin-bottom: 18px; }
.dep-bar button { width: 40px; height: 40px; border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; }
.solari { border-top: 1px solid rgb(245 239 227 / .16); }
.solari-head, .solari-row { display: grid; grid-template-columns: 40px 56px 1fr 78px; gap: 6px; align-items: center; padding: 11px 4px; border-bottom: 1px solid rgb(245 239 227 / .1); font: 600 10px/1.2 var(--mono); letter-spacing: .06em; }
.solari-head { color: rgb(245 239 227 / .38); font-size: 8.5px; text-transform: uppercase; letter-spacing: .14em; }
.dep-day { padding: 4px 0; text-align: center; border-radius: 2px; color: var(--jet); font-weight: 700; font-size: 9px; }
.dep-day[data-day="fri"] { background: var(--rosa); }
.dep-day[data-day="sat"] { background: var(--sol); }
.dep-day[data-day="sun"] { background: var(--day-chili); }
.st-ok { color: var(--penny); }
.st-vote { color: var(--sol); }
.st-wait { color: rgb(245 239 227 / .62); }
.st-none { color: rgb(245 239 227 / .28); }
.dep-foot { color: rgb(245 239 227 / .38); font-size: 10px; margin: 18px 0 0; }

/* ── search ──────────────────────────────────────────────── */
.segments { display: flex; gap: 3px; background: var(--pressed); padding: 3px; border: 1px solid var(--hairline); border-radius: 12px; margin-bottom: 14px; overflow-x: auto; }
.segments button { border: 0; background: none; min-height: 40px; padding: 0 15px; border-radius: 9px; font-size: 11px; white-space: nowrap; cursor: pointer; }
.segments button.is-active { background: white; font-weight: 620; }
.unlocked-note { display: flex; gap: 7px; align-items: flex-start; font-size: 10.5px; color: var(--muted); line-height: 1.45; margin: 0 0 14px; }
.unlocked-note .icon { width: 14px; height: 14px; color: var(--chili); margin-top: 1px; }
.result-list { border-top: 1px solid var(--hairline); }
.result-row { width: 100%; min-height: 68px; border: 0; border-bottom: 1px solid var(--hairline); background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.stash-add { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }

/* ── ledger ──────────────────────────────────────────────── */
.install-card { border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 14px; background: white; display: grid; grid-template-columns: 1fr auto; gap: 12px 14px; align-items: start; }
.install-top { grid-column: 1; }
.install-top strong { display: block; font-size: 13px; }
.due { display: block; color: var(--sol); font: 600 10px/1 var(--mono); letter-spacing: .06em; margin-top: 5px; }
.install-card .ring { grid-column: 2; grid-row: 1; }
.install-card .ring::after { background: white; }
.payer-list { grid-column: 1 / -1; border-top: 1px solid var(--hairline); padding-top: 6px; }
.payer { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 11.5px; }
.payer:last-child { border-bottom: 0; }
.payer b { font-weight: 620; }
.payer small { font: 600 9px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--chili); }
.payer.is-paid small { color: var(--muted); }
.mini-btn { border: 1px solid var(--line); background: transparent; border-radius: 999px; min-height: 28px; padding: 0 10px; font-size: 10px; cursor: pointer; }
.pass-row { grid-template-columns: 86px 1fr; }

/* ── chat ────────────────────────────────────────────────── */
.chat-log { display: grid; gap: 10px; }
.bubble { max-width: 84%; padding: 11px 13px; border-radius: 16px; font-size: 12.5px; line-height: 1.45; }
.bubble small { display: block; font-size: 9.5px; color: var(--muted); margin-bottom: 4px; }
.bubble.them { background: var(--pressed); justify-self: start; border-bottom-left-radius: 5px; }
.bubble.me { background: var(--chili); color: white; justify-self: end; border-bottom-right-radius: 5px; }
.bubble.bot { background: var(--jet); color: var(--penny); justify-self: start; max-width: 92%; border-bottom-left-radius: 5px; }
.bot-tag { display: block; font: 700 9px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sol); margin-bottom: 7px; }
.bubble.bot b { color: white; }
.bot-action { display: block; margin-top: 11px; border: 1px solid rgb(245 239 227 / .3); background: transparent; color: var(--penny); border-radius: 999px; min-height: 34px; padding: 0 13px; font-size: 11px; cursor: pointer; }
.chat-input { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px 0 16px; min-height: 46px; color: var(--quiet); font-size: 12px; }
.chat-input button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--chili); color: white; display: grid; place-items: center; cursor: pointer; }

/* ── stash ───────────────────────────────────────────────── */
.you-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 18px; }
.large-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--jet); color: var(--penny); display: grid; place-items: center; font: 700 17px/1 var(--display); }
.you-head strong { display: block; font-size: 15px; }
.you-head small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 4px; }
.private-banner { display: flex; gap: 9px; align-items: center; padding: 11px 12px; background: var(--pressed); border-radius: var(--radius-tile); font-size: 10.5px; color: var(--muted); line-height: 1.45; margin-bottom: 16px; }
.private-banner .icon { width: 15px; height: 15px; flex: none; }
.stash-list { border-top: 1px solid var(--hairline); }
.stash-item { width: 100%; min-height: 66px; border: 0; border-bottom: 1px solid var(--hairline); background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.propose-tag { border: 1px solid var(--chili); color: var(--chili); border-radius: 999px; padding: 6px 11px; font-size: 10px; font-weight: 620; flex: none; }
.your-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.your-status div { border: 1px solid var(--hairline); border-radius: var(--radius-tile); padding: 11px 10px; background: white; }
.your-status span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.your-status strong { font-size: 12px; }

/* ── bottom nav ──────────────────────────────────────────── */
.bottom-nav { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 62px; background: color-mix(in srgb, white 78%, transparent); border: 1px solid var(--hairline); border-radius: 19px; padding: 5px; display: grid; grid-template-columns: repeat(4, 1fr); z-index: 6; box-shadow: 0 10px 30px rgb(33 28 24 / .10); backdrop-filter: blur(24px) saturate(130%); -webkit-backdrop-filter: blur(24px) saturate(130%); }
.bottom-nav button { border: 0; background: none; border-radius: 15px; font-size: 9.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; transition: color 180ms ease, background-color 220ms var(--ease), transform 160ms ease; }
.bottom-nav button:active { transform: scale(.94); }
.bottom-nav button.is-active { background: var(--pressed); color: var(--chili); font-weight: 660; }

/* ── navigation map view ─────────────────────────────────── */
.map-view { padding: 60px clamp(20px, 6vw, 96px) 96px; max-width: 1500px; margin: 0 auto; }
.map-header { display: grid; grid-template-columns: 150px minmax(280px, 1fr) minmax(260px, 440px); gap: 28px; align-items: end; margin-bottom: 44px; }
.map-header p { color: var(--muted); font-size: 11px; margin: 0; }
.map-header h1 { font: 700 44px/1 var(--display); margin: 0; letter-spacing: -.01em; }
.map-header > span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0 0 30px; padding-top: 16px; border-top: 1px solid var(--line); }
.legend-key { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.legend-key .swatch { width: 22px; height: 14px; border: 2px solid; background: white; flex: none; }
.sitemap-scroll { overflow-x: auto; padding-bottom: 18px; }
.sitemap { width: 940px; padding: 28px 34px 34px; border: 1px solid var(--line); border-radius: var(--radius-card); background: rgb(255 255 255 / .48); margin: 0 auto; }
.site-node { width: 150px; min-height: 48px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; text-align: center; border: 1px solid; background: white; font-size: 10px; font-weight: 620; line-height: 1.25; position: relative; z-index: 2; }
.site-node .sub { font-size: 8.5px; font-weight: 450; color: var(--muted); text-transform: none; letter-spacing: 0; }
.node-root { border-color: var(--sol); }
.node-primary { border-color: var(--jet); background: var(--pressed); text-transform: uppercase; letter-spacing: .06em; }
.node-detail { border-color: var(--rosa); }
.node-auth { border-color: var(--chili); }
.node-function { border-color: var(--quiet); border-style: dashed; color: var(--muted); font-weight: 500; }
.ia-root { display: flex; flex-direction: column; align-items: center; }
.ia-root .site-node { width: 220px; }
.ia-root .node-shell { width: 100%; min-height: 34px; border-color: var(--quiet); background: transparent; color: var(--muted); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; font-size: 9px; }
.ia-root-stem { height: 24px; border-left: 1px solid var(--quiet); }
.ia-columns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; padding-top: 1px; }
.ia-columns::before { content: ""; position: absolute; left: 95px; right: 95px; top: 0; border-top: 1px solid var(--quiet); }
.ia-branch { display: flex; flex-direction: column; align-items: center; }
.ia-branch-stem { height: 26px; border-left: 1px solid var(--quiet); }
.ia-branch > .node-primary { width: 100%; min-height: 40px; }
.ia-children { display: grid; gap: 16px; margin-top: 20px; align-content: start; width: 100%; }
.ia-children .site-node { width: 100%; min-height: 54px; }
.ia-children .site-node::before { content: ""; position: absolute; left: 50%; top: -17px; height: 16px; border-left: 1px solid var(--quiet); }
.ia-band { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--jet); }
.ia-band header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; gap: 16px; }
.ia-band header span { color: var(--muted); font-size: 9px; }
.ia-band header strong { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ia-feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ia-feature-grid .site-node { width: 100%; min-height: 52px; }
.ia-shared { grid-template-columns: repeat(3, 1fr); }
.ia-shared .site-node { min-height: 62px; }
.ia-utilities { margin-top: 40px; border-top-color: var(--quiet); }
.state-table { border: 1px solid var(--line); background: white; }
.state-head, .state-row { display: grid; grid-template-columns: 100px 1.3fr 1.2fr 1.3fr 1.1fr; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--hairline); font-size: 10.5px; line-height: 1.4; }
.state-row:last-child { border-bottom: 0; }
.state-head { background: var(--pressed); color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.st-name { font: 600 10px/1.4 var(--mono); }
.state-row:nth-child(2) .st-name { color: var(--quiet); }
.state-row:nth-child(3) .st-name { color: var(--rosa); }
.state-row:nth-child(4) .st-name { color: var(--sol); }
.state-row:nth-child(5) .st-name { color: var(--chili); }

/* ── identity view ───────────────────────────────────────── */
.identity-view { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: start; }
.identity-subnav { position: sticky; top: 64px; height: calc(100vh - 64px); padding: 30px 18px; border-right: 1px solid var(--line); background: rgb(255 255 255 / .4); }
.identity-subnav > span { display: block; color: var(--muted); font-size: 9px; margin: 0 10px 18px; letter-spacing: .06em; text-transform: uppercase; }
.identity-subnav nav { display: grid; gap: 2px; }
.identity-subnav a { min-height: 34px; padding: 0 10px; display: flex; align-items: center; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 11px; }
.identity-subnav a:hover { color: var(--ink); }
.identity-subnav a.is-current { background: var(--pressed); color: var(--chili); font-weight: 660; }
.identity-content { width: min(100%, 1180px); margin: 0 auto; padding: 70px clamp(24px, 6vw, 90px) 96px; }
.identity-content [id] { scroll-margin-top: 90px; }
.identity-intro { display: grid; grid-template-columns: 150px minmax(260px, 1fr) minmax(260px, 420px); gap: 30px; align-items: end; padding-bottom: 44px; border-bottom: 1px solid var(--line); }
.identity-intro > p { margin: 0; color: var(--muted); font-size: 10px; }
.identity-intro h1 { margin: 0; font: 700 72px/.9 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.identity-intro > div { display: grid; gap: 10px; }
.identity-intro strong { font: 700 21px/1.15 var(--display); }
.identity-intro span { color: var(--muted); font-size: 11.5px; line-height: 1.6; max-width: 52ch; }
.identity-intro em { color: var(--chili); font-style: italic; }
.identity-section { display: grid; grid-template-columns: 180px 1fr; gap: 28px; padding: 44px 0; border-bottom: 1px solid var(--hairline); }
.identity-section > header { display: grid; grid-template-columns: 30px 1fr; align-content: start; }
.identity-section > header span { color: var(--quiet); font: 700 14px/1 var(--mono); }
.identity-section > header h2 { margin: 0; font-size: 12px; letter-spacing: .04em; }
.principle-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 52px; }
.principle-list article { min-height: 92px; padding: 14px 0; }
.principle-list b { font-size: 13px; }
.principle-list p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.type-system { grid-template-columns: 180px 1fr 1fr; }
.type-specimen > span { color: var(--muted); font-size: 9px; }
.display-specimen p { margin: 34px 0 0; font: 700 62px/.9 var(--display); letter-spacing: .02em; }
.ui-specimen p { margin: 42px 0 8px; font-size: 22px; font-weight: 640; letter-spacing: -.02em; }
.ui-specimen .mono-line { display: block; color: var(--muted); font: 500 11px/1.5 var(--mono); }
.color-rack { display: grid; grid-template-columns: repeat(5, 1fr); min-height: 180px; }
.color-rack article { padding: 14px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-right: 0; font-size: 10px; }
.color-rack article:last-child { border-right: 1px solid var(--line); }
.color-rack code { font-size: 9px; opacity: .72; }
.swatch-jet { background: var(--jet); color: var(--penny); }
.swatch-chili { background: var(--chili); color: white; }
.swatch-rosa { background: var(--rosa); color: white; }
.swatch-sol { background: var(--sol); color: var(--jet); }
.swatch-penny { background: var(--penny); }
.day-rack { display: grid; grid-template-columns: repeat(3, 1fr); }
.day-rack article { min-height: 130px; padding: 16px 12px 12px; border-right: 1px solid var(--line); display: grid; grid-template-rows: 1fr auto auto; align-items: end; }
.day-rack article:last-child { border-right: 0; }
.day-rack i { display: block; width: 100%; height: 42px; align-self: center; }
.day-rack code { font-size: 10px; }
.day-rack span { color: var(--muted); font-size: 9px; margin-top: 4px; }
.heat-scale { display: flex; align-items: center; gap: 4px; margin-top: 22px; }
.heat-step { width: 54px; height: 16px; background: var(--c); }
.heat-scale b { margin-left: 12px; font: 600 10px/1 var(--mono); letter-spacing: .08em; color: var(--muted); }
.spacing-rack, .shape-rack { display: grid; grid-template-columns: repeat(5, 1fr); }
.spacing-rack article, .shape-rack article { min-height: 148px; padding: 16px 12px 12px; border-right: 1px solid var(--line); display: grid; grid-template-rows: 1fr auto auto; align-items: end; }
.spacing-rack article:last-child, .shape-rack article:last-child { border-right: 0; }
.spacing-rack i { display: block; width: var(--size); height: var(--size); max-width: 48px; max-height: 48px; background: var(--chili); align-self: center; justify-self: center; }
.spacing-rack code, .shape-rack code { font-size: 9px; }
.spacing-rack span, .shape-rack span { color: var(--muted); font-size: 9px; margin-top: 4px; }
.shape-rack { grid-template-columns: repeat(4, 1fr); }
.shape-rack i { width: 62px; height: 62px; align-self: center; justify-self: center; background: var(--pressed); border: 1px solid var(--line); }
.shape-flap { border-radius: 0; }
.shape-tile { border-radius: 6px; }
.shape-card { border-radius: 18px; }
.shape-round { border-radius: 50%; }
.token-note { color: var(--muted); font-size: 10.5px; line-height: 1.6; margin: 20px 0 0; max-width: 62ch; }
.token-note code { color: var(--ink); }
.icon-specimens { display: flex; gap: 20px; }
.icon-specimens .icon { width: 21px; height: 21px; }
.component-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.component-board > article { padding: 16px; background: white; border: 1px solid var(--hairline); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.component-label { color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.component-board .ring::after { background: white; }
.voice-system { border-bottom: 0; }
.voice-card { padding: 20px; background: var(--jet); color: var(--penny); }
.voice-card p { margin: 0 0 12px; font: 700 21px/1.25 var(--display); }
.voice-card small { color: rgb(245 239 227 / .58); font-size: 11px; line-height: 1.55; display: block; max-width: 52ch; }

/* ── spine view ──────────────────────────────────────────── */
.spine-view { padding: 60px clamp(20px, 6vw, 96px) 96px; max-width: 1220px; margin: 0 auto; }
.spine-header { display: grid; grid-template-columns: 150px minmax(260px, 1fr) minmax(260px, 460px); gap: 28px; align-items: end; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.spine-header p { color: var(--muted); font-size: 11px; margin: 0; }
.spine-header h1 { font: 700 44px/1 var(--display); margin: 0; }
.spine-header > span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.thesis-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 12px; }
.thesis-band article { padding: 24px 20px 24px 0; border-right: 1px solid var(--hairline); padding-right: 20px; }
.thesis-band article:last-child { border-right: 0; }
.thesis-band span { display: block; color: var(--chili); font: 600 9px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.thesis-band p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.thesis-band b { color: var(--ink); }

.beats { border-top: 1px solid var(--line); }
.beat { display: grid; grid-template-columns: 180px 1fr; gap: 28px; padding: 34px 0; border-bottom: 1px solid var(--hairline); }
.beat-num { align-self: start; position: sticky; top: 88px; }
.beat-num span { display: block; font: 700 30px/1 var(--mono); color: var(--quiet); }
.beat-num b { display: block; margin-top: 6px; font: 700 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.beat-lead { margin: 0 0 16px; font-size: 14px; line-height: 1.55; max-width: 68ch; }
.ref { display: grid; grid-template-columns: 128px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--hairline); align-items: start; }
.ref-app { font: 600 10px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--rosa); }
.ref.is-reject .ref-app { color: var(--chili); }
.ref.is-split .ref-app { color: var(--sol); }
.ref.is-gap .ref-app { color: var(--muted); }
.ref p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); max-width: 72ch; }
.ref p b { color: var(--ink); }
.beat-note { margin: 16px 0 0; padding: 13px 15px; background: white; border: 1px solid var(--hairline); border-left: 3px solid var(--sol); font-size: 11.5px; line-height: 1.6; max-width: 78ch; }
.beat-fail { margin: 14px 0 0; font-size: 11px; line-height: 1.55; color: var(--muted); }
.beat-fail b { color: var(--chili); font-weight: 620; }

.gap-band { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--jet); }
.gap-band header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; }
.gap-band header span { color: var(--muted); font-size: 9px; }
.gap-band header strong { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.gap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.gap-grid article { background: white; padding: 18px 16px; }
.gap-grid b { font-size: 12px; }
.gap-grid p { margin: 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.spine-foot { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.spine-foot p { margin: 0; font-size: 12.5px; line-height: 1.6; max-width: 84ch; }
.spine-foot span { color: var(--muted); font-size: 10.5px; }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 1080px) {
  .thesis-band { grid-template-columns: 1fr 1fr; }
  .gap-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .prototype-meta { display: none; }
  .stage { padding: 18px; align-items: flex-start; }
  .phone { height: calc(100vh - 100px); max-height: 844px; }
  .map-header, .spine-header, .identity-intro { grid-template-columns: 1fr; gap: 12px; align-items: start; }
  .identity-section, .type-system { grid-template-columns: 1fr; }
  .identity-view { grid-template-columns: 150px minmax(0, 1fr); }
  .identity-content { padding-inline: 26px; }
  .spacing-rack { grid-template-columns: repeat(3, 1fr); }
  .beat { grid-template-columns: 1fr; gap: 16px; }
  .beat-num { position: static; display: flex; align-items: baseline; gap: 12px; }
  .beat-num span { font-size: 20px; }
}
@media (max-width: 620px) {
  .prototype-bar { padding: 9px 10px; flex-wrap: wrap; }
  .view-switch { width: 100%; overflow-x: auto; }
  .view-switch button { padding: 0 10px; font-size: 10.5px; }
  .stage { padding: 0; }
  .phone { width: 100%; height: calc(100vh - 100px); min-height: 600px; border: 0; border-radius: 0; }
  .screen { height: calc(100% - 76px); padding-top: 18px; }
  .map-view, .spine-view { padding: 28px 14px 60px; }
  .map-header h1, .spine-header h1 { font-size: 32px; }
  .identity-view { display: block; }
  .identity-subnav { position: sticky; top: 104px; height: auto; padding: 7px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; z-index: 10; background: var(--surface); }
  .identity-subnav > span { display: none; }
  .identity-subnav nav { display: flex; width: max-content; }
  .identity-content { padding: 34px 16px 64px; }
  .identity-intro h1 { font-size: 54px; }
  .principle-list, .component-board, .thesis-band, .gap-grid { grid-template-columns: 1fr; }
  .thesis-band article { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 18px 0; }
  .color-rack { grid-template-columns: 1fr 1fr; }
  .color-rack article { min-height: 108px; border-right: 1px solid var(--line); }
  .spacing-rack, .shape-rack, .day-rack { grid-template-columns: 1fr 1fr; }
  .ref { grid-template-columns: 1fr; gap: 6px; }
  .state-head { display: none; }
  .state-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ── motion ──────────────────────────────────────────────── */
.screen.entering { animation: screen-in 280ms var(--ease); }
@keyframes screen-in { from { opacity: 0; transform: translateY(7px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes flap-in { from { opacity: 0; transform: rotateX(-88deg); transform-origin: top; } to { opacity: 1; transform: none; } }
@keyframes clatter {
  0% { opacity: 0; transform: rotateX(-80deg); transform-origin: top; }
  55% { opacity: 1; transform: rotateX(12deg); }
  80% { transform: rotateX(-5deg); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
