/* Debate Library styles. Copied to learn/learn.css by build-learn.mjs.
   The colours, fonts and layers come from the one shared token file, assets/tokens.css (spec V0), which every
   library page links before this file. assets/theme-boot.js sets the light or dark theme before the page paints. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 17px/1.72 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
a { color: var(--aff); text-underline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: var(--z-pop); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Top bar: the same header as tabuladebate.com (brand, site nav, Sign in, Open the app). One rule under it. */
.site { border-bottom: 1px solid var(--border); background: var(--canvas); }
.site-in { display: flex; align-items: center; gap: var(--s6); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { height: 30px; width: auto; display: block; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 22px; letter-spacing: -0.02em; }
.product { font-family: var(--font-display); font-weight: var(--fw-4); font-size: 18px; }
.site-nav { display: flex; gap: var(--s5); font-size: 15px; font-weight: var(--fw-3); }
.site-nav a, .signin, .menu-panel a { color: var(--text-2); text-decoration: none; }
.site-nav a:hover, .signin:hover { color: var(--text); }
.site-nav a.here { color: var(--text); }
.site-end { display: flex; align-items: center; gap: var(--s4); margin-left: auto; }
.signin { font-size: 15px; font-weight: var(--fw-3); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: var(--h-lg); height: var(--h-lg); border-radius: var(--r-lg); color: var(--text); }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 46px; z-index: var(--z-pop); min-width: 200px; padding: var(--s2); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-xl); display: grid; }
.menu-panel a { padding: 10px var(--s3); border-radius: var(--r-lg); font-weight: var(--fw-3); }
.menu-panel a:hover { background: var(--sunk); }

/* Page: one reading column (about 68 characters a line), and "On this page" beside it on wide screens. */
.page { padding-top: var(--s6); }
.page-main { max-width: 680px; min-width: 0; margin: 0 auto; }
.toc { display: none; }
.toc-m { margin: 0 0 28px; font-size: 15px; }
.toc-m summary { cursor: pointer; font-weight: var(--fw-3); color: var(--text-2); }
.toc-m ul, .toc ul { list-style: none; padding: 0; margin: 10px 0 0; }
.toc-m li + li, .toc li + li { margin-top: 2px; }
.toc-m a, .toc a { display: block; padding: 4px 0; color: var(--text-2); text-decoration: none; }
.toc a:hover, .toc-m a:hover { color: var(--text); }
@media (min-width: 1100px) {
  .page.has-toc { display: grid; grid-template-columns: minmax(0, 680px) 220px; gap: 72px; justify-content: center; }
  .page.has-toc .page-main { margin: 0; }
  .toc { display: block; position: sticky; top: 24px; align-self: start; font-size: 14px; }
  .toc-title { margin: 0 0 6px; font-size: 13px; font-weight: var(--fw-3); color: var(--text-3); }
  .toc-m { display: none; }
}

/* Reading helper (library.js): progress and minutes left in the side list, and on narrower screens a floating
   button that opens the section list (as reading apps do it). With the script, it replaces the fold-out list. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.has-reader .toc-m { display: none; }
.has-reader .site-foot { padding-bottom: 104px; } /* room so the floating button never covers the last lines */
.toc a[aria-current], .rd-list a[aria-current] { color: var(--text); font-weight: var(--fw-3); }
.toc a.rd-done, .rd-list a.rd-done { color: var(--text-3); }
.rd-bar { height: 4px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; margin: var(--s2) 0 6px; }
.rd-fill { height: 100%; width: 0; background: var(--text-2); border-radius: var(--r-pill); }
.rd-left { margin: 0 0 var(--s3); font-size: 13px; color: var(--text-3); }
.rd-pill { position: fixed; right: var(--s4); bottom: var(--s4); z-index: var(--z-pop); display: flex; align-items: center; gap: 10px; max-width: min(340px, calc(100vw - 32px)); min-height: 48px; padding: 6px 16px 6px 6px; border-radius: var(--r-pill); border: 1px solid var(--border-ctl); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .15s, transform .15s, visibility .15s; }
.rd-pill.rd-show, .rd-pill[aria-expanded="true"] { opacity: 1; visibility: visible; transform: none; }
.rd-pct { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--sunk); font-size: 12px; font-weight: var(--fw-4); font-variant-numeric: tabular-nums; }
.rd-label { display: grid; text-align: left; min-width: 0; line-height: 1.3; }
.rd-sec { font-size: 14px; font-weight: var(--fw-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-time { font-size: 12px; color: var(--text-3); }
.rd-panel { position: fixed; right: var(--s4); bottom: 76px; z-index: var(--z-pop); width: min(360px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow: auto; padding: var(--s4); border-radius: var(--r-xl); border: 1px solid var(--border); background: var(--panel); box-shadow: 0 12px 40px rgb(0 0 0 / 0.22); }
.rd-panel[hidden] { display: none; }
.rd-head { display: flex; align-items: center; justify-content: space-between; }
.rd-title { margin: 0; font-weight: var(--fw-4); }
.rd-close { font: inherit; font-size: 14px; color: var(--text-2); background: none; border: 0; padding: 6px; cursor: pointer; }
.rd-list { list-style: none; padding: 0; margin: 0; }
.rd-list a { display: block; padding: 10px var(--s2); border-radius: var(--r-lg); color: var(--text-2); text-decoration: none; }
.rd-list a:hover { background: var(--sunk); }
@media (max-width: 520px) {
  .rd-panel { right: 0; left: 0; bottom: 0; width: auto; max-height: 75vh; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom)); }
}
@media (min-width: 1100px) { .rd-pill, .rd-panel { display: none; } .has-reader .site-foot { padding-bottom: 48px; } }
/* Buttons: secondary (.btn) and primary (.btn.primary), with the app's hover and pressed states (spec V5). */
.btn { display: inline-flex; align-items: center; min-height: var(--h-lg); padding: 0 var(--s4); border-radius: var(--r-lg); border: 1px solid var(--border-ctl); background: var(--panel); color: var(--text); font-weight: var(--fw-3); text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--sunk); border-color: var(--text-2); }
.btn:active { background: var(--border); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:active { background: var(--accent-press); border-color: var(--accent-press); }

.crumbs { font-size: 14px; color: var(--text-3); margin: 0 0 8px; }
.crumbs a { color: var(--text-3); }
.meta { font-size: 14px; color: var(--text-3); margin: -6px 0 24px; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: clamp(30px, 5.5vw, 44px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 16px; }
/* Sections are set apart by space, not rules (no double lines). */
h2 { font-size: 24px; font-weight: 800; margin: 56px 0 14px; scroll-margin-top: 24px; }
h3 { font-size: 19px; font-weight: 700; margin: 36px 0 10px; }
h4 { font-size: 17px; margin: 20px 0 6px; }
p { margin: 0 0 20px; }
ul, ol { margin: 0 0 20px; padding-left: 24px; }
li + li { margin-top: 8px; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--sunk); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }

/* Quotes: a plain bordered panel. No coloured side stripe (a common "AI look"; see the AI-slop check in PLAN.md §1). */
blockquote { margin: 0 0 20px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
blockquote p:last-child { margin: 0; }
/* The page summary ("Plain version" in the Markdown): a lead paragraph under the title, as docs sites do it.
   Larger text and space below set it apart. No box, no tint, no label, no rule. */
blockquote.plain { margin: 0 0 36px; padding: 0; background: none; border: 0; border-radius: 0; font-size: 20px; line-height: 1.55; color: var(--text-2); }

.table { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--sunk); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

pre.flow { overflow-x: auto; margin: 0 0 10px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; font: 13px/1.5 var(--font-mono); }
pre.flow code { background: none; border: 0; padding: 0; font-size: inherit; }

/* End of page: one card ("Next on your path"), then a plain call to action. No stack of boxes. */
.paths { margin: 56px 0 0; padding: 18px 20px; border-radius: var(--r-xl); background: var(--panel); border: 1px solid var(--border); }
.paths h2 { margin: 0 0 6px; font-size: 13px; font-weight: var(--fw-3); font-family: inherit; color: var(--text-3); letter-spacing: 0; }
.paths ul { margin: 0; list-style: none; padding: 0; color: var(--text-2); }
.paths a { font-weight: var(--fw-4); }
.cta { margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: var(--s3) 20px; align-items: center; justify-content: space-between; }
.cta p { margin: 0; flex: 1 1 320px; color: var(--text-2); }

.site-foot { margin-top: 72px; border-top: 1px solid var(--border); padding: 28px 0 48px; color: var(--text-3); font-size: 14px; }
.site-foot a { color: var(--text-3); }
.site-foot p { margin: 0 0 6px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: var(--s2) 20px; margin: 0 0 18px; font-weight: var(--fw-3); }
.foot-nav a { color: var(--text-2); text-decoration: none; }

@media (max-width: 760px) {
  .site-nav, .signin { display: none; }
  .menu { display: block; }
  .site-end { gap: var(--s2); }
}
@media (max-width: 520px) {
  .product { font-size: 16px; }
  .wordmark { font-size: 20px; }
  .site-in { gap: var(--s3); }
  .site-end .btn { min-height: 36px; padding: 0 12px; font-size: 14px; }
  body { font-size: 16px; }
}

/* ---------- library pictures (docs/library/visuals/STYLE.md §6) ----------
   Pictures are drawn on white. Banner and inline pictures sit on a white card in both themes; spot pictures
   have no card: in light mode their white melts into the page (multiply), in dark mode they sit on a white tile
   so the black lines stay visible. The raw #fff and #3c434c are on purpose (the light-theme --panel and
   --text-2), so the cards do not follow the dark theme; learn.css defines no colour tokens. */
.lib-figure { margin: 24px 0; }
.lib-figure img { display: block; width: 100%; height: auto; }
.lib-figure figcaption { margin-top: 8px; padding: 0 4px; font-size: var(--fs-2); line-height: 1.5; color: var(--text-2); }
.lib-figure--hero, .lib-figure--inline, .lib-figure--diagram { padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.lib-figure--hero figcaption, .lib-figure--inline figcaption, .lib-figure--diagram figcaption { color: #3c434c; }
.lib-figure--inline, .lib-figure--diagram { max-width: 600px; margin-left: auto; margin-right: auto; }
.lib-figure--spot { width: 200px; margin: 4px auto 16px; text-align: center; }
.lib-figure--spot img { mix-blend-mode: multiply; }
:root[data-theme="dark"] .lib-figure--spot img { mix-blend-mode: normal; background: #fff; border-radius: 16px; padding: 10px; }
@media (min-width: 820px) {
  .lib-figure--spot { float: right; width: 220px; margin: 4px 0 12px 24px; }
  .lib-figure--spot ~ h2 { clear: both; }
}

/* ---------- guided tracks and checks (TRACKS.md §3.4) ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.draft-note { display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: 6px; border: 1px dashed var(--border-ctl); color: var(--text-3); font-size: 14px; }
.check { margin: 40px 0 0; padding: 4px 20px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.check > h2 { border-top: 0; padding-top: 12px; margin-top: 8px; }
.check-intro { color: var(--text-2); }
.q { padding: 4px 0 12px; border-top: 1px solid var(--border); }
.q h3 { margin-top: 16px; }
.q .prompt { font-weight: 600; }
.q details { margin: 8px 0; }
.q summary { cursor: pointer; color: var(--aff); }
.choices-form { border: 0; margin: 0; padding: 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; margin: 0 0 6px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.choice:hover { background: var(--sunk); }
.choice input { margin-top: 5px; flex: none; }
.mark { margin-left: auto; font-weight: 700; white-space: nowrap; }
.mark.ok { color: var(--aff); }
.mark.bad { color: var(--neg); }
.hint { font-size: 14px; color: var(--text-3); }
.why-box { margin: 10px 0 0; padding: 10px 12px; background: var(--sunk); border-radius: 8px; }
.why-box p { margin: 0; }
.self-form label { display: block; font-weight: 600; margin: 6px 0; }
.self-form textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--border-ctl); border-radius: 8px; background: var(--canvas); color: var(--text); }
.self-form .btn { margin: 8px 0; cursor: pointer; font: inherit; }
.self-reveal { margin-top: 8px; }
.self-reveal ul { list-style: none; padding: 0; }
.check-actions { margin: 16px 0 6px; }
.check-actions .btn, .progress-tools .btn { cursor: pointer; font: inherit; }
.check-status, .tools-status { font-weight: 600; min-height: 1.4em; }
.track .steps li { padding: 6px 0; }
.track .steps li.done a { color: var(--text-2); }
.tick { color: var(--aff); font-weight: 700; font-size: 14px; margin-left: 6px; }
.track-progress { font-weight: 700; }
.resume a { font-weight: 700; }
.progress-tools { margin-top: 36px; }
.progress-tools input[type="text"] { font: inherit; padding: 6px 8px; border: 1px solid var(--border-ctl); border-radius: 6px; background: var(--canvas); color: var(--text); margin-left: 6px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.track-list li { margin-bottom: 8px; }
.cert { display: none; }
@media print {
  body.printing-cert .wrap > *:not(main), body.printing-cert main > *:not(.cert) { display: none !important; }
  body.printing-cert .cert { display: block !important; text-align: center; padding: 80px 40px; border: 3px double #000; color: #000; background: #fff; }
  .cert-kicker { font: 800 28px/1.2 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; }
  .cert-name { font: 800 40px/1.2 var(--font-display); margin: 40px 0 16px; }
  .cert-fine { margin-top: 48px; font-size: 12px; color: #333; }
}
