/* Utter styles. Values follow the design file (design/Utter App v2.dc.html); tokens are in tokens.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--text); font-family: var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); }
a:hover { color: var(--pink); }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
*::-webkit-scrollbar { display: none; }
i[class^="ph"] { line-height: 1; }
.num { font-variant-numeric: tabular-nums; }
.display, .h1 { font-family: var(--font-display); letter-spacing: -0.03em; font-weight: 500; line-height: 1.02; }
.h1 { font-size: 40px; text-wrap: balance; }
.c { text-align: center; }
.sub { color: var(--muted); font-size: 17px; line-height: 1.45; }
.note { color: var(--muted); font-size: 14px; line-height: 1.45; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kicker.accent { color: var(--accent); }
.italic { font-family: var(--font-display); font-style: italic; letter-spacing: -0.02em; }
.rule { height: 1.5px; background: var(--line); flex: none; }

/* ---------- brand ---------- */
.logo { display: flex; align-items: center; gap: 14px; }
.logo-mark { display: inline-block; flex: none; }
.wordmark { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.05em; font-size: 68px; line-height: 1; color: var(--text); }

/* ---------- stage: story | phone | engine ---------- */
.stage { zoom: var(--zoom, 1); min-height: calc(100vh / var(--zoom, 1)); display: grid; grid-template-columns: 372px auto 430px; gap: 56px; align-items: center; justify-content: center; padding: 20px 28px; }
.story, .engine { height: calc(var(--phone-h) + 24px); display: flex; flex-direction: column; min-height: 0; }
.story { gap: 22px; padding: 4px 0; }
.story .lead { font-size: 17px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.story .foot { margin-top: auto; font-size: 13px; line-height: 1.5; color: var(--muted); opacity: .75; }

.device { padding: 12px; border-radius: 66px; background: #050505; box-shadow: 0 0 0 1.5px #2a2826, 0 40px 80px rgba(0,0,0,.6); flex: none; }
.phone { position: relative; width: var(--phone-w); height: var(--phone-h); border-radius: 54px; overflow: hidden; background: var(--bg); --top: 60px; }
.statusbar { position: absolute; top: 0; left: 0; right: 0; height: 54px; padding: 0 32px 0 38px; display: flex; align-items: center; justify-content: space-between; z-index: 10; pointer-events: none; font-size: 16px; font-weight: 600; color: var(--status, var(--text)); }
.statusbar .icons { display: flex; gap: 6px; align-items: center; font-size: 17px; }
.notch { position: absolute; top: 11px; left: 50%; margin-left: -62px; width: 124px; height: 36px; border-radius: 18px; background: #050505; z-index: 11; }
.homebar { position: absolute; bottom: 8px; left: 50%; margin-left: -67px; width: 134px; height: 5px; border-radius: 3px; background: var(--status, var(--text)); z-index: 11; pointer-events: none; }
#view { position: absolute; inset: 0; }
#view > .below, #view > .page, #view > .speak { animation: screen-in .3s ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- hero: Blub ---------- */
.hero { position: absolute; left: 0; right: 0; top: 0; height: var(--hero-h); background: var(--pale); border-radius: 0 0 44px 44px; overflow: hidden; transition: background .6s ease; }
.hero .blub { position: absolute; width: 500px; height: 500px; left: 50%; top: calc(var(--hero-h) - 254px); margin-left: -250px; transform: scale(var(--pulse, 1)); transform-origin: 50% 25%; transition: transform .12s linear; }
.hero .blub .m-body { transition: fill .6s ease; }
.hero .face { position: absolute; left: 50%; top: calc(var(--hero-h) - 222px); margin-left: -120px; width: 240px; height: 210px; background: transparent; border: 0; }
.hero .badge { position: absolute; top: calc(var(--hero-h) - 222px); right: 58px; width: 60px; height: 60px; border-radius: 50%; background: var(--text); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; transform: rotate(8deg); font-size: 30px; color: var(--ink); }
.hero .bar { position: absolute; top: var(--top); left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero .bar .wm { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: -0.05em; color: var(--ink); }
.circle-btn { width: var(--btn-m); height: var(--btn-m); flex: none; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600; }
.circle-btn i { font-size: 22px; }
.pill-btn { height: var(--btn-m); padding: 0 20px; border-radius: 26px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; white-space: nowrap; }
.pill-btn i { font-size: 20px; }
.circle-btn:hover, .pill-btn:hover { background: rgba(20,20,20,.08); }
.hero .tag { height: var(--btn-m); padding: 0 18px; border-radius: 26px; background: var(--ink); color: var(--text); display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.hero .tag .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: live 1.2s infinite; }
@keyframes live { 50% { opacity: .25; } }

.below { position: absolute; left: 0; right: 0; top: var(--hero-h); bottom: 0; padding: 26px var(--gutter) 34px; display: flex; flex-direction: column; gap: 14px; }
.below.with-nav { bottom: var(--nav-h); padding-bottom: 0; gap: 16px; }
.below.center { align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: auto; }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 30px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 18px; width: 100%; height: var(--btn-l); flex: none; transition: transform .1s; }
.btn:active { transform: scale(.98); }
.btn i { font-size: 22px; }
.btn.xl { height: var(--btn-xl); border-radius: 36px; font-size: 20px; gap: 12px; }
.btn.xl i { font-size: 26px; }
.btn.primary { background: var(--accent); color: var(--ink); }
.btn.cream { background: var(--text); color: var(--ink); }
.btn.outline { background: transparent; border: 1.5px solid var(--line-strong); color: var(--text); }
.btn.outline:hover { background: rgba(243,235,221,.06); }
.btn.danger { background: var(--danger); color: var(--ink); }
.btn.black { background: var(--ink); color: var(--text); }
.btn.outline-ink { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
.btn.link { background: none; height: 48px; font-size: 17px; font-weight: 500; color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.quick .btn { border-radius: var(--radius-btn); gap: 8px; }

/* tap-to-say board: every taught word is also one tap away */
.board { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); flex: none; }
.board button { flex: none; height: 48px; padding: 0 16px 0 6px; border-radius: 24px; background: transparent; border: 1.5px solid var(--line-mid); display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; }
.board button span { width: 36px; height: 36px; border-radius: 50%; background: var(--main); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.board button:hover { background: rgba(243,235,221,.06); }

/* ---------- waveform ---------- */
.wave { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; flex: none; }
.wave div { width: 4px; border-radius: 2px; background: rgba(243,235,221,.5); transition: height .1s linear; }
.wave div.mid { background: var(--accent); }
.bars-load { display: inline-flex; align-items: center; gap: 4px; height: 32px; }
.bars-load i { display: block; width: 4px; height: 8px; border-radius: 2px; background: rgba(243,235,221,.5); animation: load 1s ease-in-out infinite; }
.bars-load i:nth-child(3) { background: var(--accent); }
.bars-load i:nth-child(2) { animation-delay: .12s; } .bars-load i:nth-child(3) { animation-delay: .24s; }
.bars-load i:nth-child(4) { animation-delay: .36s; } .bars-load i:nth-child(5) { animation-delay: .48s; }
@keyframes load { 50% { height: 32px; } }
.ring { width: 100%; height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; flex: none; }
.ring div { height: 100%; background: var(--muted); border-radius: 2px; width: 0; }

/* ---------- result ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip { height: 52px; padding: 0 20px; border-radius: 26px; border: 1.5px solid var(--line-mid); background: transparent; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.chip i { font-size: 18px; }
.chip span { color: var(--muted); }
.chip[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.chip[aria-checked="true"] span { color: rgba(20,20,20,.6); }
.chip.static { height: 40px; padding: 0 16px; font-size: 15px; }
.heard-line { font-size: 16px; color: var(--muted); text-align: center; min-height: 24px; }
.heard-line b { font-family: var(--font-display); font-style: italic; font-weight: 500; letter-spacing: -0.02em; font-size: 19px; color: var(--text); }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.verdict i { font-size: 18px; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--danger); }
.ok { color: var(--ok); } .bad { color: var(--danger); }

/* ---------- speak (shown to the listener) ---------- */
.speak { position: absolute; inset: 0; background: var(--main); color: var(--ink); padding: var(--top) 24px 40px; display: flex; flex-direction: column; }
.speak .row { display: flex; justify-content: space-between; align-items: center; }
.speak .body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; transition: transform .5s var(--ease); }
.speak .body.flipped { transform: rotate(180deg); }
.speak .who { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.speak .who div { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.speak .phrase { font-family: var(--font-display); letter-spacing: -0.02em; font-size: 54px; line-height: 1.02; text-wrap: balance; }
.speak .line { height: 2px; background: var(--ink); }
.speak.alarm { animation: alarm 1s steps(2) 4; }
@keyframes alarm { 50% { filter: brightness(1.2); } }

/* ---------- pages (scrolling) ---------- */
.page { position: absolute; left: 0; right: 0; top: 0; bottom: var(--nav-h); overflow-y: auto; padding: 70px 20px 24px; display: flex; flex-direction: column; gap: 20px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 44px, #000 66px); mask-image: linear-gradient(to bottom, transparent 44px, #000 66px); }
.page-head { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.page-head .h1 { font-size: 44px; line-height: 1; }
.page-head .sub { font-size: 16px; }
.star { font-family: var(--font-body); font-size: 24px; color: var(--accent); vertical-align: top; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wcard { text-align: left; border: 0; border-radius: var(--radius-card); background: var(--main); color: var(--ink); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.wcard:active, .add-card:active { transform: scale(.98); }
.wcard .top { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 14px; font-weight: 600; }
.wcard .ic { position: relative; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.wcard .ic svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wcard .ic i { position: relative; }
.wcard .label { font-family: var(--font-display); letter-spacing: -0.02em; font-size: 28px; line-height: 1; margin-top: auto; overflow-wrap: anywhere; }
.wcard .hr { height: 1.5px; background: var(--ink); width: 100%; }
.wcard .sound { font-family: var(--font-display); letter-spacing: -0.02em; font-style: italic; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 22px; }
.meter { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 13px; font-weight: 600; }
.meter .track { flex: 1; height: 6px; border-radius: 3px; background: rgba(20,20,20,.18); overflow: hidden; }
.meter .fill { height: 100%; background: var(--ink); border-radius: 3px; }
.add-card { border: 1.5px dashed rgba(243,235,221,.4); border-radius: var(--radius-card); background: transparent; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 600; }
.add-card i { font-size: 32px; }

/* ---------- word detail ---------- */
.detail { overflow-y: auto; gap: 22px; padding-top: 24px; padding-bottom: 40px; }
.detail .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.play { border: 1.5px solid rgba(243,235,221,.3); background: transparent; border-radius: 28px; height: 56px; padding: 0 18px 0 8px; display: flex; align-items: center; gap: 10px; flex: none; max-width: 190px; }
.play .dot { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--text); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.play .italic { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.says { display: flex; flex-direction: column; gap: 6px; position: relative; padding-right: 56px; }
.says .display { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 400; }
.says textarea { background: var(--surface); border: 1.5px solid var(--line-mid); border-radius: 16px; padding: 10px 12px; resize: none; font-family: var(--font-display); font-size: 22px; line-height: 1.15; letter-spacing: -0.02em; width: 100%; outline: none; }
.says .edit { position: absolute; right: 0; top: 0; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line-mid); background: transparent; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.says .edit.save { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); flex: none; }
.stats div { padding: 16px 0; display: flex; flex-direction: column; gap: 4px; }
.stats div + div { padding-left: 20px; border-left: 1.5px solid var(--line); }
.stats b { font-size: 36px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 15px; }
.takes { display: flex; flex-direction: column; flex: none; }
.take-row { display: flex; align-items: center; border-bottom: 1px solid var(--line-soft); }
.take { flex: 1; height: 60px; border: 0; background: transparent; display: flex; align-items: center; gap: 14px; padding: 0; font-size: 15px; color: var(--muted); text-align: left; }
.take .n { width: 64px; flex: none; }
.take em { margin-left: auto; font-style: normal; font-size: 14px; }
.mini { flex: 1; display: flex; align-items: center; gap: 3px; height: 32px; }
.mini div { width: 3px; border-radius: 2px; background: var(--main, var(--accent)); }
.take-x { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
.take-x:hover { color: var(--danger); }

/* ---------- teach ---------- */
.page.teach { padding-left: 24px; padding-right: 24px; gap: 18px; }
.teach-head { display: flex; align-items: center; gap: 14px; }
.teach-head .mini { width: 70px; height: 70px; flex: none; }
.teach-head .h1 { font-size: 34px; line-height: 1.04; }
.meanings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
/* a meaning: its own colour and icon, like the word chips on the home screen */
.meaning { height: 84px; border-radius: var(--radius-tile); border: 0; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; font-size: 15px; font-weight: 500; transition: background .2s var(--ease), transform .2s var(--ease); }
.meaning .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--main); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.meaning .ic i { font-size: 21px; }
.meaning:hover { background: var(--surface-hover); }
.meaning[aria-checked="true"] { background: var(--pale); color: var(--ink); font-weight: 600; transform: scale(1.03); }
.field { display: flex; align-items: center; gap: 12px; height: 60px; border-radius: var(--radius-btn); border: 1.5px solid var(--line-mid); padding: 0 18px; flex: none; }
.field i { font-size: 22px; color: var(--muted); }
.field input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; font-size: 18px; color: var(--text); }
.field:focus-within { border-color: var(--accent); }
.disabled-bar { height: var(--btn-xl); flex: none; border-radius: 36px; background: var(--surface); color: var(--muted); font-size: 18px; font-weight: 500; display: flex; align-items: center; justify-content: center; }
.dots { display: flex; gap: 8px; }
.dots div { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(243,235,221,.4); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink); }
.dots div.done { background: var(--main); border-color: var(--main); }
.rec { width: 100px; height: 100px; flex: none; border-radius: 50%; border: 4px solid var(--bg); box-shadow: 0 0 0 3px var(--ring, rgba(243,235,221,.3)); background: var(--danger); color: var(--ink); font-size: 42px; display: flex; align-items: center; justify-content: center; transform: scale(var(--pulse, 1)); transition: transform .12s linear, box-shadow .3s; }

/* ---------- today (log) ---------- */
.log { display: flex; flex-direction: column; padding: 0 4px; }
.log-item { display: flex; align-items: center; gap: 14px; background: transparent; border: 0; border-bottom: 1px solid var(--line-soft); padding: 12px 0; text-align: left; width: 100%; min-height: 68px; }
.log-item .ic { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--main); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.log-item .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.log-item .tx b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-item .tx span { font-size: 14px; color: var(--muted); }
.log-item time { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.daystats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); margin: 0 4px; }
.daystats div { padding: 14px 0; display: flex; flex-direction: column; gap: 4px; }
.daystats div + div { padding-left: 14px; border-left: 1.5px solid var(--line); }
.daystats b { font-size: 34px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.daystats span { font-size: 13px; color: var(--muted); line-height: 1.3; }
.empty { border: 1.5px dashed rgba(243,235,221,.4); border-radius: var(--radius-card); padding: 30px 22px; text-align: center; color: var(--muted); font-size: 16px; line-height: 1.45; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.empty i { font-size: 32px; color: var(--text); }

/* ---------- settings sheet ---------- */
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); z-index: 20; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; overflow-y: auto; z-index: 21; background: var(--bg); border-top: 1.5px solid var(--line); border-radius: 44px 44px 0 0; padding: 14px var(--gutter) 34px; display: flex; flex-direction: column; gap: 14px; animation: sheet .35s var(--ease); }
@keyframes sheet { from { transform: translateY(100%); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); align-self: center; }
.sheet h2 { font-family: var(--font-display); font-weight: 500; font-size: 32px; letter-spacing: -0.03em; line-height: 1; }
.set { display: flex; flex-direction: column; gap: 8px; }
.set label, .set .lbl { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.set input[type=text], .set select { height: 52px; border-radius: var(--radius-btn); border: 1.5px solid var(--line-mid); background: transparent; padding: 0 16px; font-size: 17px; width: 100%; }
.set select option { background: var(--surface); }
.set input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { height: 52px; border: 1.5px solid var(--line-mid); border-radius: 26px; background: transparent; font-size: 16px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.set .hint { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* ---------- nav ---------- */
.nav { position: absolute; left: 0; right: 0; bottom: 0; height: var(--nav-h); background: var(--bg); border-top: 1.5px solid rgba(243,235,221,.12); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 8px 8px 22px; z-index: 5; }
.nav button { border: 0; background: transparent; color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 600; }
.nav .ic { width: 58px; height: 34px; border-radius: 17px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--muted); }
.nav button[aria-current="page"] .ic { background: var(--text); color: var(--ink); }

/* ---------- proof ---------- */
.bignums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bignum { border: 1.5px solid var(--line); border-radius: var(--radius-card); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.bignum b { font-family: var(--font-display); font-weight: 500; font-size: 52px; letter-spacing: -0.04em; line-height: .95; font-variant-numeric: tabular-nums; }
.bignum span { font-size: 14px; line-height: 1.35; color: var(--muted); }
.bignum.hi { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.bignum.hi span { color: rgba(20,20,20,.75); }
.chart { border-top: 1.5px solid var(--line); padding: 20px 4px 0; display: flex; flex-direction: column; gap: 12px; }
.chart h3 { font-family: var(--font-display); font-weight: 500; font-size: 26px; letter-spacing: -0.02em; line-height: 1.05; }
.chart svg { width: 100%; height: auto; display: block; }
.chart svg text { font-family: var(--font-body); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart svg text.b { fill: var(--text); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.excard { border-bottom: 1px solid var(--line-soft); padding: 4px 4px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.4; }
.excard .row { display: flex; align-items: center; gap: 12px; }
.excard .pl { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 0; background: var(--text); color: var(--ink); font-size: 20px; display: flex; align-items: center; justify-content: center; }
.excard .vs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-left: 60px; }
.excard .vs div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.excard .vs small { font-size: 13px; color: var(--muted); }
.excard .vs b { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- toast ---------- */
#toast-slot { position: absolute; left: 24px; right: 24px; top: 62px; z-index: 30; pointer-events: none; }
.toast { min-height: 56px; border-radius: 28px; background: var(--ink); color: var(--text); display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-size: 16px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.4); border: 1.5px solid var(--line); animation: screen-in .3s ease; }
.toast i { font-size: 22px; color: var(--accent); flex: none; }

/* ---------- side panels share one look: flat, hairlines, no boxes inside boxes ---------- */
.facts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); flex: none; }
.fact { padding: 16px 14px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.fact + .fact { padding-left: 20px; border-left: 1.5px solid var(--line); }
.fact b { font-family: var(--font-display); font-weight: 500; font-size: 52px; letter-spacing: -0.04em; line-height: .95; font-variant-numeric: tabular-nums; }
.fact span { font-size: 14px; color: var(--muted); line-height: 1.35; }
.fact.hi b { color: var(--accent); }

.lab { display: flex; flex-direction: column; gap: 14px; min-height: 0; flex: 1; overflow: hidden; }
.lab-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.lab h2, .eng-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 32px; letter-spacing: -0.03em; line-height: 1; }
.lab p { font-size: 15px; line-height: 1.45; color: var(--muted); }
.lab p b { color: var(--text); font-weight: 600; }
.live-pill { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.live-pill.on { color: var(--danger); }
.live-pill.on::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: live 1.2s infinite; }
.spk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; flex: none; }
.spk button { height: 60px; border: 1.5px solid var(--line-mid); background: transparent; border-radius: var(--radius-btn); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.spk button b { font-size: 16px; font-weight: 600; }
.spk button span { font-size: 12px; color: var(--muted); line-height: 1.1; }
.spk button:hover { background: rgba(243,235,221,.06); }
.spk button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.spk button[aria-pressed="true"] span { color: rgba(20,20,20,.7); }
.story.running .lead, .story.running .foot { display: none; }
.lab-actions { display: grid; grid-template-columns: 1.3fr 1.2fr 52px 52px; gap: 8px; flex: none; }
.lab-actions .btn { height: 52px; border-radius: 26px; font-size: 16px; gap: 8px; white-space: nowrap; }
.lab-actions .btn i { font-size: 20px; }
.lab-actions .btn.ico { padding: 0; }
.score { display: flex; flex-direction: column; flex: none; border-top: 1.5px solid var(--line); }
.score-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.score-row .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; color: var(--muted); }
.score-row .t > b { font-size: 16px; font-weight: 600; color: var(--text); }
.score-row .t span b { color: var(--text); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cells { display: flex; gap: 4px; flex-wrap: wrap; min-height: 20px; }
.cells i { display: block; width: 4px; height: 20px; border-radius: 2px; background: var(--line); }
.cells i.ok { background: var(--ok); } .cells i.ask { background: var(--ask); } .cells i.bad { background: var(--danger); } .cells i.w-ok { background: var(--blue); }
.feed { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; font-size: 14px; }
.feed div { display: grid; grid-template-columns: 76px 1fr 1.15fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.feed div span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.feed div span b { color: var(--text); font-weight: 600; }
.feed div span.ok { color: var(--ok); } .feed div span.bad { color: var(--danger); }
.feed .hd { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 0 0 6px; }

/* ---------- engine column ---------- */
.engine { background: var(--bg); border: 1.5px solid rgba(243,235,221,.12); border-radius: 44px; padding: 24px 26px 20px; gap: 12px; overflow-y: auto; }
.eng-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.model-line { font-size: 14px; color: var(--muted); line-height: 1.4; }
.eng-sec { display: flex; flex-direction: column; gap: 8px; border-top: 1.5px solid var(--line); padding-top: 12px; }
.eng-sec > .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.eng-sec > .t .v { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.step b { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-mid); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; letter-spacing: 0; }
.eng-sec.lit .step { color: var(--text); }
.eng-sec.lit .step b { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.eng-wave { height: 40px; display: flex; align-items: center; justify-content: center; gap: 3px; overflow: hidden; }
.eng-wave i { display: block; flex: 1; max-width: 4px; min-height: 4px; border-radius: 2px; background: rgba(243,235,221,.5); transition: height .1s linear; }
.aligns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.align { display: flex; flex-direction: column; gap: 8px; }
.align canvas { width: 100%; aspect-ratio: 5 / 3; border-radius: 14px; image-rendering: pixelated; background: #0b0a09; display: block; border: 1.5px solid var(--line); }
.align.win canvas { border-color: var(--accent); }
.align .cap { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 600; }
.align .cap span { font-size: 14px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.eng-note { font-size: 13px; line-height: 1.45; color: var(--muted); }
.ranks { display: flex; flex-direction: column; gap: 6px; }
.rank { display: grid; grid-template-columns: 84px 1fr 44px; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.rank .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .tr { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.rank .tr div { height: 100%; border-radius: 3px; background: rgba(243,235,221,.5); transition: width .5s var(--ease); }
.rank.top { color: var(--text); font-weight: 600; }
.rank.top .tr div { background: var(--accent); }
.rank .d { text-align: right; font-variant-numeric: tabular-nums; }
.gauge { position: relative; height: 30px; margin-top: 12px; }
.gauge .tr { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 3px; background: var(--line-soft); }
.gauge .th { position: absolute; top: 6px; left: var(--th); width: 2px; height: 22px; background: var(--text); }
.gauge .th::after { content: "needs"; position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.gauge .mk { position: absolute; top: 8px; left: var(--m); width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); transition: left .6s var(--ease); }
.gauge.no .mk { background: var(--muted); }
.decision { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.decision b { font-family: var(--font-display); font-weight: 500; font-size: 26px; letter-spacing: -0.02em; color: var(--text); }
.decision b.act { color: var(--accent); }
.versus { display: grid; grid-template-columns: 1fr 1fr; }
.versus > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.versus > div + div { padding-left: 16px; border-left: 1.5px solid var(--line); }
.versus small { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; padding-right: 12px; }
.versus b { font-family: var(--font-display); font-weight: 500; font-size: 26px; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.versus .w b { font-style: italic; }
.timing { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: auto; }
.timing b { color: var(--text); font-weight: 600; }
.eng-idle { display: flex; flex-direction: column; }
.eng-idle .how { display: flex; gap: 14px; align-items: flex-start; border-top: 1.5px solid var(--line); padding: 16px 0; }
.eng-idle .how > i { font-size: 22px; color: var(--accent); flex: none; margin-top: 1px; }
.eng-idle .how div { font-size: 15px; line-height: 1.45; color: var(--muted); }
.eng-idle .how div strong { color: var(--text); display: block; font-size: 16px; font-weight: 600; margin-bottom: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .stage { grid-template-columns: minmax(0, 440px); justify-items: center; }
  .story { height: auto; order: 2; }
  .engine { order: 3; height: auto; width: 100%; }
}
/* On a phone: the app fills the screen, no frame, no side panels */
@media (max-width: 520px) {
  .page { -webkit-mask-image: none; mask-image: none; padding-top: 28px; }
  .stage { padding: 0; gap: 0; display: block; }
  .story, .engine, .statusbar, .notch, .homebar { display: none; }
  .device { padding: 0; border-radius: 0; box-shadow: none; background: none; }
  .phone { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; --top: max(16px, env(safe-area-inset-top)); }
  :root { --hero-h: clamp(250px, 42dvh, 372px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* ---------- Blub in motion ---------- */
svg.mascot.pop { animation: blub-pop .55s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 50% 60%; }
@keyframes blub-pop { 0% { transform: scale(.93, 1.05); } 45% { transform: scale(1.045, .965); } 100% { transform: none; } }
.m-dot { transform-box: fill-box; transform-origin: center; animation: m-dot 1s ease-in-out infinite; }
.m-dot:nth-child(2) { animation-delay: .15s; } .m-dot:nth-child(3) { animation-delay: .3s; }
@keyframes m-dot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-9px); } }
.m-z { font-family: var(--font-display); animation: m-z 2.6s ease-in-out infinite; opacity: 0; }
.m-z2 { animation-delay: 1.3s; }
@keyframes m-z { 0% { opacity: 0; transform: translate(-6px, 8px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -16px); } }
.hero .badge { animation: badge-in .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes badge-in { from { transform: rotate(8deg) scale(0); } }

/* ---------- guide ---------- */
.guide { gap: 14px; }
.guide .sub { max-width: 320px; }
.guide-dots { display: flex; gap: 8px; }
.guide-dots i { display: block; width: 8px; height: 8px; border-radius: 4px; background: var(--line-mid); transition: width .3s var(--ease), background .3s; }
.guide-dots i.on { width: 28px; background: var(--accent); }

/* ---------- profile and settings ---------- */
.page.profile { gap: 22px; padding-top: 60px; -webkit-mask-image: none; mask-image: none; }
.prof-top { display: flex; align-items: center; justify-content: space-between; }
.prof-top .wm { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: -0.05em; }
.circle-btn.light { border-color: var(--line-strong); color: var(--text); }
.circle-btn.light:hover { background: rgba(243,235,221,.06); }
.prof-id { display: flex; align-items: center; gap: 16px; padding: 0 4px; }
.group { display: flex; flex-direction: column; gap: 16px; border-top: 1.5px solid var(--line); padding: 20px 4px 0; }
.group h3 { font-family: var(--font-display); font-weight: 500; font-size: 28px; letter-spacing: -0.02em; line-height: 1; }
.row-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 0; border: 0; background: transparent; text-align: left; width: 100%; }
.row-toggle > span:first-child { display: flex; flex-direction: column; gap: 3px; }
.row-toggle b { font-size: 17px; font-weight: 600; }
.row-toggle small { font-size: 14px; color: var(--muted); line-height: 1.35; }
.sw { width: 60px; height: 34px; flex: none; border-radius: 17px; border: 1.5px solid var(--line-strong); position: relative; transition: background .25s, border-color .25s; }
.sw i { position: absolute; top: 4px; left: 4px; width: 23px; height: 23px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .25s; }
.row-toggle[aria-checked="true"] .sw { background: var(--accent); border-color: var(--accent); }
.row-toggle[aria-checked="true"] .sw i { transform: translateX(26px); background: var(--ink); }
html.still #view > * , html.still svg.mascot.pop { animation: none !important; }

/* ---------- side panels: plain labels, no small capitals ---------- */
.live-pill { font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.step { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; text-transform: none; color: var(--muted); gap: 10px; }
.step b { font-family: var(--font-body); width: 26px; height: 26px; font-size: 14px; font-weight: 600; }
.feed .hd { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.gauge .th::after { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.lab-head, .eng-head { align-items: baseline; }

/* profile: quiet labels, content fades under the status bar */
.page.profile { padding-top: 66px; -webkit-mask-image: linear-gradient(to bottom, transparent 44px, #000 62px); mask-image: linear-gradient(to bottom, transparent 44px, #000 62px); }
.profile .set label, .profile .set .lbl { font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none; }

.verdict { font-size: 17px; font-weight: 600; letter-spacing: 0; text-transform: none; }
