/* DevNotes — styles */

:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e9eef5;
  --text: #172033;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e4e9f1;
  --border-strong: #d3dae6;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: #eef2ff;
  --primary-ink: #4338ca;
  --accent: #0891b2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --info-soft: #eff6ff;
  --violet-soft: #f5f3ff;
  --line: #c7cfdc;
  --node-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow: 0 12px 35px rgba(20, 35, 65, .07);
  --code-bg: #0f172a;
  --code-head: #162036;
  --code-text: #e2e8f0;
  --out-bg: #0b1324;
  --topbar-bg: rgba(255, 255, 255, .9);
  --hero-bg: linear-gradient(135deg, #ffffff, #f6f4ff 52%, #ecfbff);
  --grid-dot: rgba(100, 116, 139, .14);
  --radius: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --surface: #111827; --surface-2: #162033; --surface-3: #1d2a40;
    --text: #e6edf7; --text-2: #cbd5e1; --muted: #98a6ba; --faint: #6b7a90;
    --border: #243047; --border-strong: #31405b;
    --primary: #818cf8; --primary-2: #a78bfa; --primary-soft: #1c2342; --primary-ink: #c7d2fe;
    --accent: #22d3ee; --success: #34d399; --success-soft: #0d2a22; --danger: #f87171; --danger-soft: #2c1517;
    --warn: #fbbf24; --warn-soft: #2a2110; --info-soft: #132238; --violet-soft: #1f1a36;
    --line: #3a4a66; --node-shadow: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 12px 35px rgba(0, 0, 0, .35);
    --code-bg: #070b14; --code-head: #0e1626; --out-bg: #050913;
    --topbar-bg: rgba(11, 16, 32, .88);
    --hero-bg: linear-gradient(135deg, #111827, #17152c 55%, #0d2027);
    --grid-dot: rgba(148, 163, 184, .1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --surface: #111827; --surface-2: #162033; --surface-3: #1d2a40;
  --text: #e6edf7; --text-2: #cbd5e1; --muted: #98a6ba; --faint: #6b7a90;
  --border: #243047; --border-strong: #31405b;
  --primary: #818cf8; --primary-2: #a78bfa; --primary-soft: #1c2342; --primary-ink: #c7d2fe;
  --accent: #22d3ee; --success: #34d399; --success-soft: #0d2a22; --danger: #f87171; --danger-soft: #2c1517;
  --warn: #fbbf24; --warn-soft: #2a2110; --info-soft: #132238; --violet-soft: #1f1a36;
  --line: #3a4a66; --node-shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 12px 35px rgba(0, 0, 0, .35);
  --code-bg: #070b14; --code-head: #0e1626; --out-bg: #050913;
  --topbar-bg: rgba(11, 16, 32, .88);
  --hero-bg: linear-gradient(135deg, #111827, #17152c 55%, #0d2027);
  --grid-dot: rgba(148, 163, 184, .1);
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.7; font-size: 16px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
img, svg { max-width: 100%; }
code, pre, kbd, .node-sub, .ref-var, .ref-val, .bucket-items, .flow-arrow em, .qa-num { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: .08em .38em; border-radius: 6px; color: var(--primary-ink); white-space: normal; overflow-wrap: anywhere; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }
[hidden] { display: none !important; }

.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .1s linear; }

/* ------------------------------------------------------------ topbar */
.topbar { height: 64px; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 22px; padding: 0 22px; background: var(--topbar-bg); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: -.02em; flex-shrink: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 6px 16px rgba(79, 70, 229, .28); }
.topnav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow: hidden; }
.nav-link { text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.nav-link .soon-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); opacity: .6; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; color: var(--text-2); }
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.menu-btn { display: none; }
#themeBtn .i-moon { display: none; }
:root[data-theme="dark"] #themeBtn .i-sun { display: none; }
:root[data-theme="dark"] #themeBtn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeBtn .i-sun { display: none; }
  :root:not([data-theme="light"]) #themeBtn .i-moon { display: block; }
}

/* search */
.search { position: relative; width: 300px; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; color: var(--muted); }
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--text); }
.search input::-webkit-search-cancel-button { display: none; }
.search-kbd { font-family: var(--mono); font-size: 11px; color: var(--faint); border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; line-height: 18px; }
.search-results { position: absolute; top: calc(100% + 8px); right: 0; width: min(520px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.sr-item { display: block; text-decoration: none; color: var(--text); padding: 10px 12px; border-radius: 10px; }
.sr-item:hover, .sr-item.active { background: var(--primary-soft); }
.sr-path { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.sr-path b { color: var(--primary); font-weight: 700; }
.sr-title { font-weight: 600; font-size: 14px; line-height: 1.4; margin: 2px 0; }
.sr-snippet { font-size: 13px; color: var(--muted); line-height: 1.5; }
.sr-item mark { background: color-mix(in srgb, var(--warn) 25%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.sr-empty { padding: 18px 14px; color: var(--muted); font-size: 14px; text-align: center; }

/* ------------------------------------------------------------ shell & sidebar */
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, var(--bg)); padding: 20px 14px 40px; scrollbar-width: thin; }
.side-head { padding: 0 10px 14px; }
.side-title { font-weight: 800; font-size: 15px; }
.side-sub { font-size: 12px; color: var(--muted); }
.progress-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; margin: 0 0 18px; }
.progress-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; color: var(--text-2); }
.progress-top b { color: var(--primary); font-size: 12px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: inherit; transition: width .35s ease; }
.side-label { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--faint); padding: 14px 10px 6px; text-transform: uppercase; }
.side-topic { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; text-decoration: none; color: var(--text-2); padding: 7px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; border: 0; background: transparent; }
.side-topic:hover { background: var(--surface-2); }
.side-topic.is-soon { color: var(--faint); font-weight: 500; cursor: default; }
.side-topic.is-soon:hover { background: transparent; }
.chip { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--faint); border: 1px solid var(--border); }
.chip-live { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.side-chapters { margin: 2px 0 6px; }
.chapter-link { display: flex; gap: 8px; align-items: baseline; text-decoration: none; color: var(--muted); padding: 6px 10px 6px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; border-left: 2px solid transparent; }
.chapter-link:hover { background: var(--primary-soft); color: var(--primary-ink); }
.chapter-link.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; border-left-color: var(--primary); }
.chapter-link .num { color: var(--faint); font-family: var(--mono); font-size: 11px; flex-shrink: 0; }
.chapter-link .done-tick { margin-left: auto; color: var(--success); font-size: 12px; }
.scrim { display: none; }

/* ------------------------------------------------------------ generic page */
main { min-width: 0; outline: none; }
.page { max-width: 1240px; margin: 0 auto; padding: 44px 38px 80px; }
.eyebrow { font-size: 11px; letter-spacing: .16em; font-weight: 800; color: var(--primary); text-transform: uppercase; margin-bottom: 8px; }
.hero { padding: 50px 48px; border: 1px solid var(--border); border-radius: 24px; background: var(--hero-bg); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 18%, transparent), transparent); pointer-events: none; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -.045em; }
.hero h1 .grad { background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 720px; font-size: 17px; color: var(--muted); margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 10px 16px; border: 1px solid var(--border); font-weight: 700; font-size: 14px; text-decoration: none; background: var(--surface); color: var(--text); }
.btn:hover { border-color: var(--border-strong); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0b1020; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0b1020; } }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--primary); }
.hero-progress { margin-top: 22px; max-width: 420px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 44px; }
.stat { background: var(--surface); border: 1px solid var(--border); padding: 16px 18px; border-radius: 13px; display: flex; flex-direction: column; }
.stat b { font-size: 24px; letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.section-head h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }

.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 44px; }
.chapter-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 20px; min-height: 178px; transition: transform .18s, box-shadow .18s, border-color .18s; position: relative; }
.chapter-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.card-num { font-size: 11px; color: var(--primary); font-weight: 800; letter-spacing: .08em; display: flex; justify-content: space-between; }
.card-num .done { color: var(--success); letter-spacing: 0; }
.chapter-card h3 { margin: 8px 0 6px; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.chapter-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 16px; color: var(--faint); font-size: 12px; }
.card-foot .arrow { color: var(--primary); font-size: 17px; transition: transform .18s; }
.chapter-card:hover .arrow { transform: translateX(3px); }

.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; margin-bottom: 44px; }
.track-card { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.track-card h3 { margin: 0; font-size: 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.track-card h3 a { color: var(--text); text-decoration: none; }
.track-card h3 a:hover { color: var(--primary); }
.track-card > p { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; }
.topic-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--text-2); font-size: 14px; border: 1px solid var(--border); }
a.topic-row:hover { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-soft); }
.topic-row.is-soon { color: var(--faint); border-style: dashed; }

.empty-state { text-align: center; padding: 70px 20px; border: 1px dashed var(--border-strong); border-radius: 20px; background: var(--surface); }
.empty-state h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.03em; }
.empty-state p { color: var(--muted); margin: 0 auto 22px; max-width: 520px; }

/* ------------------------------------------------------------ reader */
.reader { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 860px) 250px; justify-content: center; gap: 48px; padding: 32px 40px 90px; }
.breadcrumb { font-size: 12.5px; color: var(--faint); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border-strong); }
.breadcrumb b { color: var(--text-2); font-weight: 600; }
.reader-head { display: flex; justify-content: space-between; gap: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.reader-head h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -.035em; line-height: 1.15; margin: 0 0 10px; }
.reader-head .subtitle { font-size: 16.5px; color: var(--muted); margin: 0; max-width: 680px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.complete-btn { align-self: flex-start; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; border-radius: 10px; padding: 9px 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 13.5px; }
.complete-btn:hover { border-color: var(--border-strong); }
.complete-btn.done { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); color: var(--success); }

.tabs-bar { position: sticky; top: 64px; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 13px 12px; color: var(--muted); font-size: 13.5px; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 0 7px; line-height: 18px; }
.tab.active .count { background: var(--primary-soft); color: var(--primary-ink); }
.practice-btn { flex-shrink: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 9px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; }
.practice-btn[aria-pressed="true"] { background: var(--violet-soft); color: var(--primary-2); border-color: color-mix(in srgb, var(--primary-2) 35%, transparent); }

.mobile-toc { display: none; margin: 0 0 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.mobile-toc summary { padding: 11px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.mobile-toc nav { padding: 0 8px 10px; }

/* note content */
.content { min-height: 50vh; }
.note-section { margin: 0 0 40px; }
.note-section h2 { position: relative; font-size: 25px; line-height: 1.3; margin: 0 0 12px; letter-spacing: -.02em; }
.note-section h2 .anchor { position: absolute; left: -26px; top: 0; padding-right: 8px; color: var(--faint); text-decoration: none; opacity: 0; font-weight: 500; }
.note-section h2:hover .anchor, .note-section h2 .anchor:focus { opacity: 1; }
.note-section h3 { font-size: 17.5px; margin: 26px 0 8px; letter-spacing: -.01em; }
.note-section h4 { font-size: 15px; margin: 20px 0 6px; }
.note-section p { color: var(--text-2); margin: 10px 0; }
.note-section ul, .note-section ol { color: var(--text-2); padding-left: 24px; margin: 10px 0; }
.note-section li { margin: 5px 0; padding-left: 2px; }
.note-section li::marker { color: var(--faint); }
.note-section strong { color: var(--text); }
.note-section li.li-yes, .note-section li.li-no { list-style: none; position: relative; }
.note-section li.li-yes::before, .note-section li.li-no::before { position: absolute; left: -22px; font-weight: 800; }
.note-section li.li-yes::before { content: "✓"; color: var(--success); }
.note-section li.li-no::before { content: "✕"; color: var(--danger); }
.is-mistakes ul, .is-best ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.is-mistakes li, .is-best li { margin: 0; padding: 10px 14px 10px 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); position: relative; }
.is-mistakes li::before, .is-best li::before { position: absolute; left: 14px; top: 10px; font-weight: 800; }
.is-mistakes li::before { content: "✕"; color: var(--danger); }
.is-best li::before { content: "✓"; color: var(--success); }
.is-mistakes li { border-color: color-mix(in srgb, var(--danger) 22%, var(--border)); }
.is-best li { border-color: color-mix(in srgb, var(--success) 22%, var(--border)); }

blockquote { margin: 16px 0; padding: 14px 18px; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 12px 12px 0; color: var(--text); font-size: 16.5px; font-weight: 500; }

/* callouts */
.callout { margin: 18px 0; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--border); border-left-width: 4px; background: var(--surface); }
.callout-title { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.callout-kind { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.callout-title strong { font-size: 15px; }
.callout-body { color: var(--text-2); margin-top: 4px; font-size: 15px; }
.callout-body p { margin: 0; }
.callout-body > * + * { margin-top: 8px; }
.callout-body ul { margin-bottom: 0; padding-left: 20px; }
.callout-body li + li { margin-top: 4px; }
.callout-tip { border-left-color: var(--success); background: var(--success-soft); }
.callout-tip .callout-kind { color: var(--success); }
.callout-note { border-left-color: var(--accent); background: var(--info-soft); }
.callout-note .callout-kind { color: var(--accent); }
.callout-warning { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-warning .callout-kind { color: var(--warn); }
.callout-important { border-left-color: var(--danger); background: var(--danger-soft); }
.callout-important .callout-kind { color: var(--danger); }
.callout-question { border-left-color: var(--primary-2); background: var(--violet-soft); }
.callout-question .callout-kind { color: var(--primary-2); }

/* tables */
.table-wrap { margin: 16px 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* code */
.code-block { margin: 16px 0; background: var(--code-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 25px rgba(16, 24, 39, .12); border: 1px solid rgba(148, 163, 184, .12); }
.code-head { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 14px; background: var(--code-head); color: #94a3b8; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.code-head .code-lang::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; margin-right: 8px; vertical-align: 1px; }
.code-block[data-lang="text"] .code-lang::before { background: #64748b; }
.copy-btn { border: 0; background: rgba(148, 163, 184, .14); color: #cbd5e1; border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 600; }
.copy-btn:hover { background: rgba(148, 163, 184, .26); }
.code-block pre { margin: 0; padding: 15px 18px; overflow-x: auto; color: var(--code-text); font: 13.5px/1.7 var(--mono); tab-size: 4; }
.code-block pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.tk-k { color: #c792ea; }
.tk-s { color: #a5d6a7; }
.tk-c { color: #7083a3; font-style: italic; }
.tk-a { color: #fbbf72; }
.tk-n { color: #f78c6c; }
.tk-t { color: #7dd3fc; }
.tk-f { color: #82aaff; }
.code-block.is-output { background: var(--out-bg); box-shadow: none; }
.code-block.is-output .code-head { background: transparent; height: 28px; color: #6ee7b7; border-bottom: 1px dashed rgba(148, 163, 184, .18); }
.code-block.is-output .code-lang::before { content: "▸"; width: auto; height: auto; background: none; border-radius: 0; margin-right: 6px; }
.code-block.is-output pre { color: #a7f3d0; padding-top: 10px; padding-bottom: 12px; }
.code-block:not(.is-output) + .code-block.is-output { margin-top: -10px; border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
.code-block:not(.is-output):has(+ .code-block.is-output) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ------------------------------------------------------------ diagrams */
.diagram { margin: 20px 0; padding: 22px 18px; border: 1px solid var(--border); border-radius: var(--radius); background-color: var(--surface-2); background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px); background-size: 16px 16px; overflow-x: auto; }
.diagram figcaption { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted); }
.node { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 64px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--node-shadow); text-align: center; line-height: 1.35; }
.node-title { font-weight: 650; font-size: 14px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.node-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.node code { white-space: nowrap; }
.badge { font-family: var(--font); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-ink); }
.badge-final { background: var(--danger-soft); color: var(--danger); }
.badge-new { background: var(--success-soft); color: var(--success); }
.badge-deprecated { background: var(--warn-soft); color: var(--warn); }

/* flow */
.flow-cols { display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 18px; }
.flow-col { display: flex; flex-direction: column; align-items: center; }
.flow-arrow { display: flex; flex-direction: column; align-items: center; color: var(--primary); font-size: 16px; line-height: 1; padding: 5px 0; }
.flow-arrow em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: 3px; font-family: var(--mono); }
.flow-multi .flow-col { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 16px; min-width: 170px; box-shadow: var(--node-shadow); }
.flow-multi .flow-col .node { box-shadow: none; background: var(--surface-2); border-color: var(--border); width: 100%; }
.flow-multi .flow-col > .node:first-child { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.flow-multi .flow-col > .node:first-child .node-title { color: var(--primary-ink); font-weight: 800; }
.flow-multi .flow-col:has(> .node:only-child) { background: none; border: 0; padding: 0; box-shadow: none; min-width: 0; }
.flow-multi .flow-col > .node:only-child { padding: 12px 18px; min-width: 150px; }
.flow-h .flow-col { flex-direction: row; flex-wrap: wrap; justify-content: center; row-gap: 10px; }
.flow-h .flow-arrow { padding: 0 8px; flex-direction: row; gap: 6px; }
.flow-h .flow-arrow em { margin: 0; }
.flow-v .flow-col > .node:first-child, .flow-up .flow-col > .node:first-child { border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }

/* tree: org chart */
.tree-scroll { min-width: max-content; display: flex; justify-content: center; }
.tree ul { margin: 0; padding: 0; list-style: none; }
.tree-chart ul { display: flex; justify-content: center; padding-top: 22px; position: relative; }
.tree-chart .tree-scroll > ul { padding-top: 0; }
.tree-chart li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 7px 0; }
.tree-chart li::before, .tree-chart li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--line); }
.tree-chart li::after { right: auto; left: 50%; border-left: 2px solid var(--line); }
.tree-chart li:only-child::before, .tree-chart li:only-child::after { display: none; }
.tree-chart li:only-child { padding-top: 0; }
.tree-chart li:first-child::before, .tree-chart li:last-child::after { border: 0 none; }
.tree-chart li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 9px 0 0; }
.tree-chart li:first-child::after { border-radius: 9px 0 0 0; }
.tree-chart ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--line); }
.tree-chart .tree-scroll > ul > li > .node { border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }

/* tree: outline */
.tree-outline .tree-scroll { justify-content: flex-start; }
.tree-outline li { position: relative; padding: 4px 0; }
.tree-outline ul ul { margin-left: 16px; padding-left: 24px; }
.tree-outline ul ul > li::before { content: ""; position: absolute; left: -24px; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.tree-outline ul ul > li:last-child::before { bottom: auto; height: 24px; }
.tree-outline ul ul > li::after { content: ""; position: absolute; left: -24px; top: 23px; width: 20px; border-top: 2px solid var(--line); }
.tree-outline .node { flex-direction: row; align-items: baseline; gap: 12px; padding: 7px 13px; text-align: left; }
.tree-outline .tree-scroll > ul > li > .node { border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }

/* refs (variable → object) */
.refs { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ref-row { display: flex; align-items: center; gap: 0; }
.ref-vars { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ref-var { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 10px; font-size: 13px; box-shadow: var(--node-shadow); white-space: nowrap; }
.ref-var b { font-family: var(--mono); color: var(--primary-ink); font-weight: 600; }
.ref-val { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 5px; padding: 0 6px; }
.ref-arrow { width: 56px; height: 2px; background: var(--primary); position: relative; margin: 0 8px; flex-shrink: 0; }
.ref-arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left: 8px solid var(--primary); border-right: 0; }
.ref-obj { align-items: flex-start; text-align: left; min-width: 130px; border-color: color-mix(in srgb, var(--primary) 40%, var(--border-strong)); }
.refs figcaption { margin-top: 2px; }

/* buckets */
.bucket-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.bucket { min-width: 120px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); overflow: hidden; }
.bucket-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-3); padding: 4px 10px; text-align: center; }
.bucket-items { display: flex; flex-direction: column; gap: 4px; padding: 8px; min-height: 40px; align-items: center; justify-content: center; }
.bucket-items span { font-family: var(--mono); font-size: 12px; background: var(--primary-soft); color: var(--primary-ink); border-radius: 6px; padding: 2px 8px; }
.bucket-items span.empty { background: none; color: var(--faint); font-family: var(--font); font-style: italic; }
.bucket.filled { border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }
.bucket.collision { border-color: color-mix(in srgb, var(--warn) 60%, var(--border-strong)); }
.bucket.collision .bucket-label { background: var(--warn-soft); color: var(--warn); }

/* interview Q&A */
.qa { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; margin: 10px 0; transition: border-color .15s; }
.qa[open] { border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.qa summary { list-style: none; display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; cursor: pointer; font-weight: 650; color: var(--text); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; margin-left: auto; color: var(--faint); font-weight: 500; font-size: 18px; line-height: 1.2; transition: transform .15s; }
.qa[open] summary::after { content: "–"; }
.qa-num { flex-shrink: 0; font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--primary-ink); background: var(--primary-soft); border-radius: 6px; padding: 1px 7px; margin-top: 3px; }
.qa-q { line-height: 1.5; }
.qa-a { padding: 0 16px 12px 16px; border-top: 1px dashed var(--border); margin: 0 16px; padding-left: 0; padding-right: 0; }
.qa-a > :first-child { margin-top: 10px; }

.filter-empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 14px; }

/* chapter footer */
.chapter-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--border); padding-top: 26px; margin-top: 54px; }
.footer-nav { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 14px 16px; }
.footer-nav:hover { border-color: var(--primary); }
.footer-nav small { display: block; color: var(--faint); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.footer-nav b { font-size: 15px; }
.footer-nav.next { text-align: right; }
.footer-nav.disabled { opacity: .55; pointer-events: none; }

/* right rail */
.rail { padding-top: 6px; }
.rail-inner { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; }
.rail-card { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 14px; }
.rail-title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 8px; }
.toc-link { display: block; color: var(--muted); text-decoration: none; font-size: 12.5px; line-height: 1.45; padding: 5px 8px; border-left: 2px solid var(--border); }
.toc-link:hover { color: var(--text); }
.toc-link.active { color: var(--primary-ink); border-left-color: var(--primary); font-weight: 600; background: var(--primary-soft); border-radius: 0 6px 6px 0; }
.toc-link .k { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-left: 4px; color: var(--primary-2); }
.next-link { display: block; color: var(--primary); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.next-link:hover { text-decoration: underline; }
.tip-card { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.tip-card b { font-size: 12.5px; color: var(--warn); }
.tip-card p { font-size: 12.5px; color: var(--text-2); margin: 6px 0 0; line-height: 1.55; }

.site-footer { border-top: 1px solid var(--border); color: var(--faint); font-size: 12.5px; padding: 22px 38px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.skeleton { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 12px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast { width: max-content; max-width: calc(100vw - 32px); text-align: center; position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; opacity: 0; transition: .2s; z-index: 80; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .reader { grid-template-columns: minmax(0, 860px); }
  .rail { display: none; }
  .mobile-toc { display: block; }
}
@media (max-width: 1100px) {
  .topnav { display: none; }
  .chapter-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 64px; left: 0; bottom: 0; height: auto; width: min(300px, 86vw); z-index: 45; transform: translateX(-102%); transition: transform .22s ease; background: var(--surface); box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: 64px 0 0 0; background: rgba(2, 6, 23, .45); z-index: 44; }
  .note-section h2 .anchor { display: none; }
}
@media (max-width: 760px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-name { display: none; }
  .search { width: auto; flex: 1; min-width: 0; }
  .search input { min-width: 0; width: 100%; }
  .top-actions { flex: 1; min-width: 0; }
  .search-kbd { display: none; }
  .search-results { right: -48px; }
  .page { padding: 22px 16px 60px; }
  .hero { padding: 30px 22px; border-radius: 18px; }
  .hero p { font-size: 15.5px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .chapter-grid { grid-template-columns: minmax(0, 1fr); }
  .reader { padding: 20px 16px 60px; }
  .reader-head { flex-direction: column; gap: 14px; }
  .note-section h2 { font-size: 22px; }
  .chapter-footer { grid-template-columns: minmax(0, 1fr); }
  .footer-nav.next { text-align: left; }
  .diagram { padding: 18px 12px; }
  .code-block pre { font-size: 12.5px; padding: 13px 14px; }
  .practice-btn .lbl { display: none; }
  .site-footer { padding: 20px 16px; }
}

@media print {
  .topbar, .sidebar, .rail, .tabs-bar, .chapter-footer, .complete-btn, .mobile-toc, .read-progress, .site-footer, .copy-btn { display: none !important; }
  .shell, .reader { display: block; padding: 0; }
  .note-section { break-inside: auto; }
  .code-block, .diagram, .qa { break-inside: avoid; }
  .qa:not([open]) .qa-a { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.buckets.is-array .bucket-row { gap: 0; }
.buckets.is-array .bucket { min-width: 58px; border-radius: 0; margin-left: -1px; }
.buckets.is-array .bucket:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.buckets.is-array .bucket:last-child { border-radius: 0 8px 8px 0; }
.buckets.is-array .bucket-label { font-family: var(--mono); text-transform: none; letter-spacing: 0; }
.node.decision { border-style: dashed; border-color: color-mix(in srgb, var(--warn) 60%, var(--border-strong)); background: var(--warn-soft); }
.node.decision .node-title { color: var(--warn); }
.branches { display: flex; gap: 16px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.branch { display: flex; flex-direction: column; align-items: center; }
.flow-h .branches { flex-direction: column; gap: 6px; }
.flow-h .branch { flex-direction: row; }
.section-head .btn { flex-shrink: 0; }
@media (max-width: 760px) { .section-head { flex-direction: column; align-items: flex-start; } }
.buckets.is-array .bucket-row { flex-wrap: nowrap; width: max-content; margin: 0 auto; }

/* ------------------------------------------------------------ support / donations */
.support-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 13.5px; text-decoration: none; }
.support-btn:hover { border-color: var(--primary); color: var(--primary-ink); }
.support-page { max-width: 920px; }
.support-hero h1 { font-size: clamp(30px, 4.5vw, 44px); line-height: 1.1; letter-spacing: -.04em; margin: 0 0 14px; }
.support-hero p { color: var(--text-2); font-size: 16.5px; line-height: 1.7; max-width: 680px; margin: 0 0 28px; }
.support-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-bottom: 18px; }
.support-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.support-box h2 { font-size: 17px; margin: 0 0 14px; }
.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.amount-chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 99px; padding: 8px 16px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.amount-chip:hover { border-color: var(--border-strong); }
.amount-chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
.amount-other { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.amount-other input { height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); padding: 0 12px; font: inherit; font-size: 15px; min-width: 0; width: 100%; }
.amount-other input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.amount-other input[aria-invalid="true"] { border-color: var(--danger); }
.amount-hint { font-size: 13px; color: var(--muted); margin: 8px 0 16px; min-height: 1.4em; }
.support-pay { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; }
.support-small { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.support-qr { text-align: center; }
.support-qr img { display: block; width: 220px; max-width: 100%; height: auto; margin: 0 auto 14px; background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--border); }
.upi-id { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.upi-id code { font-family: var(--mono); font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; overflow-wrap: anywhere; }
.upi-id .btn { padding: 7px 12px; font-size: 13px; }
.support-other { margin-bottom: 18px; }
.support-other ul { margin: 0; padding-left: 20px; color: var(--text-2); line-height: 1.8; }
.support-fine { font-size: 12.5px; color: var(--faint); line-height: 1.6; }
.support-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 36px 0 18px; padding: 16px 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--violet-soft); }
.support-card div { display: grid; gap: 3px; min-width: 0; }
.support-card b { font-size: 14.5px; }
.support-card span { font-size: 13.5px; color: var(--text-2); }
.support-card .btn { flex-shrink: 0; }
.support-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(8, 12, 24, .55); }
.support-dialog { width: min(440px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 26px 24px; text-align: center; box-shadow: var(--shadow); }
.support-dialog h2 { margin: 6px 0 10px; font-size: 21px; }
.support-dialog p { margin: 0 0 20px; color: var(--text-2); line-height: 1.6; }
.support-emoji { font-size: 36px; }
.support-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 760px) {
  .support-grid { grid-template-columns: 1fr; }
  .support-btn { padding: 0; width: 38px; justify-content: center; }
  .support-btn .lbl { display: none; }
  .support-card { flex-direction: column; align-items: flex-start; }
}
@media print { .support-btn, .support-card, .support-modal { display: none !important; } }
.support-hero p + p { margin-top: -14px; }
.support-personal { background: var(--success-soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 15px !important; color: var(--text) !important; }
.support-impact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 18px; }
.support-impact div { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.support-impact b { font-size: 18px; color: var(--primary-ink); }
.support-impact span { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.support-thanks { font-size: 15px; color: var(--text-2); margin: 4px 0 10px; }
.support-dialog p + p { margin-top: -10px; }
.support-dialog .support-small { margin: 14px 0 0; }
@media (max-width: 760px) { .support-impact { grid-template-columns: 1fr; } }
@media print { .support-inline { display: none !important; } }
.reader-head > div { min-width: 0; }
.reader-head h1, .hero h1, .content h2, .content h3 { overflow-wrap: break-word; }
.qa-q { min-width: 0; overflow-wrap: anywhere; }
.support-blessing { text-align: center; font-size: 14.5px; color: var(--text-2); margin: -4px 0 22px; line-height: 1.6; }
@media print { .support-blessing { display: none !important; } }

/* mid-chapter message — styled as a personal card, deliberately unlike the note callouts */
.support-inline {
  --si-saffron: #f59e0b; --si-rose: #ec4899; --si-violet: #8b5cf6;
  position: relative; margin: 40px auto; max-width: 560px; padding: 22px 24px 20px; text-align: center;
  border-radius: 22px; border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--si-saffron), var(--si-rose) 50%, var(--si-violet)) border-box;
  box-shadow: 0 14px 40px -18px rgba(236, 72, 153, .45);
  overflow: hidden;
}
.support-inline::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -20%, rgba(245, 158, 11, .14), transparent 60%),
              radial-gradient(90% 70% at 100% 120%, rgba(139, 92, 246, .12), transparent 60%);
}
.support-inline > * { position: relative; }
.si-ornament { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; margin-bottom: 8px; }
.si-ornament span { width: 54px; height: 1px; background: linear-gradient(90deg, transparent, var(--si-saffron)); }
.si-ornament span:last-child { background: linear-gradient(90deg, var(--si-violet), transparent); }
.si-blessing { font-family: "Kalam", var(--font); font-size: 21px; line-height: 1.45; font-weight: 400; color: var(--text); margin: 0 0 10px; }
.si-line { font-size: 13.5px; color: var(--muted); margin: 0 auto 16px; max-width: 440px; line-height: 1.55; }
.si-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 99px;
  font-weight: 700; font-size: 14px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, var(--si-saffron), var(--si-rose) 55%, var(--si-violet));
  box-shadow: 0 8px 20px -8px rgba(236, 72, 153, .6);
}
.si-btn:hover { filter: brightness(1.07); }
.si-btn:focus-visible { outline: 2px solid var(--si-violet); outline-offset: 3px; }
@media (max-width: 760px) {
  .support-inline { padding: 20px 16px 18px; margin: 32px 0; }
  .si-blessing { font-size: 19px; }
}

/* ------------------------------------------------------------ footer links + legal pages */
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary-ink); text-decoration: underline; }
.legal-page { max-width: 820px; }
.legal h1 { font-size: clamp(30px, 4.5vw, 42px); letter-spacing: -.035em; margin: 0 0 6px; }
.legal-updated { color: var(--faint); font-size: 13.5px; margin: 0 0 26px; }
.legal .content { font-size: 16px; }
