:root {
  --accent: #E60000;
  --accent-dark: #c20000;
  --accent-tint: #fdecec;
  --ink: #212529;
  --muted: #5f666d;
  --bg: #f4f6f9;
  --border: #c2c8cf;
  --success-bg: #d4edda;
  --success-text: #155724;
  --success: #2e9e4f;
  --warning-bg: #fff3cd;
  --warning: #c89b04;
  --warning-text: #856404;
  /* Fixed score buckets — anchors mirror _COLOUR_STOPS in routes/results.py; keep in sync. */
  --score-neg: #d9534f;        /* red */
  --score-zero: #e0a800;       /* amber — fills/markers */
  --score-zero-text: #b8860b;  /* darker amber — legible as text on light */
  --score-pos: #1e7e34;        /* green */
  --radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-y: scroll; }
body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; color: var(--ink); background: var(--bg); line-height: 1.6; overflow-x: hidden; }
header { background: var(--ink); color: white; padding: 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: #484848 15px solid; }
header h1 { font-size: 20px; font-weight: 700; }
@media (max-width: 560px) { header { padding: 8px; } .header-title { display: none; } }
@media (max-width: 480px) { .status-row, .title-row { flex-direction: column; align-items: flex-start !important; gap: 10px; } }
.header-logout { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid rgba(255,255,255,0.4); padding: 7px 16px; border-radius: 5px; white-space: nowrap; transition: background-color 0.15s, border-color 0.15s; }
.header-logout svg { width: 1.1em; height: 1.1em; flex-shrink: 0; }
button.header-logout { background: transparent; font-family: inherit; cursor: pointer; }
.header-logout:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.7); color: #fff; }
.container { max-width: 860px; margin: 40px auto; padding: 0 20px 60px; }
.page-landing .container { margin-bottom: 0; }
h2 { font-size: 22px; margin-bottom: 8px; color: var(--ink); }
h3 { font-size: 17px; color: var(--ink); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
.back-link { display: inline-block; margin-bottom: 16px; color: var(--ink); font-size: 14px; }
.back-link:hover { color: var(--accent); }
.text-muted { color: var(--muted); }
.card { background: white; border-radius: var(--radius); padding: 32px; box-shadow: 0 4px 8px rgba(0,0,0,0.06); margin-bottom: 24px; }
.card-title { font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.error-banner { background: #fde8e8; border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; color: #a31515; }
/* status notices — green for success, amber for warnings (mirror .error-banner) */
.notice { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; font-size: 14px; border-left: 4px solid; }
.notice-success { background: var(--success-bg); border-left-color: var(--success); color: var(--success-text); }
.notice-warning { background: var(--warning-bg); border-left-color: var(--warning); color: var(--warning-text); }
label { display: block; font-weight: 700; margin-bottom: 4px; margin-top: 16px; font-size: 15px; }
.card label:first-child { margin-top: 0; }
.req { color: var(--accent); margin-left: 2px; }
input[type=text], input[type=email], select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 5px; font-size: 15px; font-family: inherit; background: white; }
input[type=text]:focus, input[type=email]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,0,0,0.15); }
/* custom chevron — the native one sits flush against the right edge, which looks stranded on full-width selects */
select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #484848; color: white; padding: 10px 24px; border: none; border-radius: 5px; font-size: 15px; font-family: inherit; line-height: normal; cursor: pointer; margin-top: 24px; text-decoration: none; transition: background-color 0.15s, box-shadow 0.15s; }
.btn svg { width: 1.1em; height: 1.1em; flex-shrink: 0; }
.btn:hover { background: #2e2e2e; color: white; }
.btn:focus-visible { outline: 3px solid rgba(72,72,72,0.35); outline-offset: 2px; }
.btn-secondary { background: #076a9c; color: white; border: none; }
.btn-secondary:hover { background: #055a87; color: white; }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #000; }
.btn-danger { background: white; color: var(--accent); border: 1px solid var(--accent); }
.btn-danger:hover { background: var(--accent); color: white; }
.btn-sm { padding: 8px 16px; font-size: 14px; margin-top: 0; }
.btn:disabled { opacity: 0.85; cursor: default; }
/* in-flight spinner for submit buttons (Save, Submit All Responses) */
.btn-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%; animation: btn-spin 0.6s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-spinner { animation: none; } }
.domain-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
@media (max-width: 560px) { .domain-chips { grid-template-columns: repeat(2, 1fr); } }
.meter { background: #e9ecef; border-radius: 20px; height: 12px; overflow: hidden; margin: 8px 0 4px; }
.meter-fill { background: var(--success); height: 100%; border-radius: 20px; transition: width 0.3s ease; }
.option { display: flex; gap: 13px; align-items: flex-start; padding: 8px 12px; border-radius: 8px; border: 1px solid #dde0e4; font-weight: 400; cursor: pointer; transition: background-color 0.12s, border-color 0.12s; margin-top: 0; }
.option:not(.readonly):hover { background: #f7f8fa; border-color: var(--border); }
.option input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-dot { width: 20px; height: 20px; border: 2px solid #c2c8cf; border-radius: 50%; flex-shrink: 0; margin-top: 2px; position: relative; transition: border-color 0.12s; }
.option input:checked ~ .radio-dot, .radio-dot.checked { border-color: var(--accent); }
.option input:checked ~ .radio-dot::after, .radio-dot.checked::after { content: ""; position: absolute; top: 3px; left: 3px; right: 3px; bottom: 3px; border-radius: 50%; background: var(--accent); }
.option input:focus-visible ~ .radio-dot { box-shadow: 0 0 0 3px rgba(230,0,0,0.18); }
.option:has(input:checked), .option.selected { background: var(--accent-tint); border-color: var(--accent); }
.option.readonly { cursor: default; }
.score-num { font-weight: 700; color: var(--accent); margin-right: 6px; }
/* info "i" button + its popover (e.g. the Sharing card) */
.info-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: none; padding: 2px; cursor: pointer; color: var(--muted); transition: color 0.12s; }
.info-btn svg { width: 17px; height: 17px; }
.info-btn:hover { color: var(--ink); }
.info-btn:focus-visible { outline: 3px solid rgba(33,37,41,0.3); outline-offset: 2px; border-radius: 50%; }
.info-pop { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 100; width: min(340px, 80vw); background: white; border: 1px solid #dee2e6; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 14px 16px; font-size: 13.5px; font-weight: 400; color: #555; line-height: 1.55; }
/* dashed empty-state box (e.g. "not shared with anyone yet") */
.empty-state { display: flex; align-items: center; justify-content: center; gap: 8px; background: #f8f9fa; border: 1px dashed var(--border); border-radius: 8px; padding: 16px; color: var(--muted); font-size: 14px; }
.empty-state svg { width: 17px; height: 17px; flex-shrink: 0; }
/* landing sections */
.section { margin-top: 56px; }
/* fsm-style landing type: display-6 titles, light 20px leads */
.section-title { font-size: clamp(26px, 1.375rem + 1.5vw, 40px); font-weight: 300; line-height: 1.2; margin-bottom: 8px; }
.section-lead { color: var(--muted); font-size: 20px; font-weight: 300; margin-bottom: 20px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.step { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 22px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.step h4 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; }
.faq { background: white; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.faq summary { padding: 18px 20px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 24px; font-weight: 400; line-height: 1; flex-shrink: 0; }
.faq[open] summary::after { content: "\2013"; }
.faq-body { padding: 0 18px 16px; color: #444; }
.quote { border-left: 4px solid var(--accent); padding: 4px 0 4px 16px; margin: 18px 0; color: #333; }
.quote p { font-style: italic; }
.quote cite { display: block; font-style: normal; font-weight: 700; color: var(--muted); font-size: 13px; margin-top: 8px; }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 12px; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
/* testimonial carousel */
.testimonial-card { margin-bottom: 0; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
@media (max-width: 560px) { .testimonial-card { padding: 20px; } }
.carousel { position: relative; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: center; padding: 4px; }
.carousel-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 10px; }
.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.carousel-arrow { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.12s, border-color 0.12s; }
.carousel-arrow:hover { background: #f1f3f6; border-color: #b9c0c8; }
.carousel-arrow:focus-visible { outline: 3px solid rgba(230,0,0,0.35); outline-offset: 2px; }
.carousel-dots { display: flex; gap: 8px; align-items: center; }
.carousel-dots button { width: 9px; height: 9px; border-radius: 50%; border: none; background: #c2c8cf; cursor: pointer; padding: 0; transition: background-color 0.12s, transform 0.12s; }
.carousel-dots button.active { background: var(--accent); transform: scale(1.2); }
/* gradient hero — fsm.lgfl.net style (soft red, big light heading, wave below) */
.hero-gradient { background: linear-gradient(to bottom, #d52c2c, #dd5757); color: #fff; text-align: center; padding: 80px 20px 50px; position: relative; }
@media (max-width: 1024px) { .hero-gradient { padding: 70px 15px 50px; } }
@media (max-width: 768px) { .hero-gradient { padding: 50px 10px 30px; } }
@media (max-width: 480px) { .hero-gradient { padding: 35px 10px 30px; } }
.hero-inner { max-width: 800px; margin: 0 auto; text-wrap: balance; }
.hero-image { opacity: .75; margin-top: 40px; margin-bottom: 80px; height: 300px; max-width: 100%; object-fit: contain; }
@media (max-width: 1366px) { .hero-image { height: 225px; margin-top: 30px; margin-bottom: 50px; } }
@media (max-width: 1024px) { .hero-image { height: 200px; margin-top: 20px; margin-bottom: 50px; } }
@media (max-width: 768px) { .hero-image { height: 180px; margin-top: 15px; margin-bottom: 50px; } }
@media (max-width: 480px) { .hero-image { height: 160px; margin-top: 10px; margin-bottom: 50px; } }
.hero-gradient h1 { font-size: clamp(30px, 1.475rem + 2.7vw, 56px); font-weight: 300; margin-bottom: 12px; line-height: 1.2; }
.hero-lead { font-size: 20px; font-weight: 300; opacity: 0.95; max-width: 580px; margin: 0 auto 16px; }
/* layered wave dividers (svg markup lives in landing.html, copied from fsm.lgfl.net) */
.wave-container { position: absolute; bottom: 0; left: 0; width: 100%; overflow: hidden; line-height: 0; transform: rotate(180deg); }
.wave-container svg { position: relative; display: block; width: calc(100% + 1.3px); height: 70px; }
.wave-container .shape-fill { fill: #f9f9f9; } /* must match the top of the .landing-bg gradient */
.footer-wave-container { position: relative; width: 100%; overflow: hidden; line-height: 0; margin-bottom: -2px; background-color: #dcdcdc; } /* bottom of the .landing-bg gradient */
.footer-wave-container svg { position: relative; display: block; width: calc(100% + 1.3px); height: 70px; }
/* subtle card gradient, fsm-style */
.step { background: linear-gradient(to bottom, #ffffff, #f7f8fa); }
/* dark gradient footer (matches fsm.lgfl.net) */
.site-footer { background: linear-gradient(to bottom, #1f1f1f, #000); color: #fff; text-align: center; padding: 48px 20px; }
.site-footer a { color: #fff; }
.footer-logo { display: inline-block; margin-bottom: 4px; }
.footer-logo img { height: 120px; }
.footer-reg { font-weight: 300; font-size: 13px; line-height: 1.65; opacity: 0.85; max-width: 660px; margin: 0 auto 16px; }
.footer-links { font-size: 14px; margin-bottom: 20px; }
.footer-links a { text-decoration: underline; }
.footer-social-label { font-size: 14px; margin-bottom: 12px; }
.social-icons { display: flex; gap: 16px; justify-content: center; }
.social-icons img { height: 30px; width: 30px; transition: transform 0.15s; }
.social-icons a:hover img { transform: translateY(-2px); }
/* buttons for coloured backgrounds (hero + dark CTA) */
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.hero-actions .btn { margin-top: 0; padding: 12px 32px; font-size: 16px; }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
.btn-light:hover { background: #eee; color: var(--ink); }
.btn-charcoal { background: #484848; color: #fff; border: 1px solid var(--ink); }
.btn-charcoal:hover { background: var(--ink); color: #fff; }
/* floating scroll-to-top / scroll-to-bottom buttons */
.scroll-fab { width: 44px; height: 44px; border: none; border-radius: 50%; background: var(--ink); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.3); display: none; align-items: center; justify-content: center; padding: 0; transition: background-color 0.15s; }
.scroll-fab:hover { background: #000; }
.scroll-fab:focus-visible { outline: 3px solid rgba(33,37,41,0.4); outline-offset: 2px; }
/* landing sections on a single fsm-style gradient (bands are transparent) */
.landing-bg { position: relative; left: 50%; width: 100vw; margin-left: -50vw; margin-top: -40px; margin-bottom: -60px; background: linear-gradient(to bottom, #f9f9f9, #dcdcdc); }
.band { padding: 52px 20px; }
.band-inner { max-width: 920px; margin: 0 auto; }
#how .band-inner { max-width: 820px; }
.band .section-lead { margin-bottom: 20px; }

/* ===== Domain question form (domain.html) ===== */
.sticky-actions { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #e0e0e0; box-shadow: 0 -2px 10px rgba(0,0,0,0.08); z-index: 100; padding: 12px 20px; }
.sticky-actions-inner { max-width: 860px; margin: 0 auto; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.sticky-scroll { display: flex; gap: 8px; margin-left: auto; }
/* when the answered-count is present (edit mode) it owns the right-push, so the scroll group just sits beside it */
.q-count ~ .sticky-scroll { margin-left: 0; }
/* ghost/secondary scroll arrows — recede behind the Save CTA */
.sticky-scroll .scroll-fab { display: flex; width: 36px; height: 36px; box-shadow: none; background: transparent; border: 1px solid var(--border); color: var(--muted); }
.sticky-scroll .scroll-fab:hover { background: rgba(33,37,41,0.06); border-color: var(--muted); color: var(--ink); }
/* answered-question count + "show only unanswered" toggle */
.q-count { display: inline-flex; align-items: center; margin-left: auto; font-size: 14px; line-height: 1; color: var(--muted); white-space: nowrap; }
.q-toggle { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; line-height: 1; color: var(--ink); cursor: pointer; user-select: none; white-space: nowrap; }
.q-toggle input { width: 16px; height: 16px; margin: 0; cursor: pointer; }
/* collapsed (answered) question summary row */
.q-card { transition: padding 0.7s ease; }
.q-card .q-summary { display: none; width: 100%; background: none; border: 0; padding: 0; margin: 0; font: inherit; text-align: left; cursor: pointer; align-items: center; gap: 12px; color: var(--ink); }
.q-card.collapsed { padding: 16px 20px; margin-bottom: 12px; }
.q-card.collapsed .q-summary { display: flex; animation: q-summary-in 0.7s ease both; }
@keyframes q-summary-in { from { opacity: 0; } to { opacity: 1; } }
/* soften the close: animate the body's height (grid-rows 1fr→0fr) and fade it, instead of an instant display:none swap */
.q-collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.7s ease, opacity 0.5s ease; }
.q-collapse > .q-body { overflow: hidden; min-height: 0; }
.q-card.collapsed .q-collapse { grid-template-rows: 0fr; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .q-card, .q-collapse { transition: none; }
  .q-card.collapsed .q-summary { animation: none; }
}
.q-summary:hover .q-summary-text { text-decoration: underline; text-decoration-color: var(--border); }
.q-summary-text { flex: 1; font-weight: 600; }
.q-summary-score { flex-shrink: 0; font-weight: 700; font-size: 16px; min-width: 1.4em; text-align: center; }
.q-summary-edit { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.q-hidden { display: none !important; }

/* ===== Results page (results.html) ===== */
.results-bar { position: relative; margin-top: 8px; }
.results-bar .meter { height: 16px; margin: 0; }
/* dotted midpoint (score 0) */
.mid-marker { position: absolute; top: -3px; bottom: -3px; left: 50%; border-left: 2px dotted #9aa3ad; }
/* all-schools average — solid line with a small pin on top (line + triangle share one centre) */
.avg-marker { position: absolute; top: -5px; bottom: -3px; width: 22px; transform: translateX(-50%); cursor: help; }
.avg-marker::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: #1f1f1f; }
.avg-marker::before { content: ""; position: absolute; left: 50%; top: -1px; transform: translateX(-50%); border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #1f1f1f; }
/* summary card — two-column hero (overall score | takeaways); stacks on narrow */
.summary-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 28px; align-items: center; }
.summary-takeaways { border-left: 1px solid #eee; padding-left: 28px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 560px) {
  .summary-grid { grid-template-columns: 1fr; gap: 20px; }
  .summary-takeaways { border-left: 0; padding-left: 0; border-top: 1px solid #eee; padding-top: 20px; }
}
/* answers section (separate card, with score filter) */
.answer-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; }
.fbtn { border: 1px solid var(--border); background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 14px; cursor: pointer; }
.fbtn:hover { filter: brightness(0.97); }
.fbtn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
/* score-coloured filter buttons (echo the bar colours) */
.fbtn[data-score="-2"], .fbtn[data-score="-1"] { color: var(--score-neg); border-color: #ecc3c0; }
.fbtn[data-score="0"] { color: var(--score-zero-text); border-color: #e8d7a3; }
.fbtn[data-score="1"], .fbtn[data-score="2"] { color: var(--score-pos); border-color: #bcdcc6; }
.fbtn[data-score="-2"].active, .fbtn[data-score="-1"].active { background: var(--score-neg); border-color: var(--score-neg); color: #fff; }
.fbtn[data-score="0"].active { background: var(--score-zero); border-color: var(--score-zero); color: #1f1f1f; }
.fbtn[data-score="1"].active, .fbtn[data-score="2"].active { background: var(--score-pos); border-color: var(--score-pos); color: #fff; }
.answer-domain { border-top: 1px solid #eee; }
.answer-domain > summary { padding: 13px 0; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.answer-domain > summary::-webkit-details-marker { display: none; }
.answer-domain > summary::after { content: "\25be"; color: var(--muted); }
.answer-domain[open] > summary::after { content: "\25b4"; }
.answer-list { padding-bottom: 10px; }
.answer-row { padding: 14px 0; border-top: 1px solid #f0f0f0; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start; }
.answer-main { min-width: 0; }
/* score badge — the visual anchor for each answer, colour-coded by score */
.score-badge { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.score-badge.s-pos { background: #e7f4ec; color: var(--score-pos); }
.score-badge.s-neg { background: #fbeae9; color: var(--score-neg); }
.score-badge.s-zero { background: #fbf3da; color: var(--score-zero-text); }
.answer-q { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.answer-a { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.answer-median { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.median-compare { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; padding: 4px 11px; border-radius: 11px; }
/* Only the per-answer badges carry the median tooltip (the overall card reuses
   .median-compare without one), so scope the help cursor to those. */
.answer-median .median-compare { cursor: help; }
.median-compare.above { color: var(--score-pos); background: #e7f4ec; }
.median-compare.below { color: var(--score-neg); background: #fbeae9; }
.median-compare.same { color: var(--muted); background: #f1f3f5; }
/* Folded into the .median-compare badge tooltip on screen; revealed in print
   (see @media print) so the PDF still carries the peer-median figure. */
.median-label { display: none; color: var(--muted); white-space: nowrap; }
.median-label strong { color: var(--ink); }
.adcount { font-weight: 400; font-size: 13px; }
/* Same affordance as the .guidance-link pill in the focus list (book icon,
   soft red) — a compact labelled pill that sits inline on the answer's
   meta footer, next to the peer-comparison info. */
.answer-help { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 12px; border: 1px solid #ecc3c0; background: #fff; color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 0.12s, color 0.12s, border-color 0.12s; }
.answer-help:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-tint); }
.answer-help svg { width: 13px; height: 13px; flex-shrink: 0; }
/* share modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.modal-overlay[hidden] { display: none; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 28px; max-width: 460px; width: 100%; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--ink); }
/* quiet text-buttons for the sharing line under the title */
.link-btn { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.link-btn:hover { color: var(--accent-dark); text-decoration: underline; }

/* ===== Results focus list (_results_focus.html) ===== */
/* Mirrors the answers list: a badge anchors each row, content beside it,
   and only two small type sizes (14px question, 12px everything else). */
.focus-item { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-top: 1px solid #f0f0f0; list-style: none; }
.focus-item:last-child { padding-bottom: 0; }
.focus-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.focus-domain { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.focus-q { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.45; margin-top: 2px; }
.focus-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.focus-meta strong { color: var(--ink); }
.guidance-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent); background: #fff; border: 1px solid #ecc3c0; border-radius: 12px; padding: 2px 10px; text-decoration: none; transition: background-color 0.12s, border-color 0.12s; }
.guidance-link:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-dark); }
.guidance-link svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ===== Compare page (compare.html) ===== */
/* Bars, badges, filter buttons and the collapsible domain sections reuse the
   results-page classes above; this block is just the two-column chrome. */
/* Picker: the two selects share the card's full width (the button sits on its
   own row below), so long "School — Name · DTT-00047 · 12 Mar 2026" labels fit. */
.compare-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 20px; }
.compare-picker-actions { grid-column: 1 / -1; margin-top: 16px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.compare-bar-row { display: grid; grid-template-columns: minmax(72px, 190px) 1fr 74px; gap: 12px; align-items: center; margin-top: 8px; }
.compare-bar-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-bar-label strong { color: var(--ink); }
.compare-bar-value { text-align: right; white-space: nowrap; font-size: 14px; }
/* Muted "no answer recorded" badge — the drift case where a question only
   existed for one of the two assessments. */
.score-badge.s-none { background: #f1f3f5; color: var(--muted); font-weight: 600; cursor: help; }
.compare-cols { display: grid; grid-template-columns: 34px 34px 1fr; column-gap: 10px; padding: 8px 0 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.compare-cols span { text-align: center; }
.compare-row { padding: 12px 0; border-top: 1px solid #f0f0f0; display: grid; grid-template-columns: 34px 34px minmax(0, 1fr); column-gap: 10px; align-items: start; }
.compare-q { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.compare-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; font-size: 12px; }
@media (max-width: 560px) {
  .compare-picker { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; gap: 16px; }
  .compare-bar-row { grid-template-columns: minmax(60px, 110px) 1fr 60px; gap: 8px; }
}

/* ===== Print / Save-as-PDF (results page): a clean, fileable one-off report ===== */
@media print {
  @page { margin: 16mm; }
  /* Keep the coloured maturity bars, median pills and score colours — browsers
     drop background graphics by default. */
  body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Drop interactive / navigation chrome. */
  header,
  .no-print,
  .modal-overlay,
  .answer-filter,
  .answer-help,
  .answer-domain > summary::after,
  a[href="/retrieve"] { display: none !important; }
  /* Flatten cards for paper; avoid splitting a card or a single answer across pages. */
  .card { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; }
  #answers-card { break-inside: auto; }          /* long list may span pages */
  #compare-answers { break-inside: auto; }
  .answer-row, .compare-row { break-inside: avoid; }
  .answer-domain > summary { cursor: default; }
  .median-label { display: inline; }            /* tooltip can't print — show the figure */
  .adcount { display: none !important; }
}

