/* This stylesheet belongs only to the teacher handbook. */
:root { color-scheme: light; --bg: #faf9f7; --surface: #fff; --ink: #292637; --muted: #676273; --purple: #5946c7; --purple-soft: #eeebfb; --line: #ddd8e6; --green: #236546; --green-soft: #e8f3eb; --amber: #815018; --amber-soft: #faf0df; --radius: 16px; }
html[data-theme="dark"] { color-scheme: dark; --bg: #17151d; --surface: #211e2a; --ink: #f2eef9; --muted: #b7b0c5; --purple: #c4b6ff; --purple-soft: #302842; --line: #423b50; --green: #a2ddba; --green-soft: #223b30; --amber: #f0cb91; --amber-soft: #3b3022; }
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; scrollbar-color: var(--muted) var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; overflow-wrap: anywhere; }
.hb-shell * { min-width: 0; }
::selection { background: var(--purple); color: var(--bg); }
a { color: var(--purple); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 5px; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.hb-symbols { position: absolute; }
.hb-shell { width: min(1120px, calc(100% - 64px)); margin: 0 auto; }
.hb-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.hb-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 1.15rem; min-height: 44px; }
.hb-brand img { width: 32px; height: 32px; }
.hb-tools { display: flex; align-items: center; gap: 20px; }
.hb-tools a { font-size: .9rem; font-weight: 800; }
.hb-app-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; white-space: nowrap; }
.hb-app-link .hb-icon { width: 16px; height: 16px; }
.hb-theme { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; min-height: 44px; padding: 8px 12px; font-size: .85rem; font-weight: 800; }
.hb-theme:hover { background: var(--purple-soft); }
.hb-theme[aria-pressed="true"] { color: var(--purple); background: var(--purple-soft); border-color: var(--purple); }
.hb-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.hb-skip { position: absolute; top: 8px; left: 8px; padding: 12px 18px; background: var(--surface); z-index: 5; transform: translateY(-160%); }
.hb-skip:focus { transform: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 5.4vw, 4.5rem); line-height: 1.03; letter-spacing: -.035em; font-weight: 900; }
h2 { font-size: clamp(1.8rem, 3vw, 2.55rem); line-height: 1.14; letter-spacing: -.025em; font-weight: 900; }
h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 900; }
.hb-hero { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 70px; padding: 68px 0 48px; }
.hb-intro { margin-top: 24px; font-size: 1.12rem; color: var(--muted); }
.hb-cycle { border-block: 1px solid var(--line); padding: 8px 0; list-style: none; margin: 0; }
.hb-cycle li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: center; padding: 18px 0; }
.hb-cycle li + li { border-top: 1px solid var(--line); }
.hb-cycle .hb-icon { width: 30px; height: 30px; color: var(--purple); }
.hb-cycle strong { display: block; font-size: 1.1rem; }
.hb-cycle p { color: var(--muted); font-size: .94rem; }
.hb-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; padding: 14px 0; border-block: 1px solid var(--line); }
.hb-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 800; }
.hb-nav a:hover { color: var(--purple); text-decoration: underline; }
.hb-section { padding: 68px 0; border-bottom: 1px solid var(--line); }
.hb-heading { margin-bottom: 32px; }
.hb-heading-wide { max-width: none; }
.hb-heading p { margin-top: 12px; color: var(--muted); }
.hb-setup { margin: 0; padding: 0; list-style: none; counter-reset: setup; display: grid; grid-template-columns: repeat(var(--hb-setup-cols, 5), minmax(0, 1fr)); gap: 25px; }
.hb-setup li { counter-increment: setup; position: relative; }
.hb-setup li::before { content: counter(setup); display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; border-radius: 50%; color: var(--purple); background: var(--purple-soft); font-weight: 900; font-variant-numeric: tabular-nums; }
.hb-setup li:not(:last-child)::after { content: ''; position: absolute; top: 21px; left: 54px; right: -12px; height: 1px; background: var(--line); }
.hb-setup p { margin-top: 10px; color: var(--muted); font-size: .93rem; }
.hb-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 28px; padding: 18px 22px; background: var(--purple-soft); border-radius: 12px; font-size: .94rem; }
.hb-note .hb-icon { color: var(--purple); margin-top: 2px; }
.hb-note p { flex: 1; min-width: 0; }
.hb-path { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; }
.hb-path li { padding: 22px 16px 24px; border-top: 3px solid var(--purple); background: var(--purple-soft); position: relative; }
.hb-path li:nth-child(-n+3) { background: var(--green-soft); border-color: var(--green); }
.hb-path li + li { border-left: 1px solid var(--bg); }
.hb-path .hb-level { display: block; font-size: .8rem; font-weight: 900; color: var(--purple); margin-bottom: 15px; }
.hb-path li:nth-child(-n+3) .hb-level { color: var(--green); }
.hb-path h3 { min-height: 2.6em; font-size: 1.04rem; }
.hb-path p { margin-top: 10px; font-size: .88rem; }
.hb-plan-labels { display: grid; grid-template-columns: 1fr 1fr; margin-top: 12px; font-size: .85rem; font-weight: 900; }
.hb-plan-labels span { text-align: center; color: var(--purple); }
.hb-plan-labels span:first-child { color: var(--green); }
.hb-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.hb-split p { margin-top: 10px; color: var(--muted); }
.hb-detail { border-bottom: 1px solid var(--line); }
.hb-detail summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; min-height: 52px; cursor: pointer; list-style: none; font-weight: 800; }
.hb-detail summary::-webkit-details-marker { display: none; }
.hb-detail summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--purple); border-bottom: 2px solid var(--purple); transform: rotate(45deg); flex-shrink: 0; margin-right: 5px; }
.hb-detail[open] summary::after { transform: rotate(225deg); }
.hb-detail summary:hover { color: var(--purple); }
.hb-detail-body { padding: 0 0 22px; color: var(--muted); }
.hb-detail-body > * + * { margin-top: 12px; }
.hb-detail-body ul, .hb-detail-body ol { margin-bottom: 0; padding-left: 24px; }
.hb-detail-body li + li { margin-top: 8px; }
.hb-details { margin-top: 24px; }
.hb-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.hb-mode { padding: 25px 0; border-top: 1px solid var(--line); }
.hb-mode-title { display: flex; align-items: flex-start; gap: 12px; }
.hb-mode-title .hb-icon { color: var(--purple); }
.hb-mode h3 { flex: 1; }
.hb-tag { color: var(--purple); background: var(--purple-soft); padding: 3px 9px; border-radius: 6px; font-size: .75rem; font-weight: 900; white-space: nowrap; }
.hb-tag-free { color: var(--green); background: var(--green-soft); }
.hb-mode > p { margin-top: 14px; }
.hb-mode .hb-trains { color: var(--muted); font-size: .92rem; margin-top: 7px; }
.hb-mode .hb-detail { border-bottom: 0; margin-top: 4px; font-size: .92rem; }
.hb-mode .hb-detail summary { padding-bottom: 0; min-height: 44px; }
.hb-mode .hb-detail[open] summary { padding-bottom: 12px; }
.hb-mode .hb-detail-body { padding-bottom: 0; }
.hb-workflow { margin: 0 0 34px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(var(--hb-workflow-cols, 4), minmax(0, 1fr)); background: var(--purple-soft); border-radius: var(--radius); }
.hb-workflow li { padding: 24px; }
.hb-workflow li + li { border-left: 1px solid var(--line); }
.hb-workflow strong { display: block; font-size: 1.2rem; margin-bottom: 8px; }
.hb-workflow p { font-size: .93rem; }
.hb-signals { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin: 22px 0 0; }
.hb-signals > div { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.hb-signals dt { font-weight: 900; }
.hb-signals dd { margin: 0; color: var(--muted); font-size: .93rem; }
.hb-score { margin: 0; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.hb-score figcaption { font-size: .9rem; color: var(--muted); margin-bottom: 24px; }
.hb-score-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; list-style: none; padding: 0; margin: 0; }
.hb-score-track li { text-align: center; font-size: .86rem; }
.hb-score-mark { display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 66px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 1.15rem; font-weight: 900; margin-bottom: 8px; }
.hb-score-mark.retry { background: var(--amber-soft); color: var(--amber); }
.hb-score-result { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
.hb-score-result strong { display: block; font-size: 1.2rem; }
.hb-score-result p { color: var(--muted); margin-top: 5px; }
.hb-checkpoint { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; margin-top: 40px; }
.hb-checkpoint h3 { font-size: 1.5rem; }
.hb-checkpoint p { margin-top: 10px; color: var(--muted); }
.hb-checkpoint-spec { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; font-weight: 900; color: var(--purple); }
.hb-checkpoint .hb-details { margin-top: 0; }
.hb-table { width: 100%; border-collapse: collapse; }
.hb-table caption { text-align: left; color: var(--muted); margin-bottom: 20px; }
.hb-table th { text-align: left; font-size: .88rem; color: var(--purple); background: var(--purple-soft); }
.hb-table th, .hb-table td { padding: 18px 22px; vertical-align: top; border-bottom: 1px solid var(--line); }
.hb-table tbody th { background: transparent; color: var(--ink); font-size: 1rem; width: 27%; }
.hb-table td { color: var(--muted); }
.hb-table td strong { color: var(--ink); }
/* A five-column table (the rank ladder) is wider than a phone; let it scroll sideways inside its own box rather than the page. */
.hb-table-wrap { overflow-x: auto; margin: 22px 0 8px; }
.hb-table-wrap .hb-table { min-width: 640px; }
/* A narrow table (the App score points table) that fits a phone without a sideways scroll. */
.hb-table-wrap .hb-table.hb-table-compact { min-width: 0; }
.hb-table-wrap .hb-table.hb-table-compact th, .hb-table-wrap .hb-table.hb-table-compact td { padding: 10px 8px; }
.hb-table-wrap .hb-table th, .hb-table-wrap .hb-table td { padding: 12px 14px; font-size: .92rem; }
.hb-table-wrap .hb-table tbody th { width: auto; white-space: nowrap; }
.hb-quickstart { margin-top: 44px; padding: 32px; background: var(--purple-soft); border-radius: var(--radius); }
.hb-quickstart h3 { font-size: 1.4rem; }
.hb-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 30px; list-style: none; padding: 0; margin: 22px 0 0; }
.hb-checklist li { display: flex; align-items: flex-start; gap: 10px; }
.hb-checklist .hb-icon { color: var(--purple); margin-top: 2px; width: 20px; height: 20px; }
.hb-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; padding: 40px 0 50px; font-size: .9rem; }
.hb-footer p + p { margin-top: 8px; color: var(--muted); }
.hb-footer nav { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.hb-footer nav a { min-height: 44px; display: inline-flex; align-items: center; }
/* Short links like "Help" and "Terms" were 31-40px wide: pad them to a finger-sized target. */
.hb-nav a, .hb-footer nav a { padding: 0 8px; min-width: 44px; justify-content: center; }
/* "Back to app" at the top and bottom of every handbook (they are long on a phone). */
.hb-back { margin: 14px 0 0; }
.hb-back-bottom { margin: 28px 0 8px; }
.hb-back a { display: inline-flex; align-items: center; min-height: 44px; color: var(--purple); font-weight: 800; text-decoration: none; }
@media print { .hb-back { display: none; } }
/* Feature walkthroughs: a short intro, then numbered cards, each with a
   real phone capture (390px wide, 2x). Same card language as the beta page's
   dashboard steps. Three across on a wide screen, two on a tablet, one on a
   phone. Images sit at the top of the card so uneven text lengths don't
   leave holes. */
.hb-feature { margin-top: 44px; }
.hb-feature:first-of-type { margin-top: 0; }
.hb-feature > h3 { font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.hb-feature > h3 .hb-emoji { font-size: 1.15em; }
.hb-feature > p { margin-top: 8px; color: var(--muted); }
.hb-shots { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: shot; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.hb-shots li { counter-increment: shot; display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.hb-shots h4 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1rem; }
.hb-shots h4::before { content: counter(shot); flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--purple); background: var(--purple-soft); font-weight: 900; font-size: .9rem; font-variant-numeric: tabular-nums; }
.hb-shots p { margin: 0; color: var(--muted); font-size: .93rem; }
.hb-shots figure { margin: 0; }
.hb-shots img { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(41, 38, 55, .10); }
.hb-shots figcaption { margin-top: 8px; text-align: center; color: var(--muted); font-size: .8rem; }
@media (max-width: 960px) { .hb-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .hb-shots { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .hb-hero { gap: 32px; }
    .hb-setup { grid-template-columns: 1fr; gap: 24px; }
    .hb-setup li { padding-left: 64px; }
    .hb-setup li::before { position: absolute; left: 0; top: 0; }
    .hb-setup li:not(:last-child)::after { top: 52px; bottom: -12px; left: 21px; width: 1px; height: auto; right: auto; }
    .hb-setup p { margin-top: 6px; }
    .hb-path { grid-template-columns: repeat(3, 1fr); gap: 2px; }
    .hb-plan-labels { display: none; }
    .hb-signals > div { grid-template-columns: 115px 1fr; gap: 12px; }
    .hb-workflow li { padding: 20px 16px; }
}
@media (max-width: 620px) {
    .hb-shell { width: calc(100% - 40px); }
    .hb-top { padding: 16px 0; gap: 12px; flex-wrap: wrap; }
    .hb-brand { font-size: 1rem; gap: 7px; }
    .hb-tools { gap: 10px; }
    .hb-tools a { font-size: .82rem; }
    .hb-tools .hb-app-link .hb-icon { display: none; }
    .hb-theme { width: 44px; padding: 10px; justify-content: center; }
    .hb-theme span { display: none; }
    .hb-hero { grid-template-columns: 1fr; padding: 42px 0 28px; gap: 28px; }
    h1 { font-size: clamp(2.55rem, 10vw, 3.4rem); }
    .hb-intro { margin-top: 18px; font-size: 1rem; }
    .hb-cycle { padding: 0; }
    .hb-cycle li { padding: 12px 0; gap: 10px; grid-template-columns: 32px 1fr; }
    .hb-cycle .hb-icon { width: 24px; height: 24px; }
    .hb-cycle strong { font-size: 1rem; }
    .hb-cycle p { font-size: .88rem; }
    .hb-nav { gap: 0 20px; padding: 10px 0; }
    .hb-nav a { font-size: .84rem; }
    .hb-section { padding: 44px 0; }
    .hb-heading { margin-bottom: 26px; }
    .hb-note { padding: 16px; }
    .hb-path { grid-template-columns: 1fr; gap: 0; }
    .hb-path li { padding: 18px 20px; border-top-width: 1px; }
    .hb-path li + li { border-left: 0; }
    .hb-path .hb-level { margin-bottom: 6px; }
    .hb-path h3 { min-height: 0; font-size: 1.12rem; }
    .hb-path p { margin-top: 5px; font-size: .93rem; }
    .hb-split, .hb-mode-grid, .hb-checkpoint, .hb-signals { grid-template-columns: 1fr; gap: 24px; }
    .hb-mode-grid, .hb-signals { gap: 0; }
    .hb-signals > div { grid-template-columns: 115px 1fr; }
    .hb-workflow { grid-template-columns: 1fr; }
    .hb-workflow li { padding: 20px; }
    .hb-workflow li + li { border-left: 0; border-top: 1px solid var(--line); }
    .hb-score { padding: 20px 16px; }
    .hb-score-track { gap: 7px; }
    .hb-score-track li { font-size: .75rem; }
    .hb-score-mark { flex-direction: column; gap: 0; min-height: 68px; font-size: 1rem; }
    .hb-score-mark .hb-icon { width: 18px; height: 18px; }
    .hb-score-result { grid-template-columns: 1fr; gap: 20px; }
    .hb-table th, .hb-table td { padding: 15px 10px; }
    .hb-table tbody th { width: 33%; font-size: .92rem; }
    .hb-table td { font-size: .93rem; }
    .hb-quickstart { padding: 24px 20px; }
    .hb-checklist { grid-template-columns: 1fr; }
    .hb-footer { flex-direction: column; gap: 16px; }
}
@media print {
    :root, html[data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --ink: #191919; --muted: #444; --purple: #49389d; --purple-soft: #f1eff8; --line: #ccc; --green: #245d3f; --green-soft: #edf5ef; --amber: #704716; --amber-soft: #faf2e6; }
    body { font-size: 11pt; }
    .hb-shell { width: 100%; }
    .hb-tools, .hb-nav, .hb-skip { display: none !important; }
    .hb-hero { padding: 24px 0; }
    h1 { font-size: 30pt; }
    h2 { font-size: 22pt; }
    .hb-section { padding: 26px 0; }
    .hb-detail, .hb-mode, .hb-score, .hb-setup li, tr { break-inside: avoid; }
    h2, h3, summary { break-after: avoid; }
    details > * { display: block !important; }
    details::details-content { content-visibility: visible; height: auto; }
    .hb-detail summary::after { display: none; }
    .hb-detail-body { padding-top: 10px; }
    a { color: inherit; }
}
