@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ===========================================================
   AMS Interventions — visual system
   Shares the palette and typefaces of the AMS Planning Hub.

   House rules (these are what keep it from drifting):
     1. Radius: 0. No rounded corners anywhere.
     2. No enclosures. Nothing gets a full border. Separation
        comes from hairlines, ground shift, and space.
     3. Colour is a mark, not a container. Tier is a short bar.
     4. One rule weight: 1px hairlines. 3px only where something
        genuinely escalates (the safety referral).
     5. Type does the hierarchy. Fraunces names things,
        Outfit says everything else.
   =========================================================== */

:root {
    /* Palette — shared with the Planning Hub */
    --navy:   #1B2D45;
    --navy-d: #14223A;
    --gold:   #B8893B;
    --gold-l: #E8C88A;
    --warm:   #C75B2A;
    --warm-d: #A4462C;
    --sage:   #4A6741;
    --purple: #6B4C8A;

    --cream:  #F5F0E8;
    --paper:  #FEFCF8;
    --ink:    #1A1A1A;
    --muted:  #5C564E;
    --faint:  #8B8379;
    --line:   #D6CFC3;
    --line-2: #E4DED4;
    --white:  #FFFFFF;

    /* Tier identity — navy -> terracotta -> purple reads as
       escalation. The old blue/orange/green read as a traffic
       light and put the crisis pathway in lime green. */
    --tier1-color: #1B2D45;
    --tier2-color: #C75B2A;
    --tier3-color: #6B4C8A;
    --tier1-rgb: 27, 45, 69;
    --tier2-rgb: 199, 91, 42;
    --tier3-rgb: 107, 76, 138;
    --t1-ink: #1B2D45;
    --t2-ink: #A4462C;
    --t3-ink: #594073;

    /* Ordered data scales — navy is on grade, terracotta is below, and the
       split between them is the boundary. Deliberately not a traffic light:
       see house rule 3. Every step clears 3:1 against --cream (14.03, 4.88,
       3.73, 5.30, 8.09), the WCAG floor for non-text. Adjacent steps are
       weaker than that, so stacked segments keep a 2px gap and let the
       ground do the separating. */
    --scale-on-2:  #14223A;
    --scale-on-1:  #4A6B8F;
    --scale-bel-1: #C75B2A;
    --scale-bel-2: #A4462C;
    --scale-bel-3: #7E2E14;

    /* Per-page accent, set by body.tier-N */
    --tier-accent: #1B2D45;
    --tier-accent-ink: #1B2D45;

    --accent-color: #A4462C;
    --success-color: #4A6741;

    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans:  'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Kept so any stray legacy reference still resolves */
    --text-dark: #1A1A1A;
    --text-medium: #5C564E;
    --text-light: #8B8379;
    --bg-light: #F5F0E8;
    --bg-lighter: #FEFCF8;
    --border-color: #D6CFC3;
    --border-light: #E4DED4;
    --radius: 0;
    --radius-sm: 0;
    --radius-lg: 0;
}

body.tier-1 { --tier-accent: var(--tier1-color); --tier-accent-ink: var(--t1-ink); }
body.tier-2 { --tier-accent: var(--tier2-color); --tier-accent-ink: var(--t2-ink); }
body.tier-3 { --tier-accent: var(--tier3-color); --tier-accent-ink: var(--t3-ink); }

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-size: 16.5px;
    line-height: 1.62;
    color: var(--ink);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

a { color: var(--navy); }
a:hover { color: var(--warm-d); }

::selection { background: var(--gold-l); color: var(--navy); }

/* ---------- header: flat navy band, no gradient ---------- */
header {
    background: var(--navy);
    color: var(--white);
    padding: 2.4rem 0 1.7rem;
}

header h1 {
    font-family: var(--serif);
    font-size: 2.05rem;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.1;
    margin-bottom: .35rem;
}

.subtitle {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-l);
    margin-bottom: .3rem;
}

.school-info { font-size: .88rem; color: #AEBCCB; margin-bottom: 0; }

/* ---------- nav ---------- */
.main-nav { background: var(--navy-d); position: sticky; top: 0; z-index: 100; }

.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; }

.main-nav a {
    display: block;
    padding: .72rem 1rem;
    text-decoration: none;
    color: #C6CFDA;
    font-size: .88rem;
    font-weight: 500;
    box-shadow: inset 0 -2px 0 transparent;
}

.main-nav a:hover { color: var(--white); }

.main-nav a.active { color: var(--white); font-weight: 600; box-shadow: inset 0 -2px 0 var(--gold); }

.nav-search { margin-left: auto; }
.nav-search a { color: var(--gold-l); }
.nav-search kbd {
    font-family: var(--sans);
    font-size: .68rem;
    border: 1px solid rgba(255,255,255,.28);
    padding: 0 .28rem;
    margin-left: .2rem;
}

/* ---------- main + sections: ruled, not boxed ---------- */
main { padding: 2.7rem 0 3.2rem; }

section { padding: 0 0 2.6rem; margin-bottom: 2.6rem; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

h2 {
    font-family: var(--serif);
    font-size: 1.62rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -.012em;
    line-height: 1.18;
    margin-bottom: .95rem;
}

h3 {
    font-family: var(--serif);
    font-size: 1.16rem;
    font-weight: 600;
    color: var(--navy);
    margin: 1.5rem 0 .5rem;
}

h4 {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 1.3rem 0 .45rem;
}

p { margin-bottom: .95rem; color: var(--muted); max-width: 74ch; }
strong { color: var(--ink); font-weight: 600; }
em { color: var(--muted); }

.hero { border-bottom: 1px solid var(--line); }
.hero h2 { font-size: 2rem; }

/* ---------- cards: leading rule, never enclosed ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.15rem 1.6rem;
    margin-top: 1.2rem;
}

.card { border-left: 2px solid var(--line); padding: .1rem 0 .1rem 1.05rem; }
.card h3 { margin-top: 0; font-size: 1.04rem; color: var(--navy); }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--warm-d); text-decoration: underline; }
.card p { font-size: .92rem; }
.card ul { list-style: none; padding: 0; }
.card li { padding: .34rem 0; border-bottom: 1px solid var(--line-2); font-size: .93rem; color: var(--muted); }
.card li:last-child { border-bottom: none; }

/* ---------- MTSS pyramid ---------- */
.pyramid-container {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 1.3rem;
    background: var(--line);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.pyramid-section { background: var(--cream); padding: 1.35rem 1.4rem; border-left: 4px solid var(--navy); }
.pyramid-section h3 { margin: 0 0 .4rem; color: var(--navy); }
.pyramid-section p { color: var(--muted); margin-bottom: .7rem; }
.pyramid-section.tier1 { border-left-color: var(--tier1-color); }
.pyramid-section.tier2 { border-left-color: var(--tier2-color); }
.pyramid-section.tier3 { border-left-color: var(--tier3-color); }

/* ---------- buttons: squared, quiet ---------- */
.btn {
    display: inline-block;
    padding: .5rem .95rem;
    background: var(--navy);
    color: var(--white);
    text-decoration: none;
    font-family: var(--sans);
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid var(--navy);
}

.btn:hover { background: var(--warm-d); border-color: var(--warm-d); color: var(--white); }

.btn-back { background: transparent; color: var(--navy); border-color: var(--line); margin-bottom: 1.2rem; }
.btn-back:hover { background: transparent; border-color: var(--navy); color: var(--warm-d); }

.btn-primary { background: var(--navy); color: var(--white); border-color: var(--navy); }

button { font-family: var(--sans); font-size: 1rem; cursor: pointer; border: none; }

/* ---------- intervention list: leading rule per item ---------- */
.intervention-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.05rem 1.7rem;
    margin-top: 1.5rem;
}

.intervention-card {
    display: block;
    text-decoration: none;
    color: var(--ink);
    border-left: 2px solid var(--line);
    padding: .15rem 0 .3rem 1.05rem;
    transition: border-color .12s ease;
}

.intervention-card:hover { border-left-color: var(--tier-accent); }
.intervention-card h3 { margin: 0 0 .2rem; font-size: 1.05rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.intervention-card:hover h3 { color: var(--warm-d); }
.intervention-card .rating { color: var(--gold); font-size: .88rem; letter-spacing: -.5px; margin: .1rem 0 .3rem; }
.intervention-card .description { color: var(--muted); font-size: .9rem; margin-bottom: .35rem; }
.intervention-card p { font-size: .87rem; margin-bottom: .3rem; }

/* ---------- department tags: text, not pills ---------- */
.dept-tags {
    margin-top: .5rem;
    font-size: .76rem;
    color: var(--faint);
    display: flex;
    flex-wrap: wrap;
    gap: .1rem .55rem;
    align-items: baseline;
}

.dept-tags::before {
    content: "Used by";
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-size: .64rem;
    color: var(--faint);
}

/* Department status: three marks, never colour alone. Must-have carries a
   star, exploring says "(exploring)" in words — both survive greyscale and a
   screen reader. See Core.deptMark in js/ams-core.js. */
.dept-tag { color: var(--muted); }
.dept-tag--must { color: var(--warm-d); font-weight: 600; }
.dept-tag--using { color: var(--sage); }
.dept-tag--exploring { color: var(--faint); font-style: italic; }

/* The same three marks, spelled out once under the library filters. */
.status-key {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem 1.1rem;
    margin: .55rem 0 0;
    padding: .55rem 0 0;
    border-top: 1px solid var(--line-2);
    font-size: .72rem;
    color: var(--faint);
}

.status-key dt {
    display: inline;
    font-weight: 600;
}

.status-key dd {
    display: inline;
    margin: 0 0 0 .3rem;
}

.status-key > div { display: inline; }

/* ---------- departments page: the generated "already in practice" block ---------- */
.dept-practice {
    margin-top: 1.9rem;
    padding-top: 1.05rem;
    border-top: 1px solid var(--line);
}

.dept-practice h3 { margin-top: 0; }

.dept-practice-count {
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--faint);
    margin-left: .45rem;
    vertical-align: .12em;
}

.dept-practice-note {
    margin: -.2rem 0 .75rem;
    font-size: .84rem;
    color: var(--faint);
}

.dept-practice-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .7rem;
}

.dept-practice-list a { font-weight: 500; }

.dept-practice-exploring {
    margin-top: .85rem;
    font-size: .86rem;
    color: var(--muted);
}

/* ---------- tier mark: a bar, not a pill ---------- */
.tier-chip {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
    background: none;
    padding: 0;
}

.tier-chip::before { content: ""; width: 16px; height: 3px; display: block; flex-shrink: 0; }

.tier-chip.t1 { color: var(--t1-ink); } .tier-chip.t1::before { background: var(--tier1-color); }
.tier-chip.t2 { color: var(--t2-ink); } .tier-chip.t2::before { background: var(--tier2-color); }
.tier-chip.t3 { color: var(--t3-ink); } .tier-chip.t3::before { background: var(--tier3-color); }

/* ---------- features list ---------- */
.features { list-style: none; padding: 0; }

.features li {
    padding: .42rem 0 .42rem 1.35rem;
    position: relative;
    color: var(--muted);
    border-bottom: 1px solid var(--line-2);
}

.features li:last-child { border-bottom: none; }

.features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.02em;
    width: 9px;
    height: 2px;
    background: var(--gold);
}

/* ===========================================================
   Student data charts
   Mount points are <div class="chart" data-chart="id">, filled
   by js/ams-data.js. House rules apply: no radius, no shadow,
   no full borders. A chart is separated by a hairline and space.
   =========================================================== */

.chart { margin-top: 1.25rem; }

.chart-title {
    font-family: var(--sans);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: .3rem;
}

/* Wrapper for a .chart-title plus its .chart-scope: carries the hairline
   that used to live on .chart-title alone, so a title with no scope line
   can still stand on its own without dragging in a border. */
.chart-head {
    padding-bottom: .45rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: .9rem;
}

.chart-scope { font-size: .8rem; color: var(--faint); margin: 0; }

.chart-source { font-size: .78rem; color: var(--faint); margin: .5rem 0 0; }

.chart-link {
    display: inline-block;
    margin-top: .6rem;
    font-size: .78rem;
    color: var(--muted);
}

/* ---- shared row scaffolding ---- */
.bar-row, .gb-row, .div-row, .stack-row, .db-row {
    display: grid;
    grid-template-columns: var(--labelw, 200px) 1fr;
    gap: .75rem;
    align-items: center;
}

.bar-lab, .gb-lab, .div-lab, .stack-lab, .db-lab-text {
    font-size: .78rem;
    color: var(--muted);
    text-align: right;
    line-height: 1.25;
}

.bar-row.is-total .bar-lab, .stack-row.is-total .stack-lab { color: var(--ink); font-weight: 600; }

.bar-nd { font-size: .72rem; color: var(--faint); font-style: italic; }

.bar-group-label {
    font-family: var(--sans);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 1rem 0 .4rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid var(--line-2);
}
.bar-group-label:first-child { margin-top: 0; }

/* ---- hbars ---- */
.bar-row { padding: .18rem 0; }
.bar-track { position: relative; height: 1.15rem; display: flex; align-items: center; }
.bar-fill { height: .8rem; background: var(--navy); min-width: 2px; }
.bar-val {
    position: absolute;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    padding-left: .45rem;
    white-space: nowrap;
}
.bar-row.is-total .bar-val { color: var(--ink); font-weight: 700; }
.bar-ref { position: absolute; top: -2px; bottom: -2px; border-left: 1px dashed var(--faint); }

.bar-ref-label {
    font-family: var(--sans);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
    margin-top: .6rem;
    display: flex;
    align-items: center;
    gap: .45rem;
}
.bar-ref-label::before { content: ""; width: 20px; border-top: 1px dashed var(--faint); }

/* ---- gbars: one line per series ---- */
.gb-row { padding: .4rem 0; border-bottom: 1px solid var(--line-2); }
.gb-row:last-child { border-bottom: 0; }
.gb-set { display: flex; flex-direction: column; gap: 2px; }
.gb-line { position: relative; height: .9rem; display: flex; align-items: center; }
.gb-fill { height: .62rem; min-width: 2px; }
.gb-val {
    position: absolute;
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    padding-left: .4rem;
    white-space: nowrap;
}

/* ---- divbars: centred on zero ---- */
.div-row { padding: .2rem 0; }
.div-track { position: relative; height: 1.35rem; margin-right: 4.5rem; }
.div-axis { position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--line); }
.div-fill { position: absolute; top: .28rem; height: .8rem; }
.div-val {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}

/* ---- divstack: split at the on-grade boundary ---- */
.stack-row { padding: .22rem 0; }
.stack-outer { position: relative; margin: 0 3.6rem 0 2.6rem; }
.stack { display: flex; height: 1.3rem; gap: 2px; align-items: stretch; }
.stack-seg { min-width: 0; }
.stack-axis { position: absolute; top: -3px; bottom: -3px; border-left: 1px solid var(--faint); }
.stack-end {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: .7rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}
.stack-end--worst { color: var(--warm-d); font-weight: 700; }

/* ---- dumbbell: before and after ---- */
.db-row { padding: .35rem 0; border-bottom: 1px solid var(--line-2); }
.db-row:last-child { border-bottom: 0; }
.db-track { position: relative; height: 1.35rem; }
.db-line { position: absolute; top: 50%; height: 2px; transform: translateY(-50%); background: var(--line); }
.db-line.is-worse { background: var(--warm); }
.db-line.is-better { background: var(--sage); }
.db-dot {
    position: absolute;
    top: 50%;
    width: .62rem;
    height: .62rem;
    transform: translate(-50%, -50%);
}
.db-val {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding-left: .75rem;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}
.db-val .is-worse { color: var(--warm-d); }
.db-val .is-better { color: var(--sage); }

/* ---- sparkgrid: small multiples on one scale ---- */
.spark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.1rem 1.4rem;
}
.spark { border-top: 1px solid var(--line-2); padding-top: .6rem; }
.spark h4 {
    font-family: var(--serif);
    font-size: .84rem;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: 0;
    text-transform: none;
    margin: 0;
    line-height: 1.2;
    min-height: 2.4em;
}
.spark-delta { font-size: .7rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.spark-delta.is-up { color: var(--sage); }
.spark-delta.is-down { color: var(--warm-d); }
.spark-delta.is-flat { color: var(--faint); }
.spark svg { display: block; width: 100%; height: 3.6rem; margin-top: .4rem; overflow: visible; }
.spark-x { display: flex; justify-content: space-between; font-size: .6rem; color: var(--faint); margin-top: .25rem; font-variant-numeric: tabular-nums; }
.spark-now { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: .2rem; color: var(--ink); }

/* ---- scatter ---- */
.scatter-wrap { overflow-x: auto; }
.scatter-wrap svg { display: block; min-width: 520px; width: 100%; height: auto; overflow: visible; }
.sc-quad {
    font-family: var(--sans);
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    fill: var(--faint);
}
.sc-axis {
    font-family: var(--sans);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    fill: var(--faint);
}
.sc-point-label {
    font-family: var(--sans);
    font-size: .7rem;
    fill: var(--ink);
    font-weight: 600;
    stroke: var(--cream);
    stroke-width: 3.5px;
    paint-order: stroke fill;
    stroke-linejoin: round;
}
.sc-point-label.is-ref { fill: var(--faint); font-weight: 400; }

/* ---- legend ---- */
.chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin-top: .85rem; font-size: .74rem; color: var(--muted); }
.chart-legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend-sw { width: .7rem; height: .7rem; flex: none; }

/* ---- verdict blocks: left rule, no card ---- */
.verdict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.4rem 1.8rem; margin-top: 1.3rem; }
.verdict { border-left: 3px solid var(--line); padding: .1rem 0 .1rem 1.05rem; }
.verdict--up { border-left-color: var(--sage); }
.verdict--watch { border-left-color: var(--gold); }
.verdict--down { border-left-color: var(--warm-d); }
.verdict-tag {
    font-family: var(--sans);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
}
.verdict h3 { font-size: 1.04rem; margin: .3rem 0 .35rem; }
.verdict p { font-size: .9rem; margin-bottom: .7rem; }
.verdict-evid { list-style: none; padding: 0; margin: 0; }
.verdict-evid li {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: baseline;
    padding: .3rem 0;
    border-bottom: 1px solid var(--line-2);
    font-size: .8rem;
    color: var(--muted);
}
.verdict-evid li:last-child { border-bottom: 0; }
.verdict-evid .v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.verdict-evid .v.is-pos { color: var(--sage); }
.verdict-evid .v.is-neg { color: var(--warm-d); }

/* ---- data tables ---- */
.data-table { margin-top: .7rem; border-top: 1px solid var(--line-2); }
/* Scoped rather than folded into the global focus rule: <summary> is not
   covered there, and these nine tables are the text alternative for every
   chart on the data page, so their focus ring is load-bearing. */
.data-table summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.data-table summary {
    cursor: pointer;
    padding: .6rem 0;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
}
.data-table-scroll { overflow-x: auto; padding-bottom: .3rem; }
.data-table table { border-collapse: collapse; width: 100%; font-size: .76rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: .35rem .7rem; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.data-table th {
    font-family: var(--sans);
    font-size: .62rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 700;
}
.data-table th:first-child, .data-table td:first-child { text-align: left; }

@media (max-width: 640px) {
    .bar-row, .gb-row, .div-row, .stack-row, .db-row { grid-template-columns: 1fr; gap: .15rem; }
    .bar-lab, .gb-lab, .div-lab, .stack-lab, .db-lab-text { text-align: left; font-weight: 600; color: var(--ink); }
    .div-track { margin-right: 0; }
    .stack-outer { margin: 0 2.6rem; }
}

/* ---------- callouts: leading rule, no fill box ---------- */
.highlight, .note, .warning, .takeaway {
    padding: .1rem 0 .1rem 1.1rem;
    margin: 1.15rem 0;
    border-left: 3px solid var(--gold);
}

.note     { border-left-color: var(--navy); }
.warning  { border-left-color: var(--warm); }
.takeaway { border-left-color: var(--sage); }

.highlight p:last-child, .note p:last-child, .warning p:last-child, .takeaway p:last-child { margin-bottom: 0; }

.takeaway > b:first-child {
    display: block;
    font-family: var(--sans);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--sage);
    margin-bottom: .5rem;
}

.example-block {
    border-left: 3px solid var(--line);
    padding: .1rem 0 .1rem 1.1rem;
    margin: 1.3rem 0;
    font-family: var(--serif);
    font-size: .96rem;
    line-height: 1.65;
    color: var(--muted);
}

.example-block::before {
    content: "Example";
    display: block;
    font-family: var(--sans);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: .3rem;
}

.protocol-box { border-left: 3px solid var(--navy); padding: .1rem 0 .1rem 1.1rem; margin: 1.2rem 0; }
.protocol-box h4 { margin-top: 0; color: var(--navy); }

.data-tracker {
    border-left: 3px solid var(--line);
    padding: .6rem 0 .6rem 1.1rem;
    margin: 1.1rem 0;
    font-size: .9rem;
    color: var(--muted);
}

blockquote {
    border-left: 3px solid var(--gold);
    padding: .1rem 0 .1rem 1.1rem;
    margin: 1.3rem 0;
    font-family: var(--serif);
    font-style: italic;
    color: var(--muted);
}

.success-indicator, .red-flag {
    display: block;
    padding: .3rem 0 .3rem 1.1rem;
    margin: .35rem 0;
    font-size: .93rem;
    border-left: 3px solid var(--sage);
    color: var(--muted);
}
.red-flag { border-left-color: var(--warm); }

/* ---------- intervention detail header ---------- */
.intervention-header {
    background: var(--navy);
    color: var(--white);
    padding: 2rem 1.9rem 2.1rem;
    margin-bottom: 2.4rem;
}

.intervention-header h2 { font-family: var(--serif); color: var(--white); font-size: 1.85rem; margin: 0 0 .35rem; }
.intervention-header p { color: #AEBCCB; max-width: 70ch; }

.intervention-meta {
    display: flex;
    gap: 1.6rem;
    flex-wrap: wrap;
    margin-top: .9rem;
    font-size: .84rem;
    color: #C6CFDA;
}
.intervention-meta span { display: flex; align-items: center; gap: .4rem; }

/* ---------- lists ---------- */
ol { margin: .9rem 0; padding-left: 1.3rem; }
ul li, ol li { margin: .3rem 0; color: var(--muted); }

.implementation-steps { counter-reset: step-counter; }
.implementation-steps > h3 { counter-increment: step-counter; display: flex; align-items: baseline; gap: .7rem; }
.implementation-steps > h3::before {
    content: counter(step-counter);
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--gold);
    flex-shrink: 0;
}

/* ---------- tables: ruled ---------- */
table { width: 100%; border-collapse: collapse; margin: 1.3rem 0; font-size: .93rem; }

thead th {
    text-align: left;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--faint);
    padding: .55rem .7rem .45rem;
    border-bottom: 1px solid var(--line);
    background: none;
}

tbody td { padding: .6rem .7rem; border-bottom: 1px solid var(--line-2); color: var(--muted); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--paper); }
td strong { color: var(--navy); }

.rubric-table td:first-child { font-weight: 600; color: var(--navy); width: 20%; }

/* ---------- search + filters ---------- */
.search-container { margin: 1.3rem 0 .9rem; }

.search-box {
    width: 100%;
    max-width: 460px;
    padding: .6rem .75rem;
    font-family: var(--sans);
    font-size: .95rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
}
.search-box:focus { outline: none; border-color: var(--navy); }
.search-box::placeholder { color: var(--faint); }

.filter-tags { display: flex; gap: .1rem .3rem; flex-wrap: wrap; margin: .7rem 0 .3rem; }

.tag {
    padding: .32rem .6rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: var(--sans);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

.tag:hover { color: var(--navy); }
.tag.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ---------- Library ---------- */
.lib-scroll { overflow-x: auto; }
.lib-table { font-size: .9rem; }
.lib-name a { font-family: var(--serif); font-weight: 700; color: var(--navy); text-decoration: none; white-space: nowrap; }
.lib-name a:hover { color: var(--warm-d); text-decoration: underline; }
.lib-stars { color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.lib-count { font-size: .78rem; color: var(--faint); letter-spacing: .04em; margin: .7rem 0 0; }
.lib-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.lib-sort:hover { color: var(--navy); }
.lib-sort::after { content: " \2195"; opacity: .45; }
.depts { display: flex; flex-wrap: wrap; gap: .1rem .45rem; align-items: baseline; }

/* ---------- Triage ---------- */
.triage-list { display: flex; flex-direction: column; margin-top: 1.3rem; border-top: 1px solid var(--line); }

.triage-opt {
    text-align: left;
    padding: .78rem 0 .78rem 1.05rem;
    font-family: var(--serif);
    font-size: 1.02rem;
    font-weight: 600;
    background: none;
    border: none;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
    color: var(--navy);
    cursor: pointer;
}

.triage-opt:last-child { border-bottom: none; }
.triage-opt:hover { border-left-color: var(--line); color: var(--warm-d); }
.triage-opt.is-active { border-left-color: var(--gold); color: var(--warm-d); }

.triage-ladder { margin-top: 1.3rem; }

.triage-rung { padding: 0 0 1.5rem 1.1rem; border-left: 2px solid var(--line); position: relative; }
.triage-rung:last-child { padding-bottom: .2rem; }

.triage-rung::before { content: ""; position: absolute; left: -4px; top: .42rem; width: 6px; height: 6px; }
.triage-rung.t1::before { background: var(--tier1-color); }
.triage-rung.t2::before { background: var(--tier2-color); }
.triage-rung.t3::before { background: var(--tier3-color); }

.triage-rung__head { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.triage-framing { font-size: .84rem; color: var(--faint); font-style: italic; }

.triage-items { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }

.triage-item {
    font-family: var(--serif);
    font-weight: 600;
    font-size: .96rem;
    color: var(--navy);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.triage-item:hover { color: var(--warm-d); border-bottom-color: var(--warm-d); }

/* The one 3px rule on the site — the safety pathway earns it. */
.triage-referral { border-left: 3px solid var(--warm); padding: .1rem 0 .1rem 1.05rem; margin-left: -1.1rem; }
.triage-referral strong { font-family: var(--serif); font-size: 1.02rem; color: var(--navy); display: block; }
.triage-referral p { margin: .2rem 0 0; font-size: .93rem; }

/* ---------- search palette ---------- */
.ams-palette {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(20, 32, 48, .5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 9vh 1rem 1rem;
}
.ams-palette[hidden] { display: none; }

.ams-palette__box {
    background: var(--paper);
    width: min(100%, 520px);
    border: 1px solid var(--navy);
    box-shadow: 0 18px 44px -14px rgba(20, 32, 48, .55);
    overflow: hidden;
}

.ams-palette__input {
    width: 100%;
    padding: .85rem 1.05rem;
    font-family: var(--sans);
    font-size: 1.02rem;
    color: var(--ink);
    background: var(--paper);
    border: 0;
    border-bottom: 1px solid var(--line);
    outline: none;
}
.ams-palette__input::placeholder { color: var(--faint); }

.ams-palette__results { max-height: 46vh; overflow-y: auto; }

.ams-palette__item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 1.05rem;
    text-decoration: none;
    color: var(--ink);
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--line-2);
}
.ams-palette__item:last-child { border-bottom: none; }
.ams-palette__item.is-active { background: var(--cream); border-left-color: var(--gold); }

.ams-palette__t { font-family: var(--serif); font-weight: 700; color: var(--navy); }
.ams-palette__s { margin-left: auto; font-size: .74rem; color: var(--faint); letter-spacing: .04em; }
.ams-palette__item .tier-chip { margin-left: auto; }
.ams-palette__empty { padding: 1.05rem; margin: 0; color: var(--faint); font-size: .9rem; }

.ams-palette__hint {
    display: flex;
    gap: .9rem;
    flex-wrap: wrap;
    margin: 0;
    padding: .5rem 1.05rem;
    border-top: 1px solid var(--line);
    font-size: .7rem;
    color: var(--faint);
    letter-spacing: .03em;
}
.ams-palette__hint kbd {
    font-family: var(--sans);
    border: 1px solid var(--line);
    padding: 0 .26rem;
    font-size: .66rem;
    color: var(--muted);
}

/* ---------- provenance notice ----------
   Marks pages whose content was AI-drafted rather than supplied by AMS.
   Deliberately prominent: it sits above the content it qualifies. */
.provenance {
    border-left: 3px solid var(--warm);
    padding: .1rem 0 .1rem 1.1rem;
    margin: 0 0 2rem;
}

.provenance-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--warm-d);
    margin-bottom: .3rem;
}

.provenance p { font-size: .9rem; margin-bottom: .4rem; max-width: 78ch; }
.provenance p:last-child { margin-bottom: 0; }
.provenance a { color: var(--warm-d); }

/* ---------- footer ---------- */
footer {
    background: var(--navy);
    color: #AEBCCB;
    padding: 1.9rem 0;
    margin-top: 3rem;
    font-size: .85rem;
}
footer p { color: #AEBCCB; margin: .28rem 0; max-width: none; }
footer a { color: var(--gold-l); }
footer a:hover { color: var(--white); }

/* ---------- accessibility ---------- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--gold);
    color: var(--navy);
    padding: .7rem 1.15rem;
    text-decoration: none;
    font-weight: 700;
    z-index: 2000;
}
.skip-link:focus { top: 0; }

main:focus { outline: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
.intervention-card:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.caption-sm { font-size: .82rem; color: var(--faint); margin-top: .4rem; }

.back-to-top { background: var(--navy) !important; border-radius: 0 !important; color: var(--white); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 768px) {
    body { font-size: 16px; }
    header { padding: 1.6rem 0 1.5rem; }
    header h1 { font-size: 1.62rem; }
    .main-nav a { padding: .6rem .7rem; font-size: .82rem; }
    .nav-search { margin-left: 0; }
    h2 { font-size: 1.4rem; }
    .card-grid, .intervention-list { grid-template-columns: 1fr; }
    .intervention-meta { flex-direction: column; gap: .35rem; }
    .intervention-header { padding: 1.3rem 1.1rem 1.4rem; }
    table { font-size: .86rem; }
    th, td { padding: .45rem .5rem; }
}

/* ---------- print ---------- */
@media print {
    @page { margin: 1.6cm; }

    body { background: #FFFFFF; color: #000; font-size: 11pt; line-height: 1.45; }
    .main-nav, .ams-palette, .back-to-top, .btn, .skip-link, .filter-tags, .search-container { display: none !important; }
    header, footer { background: none; color: #000; padding: 0 0 .6rem; }
    header h1, .subtitle, .school-info, footer p { color: #000; }
    .intervention-header { background: none; color: #000; padding: 0 0 .8rem; border-bottom: 2px solid #000; }
    .intervention-header h2, .intervention-header p, .intervention-meta { color: #000; }
    h2, h3, h4 { page-break-after: avoid; color: #000; }
    section, table, .example-block, .intervention-card, .card { page-break-inside: avoid; }
    a[href]::after { content: none; }
    p { max-width: none; }
}
