:root {
  --bg: #FFF9F0; --surface: #FFFFFF; --surface-2: #FFF3E3; --ink: #1F1A3D; --muted: #5F5A7A; --line: #EEE5D6;
  --coral: #FF6A4D; --coral-ink: #D9431F; --coral-50: #FFEDE7;
  --sun: #FFC53D; --sun-ink: #A86A00; --sun-50: #FFF4D4;
  --mint: #1FAE7A; --mint-ink: #0F7D55; --mint-50: #DFF6EC;
  --sky: #3D7BFF; --sky-ink: #2257D6; --sky-50: #E5EDFF;
  --lilac: #8B5CF6; --lilac-ink: #6A3BD9; --lilac-50: #EFE8FF;
  --shadow: 0 1px 2px rgba(31,26,61,.06), 0 8px 24px -8px rgba(31,26,61,.12);
  --shadow-lg: 0 2px 4px rgba(31,26,61,.06), 0 24px 48px -16px rgba(31,26,61,.22);
  --radius: 20px; --radius-sm: 12px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Unbounded", "Manrope", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141228; --surface: #1D1A36; --surface-2: #24203F; --ink: #F4F1FF; --muted: #B3AED0; --line: #2F2B4F;
    --coral-50: #3A2030; --sun-50: #3A3020; --mint-50: #163329; --sky-50: #1B2650; --lilac-50: #2A2050;
    --coral-ink: #FF9077; --sun-ink: #FFD36B; --mint-ink: #5FD9A9; --sky-ink: #8FB0FF; --lilac-ink: #B79BFF;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5);
    --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141228; --surface: #1D1A36; --surface-2: #24203F; --ink: #F4F1FF; --muted: #B3AED0; --line: #2F2B4F;
  --coral-50: #3A2030; --sun-50: #3A3020; --mint-50: #163329; --sky-50: #1B2650; --lilac-50: #2A2050;
  --coral-ink: #FF9077; --sun-ink: #FFD36B; --mint-ink: #5FD9A9; --sky-ink: #8FB0FF; --lilac-ink: #B79BFF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--font); overflow-x: hidden; }
body.modal-open { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--sky-ink); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--coral-ink); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4.4vw, 46px); font-weight: 700; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; }
h3 { font-size: 19px; font-weight: 600; }
.wrap { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .center { text-align: center; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px -12px rgba(31,26,61,.25); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo-mark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.logo-mark i { display: block; width: 9px; border-radius: 3px; }
.logo-mark i:nth-child(1) { height: 26px; background: var(--coral); }
.logo-mark i:nth-child(2) { height: 34px; background: var(--sun); }
.logo-mark i:nth-child(3) { height: 22px; background: var(--sky); transform: rotate(12deg); transform-origin: bottom left; }
.logo-text { font: 600 13px/1.1 var(--font-head); }
.logo-text b { font-weight: 700; color: var(--coral-ink); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.main-nav a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a[aria-current] { background: var(--ink); color: var(--bg); }
.header-actions { display: flex; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; min-width: 42px; justify-content: center; padding: 0 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; cursor: pointer; font: 600 13px var(--font); }
.icon-btn:hover { border-color: var(--ink); }
.kbd { color: var(--muted); font-size: 12px; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .kbd { display: none; }
  .header-actions { margin-left: auto; }
  .main-nav { position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; background: var(--surface); padding: 12px 16px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); display: none; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 17px; }
}

/* search */
.search-modal { position: fixed; inset: 0; z-index: 90; background: rgba(20,18,40,.45); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-modal[hidden] { display: none; }
.search-box { width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; border: 0; background: transparent; font: 500 18px var(--font); color: var(--ink); outline: none; min-width: 0; }
.search-close { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: 4px 8px; font: 600 12px var(--font); cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow: auto; }
.search-results a { display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.search-results a.active, .search-results a:hover { background: var(--surface-2); }
.search-results b { display: block; font-weight: 700; }
.search-results small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-icon { font-size: 22px; line-height: 1.3; }
.sr-empty { padding: 18px; color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 999px; font: 700 16px var(--font); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 8px 20px -8px var(--coral); }
.btn-primary:hover { color: #fff; box-shadow: 0 12px 24px -8px var(--coral); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: rgba(255,255,255,.92); color: #1F1A3D; padding: 10px 18px; font-size: 15px; }

/* home hero */
.home-hero { padding: 36px 0 24px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.badge { display: inline-block; background: var(--sun-50); color: var(--sun-ink); border: 1.5px solid color-mix(in srgb, var(--sun) 50%, transparent); font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.home-hero h1 { font-size: clamp(34px, 5.6vw, 62px); line-height: 1.08; }
.hl { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--sun) 75%, transparent) 62%); padding: 0 4px; }
.home-hero .lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 600px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 30px; }
.hero-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; min-width: 150px; }
.hero-facts b { display: block; font-family: var(--font-head); font-size: 18px; }
.hero-facts span { color: var(--muted); font-size: 13px; }
.hero-art { position: relative; height: 420px; }
.blob { position: absolute; inset: 30px 0 0 30px; background: radial-gradient(circle at 30% 30%, var(--sun-50), transparent 60%), radial-gradient(circle at 70% 70%, var(--lilac-50), transparent 60%), var(--coral-50); border-radius: 46% 54% 40% 60% / 55% 45% 55% 45%; z-index: 0; }
.books { position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 1; display: flex; flex-direction: column-reverse; align-items: center; }
.book { width: 260px; height: 48px; border-radius: 8px 12px 12px 8px; display: flex; align-items: center; padding-left: 22px; color: #fff; font: 600 14px var(--font-head); box-shadow: inset -10px 0 0 rgba(255,255,255,.25), inset 0 -4px 0 rgba(0,0,0,.12), 0 6px 14px -6px rgba(31,26,61,.35); position: relative; }
.book::after { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: rgba(255,255,255,.5); }
.b1 { background: var(--sky); width: 280px; }
.b2 { background: var(--coral); width: 250px; transform: translateX(14px) rotate(-2deg); }
.b3 { background: var(--mint); width: 270px; transform: translateX(-10px) rotate(1.5deg); }
.b4 { background: var(--lilac); width: 240px; transform: translateX(8px) rotate(-1deg); }
.b5 { background: var(--sun); color: #1F1A3D; width: 220px; transform: translateX(-6px) rotate(3deg); }
.sticker { position: absolute; z-index: 2; background: var(--surface); color: var(--ink); font-weight: 800; font-size: 14px; padding: 10px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); }
.s1 { top: 40px; right: 10px; transform: rotate(5deg); color: var(--mint-ink); }
.s2 { bottom: 20px; left: 0; transform: rotate(-4deg); color: var(--coral-ink); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { height: 320px; } .book { transform: scale(.85); } }

/* blocks */
.block { padding: 36px 0; }
.block.narrow, .narrow { max-width: 860px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.block-head h2 { margin: 0; }
.block-head a { font-weight: 700; text-decoration: none; }

/* class tiles */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.mini-grid { grid-template-columns: repeat(11, 1fr); gap: 10px; }
@media (max-width: 900px) { .mini-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 480px) { .mini-grid { grid-template-columns: repeat(4, 1fr); } }
.class-tile { position: relative; display: flex; flex-direction: column; padding: 18px; border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); border: 2px solid var(--line); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.class-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.class-tile .ct-num { font: 700 46px/1 var(--font-head); }
.class-tile .ct-label { font-weight: 700; color: var(--muted); font-size: 14px; }
.class-tile .ct-text { margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.class-tile.mini { align-items: center; padding: 14px 6px; }
.class-tile.mini .ct-num { font-size: 34px; }
.class-tile.mini .ct-label { font-size: 12px; }
.c-sun { background: var(--sun-50); border-color: color-mix(in srgb, var(--sun) 35%, transparent); }
.c-sun .ct-num { color: var(--sun-ink); }
.c-sky { background: var(--sky-50); border-color: color-mix(in srgb, var(--sky) 25%, transparent); }
.c-sky .ct-num { color: var(--sky-ink); }
.c-lilac { background: var(--lilac-50); border-color: color-mix(in srgb, var(--lilac) 25%, transparent); }
.c-lilac .ct-num { color: var(--lilac-ink); }
.c-sun:hover { border-color: var(--sun); } .c-sky:hover { border-color: var(--sky); } .c-lilac:hover { border-color: var(--lilac); }
.stage { margin-bottom: 36px; }
.stage h2 small { font: 600 16px var(--font); color: var(--muted); margin-left: 8px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font: 700 18px var(--font-head); color: #fff; margin-bottom: 14px; }
.step:nth-child(1) .step-n { background: var(--coral); } .step:nth-child(2) .step-n { background: var(--sun); color: #1F1A3D; }
.step:nth-child(3) .step-n { background: var(--mint); } .step:nth-child(4) .step-n { background: var(--sky); }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* tool cards */
.tools-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .tools-row { grid-template-columns: 1fr; } }
.tool-card { position: relative; border-radius: 28px; padding: 30px; color: #fff; text-decoration: none; overflow: hidden; transition: transform .2s; }
.tool-card:hover { transform: translateY(-4px); color: #fff; }
.tool-card::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.14); }
.t-coral { background: linear-gradient(135deg, #FF6A4D, #FF8F5A); }
.t-lilac { background: linear-gradient(135deg, #7C4DEB, #A57BFF); }
.tool-emoji { font-size: 40px; display: block; margin-bottom: 8px; }
.tool-card h3 { font-size: 24px; }
.tool-card p { opacity: .95; max-width: 460px; }

/* cards */
.cards { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 46px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.card-icon { width: 48px; height: 48px; display: grid; place-items: center; font-size: 24px; border-radius: 14px; background: var(--surface-2); }
.card-title { font: 600 17px/1.3 var(--font-head); }
.card-text { color: var(--muted); font-size: 15px; line-height: 1.5; }
.card-arrow { position: absolute; left: 22px; bottom: 16px; font-weight: 800; transition: transform .15s; }
.card:hover .card-arrow { transform: translateX(4px); }
.card.c-coral .card-icon { background: var(--coral-50); } .card.c-coral:hover { border-color: var(--coral); } .card.c-coral .card-arrow { color: var(--coral-ink); }
.card.c-mint .card-icon { background: var(--mint-50); } .card.c-mint:hover { border-color: var(--mint); } .card.c-mint .card-arrow { color: var(--mint-ink); }
.card.c-sky .card-icon { background: var(--sky-50); } .card.c-sky:hover { border-color: var(--sky); } .card.c-sky .card-arrow { color: var(--sky-ink); }
.card.c-lilac .card-icon { background: var(--lilac-50); } .card.c-lilac:hover { border-color: var(--lilac); } .card.c-lilac .card-arrow { color: var(--lilac-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--mint); background: var(--mint-50); color: var(--ink); }
.reading-band { background: var(--lilac-50); padding: 44px 0; margin: 20px 0; }

/* page hero */
.page-hero { padding: 22px 0 34px; margin-bottom: 36px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; opacity: .5; pointer-events: none; }
.h-coral { background: var(--coral-50); } .h-coral::after { background: color-mix(in srgb, var(--coral) 25%, transparent); }
.h-mint { background: var(--mint-50); } .h-mint::after { background: color-mix(in srgb, var(--mint) 25%, transparent); }
.h-sky { background: var(--sky-50); } .h-sky::after { background: color-mix(in srgb, var(--sky) 22%, transparent); }
.h-lilac { background: var(--lilac-50); } .h-lilac::after { background: color-mix(in srgb, var(--lilac) 22%, transparent); }
.h-sun { background: var(--sun-50); } .h-sun::after { background: color-mix(in srgb, var(--sun) 35%, transparent); }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero-row { display: flex; gap: 22px; align-items: flex-start; }
.hero-icon { flex-shrink: 0; width: 76px; height: 76px; display: grid; place-items: center; font-size: 40px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); margin-top: 4px; }
@media (max-width: 600px) { .page-hero-row { flex-direction: column; } .hero-icon { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; } .page-hero-row { gap: 14px; } }
.page-hero .lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 780px; margin: 0; }
.meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.meta span::before { content: "•"; margin-right: 8px; color: var(--coral); }
.crumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; font-weight: 600; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--muted); opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); }
.class-switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 20px; }
.class-switcher > span { font-weight: 700; font-size: 14px; color: var(--muted); margin-right: 4px; }
.pill { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font: 600 15px var(--font-head); border: 1.5px solid var(--line); }
.pill:hover { border-color: var(--sky); color: var(--sky-ink); }
.pill.is-active { background: var(--sky); border-color: var(--sky); color: #fff; }

/* article */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
@media (max-width: 1000px) { .article-grid { grid-template-columns: 1fr; gap: 24px; } .sidebar { order: -1; } .sidebar .side-card:not(.toc) { display: none; } }
.prose { max-width: 760px; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 1.8em 0 .6em; scroll-margin-top: 90px; }
.prose h3 { margin: 1.5em 0 .5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--coral); font-weight: 700; }
.prose strong { font-weight: 800; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--sun); color: var(--muted); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose pre { background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 18px 20px; overflow-x: auto; white-space: pre-wrap; font: 15px/1.6 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.prose pre code { background: none; padding: 0; }
.article-title { font-size: clamp(24px, 3vw, 34px); margin-top: 0 !important; }
.lead-in { font-size: 19px; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.prose th { background: var(--surface-2); text-align: left; font-weight: 800; }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.callout { margin: 1.6em 0; padding: 18px 20px 6px; border-radius: var(--radius-sm); border: 1.5px solid; }
.callout-label { font: 600 13px var(--font-head); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.callout-tip { background: var(--mint-50); border-color: color-mix(in srgb, var(--mint) 40%, transparent); }
.callout-tip .callout-label { color: var(--mint-ink); } .callout-tip .callout-label::before { content: "💡 "; }
.callout-note { background: var(--sky-50); border-color: color-mix(in srgb, var(--sky) 35%, transparent); }
.callout-note .callout-label { color: var(--sky-ink); } .callout-note .callout-label::before { content: "📌 "; }
.callout-warn { background: var(--sun-50); border-color: color-mix(in srgb, var(--sun) 50%, transparent); }
.callout-warn .callout-label { color: var(--sun-ink); } .callout-warn .callout-label::before { content: "⚠️ "; }

.sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1000px) { .sidebar { position: static; } }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.side-title { font: 600 14px var(--font-head); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: flex; gap: 10px; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.35; }
.toc a::before { content: counter(t); flex-shrink: 0; color: var(--muted); font-family: var(--font-head); font-size: 12px; width: 18px; padding-top: 1px; }
.toc a:hover, .toc a.active { background: var(--coral-50); color: var(--coral-ink); }
@media (max-width: 1000px) { .toc { padding: 14px 16px; } .toc ol { max-height: 240px; overflow: auto; } }
.side-tool { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 14px; border-radius: 14px; text-decoration: none; color: #fff; margin-top: 10px; }
.side-tool span { grid-row: span 2; font-size: 26px; }
.side-tool b { font-size: 15px; } .side-tool small { opacity: .9; font-size: 13px; }
.side-tool:hover { color: #fff; filter: brightness(1.06); }

/* faq */
.faq { margin-top: 48px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; font-weight: 700; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--coral-50); color: var(--coral-ink); font-size: 18px; transition: transform .2s; }
.faq-item[open] summary::after { content: "–"; }
.faq-item > div { padding: 0 20px 6px; color: var(--muted); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.pager a { display: block; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); background: var(--surface); }
.pager a:hover { border-color: var(--ink); }
.pager small { display: block; color: var(--muted); font-weight: 700; }
.pager-next { text-align: right; }
.related { margin: 56px 0 24px; }
.hub { padding-bottom: 40px; }

/* sitemap */
.sitemap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; padding-bottom: 40px; }
.sitemap-grid h2 { font-size: 20px; }
.sitemap-grid ul { padding-left: 1.1em; margin: 0; }
.sitemap-grid li { margin-bottom: 4px; }

/* footer */
.site-footer { background: #1F1A3D; color: #D9D5EE; padding: 52px 0 28px; margin-top: 60px; }
.site-footer a { color: #fff; text-decoration: none; opacity: .85; }
.site-footer a:hover { opacity: 1; color: var(--sun); }
.f-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
@media (max-width: 900px) { .f-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .f-grid { grid-template-columns: 1fr; } }
.f-col h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--sun); }
.f-col ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.f-col li { margin-bottom: 6px; }
.f-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 20px; font-size: 13px; opacity: .8; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.f-bottom p { margin: 0; max-width: 760px; }

/* tools */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
@media (max-width: 1000px) { .tool-layout { grid-template-columns: 1fr; } }
.tool-panel { min-width: 0; }
.tool-help { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }
@media (max-width: 1000px) { .tool-help { position: static; } }
.help-list { padding-left: 1.2em; margin: 0 0 12px; font-size: 15px; }
.help-list li { margin-bottom: 8px; }
.field-label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; margin-bottom: 20px; }
@media (max-width: 600px) { .seg { grid-template-columns: repeat(6, 1fr); } }
.seg button { height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 700 18px var(--font-head); cursor: pointer; }
.seg button:hover { border-color: var(--coral); }
.seg button.is-active { background: var(--coral); border-color: var(--coral); color: #fff; }
.progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.progress { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 10px 0 12px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), #45D39A); border-radius: 99px; transition: width .3s; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 600; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.d-mint { background: var(--mint); } .d-coral { background: var(--coral); } .d-ink { background: var(--ink); }
.cl-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.cl-group header { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.cl-group h2 { font-size: 19px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.cl-group h2 small { font: 700 13px var(--font); background: var(--surface-2); padding: 2px 10px; border-radius: 99px; color: var(--muted); }
.cl-group header p { margin: 0; color: var(--muted); font-size: 14px; }
.g-mint header { background: var(--mint-50); } .g-sun header { background: var(--sun-50); } .g-coral header { background: var(--coral-50); } .g-lilac header { background: var(--lilac-50); }
.cl-group ul { list-style: none; margin: 0; padding: 6px 0; }
.cl-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px dashed var(--line); }
.cl-item:last-child { border-bottom: 0; }
.cl-name { font-size: 15px; font-weight: 600; }
.cl-item.st-school .cl-name, .cl-item.st-have .cl-name { text-decoration: line-through; text-decoration-color: var(--mint); color: var(--muted); }
.cl-item.st-buy .cl-name { color: var(--coral-ink); }
.cl-btns { display: flex; gap: 4px; flex-shrink: 0; }
.cl-btns button { border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 5px 11px; font: 700 13px var(--font); cursor: pointer; }
.cl-btns button:hover { border-color: var(--ink); color: var(--ink); }
.cl-btns .b-school.on { background: var(--mint); border-color: var(--mint); color: #fff; }
.cl-btns .b-buy.on { background: var(--coral); border-color: var(--coral); color: #fff; }
.cl-btns .b-have.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
@media (max-width: 560px) { .cl-item { flex-direction: column; align-items: flex-start; } }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0; }
.toast { font-weight: 700; color: var(--mint-ink); font-size: 14px; }
.planner-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
@media (max-width: 600px) { .planner-form { grid-template-columns: 1fr; } }
.field.full { grid-column: 1 / -1; }
.planner-form textarea, .planner-form input, .planner-form select { width: 100%; font: 500 16px var(--font); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.planner-form textarea { resize: vertical; line-height: 1.5; }
.planner-form textarea:focus, .planner-form input:focus, .planner-form select:focus { outline: none; border-color: var(--lilac); box-shadow: 0 0 0 4px var(--lilac-50); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.hint.warn { color: var(--sun-ink); font-weight: 700; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.rp-summary .hint { grid-column: 1 / -1; }
@media (max-width: 700px) { .rp-summary { grid-template-columns: 1fr 1fr; } }
.rp-stat { background: var(--lilac-50); border-radius: 16px; padding: 14px 16px; }
.rp-stat b { display: block; font: 700 22px var(--font-head); color: var(--lilac-ink); }
.rp-stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.rp-weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rp-week { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.rp-week header { padding: 12px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.rp-week header span { font-size: 13px; color: var(--muted); font-weight: 600; }
.rp-week label { cursor: pointer; }
.rp-week input { accent-color: var(--lilac); width: 16px; height: 16px; vertical-align: -2px; }
.rp-week:has(input:checked) { opacity: .55; }
.rp-week ul { list-style: none; margin: 0; padding: 8px 16px 12px; }
.rp-week li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.rp-week li:last-child { border-bottom: 0; }
.rp-book { font-weight: 700; } .rp-range { color: var(--muted); white-space: nowrap; font-size: 14px; }

@media print {
  .site-header, .site-footer, .sidebar, .tool-help, .tool-actions, .related, .pager, .seg, .planner-form, .page-hero::after, .class-switcher { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .page-hero { background: none !important; padding: 0; margin: 0 0 12px; }
  .hero-icon { display: none; }
  .tool-layout, .article-grid { display: block; }
  .cl-btns button:not(.on) { display: none; }
  .faq-item > div { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.hero-icon.is-num, .card-icon:not(:empty) { font-family: var(--font-head); }
.hero-icon.is-num { color: var(--sky-ink); font-weight: 700; font-size: 38px; }
.card.c-sky .card-icon { color: var(--sky-ink); font-weight: 700; font-size: 22px; }

/* footnotes & sources */
.prose sup { font-size: .68em; line-height: 0; color: var(--coral-ink); font-weight: 700; margin-left: 1px; }
.prose #istochniki ~ p { font-size: 14px; line-height: 1.55; color: var(--muted); margin-bottom: .6em; padding-left: 4px; }
.prose #istochniki { font-size: 20px; margin-top: 2.2em; padding-top: 1.2em; border-top: 1px solid var(--line); }
