/* ==========================================================
   First Day Training - main stylesheet
   Colors are defined once here as variables (tokens).
   ========================================================== */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --text: #1c1e22;
  --muted: #596069;
  --border: #dfdbd1;
  --brand: #f5a400;          /* safety yellow-orange */
  --brand-strong: #d98c00;
  --on-brand: #1c1e22;
  --link: #9c4700;
  --link-hover: #6e3200;
  --header-bg: #1c1e22;
  --header-text: #f6f5f1;
  --header-muted: #b9bcc2;
  --catbar-bg: #2a2d33;
  --danger: #b42318;  --danger-bg: #fdecea;
  --warning: #a15c07; --warning-bg: #fff4e0;
  --tip: #0b7a43;     --tip-bg: #e7f6ee;
  --note: #1d5fbf;    --note-bg: #e9f1fc;
  --done: #0b7a43;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121316; --surface: #1b1d21; --surface-2: #23262b; --text: #ecebe7; --muted: #a3a7ae; --border: #2f333a;
    --link: #ffb547; --link-hover: #ffd18a; --header-bg: #0c0d0f; --catbar-bg: #1b1d21;
    --danger: #ff8a7a; --danger-bg: #3a1714; --warning: #ffc266; --warning-bg: #36260b;
    --tip: #5fd39a; --tip-bg: #0f2e1f; --note: #8db8ff; --note-bg: #142540; --done: #5fd39a;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121316; --surface: #1b1d21; --surface-2: #23262b; --text: #ecebe7; --muted: #a3a7ae; --border: #2f333a;
  --link: #ffb547; --link-hover: #ffd18a; --header-bg: #0c0d0f; --catbar-bg: #1b1d21;
  --danger: #ff8a7a; --danger-bg: #3a1714; --warning: #ffc266; --warning-bg: #36260b;
  --tip: #5fd39a; --tip-bg: #0f2e1f; --note: #8db8ff; --note-bg: #142540; --done: #5fd39a;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.6; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--on-brand); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { background: var(--header-bg); color: var(--header-text); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--header-text); text-decoration: none; font-size: 19px; white-space: nowrap; }
.brand:hover { color: var(--header-text); }
.brand-logo { display: block; height: 40px; width: auto; flex: none; }
.hero-logo { display: block; width: 200px; max-width: 55%; height: auto; margin: 0 0 18px; }
#print-sheet .ps-head img { vertical-align: middle; height: 28px; width: auto; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--brand); color: #1c1e22; font-weight: 800; font-size: 15px; letter-spacing: -.5px; }
.brand strong { color: var(--brand); }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 520px; }
.search-box input { width: 100%; height: 40px; border-radius: 8px; border: 1px solid #3a3e45; background: #2a2d33; color: #f6f5f1; padding: 0 12px 0 36px; font-size: 15px; }
.search-box input::placeholder { color: #9aa0a8; }
.search-box svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; color: #9aa0a8; pointer-events: none; }
.main-nav { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.main-nav a, .main-nav button { color: var(--header-text); text-decoration: none; padding: 8px 10px; border-radius: 6px; font-size: 15px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.main-nav a:hover, .main-nav button:hover { background: #2a2d33; color: #fff; }
.main-nav .btn-login { background: var(--brand); color: #1c1e22; font-weight: 600; }
.main-nav .btn-login:hover { background: var(--brand-strong); color: #1c1e22; }
.main-nav .lang-switch { border: 1px solid #4a4e57; font-size: 14px; padding: 6px 9px; }
.nav-toggle { display: none; background: none; border: 1px solid #3a3e45; color: var(--header-text); border-radius: 6px; padding: 6px 10px; font-size: 18px; cursor: pointer; margin-left: auto; }
.cat-bar { background: var(--catbar-bg); border-top: 1px solid #33373e; }
.cat-bar .wrap { display: flex; flex-wrap: wrap; gap: 2px; align-items: stretch; }
.cat-more { position: relative; }
.cat-more summary { list-style: none; cursor: pointer; color: var(--header-muted); padding: 9px 9px; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; }
.cat-more summary::-webkit-details-marker { display: none; }
.cat-more summary:hover, .cat-more[open] summary { color: #fff; }
.cat-more summary.active { color: #fff; border-bottom-color: var(--brand); }
.cat-more-menu { position: absolute; left: 0; top: 100%; max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto; z-index: 60; min-width: 230px; display: flex; flex-direction: column; padding: 6px 0; background: var(--catbar-bg); border: 1px solid #33373e; border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.cat-bar .cat-more-menu a { border-bottom: 0; border-left: 3px solid transparent; padding: 8px 14px; white-space: normal; }
.cat-more-menu a small { display: block; font-size: 12px; color: var(--header-muted); opacity: .8; }
.cat-bar a.cat-top { font-weight: 600; }
.cat-bar .cat-more-menu a.active { border-left-color: var(--brand); }
.cat-bar a { color: var(--header-muted); text-decoration: none; padding: 9px 9px; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; }
.cat-bar a:hover { color: #fff; }
.cat-bar a.active { color: #fff; border-bottom-color: var(--brand); }

/* Search dropdown */
.search-dropdown { position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-height: 70vh; overflow: auto; z-index: 60; }
.search-dropdown a { display: block; padding: 10px 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.search-dropdown a:hover, .search-dropdown a:focus { background: var(--surface-2); }
.search-dropdown .r-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.search-dropdown .r-title { font-weight: 600; display: block; }
.search-dropdown .r-sum { font-size: 14px; color: var(--muted); display: block; }
.search-dropdown .r-all { font-weight: 600; color: var(--link); }
.search-dropdown .r-empty { padding: 12px 14px; color: var(--muted); }
mark { background: #ffe08a; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 40px; padding-top: 28px; padding-bottom: 48px; }
.sidebar-inner { position: sticky; top: 120px; max-height: calc(100vh - 140px); overflow: auto; padding-right: 6px; }
.sidebar-title { display: block; font-weight: 700; color: var(--text); text-decoration: none; margin-bottom: 8px; font-size: 16px; }
.sidebar-list { list-style: none; padding: 0; margin: 12px 0 0; }
.sidebar-list a { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.35; }
.sidebar-list a:hover { background: var(--surface-2); color: var(--text); }
.sidebar-list a.current { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border); position: relative; top: 1px; }
.dot.done { background: var(--done); border-color: var(--done); }
.page { padding-top: 28px; padding-bottom: 56px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Topic article ---------- */
.topic { max-width: 780px; }
main { min-width: 0; }   /* lets wide diagrams and tables scroll inside their own box instead of stretching the page */
.topic h1, .page h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.01em; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 20px; }
.topic h2 { font-size: 24px; margin: 36px 0 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.topic h3 { font-size: 19px; margin: 24px 0 8px; }
.topic ul, .topic ol { padding-left: 24px; }
.topic li { margin: 4px 0; }
.applies { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
.badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.applies .badge a { color: inherit; text-decoration: none; }
.applies .badge:hover { border-color: var(--brand); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 32px; }
.tag-cloud a.badge { text-decoration: none; }
.tag-cloud a.badge span { color: var(--muted); font-weight: 400; }
.tag-cloud a.badge.current, .tag-cloud a.badge:hover { border-color: var(--brand); }
.badge.state { background: var(--note-bg); border-color: var(--note); color: var(--note); }
.badge.state a { color: inherit; text-decoration: none; }
.badge.state a:hover { text-decoration: underline; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

/* Callouts: <div class="callout warning"> */
.callout { border-left: 5px solid var(--note); background: var(--note-bg); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 18px 0; }
.callout p { margin: 4px 0; }
.callout.danger { border-color: var(--danger); background: var(--danger-bg); }
.callout.warning { border-color: var(--warning); background: var(--warning-bg); }
.callout.tip { border-color: var(--tip); background: var(--tip-bg); }
.callout.danger strong:first-child { color: var(--danger); }
.callout.warning strong:first-child { color: var(--warning); }
.callout.tip strong:first-child { color: var(--tip); }

/* Checklists: <ul class="checklist"> */
ul.checklist { list-style: none; padding-left: 0; }
ul.checklist li { position: relative; padding-left: 30px; }
ul.checklist li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border: 2px solid var(--muted); border-radius: 4px; }

/* To-do lists use the same boxes: <ul class="todo"> */
ul.todo { list-style: none; padding-left: 0; }
ul.todo li { position: relative; padding-left: 30px; }
ul.todo li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border: 2px solid var(--muted); border-radius: 50%; }
/* Tickable items (site.js adds role="checkbox") */
ul.checklist li[role="checkbox"], ul.todo li[role="checkbox"] { cursor: pointer; border-radius: 6px; }
ul.checklist li[role="checkbox"]:hover, ul.todo li[role="checkbox"]:hover { background: var(--surface-2); }
ul.checklist li.checked::before, ul.todo li.checked::before { content: "\2713"; background: var(--done); border-color: var(--done); color: #fff; font-size: 13px; font-weight: 700; line-height: 18px; text-align: center; }
ul.checklist li.checked, ul.todo li.checked { color: var(--muted); }
ul.todo li.checked { text-decoration: line-through; }
.checklist-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0 4px; font-size: 14px; color: var(--muted); }
.checklist-bar .checklist-count { margin-right: auto; }
.btn.small { font-size: 14px; padding: 5px 12px; border-width: 1px; }
.checklist-index { list-style: none; padding: 0; columns: 2 320px; }
.checklist-index li { break-inside: avoid; margin: 0 0 12px; }
.checklist-index small { color: var(--muted); }
.soon-tag.todo-tag { color: var(--note); background: var(--note-bg); }
#print-sheet { display: none; }

/* Do / Don't lists */
ul.do li::marker { content: "\2713  "; color: var(--tip); font-weight: 700; }
ul.dont li::marker { content: "\2717  "; color: var(--danger); font-weight: 700; }

/* Photo / video placeholders: <div class="placeholder image">Caption</div> */
.placeholder { margin: 22px 0; border: 2px dashed var(--border); border-radius: var(--radius); background: repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--surface) 14px 28px); aspect-ratio: 2 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 16px; font-size: 15px; }
.placeholder::before { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--surface); border: 1px solid var(--border); padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; color: var(--text); }
.placeholder.image::before { content: "\1F4F7  Photo coming soon"; }
.placeholder.video::before { content: "\25B6  Video coming soon"; }
.placeholder.diagram::before { content: "\270E  Diagram coming soon"; }
.placeholder.small { aspect-ratio: auto; min-height: 160px; }
/* Diagrams: <figure class="diagram"><img src="../images/diagrams/cat-slug.svg" alt="..." width="800" height="400" loading="lazy"><figcaption>Caption</figcaption></figure>
   The SVGs have their own white background so they read the same in light and dark mode. */
.diagram { margin: 22px 0; }
.diagram-img { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.diagram img { display: block; width: 100%; height: auto; }
@media (max-width: 700px) {
  /* Keep the labels readable on phones: the diagram stays about 650px wide and scrolls sideways inside its box */
  .diagram img { min-width: 650px; }
  .diagram figcaption::after { content: " (swipe sideways to see it all)"; }
}
.diagram figcaption { margin-top: 6px; font-size: 14px; color: var(--muted); text-align: center; }
/* Photo and video placeholders are hidden for launch. To show the "coming soon" boxes again, delete the next line. */
.placeholder { display: none; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 18px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--surface); }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); }

/* Standards / references block */
.refs { margin-top: 36px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.topic .refs h2 { border: 0; margin: 0 0 6px; padding: 0; font-size: 18px; }
.refs ul { margin: 0; }
.refs .small { font-size: 14px; color: var(--muted); margin: 8px 0 0; }

/* Mark complete box */
.complete-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.complete-box p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: 16px; padding: 10px 18px; border-radius: 8px; border: 2px solid var(--brand); background: var(--brand); color: #1c1e22; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #1c1e22; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.is-done { background: var(--done); border-color: var(--done); color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Topic quiz (opens from "Mark as complete") */
.quiz { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.quiz::backdrop { background: rgba(12,13,15,.6); }
.quiz-form { padding: 18px 22px 22px; }
.quiz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.quiz-head h2 { margin: 0; font-size: 21px; line-height: 1.3; }
.quiz-close { flex: none; font-size: 28px; line-height: 1; padding: 0 6px; background: none; border: 0; color: var(--muted); cursor: pointer; }
.quiz-close:hover { color: var(--text); }
.quiz-intro { margin: 6px 0 14px; font-size: 15px; color: var(--muted); }
.quiz-q { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.quiz-q legend { padding: 0 4px; font-weight: 600; }
.quiz-num { color: var(--muted); }
.quiz-choice { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px; border-radius: 6px; cursor: pointer; font-size: 16px; }
.quiz-choice:hover { background: var(--surface-2); }
.quiz-choice input { width: 18px; height: 18px; margin-top: 4px; flex: none; }
.quiz-q.is-right { border-color: var(--tip); background: var(--tip-bg); }
.quiz-q.is-wrong { border-color: var(--danger); background: var(--danger-bg); }
.quiz-feedback { margin: 6px 0 0; font-size: 15px; }
.quiz-result { margin: 4px 0 12px; padding: 10px 14px; border-radius: 8px; }
.quiz-result.pass { background: var(--tip-bg); color: var(--text); }
.quiz-result.fail { background: var(--warning-bg); color: var(--text); }
.quiz-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media print { .quiz { display: none !important; } }

/* Prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; background: var(--surface); color: var(--text); }
.pager a:hover { border-color: var(--brand); }
.pager small { display: block; color: var(--muted); font-size: 13px; }
.pager .next { text-align: right; grid-column: 2; }

/* Progress bars */
.progress { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.progress-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; min-width: 80px; border: 1px solid var(--border); }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--done); transition: width .3s; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--text); }
.card h3 { margin: 0; font-size: 18px; line-height: 1.3; display: flex; gap: 8px; align-items: baseline; }
.card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.card .card-foot { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.card .num { font-size: 13px; font-weight: 700; color: var(--brand-strong); }

/* ---------- Home ---------- */
.hero { background: var(--header-bg); color: var(--header-text); padding: 56px 0 64px; background-image: repeating-linear-gradient(135deg, rgba(245,164,0,.08) 0 18px, transparent 18px 36px); }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; margin: 0 0 14px; max-width: 800px; letter-spacing: -.02em; }
.hero h1 span { color: var(--brand); }
.hero p { font-size: 19px; color: var(--header-muted); max-width: 680px; margin: 0 0 24px; }
.hero-search { position: relative; max-width: 640px; }
.hero-search .search-dropdown { top: 60px; }
.hero-search input { width: 100%; height: 54px; font-size: 18px; border-radius: 10px; border: 0; padding: 0 18px; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; color: var(--header-muted); font-size: 15px; }
.hero-stats strong { color: #fff; font-size: 22px; display: block; }
.section { padding: 40px 0 8px; }
.section h2 { font-size: 26px; margin: 0 0 4px; }
.section > .wrap > p { color: var(--muted); margin: 0; }
.start-list { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin: 20px 0; }
.start-list li { counter-increment: s; }
.start-list a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); }
.start-list a:hover { border-color: var(--brand); }
.start-list a::before { content: counter(s); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #1c1e22; font-weight: 700; font-size: 14px; }
.banner { margin: 32px 0; padding: 22px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner h2 { margin: 0 0 4px; font-size: 21px; }
.banner p { margin: 0; color: var(--muted); }

/* ---------- All topics / search page ---------- */
.filter-input { width: 100%; max-width: 520px; height: 46px; font-size: 17px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.topic-group { margin: 28px 0; }
.topic-group h2 { font-size: 21px; margin: 0 0 8px; }
.topic-group ul { columns: 3 240px; padding-left: 20px; margin: 0; }
.topic-group li { break-inside: avoid; margin: 3px 0; }
.result { padding: 16px 0; border-bottom: 1px solid var(--border); }
.result a { font-size: 19px; font-weight: 600; }
.result p { margin: 4px 0 0; color: var(--muted); }
.result .r-cat { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.search-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.search-controls select { height: 46px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 10px; font-size: 16px; }

/* ---------- Last updated, disclaimers ---------- */
.last-updated { margin: 28px 0 0; font-size: 14px; color: var(--muted); }
.page-disclaimer { margin-top: 24px; padding: 12px 16px; border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 0 8px 8px 0; background: var(--surface); font-size: 14px; color: var(--muted); }
.page-disclaimer p { margin: 0; }
.callout.note strong:first-child { color: var(--note); }

/* ---------- Related topics ---------- */
.related { margin-top: 24px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.topic .related h2 { border: 0; margin: 0 0 8px; padding: 0; font-size: 18px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 20px; }
.related li { margin: 0; }
.related li span { display: block; font-size: 13px; color: var(--muted); }

/* ---------- Coming soon ---------- */
.topic-group h2 .badge { vertical-align: middle; margin-left: 6px; }
.soon-box { margin: 28px 0; padding: 14px 18px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.soon-box summary { cursor: pointer; font-weight: 600; font-size: 18px; }
.soon-box ul { columns: 3 240px; padding-left: 20px; margin: 12px 0 8px; }
.soon-box li { break-inside: avoid; margin: 3px 0; color: var(--muted); }
.soon-box p { margin: 8px 0 0; font-size: 15px; }
.soon-heading { font-size: 21px; margin: 32px 0 4px; }
.result.planned .soon-title { font-size: 19px; font-weight: 600; color: var(--muted); }
.soon-tag { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--warning); background: var(--warning-bg); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.count-panel { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin: 18px 0 24px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.count-panel div { font-size: 15px; color: var(--muted); }
.count-panel strong { display: block; font-size: 24px; color: var(--text); }
.count-panel .progress-bar { flex: 1 1 200px; height: 10px; }
.hero-stats a { color: inherit; text-decoration: none; }
.hero-stats a:hover strong { color: var(--brand); }

/* ---------- Forms (topic requests, organization inquiries) ---------- */
.form-card { max-width: 680px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin: 20px 0; }
.form-card h2 { margin-top: 0; }
.form-card label { display: block; font-weight: 600; margin: 14px 0 4px; }
.form-card input, .form-card select, .form-card textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.form-card textarea { min-height: 120px; resize: vertical; }
.form-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-card fieldset { border: 0; padding: 0; margin: 14px 0 0; }
.form-card legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
.form-card label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 6px 0; }
.form-card label.check input { width: 18px; height: 18px; flex: none; }
.form-card .hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.form-card .btn { margin-top: 18px; }
.form-status { margin: 14px 0 0; padding: 10px 14px; border-radius: 8px; background: var(--tip-bg); color: var(--text); font-size: 15px; }
.form-status.error { background: var(--warning-bg); }
.form-card .btn:disabled { opacity: .6; cursor: wait; }
.form-card .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Legal pages ---------- */
.legal h2 { font-size: 22px; }
.legal .effective { color: var(--muted); font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--header-bg); color: var(--header-muted); padding: 40px 0 20px; margin-top: 40px; font-size: 15px; }
.site-footer a { color: var(--header-text); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 28px; }
.site-footer h3 { color: var(--header-text); font-size: 15px; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.footer-bottom { border-top: 1px solid #33373e; margin-top: 28px; padding-top: 16px; font-size: 14px; }
.site-footer ul.footer-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }
.site-footer ul.footer-legal li { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 24px; }
  .sidebar { order: 2; }
  .sidebar-inner { position: static; max-height: none; border-top: 1px solid var(--border); padding-top: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .search-box { order: 3; flex-basis: 100%; max-width: none; margin-bottom: 10px; }
  .main-nav { display: none; order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  body.nav-open .main-nav { display: flex; }
  /* On phones the category menu sits behind the menu button too */
  .cat-bar { display: none; }
  body.nav-open .cat-bar { display: block; }
  .cat-bar .wrap { flex-direction: column; gap: 0; }
  .cat-bar a, .cat-more summary { padding: 11px 4px; border-bottom: 1px solid #33373e; }
  .cat-more-menu { position: static; box-shadow: none; border: 0; max-width: none; max-height: none; padding: 0 0 6px 12px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .form-card .row { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 44px; }
}
/* Accounts (login, signup, account, verify pages) */
.acct-card { max-width: 720px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 18px; }
.acct-card h2 { margin-top: 0; }
.acct-form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.acct-form input[type="password"], .acct-form input[type="text"], .acct-form input[type="email"] { width: 100%; max-width: 420px; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.acct-form .cert-row input { max-width: none; }
.acct-status .form-status { max-width: 680px; }
.acct-tip { display: block; margin-top: 6px; font-size: 15px; }
.acct-links { margin: 14px 0 0; font-size: 15px; }
.acct-danger summary { cursor: pointer; color: var(--danger); font-weight: 600; margin-top: 8px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.92); color: #fff; }
.verify-card { max-width: 680px; padding: 18px 22px; border: 2px solid var(--brand); border-radius: var(--radius); background: var(--surface); }
.verify-ok { font-size: 22px; font-weight: 800; color: #1f8a3b; margin: 0 0 8px; }
.verify-card table { width: 100%; border-collapse: collapse; }
.verify-card th, .verify-card td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.verify-card th { width: 40%; color: var(--muted); font-weight: 600; }

/* Certificate of completion (certificate.html) */
.complete-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cert-controls { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 0 0 20px; }
.cert-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.cert-row input { flex: 1 1 240px; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.cert-help { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.certificate { background: #fff; color: #1c1e22; border: 10px solid var(--brand); border-radius: 6px; padding: 10px; margin: 0 0 24px; }
.cert-inner { border: 2px solid #1c1e22; padding: 28px 24px; text-align: center; }
.cert-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.cert-brand strong { color: var(--brand-strong); }
.cert-kicker { font-size: 30px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: 14px 0 6px; }
.cert-small { margin: 6px 0; font-size: 16px; color: #3a3d43; }
.cert-name { font-size: 32px; font-weight: 700; font-family: Georgia, "Times New Roman", serif; margin: 8px auto; max-width: 560px; min-height: 1.3em; border-bottom: 2px solid #1c1e22; }
.cert-topic { font-size: 24px; font-weight: 700; margin: 8px 0 0; }
.cert-cat { margin: 2px 0 8px; font-size: 15px; color: #3a3d43; }
.cert-sign { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; margin: 36px auto 12px; max-width: 620px; font-size: 13px; color: #3a3d43; text-align: left; }
.cert-sign span { display: block; border-bottom: 1px solid #1c1e22; height: 28px; margin-bottom: 4px; }
.cert-sign .cert-date-out { display: block; font-size: 16px; font-weight: 600; color: #1c1e22; line-height: 28px; height: 28px; text-align: center; }
.cert-no { margin: 18px 0 0; font-size: 13px; color: #3a3d43; letter-spacing: .02em; }
.cert-no strong { font-size: 16px; color: #1c1e22; letter-spacing: .06em; }
.cert-note { font-size: 11px; color: #555; margin: 16px auto 0; max-width: 680px; line-height: 1.4; }
.cert-verify { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; margin: 18px auto 0; }
.cert-verify .cert-no { margin: 0; text-align: left; }
.cert-qr { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: #3a3d43; }
.cert-qr svg { display: block; width: 112px; height: 112px; background: #fff; border: 1px solid #c9ccd2; }
.cert-list li { margin: 6px 0; }
@media (max-width: 560px) {
  .cert-kicker { font-size: 22px; } .cert-name { font-size: 24px; } .cert-topic { font-size: 19px; }
  .cert-sign { grid-template-columns: 1fr; gap: 16px; }
}

@media print {
  .site-header, .site-footer, .sidebar, .complete-box, .pager, .placeholder, .form-card, .related { display: none !important; }
  .diagram { break-inside: avoid; }
  .layout { display: block; }
  .checklist-bar { display: none !important; }
  /* Printing a single checklist: show only the print sheet */
  body.printing-sheet > *:not(#print-sheet) { display: none !important; }
  body.printing-sheet { background: #fff; color: #000; font-size: 13pt; }
  body.printing-sheet #print-sheet { display: block; padding: 0 8px; }
  #print-sheet .ps-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 6px; font-size: 11pt; }
  #print-sheet h1 { font-size: 20pt; margin: 14px 0 2px; }
  #print-sheet .ps-topic { margin: 0 0 12px; font-size: 11pt; }
  #print-sheet .ps-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 10px 0 16px; font-size: 11pt; }
  #print-sheet .ps-fields span { display: inline-block; width: 70%; border-bottom: 1px solid #000; }
  #print-sheet ul { list-style: none; padding: 0; }
  #print-sheet li { position: relative; padding: 6px 0 6px 32px; border-bottom: 1px solid #ccc; color: #000 !important; text-decoration: none !important; }
  #print-sheet li::before { content: "" !important; position: absolute; left: 2px; top: 7px; width: 16px; height: 16px; border: 2px solid #000 !important; background: #fff !important; border-radius: 3px; }
  #print-sheet li.checked::before { content: "\2713" !important; color: #000 !important; font-size: 13px; line-height: 16px; text-align: center; }
  #print-sheet .ps-foot { margin-top: 20px; font-size: 9pt; }
  #print-sheet .ps-foot .ps-fields { font-size: 11pt; }
  /* Certificate: print only the certificate, landscape, on one page */
  body[data-page="certificate"] { background: #fff; }
  body[data-page="certificate"] .certificate { page: certificate; }
  .cert-page > *:not(#certificate-page), .cert-controls, .cert-others { display: none !important; }
  .cert-page { padding: 0 !important; max-width: none !important; }
  .certificate { margin: 0; border-color: #f5a400; -webkit-print-color-adjust: exact; print-color-adjust: exact; page-break-inside: avoid; }
  .cert-inner { padding: 24px 32px; }
  .cert-sign { margin: 22px auto 8px; }
  .cert-verify { margin-top: 12px; }
  .cert-qr svg { width: 100px; height: 100px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cert-note { margin-top: 10px; }
  .cert-name.blank { border-bottom-color: #1c1e22; }
}
@page certificate { size: landscape; margin: 0.4in; }

/* ---------- Toolbox talks (toolbox-talks/*.html): one printable page each ---------- */
.talk-sheet { background: #fff; color: #1c1e22; border: 2px solid #1c1e22; border-radius: 8px; padding: 18px 22px; margin: 0 0 22px; line-height: 1.4; }
.talk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; border-bottom: 3px solid #f5a400; padding-bottom: 8px; margin-bottom: 10px; }
.talk-brand { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #3a3d43; }
.talk-brand strong { color: #b87a00; }
.talk-time { font-size: 13px; color: #3a3d43; }
.talk-sheet p.talk-title { flex-basis: 100%; margin: 2px 0 0; font-size: 26px; font-weight: 700; line-height: 1.15; color: #1c1e22; }
.talk-sheet h2.talk-h { margin: 12px 0 4px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: #1c1e22; border: 0; padding: 0; }
.talk-sheet p { margin: 0 0 4px; color: #1c1e22; font-size: 15px; }
.talk-sheet ul, .talk-sheet ol { margin: 0; padding-left: 22px; }
.talk-sheet li { margin: 2px 0; font-size: 15px; color: #1c1e22; }
.talk-action { margin: 10px 0 0; padding: 7px 10px; border: 2px solid #1c1e22; border-radius: 6px; background: #fff7e0; font-size: 15px; }
.talk-signin { width: 100%; border-collapse: collapse; margin-top: 4px; table-layout: fixed; }
.talk-signin th, .talk-signin td { border: 1px solid #1c1e22; padding: 0 6px; height: 27px; text-align: left; font-size: 12px; color: #1c1e22; background: #fff; }
.talk-signin th { background: #eceef1; height: 22px; font-size: 12px; }
.talk-signin .col-n { width: 6%; text-align: center; } .talk-signin .col-name { width: 34%; } .talk-signin .col-sig { width: 36%; } .talk-signin .col-co { width: 24%; }
.talk-meta { display: grid; grid-template-columns: 1.2fr 1.4fr 1.4fr; gap: 6px 14px; margin: 4px 0 6px; font-size: 12px; }
.talk-meta span { display: block; border-bottom: 1px solid #1c1e22; height: 20px; margin-bottom: 1px; }
.talk-foot { margin-top: 8px; font-size: 10px !important; color: #555 !important; line-height: 1.35; }
.talk-print { margin: 0 0 14px; }
.talk-more { font-size: 15px; }
@media (max-width: 560px) { .talk-sheet p.talk-title { font-size: 22px; } .talk-meta { grid-template-columns: 1fr; } }
@media print {
  body[data-page^="toolbox-talks/"] .site-header, body[data-page^="toolbox-talks/"] .site-footer, body[data-page^="toolbox-talks/"] .sidebar,
  body[data-page^="toolbox-talks/"] .breadcrumbs, body[data-page^="toolbox-talks/"] .skip-link { display: none !important; }
  body[data-page^="toolbox-talks/"] article.topic > *:not(.talk-sheet) { display: none !important; }
  body[data-page^="toolbox-talks/"] { background: #fff !important; }
  body[data-page^="toolbox-talks/"] .layout, body[data-page^="toolbox-talks/"] main, body[data-page^="toolbox-talks/"] article.topic { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; }
  .talk-sheet { page: talk; border-width: 2px; border-radius: 0; padding: 0.12in 0.18in; margin: 0; break-inside: avoid; page-break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .talk-sheet p.talk-title { font-size: 18pt; }
  .talk-sheet p, .talk-sheet li, .talk-action { font-size: 10.5pt; }
  .talk-sheet h2.talk-h { font-size: 10pt; margin-top: 9px; }
  .talk-signin th, .talk-signin td { height: 0.26in; font-size: 9pt; }
  .talk-signin th { height: 0.2in; }
  .talk-foot { font-size: 7.5pt !important; }
}
@page talk { size: letter portrait; margin: 0.4in; }
/* ---------- Paid courses (courses/*.html, js/courses.js) ---------- */
.course-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 20px 0; }
.course-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.course-card h2 { margin: 0 0 6px; font-size: 21px; border: 0; padding: 0; }
.course-card h2 a { color: inherit; text-decoration: none; }
.course-meta { font-size: 14px; color: var(--muted); margin: 8px 0; }
.course-price { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 0; font-weight: 700; }
.course-price .owned { color: var(--brand-strong); }
.course-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.course-side { position: sticky; top: 90px; }
.buybox { background: var(--surface); border: 2px solid var(--brand); border-radius: 12px; padding: 18px 20px; }
.buy-price { font-size: 30px; font-weight: 800; margin: 0 0 8px; }
.buy-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.buy-points { margin: 0 0 14px; padding-left: 20px; font-size: 15px; }
.buy-signin, .course-soon { font-size: 14px; color: var(--muted); }
.redeem-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.redeem-form label { font-weight: 600; font-size: 14px; }
.course-module { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 8px 0; background: var(--surface); }
.course-module summary { cursor: pointer; }
.course-module summary small, .course-module li small { color: var(--muted); font-weight: 400; }
.course-module ul { margin: 8px 0 4px; }
.course-free { font-size: 13px; font-weight: 700; margin-left: 6px; }
.cp-bar { height: 10px; border-radius: 6px; background: var(--border); overflow: hidden; margin: 8px 0 4px; }
.cp-bar span { display: block; height: 100%; background: var(--brand); }
.cp-pct { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.cp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.cp-head a { font-weight: 700; }
.cp-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.cp-side { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; }
.cp-mod h3 { font-size: 14px; margin: 14px 0 4px; }
.cp-mod ul { list-style: none; margin: 0; padding: 0; }
.cp-item { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 6px; font-size: 15px; color: var(--text); text-decoration: none; line-height: 1.3; }
.cp-item:hover { background: var(--bg); }
.cp-item.active { background: var(--brand); color: #1c1e22; font-weight: 700; }
.cp-item.locked { color: var(--muted); }
.cp-item.done .cp-mark { color: #1a8f3c; font-weight: 800; }
.cp-item em { font-size: 12px; font-style: normal; font-weight: 700; color: var(--brand-strong); }
.cp-mark { width: 1.2em; flex: none; text-align: center; }
.cp-main { min-width: 0; max-width: 780px; }
.cp-main:focus { outline: none; }
.cp-crumb { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
.lesson-body h3 { margin-top: 26px; }
.lesson-body h4 { margin-top: 18px; }
.cp-nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--border); }
.cp-q { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px 8px; margin: 0 0 14px; background: var(--surface); }
.cp-q legend { font-weight: 700; padding: 0 6px; }
.cp-q legend span { color: var(--brand-strong); }
.cp-q label { display: block; padding: 6px 4px; cursor: pointer; }
.cp-missed li { margin: 8px 0; }
#cp-toggle { display: none; }
@media (max-width: 900px) {
  .course-grid { grid-template-columns: 1fr; } .course-side { position: static; order: -1; }
  .cp-layout { grid-template-columns: 1fr; } #cp-toggle { display: inline-block; }
  .cp-side { display: none; position: static; max-height: none; } .cp-side.open { display: block; }
}
@media print { .course-side, .cp-side, .cp-head, .cp-nav { display: none !important; } }
/* Advertising notice (AdSense consent) */
.ads-notice { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1000; max-width: 720px; margin: 0 auto; padding: 14px 16px; background: var(--surface, #fff); color: var(--text); border: 2px solid var(--border); border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.25); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.ads-notice p { margin: 0; flex: 1 1 320px; font-size: 15px; }
.ads-notice .btn { padding: 8px 16px; font-size: 15px; }
@media print { .ads-notice { display: none; } }