/* ==========================================================================
   CSG Learning Platform: shared look and feel
   Components extracted from the original CSG staff packs (format reference only).
   A page picks its theme with <html data-theme="dark|bright">.
   Packs never redefine these components; they only add content.
   ========================================================================== */

/* ---------- FONTS (self-hosted, SIL OFL; see assets/fonts/OFL-NOTICE.txt) ---------- */
@font-face { font-family: "Inter"; src: url("fonts/inter-var.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-var.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- THEME TOKENS ---------- */
:root, [data-theme="dark"] {
  --header-h: 88px; /* 72px header logo + 8px padding top and bottom (64px on phones) */
  /* Brand colours (03_DESIGN_SYSTEM.md) */
  --navy: #06192F; --teal: #1FD0DC; --white: #ffffff;
  --offwht: #C8DCE3; --muted: #9FB8C2; --dkteal: #0B2440;
  --midteal: #2A8F92; --red: #C0392B; --green: #27ae60;
  --amber: #D4A843;

  /* Roles: components use these, so a theme only swaps roles */
  --bg: var(--navy);
  --text: var(--offwht);
  --heading: var(--white);
  --surface: var(--dkteal);
  --accent: var(--teal);          /* fills, borders, bars */
  --accent-ink: var(--teal);      /* accent used as text */
  --on-accent: var(--navy);       /* text sitting on an accent fill */
  --warm: var(--amber);
  --warm-ink: var(--amber);
  --warn: var(--red);
  --warn-ink: #E88;
  --ok: var(--green);
  --line: rgba(31,208,220,0.24);
  --line-soft: rgba(31,208,220,0.12);
  --line-card: rgba(31,208,220,0.2);
  --tint: rgba(31,208,220,0.08);
  --tint-strong: rgba(31,208,220,0.16);
  --header-bg: rgba(6,25,47,0.94);
  --sidebar-bg: #041427;
  --sidebar-bg-solid: var(--navy);
  --diagram-bg: rgba(10,14,20,0.4);
  --helpline-bg: var(--red);
  --helpline-ink: var(--white);
  --wrong-bg: rgba(192,57,43,0.1);
  --wrong-line: var(--red);
  --wrong-ink: rgba(255,255,255,0.6);
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-w: 295px;
  --glow: 0 0 16px rgba(31,208,220,0.45);
  --card-shadow: 0 10px 30px rgba(0,0,0,0.25);
  --art-bg: linear-gradient(160deg, #0E3354, #0A2238);
  --font-head: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

/* Bright theme for cheerful parent, child and teacher packs.
   Same layout and components; lighter ground, navy text, rounder corners.
   Teal stays the brand accent; amber is the warm secondary.
   Red is never used here except for a genuine safety warning (.warn). */
[data-theme="bright"] {
  --bg: #F3FAFA;
  --text: #22364F;
  --heading: var(--navy);
  --surface: #ffffff;
  --accent: var(--teal);
  --accent-ink: #086E70;          /* the packs' print teal: AA on white and on the light tints (audit 10 Nov 2026) */
  --on-accent: var(--navy);
  --muted: #4F6B70;               /* darkened muted so it passes AA on white */
  --warm: var(--amber);
  --warm-ink: #8A6512;
  --warn: var(--red);
  --warn-ink: #A93226;
  --ok: #1E8449;
  --line: rgba(42,143,146,0.32);
  --line-soft: rgba(42,143,146,0.16);
  --line-card: rgba(42,143,146,0.28);
  --tint: rgba(66,206,208,0.12);
  --tint-strong: rgba(66,206,208,0.24);
  --header-bg: rgba(255,255,255,0.94);
  --sidebar-bg: #E6F4F4;
  --sidebar-bg-solid: #E6F4F4;
  --diagram-bg: #ffffff;
  --helpline-bg: var(--navy);
  --helpline-ink: var(--white);
  --wrong-bg: rgba(212,168,67,0.14);
  --wrong-line: var(--amber);
  --wrong-ink: #4A5A6A;
  --radius: 12px;
  --radius-lg: 18px;
  --glow: none;
  --card-shadow: 0 6px 20px rgba(6,25,47,0.06);
  --art-bg: linear-gradient(160deg, #E6F7F8, #CFEFF1);
  color-scheme: light;
}

/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--heading);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 17px; line-height: 1.7; min-height: 100vh;
}
img { max-width: 100%; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
[data-theme="bright"] :focus-visible { outline-color: var(--navy); }
.skip-link { position: absolute; left: -9999px; top: 0.5rem; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; border-radius: var(--radius); font-weight: 700; }
.skip-link:focus { left: 0.5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- HEADER ---------- */
#header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 0 1.25rem;
}
.header-inner { display: flex; align-items: center; gap: 0.9rem; height: var(--header-h); padding: 8px 0; box-sizing: border-box; max-width: 1300px; margin: 0 auto; }
.logo-wrap { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; flex-shrink: 0; min-height: 44px; }
/* Header logo: the Academy photo logo with the name beside it (~/brand/BRANDING.md, "Academy" variants, Dale's decision). 72px tall, 48px on phones.
   csg-header-academy-dark (white text) on the dark theme, csg-header-academy-light (grey text, darker teal ACADEMY) on the bright theme.
   Only one is ever shown; the hidden one is lazy so it never downloads. Fixed height, auto width: never stretched. */
.logo-wrap picture { display: block; }
.logo-wrap img { height: 72px; width: auto; display: block; }
.logo-wrap .brand-header-light, [data-theme="bright"] .logo-wrap .brand-header-dark { display: none; }
[data-theme="bright"] .logo-wrap .brand-header-light { display: block; }
@media (max-width: 480px) {
  :root, [data-theme] { --header-h: 64px; }
  .logo-wrap img { height: 48px; }
}
}
#progress-bar-wrap { flex: 1; height: 8px; background: var(--tint-strong); border-radius: 999px; overflow: hidden; min-width: 40px; }
#progress-bar { height: 100%; background: var(--accent); border-radius: 999px; box-shadow: var(--glow); transition: width 0.4s ease; width: 0%; }
#progress-label { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.header-link { font-size: 0.78rem; color: var(--accent-ink); text-decoration: none; font-weight: 600; white-space: nowrap; padding: 0.55rem 0.4rem; }
.header-link:hover { text-decoration: underline; }
.theme-toggle { background: var(--tint); border: 1px solid var(--line); color: var(--accent-ink); border-radius: 20px; padding: 0.3rem 0.8rem; min-height: 44px; min-width: 44px; font-size: 0.78rem; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.theme-toggle:hover { background: var(--tint-strong); }
#menu-toggle { display: none; background: none; border: none; color: var(--accent-ink); cursor: pointer; font-size: 1.5rem; min-width: 44px; min-height: 44px; }

#body-wrap { display: flex; flex: 1; }

/* ---------- SIDEBAR ---------- */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--sidebar-bg); border-right: 1px solid var(--line-soft);
  padding: 1.1rem 0; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
}
#sidebar ul { list-style: none; }
#sidebar li { border-bottom: 1px solid var(--line-soft); }
#sidebar li button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.85rem 1.15rem; min-height: 44px;
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 0.82rem; text-align: left; transition: all 0.2s;
}
#sidebar li button:hover { color: var(--heading); background: var(--tint); }
#sidebar li.active button { color: var(--accent-ink); background: var(--tint); font-weight: 600; }
#sidebar li.done button { color: var(--text); }
.nav-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.65rem; }
#sidebar li.done .nav-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
#sidebar li.active .nav-check { border-color: var(--accent); color: var(--accent-ink); }
.nav-num { font-size: 0.68rem; color: var(--muted); flex-shrink: 0; width: 17px; }
.nav-badge { font-size: 0.58rem; background: var(--tint-strong); color: var(--accent-ink); border: 1px solid var(--line); border-radius: 3px; padding: 0.1rem 0.3rem; margin-left: auto; flex-shrink: 0; }
.sidebar-links { padding: 1rem 1.15rem 0; display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-links a { color: var(--accent-ink); font-size: 0.8rem; text-decoration: none; font-weight: 600; padding: 0.55rem 0; }
.sidebar-links a:hover { text-decoration: underline; }

#main { flex: 1; padding: 1.75rem 2.25rem 5rem; max-width: 780px; min-width: 0; }

.module { display: none; }
.module.active { display: block; animation: fade 0.3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- TYPOGRAPHY ---------- */
.eyebrow { font-size: 0.68rem; color: var(--accent-ink); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.4rem; font-weight: 600; }
h1.mod-title { font-family: var(--font-head); font-size: clamp(2rem, 4.8vw, 3rem); font-weight: 700; letter-spacing: -0.01em; color: var(--heading); line-height: 1.12; margin-bottom: 0.4rem; }
h1.mod-title .accent { color: var(--accent-ink); }
.mod-subtitle { font-size: 0.97rem; color: var(--text); font-style: italic; margin-bottom: 1.5rem; line-height: 1.6; }
h2.sh { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; color: var(--heading); margin: 2.2rem 0 0.7rem; line-height: 1.35; }
h2.sh::before { content: ""; display: inline-block; width: 18px; height: 4px; border-radius: 2px; background: var(--accent); vertical-align: middle; margin-right: 0.55rem; position: relative; top: -2px; }
h3.subh { font-size: 0.98rem; font-weight: 700; color: var(--accent-ink); margin: 1.5rem 0 0.5rem; }
p { color: var(--text); margin-bottom: 0.85rem; line-height: 1.72; }
p strong { color: var(--heading); }
p:last-child { margin-bottom: 0; }

/* ---------- SHORT VERSION ---------- */
.short-version { background: linear-gradient(160deg, var(--tint-strong), var(--tint)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; margin-bottom: 1.75rem; }
.sv-label { font-size: 0.67rem; color: var(--accent-ink); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.6rem; }
.sv-list { list-style: none; }
.sv-list li { font-size: 0.93rem; color: var(--heading); padding: 0.32rem 0 0.32rem 1.4rem; position: relative; line-height: 1.55; }
.sv-list li::before { content: "\2192"; position: absolute; left: 0; color: var(--accent-ink); font-weight: 700; }

/* ---------- KEY POINT ---------- */
.key-point { border-left: 3px solid var(--accent); padding: 0.15rem 0 0.15rem 1rem; margin: 1.1rem 0; font-size: 1rem; color: var(--heading); font-weight: 600; line-height: 1.6; }
.key-point.warn { border-left-color: var(--warn); }
.key-point.amber { border-left-color: var(--warm); }

/* ---------- CARDS ---------- */
.card-grid { display: grid; gap: 0.8rem; margin: 1rem 0; }
.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(265px, 100%), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(195px, 100%), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fill, minmax(min(165px, 100%), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card.hi { border-color: var(--accent); }
.card.red-border { border-color: rgba(192,57,43,0.45); }
.card.warm { border-color: var(--warm); }
.cl { font-size: 0.65rem; color: var(--accent-ink); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.35rem; }
.ct { font-size: 0.93rem; font-weight: 700; color: var(--heading); margin-bottom: 0.3rem; }
.card p { font-size: 0.87rem; margin-bottom: 0.5rem; line-height: 1.6; }
.card p:last-child { margin-bottom: 0; }

/* ---------- LISTS ---------- */
ul.tight { list-style: none; margin: 0.7rem 0; }
ul.tight li { font-size: 0.92rem; color: var(--text); padding: 0.3rem 0 0.3rem 1.35rem; position: relative; line-height: 1.6; }
ul.tight li::before { content: "\25AA"; position: absolute; left: 0.15rem; color: var(--accent-ink); }
ul.tight li strong { color: var(--heading); }
ul.num { list-style: none; margin: 0.7rem 0; counter-reset: step; }
ul.num li { font-size: 0.92rem; color: var(--text); padding: 0.4rem 0 0.4rem 2.2rem; position: relative; line-height: 1.6; counter-increment: step; margin-bottom: 0.3rem; }
ul.num li::before { content: counter(step); position: absolute; left: 0; top: 0.4rem; width: 1.5rem; height: 1.5rem; background: var(--accent); color: var(--on-accent); border-radius: 50%; font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
ul.num li strong { color: var(--heading); }

/* ---------- STATS ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 0.75rem; margin: 1.1rem 0; }
.stat-box { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius); padding: 0.9rem 0.6rem; text-align: center; }
.stat-num { font-size: 2.1rem; font-weight: 800; color: var(--accent-ink); line-height: 1; }
.stat-desc { font-size: 0.75rem; color: var(--text); margin-top: 0.3rem; line-height: 1.35; }
.stat-source { font-size: 0.66rem; color: var(--muted); margin-top: 0.2rem; }

/* ---------- DIAGRAMS ---------- */
.diagram-wrap { background: var(--diagram-bg); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1rem 0.9rem; margin: 1.2rem 0; overflow-x: auto; }
.diagram-title { font-size: 0.68rem; color: var(--accent-ink); letter-spacing: 0.11em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.85rem; text-align: center; }
.diagram-wrap svg { width: 100%; height: auto; display: block; }
.diagram-caption { font-size: 0.79rem; color: var(--muted); text-align: center; margin-top: 0.7rem; font-style: italic; line-height: 1.5; }

/* ---------- ACCORDION ---------- */
.platform-card { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius); margin-bottom: 0.45rem; overflow: hidden; }
.platform-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; cursor: pointer; padding: 0.85rem 1.1rem; min-height: 44px; color: var(--heading); gap: 0.6rem; text-align: left; }
.platform-toggle:hover { background: var(--tint); }
.pname { font-weight: 700; font-size: 0.92rem; text-align: left; }
.pstat { font-size: 0.74rem; color: var(--accent-ink); }
.parrow { color: var(--accent-ink); transition: transform 0.2s; font-size: 1rem; }
.platform-card.open .parrow { transform: rotate(90deg); }
.platform-detail { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; padding: 0 1.1rem; }
.platform-card.open .platform-detail { max-height: 900px; padding: 0 1.1rem 0.95rem; }
.platform-detail p { font-size: 0.86rem; margin-bottom: 0.5rem; }
.risk-tag { display: inline-block; background: var(--tint); color: var(--accent-ink); font-size: 0.68rem; padding: 0.16rem 0.5rem; border-radius: 20px; margin-right: 0.3rem; margin-bottom: 0.22rem; border: 1px solid var(--line); }

/* ---------- COLLAPSIBLE DETAIL ---------- */
.detail-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; cursor: pointer; margin: 0.9rem 0 0; color: var(--accent-ink); font-size: 0.85rem; font-weight: 600; text-align: left; transition: all 0.2s; }
.detail-toggle:hover { background: var(--tint-strong); }
.detail-toggle .dt-arrow { transition: transform 0.2s; }
.detail-toggle.open .dt-arrow { transform: rotate(90deg); }
.detail-body { display: none; padding: 0.9rem 0 0; }
.detail-body.open { display: block; animation: fade 0.25s ease; }

/* ---------- STEP-THROUGH ---------- */
.step-nav { display: flex; gap: 0.35rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.step-btn { background: var(--surface); border: 1px solid var(--line); color: var(--muted); padding: 0.4rem 0.75rem; min-width: 48px; min-height: 48px; border-radius: 14px; font-weight: 700; cursor: pointer; font-size: 0.78rem; transition: all 0.2s; }
.step-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: var(--glow); }
.step-btn.seen { border-color: var(--accent); color: var(--text); }
.step-panel { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius); padding: 1.2rem; display: none; }
.step-panel.active { display: block; animation: fade 0.25s ease; }
.step-num { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--accent-ink); line-height: 1; margin-bottom: 0.25rem; }
.step-label { font-size: 1rem; font-weight: 700; color: var(--heading); margin-bottom: 0.4rem; }
.step-quote { font-size: 0.87rem; color: var(--accent-ink); font-style: italic; padding: 0.4rem 0.65rem; border-left: 2px solid var(--accent); margin: 0.6rem 0; }
.step-detail { font-size: 0.89rem; color: var(--text); line-height: 1.7; }

/* ---------- TABS ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); padding-bottom: 0.65rem; }
.tab-btn { background: none; border: 1px solid var(--line); color: var(--muted); padding: 0.4rem 0.95rem; min-height: 44px; border-radius: 999px; cursor: pointer; font-size: 0.79rem; transition: all 0.2s; }
.tab-btn:hover { color: var(--heading); border-color: var(--accent); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade 0.25s ease; }

/* ---------- FLAG CARDS ---------- */
.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(235px, 100%), 1fr)); gap: 0.65rem; margin: 1rem 0; }
.flag-card { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius); padding: 0.9rem; cursor: pointer; transition: border-color 0.2s; }
.flag-card:hover { border-color: var(--accent); }
.flag-card.special { border-left: 3px solid var(--accent); }
.flag-num { font-size: 1.3rem; font-weight: 800; color: var(--accent-ink); line-height: 1; margin-bottom: 0.3rem; }
.flag-text { font-size: 0.86rem; color: var(--heading); font-weight: 600; margin-bottom: 0.25rem; line-height: 1.5; }
.flag-hint { font-size: 0.71rem; color: var(--muted); }
.flag-more { font-size: 0.82rem; color: var(--text); display: none; margin-top: 0.45rem; border-top: 1px solid var(--line); padding-top: 0.45rem; line-height: 1.6; }
.flag-card.open .flag-more { display: block; }
.flag-card.open .flag-hint { display: none; }
.flag-tag { font-size: 0.61rem; color: var(--accent-ink); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.2rem; display: block; }

/* ---------- DON'T-SAY LIST ---------- */
.dont-say { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-bottom: 0.45rem; cursor: pointer; transition: border-color 0.2s; }
.dont-say:hover, .dont-say.open { border-color: var(--accent); }
.dont-phrase { font-size: 0.89rem; font-style: italic; color: var(--accent-ink); margin-bottom: 0; }
.dont-reason { font-size: 0.83rem; color: var(--text); margin: 0.5rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--line); display: none; line-height: 1.6; }
.dont-say.open .dont-reason { display: block; }

/* ---------- BOXES ---------- */
.note-box { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1rem 0; }
.note-box p { font-size: 0.87rem; font-style: italic; }
.warn-box { background: rgba(192,57,43,0.07); border: 1px solid rgba(192,57,43,0.32); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1rem 0; }
.warn-box p { font-size: 0.87rem; }
.tell-box { margin-top: 1.2rem; background: var(--tint); border: 1px solid var(--accent); border-radius: var(--radius); padding: 0.85rem 1rem; }
.tell-box p { font-size: 0.88rem; font-style: italic; color: var(--heading); }

/* ---------- VOCAB ---------- */
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 0.5rem; margin: 0.75rem 0; }
.vocab-item { background: var(--surface); border: 1px solid var(--line-card); border-radius: 5px; padding: 0.65rem 0.8rem; }
.vocab-term { font-size: 0.83rem; font-weight: 700; color: var(--accent-ink); margin-bottom: 0.15rem; }
.vocab-def { font-size: 0.78rem; color: var(--text); line-height: 1.5; }

/* ---------- DOC EXAMPLE (Not this / This) ---------- */
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin: 1rem 0; }
.doc-bad { background: var(--wrong-bg); border: 1px solid var(--wrong-line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.doc-good { background: rgba(39,174,96,0.08); border: 1px solid rgba(39,174,96,0.4); border-radius: var(--radius); padding: 0.9rem 1rem; }
.doc-label { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.45rem; }
.doc-bad .doc-label { color: var(--warn-ink); }
[data-theme="bright"] .doc-bad .doc-label { color: var(--warm-ink); }
.doc-good .doc-label { color: var(--ok); }
.doc-body { font-size: 0.8rem; color: var(--text); font-style: italic; line-height: 1.6; }

/* ---------- QUIZ ---------- */
.module-quiz { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.quiz-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--heading); }
.quiz-header p { font-size: 0.83rem; color: var(--muted); margin-bottom: 1.1rem; }
.quiz-question { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius-lg); padding: 1.2rem; margin-bottom: 0.85rem; }
.q-ey { font-size: 0.66rem; color: var(--accent-ink); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; font-weight: 600; }
.q-sc { font-size: 0.89rem; color: var(--heading); line-height: 1.65; margin-bottom: 0.95rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.q-pr { font-size: 0.83rem; color: var(--muted); margin-bottom: 0.6rem; font-style: italic; }
.q-opts { display: flex; flex-direction: column; gap: 0.4rem; }
.q-opt { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.9rem; min-height: 44px; cursor: pointer; font-size: 0.86rem; color: var(--text); text-align: left; transition: all 0.2s; width: 100%; line-height: 1.55; }
[data-theme="bright"] .q-opt { border-radius: var(--radius); }
.q-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--tint-strong); }
.q-opt.correct { background: rgba(39,174,96,0.12); border-color: var(--ok); color: var(--heading); }
.q-opt.wrong { background: var(--wrong-bg); border-color: var(--wrong-line); color: var(--wrong-ink); }
/* Not colour alone: a written marker on the answer states */
.q-opt.correct::after { content: "  \2713 Right answer"; font-weight: 700; color: var(--ok); white-space: nowrap; }
.q-opt.wrong::after { content: "  \2717 Your answer"; font-weight: 700; white-space: nowrap; }
.q-opt:disabled { cursor: default; }
.q-fb { margin-top: 0.85rem; padding: 0.75rem 0.9rem; border-radius: 5px; font-size: 0.84rem; display: none; line-height: 1.65; }
.q-fb.show { display: block; }
.q-fb.correct-fb { background: rgba(39,174,96,0.08); border: 1px solid rgba(39,174,96,0.3); color: var(--text); }
.q-fb.wrong-fb { background: var(--wrong-bg); border: 1px solid var(--wrong-line); color: var(--text); }
.q-fb strong { color: var(--heading); }
.quiz-result { text-align: center; padding: 1.5rem 1rem; background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius-lg); display: none; margin-top: 0.85rem; }
.quiz-result.show { display: block; }
.quiz-score-num { font-size: 2.5rem; font-weight: 800; color: var(--accent-ink); line-height: 1; }
.quiz-score-lbl { font-size: 0.85rem; color: var(--text); margin-top: 0.2rem; }
.quiz-score-msg { font-size: 0.88rem; color: var(--heading); margin-top: 0.75rem; font-style: italic; line-height: 1.6; }

/* ---------- FINAL ASSESSMENT ---------- */
.fa-progress { font-size: 0.76rem; color: var(--muted); margin-bottom: 1.1rem; }
.fa-result { text-align: center; padding: 1.75rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); display: none; margin-top: 0.85rem; }
.fa-result.show { display: block; }
.fa-score-big { font-size: 3.2rem; font-weight: 800; color: var(--accent-ink); line-height: 1; }
.fa-score-sub { font-size: 0.95rem; color: var(--text); margin-top: 0.2rem; }
.fa-msg { font-size: 0.9rem; color: var(--heading); margin-top: 0.9rem; line-height: 1.7; }
.fa-helpline { margin-top: 1.1rem; font-size: 0.86rem; color: var(--warn-ink); font-weight: 700; }
[data-theme="bright"] .fa-helpline { color: var(--accent-ink); }

/* ---------- BUTTONS ---------- */
.complete-btn { display: none; width: 100%; margin-top: 1.6rem; background: var(--accent); border: none; border-radius: 999px; box-shadow: var(--glow); padding: 0.9rem; min-height: 44px; font-size: 0.92rem; font-weight: 700; color: var(--on-accent); cursor: pointer; transition: opacity 0.2s; }
.complete-btn.show { display: block; }
.complete-btn:hover { opacity: 0.9; }
.complete-btn.done { background: var(--midteal); color: rgba(6,25,47,0.8); cursor: default; box-shadow: none; }
.print-btn { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--accent); color: var(--on-accent); border: none; border-radius: 999px; padding: 0.65rem 1.1rem; min-height: 44px; font-size: 0.85rem; font-weight: 700; cursor: pointer; margin-bottom: 0.5rem; text-decoration: none; }

/* ---------- RESOURCES ---------- */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 0.85rem; margin: 1rem 0; }
.resource-card { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; }
.resource-label { font-size: 0.64rem; color: var(--accent-ink); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.3rem; }
.resource-name { font-size: 0.97rem; font-weight: 700; color: var(--heading); margin-bottom: 0.3rem; }
.resource-desc { font-size: 0.79rem; color: var(--text); flex: 1; margin-bottom: 0.6rem; line-height: 1.5; }
.resource-url { font-size: 0.76rem; color: var(--accent-ink); word-break: break-word; }
.resource-url a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--line); }

/* ---------- HELPLINE BANNER ---------- */
.helpline-banner { background: var(--helpline-bg); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; text-align: center; }
.hl-num { font-size: 1.8rem; font-weight: 800; color: var(--helpline-ink); }
.hl-num a { color: var(--helpline-ink); text-decoration: none; display: inline-block; min-height: 44px; }
[data-theme="bright"] .hl-num a { color: var(--teal); }
.hl-lbl { font-size: 0.85rem; color: rgba(255,255,255,0.9); line-height: 1.5; }

/* ---------- LEGAL BOX ---------- */
.legal-box { background: rgba(212,168,67,0.08); border: 1px solid rgba(212,168,67,0.45); border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1rem 0; }
.legal-box .cl { color: var(--warm-ink); }
.legal-box p { font-size: 0.86rem; }
.legal-box ul.tight li::before { color: var(--warm-ink); }
.legal-foot { font-size: 0.78rem; color: var(--muted); font-style: italic; margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid rgba(212,168,67,0.25); }

/* ---------- PRINTABLE SHEET ---------- */
.print-sheet { background: #fff; color: #1a1a1a; border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; margin: 1.2rem 0; border: 1px solid #d5e3e4; }
.print-sheet h3, .print-sheet h1.ps-title { color: #142A46; font-size: 1.15rem; margin-bottom: 0.3rem; }
/* Printables are always white paper, so links keep the print teal even in dark mode */
.print-sheet a, .print-sheet a.ext, .print-sheet a.tel { color: #086e70; }
.print-sheet .ss-sub { color: #555; font-size: 0.82rem; font-style: italic; margin-bottom: 1rem; }
.print-sheet p { color: #222; font-size: 0.88rem; margin-bottom: 0.6rem; }
.print-sheet ul { list-style: none; margin: 0.6rem 0; }
.print-sheet ul li { font-size: 0.87rem; color: #222; padding: 0.28rem 0 0.28rem 1.3rem; position: relative; line-height: 1.55; }
.print-sheet ul li::before { content: "\2192"; position: absolute; left: 0; color: #086e70; font-weight: 700; }
.print-sheet .ss-num { background: #142A46; color: #fff; border-radius: 6px; padding: 0.7rem 1rem; text-align: center; margin: 0.9rem 0; }
.print-sheet .ss-num strong { font-size: 1.3rem; color: #42CED0; }

/* ---------- BOTTOM NAV ---------- */
#bottom-nav { position: sticky; bottom: 0; background: var(--header-bg); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 0.65rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; z-index: 40; }
.bnav-btn { background: var(--tint); border: 1px solid var(--line); color: var(--accent-ink); padding: 0.55rem 1.3rem; min-height: 48px; border-radius: 999px; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.2s; white-space: nowrap; }
.bnav-btn:hover { background: var(--tint-strong); }
.bnav-btn:disabled { opacity: 0.35; cursor: default; }
#bnav-label { font-size: 0.75rem; color: var(--muted); text-align: center; flex: 1; }

/* ---------- LINKS AND UTILITIES ---------- */
a.ext { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--line); transition: all 0.15s; }
a.ext:hover { border-bottom-color: var(--accent); }
a.tel { color: var(--accent-ink); text-decoration: none; font-weight: 700; border-bottom: 1px solid var(--line); }
.mt1 { margin-top: 1rem; } .mt2 { margin-top: 1.9rem; }
hr.div { border: none; border-top: 1px solid var(--line-soft); margin: 1.6rem 0; }
.teal { color: var(--accent-ink); } .muted { color: var(--muted); }
.warm-ink { color: var(--warm-ink); }

/* ==========================================================================
   LIBRARY AND STATIC PAGES (index, about, guides)
   Built from the same components: cards, tabs-as-chips, short version,
   helpline banner. No new colours.
   ========================================================================== */
.page { max-width: 1100px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.page.narrow { max-width: 780px; }
.lib-hero { padding: 1.5rem 0 0.5rem; }
/* Photo lockup on the About page only: big one-off spot, shown at least 120px tall and never upscaled past its 874px native width.
   Light (grey text) or dark (white text) version to match the theme; the hidden one is lazy so it never downloads. */
.photo-lockup-block { margin: 0.5rem 0 1.2rem; }
.photo-lockup-block picture { display: block; }
.photo-lockup-block img { display: block; width: min(440px, 100%); height: auto; min-height: 120px; object-fit: contain; object-position: left center; }
.photo-lockup-block .photo-lockup-dark, [data-theme="bright"] .photo-lockup-block .photo-lockup-light { display: block; }
.photo-lockup-block .photo-lockup-light, [data-theme="bright"] .photo-lockup-block .photo-lockup-dark { display: none; }
.lib-hero .mod-subtitle { max-width: 640px; }
.filters { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.2rem 0 1.5rem; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.filter-label { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin-right: 0.4rem; min-width: 5.5rem; }
.filter-row .tab-btn { color: var(--text); }
.filter-row .tab-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.lib-groups { display: flex; flex-direction: column; gap: 2.2rem; }
.series-group h2.sh { margin-top: 0.2rem; }
.series-links { display: flex; flex-direction: column; gap: 0.1rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line-soft); }
.series-links .eyebrow { margin-bottom: 0.2rem; }
.result-count { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.6rem; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem; margin: 1rem 0; }
.pack-card { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--card-shadow); transition: transform 0.15s, border-color 0.15s; }
.pack-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pack-cover { display: block; aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--art-bg); border-bottom: 1px solid var(--line-card); }
.pack-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.pack-body .ct { font-family: var(--font-head); font-size: 1.15rem; }
.pack-body p { font-size: 0.87rem; flex: 1; }
.pack-meta { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.6rem 0 0.8rem; }
.pack-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pack-actions a { flex: 1; text-align: center; text-decoration: none; border-radius: 12px; padding: 0.6rem 0.8rem; min-height: 44px; font-size: 0.86rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.btn-secondary { background: var(--tint); color: var(--accent-ink); border: 1px solid var(--line); }
.progress-tag { font-size: 0.7rem; font-weight: 700; color: var(--ok); }
.empty-state { padding: 1.5rem; text-align: center; color: var(--muted); font-style: italic; }

/* High-sensitivity packs sit in their own dark section,
   so they never blend into the cheerful browse view */
.serious-section { margin-top: 3rem; border-radius: 22px; padding: 1.75rem 1.5rem; border: 1px solid rgba(242,198,109,0.45); }
.serious-section[data-theme="dark"] { background: #020D1A; color: var(--white); }
.sens-label { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #F2C66D; border: 1px solid rgba(242,198,109,0.5); background: rgba(242,198,109,0.1); padding: 0.25rem 0.7rem; border-radius: 999px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 1.25rem 2rem; text-align: center; font-size: 0.8rem; color: var(--muted); }
.site-footer a { color: var(--accent-ink); }
.site-footer p { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.4rem; }

/* Adult guide */
.guide-section { margin-bottom: 2rem; }
.guide-q { list-style: none; counter-reset: q; }
.guide-q li { counter-increment: q; padding: 0.55rem 0 0.55rem 2.2rem; position: relative; font-size: 0.93rem; color: var(--text); border-bottom: 1px solid var(--line-soft); }
.guide-q li::before { content: counter(q); position: absolute; left: 0; top: 0.55rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent-ink); font-size: 0.78rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ---------- MOBILE ---------- */
@media (max-width: 820px) {
  body { font-size: 16.5px; }
  #sidebar { position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform 0.3s ease; background: var(--sidebar-bg-solid); border-right: 1px solid var(--line); max-width: 85vw; }
  #sidebar.open { transform: translateX(0); }
  #menu-toggle { display: block; }
  #main { padding: 1.35rem 1.15rem 5rem; }
  #progress-label { font-size: 0.68rem; }
  .doc-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .flag-grid { grid-template-columns: 1fr; }
  h2.sh { margin-top: 1.9rem; font-size: 1.12rem; }
  .q-opt { padding: 0.8rem 0.9rem; }
  .step-btn { padding: 0.45rem 0.7rem; }
  .diagram-wrap { padding: 0.9rem 0.7rem 0.75rem; }
  #bnav-label { display: none; }
  .bnav-btn { flex: 1; }
  .filter-label { min-width: 100%; }
}
@media (max-width: 480px) {
  .tt-label { display: none; }
  .theme-toggle { padding: 0.3rem 0.6rem; font-size: 1rem; }
  .header-inner { gap: 0.55rem; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- PRINT ---------- */
@media print {
  #header, #sidebar, #bottom-nav, .complete-btn, #menu-toggle, .print-btn, .skip-link, .filters, .no-print { display: none !important; }
  .module, .tab-panel, .step-panel, .detail-body, .flag-more, .dont-reason, .q-fb { display: block !important; }
  .platform-detail { max-height: none !important; padding: 0 1.1rem 0.95rem !important; }
  body, .serious-section { background: white !important; color: black; font-size: 11pt; }
  .card, .note-box, .resource-card, .short-version, .quiz-question, .stat-box { border: 1px solid #bbb; background: white; }
  h1.mod-title, h2.sh, .ct, .step-label, .sv-list li { color: #111; }
  .teal, .ct, .step-num, .flag-num, .stat-num, h2.sh::before, .eyebrow, .cl, h1.mod-title .accent { color: #086e70; }
  p, .step-detail, .flag-more, .vocab-def, .dont-reason, .sv-list li, ul.tight li, ul.num li { color: #222; }
  .helpline-banner { background: white; border: 2px solid #111; }
  .hl-num, .hl-num a, .hl-lbl { color: #111 !important; }
  a.ext, a.tel { color: #086e70; }
  a.ext::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  .module { page-break-before: always; }
  .module:first-of-type { page-break-before: auto; }
  /* Printable sheets: no screen padding, so a sheet fits on one A4 page (audit, 11 Nov 2026) */
  html[data-page="print"] .page { padding: 0; margin: 0; max-width: none; }
}

/* "More from Cyber Safety Guy" links to Dale's guides (added by shared.js) */
.related-guides { margin-top: 1.9rem; }
.related-guides .resource-card a.ext { align-self: flex-start; font-size: 0.85rem; }

/* Links whose text is already a web address: don't print the address twice */
@media print { a.ext.url::after { content: none; } }

/* Web links on the dark helpline banner: use the banner's own text colour */
.hl-lbl a.ext, .print-sheet .ss-num a.ext { color: #fff; border-bottom-color: rgba(255,255,255,0.7); }
.hl-lbl a.ext:hover { border-bottom-color: #fff; }

/* ==========================================================================
   REDESIGN (Dale, 8 Nov 2026): library home page, header menu, series cards,
   trust strip, "My learning". Brand cyan #1FD0DC on navy #06192F.
   ========================================================================== */
.site-nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 0.55rem 0.9rem; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; }
.site-nav a:hover { background: var(--tint); color: var(--heading); }
.site-nav a[aria-current="page"] { background: var(--tint-strong); color: var(--accent-ink); }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.hero-circuit { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.3; pointer-events: none; }
[data-theme="bright"] .hero-circuit { opacity: 0.2; }
.hero-inner { position: relative; max-width: 1100px; margin: 0 auto; padding: 2.75rem 1.25rem 2.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 2rem; }
.hero-copy { flex: 1 1 420px; min-width: 0; }
.hero-copy h1.mod-title { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.02; margin: 0.4rem 0 0.9rem; }
.hero-copy .mod-subtitle { font-style: normal; font-size: 1.12rem; max-width: 540px; margin-bottom: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn-pill { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 48px; padding: 0 1.4rem; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 0.95rem; }
.btn-pill.primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.btn-pill.ghost { border: 1.5px solid var(--line); color: var(--heading); }
.btn-pill.ghost:hover { border-color: var(--accent); }
.hand { font-family: "Caveat", cursive; font-weight: 600; }
.hero-tagline { font-size: 1.7rem; color: var(--accent-ink); margin-top: 1.2rem; line-height: 1.1; }
.hero-art { flex: 1 1 360px; min-width: 0; display: flex; justify-content: center; }
/* Dale's photo logo (logo alone, ~/brand/web/csg-logo-photo-720), shown at up to half its pixel size so it stays sharp */
.hero-art img { width: auto; height: 340px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 0 24px rgba(31, 208, 220, 0.35)); }

/* Age shortcuts: the age filter row, styled as chips */
.jump { margin: 1.6rem 0 0.4rem; }
.jump-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.filters { gap: 0.6rem; margin-top: 0.4rem; }
.filter-row .tab-btn { background: var(--surface); border-radius: 14px; min-height: 48px; padding: 0 1.05rem; font-weight: 600; color: var(--heading); }
.filter-row .tab-btn[aria-pressed="true"] { box-shadow: var(--glow); }
#filter-age .tab-btn::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.55rem; background: var(--accent); }
#filter-age .tab-btn[data-value="7-9"]::before { background: #3BB273; }
#filter-age .tab-btn[data-value="10-12"]::before { background: #D4A843; }
#filter-age .tab-btn[data-value="13-15"]::before { background: #E8875A; }
#filter-age .tab-btn[data-value="16-18"]::before { background: #B58BE0; }
#filter-age .tab-btn[data-value="adult"]::before { background: var(--muted); }
#filter-age .tab-btn[aria-pressed="true"]::before { background: var(--on-accent); }

/* Series overview cards */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; margin: 2.4rem 0 1rem; }
.section-head h2 { font-family: var(--font-head); font-size: 1.9rem; color: var(--heading); line-height: 1.15; }
.section-head p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.series-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 1.1rem; }
.series-card { background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--card-shadow); transition: transform 0.15s, border-color 0.15s; }
.series-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.series-art { height: 150px; display: flex; align-items: center; justify-content: center; background: var(--art-bg); border-bottom: 1px solid var(--line-card); }
.series-art img { height: 120px; width: auto; }
.series-card-body { padding: 1.05rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.series-card-body .cl { margin: 0; }
.series-card-body h3 { font-family: var(--font-head); font-size: 1.3rem; color: var(--heading); line-height: 1.2; }
.series-card-body p { font-size: 0.9rem; flex: 1; margin: 0; }
.series-card-body a { align-self: flex-start; margin-top: 0.6rem; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; background: var(--tint-strong); color: var(--accent-ink); font-weight: 700; font-size: 0.9rem; text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.series-card.serious { border-color: rgba(242,198,109,0.45); }
.series-card.serious .cl { color: var(--warm-ink); }
.series-group, #find, #packs, #for-adults { scroll-margin-top: calc(var(--header-h) + 1rem); }
.series-group h2.sh { font-size: 1.6rem; }

/* Trust strip */
.trust { margin-top: 3rem; display: flex; flex-wrap: wrap; border: 1px solid var(--line-card); border-radius: 22px; overflow: hidden; background: var(--surface); }
.trust-items { flex: 999 1 600px; min-width: 0; padding: 1.3rem 1.4rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 1.1rem; }
.trust-item { display: flex; gap: 0.75rem; align-items: flex-start; }
.trust-item svg { flex: 0 0 auto; margin-top: 0.15rem; }
.trust-item strong { display: block; color: var(--heading); font-size: 0.95rem; }
.trust-item span { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.trust-quote { flex: 1 1 240px; background: var(--accent); color: var(--on-accent); padding: 1.3rem 1.5rem; display: flex; align-items: center; font-size: 1.9rem; line-height: 1.1; }

/* My learning */
.mine-list { display: flex; flex-direction: column; gap: 0.7rem; margin: 1rem 0 2rem; }
.mine-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1rem; background: var(--surface); border: 1px solid var(--line-card); border-radius: var(--radius-lg); padding: 0.9rem 1.1rem; }
.mine-item .mine-title { flex: 1 1 220px; min-width: 0; }
.mine-item .mine-title a { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--heading); text-decoration: none; }
.mine-item .mine-title span { display: block; font-size: 0.82rem; color: var(--muted); }
.mine-bar { flex: 1 1 160px; height: 8px; border-radius: 999px; background: var(--tint-strong); overflow: hidden; }
.mine-bar div { height: 100%; background: var(--accent); border-radius: 999px; box-shadow: var(--glow); }
.mine-state { font-size: 0.82rem; font-weight: 700; color: var(--accent-ink); min-width: 7rem; text-align: right; }
.mine-clear { margin-top: 0.5rem; }

@media (max-width: 820px) {
  .site-nav a { padding: 0.5rem 0.65rem; font-size: 0.85rem; }
  .hero-inner { padding-top: 1.75rem; }
  .section-head h2 { font-size: 1.55rem; }
}
@media (max-width: 480px) {
  .site-nav { gap: 0; }
  .site-nav a { padding: 0.45rem 0.5rem; }
  .trust-quote { font-size: 1.6rem; }
}

/* Bottom nav: "Next" is the primary action */
#btn-next { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: var(--glow); }
#btn-next:hover { background: var(--accent); opacity: 0.92; }
#btn-next:disabled { box-shadow: none; }

/* Phones: on pages with the site menu, the menu drops to its own row under the logo */
@media (max-width: 600px) {
  .header-inner:has(.site-nav) { height: auto; flex-wrap: wrap; row-gap: 0; }
  .header-inner:has(.site-nav) .theme-toggle { margin-left: auto; }
  .site-nav { order: 3; width: 100%; margin: 0 0 0.35rem; justify-content: flex-start; }
  .site-nav a { padding: 0.4rem 0.75rem; font-size: 0.9rem; }
}
/* Dark theme: covers are light illustrations, so frame them inside the card */
[data-theme="dark"] .pack-cover { border: 0; border-radius: 12px; width: calc(100% - 20px); margin: 10px 10px 0; box-shadow: 0 0 0 1px rgba(31,208,220,0.25); }
/* Library search */
.search-box { margin-bottom: 1.4rem; }
.search-field { display: flex; align-items: center; gap: 0.6rem; max-width: 560px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 999px; padding: 0 1.1rem; box-shadow: var(--card-shadow); color: var(--muted); }
.search-field:focus-within { border-color: var(--accent); box-shadow: var(--glow); outline: 2px solid var(--accent); outline-offset: 2px; }
.search-field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1rem; padding: 0.85rem 0; outline: none; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
@media (max-width: 600px) { .hero-art img { height: 210px; } }
@media (max-width: 600px) { .series-group, #find, #packs, #for-adults { scroll-margin-top: 130px; } }
#series-overview[hidden], #for-adults[hidden] { display: none; }
/* ================= BYTE'S HQ (My learning) =================
   A fixed night-time den in both themes. Counts children's packs only (Dale, 8 Nov 2026). */
.hq-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 1rem; }
.hq-chip { display: inline-flex; align-items: center; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--line-card); background: var(--surface); color: var(--heading); font-size: 0.88rem; font-weight: 600; }
.hq-chip.gold { border-color: rgba(212,168,67,0.7); }
.hq-wrap { position: relative; margin-bottom: 2rem; }
.hq { position: relative; width: 100%; aspect-ratio: 700 / 580; border-radius: var(--radius-lg); overflow: hidden; background: #041427; box-shadow: var(--card-shadow); }
.hq-scene { display: block; width: 100%; height: 100%; font-family: "Space Grotesk", Inter, sans-serif; }
.hq-spot { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid #FFFFFF; background: #1FD0DC; color: #06192F; font: 700 1.1rem/1 Inter, sans-serif; cursor: pointer; padding: 0; animation: hqRing 1.8s ease-out infinite; }
.hq-spot[aria-pressed="true"] { background: #FFFFFF; }
.hq-spot:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 3px; }
.hq-panel { background: #06192F; color: #C8DCE3; border: 1px solid #1FD0DC; border-radius: var(--radius-lg); padding: 1rem 1.2rem; margin-top: 0.8rem; box-shadow: 0 0 24px rgba(31,208,220,0.25); }
.hq-kicker { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #1FD0DC; font-weight: 700; }
.hq-title { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; color: #FFFFFF; margin: 0.15rem 0 0.25rem; }
.hq-text { margin: 0; font-size: 0.95rem; line-height: 1.5; color: #C8DCE3; }
@media (min-width: 900px) {
  .hq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.2rem; align-items: center; }
  .hq-panel { margin: 0; }
}
@media (max-width: 600px) { .hq-spot { width: 34px; height: 34px; margin: -17px 0 0 -17px; font-size: 0.95rem; } }
.hq-shield path { fill: none; stroke: rgba(31,208,220,0.45); stroke-width: 2.5; stroke-dasharray: 5 5; }
.hq-shield.on path { fill: #1FD0DC; stroke: #D4A843; stroke-width: 4; stroke-dasharray: none; filter: drop-shadow(0 0 6px rgba(31,208,220,0.6)); }
.hq-gear { display: none; }
.hq-gear.on { display: inline; animation: hqPop 0.55s cubic-bezier(.3,1.4,.5,1) both; transform-box: fill-box; transform-origin: center; }
@keyframes hqFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-28px); } }
.hq-float { animation: hqFloat 4s ease-in-out infinite; }
@keyframes hqBlink { 0%,90%,100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
.hq-blink { animation: hqBlink 5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hqPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.hq-pulse { animation: hqPulse 2s ease-in-out infinite; }
.hq-pulse2 { animation: hqPulse 2s ease-in-out .6s infinite; }
.hq-pulse3 { animation: hqPulse 2s ease-in-out 1.2s infinite; }
@keyframes hqRing { 0% { box-shadow: 0 0 0 0 rgba(31,208,220,0.7); } 100% { box-shadow: 0 0 0 14px rgba(31,208,220,0); } }
@keyframes hqTurn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.hq-turn { animation: hqTurn 14s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hqTw { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
.hq-tw1 { animation: hqTw 3s infinite; } .hq-tw2 { animation: hqTw 4s 1s infinite; } .hq-tw3 { animation: hqTw 5s 2s infinite; }
@keyframes hqPop { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hq-float, .hq-blink, .hq-pulse, .hq-pulse2, .hq-pulse3, .hq-turn, .hq-tw1, .hq-tw2, .hq-tw3, .hq-spot, .hq-gear.on { animation: none; }
}
/* ================= VIEW CHOOSER + ANALYST PROFILE (My learning, ages 10 to 18) =================
   Dale, 9 Nov 2026: Byte's HQ for ages 4 to 9, the analyst profile for 10 to 18. Both read the same
   progress from children's packs only. A fixed dark panel in both themes. */
.view-choose .choose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.choose-card { display: flex; flex-direction: column; gap: 0.35rem; text-align: left; padding: 1.3rem 1.4rem; border-radius: var(--radius-lg); border: 1px solid var(--line-card); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; box-shadow: var(--card-shadow); transition: transform .15s, border-color .15s; }
.choose-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.choose-card.dark { background: #020A16; color: #B8CCD6; border-color: rgba(94,240,250,0.35); }
.choose-kicker { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--accent-ink); }
.choose-card.dark .choose-kicker { color: #5EF0FA; font-family: ui-monospace, "JetBrains Mono", monospace; }
.choose-name { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--heading); }
.choose-card.dark .choose-name { color: #FFFFFF; }
.choose-desc { font-size: 0.95rem; }
.view-switch-row { display: flex; justify-content: flex-end; }
.view-switch { background: none; border: 1px solid var(--line-card); color: var(--accent-ink); border-radius: 999px; padding: 0.45rem 0.9rem; font: 600 0.85rem Inter, sans-serif; cursor: pointer; }

.an { position: relative; overflow: hidden; background: #020A16; color: #B8CCD6; border-radius: var(--radius-lg); padding: 1.1rem 1.4rem 3.4rem; margin-bottom: 2rem; box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.an-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.an-glow { position: absolute; border-radius: 50%; pointer-events: none; }
.an-glow.a { left: -15%; top: -25%; width: 60%; aspect-ratio: 1; background: radial-gradient(circle, rgba(31,208,220,0.20), rgba(31,208,220,0) 65%); }
.an-glow.b { right: -18%; bottom: -35%; width: 62%; aspect-ratio: 1; background: radial-gradient(circle, rgba(124,92,255,0.18), rgba(124,92,255,0) 65%); }
.an-top, .an-title, .an-grid, .an-meters { position: relative; }
.an-meters { margin-top: 1.1rem; }
.an-top { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.an-mono { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: 0.75rem; letter-spacing: 0.12em; color: #1FD0DC; }
.an-mono.gold { color: #F5D27A; }
.an-switch { background: transparent; border: 1px solid rgba(159,184,194,0.35); color: #C8DCE3; border-radius: 6px; padding: 0.4rem 0.7rem; font: 600 0.75rem ui-monospace, "JetBrains Mono", monospace; letter-spacing: 0.06em; cursor: pointer; text-transform: uppercase; }
.an-switch:focus-visible, .view-switch:focus-visible, .choose-card:focus-visible { outline: 3px solid #5EF0FA; outline-offset: 3px; }
.an-title { margin: 0.4rem 0 0.8rem; font-family: var(--font-head); font-size: 2rem; color: #FFFFFF; text-shadow: 0 0 24px rgba(31,208,220,0.35); }
.an-grid { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 760px) { .an-grid { grid-template-columns: minmax(0, 1fr); } .an-core { max-width: 420px; margin: 0 auto; } }
.an-core { position: relative; width: 100%; aspect-ratio: 1; }
.an-ring { position: absolute; border-radius: 50%; }
.an-ring.r1 { inset: 0; border: 1px dashed rgba(31,208,220,0.35); animation: anSpin 30s linear infinite; }
.an-ring.r2 { inset: 5%; border: 2px solid transparent; border-top-color: #1FD0DC; border-left-color: rgba(31,208,220,0.4); animation: anSpinR 22s linear infinite; }
.an-ring.r3 { inset: 10%; border: 1px solid rgba(124,92,255,0.45); border-right-color: transparent; border-bottom-color: transparent; animation: anSpin 18s linear infinite; }
.an-sweep { position: absolute; inset: 13.6%; border-radius: 50%; background: conic-gradient(from 0deg, rgba(31,208,220,0.38), rgba(31,208,220,0) 70deg, rgba(31,208,220,0) 360deg); animation: anSpin 5s linear infinite; }
.an-disc { position: absolute; inset: 13.6%; border-radius: 50%; background: radial-gradient(circle, rgba(6,26,46,0.6), rgba(2,10,22,0.85)); border: 1px solid rgba(31,208,220,0.25); }
.an-radar { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: anGlow 3s ease-in-out infinite; }
.an-radar .an-lab { font: 700 13px Inter, sans-serif; fill: #FFFFFF; }
.an-radar .an-lv { font: 700 12px ui-monospace, "JetBrains Mono", monospace; fill: #5EF0FA; }
.an-clear-label { font: 600 9px ui-monospace, "JetBrains Mono", monospace; letter-spacing: 2px; fill: #9FB8C2; }
.an-clear-num { font: 700 40px "Space Grotesk", sans-serif; fill: #FFFFFF; filter: drop-shadow(0 0 10px rgba(31,208,220,0.9)); }
.an-side { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.an-card { display: flex; gap: 1rem; align-items: center; padding: 1rem; border-radius: 16px; background: rgba(10,34,58,0.55); border: 1px solid rgba(94,240,250,0.25); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 30px rgba(0,0,0,0.35); }
.an-ident { flex: 0 0 64px; height: 64px; border-radius: 14px; background: #061A2E; border: 1px solid rgba(31,208,220,0.5); display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 7px; box-sizing: border-box; box-shadow: 0 0 18px rgba(31,208,220,0.35); }
.an-ident span { border-radius: 2px; }
.an-card-body { flex: 1 1 auto; min-width: 0; }
.an-id { font: 700 1.1rem ui-monospace, "JetBrains Mono", monospace; color: #FFFFFF; }
.an-small { font-size: 0.78rem; color: #9FB8C2; }
.an-next { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; flex-wrap: wrap; }
.an-next-bar { flex: 1 1 120px; height: 6px; border-radius: 3px; background: rgba(31,208,220,0.12); overflow: hidden; }
.an-next-bar div { height: 100%; width: 0; background: linear-gradient(90deg, #1FD0DC, #7C5CFF); box-shadow: 0 0 10px rgba(31,208,220,0.8); transition: width .8s ease; }
.an-next-text { font: 600 0.68rem ui-monospace, "JetBrains Mono", monospace; color: #C9B8FF; letter-spacing: 0.04em; }
.an-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.6rem; }
.an-meter { padding: 0.65rem 0.75rem; border-radius: 12px; background: rgba(10,34,58,0.45); border: 1px solid rgba(94,240,250,0.15); }
.an-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.an-meter-name { font-size: 0.85rem; font-weight: 600; color: #FFFFFF; }
.an-meter-lv { font: 600 0.68rem ui-monospace, "JetBrains Mono", monospace; color: #5EF0FA; }
.an-segs { display: flex; gap: 3px; margin-top: 0.5rem; }
.an-segs span { flex: 1 1 0; height: 7px; border-radius: 2px; background: rgba(31,208,220,0.12); }
.an-segs span.on { background: #1FD0DC; box-shadow: 0 0 8px rgba(31,208,220,0.8); }
.an-meter-from { font-size: 0.7rem; color: #6F8A98; margin-top: 0.35rem; }
.an-soon { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.75rem 0.9rem; border-radius: 12px; border: 1px dashed rgba(212,168,67,0.45); font-size: 0.85rem; }
.an-tip { position: absolute; left: 0; right: 0; bottom: 0; height: 2.6rem; display: flex; align-items: center; padding: 0 1.4rem; border-top: 1px solid rgba(31,208,220,0.18); background: rgba(2,10,22,0.85); font: 500 0.78rem ui-monospace, "JetBrains Mono", monospace; color: #5EF0FA; overflow: hidden; white-space: nowrap; }
.an-caret { margin-left: 3px; animation: anCaret 1s steps(1) infinite; }
.an-flow { stroke-dasharray: 4 6; animation: anDash 3s linear infinite; }
.an-n1 { animation: anNode 3s infinite; } .an-n2 { animation: anNode 4s 1s infinite; } .an-n3 { animation: anNode 5s 2s infinite; }
@keyframes anSpin { to { transform: rotate(360deg); } }
@keyframes anSpinR { to { transform: rotate(-360deg); } }
@keyframes anGlow { 0%,100% { filter: drop-shadow(0 0 6px rgba(31,208,220,.6)); } 50% { filter: drop-shadow(0 0 14px rgba(31,208,220,1)); } }
@keyframes anCaret { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes anDash { to { stroke-dashoffset: -40; } }
@keyframes anNode { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .an-ring, .an-sweep, .an-radar, .an-caret, .an-flow, .an-n1, .an-n2, .an-n3 { animation: none; }
}
.view-about { margin: 0 0 1rem; font-size: 0.92rem; color: var(--muted); max-width: 46rem; }
.an-sub { position: relative; margin: -0.3rem 0 1.1rem; max-width: 44rem; font-size: 0.95rem; line-height: 1.5; color: #C8DCE3; }
/* Challenges panel on the analyst profile */
.an-ch { padding: 0.9rem 1rem; border-radius: 14px; background: rgba(10,34,58,0.45); border: 1px solid rgba(212,168,67,0.4); }
.an-ch-head { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.an-ch-empty, .an-ch-more { margin: 0.3rem 0 0; font-size: 0.85rem; color: #C8DCE3; }
.an-ch-more { color: #9FB8C2; font-size: 0.8rem; }
.an-ch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.an-ch-list a { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0.45rem 0.75rem; border-radius: 10px; background: rgba(2,10,22,0.6); border: 1px solid rgba(94,240,250,0.2); color: #FFFFFF; text-decoration: none; }
.an-ch-list a:hover, .an-ch-list a:focus-visible { border-color: #5EF0FA; outline: none; box-shadow: 0 0 14px rgba(31,208,220,0.35); }
.an-ch-title { font-weight: 600; font-size: 0.92rem; }
.an-ch-state { font: 700 0.7rem ui-monospace, "JetBrains Mono", monospace; letter-spacing: 0.08em; padding: 0.25rem 0.5rem; border-radius: 6px; }
.an-ch-state.ready { background: #1FD0DC; color: #021020; }
.an-ch-state.captured { border: 1px solid #D4A843; color: #F5D27A; }

/* Challenge page */
.ch-back { margin: 0 0 0.8rem; }
.ch .an-top { margin-bottom: 0.2rem; }
.ch-progress { position: relative; display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1rem; }
.ch-segs { display: flex; gap: 6px; }
.ch-segs span { width: 46px; height: 8px; border-radius: 3px; background: rgba(94,240,250,0.12); }
.ch-segs span.on { background: #D4A843; box-shadow: 0 0 10px rgba(212,168,67,0.8); }
.ch-count { font: 600 0.75rem ui-monospace, "JetBrains Mono", monospace; color: #FFFFFF; letter-spacing: 0.06em; }
.ch-play { position: relative; display: flex; flex-direction: column; gap: 1rem; }
.ch-feedback { position: relative; min-height: 1.5rem; margin-top: 0.6rem; font: 500 0.85rem ui-monospace, "JetBrains Mono", monospace; color: #5EF0FA; }
.ch-msg { max-width: 34rem; border-radius: 20px; padding: 3px; background: linear-gradient(160deg, #3A5A78, #0A1828 50%, #2A3F5A); box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.ch-msg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; padding: 0.7rem 1rem 0.3rem; background: #060B14; border-radius: 17px 17px 0 0; }
.ch-msg-from { color: #FFFFFF; font-weight: 700; }
.ch-msg-kind { font: 600 0.7rem ui-monospace, "JetBrains Mono", monospace; color: #6F8A98; letter-spacing: 0.08em; text-transform: uppercase; }
.ch-msg-body { background: #060B14; border-radius: 0 0 17px 17px; padding: 0.4rem 1rem 1.1rem; font-size: 1rem; line-height: 1.9; color: #E6EEF5; }
.ch-seg { display: inline; font: inherit; line-height: inherit; color: inherit; background: rgba(255,255,255,0.03); border: 0; border-bottom: 1px dashed rgba(94,240,250,0.35); border-radius: 4px; padding: 0.05rem 0.2rem; cursor: pointer; text-align: left; }
.ch-seg:hover, .ch-seg:focus-visible { background: rgba(31,208,220,0.12); outline: none; }
.ch-seg.link { color: #5AB8FF; text-decoration: underline; }
.ch-seg.found { background: rgba(212,168,67,0.28); color: #FFFFFF; box-shadow: 0 0 0 2px #D4A843, 0 0 14px rgba(212,168,67,0.6); border-bottom-color: transparent; }
.ch-clues { display: flex; flex-direction: column; gap: 0.6rem; }
.ch-clue { padding: 0.7rem 0.9rem; border-radius: 12px; background: rgba(212,168,67,0.08); border: 1px solid rgba(212,168,67,0.55); color: #E6EEF5; font-size: 0.92rem; animation: chRise .4s ease-out both; }
.ch-clue-head { font: 700 0.72rem ui-monospace, "JetBrains Mono", monospace; color: #F5D27A; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.2rem; }
.ch-sort { display: flex; flex-direction: column; gap: 0.7rem; }
.ch-sort-row { padding: 0.8rem 0.9rem; border-radius: 14px; background: rgba(10,34,58,0.5); border: 1px solid rgba(94,240,250,0.18); }
.ch-sort-row.done { border-color: rgba(212,168,67,0.55); background: rgba(212,168,67,0.06); }
.ch-sort-text { margin: 0 0 0.6rem; color: #FFFFFF; font-size: 0.98rem; }
.ch-sort-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ch-pill { min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid rgba(94,240,250,0.45); background: transparent; color: #5EF0FA; font: 600 0.9rem Inter, sans-serif; cursor: pointer; }
.ch-pill:hover, .ch-pill:focus-visible { background: rgba(31,208,220,0.14); outline: none; }
.ch-sort-row.done .ch-pill { opacity: 0.4; cursor: default; }
.ch-sort-row.done .ch-pill.chosen { opacity: 1; background: #D4A843; border-color: #D4A843; color: #1A1208; }
.ch-why { display: block; margin: 0.5rem 0 0; font-size: 0.88rem; color: #F5D27A; }
.ch-order { display: flex; flex-direction: column; gap: 0.7rem; }
.ch-pool { display: flex; flex-direction: column; gap: 0.5rem; }
.ch-step { text-align: left; min-height: 48px; padding: 0.7rem 0.9rem; border-radius: 12px; border: 1px solid rgba(94,240,250,0.3); background: rgba(10,34,58,0.5); color: #FFFFFF; font: 0.95rem/1.4 Inter, sans-serif; cursor: pointer; }
.ch-step:hover, .ch-step:focus-visible { border-color: #5EF0FA; outline: none; box-shadow: 0 0 14px rgba(31,208,220,0.3); }
.ch-done { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; color: #F5D27A; }
.ch-done li { padding: 0.6rem 0.8rem; border-radius: 12px; background: rgba(212,168,67,0.08); border: 1px solid rgba(212,168,67,0.5); animation: chRise .4s ease-out both; }
.ch-step-text { display: block; color: #FFFFFF; }
.ch-locked { padding: 1rem 1.1rem; border-radius: 14px; border: 1px dashed rgba(212,168,67,0.5); color: #E6EEF5; }
.ch-locked p { margin: 0 0 0.8rem; }
.ch-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border-radius: 10px; background: #1FD0DC; color: #021020; font-weight: 700; text-decoration: none; }
.ch-win { position: relative; margin-top: 1rem; border-radius: 16px; overflow: hidden; padding: 2px; }
.ch-win:focus { outline: 3px solid #F5D27A; outline-offset: 3px; }
.ch-win-border { position: absolute; left: 50%; top: 50%; width: 200%; aspect-ratio: 1; transform: translate(-50%, -50%); background: conic-gradient(from 0deg, #D4A843, rgba(212,168,67,0) 25%, #1FD0DC 50%, rgba(31,208,220,0) 75%, #D4A843); animation: chBorder 5s linear infinite; }
.ch-win-inner { position: relative; border-radius: 14px; background: #0A1424; padding: 1rem 1.2rem; }
.ch-flag { font: 700 1.1rem ui-monospace, "JetBrains Mono", monospace; color: #F5D27A; text-shadow: 0 0 14px rgba(212,168,67,0.7); overflow-wrap: break-word; }
.ch-win-text { margin: 0.4rem 0 0; color: #FFFFFF; }
.ch-debrief { margin: 0.6rem 0 1rem; color: #C8DCE3; font-size: 0.95rem; line-height: 1.5; }
@keyframes chRise { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes chBorder { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ch-clue, .ch-done li, .ch-win-border { animation: none; } }
@media (max-width: 600px) {
  .ch-segs span { width: 28px; }
  .ch-count { white-space: nowrap; }
  .ch-flag { font-size: 0.98rem; }
  .an { padding-bottom: 4.6rem; }
  .an-tip { height: auto; min-height: 2.6rem; padding: 0.45rem 1.1rem; white-space: normal; line-height: 1.4; }
}
/* Career cards (analyst profile) */
.an-careers-wrap { position: relative; margin-top: 1.3rem; }
.an-careers-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.an-careers-sub { margin: 0.2rem 0 0.8rem; font-size: 0.88rem; color: #9FB8C2; }
.an-careers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; align-items: start; }
.cc { position: relative; border-radius: 16px; padding: 2px; overflow: hidden; background: rgba(94,240,250,0.14); }
.cc.expanded { grid-column: 1 / -1; }
.cc-holo { position: absolute; left: 50%; top: 50%; width: 220%; aspect-ratio: 1; transform: translate(-50%, -50%); background: conic-gradient(from 0deg, #1FD0DC, #7C5CFF, #F2994A, #D4A843, #3BB273, #1FD0DC); opacity: 0; animation: ccSpin 9s linear infinite; }
.cc.open .cc-holo { opacity: 0.85; }
.cc.route .cc-holo { background: conic-gradient(from 0deg, #D4A843, #F5D27A, #8C6420, #D4A843); }
.cc-front, .cc-back { position: relative; background: #061527; }
.cc-front { border-radius: 14px; padding: 0.95rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; min-height: 9.5rem; overflow: hidden; }
.cc.expanded .cc-front { border-radius: 14px 14px 0 0; }
.cc.open .cc-front::after { content: ""; position: absolute; top: -40%; left: -60%; width: 40%; height: 180%; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.12), rgba(255,255,255,0)); transform: rotate(20deg); animation: ccShine 5s ease-in-out infinite; pointer-events: none; }
.cc-kicker { font: 600 0.68rem ui-monospace, "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: #5EF0FA; }
.cc.route .cc-kicker { color: #F5D27A; }
.cc-title { margin: 0; font-family: var(--font-head); font-size: 1.12rem; line-height: 1.25; color: #FFFFFF; }
.cc-tag { margin: 0; font-size: 0.86rem; color: #C8DCE3; }
.cc-lock { margin: auto 0 0; font-size: 0.8rem; color: #8FA6B2; }
.cc.locked .cc-title { color: #9FB8C2; }
.cc-btn { align-self: flex-start; margin-top: auto; min-height: 40px; padding: 0 0.9rem; border-radius: 10px; border: 0; background: #1FD0DC; color: #021020; font: 700 0.85rem Inter, sans-serif; cursor: pointer; position: relative; z-index: 1; }
.cc.route .cc-btn { background: #D4A843; color: #1A1208; }
.cc-btn:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.cc-back { border-radius: 0 0 14px 14px; padding: 0.4rem 1.1rem 1.1rem; color: #C8DCE3; font-size: 0.93rem; line-height: 1.55; border-top: 1px solid rgba(94,240,250,0.18); }
.cc-back h4 { margin: 0.9rem 0 0.3rem; font: 600 0.72rem ui-monospace, "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: #5EF0FA; }
.cc-back ul, .cc-back ol { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.3rem; }
.cc-what { margin: 0.6rem 0 0; color: #FFFFFF; }
.cc-small { margin: 0 0 0.4rem; font-size: 0.84rem; color: #9FB8C2; }
.cc-ways strong { color: #FFFFFF; }
.cc-ways a { color: #5EF0FA; }
.cc-hard { margin-top: 0.8rem; padding: 0.2rem 0.9rem 0.8rem; border-radius: 12px; border: 1px solid rgba(201,184,255,0.35); background: rgba(124,92,255,0.08); }
.cc-hard h4 { color: #C9B8FF; }
.cc-hard p { margin: 0; }
.cc-dale { margin: 1rem 0 0; padding: 0.8rem 1rem; border-radius: 12px; background: rgba(212,168,67,0.08); border: 1px solid rgba(212,168,67,0.4); }
.cc-dale p { margin: 0; color: #FFFFFF; font-style: italic; }
.cc-dale cite { display: block; margin-top: 0.3rem; font: 600 0.72rem ui-monospace, "JetBrains Mono", monospace; color: #F5D27A; font-style: normal; }
.cc-route { list-style: none; padding-left: 0 !important; gap: 0.6rem !important; margin-top: 0.7rem !important; }
.cc-route li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.8rem; padding: 0.6rem 0.8rem; border-radius: 10px; background: rgba(10,34,58,0.5); border-left: 3px solid #D4A843; }
.cc-when { font: 700 0.75rem ui-monospace, "JetBrains Mono", monospace; color: #F5D27A; text-transform: uppercase; letter-spacing: 0.06em; }
@media (max-width: 600px) { .cc-route li { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; } }
@keyframes ccSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes ccShine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .cc-holo, .cc.open .cc-front::after { animation: none; } }
/* Patch wall (analyst profile) and patch on the challenge win card */
.an-patches-wrap { position: relative; margin-top: 1.3rem; }
.an-patches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.9rem 0.6rem; }
.patch-cell { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center; }
.patch { width: 78px; height: 88px; }
.patch.big { width: 96px; height: 108px; }
.patch-rim { position: relative; width: 100%; height: 100%; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: rgba(94,240,250,0.16); overflow: hidden; }
.patch-inner { position: absolute; inset: 4px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: #040E1C; display: flex; align-items: center; justify-content: center; }
.patch-stitch { position: absolute; inset: 6px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); border: 1px dashed rgba(255,255,255,0.3); }
.patch.off .patch-stitch { border-color: rgba(94,240,250,0.12); }
.patch-text { position: relative; font: 700 0.62rem/1.2 ui-monospace, "JetBrains Mono", monospace; letter-spacing: 0.02em; color: #34506A; text-align: center; padding: 0 6px; }
.patch.big .patch-text { font-size: 0.78rem; }
.patch-shine { position: absolute; top: -20px; left: -40%; width: 22px; height: 160%; background: rgba(255,255,255,0.32); transform: rotate(20deg); animation: patchShine 4.5s ease-in-out infinite; }
.patch.on { filter: drop-shadow(0 0 8px rgba(31,208,220,0.25)); }
.patch-cap { font-size: 0.7rem; line-height: 1.3; color: #9FB8C2; max-width: 7rem; }
.ch-patch { display: flex; align-items: center; gap: 0.9rem; margin: 0.8rem 0 0; }
.ch-patch .patch { animation: patchPop .6s cubic-bezier(.3,1.4,.5,1) both; }
.ch-patch-text { color: #FFFFFF; font-weight: 600; }
@keyframes patchShine { 0%, 55% { left: -40%; } 100% { left: 140%; } }
@keyframes patchPop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .patch-shine, .ch-patch .patch { animation: none; } }
