/* Carousel unified resource site — shared styles */
:root {
  --paper: #faf9f5; --paper-2: #f5f3ec; --paper-3: #efece2; --card: #ffffff;
  --ink: #1a1815; --ink-2: #2c2a26;
  --ink-60: rgba(26,24,21,0.62); --ink-45: rgba(26,24,21,0.45); --ink-30: rgba(26,24,21,0.28);
  --ink-15: rgba(26,24,21,0.13); --ink-08: rgba(26,24,21,0.06);
  --line: rgba(26,24,21,0.09); --line-2: rgba(26,24,21,0.16);
  --clay: #c8632d; --clay-soft: #f4e6dc; --clay-deep: #a04d1f;
  --gain: #2f7a4d; --gain-soft: #e3ecde;
  --loss: #b13a30; --loss-soft: #f3dedb;
  --info: #3a4f73; --info-soft: #e0e5ee;
  --warn: #8a6515; --warn-soft: #efe6cf;
  --purple: #8a3fb0; --purple-soft: #f0e4f6;
  --ui-bg: #ffffff; --ui-line: #ececea; --ui-sunk: #f6f6f4;
  --ui-ink: #1a1a1a; --ui-muted: #8a8a86;
  --canvas: #e8e5dc;
  --code-bg: #ffffff; --code-fg: #1a1815;
}
html[data-theme="dark"] {
  --canvas: #141210;
  --paper: #1d1b17; --paper-2: #232019; --paper-3: #2b2820; --card: #24211c;
  --ink: #ece7dc; --ink-2: #d9d4c8;
  --ink-60: rgba(236,231,220,0.66); --ink-45: rgba(236,231,220,0.5); --ink-30: rgba(236,231,220,0.32);
  --ink-15: rgba(236,231,220,0.15); --ink-08: rgba(236,231,220,0.08);
  --line: rgba(236,231,220,0.1); --line-2: rgba(236,231,220,0.18);
  --clay: #d4744a; --clay-soft: #3a2517; --clay-deep: #e09060;
  --gain: #5dba8a; --gain-soft: #1d2f25;
  --info: #93a9d6; --info-soft: #232b3a;
  --loss: #d4685e; --loss-soft: #392019;
  --warn: #cfa64a; --warn-soft: #332a14;
  --purple: #b97fd6; --purple-soft: #321f3c;
  --code-bg: #11100d; --code-fg: #e6e1d5;
}
* { box-sizing: border-box; }
@view-transition { navigation: auto; }
html { scroll-behavior: smooth; }
body { margin: 0; padding: 0; font-family: 'Inter', -apple-system, system-ui, sans-serif; background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11','ss01','ss03'; line-height: 1.6; }
.serif { font-family: 'Instrument Serif', serif; font-weight: 400; letter-spacing: -0.4px; }
.mono { font-family: 'JetBrains Mono', monospace; }
.micro { font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-45); }
::selection { background: var(--clay-soft); }
a { color: var(--clay-deep); text-decoration: none; }
svg { display: block; }
strong { font-weight: 600; }

/* ░░ global header ░░ */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1060px; margin: 0 auto; padding: 0 28px; height: 58px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; }
.lmark { width: 28px; height: 28px; background: var(--ink); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; font-family: 'Instrument Serif', serif; color: var(--paper); font-size: 17px; }
.brand .wm { font-weight: 600; font-size: 16px; letter-spacing: -0.2px; color: var(--ink); }
.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topnav a { font-size: 13.5px; font-weight: 450; color: var(--ink-60); padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.topnav a:hover { background: var(--paper-3); color: var(--ink); }
.topnav a.active { background: var(--ink); color: var(--paper); font-weight: 500; }
.topnav a .ext { color: currentColor; opacity: 0.55; }
@media (max-width: 760px) { .topnav a.hide-m { display: none; } }

/* ░░ page head (cover) ░░ */
.cover { background: var(--paper); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.cover-in { max-width: 1060px; margin: 0 auto; padding: 60px 28px 54px; position: relative; }
.cover-in::after { content: ''; position: absolute; right: -60px; top: -150px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle at center, var(--accent-soft, var(--clay-soft)), transparent 70%); opacity: 0.8; pointer-events: none; }
.cover h1 { font-size: 52px; line-height: 1.02; letter-spacing: -1.5px; margin: 22px 0 0; position: relative; z-index: 1; font-family: 'Instrument Serif', serif; font-weight: 400; }
.cover .lede { font-size: 16.5px; color: var(--ink-60); margin: 16px 0 0; max-width: 600px; position: relative; z-index: 1; }
.cover.compact .cover-in { padding: 44px 28px 40px; }
.cover.compact h1 { font-size: 38px; letter-spacing: -1.1px; }
.crumb { position: relative; z-index: 1; }
.crumb a { color: var(--ink-45); }
.crumb a:hover { color: var(--clay-deep); }
.crumb .sep { color: var(--ink-30); margin: 0 7px; }

/* ░░ page body ░░ */
.page { max-width: 1060px; margin: 0 auto; padding: 0 28px 80px; }
.page.narrow { max-width: 880px; }
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 44px 52px 48px; margin-top: 36px; box-shadow: 0 20px 60px rgba(26,24,21,0.07); }
@media (max-width: 760px) {
  .cover h1 { font-size: 38px; }
  .cover.compact h1 { font-size: 30px; }
  .cover-in { padding: 44px 22px 40px; }
  .page { padding: 0 22px 64px; }
  .sheet { padding: 30px 24px 34px; border-radius: 16px; }
}

/* ░░ prose ░░ */
.prose { max-width: 720px; }
.prose h2 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 32px; letter-spacing: -0.8px; line-height: 1.1; margin: 42px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.2px; margin: 30px 0 9px; }
.prose h4 { font-size: 15px; font-weight: 600; letter-spacing: -0.1px; margin: 22px 0 6px; }
.prose p { margin: 0 0 15px; font-size: 17px; color: var(--ink-2); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; font-size: 17px; color: var(--ink-2); display: flex; flex-direction: column; gap: 7px; }
.prose li::marker { color: var(--ink-45); }
.prose hr { border: none; height: 1px; background: var(--line); margin: 32px 0; }
.prose em.hl { font-style: normal; background: var(--clay-soft); color: var(--clay-deep); padding: 0 5px; border-radius: 5px; font-size: 0.94em; }
.prose code { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; background: var(--paper-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; white-space: nowrap; }
.prose a { border-bottom: 1px solid var(--clay-soft); }
.prose pre { margin: 18px 0 20px; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px; overflow-x: auto; font-size: 13px; line-height: 1.65; }
.prose pre code { background: none; border: none; padding: 0; white-space: pre; font-size: inherit; color: inherit; }
.prose blockquote { margin: 0 0 16px; padding: 2px 0 2px 18px; border-left: 3px solid var(--line-2); color: var(--ink-60); }

/* tables */
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0 22px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 14.5px; }
@media (max-width: 760px) { .prose table { display: block; overflow-x: auto; } }
.prose th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-45); padding: 11px 16px; border-bottom: 1px solid var(--line-2); background: var(--paper-2); white-space: nowrap; }
.prose td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; min-width: 110px; }
.prose tr:last-child td { border-bottom: none; }

/* Q&A (FAQ prose) */
.qa { margin: 0 0 22px; }
.qa h4 { font-size: 17.5px; font-weight: 600; letter-spacing: -0.2px; margin: 0 0 5px; }
.qa p { margin: 0; color: var(--ink-60); }

/* ░░ components from the manual ░░ */
.kick { margin-bottom: 13px; }
.callout { display: flex; gap: 14px; padding: 16px 20px; border-radius: 14px; background: var(--clay-soft); margin: 18px 0; }
.callout.info { background: var(--info-soft); }
.callout .cico { flex-shrink: 0; margin-top: 1px; color: var(--clay-deep); }
.callout.info .cico { color: var(--info); }
.callout p { margin: 0; font-size: 15.5px; color: var(--clay-deep); }
.callout.info p { color: var(--info); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.tile h4 { font-size: 17px; font-weight: 600; margin: 12px 0 6px; letter-spacing: -0.2px; }
.tile > h4:first-child { margin-top: 0; }
.tile p { margin: 0; color: var(--ink-60); font-size: 15px; }
.tile .num-tag { font-size: 11px; color: var(--ink-45); font-weight: 600; }
.tile-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--paper-3); color: var(--ink); }
.tile.link { cursor: pointer; transition: border-color .15s, transform .15s; text-decoration: none; display: block; color: inherit; }
.tile.link:hover { border-color: var(--ink-30); transform: translateY(-2px); }
.tile .go { font-size: 12.5px; color: var(--clay-deep); font-weight: 500; margin-top: 10px; display: inline-flex; align-items: center; gap: 5px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.pill.gain { background: var(--gain-soft); color: var(--gain); }
.pill.loss { background: var(--loss-soft); color: var(--loss); }
.pill.purple { background: var(--purple-soft); color: var(--purple); }
.pill.ink { background: var(--ink-08); color: var(--ink); }
.pill.clay { background: var(--clay-soft); color: var(--clay-deep); }

.legend { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 22px; }
.card .legend { border: none; border-radius: 0; padding: 0; }
.legend-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.legend-row:last-child { border-bottom: none; }
.legend-row .lcol { width: 150px; flex-shrink: 0; }
.legend-row p { margin: 0; font-size: 15.5px; color: var(--ink-60); }
@media (max-width: 760px) { .legend-row { flex-direction: column; gap: 7px; } .legend-row .lcol { width: auto; } }

.statusgrid { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 22px; }
.st-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.st-row:last-child { border-bottom: none; }
.st-ic { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; background: var(--card); border: 2px solid var(--c, var(--ink-30)); position: relative; }
.st-ic.dashed { border-style: dashed; }
.st-ic.rainbow { border: 0; background: linear-gradient(115deg, #FFB1B1 0%, #6BE6FF 32%, #FFB521 60%, #B4BAFF 100%); }
.st-ic.rainbow::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--card); }
.st-txt b { display: block; font-size: 16px; color: var(--ink); font-weight: 600; }
.st-txt span { font-size: 15px; color: var(--ink-60); }
.st-grp { margin: 20px 0 8px; }
.st-txt .st-act { display: block; width: fit-content; margin-top: 7px; font-size: 11px; font-weight: 600; color: var(--clay-deep); background: var(--clay-soft); padding: 3px 10px; border-radius: 999px; }
.st-badge { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--card); display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.st-badge svg { width: 8px; height: 8px; display: block; }
.st-badge.proc { background: #17B26A; }
.st-badge.tout { background: #DC6803; }
.st-badge.retry { background: #DC6803; font-size: 9px; font-weight: 800; color: #fff; line-height: 1; }
.st-badge.err { background: #D92D20; }

.faq { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: none; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 22px; font-size: 16.5px; font-weight: 500; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { transition: transform .2s; color: var(--ink-45); flex-shrink: 0; }
.faq details[open] summary .chev { transform: rotate(90deg); }
.faq .answer { padding: 0 22px 18px; font-size: 16px; color: var(--ink-60); }

/* figures + screenshot placeholders */
.figure { margin: 22px 0 8px; }
.figure .frame { border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; background: var(--ui-bg); box-shadow: 0 16px 50px rgba(26,24,21,0.07); }
.figure .frame img { width: 100%; display: block; }
.figcap { font-size: 12px; color: var(--ink-45); margin-top: 10px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.figcap .tag { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 2px 7px; border-radius: 5px; font-weight: 600; }
.figcap .tag.alt { background: var(--ink-08); color: var(--ink-60); }
.shot-ph { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 9px; min-height: 240px; padding: 32px; text-align: center; color: var(--ink-45); font-size: 12.5px; background: var(--paper-3); background-image: repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(26,24,21,0.025) 12px, rgba(26,24,21,0.025) 24px); }
.shot-ph .fname { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-60); background: var(--paper); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 9px; }

/* walkthrough video */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 16px 50px rgba(26,24,21,0.08); margin-top: 18px; background: #1a1815; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-facade { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: #000; display: block; }
.yt-facade .yt-thumb { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.92; }
.yt-facade .yt-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); transition: transform .15s ease; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35)); }
.yt-facade:hover .yt-play { transform: translate(-50%,-50%) scale(1.08); }

/* steps (numbered cards, from manual) */
.msteps { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.mstep { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.mstep-num { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-family: 'Instrument Serif', serif; font-size: 19px; }
.mstep-body { flex: 1; min-width: 0; }
.mstep-body h4 { font-size: 17px; font-weight: 600; margin: 3px 0 5px; letter-spacing: -0.1px; }
.mstep-body p { margin: 0; color: var(--ink-60); font-size: 16px; }

/* kebab menu recreation */
.kebabwrap { background: var(--ui-sunk); padding: 28px; display: flex; justify-content: center; }
.kebab { width: 244px; background: #fff; border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,0.14); padding: 6px; }
.kebab-item { display: flex; align-items: center; gap: 12px; padding: 10px 11px; border-radius: 8px; font-size: 13px; color: var(--ui-ink); }
.kebab-item.hot { background: var(--ui-sunk); }
.kebab-item .ki { color: var(--ui-muted); flex-shrink: 0; }

/* ░░ pager (prev / next) ░░ */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; }
.pager a { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; display: flex; flex-direction: column; gap: 3px; color: inherit; transition: border-color .15s, transform .15s; }
.pager a:hover { border-color: var(--ink-30); transform: translateY(-2px); }
.pager a.next { text-align: right; align-items: flex-end; }
.pager a.prev { grid-column: 1; }
.pager a.next:only-child, .pager a.next { grid-column: 2; }
.pager .pdir { font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-45); }
.pager .ptitle { font-size: 15.5px; font-weight: 600; letter-spacing: -0.2px; color: var(--ink); }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager a.next { grid-column: auto; } }

/* ░░ home directory ░░ */
/* ░░ home: watch banner + quick links ░░ */
.watch { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 30px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; overflow: hidden; }
.watch .video { margin: 0; border-radius: 12px; box-shadow: none; }
.watch h3 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 27px; letter-spacing: -0.5px; margin: 8px 0 7px; }
.watch p { font-size: 16px; color: var(--ink-60); margin: 0; max-width: 480px; }
.watch .go { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 13.5px; font-weight: 500; color: var(--clay-deep); }
@media (max-width: 820px) { .watch { grid-template-columns: 1fr; gap: 18px; } }
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.qgrid a { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; color: inherit; transition: border-color .15s, transform .15s; }
.qgrid a:hover { border-color: var(--ink-30); transform: translateY(-2px); }
.qgrid .qico { color: var(--ink-45); }
.qgrid h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.2px; margin: 10px 0 2px; }
.qgrid .sub { font-size: 13px; color: var(--ink-45); }
@media (max-width: 880px) { .qgrid { grid-template-columns: repeat(2, 1fr); } }

/* full site index (glossary) */
.dex { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 40px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 30px 34px 32px; }
@media (max-width: 880px) { .dex { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .dex { grid-template-columns: 1fr; } }
.dex-b h4 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.2px; margin: 0 0 9px; display: flex; align-items: center; gap: 8px; }
.dex-b h4 .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dex-b h4 a { color: inherit; }
.dex-b h4 a:hover { color: var(--clay-deep); }
.dex-b a.di { display: flex; align-items: baseline; gap: 9px; padding: 5px 0; font-size: 15px; color: var(--ink-60); line-height: 1.4; }
.dex-b a.di:hover { color: var(--ink); }
.dex-b .dn { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--ink-30); width: 18px; flex-shrink: 0; }

/* ░░ home: editorial glossary sections ░░ */
.home-secs { margin-top: -6px; }
.sec { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 56px; padding: 46px 0; border-top: 1px solid var(--line-2); }
.sec:first-child { border-top: 0; padding-top: 10px; }
.sec:last-child { padding-bottom: 16px; }
.sec-k { display: flex; align-items: center; gap: 8px; }
.sec-k .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sec-l h2 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 31px; letter-spacing: -0.7px; margin: 12px 0 9px; }
.sec-l p { font-size: 15.5px; color: var(--ink-60); margin: 0; text-wrap: pretty; max-width: 44ch; }
.sec-l .go { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 14px; font-weight: 500; color: var(--clay-deep); }
.sec-r { min-width: 0; }
.sec-video { max-width: 470px; margin-top: 0; }
.sec-links-row { display: flex; flex-wrap: wrap; gap: 4px 32px; margin-top: 16px; }
.sec-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 36px; align-content: start; max-width: 640px; }
.sec-links a.di, .sec-links-row a.di { display: flex; align-items: baseline; gap: 9px; padding: 5px 0; font-size: 15px; color: var(--ink-60); line-height: 1.4; }
.sec-links a.di:hover, .sec-links-row a.di:hover { color: var(--ink); }
.sec-links .dn { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--ink-30); width: 18px; flex-shrink: 0; }
.sec-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 980px) {
  .sec { grid-template-columns: 1fr; gap: 22px; padding: 36px 0; }
  .sec-cols { grid-template-columns: 1fr; gap: 26px; }
}

.hub-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 880px) {
  .hub-cards { grid-template-columns: 1fr; }
}
.hub-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.hub-illo { height: 92px; background: var(--paper-2); background-image: radial-gradient(var(--ink-15) 1px, transparent 1px); background-size: 16px 16px; display: flex; align-items: center; justify-content: center; color: var(--hcd, var(--clay-deep)); border-bottom: 1px solid var(--line); }
.hub-illo svg { width: 38px; height: 38px; }
.hub-body { padding: 18px 22px 18px; display: flex; flex-direction: column; flex: 1; }
.hub-body h2 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 24px; letter-spacing: -0.5px; margin: 0 0 6px; }
.hub-body h2 a { color: inherit; }
.hub-body h2 a:hover { color: var(--hcd, var(--clay-deep)); }
.hub-body > p { font-size: 15px; color: var(--ink-60); margin: 0; flex: 1; }
.hub-links { margin-top: 12px; display: flex; flex-direction: column; }
.hub-links a { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15px; font-weight: 500; color: var(--ink); transition: color .12s; }
.hub-links a:hover { color: var(--hcd, var(--clay-deep)); }
.hub-links .hl-ico { color: var(--ink-45); display: inline-flex; width: 18px; flex-shrink: 0; }
.article-list .ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--ic-bg, var(--paper-3)); color: var(--ic-fg, var(--ink)); flex-shrink: 0; }
.article-list.lg a { padding: 22px 26px; }
.article-list.lg .at h3 { font-size: 17px; }
.article-list.lg .at p { font-size: 13.5px; }
.article-list .meta { font-size: 11.5px; color: var(--ink-45); white-space: nowrap; flex-shrink: 0; font-family: 'JetBrains Mono', monospace; }
.article-list.sm a { padding: 12px 24px; }
.article-list.sm .at h3 { font-size: 14px; margin: 0; }

/* ░░ help collections ░░ */
.collection { margin-top: 36px; }
.collection-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.collection-head h2 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 26px; letter-spacing: -0.6px; margin: 0; }
.collection-head .count { font-size: 12px; color: var(--ink-45); }
.article-list { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.article-list a { display: flex; align-items: center; gap: 18px; padding: 16px 24px; border-bottom: 1px solid var(--line); color: inherit; transition: background .12s; }
.article-list a:last-child { border-bottom: none; }
.article-list a:hover { background: var(--paper-2); }
.article-list .at { flex: 1; min-width: 0; }
.article-list .at h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; margin: 0 0 2px; }
.article-list .at p { font-size: 15px; color: var(--ink-60); margin: 0; }
.article-list .arr { color: var(--ink-30); flex-shrink: 0; }

/* ░░ side rail ░░ */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; padding-top: 48px; }
@media (max-width: 920px) { .cols { grid-template-columns: 1fr; } }
.rail { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 920px) { .rail { position: static; } }
.rail-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.rail-card h4 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.2px; margin: 10px 0 5px; }
.rail-card p { font-size: 13px; color: var(--ink-60); margin: 0 0 10px; }
.rail-card .go { font-size: 12.5px; font-weight: 500; color: var(--clay-deep); display: inline-flex; align-items: center; gap: 5px; }
.rail-toc { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 8px; }
.rail-toc .micro { padding: 8px 14px 4px; display: block; }
.toc-link { display: flex; align-items: baseline; gap: 10px; padding: 5px 14px; border-radius: 8px; font-size: 13px; color: var(--ink-60); line-height: 1.35; }
.toc-link:hover { background: var(--paper-3); color: var(--ink); }
.toc-link.here { color: var(--ink); font-weight: 600; }
.toc-link .n { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--ink-30); width: 18px; flex-shrink: 0; }
@media (max-width: 920px) { .rail-toc { display: none; } }

/* ░░ footer ░░ */
.foot { border-top: 1px solid var(--line-2); background: var(--paper); }
.foot-in { max-width: 1060px; margin: 0 auto; padding: 36px 28px 44px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot .fbrand { display: flex; align-items: center; gap: 9px; }
.foot .fbrand .wm { font-weight: 600; font-size: 14.5px; }
.foot .fsub { font-size: 12px; color: var(--ink-45); margin-top: 8px; max-width: 280px; line-height: 1.55; }
.foot-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-col { display: flex; flex-direction: column; gap: 7px; min-width: 120px; }
.foot-col .micro { margin-bottom: 4px; }
.foot-col a { font-size: 13px; color: var(--ink-60); }
.foot-col a:hover { color: var(--ink); }

/* ░░░░ RADICAL FLAT LAYOUT — global sidebar, everything visible ░░░░ */
.menu-toggle, .mbar { display: none; }
.sidenav { position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; width: 312px; padding: 0 18px 32px 24px; background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink-15) transparent; }
.sidenav .brand { display: flex; align-items: center; gap: 10px; margin: 2px 6px; }
.sidenav .brand .lmark { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
img.lmark { background: none; object-fit: contain; }
.sidenav .brand .wm { font-weight: 600; font-size: 22px; line-height: 1; letter-spacing: -0.5px; color: var(--ink); }
.sidenav .brand .sub { font-size: 11.5px; color: var(--ink-45); margin-top: 1px; line-height: 1.2; }
.nav-label { display: flex; align-items: center; gap: 8px; margin: 28px 0 7px; padding-left: 12px; color: var(--ink); font-weight: 650; letter-spacing: 0.14em; font-size: 13.5px; }
.nav-label .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.nav-label a { color: inherit; }
.nav-sublabel { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-30); margin: 12px 0 3px; padding-left: 12px; }
.nav-link { display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; border-radius: 9px; font-size: 15px; color: rgba(26,24,21,0.78); font-weight: 450; line-height: 1.4; transition: background .12s, color .12s; }
html[data-theme="dark"] .nav-link { color: rgba(236,231,220,0.78); }
.nav-link:hover { background: var(--paper-3); color: var(--ink); }
.nav-link.active { background: var(--ink); color: var(--paper); font-weight: 500; }
.nav-link.active span { color: var(--paper); }
.nav-link.active .n { color: rgba(255,255,255,0.55); }
.nav-link .n { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-30); width: 20px; flex-shrink: 0; }
.nav-link.active .n { color: rgba(255,255,255,0.55); }
.nav-link .ext { margin-left: auto; align-self: center; opacity: 0.45; }
.nav-link.parent { font-weight: 500; color: rgba(26,24,21,0.72); margin-top: 3px; }
html[data-theme="dark"] .nav-link.parent { color: rgba(236,231,220,0.72); }
.nav-link.parent.active { color: var(--paper); }
html[data-theme="dark"] .nav-link.parent.active { color: var(--paper); }
.nav-link.sub { margin-left: 17px; padding: 6px 8px 6px 13px; border-left: 1px solid var(--ink-15); border-top-left-radius: 0; border-bottom-left-radius: 0; color: rgba(26,24,21,0.58); font-size: 14px; }
html[data-theme="dark"] .nav-link.sub { color: rgba(236,231,220,0.58); }
.nav-link.sub:hover { border-left-color: var(--ink-30); }
.nav-link.sub.active { border-left-color: var(--ink); color: var(--paper); }
.nav-parent-row { display: flex; align-items: center; gap: 2px; margin-top: 3px; }
.nav-parent-row .nav-link.parent { flex: 1; margin-top: 0; }
.nav-fold { border: 0; background: none; padding: 4px 6px; cursor: pointer; color: rgba(26,24,21,0.72); border-radius: 6px; display: inline-flex; align-items: center; }
html[data-theme="dark"] .nav-fold { color: rgba(236,231,220,0.72); }
.nav-fold:hover { background: var(--paper-3); color: var(--ink); }
.nav-fold svg { transition: transform .15s; }
.nav-fold.closed svg { transform: rotate(-90deg); }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.nav-search { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; padding: 0 11px; height: 38px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper-2); color: var(--ink-45); }
.nav-search:focus-within { border-color: var(--ink-30); }
.nav-search input { border: 0; background: none; outline: none; font: inherit; font-size: 14px; color: var(--ink); width: 100%; }
.nav-search input::placeholder { color: var(--ink-45); }
.side-actions { display: flex; gap: 6px; }
.side-open { display: none; position: fixed; top: 16px; left: 16px; z-index: 110; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-60); cursor: pointer; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(26,24,21,0.12); }
.side-open:hover { color: var(--ink); border-color: var(--ink-30); }
@media (min-width: 1001px) {
  html.side-collapsed .sidenav { display: none; }
  html.side-collapsed .main { margin-left: 0; }
  html.side-collapsed .side-open { display: inline-flex; }
}
@media (max-width: 1000px) {
  .side-collapse { display: none; }
  body.nav-open { overflow: hidden; }
}
.theme-toggle { border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-60); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: color .12s, border-color .12s; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-30); }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
body.nav-open::before { content: ''; position: fixed; inset: 0; background: rgba(26,24,21,0.35); z-index: 90; }

.main { margin-left: 312px; background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: clip; }
.main::before { content: ''; position: fixed; left: 120px; top: 36%; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle at center, var(--accent-soft, var(--clay-soft)), transparent 70%); opacity: 0.9; pointer-events: none; }
.main::after { content: ''; position: fixed; right: -170px; bottom: 4%; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle at center, var(--info-soft), transparent 70%); opacity: 0.85; pointer-events: none; }
.phead, .content, .main .foot { position: relative; z-index: 1; }
.phead { border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.phead::before { content: ''; position: absolute; left: 26%; top: -140px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle at center, var(--gain-soft), transparent 70%); opacity: 0.9; pointer-events: none; }
.phead-in { max-width: 880px; margin: 0 auto; padding: 54px 56px 42px; position: relative; }
.phead-in::after { content: ''; position: absolute; right: -60px; top: -150px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle at center, var(--accent-soft, var(--clay-soft)), transparent 70%); opacity: 1; pointer-events: none; }
.content::before { content: ''; position: fixed; right: -240px; top: 16%; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle at center, var(--gain-soft), transparent 70%); opacity: 0.8; pointer-events: none; z-index: -1; }
.content::after { content: ''; position: fixed; left: 140px; bottom: 22%; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle at center, var(--info-soft), transparent 70%); opacity: 0.75; pointer-events: none; z-index: -1; }
.phead h1 { font-size: 42px; line-height: 1.04; letter-spacing: -1.2px; margin: 14px 0 0; position: relative; z-index: 1; font-family: 'Instrument Serif', serif; font-weight: 400; }
.phead .lede { font-size: 18px; color: var(--ink-60); margin: 14px 0 0; max-width: 620px; position: relative; z-index: 1; }
.content { max-width: 880px; margin: 0 auto; padding: 38px 56px 72px; flex: 1; width: 100%; }
.content.wide { max-width: 1080px; }
.main.wide .phead-in, .main.wide .foot-in { max-width: 1080px; }
.content .doc { min-width: 0; }
.toc { display: none; font-size: 14px; }
.toc .toc-head { color: var(--ink-45); margin-bottom: 8px; padding-left: 14px; }
.toc a { display: block; padding: 5px 0 5px 14px; color: var(--ink-60); border-left: 2px solid transparent; line-height: 1.45; }
.toc a.t3 { padding-left: 28px; }
.toc a:hover { color: var(--ink); }
.toc a.current { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }
@media (min-width: 1180px) {
  .main.has-toc .phead-in, .main.has-toc .foot-in { max-width: 1192px; }
  .main.has-toc .phead-in { padding-right: 328px; }
  .main.has-toc .foot-in { padding-right: 328px; }
  /* pages without a TOC share the exact same text-column geometry */
  .main:not(.wide) .phead-in, .main:not(.wide) .foot-in { max-width: 1192px; padding-right: 328px; }
  .main:not(.wide) .content:not(.has-toc) { max-width: 1192px; padding-right: 328px; }
  .content.has-toc { max-width: 1192px; display: grid; grid-template-columns: minmax(0, 1fr) 216px; column-gap: 56px; align-items: start; }
  .content.has-toc .toc { display: block; position: sticky; top: 48px; max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink-15) transparent; }
}
.main .foot { margin-top: auto; }
.main .foot-in { max-width: 880px; margin: 0 auto; padding: 30px 56px 40px; }

@media (max-width: 1000px) {
  .sidenav { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 60px rgba(0,0,0,0.2); }
  body.nav-open .sidenav { transform: translateX(0); }
  .main { margin-left: 0; }
  .phead-in { padding: 40px 24px 36px; }
  .content { padding: 30px 24px 60px; }
  .main .foot-in { padding: 26px 24px 36px; }
  .phead h1 { font-size: 32px; }
  /* mobile header bar */
  .mbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 80; height: 56px; padding: 0 10px 0 8px; background: var(--paper); background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .mbar-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
  .mbar-btn:active { background: var(--line); }
  .mbar .brand { gap: 8px; margin-right: auto; min-width: 0; }
  .mbar .lmark { width: 26px; height: 26px; border-radius: 7px; }
  .mbar .wm { font-size: 16.5px; white-space: nowrap; }
  .mbar .sun { display: none; }
  html[data-theme="dark"] .mbar .moon { display: none; }
  html[data-theme="dark"] .mbar .sun { display: block; }
}

@media (max-width: 640px) {
  .phead-in { padding: 36px 20px 32px; }
  .phead h1 { font-size: 30px; }
  .phead .lede { font-size: 14.5px; }
  .content { padding: 26px 20px 56px; }
  .main .foot-in { padding: 26px 20px 36px; }
  .article-list a { padding: 14px 16px; gap: 12px; }
  .article-list .meta { display: none; }
  .article-list.lg a { padding: 16px 16px; }
  .collection-head h2 { font-size: 22px; }
  .prose pre { padding: 14px 14px; font-size: 11.5px; border-radius: 10px; }
  .callout { padding: 14px 16px; }
  .legend { padding: 2px 16px; }
  .statusgrid { padding: 4px 16px; }
  .mstep { padding: 14px 14px; gap: 12px; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { grid-column: auto; }
}

@media print {
  body { background: #fff; }
  .topbar, .sidenav, .menu-toggle, .mbar { display: none; }
  .main { margin-left: 0; }
  .cover-in::after, .phead-in::after, .content::before, .content::after, .main::before, .main::after { display: none; }
  .sheet { box-shadow: none; border: none; padding: 0; }
  .figure, .callout, .mstep, .tile, .qa { break-inside: avoid; }
}

/* clickable section labels */
a.nav-label:hover { color: var(--clay); }

/* collapsible code blocks */
.prose pre.clamp { max-height: 240px; overflow: hidden; position: relative; }
.prose pre.clamp::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--code-bg)); pointer-events: none; }
.code-expand { display: inline-flex; align-items: center; gap: 6px; margin: -8px 0 20px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-60); font: inherit; font-size: 12.5px; font-weight: 500; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.code-expand:hover { color: var(--ink); border-color: var(--ink-30); }
@media print { .prose pre.clamp { max-height: none; } .prose pre.clamp::after { display: none; } .code-expand { display: none; } }

/* sticky brand + search at the top of the sidebar */
.side-sticky { position: sticky; top: 0; z-index: 5; background: var(--paper); margin: 0 -18px 0 -24px; padding: 26px 18px 1px 24px; }

@media print {
  html::before, html::after { display: none; }
}

/* image lightbox */
.figure .frame img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(20,18,16,0.88); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 92vh; transform-origin: center; transition: transform .15s ease; cursor: grab; user-select: none; box-shadow: 0 30px 90px rgba(0,0,0,0.5); border-radius: 10px; }
.lightbox .lb-controls { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; }
.lightbox .lb-controls button { width: 42px; height: 42px; border-radius: 11px; border: 1px solid rgba(255,255,255,0.25); background: rgba(0,0,0,0.45); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lightbox .lb-controls button:hover { background: rgba(0,0,0,0.7); }
