/* PySD বাংলা — metro-line নকশা
   দুইটা line: Python (নীল) আর System Design (সবুজ)। বাকি সব শান্ত, পড়ার জন্য। */

:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #eaf0ec;
  --ink: #17201d;
  --muted: #56635e;
  --rule: #d6dfda;
  --py: #2c6bb3;
  --sd: #0f8061;
  --yl: #b98200;
  --rd: #c2413b;
  --vi: #6e4bb5;
  --code-bg: #f4f7f5;
  --code-ink: #1d2724;
  --focus: #2c6bb3;
  --font-body: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, sans-serif;
  --font-display: 'Baloo Da 2', 'Hind Siliguri', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --measure: 46rem;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e1412;
    --surface: #141c19;
    --surface-2: #1b2522;
    --ink: #e2e9e5;
    --muted: #98a6a0;
    --rule: #27332f;
    --py: #74a9e8;
    --sd: #40c79c;
    --yl: #f0c04a;
    --rd: #f07a72;
    --vi: #ae92ee;
    --code-bg: #111916;
    --code-ink: #dbe4df;
    --focus: #74a9e8;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0e1412;
  --surface: #141c19;
  --surface-2: #1b2522;
  --ink: #e2e9e5;
  --muted: #98a6a0;
  --rule: #27332f;
  --py: #74a9e8;
  --sd: #40c79c;
  --yl: #f0c04a;
  --rd: #f07a72;
  --vi: #ae92ee;
  --code-bg: #111916;
  --code-ink: #dbe4df;
  --focus: #74a9e8;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.8;
  overflow-x: hidden;
}
a { color: var(--py); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.3; font-weight: 700; margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }
kbd { font-family: var(--font-mono); font-size: 0.75rem; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.topbar-in { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.mainnav { display: flex; gap: 4px; margin-left: 12px; }
.mainnav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.mainnav a:hover { color: var(--ink); background: var(--surface-2); }
.mainnav a[aria-current='page'] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn, .search-btn { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn { width: 38px; height: 38px; }
.search-btn { gap: 8px; padding: 4px 10px 4px 12px; color: var(--muted); font-size: 0.95rem; }
.search-btn:hover, .icon-btn:hover { border-color: var(--muted); color: var(--ink); }
.menu-btn { display: none; }
.i-moon { display: none; }
:root[data-theme='dark'] .i-sun { display: none; }
:root[data-theme='dark'] .i-moon { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .i-sun { display: none; }
  :root:not([data-theme='light']) .i-moon { display: inline-flex; }
}

/* ---------- layout ---------- */
.shell { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.shell.narrow { max-width: 900px; padding-top: 40px; padding-bottom: 60px; }
.shell.with-side { max-width: 1440px; display: grid; grid-template-columns: 290px minmax(0, 1fr) 230px; gap: 40px; padding: 0 20px; }
.main { min-width: 0; padding: 36px 0 64px; }

/* ---------- metro line lists (sidebar, track pages) ---------- */
.line { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.line::before { content: ''; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--line, var(--py)); }
.line.python { --line: var(--py); }
.line.sd { --line: var(--sd); }
.stn { position: relative; }
.stn::before { content: ''; position: absolute; left: -24px; top: 0.62em; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line, var(--py)); }
.stn.done::before { background: var(--line, var(--py)); }
.stn.cur::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--line) 25%, transparent); }
.stn.soon { color: var(--muted); }
.stn.soon::before { border-style: dashed; border-color: var(--muted); }
.stn small { color: var(--muted); font-size: 0.78rem; margin-left: 6px; }

/* sidebar */
.sidebar { position: sticky; top: 61px; align-self: start; max-height: calc(100vh - 61px); overflow-y: auto; padding: 28px 10px 40px 0; font-size: 0.95rem; line-height: 1.55; scrollbar-width: thin; }
.side-head { display: inline-block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; text-decoration: none; color: var(--ink); padding-left: 2px; }
.side-head.python { color: var(--py); }
.side-head.sd { color: var(--sd); }
.side-part { margin-top: 18px; }
.side-part-title { margin: 0 0 6px; font-weight: 600; font-size: 0.88rem; color: var(--muted); }
.side-part-title span { font-weight: 400; margin-left: 4px; }
.sidebar .stn { padding: 4px 0; }
.sidebar .stn a { color: var(--ink); text-decoration: none; display: block; }
.sidebar .stn a:hover { color: var(--line); }
.sidebar .stn.cur a { font-weight: 700; color: var(--line); }

/* progress */
.progress { margin: 10px 0 4px; }
.progress .bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--py); border-radius: 6px; transition: width 0.4s ease; }
.progress[data-progress='sd'] .bar span, .track-sd .progress .bar span { background: var(--sd); }
.progress-text { margin: 4px 0 0; font-size: 0.82rem; color: var(--muted); }

/* ---------- chapter ---------- */
.chapter { max-width: var(--measure); }
.crumbs { font-size: 0.9rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.chapter h1 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem); margin-top: 10px; }
.chapter.python h1 { color: var(--ink); }
.chapter-desc { font-size: 1.12rem; color: var(--muted); margin: 8px 0 14px; }
.chapter-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
.chip { display: inline-block; font-size: 0.85rem; padding: 2px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
a.chip:hover { background: color-mix(in srgb, var(--py) 18%, var(--surface-2)); }

.prose > * + * { margin-top: 1.05em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font-size: 1.65rem; margin-top: 2.2em; padding-top: 0.2em; position: relative; }
.prose h3 { font-size: 1.28rem; margin-top: 1.8em; position: relative; }
.prose h4 { font-size: 1.08rem; margin-top: 1.4em; }
.prose .anchor { position: absolute; left: -1.1em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.chapter.python .prose h2::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--py); margin-bottom: 12px; }
.chapter.sd .prose h2::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--sd); margin-bottom: 12px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose li > ul, .prose li > ol { margin-top: 0.35em; }
.prose strong { font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }
.prose :not(pre) > code { font-family: var(--font-mono); font-size: 0.84em; background: var(--surface-2); padding: 0.12em 0.4em; border-radius: 5px; word-break: break-word; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--rule); color: var(--muted); }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.6; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* code */
.code { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 4px 14px; border-bottom: 1px solid var(--rule); font-size: 0.8rem; color: var(--muted); background: var(--surface-2); }
.copy-btn { font: inherit; font-size: 0.78rem; color: var(--muted); background: transparent; border: 1px solid var(--rule); border-radius: 6px; padding: 1px 10px; cursor: pointer; }
.copy-btn:hover { color: var(--ink); border-color: var(--muted); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.65; color: var(--code-ink); tab-size: 4; }
.code code { font-family: inherit; }
.hljs-keyword, .hljs-meta .hljs-keyword, .hljs-built_in.hljs-keyword { color: var(--vi); font-weight: 600; }
.hljs-string, .hljs-regexp, .hljs-meta .hljs-string { color: var(--sd); }
.hljs-number, .hljs-literal { color: var(--yl); }
.hljs-comment, .hljs-quote { color: var(--muted); font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-title.class_ { color: var(--py); font-weight: 600; }
.hljs-built_in, .hljs-type { color: var(--rd); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-params { color: var(--ink); }
.hljs-meta, .hljs-decorator, .hljs-symbol { color: var(--yl); }
.hljs-section, .hljs-name, .hljs-selector-tag { color: var(--py); }
.hljs-addition { color: var(--sd); }
.hljs-deletion { color: var(--rd); }

/* callouts */
.callout { border-radius: var(--radius); padding: 14px 18px; background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--c, var(--py)); }
.callout > * + * { margin-top: 0.6em; }
.callout p { margin: 0; }
.callout .callout-title { font-weight: 700; color: var(--c, var(--py)); font-family: var(--font-display); font-size: 1.05rem; }
.callout.tip { --c: var(--sd); }
.callout.note { --c: var(--py); }
.callout.warning { --c: var(--yl); }
.callout.danger { --c: var(--rd); }
.callout.example, .callout.bd { --c: var(--vi); }
.callout.ai { --c: var(--py); background: color-mix(in srgb, var(--py) 6%, var(--surface)); }
.callout.task { --c: var(--sd); background: color-mix(in srgb, var(--sd) 6%, var(--surface)); }

/* self check (details) */
.prose details { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 0 16px; }
.prose details + details { margin-top: 10px; }
.prose summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style-position: outside; }
.prose details[open] summary { border-bottom: 1px dashed var(--rule); margin-bottom: 10px; }
.prose details > :last-child { margin-bottom: 14px; }

/* diagram (inline SVG) */
.prose figure { margin: 1.6em 0; padding: 18px 14px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.prose figcaption { margin-top: 10px; font-size: 0.9rem; color: var(--muted); text-align: center; line-height: 1.6; }
svg.dg { display: block; width: 100%; height: auto; margin: 0 auto; font-family: var(--font-body); overflow: visible; }
.dg text { fill: var(--ink); font-size: 15px; }
.dg .t { text-anchor: middle; dominant-baseline: central; }
.dg .s { font-size: 12.5px; fill: var(--muted); }
.dg .b { font-weight: 700; }
.dg .bx { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.4; }
.dg .bx.p { fill: color-mix(in srgb, var(--py) 13%, var(--surface)); stroke: var(--py); }
.dg .bx.g { fill: color-mix(in srgb, var(--sd) 13%, var(--surface)); stroke: var(--sd); }
.dg .bx.y { fill: color-mix(in srgb, var(--yl) 15%, var(--surface)); stroke: var(--yl); }
.dg .bx.r { fill: color-mix(in srgb, var(--rd) 12%, var(--surface)); stroke: var(--rd); }
.dg .bx.v { fill: color-mix(in srgb, var(--vi) 13%, var(--surface)); stroke: var(--vi); }
.dg .bx.n { fill: none; stroke: var(--muted); stroke-dasharray: 6 5; }
.dg .ln { stroke: var(--muted); stroke-width: 1.7; fill: none; marker-end: url(#ar); }
.dg .ln.p { stroke: var(--py); marker-end: url(#arp); }
.dg .ln.g { stroke: var(--sd); marker-end: url(#arg); }
.dg .ln.r { stroke: var(--rd); marker-end: url(#arr); }
.dg .ln.y { stroke: var(--yl); marker-end: url(#ary); }
.dg .ln.d { stroke-dasharray: 6 5; }
.dg .ln.no { marker-end: none; }
.dg .ln.both { marker-start: url(#ar); }
.dg .fp { fill: var(--py); }
.dg .fg { fill: var(--sd); }
.dg .fr { fill: var(--rd); }
.dg .fy { fill: var(--yl); }
.dg .fv { fill: var(--vi); }
.dg .fm { fill: var(--muted); }
.dg .tp { fill: var(--py); }
.dg .tg { fill: var(--sd); }
.dg .tr { fill: var(--rd); }
.dg .ty { fill: var(--yl); }
.dg .tv { fill: var(--vi); }
.dg .mono { font-family: var(--font-mono); font-size: 12.5px; }
.mk { fill: var(--muted); }
.mk.p { fill: var(--py); }
.mk.g { fill: var(--sd); }
.mk.r { fill: var(--rd); }
.mk.y { fill: var(--yl); }

/* chapter end */
.chapter-end { margin-top: 56px; padding: 22px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-align: center; }
.chapter-end p { margin: 10px 0 0; }
.done-btn { font: inherit; font-weight: 600; cursor: pointer; padding: 10px 22px; border-radius: 999px; border: 2px solid var(--line-c, var(--py)); background: transparent; color: var(--ink); }
.track-sd .done-btn { --line-c: var(--sd); }
.done-btn .when-done { display: none; }
.done-btn.is-done { background: var(--line-c, var(--py)); color: #fff; }
:root[data-theme='dark'] .done-btn.is-done { color: #0e1412; }
.done-btn.is-done .when-done { display: inline; }
.done-btn.is-done .when-todo { display: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.pager a { display: flex; flex-direction: column; padding: 14px 18px; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); line-height: 1.5; }
.pager a:hover { border-color: var(--muted); }
.pager .next { text-align: right; }
.pager small { color: var(--muted); }
.pager span { font-weight: 600; margin-top: 2px; }

/* on this page */
.otp { position: sticky; top: 61px; align-self: start; max-height: calc(100vh - 61px); overflow-y: auto; padding: 36px 0 30px; font-size: 0.87rem; line-height: 1.5; }
.otp-title { margin: 0 0 8px; font-weight: 700; }
.otp ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.otp li a { display: block; padding: 4px 0 4px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.otp li.d3 a { padding-left: 24px; font-size: 0.83rem; }
.otp li a:hover { color: var(--ink); }
.otp li a.on { color: var(--ink); border-left-color: var(--py); font-weight: 600; }
.track-sd .otp li a.on { border-left-color: var(--sd); }

/* ---------- buttons ---------- */
.btn { display: inline-block; padding: 9px 20px; border-radius: 999px; text-decoration: none; font-weight: 600; border: 2px solid var(--b, var(--py)); background: var(--b, var(--py)); color: #fff; line-height: 1.4; }
:root[data-theme='dark'] .btn:not(.ghost) { color: #0e1412; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .btn:not(.ghost) { color: #0e1412; } :root:not([data-theme='light']) .done-btn.is-done { color: #0e1412; } }
.btn.sd { --b: var(--sd); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--muted); }

/* ---------- home ---------- */
.hero { border-bottom: 1px solid var(--rule); background: var(--surface); }
.hero-in { max-width: 1240px; margin: 0 auto; padding: 56px 20px 8px; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem); line-height: 1.2; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; margin: 18px 0 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 0; }
.continue { margin: 16px 0 0; color: var(--muted); }
.metro-wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 28px; }
.metro-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-size: 0.92rem; margin-bottom: 4px; }
.lg { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.lg::before { content: ''; width: 26px; height: 5px; border-radius: 5px; background: var(--py); }
.lg.sd::before { background: var(--sd); }
.metro-scroll { overflow-x: auto; padding: 4px 0; }
.metro { min-width: 980px; width: 100%; height: auto; font-family: var(--font-body); }
.m-line { stroke-width: 9; stroke-linecap: round; fill: none; }
.m-line.python { stroke: var(--py); }
.m-line.sd { stroke: var(--sd); }
.m-link { stroke: var(--rule); stroke-width: 5; }
.m-dot { fill: var(--surface); stroke-width: 4.5; }
.m-dot.python { stroke: var(--py); }
.m-dot.sd { stroke: var(--sd); }
.m-dot.python.half { fill: color-mix(in srgb, var(--py) 40%, var(--surface)); }
.m-dot.sd.half { fill: color-mix(in srgb, var(--sd) 40%, var(--surface)); }
.m-dot.python.full { fill: var(--py); }
.m-dot.sd.full { fill: var(--sd); }
.m-num { fill: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 22px; text-anchor: middle; }
.m-name { fill: var(--muted); font-size: 14px; text-anchor: middle; }
.mstn:hover .m-name, .mstn:focus .m-name { fill: var(--ink); }
.mstn:hover .m-dot { stroke-width: 6; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; padding-top: 56px; padding-bottom: 20px; }
.home-track h2 { font-size: 1.6rem; }
.home-track.python h2 { color: var(--py); }
.home-track.sd h2 { color: var(--sd); }
.home-track > p { color: var(--muted); margin: 10px 0 0; }
.home-track .line { margin-top: 20px; }
.home-track .stn { padding: 7px 0; line-height: 1.5; }
.home-track .stn span { display: block; font-weight: 600; }
.home-track .stn small { margin-left: 0; }
.home-track-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.how { padding-top: 48px; padding-bottom: 72px; }
.how h2 { font-size: 1.6rem; }
.how-steps { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 40px; }
.how-steps li { counter-increment: s; position: relative; padding-left: 52px; color: var(--muted); }
.how-steps li strong { color: var(--ink); display: block; }
.how-steps li::before { content: counter(s, bengali); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: var(--ink); }

/* ---------- track pages ---------- */
.track-head { padding-bottom: 26px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
.track-kicker { margin: 0 0 6px; font-weight: 600; color: var(--muted); }
.track-head.python .track-kicker { color: var(--py); }
.track-head.sd .track-kicker { color: var(--sd); }
.track-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8rem); }
.track-head .lede { color: var(--muted); font-size: 1.12rem; margin: 12px 0 18px; }
.track-part { padding-top: 34px; }
.track-part h2 { font-size: 1.45rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.part-no { font-size: 0.95rem; color: var(--muted); font-weight: 600; font-family: var(--font-body); }
.part-month { margin: 2px 0 14px; color: var(--muted); font-size: 0.95rem; }
.line.big .stn { padding: 2px 0; }
.line.big .stn > a, .line.big .stn > div { display: block; padding: 10px 14px; margin-left: 6px; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.line.big .stn > a:hover { background: var(--surface); }
.line.big .stn::before { top: 1.15em; }
.stn-title { display: block; font-weight: 600; font-size: 1.05rem; }
.stn-desc { display: block; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }
.line.big .stn small { margin-left: 0; }

/* ---------- roadmap ---------- */
.plan { padding: 26px 0 10px; }
.plan h2 { font-size: 1.4rem; }
.plan > p { color: var(--muted); margin: 6px 0 0; }
.plan-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-list li { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; line-height: 1.55; }
.plan-list strong { display: block; }
.plan-list span { color: var(--py); font-weight: 600; font-size: 0.95rem; }
.plan-list p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }
.month-jump { position: sticky; top: 61px; z-index: 5; background: var(--bg); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 0; margin-top: 26px; border-bottom: 1px solid var(--rule); }
.month-jump span { color: var(--muted); font-size: 0.9rem; margin-right: 6px; }
.month-jump a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--rule); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.95rem; background: var(--surface); }
.month-jump a:hover { border-color: var(--py); }
.month-jump a.complete { background: var(--py); border-color: var(--py); color: #fff; }
.month { padding: 40px 0 34px; border-bottom: 1px solid var(--rule); scroll-margin-top: 130px; }
.month-no { margin: 0; font-weight: 700; color: var(--py); }
.month-head h2 { font-size: 1.9rem; }
.month-goal { margin: 8px 0 0; color: var(--muted); font-size: 1.05rem; }
.month-progress { margin: 6px 0 0; font-size: 0.88rem; color: var(--muted); }
.month-read { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 22px; }
.read-label { margin: 0 0 8px; font-weight: 700; }
.read-label.python { color: var(--py); }
.read-label.sd { color: var(--sd); }
.month-read .stn { padding: 3px 0; line-height: 1.55; }
.month-read .none { list-style: none; color: var(--muted); font-size: 0.95rem; }
.weeks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.week { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.week-title { margin: 0 0 6px; font-weight: 700; }
.tasks { list-style: none; padding: 0; margin: 0; }
.tasks li + li { margin-top: 4px; }
.tasks label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; line-height: 1.55; font-size: 0.97rem; }
.tasks input { margin-top: 0.3em; width: 18px; height: 18px; flex: none; accent-color: var(--py); }
.tasks input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.tasks code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface-2); padding: 0 5px; border-radius: 4px; }
.soon-ref { border-bottom: 1px dashed var(--muted); }
.month-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.box { border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--rule); border-left: 5px solid var(--sd); background: var(--surface); }
.box.check { border-left-color: var(--yl); }
.box p { margin: 0; line-height: 1.6; }
.box-title { font-weight: 700; margin-bottom: 4px !important; }
.nf { text-align: left; padding-top: 80px; }
.nf h1 { font-size: 2.4rem; }

/* ---------- search ---------- */
.search { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--ink) 35%, transparent); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search[hidden] { display: none; }
.search-box { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); overflow: hidden; }
.search-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule); color: var(--muted); }
.search-row input { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-close { font: inherit; font-size: 0.85rem; border: 1px solid var(--rule); background: transparent; color: var(--muted); border-radius: 8px; padding: 2px 10px; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); line-height: 1.5; }
.search-results a:hover, .search-results a.sel { background: var(--surface-2); }
.search-results small { color: var(--muted); display: block; font-size: 0.85rem; }
.search-results .empty { padding: 14px; color: var(--muted); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); background: var(--surface); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 26px 20px 34px; font-size: 0.92rem; line-height: 1.6; }
.foot p { margin: 0 0 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .shell.with-side { grid-template-columns: 270px minmax(0, 1fr); gap: 34px; }
  .otp { display: none; }
}
@media (max-width: 900px) {
  body { font-size: 17px; }
  .shell.with-side { display: block; padding: 0 16px; }
  .menu-btn { display: inline-flex; }
  body:not(.page-chapter) .menu-btn { display: none; }
  .sidebar { position: fixed; top: 59px; left: 0; bottom: 0; width: min(330px, 86vw); max-height: none; z-index: 25; background: var(--bg); border-right: 1px solid var(--rule); padding: 20px 16px 40px; transform: translateX(-105%); transition: transform 0.25s ease; }
  body.side-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--ink) 30%, transparent); }
  .main { padding-top: 24px; }
  .home-grid, .how-steps, .month-read, .weeks, .month-foot, .plan-list { grid-template-columns: 1fr; }
  .home-grid { gap: 44px; }
  .prose .anchor { display: none; }
}
@media (max-width: 720px) {
  .topbar-in { gap: 10px; padding: 8px 16px; flex-wrap: wrap; }
  .mainnav { order: 5; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 2px; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: 38px; height: 38px; padding: 0; }
  .sidebar { top: 104px; }
  .shell, .hero-in, .metro-wrap, .foot-in { padding-left: 16px; padding-right: 16px; }
  .shell.narrow { padding-top: 28px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .prose figure { margin-left: -6px; margin-right: -6px; padding: 12px 8px 10px; }
  html { scroll-padding-top: 120px; }
  .month-jump { top: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .sidebar, .otp, .pager, .chapter-end, .foot, .search { display: none !important; }
  .shell.with-side { display: block; }
}
