/* Solo Ascent v2 — a living scene, not a dashboard. */
:root {
  --bg: #05060c; --ink: #eef0f8; --mute: rgba(226, 230, 245, .62); --faint: rgba(226, 230, 245, .38);
  --line: rgba(255, 255, 255, .12); --glass: rgba(8, 10, 20, .62); --gold: #f0c45a; --danger: #ff7686;
  --acc: #6f9bff; --acc2: #2b4fd6;
  --rail: 64px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --vh: 100vh;
}
@supports (height: 100dvh) { :root { --vh: 100dvh; } }
[data-accent="surge"], .p-surge { --acc: #6f9bff; --acc2: #2142c8; }
[data-accent="rai"], .p-rai { --acc: #f2c14e; --acc2: #a8741a; }
[data-accent="oro"], .p-oro { --acc: #d9b98a; --acc2: #7a5a33; }
[data-accent="hex"], .p-hex { --acc: #b993ff; --acc2: #6a3fd1; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow: hidden;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app { position: relative; max-width: 520px; height: var(--vh); margin: 0 auto; overflow: hidden; isolation: isolate; background: #000; }

/* ---------- Stage ---------- */
.stage { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.layer.in { opacity: 1; }
.layer.out { opacity: 0; }
.frame { position: absolute; top: 0; left: 50%; width: max(100%, calc(var(--vh) * .75)); aspect-ratio: 3 / 4; transform: translateX(-50%); }
.kb { position: absolute; inset: 0; transform-origin: 50% 30%; animation: breathe 22s ease-in-out infinite alternate; will-change: transform; }
.kb img { width: 100%; height: 100%; object-fit: cover; }
@keyframes breathe { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.09) translate3d(-1.2%, 1%, 0); } }
.fx { position: absolute; pointer-events: none; mix-blend-mode: screen; will-change: opacity, transform; }

/* Hex: lantern pulse at the lantern in the art */
.p-hex .fx-a { left: 66.5%; top: 48%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(120, 255, 200, .55) 0, rgba(80, 220, 180, .22) 30%, transparent 62%); animation: lantern 3.4s ease-in-out infinite; }
.p-hex .fx-b { inset: 0; background: radial-gradient(60% 40% at 66% 48%, rgba(185, 147, 255, .18), transparent 70%); animation: glow 7s ease-in-out infinite alternate; }
@keyframes lantern { 0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(.92); } 45% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 60% { opacity: .8; } }
/* Surge: cold aura flicker at the edges */
.p-surge .fx-a { inset: 10% -10% 20%; background: radial-gradient(30% 50% at 12% 55%, rgba(90, 170, 255, .30), transparent 70%), radial-gradient(30% 50% at 88% 55%, rgba(90, 170, 255, .30), transparent 70%); animation: flicker 4.6s ease-in-out infinite; }
.p-surge .fx-b { inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(40, 90, 255, .12)); animation: glow 9s ease-in-out infinite alternate; }
@keyframes flicker { 0%, 100% { opacity: .45; } 20% { opacity: .9; } 24% { opacity: .55; } 50% { opacity: .85; } 70% { opacity: .5; } }
/* Rai: warm aura swelling behind the shoulders */
.p-rai .fx-a { left: 50%; top: 52%; width: 120%; aspect-ratio: 1.2; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255, 196, 80, .26), transparent 75%); animation: swell 3.8s ease-in-out infinite; }
.p-rai .fx-b { inset: 0; background: linear-gradient(0deg, rgba(255, 170, 60, .10), transparent 40%); animation: glow 6s ease-in-out infinite alternate; }
@keyframes swell { 0%, 100% { opacity: .5; transform: translate(-50%, -50%) scale(.95); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } }
/* Oro: mountain mist drifting */
.p-oro .fx-a { left: -40%; right: -40%; top: 30%; height: 40%; background: radial-gradient(40% 60% at 30% 50%, rgba(200, 210, 230, .16), transparent 70%), radial-gradient(35% 50% at 75% 40%, rgba(200, 210, 230, .12), transparent 70%); animation: mist 26s ease-in-out infinite alternate; }
.p-oro .fx-b { inset: 0; background: radial-gradient(50% 30% at 50% 20%, rgba(240, 200, 140, .08), transparent 70%); animation: glow 10s ease-in-out infinite alternate; }
@keyframes mist { from { transform: translate3d(-8%, 0, 0); } to { transform: translate3d(8%, -3%, 0); } }
@keyframes glow { from { opacity: .4; } to { opacity: 1; } }

/* Team slats (first run) */
.slats { position: absolute; inset: 0 0 34% 0; display: flex; gap: 3px; }
.slat { flex: 1; overflow: hidden; position: relative; }
.slat img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; animation: rise 1.6s cubic-bezier(.2, .7, .2, 1) both; }
.slat:nth-child(2) img { animation-delay: .15s; } .slat:nth-child(3) img { animation-delay: .3s; } .slat:nth-child(4) img { animation-delay: .45s; }
.slat::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -2px 0 var(--acc); opacity: .7; }
@keyframes rise { from { opacity: 0; transform: translateY(6%) scale(1.06); } to { opacity: 1; transform: none; } }

.veil { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 6, 12, .7) 0, rgba(5, 6, 12, 0) 14%, rgba(5, 6, 12, 0) 36%, rgba(5, 6, 12, .72) 58%, rgba(5, 6, 12, .96) 80%, #05060c 100%); }
.app.has-sheet .veil { background: rgba(5, 6, 12, .55); transition: background .4s; }
.motes { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.motes i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 8px var(--acc); opacity: 0; animation: mote 14s linear infinite; }
.motes i:nth-child(1) { left: 12%; animation-delay: 0s; } .motes i:nth-child(2) { left: 28%; animation-delay: 4s; animation-duration: 18s; }
.motes i:nth-child(3) { left: 47%; animation-delay: 8s; } .motes i:nth-child(4) { left: 63%; animation-delay: 2s; animation-duration: 16s; }
.motes i:nth-child(5) { left: 78%; animation-delay: 6s; } .motes i:nth-child(6) { left: 90%; animation-delay: 11s; animation-duration: 20s; }
.motes i:nth-child(7) { left: 36%; animation-delay: 13s; animation-duration: 17s; }
@keyframes mote { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 10% { opacity: .8; } 70% { opacity: .5; } 100% { transform: translate3d(14px, calc(var(--vh) * -0.8), 0); opacity: 0; } }

/* ---------- Quiet chrome ---------- */
.hud { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(6px + var(--safe-t)) 8px 0 16px; }
.clock { font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: var(--mute); display: flex; align-items: center; gap: 8px; }
.clock i { width: 4px; height: 4px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 6px var(--acc); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--mute); border-radius: 50%; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.icon-btn:active { background: rgba(255, 255, 255, .08); }
.in-setup .hud, .in-setup .alt, .in-setup .rail { display: none; }

.alt { position: absolute; z-index: 3; left: 10px; top: calc(56px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; padding: 6px 4px; min-width: 44px; }
.alt-lv { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.alt-lv small { font-size: .52rem; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); }
.alt-lv b { font-size: 1.5rem; font-weight: 300; color: var(--ink); text-shadow: 0 0 14px var(--acc); margin-top: 2px; }
.alt-rails { display: flex; gap: 6px; height: calc(var(--vh) * .2); }
.alt-rail { position: relative; width: 2px; height: 100%; background: rgba(255, 255, 255, .14); }
.alt-rail i { position: absolute; left: 0; bottom: 0; width: 100%; height: 0; transition: height 1s cubic-bezier(.2, .7, .2, 1); }
.alt-rail i::after { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; }
.alt-rail.acc i { background: var(--acc); box-shadow: 0 0 8px var(--acc); } .alt-rail.acc i::after { background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.alt-rail.gold i { background: var(--gold); } .alt-rail.gold i::after { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.alt-goal { font-size: .78rem; color: var(--gold); text-align: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.alt-goal small { display: block; font-size: .5rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin-top: 2px; }

/* ---------- Dialogue (the character speaks first) ---------- */
.dialogue { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(var(--rail) + var(--safe-b)); padding: 0 18px 10px; outline: none; max-height: calc(var(--vh) - var(--rail) - 120px); overflow-y: auto; scrollbar-width: none; }
.dialogue::-webkit-scrollbar { display: none; }
.in-setup .dialogue { bottom: 0; padding-bottom: calc(18px + var(--safe-b)); max-height: calc(var(--vh) - 40px); }
.who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; }
.who b { font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--acc); font-weight: 700; text-shadow: 0 0 12px color-mix(in srgb, var(--acc) 50%, transparent); }
.who span { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.who em { font-style: normal; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bg); background: var(--acc); padding: 2px 7px; border-radius: 2px; }
.line { margin: 0 0 14px; font-size: 1.22rem; line-height: 1.4; font-weight: 400; letter-spacing: .005em; text-shadow: 0 2px 18px rgba(0, 0, 0, .9); overflow-wrap: anywhere; }
.line.long { font-size: 1.08rem; }
.line.speak .w { display: inline-block; opacity: 0; transform: translateY(4px); filter: blur(3px); animation: word .5s ease forwards; }
@keyframes word { to { opacity: 1; transform: none; filter: none; } }
.line.has-q { font-family: ui-serif, "Iowan Old Style", Georgia, serif; }

.opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { position: relative; min-height: 46px; padding: 0 14px 0 26px; text-align: left; border: 1px solid var(--line); border-radius: 3px; background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--ink); font-size: .95rem; cursor: pointer; transition: border-color .2s, background .2s; }
.opt::before { content: ""; position: absolute; left: 11px; top: 50%; width: 6px; height: 6px; transform: translateY(-50%) rotate(45deg); border: 1px solid var(--acc); }
.opt.primary { border-color: color-mix(in srgb, var(--acc) 70%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 22%, rgba(8, 10, 20, .7)), rgba(8, 10, 20, .6)); }
.opt.primary::before { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.opt:active { background: color-mix(in srgb, var(--acc) 30%, rgba(8, 10, 20, .7)); }
.opt:focus-visible, .chip:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ---------- Rail: part of the world, three things ---------- */
.rail { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: calc(var(--rail) + var(--safe-b)); padding: 0 8px var(--safe-b) 10px; display: flex; align-items: center; gap: 8px; }
.rail::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--acc) 45%, transparent), transparent); }
.rail-team { display: flex; align-items: center; min-height: 48px; padding: 0 4px; text-decoration: none; }
.rail-team img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; margin-left: -9px; border: 1.5px solid #05060c; filter: grayscale(.7) brightness(.7); }
.rail-team img:first-child { margin-left: 0; }
.rail-team img.on { filter: none; border-color: var(--acc); box-shadow: 0 0 10px var(--acc); position: relative; z-index: 1; transform: scale(1.12); }
.rail-talk { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; text-decoration: none; color: var(--mute); border-bottom: 1px solid var(--line); font-size: .92rem; }
.rail-talk span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-talk svg, .rail-trail svg { width: 22px; height: 22px; fill: none; stroke: var(--acc); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rail-trail { width: 48px; height: 48px; display: grid; place-items: center; flex: none; border-radius: 50%; }
.rail-trail:active, .rail-team:active { background: rgba(255, 255, 255, .06); }

/* ---------- Sheets over the scene ---------- */
.scrim { position: absolute; inset: 0; z-index: 4; }
.sheet { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; max-height: calc(var(--vh) * .86); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 18px calc(22px + var(--safe-b)); background: linear-gradient(180deg, rgba(10, 12, 24, .9), rgba(6, 7, 14, .97) 120px); border-top: 1px solid color-mix(in srgb, var(--acc) 40%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: sheetIn .35s cubic-bezier(.2, .8, .2, 1); }
.sheet::before { content: ""; display: block; width: 36px; height: 3px; margin: 4px auto 6px; border-radius: 2px; background: rgba(255, 255, 255, .2); }
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.app.has-sheet .dialogue, .app.has-sheet .alt { opacity: 0; pointer-events: none; transition: opacity .25s; }
.sh-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.sh-head img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--acc); }
.sh-head div { flex: 1; min-width: 0; }
.sh-head h2 { margin: 0; font-size: .82rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 700; }
.sh-head span { font-size: .78rem; color: var(--mute); }
.x { width: 44px; height: 44px; display: grid; place-items: center; text-decoration: none; color: var(--mute); border-radius: 50%; flex: none; margin-right: -8px; }
.x:active { background: rgba(255, 255, 255, .08); }

.form { display: flex; flex-direction: column; gap: 10px; }
.form.inline { flex-direction: row; }
.form.inline input { flex: 1; }
.form.inline .btn { width: auto; flex: none; }
.lbl { font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); margin-top: 4px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); min-width: 0; }
.fld > span i { font-style: normal; color: var(--faint); letter-spacing: .1em; margin-left: 4px; text-transform: lowercase; }
input, textarea { font: inherit; letter-spacing: normal; text-transform: none; color: var(--ink); background: rgba(255, 255, 255, .04); border: 0; border-bottom: 1px solid rgba(255, 255, 255, .22); border-radius: 0; padding: 10px 2px; min-height: 46px; width: 100%; min-width: 0; }
textarea { resize: vertical; border: 1px solid rgba(255, 255, 255, .14); padding: 12px; border-radius: 3px; line-height: 1.5; }
input:focus, textarea:focus { outline: none; border-color: var(--acc); background: rgba(255, 255, 255, .06); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=date] { color-scheme: dark; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 > * { min-width: 0; }
.hint { color: var(--mute); font-size: .8rem; margin: 2px 0; }
.empty { color: var(--mute); font-size: .9rem; margin: 14px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 3px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--ink); font-weight: 600; letter-spacing: .04em; cursor: pointer; text-decoration: none; width: 100%; }
.btn.primary { border-color: transparent; color: #fff; background: linear-gradient(90deg, var(--acc2), color-mix(in srgb, var(--acc) 80%, var(--acc2))); box-shadow: 0 0 22px -6px var(--acc); }
[data-accent="rai"] .btn.primary, [data-accent="oro"] .btn.primary { color: #120d05; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(255, 118, 134, .35); }
.btn:active { transform: scale(.985); }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sect { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sheet > .btn { margin: 12px 0 4px; }

.chips { display: flex; gap: 6px; }
.chips.wrap { flex-wrap: wrap; }
.chip { flex: 1 1 0; min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 3px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink); font-size: .9rem; cursor: pointer; white-space: nowrap; }
.chips.wrap .chip { flex: 0 1 auto; }
.chip.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 24%, transparent); box-shadow: inset 0 -2px 0 var(--acc); }
.chips.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.chips.grid4 .chip { padding: 0 2px; font-size: .84rem; }
.chips.effort .chip { padding: 0 2px; font-size: .76rem; }
.scale-lbl { display: flex; justify-content: space-between; font-size: .7rem; color: var(--faint); margin-top: -4px; }

.ridge { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 18px 0 4px; text-align: center; }
.ridge.wide { grid-template-columns: repeat(14, 1fr); gap: 2px; }
.rd i { display: block; height: 22px; margin: 0 auto 4px; width: 100%; max-width: 26px; border-bottom: 2px solid rgba(255, 255, 255, .14); }
.rd small { font-size: .6rem; color: var(--faint); letter-spacing: .05em; }
.rd.trained i { height: 34px; background: linear-gradient(0deg, color-mix(in srgb, var(--acc) 70%, transparent), transparent); border-color: var(--acc); }
.rd.rest i { height: 26px; background: linear-gradient(0deg, rgba(150, 160, 210, .35), transparent); border-color: #8a94c8; }
.rd.skipped i { border-color: var(--danger); }
.rd.notyet i { border-bottom-style: dashed; border-color: var(--mute); }
.ridge { align-items: end; }

/* Weigh-in big number */
.big-num .numwrap { display: flex; align-items: baseline; gap: 8px; }
.big-num input { font-size: 2.4rem; font-weight: 300; padding: 4px 2px; text-align: left; font-variant-numeric: tabular-nums; }
.big-num b { font-size: 1rem; color: var(--mute); text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Reflect */
.cats { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: -4px 0 10px; }
.cat { min-height: 40px; padding: 0 10px; border: 0; background: none; color: var(--mute); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; border-bottom: 1px solid transparent; }
.cat.on { color: var(--acc); border-color: var(--acc); }
.prompt { display: flex; gap: 8px; align-items: flex-start; }
.prompt p { flex: 1; margin: 0 0 6px; font-family: ui-serif, "Iowan Old Style", Georgia, serif; font-size: 1.28rem; line-height: 1.35; font-style: italic; }
.ghost-btn { width: 44px; height: 44px; flex: none; border: 1px solid var(--line); background: none; border-radius: 50%; font-size: 1.1rem; cursor: pointer; color: var(--acc); }

/* Talk: the scene stays visible above the transcript */
.sheet.s-talk { top: calc(var(--vh) * .3); max-height: none; display: flex; flex-direction: column; overflow: hidden; padding-bottom: calc(10px + var(--safe-b)); background: linear-gradient(180deg, rgba(5, 6, 12, .25), rgba(5, 6, 12, .9) 90px, rgba(5, 6, 12, .97)); border-top: 0; }
.sheet.s-talk::before { display: none; }
.app.sheet-talk .veil { background: linear-gradient(180deg, rgba(5, 6, 12, .55), transparent 18%, transparent 26%, rgba(5, 6, 12, .9) 46%); }
.talk-head { margin: 0 0 4px; }
.talk-head h2 { color: var(--acc); }
.msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding: 6px 0 10px; scrollbar-width: none; }
.msgs::-webkit-scrollbar { display: none; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { padding-left: 12px; border-left: 2px solid var(--acc); max-width: 94%; }
.msg.them b { display: block; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--acc); margin-bottom: 2px; }
.msg.them p { font-size: 1.02rem; line-height: 1.45; }
.msg.me { align-self: flex-end; max-width: 82%; text-align: right; }
.msg.me p { color: var(--mute); font-style: italic; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; flex: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { flex: none; font-size: .84rem; border-radius: 22px; }
.composer { display: flex; gap: 8px; align-items: center; flex: none; }
.composer input { flex: 1; }
.send { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--acc); background: color-mix(in srgb, var(--acc) 22%, transparent); display: grid; place-items: center; cursor: pointer; flex: none; }
.send svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fine { margin: 6px 0 0; font-size: .66rem; color: var(--faint); text-align: center; flex: none; }

/* Team select: four slivers of light, the focused one opens */
.sheet.s-team { top: calc(50px + var(--safe-t)); max-height: none; background: linear-gradient(180deg, rgba(5, 6, 12, .6), rgba(5, 6, 12, .96) 50%); border-top: 0; }
.sheet.s-team::before { display: none; }
.sh-head.bare { margin-bottom: 10px; }
.select { display: flex; gap: 4px; height: calc(var(--vh) * .44); min-height: 220px; }
.sel { position: relative; flex: 1 1 0; min-width: 44px; padding: 0; border: 0; overflow: hidden; cursor: pointer; background: #000; transition: flex-grow .55s cubic-bezier(.2, .8, .2, 1); border-radius: 2px; }
.sel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; filter: grayscale(.6) brightness(.55); transition: filter .5s; }
.sel span { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%) rotate(180deg); writing-mode: vertical-rl; font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 6px #000; white-space: nowrap; }
.sel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--acc); opacity: .5; }
.sel.on { flex-grow: 5; }
.sel.on img { filter: none; }
.sel.on span { display: none; }
.sel.on::after { opacity: 1; box-shadow: 0 0 14px var(--acc); }
.sel.lead::before { content: ""; position: absolute; z-index: 1; top: 8px; left: 50%; width: 6px; height: 6px; transform: translateX(-50%) rotate(45deg); background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.sel-info { padding: 14px 2px 0; }
.sel-info b { font-size: 1.05rem; letter-spacing: .28em; text-transform: uppercase; color: var(--acc); }
.sel-info .role { display: block; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.sel-info p { margin: 8px 0; color: var(--mute); }
.sel-info p.tag { color: var(--ink); font-family: ui-serif, Georgia, serif; font-style: italic; }
.sel-info .leading { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--acc); }

/* Trail */
.asc { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; margin-bottom: 14px; }
.asc > div:first-child { display: flex; flex-direction: column; line-height: 1; }
.asc small { font-size: .55rem; letter-spacing: .24em; text-transform: uppercase; color: var(--mute); }
.asc b { font-size: 2rem; font-weight: 300; text-shadow: 0 0 14px var(--acc); }
.asc-bar, .gbar { height: 2px; background: rgba(255, 255, 255, .14); position: relative; }
.asc-bar i, .gbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--acc); box-shadow: 0 0 10px var(--acc); transition: width 1s; }
.gbar { margin: 10px 0 6px; } .gbar i { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.asc p { grid-column: 1 / -1; margin: 6px 0 0; font-size: .76rem; color: var(--mute); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.seg button { min-height: 44px; border: 0; background: none; color: var(--mute); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg button.on { color: var(--ink); border-color: var(--acc); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 12px 0 0; }
.trio b { display: block; font-size: 1.5rem; font-weight: 300; }
.trio span { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.bignum { font-size: 2.4rem; font-weight: 300; margin-top: 8px; font-variant-numeric: tabular-nums; }
.bignum small { font-size: .9rem; color: var(--mute); margin-left: 6px; }
.scale { display: flex; justify-content: space-between; font-size: .74rem; color: var(--mute); }
.chart { width: 100%; height: auto; margin: 10px 0 0; }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.chart circle { fill: var(--gold); }
.chart .goal { stroke: var(--acc); stroke-dasharray: 3 5; stroke-width: 1.2; }
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.list li > div { flex: 1; min-width: 0; }
.list b { display: block; font-weight: 600; }
.list span { font-size: .82rem; color: var(--mute); }
.list em { display: block; font-size: .84rem; color: var(--mute); overflow-wrap: anywhere; }
.list.refl b { font-family: ui-serif, Georgia, serif; font-style: italic; font-weight: 400; margin-top: 2px; }
.list.refl p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tagline { font-size: .64rem !important; letter-spacing: .18em; text-transform: uppercase; color: var(--acc) !important; }
.del { flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--faint); cursor: pointer; border-radius: 50%; }
.del:active { background: rgba(255, 255, 255, .08); }

/* ---------- First run ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 2px; background: rgba(255, 255, 255, .14); }
.steps i.on { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.in-setup .form { margin-top: 2px; }
.in-setup .hint { margin-top: 8px; }
.pickrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pk { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border: 0; background: none; cursor: pointer; min-height: 44px; }
.pk img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(255, 255, 255, .2); filter: grayscale(.6) brightness(.7); transition: filter .3s, box-shadow .3s; }
.pk span { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.pk.on img { filter: none; border-color: var(--acc); box-shadow: 0 0 16px var(--acc); }
.pk.on span { color: var(--acc); }
.pk-blurb { margin: 2px 0 4px; font-size: .88rem; color: var(--mute); min-height: 2.6em; }

/* ---------- Ascent moment ---------- */
.flash { position: absolute; inset: 0; z-index: 8; pointer-events: none; display: grid; place-items: center; }
.flash .beam { position: absolute; left: 50%; bottom: 0; width: 2px; height: 100%; transform: translateX(-50%) scaleY(0); transform-origin: bottom; background: linear-gradient(0deg, transparent, var(--acc), #fff); box-shadow: 0 0 24px 6px var(--acc); }
.flash.go .beam { animation: beam 2.8s cubic-bezier(.2, .8, .2, 1) forwards; }
.fl-txt { position: relative; text-align: center; opacity: 0; padding: 20px 28px; background: radial-gradient(closest-side, rgba(5, 6, 12, .85), transparent); }
.flash.go .fl-txt { animation: fltxt 2.8s ease forwards; }
.fl-txt small { display: block; font-size: .72rem; letter-spacing: .5em; text-transform: uppercase; color: var(--acc); }
.fl-txt b { display: block; font-size: 4.2rem; font-weight: 200; line-height: 1; text-shadow: 0 0 30px var(--acc); }
.fl-txt span { font-size: .82rem; color: var(--mute); }
@keyframes beam { 0% { transform: translateX(-50%) scaleY(0); opacity: 1; } 40% { transform: translateX(-50%) scaleY(1); opacity: 1; } 100% { transform: translateX(-50%) scaleY(1); opacity: 0; } }
@keyframes fltxt { 0%, 20% { opacity: 0; transform: translateY(12px); } 40%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.toast { position: absolute; z-index: 9; left: 50%; transform: translateX(-50%); bottom: calc(var(--rail) + var(--safe-b) + 12px); width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; font-size: .88rem; background: rgba(10, 12, 24, .95); border: 1px solid var(--acc); border-radius: 3px; }
.in-setup .toast { bottom: calc(20px + var(--safe-b)); top: auto; }

@media (max-width: 370px) {
  .dialogue { padding-left: 14px; padding-right: 14px; }
  .line { font-size: 1.12rem; }
  .line.long { font-size: 1rem; }
  .opt { font-size: .9rem; padding-left: 24px; }
  .sheet { padding-left: 14px; padding-right: 14px; }
  .chips.effort .chip { font-size: .7rem; }
  .rail-talk { padding: 0 8px; font-size: .86rem; }
}
@media (max-height: 700px) {
  .alt-rails { height: calc(var(--vh) * .14); }
  .line { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .line.speak .w { opacity: 1; transform: none; filter: none; }
}

/* v2 polish */
.alt { align-items: flex-start; left: 14px; }
.alt-lv { align-items: flex-start; }
.alt-rails { margin-left: 3px; }
.alt-goal { text-align: left; }
.q { margin: -4px 0 14px; padding-left: 12px; border-left: 2px solid var(--acc); font-family: ui-serif, "Iowan Old Style", Georgia, serif; font-style: italic; font-size: 1.18rem; line-height: 1.35; text-shadow: 0 2px 14px rgba(0, 0, 0, .9); }
.q small { display: block; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-style: normal; font-size: .6rem; letter-spacing: .26em; text-transform: uppercase; color: var(--acc); margin-bottom: 4px; }
.q.rise { animation: qrise .8s ease .5s both; }
@keyframes qrise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.opts.three { grid-template-columns: 1fr 1fr; }
.opts.three .opt:first-child { grid-column: 1 / -1; }
.select { height: calc(var(--vh) * .52); }
@media (max-width: 370px) { .q { font-size: 1.06rem; } }

/* ---------- v3: tap-first controls, streak, badges, recap, Why today ---------- */
.tint { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.lbl i { font-style: normal; color: var(--faint); letter-spacing: .1em; text-transform: lowercase; margin-left: 4px; }

/* Streak on the quiet meter */
.alt-streak { display: flex; flex-direction: column; align-items: flex-start; font-size: .82rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 2px; }
.alt-streak i { display: block; width: 6px; height: 6px; margin: 0 0 5px 1px; transform: rotate(45deg); border: 1px solid var(--acc); }
.alt-streak.lit i { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.alt-streak small { display: block; font-size: .5rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin-top: 3px; }

/* Why today */
.who { align-items: center; }
.why-btn { margin-left: auto; min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: rgba(8, 10, 20, .55); color: var(--mute); font-size: .72rem; letter-spacing: .08em; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.why-btn.on { color: var(--ink); border-color: var(--acc); }
.opts.two .opt { min-width: 0; }

/* Steppers: move a number with taps instead of typing it */
.stepper { display: flex; align-items: stretch; gap: 6px; }
.st-b { flex: none; width: 44px; min-height: 52px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255, 255, 255, .04); color: var(--ink); font-size: .86rem; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0; }
.st-b.big { width: 48px; font-weight: 600; }
.st-b:active { background: color-mix(in srgb, var(--acc) 26%, transparent); }
.st-v, .st-in { flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: baseline; justify-content: center; gap: 6px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); background: none; color: var(--ink); cursor: text; padding: 6px 2px 0; }
.st-v b { font-size: 1.9rem; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.2; }
.st-v small { font-size: .82rem; color: var(--mute); }
.st-in { font-size: 1.6rem; text-align: center; display: block; }
.minrow { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: -2px; }
.minrow .st-b { min-height: 40px; }
.minv { min-width: 84px; text-align: center; color: var(--mute); font-size: .9rem; }
.minv b { font-size: 1.3rem; font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.chips.mins { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.chips.mins .chip { padding: 0; min-width: 40px; font-variant-numeric: tabular-nums; }

/* Date: today by default, earlier/later with a tap */
.datectl { display: flex; align-items: center; gap: 8px; }
.dc-b { width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--ink); font-size: 1.3rem; cursor: pointer; }
.dc-b:disabled { opacity: .3; cursor: default; }
.dc-v { flex: 1; text-align: center; font-size: .95rem; }

/* Optional words stay behind a tap */
.addnote { align-self: flex-start; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--acc); font-size: .86rem; cursor: pointer; }
.reveal { display: flex; flex-direction: column; gap: 6px; }
.reveal textarea { min-height: 0; }
.chips.tags .chip, .chips.why .chip { flex: 0 1 auto; border-radius: 22px; font-size: .84rem; }
.chips.why .chip[data-val="__skip"] { color: var(--mute); border-style: dashed; }

/* Reflection answers: tap the closest one */
.chips.choices { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.chips.choices .chip { text-align: left; white-space: normal; padding: 10px 14px; min-height: 46px; line-height: 1.3; font-size: .95rem; }

/* Trail: four tabs, noticed patterns, badges */
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.four button { letter-spacing: .08em; font-size: .7rem; padding: 0 2px; }
.streak-note { margin-top: 8px; }
.noticed { margin: 12px 0 4px; padding: 10px 12px; border-left: 2px solid var(--acc); background: rgba(255, 255, 255, .03); }
.noticed ul { margin: 6px 0 0; padding: 0 0 0 16px; }
.noticed li { font-size: .88rem; color: var(--ink); margin: 3px 0; }
.badges { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.bd { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255, 255, 255, .03); }
.bd > i { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-style: normal; color: var(--acc); border: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); border-radius: 50%; box-shadow: 0 0 12px -4px var(--acc); }
.bd div { min-width: 0; }
.bd b { display: block; font-size: .95rem; }
.bd span { display: block; font-size: .8rem; color: var(--mute); }
.bd small { display: block; font-size: .68rem; color: var(--faint); margin-top: 2px; letter-spacing: .06em; }
.badges.locked .bd { opacity: .5; border-style: dashed; }
.badges.locked .bd > i { color: var(--faint); border-color: var(--line); box-shadow: none; }

/* Celebrations: streak milestones and badges, same spirit as the Ascent moment */
.fl-txt em { display: block; font-style: normal; font-size: 1.1rem; margin: 4px 0 2px; color: var(--ink); }
.fl-badge i { display: block; font-style: normal; font-size: 2.6rem; line-height: 1.1; color: var(--acc); text-shadow: 0 0 24px var(--acc); margin: 6px 0 2px; }
.fl-txt span { display: block; max-width: 260px; margin: 0 auto; }

/* Weekly recap: the team speaks in turn */
.recap-intro { margin: 0 0 10px; font-family: ui-serif, Georgia, serif; font-size: 1.1rem; line-height: 1.35; }
.beats { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.beat { display: flex; gap: 10px; align-items: flex-start; }
.beat img { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--acc); }
.beat div { min-width: 0; padding-left: 10px; border-left: 2px solid var(--acc); }
.beat b { display: block; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--acc); }
.beat p { margin: 2px 0 0; font-size: .98rem; line-height: 1.4; }

/* Customize sheet */
.s-customize .pk-blurb b { color: var(--acc); font-weight: 600; }
.premium-later .locked input:disabled { opacity: .7; }
.premium-later .chip:disabled, .premium-later .btn:disabled { cursor: not-allowed; }

@media (max-width: 370px) {
  .st-b { width: 40px; font-size: .8rem; }
  .st-b.big { width: 44px; }
  .st-v b { font-size: 1.6rem; }
  .chips.mins { gap: 3px; }
  .chips.mins .chip { font-size: .82rem; }
  .why-btn { padding: 0 10px; font-size: .68rem; }
}

/* v3.1: time window card, Sources, locked core */
.tf-card { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: rgba(10,14,24,.62); border: 1px solid rgba(255,255,255,.12); }
.tf-card small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .72; }
.tf-card b { display: block; margin: 2px 0 6px; font-size: 16px; }
.tf-card ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }
.tf-card li + li { margin-top: 2px; }
.src { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.src li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); }
.src li b { display: block; font-size: 15px; }
.src li small { display: block; font-size: 12px; opacity: .7; }
.src-st { flex: none; font-size: 12px; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); opacity: .8; }
.src-st.on { border-color: currentColor; opacity: 1; }
.core-lock { margin: 4px 0 10px; font-style: italic; opacity: .85; }
.core-lock small { display: block; font-style: normal; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
/* v3.1: nutrition (nutrition.js markup) */
.nut-sec { display: grid; gap: 8px; margin-top: 6px; }
.nut-sec .chips.wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.nut-meals { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nut-meals li { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); }
.nut-meals li b { display: block; font-size: 14px; }
.nut-meals li span { font-size: 12px; opacity: .72; }
.nut-disc { padding: 8px 10px; border-left: 3px solid currentColor; background: rgba(255,255,255,.05); border-radius: 6px; opacity: 1 !important; }
.nut-src summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 600; }
.nut-src ol { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.45; display: grid; gap: 8px; }
.nut-src a { display: inline-block; min-height: 40px; line-height: 40px; }

/* Talk: newest reply rises in like the projection just said it. */
.msg.them.fresh { animation: msg-in .45s ease-out both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg.them.fresh { animation: none; } }
/* Sources: read-only Tredict import + a plain readout (not medical). */
.src-st.ro { border-color: rgba(224, 176, 74, .7); color: #e8c77a; opacity: 1; white-space: nowrap; }
.rec-card { margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.03); }
.rec-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 6px 0 4px; text-align: center; }
.rec-row b { display: block; font-size: 1.15rem; }
.rec-row span { display: block; font-size: 11px; opacity: .75; line-height: 1.2; }
.chips.race { margin-top: 6px; }
