/* Bloomscroll. A restrained, editorial register: neutral chrome, one muted
 * accent per card, typography doing the work. Cards are styled by layout
 * (.L-*), type (.T-*) and entrance (.E-*); colours inside a card come from
 * the variables its skin sets: --bg --surface --ink --sub --accent --accent2
 * --line.
 *
 * The `hidden` attribute must always win: an element hidden with it but given
 * a `display` rule stays on screen, invisible, catching every tap and scroll.
 * That is what broke the first release (the sheet), hence the global rule.
 */
:root {
  --f-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ui-bg: #0e0f11; --ui-panel: #16171a; --ui-ink: #ececea; --ui-sub: #9c9ea3; --ui-line: rgba(255, 255, 255, .1);
  --amb-a: #9fb8d8;
  --good: #1f7a4d; --bad: #b42318; --heart: #d64545; --gold: #c9a227;
  --hud-h: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ui-bg); color: var(--ui-ink); font-family: var(--f-sans);
  overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font-family: var(--f-mono); font-size: .76em; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--ui-line); background: rgba(255, 255, 255, .04); }
[hidden] { display: none !important; }
.noscript { max-width: 560px; margin: 12vh auto; padding: 0 20px; line-height: 1.6; }
.noscript a { color: #fff; }
@media (pointer: coarse) { .card { -webkit-user-select: none; user-select: none; } }

/* ── ambient & shell ───────────────────────────────────────────────────── */
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(900px 600px at 50% -10%, rgba(255, 255, 255, .05), transparent 70%); }
.ambient i { position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%; filter: blur(110px); opacity: .07; background: var(--amb-a); transition: background-color 1.2s ease; }
.ambient i:first-child { left: -22vmax; top: -26vmax; }
.ambient i:last-child { right: -24vmax; bottom: -30vmax; }
.shell { position: relative; height: 100vh; height: 100dvh; display: grid; grid-template-columns: 1fr minmax(340px, 460px) 1fr; gap: 32px; padding: 18px 24px; }
.phone { position: relative; height: 100%; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 0 1px var(--ui-line); isolation: isolate; }
.side { align-self: center; max-width: 320px; color: var(--ui-ink); }
.side-l { justify-self: end; }
.side-r { justify-self: start; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; width: 100%; }
@media (max-width: 1060px) {
  .shell { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .side { display: none; }
  .phone { border-radius: 0; box-shadow: none; }
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.brand span { font-size: 13px; color: var(--ui-sub); }
.logo { width: 38px; height: 38px; }
.logo g { fill: #d8d8d6; } .logo circle { fill: var(--amb-a); transition: fill 1s; }
.side-lead { color: #c6c7cb; line-height: 1.6; font-size: 14px; margin: 18px 0; }
.keys { display: grid; gap: 6px; margin: 0 0 18px; font-size: 12.5px; }
.keys div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ui-line); padding-bottom: 6px; }
.keys dt { white-space: nowrap; } .keys dd { margin: 0; color: var(--ui-sub); text-align: right; }
.side-link { color: var(--ui-ink); font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .35); }
.side-link.as-btn { background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .35); padding: 0; margin-top: 10px; }
.sess { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 10px; padding: 14px 16px; }
.lbl { margin: 0 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ui-sub); }
#sessStats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
#sessStats div { display: flex; flex-direction: column; } #sessStats dt { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; } #sessStats dd { margin: 0; font-size: 12px; color: var(--ui-sub); }
.upnext { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 12.5px; }
.upnext li { display: flex; gap: 8px; align-items: center; color: #c6c7cb; min-width: 0; }
.upnext li i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.upnext li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mixbars { display: grid; gap: 6px; font-size: 12px; }
.mixbars div { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 8px; color: var(--ui-sub); }
.mixbars b { display: block; height: 4px; border-radius: 2px; background: #c6c7cb; transition: width .6s; }

/* ── HUD ───────────────────────────────────────────────────────────────── */
.hud { position: absolute; z-index: 20; top: 0; left: 0; right: 0; height: var(--hud-h); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 0 12px; padding-top: max(10px, env(safe-area-inset-top)); pointer-events: none; }
.hud > * { pointer-events: auto; }
.lanes { display: flex; padding: 3px; border-radius: 8px; background: rgba(14, 15, 17, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 0 1px var(--ui-line); }
.lanes button { border: 0; background: none; color: #d4d5d8; font-size: 12.5px; font-weight: 600; padding: 7px 11px; border-radius: 6px; transition: background .2s, color .2s; white-space: nowrap; }
.lanes button[aria-current="true"] { background: #f2f2f0; color: #111; }
.hud-r { display: flex; gap: 6px; }
.hbtn { height: 36px; min-width: 36px; border: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; background: rgba(14, 15, 17, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 0 1px var(--ui-line); color: #fff; }
.hbtn svg { width: 18px; height: 18px; fill: #fff; } .hbtn svg .w { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
#soundBtn .off { display: none; } #soundBtn[aria-pressed="false"] .on { display: none; } #soundBtn[aria-pressed="false"] .off { display: block; }
.bloom-btn b { font-size: 12.5px; font-weight: 700; min-width: 14px; font-variant-numeric: tabular-nums; }
.bloom-btn .flower { width: 22px; height: 22px; }
.flower .p { fill: rgba(255, 255, 255, .22); transition: fill .5s; }
.flower .p.on { fill: #f2f2f0; }
.flower .c { fill: var(--amb-a); }
.bloom-btn.pop .flower { animation: pop .5s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pop { 40% { transform: scale(1.25); } }
@media (max-width: 380px) { .lanes button { padding: 7px 8px; font-size: 11.5px; } }

/* ── feed & cards ──────────────────────────────────────────────────────── */
.feed { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; outline: none; -webkit-overflow-scrolling: touch; }
.feed::-webkit-scrollbar { display: none; }
.card {
  position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden;
  background: var(--bg); color: var(--ink); display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--hud-h) + 18px) 70px 30px 24px; padding-bottom: max(30px, env(safe-area-inset-bottom));
}
.card > canvas.bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.card > .scrim { position: absolute; inset: 0; pointer-events: none; }
.card > .in { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; max-height: 100%; min-height: 0; overflow: hidden; }
.card > .in > * { flex-shrink: 0; }
.card .body { display: flex; flex-direction: column; gap: 10px; }
.card h2 { margin: 0; }
.card p { margin: 0; }
.kick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.chip { padding: 4px 7px; border-radius: 4px; line-height: 1; }
.chip.type { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.chip.lane { color: var(--sub); padding-left: 2px; padding-right: 2px; }
.chip.via { background: var(--accent); color: var(--bg); }
.kick .meta { color: var(--sub); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.hl { font-size: calc(clamp(24px, 6.6vw, 33px) * var(--k, 1)); line-height: 1.14; letter-spacing: -.02em; font-weight: 700; }
.title { font-size: calc(clamp(25px, 7vw, 34px) * var(--k, 1)); line-height: 1.12; letter-spacing: -.022em; font-weight: 700; }
.sum { font-size: calc(15.5px * var(--kb, 1)); line-height: 1.55; color: var(--ink); opacity: .86; }
.ex { font-size: calc(14px * var(--kb, 1)); line-height: 1.55; color: var(--sub); }
.by { font-size: 12.5px; font-weight: 600; color: var(--sub); }
.lens { border-left: 2px solid var(--accent); padding: 10px 12px; background: color-mix(in srgb, var(--surface) 72%, transparent); border-radius: 0 6px 6px 0; display: grid; gap: 3px; }
.lens b { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.lens span { font-size: calc(14px * var(--kb, 1)); line-height: 1.45; }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acts.center, .body.center { align-items: center; text-align: center; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 6px; font-weight: 600; font-size: 13.5px; text-decoration: none; border: 0; line-height: 1.15; max-width: 100%; }
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn .lbl { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .65; margin: 0; color: inherit; }
.bgl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.aside { font-size: 12.5px; color: var(--sub); font-weight: 500; }
.more { color: var(--ink); font-weight: 600; font-size: 13.5px; text-decoration: none; border-bottom: 1px solid var(--accent); align-self: flex-start; }
.foot { font-size: 12px; color: var(--sub); line-height: 1.45; }

/* entrances: quiet, one after another */
.card .in > * { opacity: 0; }
.card.on .in > * { animation: in-rise .42s cubic-bezier(.2, .7, .2, 1) both; }
.card.on .in > *:nth-child(2) { animation-delay: .05s; } .card.on .in > *:nth-child(3) { animation-delay: .1s; }
.card.on .in > *:nth-child(4) { animation-delay: .15s; } .card.on .in > *:nth-child(n+5) { animation-delay: .2s; }
.card.E-fade.on .in > * { animation-name: in-fade; }
.card.seen .in > * { opacity: 1; }
@keyframes in-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes in-fade { from { opacity: 0; } to { opacity: 1; } }
body.calm .card .in > * { opacity: 1 !important; animation: none !important; }

/* ── news layouts ──────────────────────────────────────────────────────── */
.L-editorial .kick { border-top: 1px solid var(--ink); padding-top: 10px; }
.L-editorial .hl { font-family: var(--f-serif); font-weight: 700; font-size: calc(clamp(26px, 7.2vw, 35px) * var(--k, 1)); line-height: 1.12; letter-spacing: -.01em; }
.L-editorial .sum { font-family: var(--f-serif); font-size: calc(17px * var(--kb, 1)); opacity: .9; }
.L-headline { justify-content: flex-end; }
.L-headline .scrim { background: linear-gradient(to top, var(--scrim) 0%, var(--scrim) 40%, var(--scrim0) 85%); }
.L-headline .hl { font-size: calc(clamp(27px, 7.6vw, 38px) * var(--k, 1)); line-height: 1.08; letter-spacing: -.028em; }
.L-brief .in { background: var(--surface); padding: 22px 20px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, .08); }
.L-split { justify-content: flex-start; }
.L-split .scrim { background: linear-gradient(to bottom, color-mix(in srgb, var(--ink) 94%, transparent) 0 27%, transparent 27%); }
.L-split .in { height: 100%; }
.L-split .kick { color: var(--bg); } .L-split .kick .meta { color: var(--bg); opacity: .75; }
.L-split .chip.type { color: var(--bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bg) 45%, transparent); }
.L-split .chip.lane { color: var(--bg); opacity: .75; }
.L-split .body { margin-top: auto; }
.splitpub { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.L-terminal { font-family: var(--f-mono); }
.L-terminal .cmd { color: var(--sub); font-size: 12.5px; } .L-terminal .cmd span { color: var(--accent); }
.L-terminal .hl { font-family: var(--f-mono); font-size: calc(clamp(19px, 5.4vw, 25px) * var(--k, 1)); line-height: 1.32; font-weight: 700; letter-spacing: -.01em; }
.L-terminal .sum { font-size: calc(13.5px * var(--kb, 1)); }
.L-terminal .lens { border-radius: 0; }
.bignum { font-size: calc(clamp(56px, 17vw, 92px) * var(--k, 1)); font-weight: 800; line-height: .95; color: var(--accent); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.L-bignum .hl { font-size: calc(clamp(20px, 5.4vw, 26px) * var(--k, 1)); }
.L-bignum mark { background: none; color: var(--accent); }

/* ── flashcards ────────────────────────────────────────────────────────── */
.T-card .in { height: 100%; }
.flip { position: relative; flex: 1 1 auto; min-height: 240px; perspective: 1400px; cursor: pointer; outline: none; }
.flip:focus-visible .face { box-shadow: 0 0 0 2px var(--accent); }
.face { position: absolute; inset: 0; border-radius: 12px; padding: 26px 22px; display: flex; flex-direction: column; justify-content: center; gap: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .55s cubic-bezier(.3, .8, .25, 1); overflow: auto; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 14px 40px rgba(0, 0, 0, .1); }
.face.back { transform: rotateY(180deg); justify-content: flex-start; }
.flip.flipped .front { transform: rotateY(-180deg); } .flip.flipped .back { transform: rotateY(0); }
.flip.flipped .front { pointer-events: none; } .flip:not(.flipped) .back { pointer-events: none; }
.qa { font-weight: 700; font-size: 11px; color: var(--accent); letter-spacing: .12em; }
.face h2 { font-size: calc(clamp(21px, 5.8vw, 27px) * var(--k, 1)); line-height: 1.22; letter-spacing: -.015em; font-weight: 650; }
.ans { font-size: 15.5px; line-height: 1.6; } .ans p + p { margin-top: 10px; }
.tap { font-size: 12px; color: var(--sub); font-weight: 500; margin-top: 4px !important; }
.hint { align-self: flex-start; border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.hinttext { font-size: 13.5px; color: var(--sub); font-style: italic; }
.grade { display: flex; gap: 10px; }
.grade .btn { flex: 1; justify-content: center; padding: 13px; }

/* ── quizzes ───────────────────────────────────────────────────────────── */
.prompt { font-size: calc(clamp(18px, 5vw, 23px) * var(--k, 1)); line-height: 1.34; font-weight: 650; letter-spacing: -.01em; }
.prompt .blank { display: inline-block; min-width: 2.4em; text-align: center; border-bottom: 2px solid var(--accent); color: var(--accent); font-weight: 700; }
.ask { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opt { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: calc(11px * var(--kb, 1)) 12px; border: 0; border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-weight: 550; font-size: calc(14.5px * var(--kb, 1)); line-height: 1.3; transition: background .2s, box-shadow .2s; }
.opt:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent); }
.opt b { flex: none; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-weight: 700; }
.card .opts .opt.right { background: var(--good); color: #fff; box-shadow: none; } .card .opts .opt.right b { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.card .opts .opt.wrong { background: var(--bad); color: #fff; box-shadow: none; } .card .opts .opt.wrong b { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.opts.done .opt:not(.right):not(.wrong) { opacity: .5; }
.opts.done .opt { cursor: default; }
.why { display: block; font-size: 12.5px; color: var(--sub); line-height: 1.45; padding: 5px 4px 2px 50px; }
.after { display: grid; gap: 8px; }
.verdict { font-weight: 700; font-size: 14.5px; }
.explain { font-size: 13.5px; line-height: 1.5; color: var(--sub); max-height: 9.5em; overflow: auto; }
.L-exam .prompt { font-family: var(--f-serif); font-weight: 600; font-size: calc(clamp(19px, 5.2vw, 24px) * var(--k, 1)); }
.L-exam .opt { background: transparent; box-shadow: none; border-bottom: 1px solid var(--line); border-radius: 0; }
.L-exam .opt b { border-radius: 50%; }
.card .opts .opt.right, .card .opts .opt.wrong { border-radius: 8px; border-bottom-color: transparent; }
.ring { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--sub); font-weight: 500; }
.ring svg { width: 40px; height: 40px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: var(--line); stroke-width: 3; }
.ring .arc { stroke: var(--accent); stroke-dasharray: 119.4; stroke-dashoffset: 119.4; stroke-linecap: round; }
.card.on .ring .arc { animation: ring 10s linear forwards; }
@keyframes ring { to { stroke-dashoffset: 0; } }
.revealbtn { align-self: flex-start; }
.reveal { font-size: 14px; line-height: 1.55; max-height: 42%; overflow: auto; display: grid; gap: 8px; padding: 14px; border-radius: 8px; background: color-mix(in srgb, var(--surface) 85%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.L-think .prompt { font-family: var(--f-serif); font-weight: 600; font-size: calc(clamp(21px, 5.8vw, 27px) * var(--k, 1)); line-height: 1.25; }

/* ── library layouts ───────────────────────────────────────────────────── */
.L-encyclopedia .title, .L-magazine .title, .L-dictionary .term { font-family: var(--f-serif); font-weight: 700; letter-spacing: -.01em; }
.L-encyclopedia .body { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); padding: 16px 0; }
.L-encyclopedia .sum { font-family: var(--f-serif); font-size: calc(17.5px * var(--kb, 1)); font-style: italic; }
.L-feature .title { font-size: calc(clamp(28px, 8.4vw, 42px) * var(--k, 1)); line-height: 1.04; letter-spacing: -.03em; }
.L-feature { justify-content: flex-end; }
.L-feature .scrim { background: linear-gradient(to top, var(--scrim) 0%, var(--scrim) 45%, var(--scrim0) 90%); }
.L-museum { justify-content: flex-end; }
.L-museum .in { background: var(--surface); padding: 18px; border-radius: 4px; box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, .12); }
.L-museum .title { font-size: calc(clamp(21px, 6vw, 28px) * var(--k, 1)); }
.L-dictionary .term { font-size: calc(clamp(32px, 9.4vw, 48px) * var(--k, 1)); line-height: 1.02; }
.pos { font-family: var(--f-serif); font-size: 15.5px; color: var(--sub); }
.def { font-size: calc(16.5px * var(--kb, 1)); line-height: 1.5; }
.L-dictionary .def::before { content: '1.'; font-weight: 700; margin-right: 8px; color: var(--accent); }
.L-spec { font-family: var(--f-mono); }
.L-spec .term { font-size: calc(clamp(22px, 6.4vw, 30px) * var(--k, 1)); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; padding: 12px 0; border-top: 1px solid var(--accent); border-bottom: 1px solid var(--line); font-family: var(--f-sans); }
.L-spec .pos { font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.L-spec .def { font-family: var(--f-mono); font-size: calc(13.5px * var(--kb, 1)); line-height: 1.6; }
.T-term .term { margin: 0; }
.pull { margin: 0; font-family: var(--f-serif); font-style: italic; font-size: calc(clamp(19px, 5.4vw, 25px) * var(--k, 1)); line-height: 1.3; padding-left: 14px; border-left: 2px solid var(--accent); }
.L-magazine .title { font-size: calc(clamp(21px, 5.8vw, 28px) * var(--k, 1)); }
.surprise { font-size: 15px; line-height: 1.55; } .surprise b { color: var(--accent); }
.finds { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.45; color: var(--sub); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; } .tag { font-size: 11.5px; font-weight: 500; padding: 3px 7px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); color: var(--sub); }

/* ── specials ──────────────────────────────────────────────────────────── */
.rising { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; }
.rising li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'w n' 'bar bar' 's spark'; gap: 5px 10px; align-items: center; }
.rising .w { grid-area: w; font-size: 16px; font-weight: 650; }
.rising b { grid-area: n; font-size: 20px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.rising .bar { grid-area: bar; position: relative; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rising .bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; transform-origin: left; }
.rising .bar em { position: absolute; top: 0; bottom: 0; left: 0; border-right: 2px solid var(--ink); opacity: .5; }
.card.on .rising .bar i { animation: grow .8s .2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.rising small { grid-area: s; font-size: 12px; color: var(--sub); }
.spark { grid-area: spark; width: 110px; height: 26px; } .spark polyline { fill: none; stroke: var(--ink); stroke-width: 1.5; opacity: .6; } .spark line { stroke: var(--ink); opacity: .18; stroke-dasharray: 2 3; }
.pair { display: grid; gap: 0; margin-top: 4px; }
.pairitem { background: var(--surface); box-shadow: 0 0 0 1px var(--line); border-radius: 8px; padding: 13px 14px; }
.pairlink { color: inherit; text-decoration: none; display: grid; gap: 4px; }
.pairitem small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
.pairitem b { font-size: 15px; line-height: 1.32; font-weight: 600; }
.pairjoin { position: relative; height: 46px; display: grid; place-items: center; }
.pairjoin::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px dashed var(--accent); }
.pairjoin span { position: relative; background: var(--bg); color: var(--accent); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--accent); }
.picks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.pick { display: grid; gap: 2px; text-decoration: none; color: var(--ink); background: var(--surface); padding: 12px 14px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.pick small { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.pick b { font-size: 15px; line-height: 1.3; font-weight: 600; } .pick span { font-size: 12px; color: var(--sub); }
.tickmark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); margin-bottom: 8px; }
.twenty { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 8px; background: color-mix(in srgb, var(--surface) 85%, transparent); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; line-height: 1.45; }
.twenty .ring { position: relative; } .twenty .ring b { position: absolute; left: 0; width: 40px; text-align: center; font-size: 12px; color: var(--ink); }
.card.on .twenty .arc { animation-duration: 20s; }
.haul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13.5px; }
.haul a { color: var(--ink); }
.flower.big { width: 150px; height: 150px; margin: 0 auto 6px; display: block; }
.flower.big .p { fill: var(--line); }
.flower.big .p.on { fill: var(--accent); }
.flower.big .c { fill: var(--ink); }
.card.on .flower.big .p.on { animation: petal .5s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: calc(var(--i) * 50ms); }
@keyframes petal { from { transform: scale(0); } }

/* ── rail ──────────────────────────────────────────────────────────────── */
.rail { position: absolute; z-index: 15; right: 10px; bottom: max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.rbtn { width: 48px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; color: #fff; }
.rbtn svg { width: 42px; height: 42px; padding: 11px; border-radius: 50%; background: rgba(14, 15, 17, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s, background .2s; }
.rbtn svg .f { fill: #fff; stroke: none; }
.rbtn span { font-size: 10.5px; font-weight: 600; min-height: 12px; }
.rbtn span:not(:empty) { background: rgba(14, 15, 17, .55); padding: 1px 6px; border-radius: 4px; }
.rbtn:active svg { transform: scale(.92); }
.rbtn:focus-visible svg { box-shadow: 0 0 0 2px #fff; }
.rbtn[data-r="like"][aria-pressed="true"] svg { background: var(--heart); fill: #fff; }
.rbtn[data-r="wow"][aria-pressed="true"] svg { background: var(--gold); }
.rbtn[data-r="save"][aria-pressed="true"] svg { background: #f2f2f0; fill: #111; stroke: #111; }
.rbtn.pulse svg { animation: pop .4s cubic-bezier(.3, 1.4, .5, 1); }
.rail.hide { opacity: 0; pointer-events: none; }

/* ── overlays ──────────────────────────────────────────────────────────── */
.toast { position: absolute; z-index: 40; left: 50%; bottom: 92px; transform: translate(-50%, 12px); opacity: 0; padding: 9px 14px; border-radius: 6px; background: rgba(14, 15, 17, .92); color: #fff; font-size: 13px; font-weight: 500; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 86%; text-align: center; box-shadow: 0 0 0 1px var(--ui-line); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.burst { position: absolute; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.burst i { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; animation: heart .7s cubic-bezier(.2, .9, .3, 1) forwards; }
.burst i svg { width: 100%; height: 100%; fill: #fff; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
@keyframes heart { 0% { transform: scale(.4); opacity: 0; } 25% { transform: scale(1.05); opacity: .95; } 70% { opacity: .95; } 100% { transform: scale(1) translateY(-24px); opacity: 0; } }

.sheet { position: absolute; inset: 0; z-index: 50; background: rgba(5, 5, 7, .5); display: flex; align-items: flex-end; opacity: 0; transition: opacity .2s; }
.sheet.open { opacity: 1; }
.sheet-card { width: 100%; max-height: 88%; overflow: auto; background: var(--ui-panel); color: var(--ui-ink); border-radius: 14px 14px 0 0; padding: 18px 18px max(22px, env(safe-area-inset-bottom)); transform: translateY(24px); transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -16px 40px rgba(0, 0, 0, .45), 0 0 0 1px var(--ui-line); }
.sheet.open .sheet-card { transform: none; }
.sheet-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-card h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.sheet-card h4 { margin: 18px 0 8px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ui-sub); }
.sheet-card p { color: #c6c7cb; font-size: 13.5px; line-height: 1.55; margin: 0 0 10px; }
.sheet-card a { color: #fff; }
.x { width: 32px; height: 32px; border-radius: 6px; border: 0; background: rgba(255, 255, 255, .07); color: #fff; font-size: 20px; line-height: 1; }
.share-prev { display: grid; place-items: center; min-height: 150px; margin-bottom: 14px; }
.share-prev img { width: 56%; max-width: 230px; border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 0 1px var(--ui-line); }
.share-prev .ph { color: var(--ui-sub); font-size: 13px; }
.share-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-bottom: 14px; }
.sbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--ui-line); font-size: 12.5px; font-weight: 600; color: #fff; }
.sbtn svg, .soc svg { width: 20px; height: 20px; }
.share-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 6px; }
.soc { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #c6c7cb; text-decoration: none; font-size: 11px; }
.soc svg { width: 42px; height: 42px; padding: 11px; border-radius: 50%; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--ui-line); color: #fff; }
.soc:hover svg { background: var(--brand); box-shadow: none; }
.share-note { margin-top: 12px !important; font-size: 12px !important; color: var(--ui-sub) !important; }
.menu-list { display: grid; gap: 6px; }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 12px 14px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--ui-line); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.menu-list small { display: block; color: var(--ui-sub); font-weight: 400; font-size: 12px; margin-top: 2px; }
.switch { margin-left: auto; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .16); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
[aria-checked="true"] .switch { background: #3f8f63; } [aria-checked="true"] .switch::after { transform: translateX(16px); }
.sliders { display: grid; gap: 14px; margin-top: 6px; }
.sliders label { display: grid; grid-template-columns: 96px 1fr 44px; gap: 10px; align-items: center; font-size: 13.5px; font-weight: 600; }
.sliders input { width: 100%; accent-color: #d8d8d6; }
.sliders output { font-family: var(--f-mono); font-size: 12px; color: var(--ui-sub); text-align: right; }
.garden { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; }
.garden figure { margin: 0; display: grid; justify-items: center; gap: 2px; flex: none; width: 44px; }
.garden figure .flower { width: 36px; height: 36px; }
.garden figcaption { font-size: 10.5px; color: var(--ui-sub); }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.statgrid div { background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--ui-line); border-radius: 8px; padding: 10px; }
.statgrid b { display: block; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; } .statgrid span { font-size: 11.5px; color: var(--ui-sub); }
.saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.saved li { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--ui-line); border-radius: 8px; padding: 10px 12px; }
.saved li a { flex: 1; color: #fff; text-decoration: none; font-size: 13.5px; line-height: 1.35; }
.saved li small { display: block; color: var(--ui-sub); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.saved li button { border: 0; background: none; color: var(--ui-sub); font-size: 18px; }

/* ── splash ────────────────────────────────────────────────────────────── */
.splash { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 28px 22px; transition: opacity .35s; overflow: auto;
  background: linear-gradient(180deg, #15161a 0%, #0e0f11 100%); }
.splash::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 70%); -webkit-mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 70%); }
.splash.gone { opacity: 0; pointer-events: none; }
.splash-in { position: relative; width: 100%; max-width: 360px; text-align: center; }
.splash-flower { width: 72px; height: 72px; display: block; margin: 0 auto 14px; }
.splash-flower .p { fill: rgba(255, 255, 255, .2); animation: petal .45s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: calc(var(--i) * 60ms + .15s); }
.splash-flower g:nth-child(-n+5) .p { fill: #e9e9e7; }
.splash-flower .c { fill: var(--amb-a); }
.splash h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.splash h1 span { color: #a3a5aa; font-weight: 600; }
.tag { margin: 10px 0 4px; color: #c6c7cb; font-size: 14.5px; }
.welcome { margin: 10px 0 0; color: #d8d8d6; font-size: 13px; font-weight: 500; min-height: 1em; }
.lanepick { display: grid; gap: 8px; margin: 24px 0 16px; }
.lanepick button { display: grid; gap: 3px; text-align: left; padding: 14px 16px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--ui-line); transition: background .15s, box-shadow .15s; }
.lanepick button:hover, .lanepick button:focus-visible { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); outline: none; }
.lanepick button.pref { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); }
.lanepick b { font-size: 15.5px; font-weight: 650; } .lanepick span { font-size: 12.5px; color: var(--ui-sub); }
.fine { font-size: 12px; color: var(--ui-sub); line-height: 1.55; }
.shared-prev { margin: 18px 0 0; padding: 12px 14px; border-radius: 8px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--ui-line); text-align: left; font-size: 13.5px; line-height: 1.4; }
.shared-prev small { display: block; color: var(--ui-sub); font-weight: 700; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }

/* embedded on the feed pages: a smaller, quieter frame */
body.embed .shell { padding: 0; grid-template-columns: 1fr; }
body.embed .side { display: none; }
body.embed .phone { border-radius: 0; box-shadow: none; }
.tapsound { position: absolute; z-index: 30; left: 50%; bottom: 22px; transform: translateX(-50%); border: 0; padding: 8px 12px; border-radius: 6px; background: rgba(14, 15, 17, .85); box-shadow: 0 0 0 1px var(--ui-line); color: #fff; font-size: 12px; font-weight: 600; }
.swipehint { position: absolute; z-index: 14; left: 50%; bottom: 24px; transform: translateX(-50%); color: #fff; font-size: 11.5px; font-weight: 600; pointer-events: none; animation: hint 2s ease-in-out infinite; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 6px; background: rgba(14, 15, 17, .55); }
@keyframes hint { 50% { transform: translate(-50%, -5px); } }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ui-sub); font-size: 14px; }

.card.tight .hl, .card.tight .title, .card.tight .term, .card.tight .bignum, .card.tight .prompt, .card.tight .face h2 { overflow-wrap: anywhere; hyphens: auto; }

@media (prefers-reduced-motion: reduce) {
  .card .in > * { opacity: 1 !important; animation: none !important; }
  .swipehint { animation: none !important; }
}

/* ── rendered markdown inside cards: text, code, tables, maths ─────────── */
.md > * + * { margin-top: 8px; }
.md p { margin: 0; }
.md ul, .md ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.md li > p { margin: 0; }
.md strong { font-weight: 650; }
.md a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }
.md blockquote { margin: 0; padding-left: 12px; border-left: 2px solid var(--line); color: var(--sub); }
.md .mdh { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-top: 12px; }
.md .mdh:first-child { margin-top: 0; }
.md .mdnote { font-size: 12px; color: var(--sub); font-style: italic; }
.card code { font-family: var(--f-mono); font-size: .86em; padding: .1em .35em; border-radius: 4px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.card .codehl { margin: 0; border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, var(--surface)); box-shadow: inset 0 0 0 1px var(--line); overflow: auto; max-height: 14em; }
.card .codehl pre { margin: 0; padding: 10px 12px; font-family: var(--f-mono); font-size: 12px; line-height: 1.55; white-space: pre; }
.card .codehl pre code { padding: 0; background: none; font-size: inherit; }
.card .codehl .k, .card .codehl .kd, .card .codehl .kn, .card .codehl .kr, .card .codehl .kc, .card .codehl .kt, .card .codehl .ow { color: var(--accent); font-weight: 600; }
.card .codehl .s, .card .codehl .s1, .card .codehl .s2, .card .codehl .sb, .card .codehl .sd, .card .codehl .se, .card .codehl .si, .card .codehl .sr { color: var(--accent2); }
.card .codehl .m, .card .codehl .mi, .card .codehl .mf, .card .codehl .mh, .card .codehl .mo, .card .codehl .il { color: var(--accent2); }
.card .codehl .c, .card .codehl .c1, .card .codehl .cm, .card .codehl .cs, .card .codehl .ch, .card .codehl .cp, .card .codehl .cpf { color: var(--sub); font-style: italic; }
.card .codehl .nf, .card .codehl .fm, .card .codehl .nc, .card .codehl .nn, .card .codehl .nd { font-weight: 600; }
.card .md-table-wrap { overflow-x: auto; }
.card table { border-collapse: collapse; font-size: 12.5px; line-height: 1.4; width: max-content; min-width: 100%; }
.card .md-table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.card th, .card td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 7.5em; max-width: 15em; white-space: normal; }
.card th { font-weight: 650; color: var(--ink); border-bottom-color: var(--ink); }
.card .arithmatex { color: inherit; }
.card .katex { font-size: 1.04em; }
.card .katex-display { margin: 6px 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.card .ans.md, .card .reveal.md, .card .explain.md { display: grid; gap: 8px; }
.card .ans.md > *, .card .reveal.md > *, .card .explain.md > * { margin: 0; }
.card .ex.md { font-size: calc(14px * var(--kb, 1)); line-height: 1.55; color: var(--sub); }
.card .face h2 code, .card .prompt code { font-size: .8em; }
.L-spec .def { font-weight: 500; opacity: .92; }
