/* ADT Learning — Economics Portal design system
   Tokens from spec v3 §3 (slide 3). Never use raw hex outside this block. */
:root {
  --color-navy-900: #071B31;
  --color-navy-800: #1E3044;
  --color-warm-white: #FBF9F7;
  --color-accent-orange: #D76B1B;
  --color-orange-dark: #b8590f;
  --color-economics: #294A33;
  --color-info: #2E4D60;
  --color-finance-gold: #D49A24;
  --color-border: #E7E3DE;
  --color-white: #ffffff;
  --color-text: #1a2430;
  --color-text-muted: #5b6674;
  --color-danger: #b3442f;
  --color-surface: #ffffff;
  --color-hover: #f5f2ef;
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(7, 27, 49, 0.06), 0 1px 8px rgba(7, 27, 49, 0.04);
  /* Two-font system (see shell.js's loadFonts): Plus Jakarta Sans for everything
     functional, Fraunces reserved for the wordmark and page/hero headings only —
     applied explicitly per-selector below, never the default body face. */
  --font-ui: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  font-family: var(--font-ui);
}

/* Dark mode — an explicit opt-in toggle (see shell.js's applyTheme / the topbar's
   sun-moon button), not tied to the OS preference, so it never changes for anyone who
   hasn't asked for it. Only the tokens actually used for page/card/text surfaces are
   redefined; subject/status colours (badges, the sidebar's permanent navy, accent
   buttons) stay the same in both themes on purpose. */
html[data-theme="dark"] {
  --color-warm-white: #10161d;
  --color-surface: #1a222b;
  --color-hover: #212b34;
  --color-border: #2b3540;
  --color-text: #e7e9ea;
  --color-text-muted: #98a4ad;
}

/* Accessibility overrides (see account.html's Accessibility panel + shell.js's
   applyA11ySettings, which keeps these in sync with Store on every page, not just
   account.html). */
html.a11y-large-text { zoom: 1.15; }
html.a11y-reduce-motion, html.a11y-reduce-motion * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-high-contrast:not([data-theme="dark"]) {
  --color-text: #000000; --color-text-muted: #000000; --color-border: #000000;
  --color-surface: #ffffff; --color-warm-white: #ffffff; --color-hover: #eeeeee;
}
html.a11y-high-contrast[data-theme="dark"] {
  --color-text: #ffffff; --color-text-muted: #ffffff; --color-border: #ffffff;
  --color-surface: #000000; --color-warm-white: #000000; --color-hover: #1a1a1a;
}
html.a11y-high-contrast .card, html.a11y-high-contrast .modal, html.a11y-high-contrast .pill,
html.a11y-high-contrast input, html.a11y-high-contrast select, html.a11y-high-contrast textarea {
  border-width: 2px;
}
html.a11y-high-contrast .btn-primary, html.a11y-high-contrast .btn-secondary { outline: 2px solid currentColor; outline-offset: -1px; }
html.a11y-high-contrast a { text-decoration: underline; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--color-warm-white);
  color: var(--color-text);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14px;
  padding: 10px 18px; white-space: nowrap; transition: filter .12s ease, background .12s ease;
}
.btn-primary { background: var(--color-accent-orange); color: #fff; }
.btn-primary:hover { filter: brightness(0.94); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-hover); }
.btn-dark { background: var(--color-navy-900); color: #fff; }
.btn-dark:hover { filter: brightness(1.2); }
.btn-danger-text { background: transparent; color: var(--color-danger); border: none; padding: 10px 4px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  border: 1px solid var(--color-border); padding: 6px 12px; font-size: 13px; background: var(--color-surface);
}
/* Streak fire — grey at a 0-day streak, accent-orange once there's an actual streak. */
.streak-icon { display: inline-flex; align-items: center; color: var(--color-text-muted); font-weight: 700; }
.streak-icon.streak-lit { color: var(--color-accent-orange); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-mastered   { background: #e7efe9; color: var(--color-economics); }
.badge-strong     { background: #e7edf1; color: var(--color-info); }
.badge-developing { background: #fbe9dc; color: var(--color-accent-orange); }
.badge-attention  { background: #fbe9dc; color: var(--color-accent-orange); }
.badge-notstarted { background: #efece8; color: var(--color-text-muted); }
.badge-notstarted::before { display: none; }
.badge-premium    { background: #efece8; color: var(--color-text-muted); }
.badge-premium::before { display: none; }
.badge-finance    { background: #f7ecd4; color: var(--color-finance-gold); }
.badge-active     { background: #e7efe9; color: var(--color-economics); }
.badge-info       { background: #e7edf1; color: var(--color-info); }
.badge-neutral    { background: #efece8; color: var(--color-text-muted); }
.badge-neutral::before{ display:none; }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--color-navy-900); color: #cfd8e2;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; }
.sidebar-collapse-btn {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 24px); margin: 0 12px 10px; padding: 8px 8px;
  background: transparent; border: none; border-radius: 8px; color: #8493a6; font-size: 12.5px; font-weight: 600;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-collapse-btn svg { flex: none; }
.sidebar-brand .mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--color-accent-orange);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none;
}
.sidebar-brand .name { color: #fff; font-weight: 600; font-size: 16px; font-family: var(--font-display); letter-spacing: 0.01em; }
.sidebar-brand .sub { display: block; font-size: 10px; letter-spacing: .08em; color: #8493a6; font-weight: 600; }
.nav-group-label { font-size: 11px; letter-spacing: .08em; color: #6d7d90; font-weight: 700; padding: 14px 20px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px; font-size: 14px; font-weight: 500; color: #c3cddb;
  border-left: 3px solid transparent;
}
.nav-item svg { flex: none; opacity: .85; }
.nav-item .nav-icon { display: flex; flex: none; }
.nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-item.active { background: var(--color-navy-800); color: #fff; border-left-color: var(--color-accent-orange); font-weight: 700; }
.sidebar-spacer { flex: 1; }
.plan-card { margin: 14px; padding: 14px; background: rgba(255,255,255,0.06); border-radius: var(--radius); }
.plan-card .t { color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.plan-card .d { font-size: 12px; color: #a9b4c2; line-height: 1.5; margin-bottom: 10px; }

.main-col { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; transition: margin-left .15s ease; }

/* Collapsible sidebar (see shell.js's initSidebarCollapse) — icons only, labels and the
   plan-upgrade card hidden, width shrinks to match. */
.app-shell.sidebar-collapsed .sidebar { width: 68px; flex-basis: 68px; transition: width .15s ease; }
.app-shell.sidebar-collapsed .main-col { margin-left: 68px; }
.app-shell.sidebar-collapsed .sidebar-brand .name,
.app-shell.sidebar-collapsed .sidebar-brand .sub,
.app-shell.sidebar-collapsed .nav-group-label,
.app-shell.sidebar-collapsed .nav-item .nav-label,
.app-shell.sidebar-collapsed .plan-card,
.app-shell.sidebar-collapsed .sidebar-collapse-btn .label { display: none; }
.app-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 20px 8px 16px; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding: 10px 0; }
.app-shell.sidebar-collapsed .sidebar-collapse-btn { justify-content: center; width: 44px; margin: 0 auto 10px; }

/* Hover-to-peek: while collapsed, hovering the sidebar temporarily expands it back to full
   width (icons + labels), overlaying the page rather than shifting it — main-col's margin
   deliberately stays put during the peek. Moving the mouse away collapses it again. This is
   only for the collapsed state; clicking "Show menu" (removing .sidebar-collapsed) pins it
   open with no hover behaviour at all. */
.app-shell.sidebar-collapsed .sidebar:hover { width: var(--sidebar-w); z-index: 25; box-shadow: 4px 0 24px rgba(0,0,0,.18); }
.app-shell.sidebar-collapsed .sidebar:hover .sidebar-brand .name,
.app-shell.sidebar-collapsed .sidebar:hover .sidebar-brand .sub,
.app-shell.sidebar-collapsed .sidebar:hover .nav-group-label,
.app-shell.sidebar-collapsed .sidebar:hover .nav-item .nav-label,
.app-shell.sidebar-collapsed .sidebar:hover .plan-card,
.app-shell.sidebar-collapsed .sidebar:hover .sidebar-collapse-btn .label { display: block; }
.app-shell.sidebar-collapsed .sidebar:hover .sidebar-brand { justify-content: flex-start; padding: 20px 20px 16px; }
.app-shell.sidebar-collapsed .sidebar:hover .nav-item { justify-content: flex-start; padding: 10px 20px; }
.app-shell.sidebar-collapsed .sidebar:hover .sidebar-collapse-btn { justify-content: flex-start; width: calc(100% - 24px); margin: 0 12px 10px; }
.topbar {
  height: var(--topbar-h); background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar-search-wrap { position: relative; flex: 1; max-width: 480px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px; background: var(--color-hover);
  border: 1px solid var(--color-border); border-radius: 8px; padding: 9px 14px; color: var(--color-text-muted); font-size: 14px;
}
.topbar-search input {
  border: none; background: transparent; outline: none; font-size: 14px; color: var(--color-text);
  width: 100%; padding: 0; font-family: inherit;
}
.topbar-search input::placeholder { color: var(--color-text-muted); }
.topbar-search:focus-within { outline: 2px solid var(--color-info); outline-offset: 2px; border-radius: 8px; }
.search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 420px; overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(7,27,49,.12);
  z-index: 40; padding: 6px 0;
}
.search-results.show { display: block; }
.search-group-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-muted); padding: 8px 14px 4px; }
.search-result-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 14px; font-size: 13.5px; color: var(--color-text); }
.search-result-row:hover { background: var(--color-hover); }
.search-result-row .t { font-weight: 600; }
.search-result-row .s { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.search-empty { padding: 14px; font-size: 13px; color: var(--color-text-muted); }
.topbar-spacer { flex: 1; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--color-economics); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none;
}

/* Homework notification bell (see shell.js's initHomeworkBell). Hidden entirely for
   anyone who hasn't joined a class — never shown as an empty/decorative icon. */
.hw-bell-wrap { position: relative; flex: none; }
.hw-bell { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); display: flex; align-items: center; justify-content: center; }
.hw-bell:hover { background: var(--color-hover); color: var(--color-text); }
.hw-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--color-info); color: #fff; font-size: 10px; font-weight: 800; align-items: center; justify-content: center; line-height: 1;
}
.hw-badge.overdue { background: var(--color-danger); }
.hw-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 300px; max-height: 360px; overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(7,27,49,.12);
  z-index: 40; padding: 6px 0;
}
.hw-dropdown.show { display: block; }
.hw-drop-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; color: var(--color-text); }
.hw-drop-row:hover { background: var(--color-hover); }
.hw-drop-row .t { font-weight: 600; font-size: 13.5px; }
.hw-drop-row .s { font-size: 12px; color: var(--color-text-muted); }
.hw-drop-due { font-size: 11px; font-weight: 700; color: var(--color-info); white-space: nowrap; }
.hw-drop-due.overdue { color: var(--color-danger); }
.hw-drop-more { padding: 8px 14px; font-size: 12px; color: var(--color-text-muted); text-align: center; }

/* Topbar session pill — a running focus timer and/or ambient sound (see shell.js's
   initSessionIndicator). Hidden entirely when neither is active. */
.session-pill-wrap { position: relative; flex: none; }
.session-pill { font: inherit; color: inherit; }
.session-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 240px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(7,27,49,.12);
  z-index: 40; padding: 12px;
}
.session-dropdown.show { display: block; }
.session-drop-row { font-size: 13.5px; margin-bottom: 10px; }
.session-drop-row select { width: 100%; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 13px; background: var(--color-surface); color: var(--color-text); }
.session-drop-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.session-drop-sep { height: 1px; background: var(--color-border); margin: 12px 0; }
.page { padding: 28px 32px 60px; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; font-family: var(--font-display); font-weight: 600; }
.page-head .desc { color: var(--color-text-muted); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex: none; }

/* ---------- Cards / grid ---------- */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-pad { padding: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-tile { padding: 18px 20px; }
.stat-tile .num { font-size: 28px; font-weight: 800; color: var(--color-text); }
.stat-tile .lbl { font-size: 13px; color: var(--color-text); margin-top: 4px; font-weight: 600; }
.stat-tile .sub { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.stat-tile.economics .num { color: var(--color-economics); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }

/* progress bars */
.bar { height: 8px; border-radius: 4px; background: var(--color-border); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--color-economics); }
.bar.orange > span { background: var(--color-accent-orange); }
.mastery-track { display: flex; gap: 3px; width: 130px; }
.mastery-track i { flex: 1; height: 7px; border-radius: 3px; background: var(--color-border); display: block; }
.mastery-track i.on.mastered { background: var(--color-economics); }
.mastery-track i.on.strong { background: var(--color-info); }
.mastery-track i.on.developing { background: var(--color-accent-orange); }

/* forms */
label.field { display: block; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--color-text-muted); margin-bottom: 6px; text-transform: uppercase; }
input[type=text], input[type=email], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 14px; color: var(--color-text); background: var(--color-surface);
  font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-info); outline-offset: 1px; }
.form-row { margin-bottom: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.toggle { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--color-border); border: none; flex: none; }
.toggle::after { content: ""; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; top: 2px; left: 2px; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.toggle.on { background: var(--color-economics); }
.toggle.on::after { transform: translateX(18px); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-muted); padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--color-hover); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 20px; }
.tab { padding: 10px 4px; margin-right: 22px; font-size: 14px; font-weight: 600; color: var(--color-text-muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--color-text); border-bottom-color: var(--color-accent-orange); }
.panel { display: none; }
.panel.active { display: block; }

/* callouts (lesson page) */
.callout { border-radius: 8px; padding: 16px 18px; margin: 16px 0; border-left: 4px solid; }
.callout .k { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; display: block; }
.callout-definition { background: #e7efe9; border-color: var(--color-economics); color: #1e3324; }
.callout-definition .k { color: var(--color-economics); }
.callout-tip { background: #e7edf1; border-color: var(--color-info); color: #1c3241; }
.callout-tip .k { color: var(--color-info); }
.callout-mistake { background: #fbe9dc; border-color: var(--color-accent-orange); color: #7a3d0f; }
.callout-mistake .k { color: var(--color-accent-orange); }
.callout-grade9 { background: #f7ecd4; border-color: var(--color-finance-gold); color: #6b5410; }
.callout-grade9 .k { color: #93701a; }

/* toast / modal */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--color-navy-900); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-overlay { position: fixed; inset: 0; background: rgba(7,27,49,.5); display: none; align-items: center; justify-content: center; z-index: 200; }
.modal-overlay.show { display: flex; }
.modal { background: var(--color-surface); border-radius: var(--radius); padding: 26px; width: 420px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { font-size: 18px; margin-bottom: 10px; }
.modal p { color: var(--color-text-muted); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; }
.signin-divider, .ob-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--color-text-muted); font-size: 12.5px; }
.signin-divider::before, .signin-divider::after, .ob-divider::before, .ob-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }

/* mobile bottom nav */
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .sidebar, .app-shell.sidebar-collapsed .sidebar { display: none; }
  .main-col, .app-shell.sidebar-collapsed .main-col { margin-left: 0; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 62px; background: var(--color-surface);
    border-top: 1px solid var(--color-border); z-index: 30;
  }
  .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--color-text-muted); font-weight: 600; }
  .mobile-nav a.active { color: var(--color-accent-orange); }
  body.has-mobile-nav .page, body.has-mobile-nav .main-col { padding-bottom: 70px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .topbar-course-pill { display: none; }
  .topbar { gap: 8px; padding: 0 14px; }
  .page { padding: 18px 16px 24px; }
  /* Minimum 44px tap targets on touch/mobile per S17 build requirements */
  .btn, .nav-item, .mobile-nav a, .toggle, .tab, .rating-btn, .seg-btn { min-height: 44px; }
  .toggle { min-height: 22px; } /* the switch itself stays visually small; its hit area is padded via the row */
  .privacy-row, .task-row { min-height: 44px; }
}

/* Desktop-first notice for extended writing / mock exams (v3 §5, §37 — S16 build requirements) */
.desktop-first-note { display: none; }
@media (max-width: 900px) {
  .desktop-first-note {
    display: flex; gap: 10px; align-items: flex-start; background: #fbe9dc; border: 1px solid #f0c9a4;
    border-radius: 8px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; color: #7a3d0f;
  }
  .desktop-first-note b { color: #5c2d0a; }
}

/* Accessibility (spec §42): visible keyboard focus on every interactive control, and a
   blanket prefers-reduced-motion rule so animation isn't the default for anyone who's
   asked their OS not to show it. */
.btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible, .mobile-nav a:focus-visible,
.rating-btn:focus-visible, .search-result-row:focus-visible {
  outline: 2px solid var(--color-info); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Print stylesheet — used by the real "export to PDF" flow (window.print()) on results/progress pages */
@media print {
  .sidebar, .topbar, #shell-mobile-nav, .page-actions, .mobile-nav, footer { display: none !important; }
  .main-col { margin-left: 0 !important; }
  body { background: #fff !important; }
  .page { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border-color: #ccc !important; }
}

/* Lumo — ADT's mascot (see lumo.js). Static by design, except Lumo.celebrate()'s one-off
   bounce + scoped confetti burst for a genuine completion moment. */
.lumo-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lumo-msg { font-size: 13.5px; font-weight: 600; color: var(--color-text); max-width: 260px; }
.lumo-bounce { animation: lumo-bounce 0.6s ease 2; }
@keyframes lumo-bounce { 0%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-8px) rotate(-4deg); } 60% { transform: translateY(0) rotate(4deg); } }
.lumo-confetti-wrap { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.lumo-confetti-bit {
  position: absolute; top: 30%; width: 7px; height: 7px; border-radius: 2px;
  animation: lumo-confetti-fall 1.3s ease-out forwards;
}
@keyframes lumo-confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), 90px) rotate(var(--rot)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lumo-bounce { animation: none; }
  .lumo-confetti-bit { display: none; }
}

/* Site-wide floating ambient-sound mini-player (see sounds.js). Only rendered into the DOM
   while a sound is on; collapses to a small tab, expands on hover. */
.sounds-mini-player { position: fixed; bottom: 20px; right: 20px; z-index: 500; }
.sounds-mini-player .smp-tab {
  width: 42px; height: 42px; border-radius: 50%; background: var(--color-navy-900); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.sounds-mini-player .smp-panel {
  display: none; position: absolute; bottom: 50px; right: 0; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px;
  width: 200px; box-shadow: 0 4px 18px rgba(0,0,0,.16);
}
.sounds-mini-player:hover .smp-panel { display: block; }
.sounds-mini-player .smp-title { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.sounds-mini-player .smp-select { width: 100%; margin-bottom: 8px; padding: 6px; border-radius: 6px; border: 1px solid var(--color-border); font-size: 13px; }
.sounds-mini-player .smp-panel input[type=range] { width: 100%; margin-bottom: 10px; }

/* Shared typography + content-block styles for admin-authored lesson notes
   (learningNotesHtml / revisionNotesHtml on a topics/{id} Firestore doc, written from
   admin-notes.html) — the base reset above strips h1-h4/p margins and ul markers
   entirely, so without this any notes HTML renders as an unspaced, unbulleted blob.
   .notes-prose carries the readable spacing; .formula-box/.worked/.worked-grid are the
   specific content blocks the notes editor's toolbar inserts, kept identical to the
   copies already hand-written in lesson.html/sample-lesson.html so a note looks the same
   wherever it's shown. */
.notes-prose { font-size: 15px; line-height: 1.7; color: var(--color-text); }
.notes-prose h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; }
.notes-prose h2:first-child { margin-top: 0; }
.notes-prose h3 { font-size: 16.5px; font-weight: 700; margin: 22px 0 10px; }
.notes-prose p { margin: 0 0 14px; }
.notes-prose ul, .notes-prose ol { list-style: disc; margin: 0 0 16px; padding-left: 22px; }
.notes-prose ol { list-style: decimal; }
.notes-prose li { margin-bottom: 6px; }
.notes-prose strong { font-weight: 700; }
.notes-prose blockquote { border-left: 3px solid var(--color-accent-orange); margin: 16px 0; padding: 4px 0 4px 16px; color: var(--color-text-muted); }
.notes-prose a { color: var(--color-info); font-weight: 600; }
.notes-prose img { border-radius: 8px; margin: 16px 0; }
.notes-prose hr { border: none; border-top: 1px solid var(--color-border); margin: 24px 0; }
.formula-box { border:1px solid var(--color-border); border-radius:8px; padding:26px; text-align:center; font-size:20px; margin:20px 0; background:var(--color-surface); overflow-x:auto; }
.worked { border:1px solid var(--color-border); border-radius:8px; padding:18px 20px; margin:16px 0; }
.worked .k { font-size:11px; font-weight:800; letter-spacing:.06em; color:var(--color-info); margin-bottom:8px; display:block; }
.worked-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top:10px; }
@media (max-width: 640px) { .worked-grid { grid-template-columns: 1fr; } }
