/* Layout: a practice studio — ink-navy rail on the left, a dotted-notebook page on the right;
   the problem workspace pairs a light brief with a dark code pane like an editor. */
:root {
  --bg: #F4F6FB; --bg-dot: #DCE2EE; --surface: #FFFFFF; --sunk: #EEF1F7; --line: #E1E6F0; --line-strong: #CBD3E2;
  --ink: #141B33; --muted: #5D6884; --faint: #8A93AB;
  --accent: #2F5BEA; --accent-2: #5B7CFA; --accent-ink: #FFFFFF; --accent-soft: #E6ECFE; --accent-glow: rgba(47, 91, 234, 0.18);
  --rail: #111833; --rail-2: #1A2346; --rail-ink: #E7EBF7; --rail-muted: #8D97B8;
  --easy: #0E8A6B; --easy-soft: #DDF3EC; --med: #A86A00; --med-soft: #FCEFD6; --hard: #7246D4; --hard-soft: #EEE7FD;
  --c-easy: #0E8A6B; --c-med: #C27C0E; --c-hard: #7A4DD6;
  --ok: #0E8A6B; --ok-soft: #DDF3EC; --bad: #C8364F; --bad-soft: #FBE3E8; --warm: #E8892B;
  --code-bg: #0F1529; --code-gutter: #141B33; --code-ink: #E3E8F6; --code-muted: #6E79A0;
  --shadow-sm: 0 1px 2px rgba(20, 27, 51, 0.06);
  --shadow: 0 1px 2px rgba(20, 27, 51, 0.05), 0 6px 20px rgba(20, 27, 51, 0.06);
  --shadow-lg: 0 2px 6px rgba(20, 27, 51, 0.06), 0 18px 40px rgba(20, 27, 51, 0.10);
  --r: 14px; --r-sm: 9px;
  --f-display: "Bricolage Grotesque", "Manrope", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1020; --bg-dot: #1A2140; --surface: #151C33; --sunk: #1C2440; --line: #263052; --line-strong: #34406A;
    --ink: #E8ECF7; --muted: #A2ACC6; --faint: #78829F;
    --accent: #7E9BFF; --accent-2: #9DB2FF; --accent-ink: #0C1020; --accent-soft: #222D58; --accent-glow: rgba(126, 155, 255, 0.22);
    --rail: #090D1A; --rail-2: #131A33;
    --easy: #4FD1A8; --easy-soft: #143A31; --med: #F2B84B; --med-soft: #3A2E14; --hard: #B9A2FF; --hard-soft: #2D2552;
    --c-easy: #2FA582; --c-med: #BC8420; --c-hard: #8C70E0;
    --ok: #4FD1A8; --ok-soft: #143A31; --bad: #FF8098; --bad-soft: #43202B; --warm: #F5A04A;
    --code-bg: #0A0F1F; --code-gutter: #0E1428;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 44px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; letter-spacing: -0.005em; }
code, pre, .mono { font-family: var(--f-mono); }
code { font-size: 0.86em; background: var(--sunk); padding: 0.1em 0.38em; border-radius: 5px; }
button { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--rail) 0%, var(--rail-2) 100%); color: var(--rail-ink);
  padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); box-shadow: 0 6px 16px var(--accent-glow); }
.logo svg { width: 20px; height: 20px; }
.brand b { font-family: var(--f-display); font-size: 1.12rem; display: block; color: #fff; letter-spacing: -0.01em; }
.brand small { display: block; font: 500 0.74rem var(--f-body); color: var(--rail-muted); }
.nav { display: grid; gap: 3px; }
.nav-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--rail-muted); padding: 10px 12px 4px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--rail-ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; opacity: 0.82; transition: background 0.15s, opacity 0.15s; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav a:hover { background: rgba(255, 255, 255, 0.06); opacity: 1; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.10); opacity: 1; box-shadow: inset 3px 0 0 var(--accent-2); }
.nav .badge { margin-left: auto; font: 600 0.7rem var(--f-mono); background: var(--warm); color: #1A1205; border-radius: 99px; padding: 1px 7px; }
.side .who { margin-top: auto; display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); font-size: 0.82rem; color: var(--rail-ink); }
.side .who .sub { font-size: 0.74rem; color: var(--rail-muted); }
.side .who .btn.ghost { color: var(--rail-muted); padding: 2px 0; }
.side .who .btn.ghost:hover { color: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 99px; vertical-align: middle; margin-right: 8px; }
.main { padding: 30px clamp(16px, 3.4vw, 44px) 72px; min-width: 0; }
.wrap { max-width: 1020px; }
.wide { max-width: 1440px; }

/* ---------- page header ---------- */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 6px; }
.pagehead p { margin: 6px 0 0; color: var(--muted); }
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 24px 26px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #3B63F0 0%, #2448C9 42%, #172C80 100%);
  box-shadow: var(--shadow-lg); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center;
}
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px); background-size: 18px 18px;
  mask-image: linear-gradient(90deg, transparent 30%, #000 100%); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%); }
.hero .eyebrow { color: rgba(255, 255, 255, 0.72); }
.hero h1 { color: #fff; margin-top: 6px; }
.hero p { margin: 8px 0 0; color: rgba(255, 255, 255, 0.82); max-width: 56ch; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero .chip { font-size: 0.8rem; font-weight: 600; padding: 4px 11px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); color: #fff; backdrop-filter: blur(4px); }
.ring { position: relative; width: 112px; height: 112px; z-index: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, 0.18); }
.ring .val { stroke: #fff; transition: stroke-dashoffset 0.6s ease; }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring .lbl b { font: 700 1.5rem var(--f-display); display: block; }
.ring .lbl span { font-size: 0.7rem; color: rgba(255, 255, 255, 0.75); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); display: grid; gap: 2px; }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat span.k { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.stat .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat .ico svg { width: 16px; height: 16px; }
.stat .ico.warm { background: color-mix(in srgb, var(--warm) 18%, transparent); color: var(--warm); }
.stat .ico.ok { background: var(--ok-soft); color: var(--ok); }
.stat .ico.hard { background: var(--hard-soft); color: var(--hard); }
.stat b { display: block; font-family: var(--f-display); font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin-top: 4px; }
.stat .sub { font-size: 0.8rem; color: var(--muted); }
.bar { height: 6px; background: var(--sunk); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }

/* ---------- cards & items ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.card h3 + * { margin-top: 4px; }
.stack { display: grid; gap: 16px; }
.eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { justify-content: space-between; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cardhead .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.cardhead .ico svg { width: 16px; height: 16px; }
.cardhead .t { display: flex; align-items: center; gap: 10px; }

.item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; padding: 13px 10px; margin: 0 -10px; border-radius: 10px; transition: background 0.15s; }
.item + .item { border-top: 1px solid var(--line); border-radius: 0; }
.item:hover { background: var(--sunk); border-radius: 10px; }
.chk { width: 28px; height: 28px; border-radius: 99px; border: 2px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: transparent; font-weight: 800; font-size: 0.8rem; transition: all 0.15s; }
.chk:hover { border-color: var(--ok); }
.chk[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--ok) 35%, transparent); }
.title { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.title a { color: var(--ink); text-decoration: none; }
.title a:hover { color: var(--accent); text-decoration: underline; }
.meta { grid-column: 2; color: var(--muted); font-size: 0.88rem; }
.meta .py { font-family: var(--f-mono); font-size: 0.84em; color: var(--ink); background: var(--sunk); padding: 1px 6px; border-radius: 5px; }
.item:hover .meta .py { background: var(--surface); }
.pill { font: 700 0.66rem var(--f-body); letter-spacing: 0.06em; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; white-space: nowrap; }
.pE { color: var(--easy); background: var(--easy-soft); } .pM { color: var(--med); background: var(--med-soft); } .pH { color: var(--hard); background: var(--hard-soft); }
.pB, .pT { color: var(--accent); background: var(--accent-soft); } .pO { color: var(--muted); background: var(--sunk); }
.pNote { color: var(--muted); background: var(--sunk); }
.conf { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.conf button { font: 600 0.8rem var(--f-mono); width: 30px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; transition: all 0.12s; }
.conf button:hover { border-color: var(--accent); color: var(--accent); }
.conf button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 10px var(--accent-glow); }

.btn { font: 600 0.86rem var(--f-body); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; transition: all 0.15s; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: var(--accent-ink); box-shadow: 0 4px 14px var(--accent-glow); }
.btn.primary:hover { color: var(--accent-ink); filter: brightness(1.06); transform: translateY(-1px); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.empty { color: var(--muted); font-size: 0.92rem; padding: 6px 0; }

.next { display: grid; gap: 0; }
.next div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; font-size: 0.92rem; padding: 9px 0; border-top: 1px dashed var(--line); }
.next div:first-child { border-top: 0; }
.next span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- plan ---------- */
details.week { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s; }
details.week[open] { box-shadow: var(--shadow); }
details.week > summary { list-style: none; cursor: pointer; padding: 15px 20px; display: grid; grid-template-columns: auto minmax(0, 1fr) 150px; gap: 4px 16px; align-items: center; }
details.week > summary::-webkit-details-marker { display: none; }
details.week > summary .wk { font: 600 0.74rem var(--f-mono); color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 6px 9px; text-align: center; line-height: 1.2; }
details.week > summary .wk small { display: block; color: var(--muted); font-weight: 500; }
details.week > summary .cnt { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
details.week > summary .cnt .bar { margin-top: 5px; }
details.week.done > summary .wk { background: var(--ok-soft); color: var(--ok); }
details.week.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow); }
details.week .body { padding: 0 20px 14px; }
.dayrow { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.dayrow .d { font-size: 0.8rem; color: var(--muted); padding-top: 18px; font-variant-numeric: tabular-nums; font-weight: 600; }
.dayrow.today .d { color: var(--accent); }
.dayrow.today .d::before { content: "● "; }
.phase { display: flex; align-items: center; gap: 10px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; margin: 26px 0 4px; }
.phase::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

/* ---------- problem workspace ---------- */
.ws { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.ws > * { min-width: 0; }
.ws .brief { display: grid; gap: 14px; min-width: 0; }
.ws .editor-col { display: grid; gap: 12px; position: sticky; top: 18px; }
.crumbs { font-size: 0.85rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.pyhint { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: linear-gradient(135deg, var(--accent-soft), transparent 130%); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.pyhint .ico { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.pyhint .ico svg { width: 17px; height: 17px; }
.editor-shell { border-radius: var(--r); overflow: hidden; background: var(--code-bg); box-shadow: var(--shadow-lg); border: 1px solid #1F2847; }
.editor-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--code-gutter); border-bottom: 1px solid #1F2847; }
.editor-bar .dots { display: flex; gap: 6px; align-items: center; }
.editor-bar .dots i { width: 10px; height: 10px; border-radius: 99px; background: #2A3458; }
.editor-bar .file { font: 500 0.8rem var(--f-mono); color: var(--code-muted); margin-left: 8px; }
.editor-bar .btn { background: #1B2442; border-color: #2A3458; color: var(--code-ink); padding: 5px 10px; font-size: 0.8rem; border-radius: 8px; }
.editor-bar > .row { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
button.timer { border: 0; cursor: pointer; }
.editor-bar .btn:hover { border-color: var(--accent-2); color: #fff; }
.editor-bar .btn.primary { background: linear-gradient(180deg, #6C8BFF, #3F66F2); border-color: transparent; color: #fff; }
.timer { font: 600 0.92rem var(--f-mono); font-variant-numeric: tabular-nums; color: var(--code-ink); background: #1B2442; border-radius: 8px; padding: 5px 10px; display: inline-flex; align-items: center; gap: 6px; }
.timer::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: #4FD1A8; box-shadow: 0 0 0 3px rgba(79, 209, 168, 0.18); }
.timer.paused::before { background: #F2B84B; box-shadow: 0 0 0 3px rgba(242, 184, 75, 0.18); }
.CodeMirror { height: 460px; font-family: var(--f-mono); font-size: 14px; line-height: 1.6; }
.editor-foot { padding: 8px 14px; font-size: 0.76rem; color: var(--code-muted); border-top: 1px solid #1F2847; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.lintstat { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--code-muted); font: 600 0.76rem var(--f-body); cursor: pointer; }
.lintstat::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: #4A5580; }
.lintstat.ls-clean { color: #7FE0BE; } .lintstat.ls-clean::before { background: #4FD1A8; }
.lintstat.ls-warn { color: #F5D08F; } .lintstat.ls-warn::before { background: #F5C26B; }
.lintstat.ls-err { color: #FF9AAA; } .lintstat.ls-err::before { background: #FF6B81; }
.problems { display: grid; gap: 2px; padding: 6px 8px 8px; border-top: 1px solid #1F2847; max-height: 150px; overflow: auto; }
.problems button { text-align: left; background: none; border: 0; color: var(--code-ink); font: 0.8rem var(--f-body); padding: 5px 8px; border-radius: 6px; cursor: pointer; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; }
.problems button:hover { background: #1B2442; }
.problems .loc { font-family: var(--f-mono); color: var(--code-muted); }
.problems .code { font-family: var(--f-mono); color: var(--code-muted); background: none; padding: 0; }
.problems .e { color: #FF9AAA; } .problems .w { color: #F5D08F; }
kbd { font: 600 0.72rem var(--f-mono); background: #1B2442; color: var(--code-ink); border: 1px solid #2A3458; border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.results { display: grid; gap: 8px; }
.res { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; font-size: 0.85rem; background: var(--surface); box-shadow: var(--shadow-sm); }
.res.pass { border-left: 4px solid var(--ok); }
.res.fail { border-left: 4px solid var(--bad); }
.res .k { color: var(--muted); font-weight: 600; }
.res pre, pre.out { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; font-size: 0.8rem; background: var(--sunk); border-radius: 7px; padding: 8px 10px; }
.summary-line { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.summary-line.ok { color: var(--ok); } .summary-line.bad { color: var(--bad); }
.scorebar { display: flex; gap: 3px; margin-top: 8px; }
.scorebar i { flex: 1; height: 6px; border-radius: 99px; background: var(--bad); opacity: 0.85; }
.scorebar i.p { background: var(--ok); }
pre.code { background: var(--code-bg); color: var(--code-ink); border-radius: 11px; padding: 14px 16px; overflow-x: auto; font-size: 0.84rem; line-height: 1.6; margin: 0; }
.tests-list { font-family: var(--f-mono); font-size: 0.79rem; display: grid; gap: 6px; }
.tests-list div { background: var(--sunk); border-radius: 8px; padding: 7px 10px; overflow-x: auto; white-space: nowrap; }
label.f { display: grid; gap: 5px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
input[type="text"], input[type="search"], textarea, select { font: 0.92rem var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; width: 100%; transition: border-color 0.15s, box-shadow 0.15s; }
input[type="text"]:focus, input[type="search"]:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
textarea { min-height: 92px; resize: vertical; }
.saved { font-size: 0.76rem; color: var(--muted); }
.saved::before { content: "● "; color: var(--ok); }
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.searchbox input { padding-left: 38px; height: 46px; border-radius: 12px; box-shadow: var(--shadow-sm); }

/* ---------- prose / playbook ---------- */
.prose { max-width: 74ch; }
.prose p { margin: 0.4rem 0 0.8rem; }
.prose ol, .prose ul { padding-left: 1.2rem; margin: 0.4rem 0 1rem; }
.prose li { margin: 0.35rem 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 10px 0 16px; box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
.checks label { display: flex; gap: 12px; align-items: flex-start; padding: 9px 12px; cursor: pointer; border-radius: 10px; }
.checks label:hover { background: var(--sunk); }
.checks input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ok); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; position: sticky; top: 0; z-index: 5; padding: 10px 0; background: linear-gradient(var(--bg) 70%, transparent); }
.toc a { font-size: 0.82rem; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.toc a:hover { border-color: var(--accent); color: var(--accent); }
section.pb { margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); max-width: none; }
section.pb h2 { margin-bottom: 8px; }
.tpl { display: grid; gap: 8px; margin-bottom: 18px; }

/* ---------- daily routine ---------- */
.routine-card { padding-bottom: 12px; }
.routine-progress { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.routine-progress .bar { width: 120px; margin: 0; }
ol.routine { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 0; position: relative; }
ol.routine::before { content: ""; position: absolute; left: 19px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
ol.routine li { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 8px 8px 0; border-radius: 10px; }
ol.routine li:hover { background: color-mix(in srgb, var(--sunk) 70%, transparent); }
ol.routine .n { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; margin-left: 6px; border-radius: 99px; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); font: 700 0.75rem var(--f-mono); transition: all 0.15s; }
ol.routine li.ticked .n { background: var(--ok); border-color: var(--ok); color: #fff; }
ol.routine li.ticked .n .num { display: none; }
ol.routine li .n .tick { display: none; }
ol.routine li.ticked .n .tick { display: block; }
ol.routine label { cursor: pointer; display: block; }
ol.routine li.ticked label { color: var(--muted); }
ol.routine li.ticked label .txt { text-decoration: line-through; text-decoration-color: var(--line-strong); }
ol.routine li.next-up { background: var(--accent-soft); }
ol.routine li.next-up .n { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
ol.routine input { position: absolute; opacity: 0; pointer-events: none; }
ol.routine .auto { font: 700 0.62rem var(--f-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); border: 1px solid var(--line); border-radius: 99px; padding: 2px 7px; }

/* ---------- mock timer ---------- */
.mock { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.clockcard { background: radial-gradient(130% 120% at 0% 0%, #22306A 0%, #111833 70%); color: #fff; border-radius: 18px; padding: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; align-content: start; }
.clockcard .eyebrow { color: rgba(255, 255, 255, 0.65); }
.clock { font: 700 clamp(3.4rem, 9vw, 6rem) var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1; }
.clockcard .btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); color: #fff; }
.clockcard .btn:hover { border-color: #fff; color: #fff; }
.clockcard .btn.primary { background: #fff; color: #172C80; border-color: #fff; box-shadow: none; }
.clockcard .pill { background: rgba(255, 255, 255, 0.14); color: #fff; }
.clockcard a:not(.btn) { color: #fff; }
.clockbar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.clockbar i { display: block; height: 100%; background: linear-gradient(90deg, #4FD1A8, #F2B84B 70%, #FF8098); border-radius: 99px; transition: width 1s linear; }
.steps { display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); transition: all 0.2s; }
.step .t { font: 600 0.8rem var(--f-mono); color: var(--muted); padding-top: 2px; }
.step.now { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-glow); transform: translateX(4px); }
.step.now .t { color: var(--accent); }
.step.done { opacity: 0.55; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11px var(--f-body); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.84rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 0.8rem; padding: 7px 10px; border-radius: 8px; z-index: 50; white-space: nowrap; box-shadow: var(--shadow-lg); }
.pbars { display: grid; gap: 10px; }
.pbar { display: grid; grid-template-columns: minmax(130px, 240px) minmax(0, 1fr) 76px; gap: 12px; align-items: center; font-size: 0.86rem; }
.pbar .track { height: 10px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.pbar .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.pbar.weak .fill { background: var(--bad); }
.pbar .v { font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); text-align: right; }

/* ---------- notes ---------- */
.notecard { display: grid; gap: 6px; transition: transform 0.15s, box-shadow 0.15s; }
.notecard:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.notecard .title a { font-size: 1.02rem; }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 12px; font-size: 0.9rem; }
.kv dt { color: var(--muted); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.kv dd { margin: 0; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 0.9rem; z-index: 60; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px; }
.toast .btn { background: var(--surface); color: var(--ink); }
#mock-pill { border-radius: 99px !important; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 48px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  background: radial-gradient(120% 120% at 0% 0%, #3B63F0 0%, #1E3AA8 45%, #0E1638 100%); }
.login-art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px); background-size: 20px 20px; pointer-events: none; }
.login-art > * { position: relative; z-index: 1; }
.login-art h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); color: #fff; max-width: 15ch; }
.login-art p { color: rgba(255, 255, 255, 0.82); max-width: 46ch; font-size: 1.02rem; }
.snippet { background: rgba(8, 12, 30, 0.55); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 16px 18px; font: 0.84rem/1.7 var(--f-mono); color: #DCE3FF; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); max-width: 460px; backdrop-filter: blur(6px); }
.snippet .k { color: #C9A7FF; } .snippet .s { color: #7FE0BE; } .snippet .c { color: #8892BF; } .snippet .ok { color: #7FE0BE; font-weight: 600; }
.feature-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.feature-list li { display: flex; gap: 10px; align-items: center; color: rgba(255, 255, 255, 0.88); font-size: 0.95rem; }
.feature-list li::before { content: "✓"; width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); font-size: 0.75rem; font-weight: 800; flex: none; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login { max-width: 400px; width: 100%; display: grid; gap: 16px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; box-shadow: var(--shadow); transition: all 0.15s; }
.gbtn:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.gbtn svg { width: 20px; height: 20px; }
.err { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .ws { grid-template-columns: minmax(0, 1fr); }
  .ws .editor-col { position: static; }
  .mock { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-art { min-height: auto; }
  .snippet { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: column; padding: 10px 12px; gap: 8px; }
  .brand small, .nav-label { display: none; }
  .nav { display: flex; overflow-x: auto; gap: 2px; width: 100%; scrollbar-width: none; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .nav a svg { display: none; }
  .side .who { display: none; }
  .main { padding-top: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .ring { width: 92px; height: 92px; }
  details.week > summary { grid-template-columns: auto minmax(0, 1fr); }
  details.week > summary .cnt { grid-column: 1 / -1; text-align: left; }
  .dayrow { grid-template-columns: minmax(0, 1fr); }
  .dayrow .d { padding-top: 8px; }
  .pbar { grid-template-columns: minmax(0, 1fr) 64px; }
  .pbar .track { grid-column: 1 / -1; grid-row: 2; }
  .next div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  ol.routine li { grid-template-columns: 40px minmax(0, 1fr); }
  ol.routine .auto { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.cm-error-line { background: rgba(255, 107, 129, 0.14); box-shadow: inset 3px 0 0 #FF6B81; }
.linklike { background: none; border: 0; padding: 0; margin-left: 8px; color: var(--accent); font: 600 0.8rem var(--f-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
