/* TokenFlow design system ------------------------------------------------------------------------------------ */
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --nav-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --editor-size: 13.5px;
}

:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0c; --bg-2: #0f0f12; --surface: #141416; --surface-2: #1a1a1e; --surface-3: #222228; --surface-4: #2b2b33;
  --border: rgba(255,255,255,.075); --border-2: rgba(255,255,255,.13); --border-3: rgba(255,255,255,.22);
  --text: #ececf1; --text-2: #a5a5b0; --text-3: #75757f;
  --accent: #7f88ff; --accent-2: #5b63e6; --accent-ink: #ffffff; --accent-soft: rgba(127,136,255,.14);
  --ok: #3ecf8e; --ok-soft: rgba(62,207,142,.12); --bad: #ff6369; --bad-soft: rgba(255,99,105,.12);
  --warn: #f5b041; --warn-soft: rgba(245,176,65,.12); --info: #56b6f7;
  /* difficulty: marks validated with the dataviz CVD checks against the dark surface; text tints for contrast */
  --easy: #22a393; --medium: #c2860b; --hard: #c92e3c;
  --easy-ink: #3fd2bf; --medium-ink: #f2b544; --hard-ink: #ff6b74;
  --heat-0: #1d1d23; --heat-1: #2c2f63; --heat-2: #3f46a8; --heat-3: #5b63e6; --heat-4: #9aa1ff;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7), 0 0 0 1px var(--border-2);
  --glow: radial-gradient(800px 360px at 12% -10%, rgba(91,99,230,.18), transparent 60%),
          radial-gradient(600px 300px at 95% 0%, rgba(34,163,147,.08), transparent 60%);
  --tok-kw: #c792ea; --tok-str: #c3e88d; --tok-num: #f78c6c; --tok-com: #6b6f86; --tok-fn: #82aaff; --tok-def: #ffcb6b;
  --tok-op: #89ddff; --tok-type: #ffcb6b; --tok-bool: #ff9cac;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f8; --bg-2: #f1f1f3; --surface: #ffffff; --surface-2: #f6f6f8; --surface-3: #ececf0; --surface-4: #e1e1e7;
  --border: rgba(10,10,20,.08); --border-2: rgba(10,10,20,.14); --border-3: rgba(10,10,20,.24);
  --text: #16161b; --text-2: #55555f; --text-3: #85858f;
  --accent: #4f57d6; --accent-2: #3f47c6; --accent-ink: #ffffff; --accent-soft: rgba(79,87,214,.1);
  --ok: #12805c; --ok-soft: rgba(18,128,92,.09); --bad: #c42f37; --bad-soft: rgba(196,47,55,.08);
  --warn: #9a6a05; --warn-soft: rgba(201,148,6,.12); --info: #1d6fb8;
  --easy: #0f8f7f; --medium: #c99406; --hard: #c42f37;
  --easy-ink: #0b7a6c; --medium-ink: #8f6604; --hard-ink: #b3262e;
  --heat-0: #ececf0; --heat-1: #cfd2fb; --heat-2: #9aa1f3; --heat-3: #5f67e0; --heat-4: #3138b0;
  --shadow: 0 1px 2px rgba(10,10,20,.05), 0 8px 24px -16px rgba(10,10,20,.18);
  --shadow-lg: 0 24px 64px -20px rgba(10,10,20,.28), 0 0 0 1px var(--border-2);
  --glow: radial-gradient(800px 360px at 12% -10%, rgba(79,87,214,.10), transparent 60%),
          radial-gradient(600px 300px at 95% 0%, rgba(15,143,127,.06), transparent 60%);
  --tok-kw: #8b2fc9; --tok-str: #2f7d32; --tok-num: #b45309; --tok-com: #8a8fa3; --tok-fn: #2559c4; --tok-def: #a35b00;
  --tok-op: #0f7490; --tok-type: #a35b00; --tok-bool: #c0306b;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* nav ------------------------------------------------------------------------------------------------------- */
.nav { position: sticky; top: 0; z-index: 40; height: var(--nav-h); display: flex; align-items: center; gap: 6px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.02em; font-size: 15px; margin-right: 14px; }
.logo { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none;
  background: #10131A; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.logo svg { width: 19px; height: 19px; }
.site-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; font-size: 13px; text-align: center;
  background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--border); }
.site-banner.warn { background: var(--warn-soft); }
.site-banner .i { flex: none; width: 16px; height: 16px; }
.made-by { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px 0 8px; font-size: 12.5px; color: var(--text-3); }
.made-by .logo { width: 20px; height: 20px; border-radius: 6px; }
.made-by .logo svg { width: 15px; height: 15px; }
.nav-links { display: flex; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13.5px; transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.on { color: var(--text); background: var(--surface-3); }
.nav-spacer { flex: 1; }
.search-btn { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px 0 12px; min-width: 220px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-3); font-size: 13px; transition: border-color .15s; }
.search-btn:hover { border-color: var(--border-2); color: var(--text-2); }
.search-btn kbd { margin-left: auto; }
kbd { font: 11px/1 var(--mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.streak { display: flex; align-items: center; gap: 5px; padding: 0 10px; height: 30px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--text-2); border: 1px solid var(--border); }
.streak.hot { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 12.5px; color: #fff; flex: none;
  background: linear-gradient(135deg, #5b63e6, #22a393); }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; border-radius: 22px; }
.menu-btn { display: none; }

/* layout ---------------------------------------------------------------------------------------------------- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 80px; }
.page.wide { max-width: 1400px; }
.glow { background: var(--glow); }
.grid { display: grid; gap: 16px; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.main-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid > *, .main-side > *, .stack > *, .topic-grid > *, .plans-grid > *, .profile-grid > * { min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .sm { font-size: 12.5px; } .xs { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 680; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 640; }
h3 { font-size: 15px; font-weight: 620; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-b { padding: 16px 18px; }
.card.hoverable { transition: border-color .15s, transform .15s var(--ease); }
.card.hoverable:hover { border-color: var(--border-2); transform: translateY(-1px); }

/* controls -------------------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-weight: 560; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-3); border-color: var(--border-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent-2); border-color: transparent; color: var(--accent-ink); box-shadow: 0 6px 16px -8px var(--accent-2); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent-2) 88%, white); }
.btn.success { background: color-mix(in srgb, var(--ok) 88%, black); border-color: transparent; color: #fff; }
.btn.success:hover { background: var(--ok); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 14.5px; border-radius: 11px; }
.btn .spin, .spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.input, .select, .textarea { height: 34px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 520; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon .i { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 32px; width: 100%; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 540; font-size: 12.5px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 520; cursor: pointer; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--border-3); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 560;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.diff { font-weight: 600; font-size: 12.5px; }
.diff.Easy { color: var(--easy-ink); } .diff.Medium { color: var(--medium-ink); } .diff.Hard { color: var(--hard-ink); }
.diff-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 640; }
.diff-pill.Easy { color: var(--easy-ink); background: color-mix(in srgb, var(--easy) 16%, transparent); }
.diff-pill.Medium { color: var(--medium-ink); background: color-mix(in srgb, var(--medium) 16%, transparent); }
.diff-pill.Hard { color: var(--hard-ink); background: color-mix(in srgb, var(--hard) 16%, transparent); }
.status-ic.solved { color: var(--ok); } .status-ic.attempted { color: var(--warn); } .status-ic.todo { color: var(--text-3); opacity: .5; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; }
.empty { text-align: center; padding: 40px 16px; color: var(--text-3); }
.hr { height: 1px; background: var(--border); margin: 14px 0; border: 0; }
.link { color: var(--accent); font-weight: 540; }
.link:hover { text-decoration: underline; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s var(--ease); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* markdown ---------------------------------------------------------------------------------------------------- */
.md { line-height: 1.7; color: var(--text); }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { font: 12.5px/1.5 var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--border); }
.md pre { margin: 0 0 12px; }
.md-table { overflow-x: auto; margin: 0 0 12px; }
.md table { border-collapse: collapse; font-size: 13px; min-width: 60%; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-3); font-weight: 620; }
.md > :last-child { margin-bottom: 0; }
.md strong { font-weight: 640; }
pre.code, .io-box, .io-input, .example, .diffview, .md code { font-variant-ligatures: none; }
pre.code { margin: 0; padding: 12px 14px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--border); overflow: auto;
  font: 12.8px/1.65 var(--mono); tab-size: 4; color: var(--text); }
pre.code code { background: none; border: 0; padding: 0; font: inherit; }
.tok-keyword { color: var(--tok-kw); } .tok-string, .tok-string2 { color: var(--tok-str); } .tok-number { color: var(--tok-num); }
.tok-comment { color: var(--tok-com); font-style: italic; } .tok-variableName.tok-definition, .tok-definition { color: var(--tok-def); }
.tok-propertyName, .tok-function { color: var(--tok-fn); } .tok-operator, .tok-punctuation { color: var(--tok-op); }
.tok-typeName, .tok-className { color: var(--tok-type); } .tok-bool, .tok-atom { color: var(--tok-bool); } .tok-meta { color: var(--tok-com); }

/* home ---------------------------------------------------------------------------------------------------------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.hero p { margin: 6px 0 0; color: var(--text-2); }
.daily { position: relative; overflow: hidden; }
.daily::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 140px at 100% 0%, var(--accent-soft), transparent 70%); pointer-events: none; }
.stat-big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.ring-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.ring-wrap .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.diff-bars { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.diff-bar .progress > i.Easy { background: var(--easy); } .diff-bar .progress > i.Medium { background: var(--medium); } .diff-bar .progress > i.Hard { background: var(--hard); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; }
.heat i { width: 11px; height: 11px; border-radius: 3px; background: var(--heat-0); }
.heat i[data-l="1"] { background: var(--heat-1); } .heat i[data-l="2"] { background: var(--heat-2); } .heat i[data-l="3"] { background: var(--heat-3); } .heat i[data-l="4"] { background: var(--heat-4); }
.heat i:hover { outline: 1px solid var(--text-2); }
.heat-legend { display: flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--text-3); }
.heat-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.step-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 90px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: 0; }
.step-num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--text-2); }
.step-num.done { background: var(--ok-soft); color: var(--ok); }
.commit { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.commit:last-child { border-bottom: 0; }
.commit .sha { font: 11.5px var(--mono); color: var(--accent); padding-top: 2px; }

/* problems table ------------------------------------------------------------------------------------------------ */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 12px; font-weight: 560; color: var(--text-3); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.table th.sort { cursor: pointer; } .table th.sort:hover { color: var(--text); }
.table td.nowrap, .table th { white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .1s; }
.table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.table tbody tr:hover { background: var(--surface-2); }
.table .title-cell { font-weight: 540; }
.table .num { color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: 6px; }
.table-wrap { overflow-x: auto; }
.topic-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); }
.topic-list a:hover, .topic-list a.on { background: var(--surface-2); color: var(--text); }
.topic-list .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* workspace ------------------------------------------------------------------------------------------------------ */
body.ws-mode { overflow: hidden; }
.ws { height: calc(100vh - var(--nav-h)); display: flex; flex-direction: column; background: var(--bg); }
.ws-bar { height: 46px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.ws-bar .center { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.ws-main { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--left, 46%) 8px minmax(0, 1fr); padding: 8px; gap: 0; }
.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.pane-tabs { flex: none; display: flex; gap: 2px; align-items: center; height: 40px; padding: 0 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); overflow-x: auto; }
.pane-tab { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 7px; border: 0; background: none; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 540; white-space: nowrap; }
.pane-tab:hover { color: var(--text); background: var(--surface-3); }
.pane-tab.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.pane-tab .i { width: 14px; height: 14px; }
.pane-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 28px; }
.split-v { cursor: col-resize; display: grid; place-items: center; }
.split-v::after { content: ""; width: 2px; height: 32px; border-radius: 2px; background: var(--border-2); transition: background .15s, height .15s; }
.split-v:hover::after, .split-v.drag::after { background: var(--accent); height: 60px; }
.right-col { min-height: 0; display: grid; grid-template-rows: minmax(120px, var(--top, 62%)) 8px minmax(90px, 1fr); }
.split-h { cursor: row-resize; display: grid; place-items: center; }
.split-h::after { content: ""; height: 2px; width: 32px; border-radius: 2px; background: var(--border-2); }
.split-h:hover::after, .split-h.drag::after { background: var(--accent); width: 60px; }
.editor-bar { flex: none; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.editor-host { flex: 1; min-height: 0; overflow: hidden; }
.editor-host .cm-editor { height: 100%; font-size: var(--editor-size); background: var(--surface); }
.editor-host .cm-editor.cm-focused { outline: none; }
.editor-host .cm-scroller { font-family: var(--mono); line-height: 1.65; font-variant-ligatures: none; }
.editor-host .cm-gutters { background: var(--surface); border-right: 1px solid var(--border); color: var(--text-3); }
.editor-host .cm-activeLineGutter { background: var(--surface-2); color: var(--text-2); }
.editor-host .cm-activeLine { background: color-mix(in srgb, var(--surface-3) 45%, transparent); }
.editor-host .cm-selectionBackground, .editor-host .cm-focused .cm-selectionBackground { background: color-mix(in srgb, var(--accent) 28%, transparent) !important; }
.editor-host .cm-cursor { border-left-color: var(--accent); border-left-width: 2px; }
.editor-host .cm-matchingBracket { background: var(--accent-soft); outline: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.editor-host .cm-tooltip { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.editor-host .cm-tooltip-autocomplete ul li[aria-selected] { background: var(--accent-2); color: #fff; }
.editor-host .cm-panels { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.editor-host .cm-searchMatch { background: var(--warn-soft); outline: 1px solid var(--warn); }
.console-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.case-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.case-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 8px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 12.5px; font-weight: 560; color: var(--text-2); }
.case-chip.on { background: var(--surface-3); color: var(--text); }
.case-chip .x { opacity: 0; margin-right: -4px; } .case-chip:hover .x { opacity: .7; }
.case-chip.pass::before, .case-chip.fail::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.case-chip.pass::before { background: var(--ok); } .case-chip.fail::before { background: var(--bad); }
.io { display: flex; flex-direction: column; gap: 10px; }
.io-label { font-size: 12px; font-weight: 560; color: var(--text-3); margin-bottom: 5px; }
.io-box { font: 12.8px/1.55 var(--mono); padding: 9px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid transparent; white-space: pre-wrap; word-break: break-word; }
.io-box.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.io-input { width: 100%; font: 12.8px/1.55 var(--mono); padding: 8px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid transparent; outline: none; resize: vertical; min-height: 36px; }
.io-input:focus { border-color: var(--accent); }
.io-input.err { border-color: var(--bad); }
.verdict { font-size: 20px; font-weight: 680; letter-spacing: -.02em; }
.verdict.ok { color: var(--ok); } .verdict.bad { color: var(--bad); } .verdict.warn { color: var(--warn); }
.err-box { padding: 12px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font: 12.8px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
.metric { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.metric .v { font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.example { border-left: 2px solid var(--border-2); padding: 4px 0 4px 14px; margin: 8px 0 16px; font: 12.8px/1.65 var(--mono); }
.example b { font-family: var(--font); font-weight: 620; font-size: 13px; color: var(--text); }
.example .v { color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.acc { border-top: 1px solid var(--border); }
.acc > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; font-weight: 560; font-size: 13.5px; color: var(--text-2); }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { color: var(--text); }
.acc > summary .chev { margin-left: auto; transition: transform .2s; }
.acc[open] > summary .chev { transform: rotate(180deg); }
.acc > .acc-b { padding: 0 0 14px; }
.lock-card { text-align: center; padding: 36px 20px; border: 1px dashed var(--border-2); border-radius: var(--r-lg); color: var(--text-2); }
.lock-card .i { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--border-3); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt .key { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--text-2); }
.opt.on .key { background: var(--accent-2); color: #fff; }
.drawer-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4); animation: fade .15s; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 61; width: min(420px, 92vw); background: var(--surface); border-right: 1px solid var(--border-2); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide .22s var(--ease); }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-list { flex: 1; overflow: auto; padding: 6px 10px 20px; }
.drawer-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.drawer-item:hover { background: var(--surface-2); }
.drawer-item.on { background: var(--surface-3); }
.diffview { font: 12.5px/1.6 var(--mono); border-radius: 10px; border: 1px solid var(--border); overflow: auto; background: var(--bg-2); }
.diffview div { padding: 0 12px; white-space: pre; }
.diffview .add { background: var(--ok-soft); color: var(--ok); } .diffview .del { background: var(--bad-soft); color: var(--bad); }
.celebrate { position: relative; }
.burst { position: absolute; left: 50%; top: 20px; pointer-events: none; }
.burst i { position: absolute; width: 6px; height: 10px; border-radius: 2px; opacity: 0; animation: burst 1s var(--ease) forwards; }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }

/* topics -------------------------------------------------------------------------------------------------------- */
.roadmap { position: relative; display: flex; flex-direction: column; gap: 12px; }
.roadmap-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; }
.roadmap-item .n { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; font-size: 16px; background: var(--surface-3); color: var(--text-2); }
.roadmap-item .n.done { background: var(--ok-soft); color: var(--ok); }
.subtopic { padding: 18px 20px; }
.prob-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; }
.prob-row:hover { background: var(--surface-2); }
.lvl { font: 11px/1 var(--mono); color: var(--text-3); padding: 3px 5px; border: 1px solid var(--border-2); border-radius: 5px; }
.local-nav { position: sticky; top: calc(var(--nav-h) + 10px); display: flex; flex-direction: column; gap: 2px; }
.local-nav a { padding: 6px 10px; border-radius: 7px; font-size: 13px; color: var(--text-2); }
.local-nav a:hover { color: var(--text); background: var(--surface-2); }
.proj { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.proj:last-child { border-bottom: 0; }
.domain { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* leaderboard / profile ----------------------------------------------------------------------------------------- */
.rank { font-weight: 700; font-variant-numeric: tabular-nums; width: 40px; color: var(--text-2); }
.rank.top { color: var(--warn); }
tr.me td { background: var(--accent-soft); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.badge .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); flex: none; }
.badge.earned .ic { background: linear-gradient(135deg, var(--accent-2), #8a5cf6); color: #fff; }
.badge:not(.earned) { opacity: .6; }

/* overlays ------------------------------------------------------------------------------------------------------ */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); display: grid; place-items: start center; padding: 10vh 16px 16px; animation: fade .12s; }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); overflow: hidden; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-h { padding: 18px 20px 6px; } .modal-b { padding: 10px 20px 18px; } .modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.palette { width: min(640px, 100%); }
.palette input { width: 100%; border: 0; outline: none; background: none; padding: 16px 18px; font-size: 15px; border-bottom: 1px solid var(--border); }
.palette-list { max-height: 50vh; overflow: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.palette-item.on { background: var(--surface-3); }
.palette-group { padding: 8px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); animation: pop .2s var(--ease); font-size: 13px; }
.toast.ok .i { color: var(--ok); } .toast.bad .i { color: var(--bad); }
.tooltip { position: fixed; z-index: 95; pointer-events: none; padding: 6px 9px; border-radius: 7px; background: var(--surface-4); color: var(--text); font-size: 12px; box-shadow: var(--shadow-lg); white-space: nowrap; }
.banner { padding: 10px 14px; border-radius: 10px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { background: var(--warn-soft); color: var(--warn); } .banner.info { background: var(--accent-soft); color: var(--accent); } .banner.bad { background: var(--bad-soft); color: var(--bad); }

/* responsive ------------------------------------------------------------------------------------------------------ */
@media (max-width: 1080px) {
  .main-side { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr 1fr; }
  .search-btn { min-width: 0; } .search-btn span, .search-btn kbd { display: none; }
}
@media (max-width: 860px) {
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; padding: 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .menu-btn { display: grid; }
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 64px; }
  body.ws-mode { overflow: auto; }
  .ws { height: auto; }
  .ws-main { grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 8px; }
  .split-v { display: none; }
  .pane { max-height: none; }
  .left-pane .pane-body { max-height: 70vh; }
  .right-col { grid-template-rows: 60vh 8px auto; }
  .ws-bar .center { position: static; transform: none; margin-left: auto; }
  .ws-bar .hide-sm { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .proj { grid-template-columns: 1fr; gap: 6px; }
  .table .hide-sm { display: none; }
  .streak span { display: none; }
}

@media (max-width: 960px) {
  .topic-grid, .plans-grid, .profile-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .hide-sm { display: none !important; }
}

/* community ------------------------------------------------------------------------------------------------------ */
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.nav-bell { position: relative; }
.count-badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }
.popover { position: fixed; z-index: 70; width: min(400px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: pop .15s var(--ease); overflow: hidden; }
.popover .list { overflow: auto; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.notif.unread::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 40px; }
.vote.row-v { flex-direction: row; gap: 4px; min-width: 0; }
.vote button { width: 30px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; }
.vote button:hover { background: var(--surface-2); color: var(--text); }
.vote button.up.on { color: var(--ok); } .vote button.down.on { color: var(--bad); }
.vote .score { font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 18px; text-align: center; }
.thread-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background .1s; }
.thread-row:hover { background: var(--surface-2); }
.thread-row:last-child { border-bottom: 0; }
.thread-row .stat { text-align: center; }
.thread-row .stat b { display: block; font-size: 15px; }
.thread-row h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--text-3); }
.meta a:hover { color: var(--text); }
.post { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
.comment { position: relative; padding: 12px 0 0; }
.comment .c-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.comment .c-head b { color: var(--text); font-weight: 600; }
.comment .c-body { margin: 6px 0 4px; }
.comment .c-actions { display: flex; align-items: center; gap: 2px; margin-left: -6px; }
.comment .c-actions .btn.ghost { height: 26px; padding: 0 8px; font-size: 12px; }
.children { margin-left: 13px; padding-left: 18px; border-left: 2px solid var(--border); }
.comment.flash > .c-body { animation: flash 2s var(--ease); border-radius: 8px; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.md a.mention, .md a { color: var(--accent); font-weight: 540; }
.md-editor { border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
.md-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.md-editor .tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.md-editor textarea { width: 100%; border: 0; outline: none; background: none; resize: vertical; padding: 12px 14px; min-height: 110px; line-height: 1.6; }
.md-editor .preview { padding: 12px 14px; min-height: 110px; }
.md-editor .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }
.spoiler-gate { text-align: center; padding: 28px 16px; border: 1px dashed var(--border-2); border-radius: 12px; color: var(--text-2); }
.gh-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pager { display: flex; justify-content: center; gap: 6px; padding: 14px; }
.modal.wide { width: min(760px, 100%); }
.avatar.md { width: 32px; height: 32px; }


/* ---------------------------------------------------------------- Study notes */
.study-sec { display: flex; flex-direction: column; gap: 8px; }
.study-h { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0; }
.study-h .i { color: var(--accent); }
.study-out { margin: 4px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border);
  font: 12.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.study-explain { padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 9px 9px 0; }
.study-explain > :last-child { margin-bottom: 0; }
.study-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.study-list li > div > :last-child { margin-bottom: 0; }
.study-cta { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border-2)); background: var(--accent-soft); color: var(--text); cursor: pointer; }
.study-cta:hover { border-style: solid; }
.study-cta > .i:first-child { color: var(--accent); flex: none; }
.study-cta > div { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- Free / Pro */
.tag.pro { background: var(--accent-soft); color: var(--accent); }
.tag.pro .i { width: 11px; height: 11px; }
.status-ic.locked { color: var(--text-3); }
tr.locked td, a.prob-row.locked { color: var(--text-3); }
tr.locked .num { opacity: .7; }
.pro-banner { margin-bottom: 16px; }
.upgrade-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.upgrade-chip:hover { border-color: var(--accent); }
@media (max-width: 720px) { .upgrade-chip span { display: none; } }
@media (max-width: 480px) { .upgrade-chip { display: none; } }
.pro-lock { width: 54px; height: 54px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pro-lock .i { width: 24px; height: 24px; }
.plans { align-items: stretch; }
.plan-card { display: flex; flex-direction: column; }
.plan-card.pro { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.plan-card .price { font-size: 22px; font-weight: 700; margin: 6px 0 12px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.plan-list .i { color: var(--ok); flex: none; margin-top: 2px; }
.ok-ic { color: var(--ok); }
.nav-link, .search-btn, .streak { white-space: nowrap; }
@media (max-width: 1360px) { .search-btn { min-width: 0; padding: 0 9px; } .search-btn > span, .search-btn > kbd { display: none; } }
/* seven nav links + upgrade chip: collapse into the menu earlier */
@media (max-width: 1160px) {
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; padding: 8px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 30; }
  .nav-links.open { display: flex; }
  .menu-btn { display: grid; }
}

/* ---------------------------------------------------------------- Sign in, landing, pricing */
.auth-page { display: grid; place-items: center; min-height: calc(100vh - var(--nav-h) - 40px); }
.auth-card { width: 100%; max-width: 400px; padding: 32px 28px; }
.auth-card h1 { font-size: 24px; margin: 18px 0 6px; }
.auth-card > p.muted { margin: 0 0 22px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 44px; border-radius: 10px; font-weight: 600;
  font-size: 14px; cursor: pointer; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); transition: border-color .15s, background .15s; }
.auth-btn:hover:not(:disabled) { border-color: var(--border-3); background: var(--surface-2); }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-btn.github { background: #24292f; color: #fff; border-color: #24292f; }
.auth-btn.github:hover:not(:disabled) { background: #32383f; }
.auth-logo { display: inline-grid; place-items: center; }
.auth-logo.lg { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.signin-btn { height: 32px; }
@media (max-width: 480px) { .signin-btn span { display: none; } }
.land-hero { padding: 36px 0 28px; max-width: 760px; }
.land-hero h1 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.1; letter-spacing: -.02em; margin: 10px 0 14px; }
.land-hero .lead { font-size: 16.5px; color: var(--text-2); margin: 0; }
.land-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .land-grid { grid-template-columns: minmax(0, 1fr); } }
.land-step { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; color: var(--text); }
.land-step:hover { background: var(--surface-2); }
.land-step.locked b { color: var(--text-2); }
.land-step > .i { color: var(--text-3); flex: none; }
.land-price { font-size: 30px; font-weight: 700; }
.land-feature h3 { margin: 10px 0 6px; }
.land-feature p { margin: 0; }
.land-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.price-box { margin: 6px 0 12px; min-height: 52px; }
.price-box .price { font-size: 30px; font-weight: 700; }
.seg.billing .save { font-size: 11px; font-weight: 700; color: var(--ok); }

/* ---------------------------------------------------------------- AI Lab notebook */
body.lab-mode { overflow: hidden; }
.nb-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: calc(100vh - var(--nav-h)); }
.nb-side { border-right: 1px solid var(--border); background: var(--bg-2); padding: 16px 10px; overflow: auto; }
.nb-side-h { display: flex; align-items: baseline; justify-content: space-between; padding: 0 8px 8px; font-size: 12.5px; color: var(--text-2); }
.nb-side-list { display: flex; flex-direction: column; gap: 1px; }
.nb-link { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border-radius: 8px; border: 0; background: none;
  color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.nb-link:hover { background: var(--surface-2); color: var(--text); }
.nb-link.on { background: var(--surface-3); color: var(--text); }
.nb-link > .i { flex: none; width: 15px; height: 15px; color: var(--text-3); }
.nb-link.on > .i { color: var(--accent); }
.nb-import { margin-top: 10px; border-top: 1px solid var(--border); border-radius: 0; padding-top: 12px; }

.nb-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.nb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px;
  border-bottom: 1px solid var(--border); background: var(--bg); }
.nb-toolbar-l { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1 1 260px; }
.nb-toolbar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nb-title { font: 600 17px/1.3 var(--font); color: var(--text); background: none; border: 1px solid transparent; border-radius: 7px;
  padding: 4px 6px; margin-left: -6px; min-width: 0; flex: 1; max-width: 520px; }
.nb-title:hover { border-color: var(--border); }
.nb-title:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.nb-save { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.nb-kernel { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); margin-right: 4px; white-space: nowrap; }
.k-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.k-dot.idle { background: var(--ok); }
.k-dot.busy { background: var(--accent); animation: kpulse 1s ease-in-out infinite; }
@keyframes kpulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .k-dot.busy { animation: none; } }
.nb-runtime button { display: inline-flex; align-items: center; gap: 5px; }
.nb-runtime .i { width: 13px; height: 13px; }
.nb-more { position: relative; }
.nb-more > summary { list-style: none; width: 30px; padding: 0; justify-content: center; }
.nb-more > summary::-webkit-details-marker { display: none; }
.nb-menu { position: absolute; right: 0; top: 34px; z-index: 20; min-width: 200px; padding: 6px; border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.nb-menu button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: none; border-radius: 7px;
  color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.nb-menu button:hover { background: var(--surface-2); }
.nb-menu button.danger { color: var(--bad); }

.nb-scroll { flex: 1; overflow: auto; }
.nb-doc { max-width: 940px; margin: 0 auto; padding: 18px 24px 120px 8px; }
.nb-doc > .banner { margin: 0 0 8px 64px; }
.nb-help { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0 0 64px; font-size: 12px; color: var(--text-3); }
.nb-help kbd { font-size: 10.5px; padding: 2px 5px; }

/* the run rail: execution count and state, the one bold element of the notebook */
.nb-cell { display: grid; grid-template-columns: 56px minmax(0, 1fr); position: relative; outline: none; }
.nb-rail { font: 500 12px/1 var(--mono); color: var(--text-3); text-align: right; padding: 13px 12px 0 0; position: relative; user-select: none; }
.nb-rail::after { content: ""; position: absolute; right: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: transparent; }
.nb-cell.active .nb-rail::after { background: var(--border-3); }
.nb-cell.active:focus .nb-rail::after, .nb-cell.active:focus-within .nb-rail::after { background: var(--accent); }
.nb-cell[data-state="running"] .nb-rail, .nb-cell[data-state="queued"] .nb-rail { color: var(--accent); }
.nb-cell[data-state="error"] .nb-rail { color: var(--bad); }
.nb-cell[data-state="error"] .nb-rail::after { background: var(--bad); }
.nb-rail .i { width: 14px; height: 14px; }
.nb-body { position: relative; padding: 4px 0 4px 12px; min-width: 0; }
.nb-editor { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); overflow: hidden; }
.nb-cell.active .nb-editor { border-color: var(--border-2); }
.nb-cell.markdown .nb-editor { background: var(--surface); }
.nb-editor .cm-editor { font-size: var(--editor-size); background: transparent; }
.nb-editor .cm-editor.cm-focused { outline: none; }
.nb-editor .cm-content { padding: 10px 0; }
.nb-editor .cm-line { padding: 0 14px; }
.nb-editor .cm-activeLine { background: transparent; }
.nb-cell.active .nb-editor .cm-focused .cm-activeLine { background: var(--surface-2); }
.nb-md { padding: 6px 2px; cursor: text; }
.nb-md > :last-child { margin-bottom: 0; }
.nb-md h1 { font-size: 24px; margin: 4px 0 8px; } .nb-md h2 { font-size: 18px; margin: 10px 0 6px; }
.nb-tools { position: absolute; top: -10px; right: 6px; z-index: 5; display: none; gap: 1px; padding: 2px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.nb-cell:hover .nb-tools, .nb-cell.active .nb-tools { display: flex; }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.sm .i { width: 14px; height: 14px; }

.nb-out { padding: 8px 2px 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nb-out pre { margin: 0; font: 12.8px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto; }
.out-stream { color: var(--text); }
.out-stream.stderr { color: var(--warn); }
.out-result { color: var(--text-2); }
.out-image { max-width: 100%; height: auto; border-radius: 8px; background: #fff; align-self: flex-start; }
.out-error { border-left: 3px solid var(--bad); background: var(--bad-soft); border-radius: 0 8px 8px 0; padding: 8px 12px; font: 12.8px/1.55 var(--mono); color: var(--text); }
.out-error-h b { color: var(--bad); }
.out-error pre { color: var(--text-2); margin-top: 4px !important; }
.nb-meta { display: flex; gap: 14px; justify-content: flex-end; padding: 6px 2px 0; font: 11.5px/1 var(--mono); color: var(--text-3); }

.nb-insert { height: 14px; position: relative; display: flex; justify-content: center; align-items: center; gap: 6px; margin-left: 68px; opacity: 0; }
.nb-insert::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border-2); }
.nb-insert:hover, .nb-insert:focus-within { opacity: 1; }
.nb-insert button { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font: inherit; font-size: 11.5px; cursor: pointer; }
.nb-insert button:hover { color: var(--text); border-color: var(--accent); }
.nb-insert button .i { width: 12px; height: 12px; }
.nb-cells > .nb-insert:last-child { opacity: 1; height: 40px; }
.nb-cells > .nb-insert:last-child::before { display: none; }

@media (max-width: 900px) {
  body.lab-mode { overflow: auto; }
  .nb-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .nb-side { border-right: 0; border-bottom: 1px solid var(--border); max-height: 190px; }
  .nb-scroll { overflow: visible; }
  .nb-toolbar { padding: 10px 12px; }
  .nb-toolbar-r .btn span { display: none; }
  .nb-doc { padding: 12px 12px 80px 0; }
  .nb-cell { grid-template-columns: 34px minmax(0, 1fr); }
  .nb-rail { padding-right: 8px; }
  .nb-body { padding-left: 8px; }
  .nb-insert, .nb-help, .nb-doc > .banner { margin-left: 42px; }
  .nb-help { display: none; }
}
.dev-login { margin-top: 10px; padding: 14px; border-radius: 12px; border: 1px dashed var(--border-2); display: flex; flex-direction: column; gap: 9px; }
.dev-login-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.dev-login-h .tag { margin-left: auto; }
.dev-login .input { width: 100%; }

/* ---------------------------------------------------------------- Hint ladder, solution prompt, study notes v2 */
.hint-ladder { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.hint-item { border-left: 3px solid var(--warn); padding: 2px 0 2px 12px; }
.hint-n { font-size: 12px; font-weight: 650; color: var(--warn); margin-bottom: 2px; }
.hint-item .md > :last-child { margin-bottom: 0; }
.hint-ladder > .btn { align-self: flex-start; }
.reveal-modal .modal-f { flex-wrap: wrap; }
.study-why { font-size: 15px; color: var(--text); padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.study-why > :last-child { margin-bottom: 0; }
.subgoals li::marker { color: var(--accent); font-weight: 700; }
.acc.check summary .md, .acc.check summary span > div { display: inline; }
.acc.check summary p { display: inline; margin: 0; }
.study-bridge { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--border)); }
.study-bridge > .i { color: var(--accent); flex: none; margin-top: 3px; }
.study-bridge .md > :last-child { margin-bottom: 0; }
.review-card .section-title h3 { display: flex; align-items: center; gap: 6px; }

/* Links to the public legal pages (Terms, Privacy, Refunds, Contact) */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 12.5px; margin: 6px 0 18px; }
.legal-links a { color: var(--text-3); text-decoration: none; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }
.checkout-wait { margin-top: 24px; }
.checkout-wait .i { animation: tf-spin 1s linear infinite; }
@keyframes tf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .checkout-wait .i { animation: none; } }
