/* ==========================================================================
   suspensions/styles.css
   ==========================================================================
   All the styling for the Suspensions Dashboard, in four parts:
     A.  WCA's brand: colors and font. Defined once here; the JavaScript reads
         the same values, so there is one source of truth.
     A2. This dashboard's colors: which brand color each thing on the page takes.
     B.  Page basics and the pieces every section uses: headings, headline
         tiles, chart cards, legends, the hover tooltip, "About the data".
     C.  This dashboard: the band at the top, the menu, each part's opening
         panel and its picture, the chart cards, part 4's cards, and
         "Find your district" (the map and the district card).
   Parts A and B are copied unchanged from the Youth Justice Dashboard;
   change them there and here together, or not at all.
   ========================================================================== */

/* --------------------------------------------------------------------------
   A. BRAND  ·  from WCA's 2024 Quick Reference Style Guide
   --------------------------------------------------------------------------
   Use these names in CSS as var(--wca-blue) and so on. charts.js reads the
   same values, so there is one source of truth. */

:root {
  /* Primary */
  --wca-blue:        #314F9E;   /* titles, section heads, the main data series */
  --wca-green:       #098342;   /* stat numbers, links, and Westchester in every chart */

  /* Blue steps for maps and stacked bars (light to dark; checked for color-blind readers) */
  --wca-blue-100:    #A3B3DC;
  --wca-blue-200:    #7A91C8;
  --wca-blue-300:    #5673B5;
  --wca-blue-500:    #314F9E;   /* same as --wca-blue */
  --wca-blue-700:    #22366E;

  /* Tertiary: the brand allows ONE per piece, used sparingly.
     Orange is used only for "fewer than before" on diverging map scales. */
  --wca-orange:      #D14905;
  --wca-orange-100:  #E8A07A;

  /* Tints for card fills (never flat gray: gray reads as "sources") */
  --wca-blue-tint:   #EAEEF7;
  --wca-green-tint:  #E7F2EC;

  /* Neutrals */
  --ink:             #111111;   /* headings */
  --body:            #333333;   /* body text */
  --fine:            #555555;   /* fine print */
  --muted:           #767676;   /* captions, sources */
  --rule:            #DCDCDC;   /* hairlines */
  --panel:           #EFEFEF;   /* panels */
  --white:           #FFFFFF;

  /* Map helpers */
  --map-no-data:     #E6E6E6;   /* counties with nothing to show */
  --map-stroke:      #FFFFFF;   /* lines between counties */

  /* Font */
  --font: "Lexend", "Segoe UI", Arial, sans-serif;

  /* Layout */
  --page-width: 1100px;
  --gutter: 16px;
  --radius: 8px;
}

/* Lexend, served from the project so the page never calls out to another site. */
@font-face { font-family: "Lexend"; font-weight: 400; font-style: normal; font-display: swap;
             src: url("resources/fonts/lexend-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 600; font-style: normal; font-display: swap;
             src: url("resources/fonts/lexend-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 700; font-style: normal; font-display: swap;
             src: url("resources/fonts/lexend-latin-700-normal.woff2") format("woff2"); }

/* --------------------------------------------------------------------------
   A2. THIS DASHBOARD'S COLORS
   --------------------------------------------------------------------------
   Every color on the page is one of WCA's brand colors from part A, given a
   job here (the one value written out below is a brighter step of the brand's
   orange, for the pictures). Blue and green are the brand's two colors; orange
   is the one extra color this dashboard uses, and it has two jobs only: the
   dotted path and the lights in the pictures, and the one mark in each chart
   that everything else is compared with.
   Checked with the dataviz color check, 2026-11-11: the bars (blue) and what
   they are compared with (orange) tell apart for color-blind readers and both
   stand out on white; the map is one hue, light to dark.
   charts.js reads these by name. */

:root {
  /* The blue-to-green sweep: the band at the top and each part's opening panel */
  --sns-sweep-from:    var(--wca-blue);
  --sns-sweep-to:      var(--wca-green);

  /* Words */
  --sns-title:         var(--wca-blue);       /* part titles, chart titles, a district's name */
  --sns-number:        var(--wca-green);      /* the big numbers (WCA's rule: stat numbers are green) */

  /* Charts */
  --sns-data:          var(--wca-blue);       /* the bars: every student group, a district */
  --sns-average:       var(--wca-orange);     /* what the bars are compared with, with a dashed line from it:
                                                 the "All students" bar (parts 1 and 2), Westchester beside a district.
                                                 In part 3 (no dashed line): the "Suspended" and "Felony arrests" bars */
  --sns-other:         var(--muted);          /* New York State beside a district */

  /* The pictures */
  --sns-path:          #F07722;               /* the dotted path and the lit windows: the orange of WCA's color schema,
                                                 a brighter step of --wca-orange that shows on the dark panels */
  --sns-art-dark:      var(--wca-blue-700);   /* figures in the windows, doors, clock hands */
  --sns-art-wall:      #4A8F87;               /* walls of the school and the home: solid, never see-through (Brandon, Nov 2026) */
  --sns-art-roof:      #6BA59D;               /* roofs, the bell tower, the chimney */
  --sns-art-cap:       #8DBAB3;               /* the tip of the bell tower, the school's front step */
  --sns-veil:          rgba(255, 255, 255, 0.55);   /* thin white lines on the sweep */

  /* Boxes */
  --sns-panel:         var(--wca-blue-tint);  /* "What we see" boxes, the research cards, the number boxes in parts 2 and 3,
                                                 the district card, "Take action" */
  --sns-shadow:        rgba(0, 0, 0, 0.05);   /* the soft shadow under the menu */
  --sns-number-line:   #C9D2E6;               /* the thin lines between the three numbers in part 2's box */
}


/* --------------------------------------------------------------------------
   B. PAGE BASICS
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--body);
  background: var(--white);
  overflow-wrap: break-word;   /* a long word (a file or column name) can't push the page wider than the screen */
}

.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 48px;
}

h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 32px; font-weight: 700; color: var(--wca-blue); }
h2 { font-size: 22px; font-weight: 600; color: var(--wca-blue); }
h3 { font-size: 17px; font-weight: 600; }

p  { margin: 0 0 12px; }
a  { color: var(--wca-green); }
small, .muted { color: var(--muted); font-size: 14px; }
.fine { color: var(--fine); font-size: 14px; }

/* Brand motif: a thin blue-to-green rule under the page title */
.rule-gradient {
  height: 4px; border: 0; margin: 12px 0 24px;
  background: linear-gradient(90deg, var(--wca-blue), var(--wca-green));
}

/* Page header */
.page-header { padding-top: 28px; }
.page-header .kicker {
  color: var(--wca-green); font-weight: 600; font-size: 14px;
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px;
}
.page-header .subtitle { font-size: 18px; color: var(--fine); max-width: 60ch; }

/* Section spacing */
section { margin: 36px 0; }
section > h2 { margin-bottom: 4px; }
.section-intro { color: var(--fine); max-width: 70ch; }


/* --------------------------------------------------------------------------
   B (continued). PIECES EVERY SECTION USES
   -------------------------------------------------------------------------- */

/* Headline tiles: a row of big numbers at the top of the page */
.tiles {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr);
}
.tile {
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 16px 18px; background: var(--white);
}
.tile .value {
  font-size: 40px; font-weight: 700; line-height: 1.1;
  color: var(--wca-green);              /* brand rule: stat numbers are green */
}
.tile .label { color: var(--body); font-size: 15px; margin-top: 6px; }
.tile .compare { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* Chart cards: one per story chart. Kicker (number), heading (the finding),
   commentary, the chart, then its source line. */
.card { border-top: 1px solid var(--rule); padding: 28px 0 8px; }
.card .kicker {
  color: var(--wca-green); font-weight: 600; font-size: 14px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.card h2 { margin-top: 2px; }
.card .commentary { max-width: 70ch; }
.card .source { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* The box a chart draws into. Chart.js fills it; the height is set here. */
.chart-box { position: relative; height: 300px; }
.chart-box.short { height: 220px; }

/* Two charts side by side (chart 1). Stacks on phones. */
.chart-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chart-pair h3 { font-size: 15px; color: var(--fine); font-weight: 600; margin-bottom: 4px; }

/* Chart legend written in HTML (clearer than a drawn one) */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 4px; font-size: 14px; color: var(--fine); }
.legend .swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  vertical-align: -2px; margin-right: 6px;
}

/* Hover tooltip (one per page, moved to where the mouse is by charts.js) */
.tooltip {
  position: fixed; z-index: 10; pointer-events: none;
  max-width: 260px; padding: 8px 10px; border-radius: 6px;
  background: var(--ink); color: var(--white);
  font-size: 13px; line-height: 1.4;
  opacity: 0; transition: opacity 0.1s;
}
.tooltip.show { opacity: 1; }
.tooltip strong { color: var(--white); }

/* "About the data" */
.about { padding-top: 28px; }
.about p { max-width: 75ch; font-size: 15px; }

/* Footer */
.page-footer { border-top: 1px solid var(--rule); margin-top: 36px; padding-top: 16px; color: var(--muted); font-size: 14px; }

/* Hidden-but-readable text for screen readers */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}


/* --------------------------------------------------------------------------
   PHONES AND NARROW WINDOWS
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  h1 { font-size: 26px; }
  .tiles { grid-template-columns: 1fr; }
  .tile .value { font-size: 34px; }
  .chart-pair { grid-template-columns: 1fr; }
  .chart-box { height: 260px; }
}


/* --------------------------------------------------------------------------
   C. THIS DASHBOARD
   -------------------------------------------------------------------------- */

/* A browser hides anything marked hidden (the parts not on screen, the search results when empty) */
[hidden] { display: none !important; }

/* Text that is still a first draft carries this small tag (search the page for PLACEHOLDER) */
.ph { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); vertical-align: 1px; }

/* ---- C1. The band at the top: WCA's logo on the blue-to-green sweep ---- */
.site-banner { background: linear-gradient(90deg, var(--sns-sweep-from), var(--sns-sweep-to)); color: var(--white); }
.site-banner .inner {
  max-width: var(--page-width); margin: 0 auto; padding: 22px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 120px;
}
.site-banner .logo { width: 220px; flex: 0 0 auto; display: block; }
.site-banner .logo svg { width: 100%; height: auto; display: block; }
.site-banner .banner-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.site-banner .badge {                                    /* the links in the top band ("Find your district", "About the data") */
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 600; white-space: nowrap; color: var(--white); text-decoration: none;
  border: 1.5px solid var(--white); border-radius: 999px; padding: 8px 16px;
}
.site-banner .badge svg { width: 14px; height: 14px; flex: 0 0 auto; }
.site-banner .badge:hover, .site-banner .badge:focus-visible { background: var(--white); color: var(--sns-sweep-from); }

/* ---- C2. Page header and the three headline tiles ---- */
.page.top { padding-bottom: 0; }                           /* the header's part of the page: the menu follows it closely */
.page-header { margin-bottom: 0; }
.page-header h1 { font-size: 34px; }
.page-header .define { color: var(--fine); font-size: 15px; max-width: 70ch; }
.tiles { grid-template-columns: repeat(3, 1fr); }
.tile .value .unit { font-size: 17px; font-weight: 600; white-space: nowrap; }
.tile .label .year { white-space: nowrap; }

/* ---- C3. The menu: one tab for each part. It stays at the top of the screen while you scroll. ---- */
.tabbar {
  position: sticky; top: 0; z-index: 5; margin-top: 28px;
  background: var(--white); border-bottom: 1px solid var(--rule); box-shadow: 0 2px 6px var(--sns-shadow);
}
.tabbar .inner {
  max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;      /* on a phone the tabs slide sideways */
}
.tabbar .inner::-webkit-scrollbar { display: none; }
/* The tabs sit in the middle of the menu. The two outer margins share the spare room; on a phone, where the tabs
   are wider than the screen, there is none, so they start at the left edge and still slide sideways. */
.tabbar .tab:first-child { margin-left: auto; }
.tabbar .tab:last-child { margin-right: auto; }
.tab {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--fine); white-space: nowrap;
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 12px 11px; cursor: pointer;
}
.tab .n {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; margin-right: 6px;
  background: var(--sns-panel); color: var(--sns-title); font-size: 12px; line-height: 22px; text-align: center;
}
.tab .n svg { width: 12px; height: 12px; vertical-align: -1px; }
.tab[aria-selected="true"] {
  color: var(--sns-title);
  border-image: linear-gradient(90deg, var(--sns-sweep-from), var(--sns-sweep-to)) 1;
}
.tab[aria-selected="true"] .n { background: var(--sns-title); color: var(--white); }
.tab:focus-visible { outline: 2px solid var(--sns-title); outline-offset: -2px; }
.tabpanel { margin: 0; }
.tabpanel:focus { outline: none; }

/* ---- C4. Each part's opening panel: the part's name, one sentence with its numbers large, and a picture ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 24px; align-items: center;
  background: linear-gradient(120deg, var(--sns-sweep-from), var(--sns-sweep-to)); color: var(--white);
  border-radius: var(--radius); padding: 28px 32px; margin: 24px 0 8px; overflow: hidden;
}
.hero .num { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.hero h2 { color: var(--white); font-size: 28px; font-weight: 700; margin: 2px 0 14px; }
.hero .lead { font-size: 20px; line-height: 1.5; margin: 0; }
.hero .lead .line { display: block; margin-bottom: 6px; }
.hero .lead .big { font-size: 34px; font-weight: 700; line-height: 1; white-space: nowrap; }
.hero.plain { grid-template-columns: 1fr; }                /* "Find your district": no picture */

/* The pictures. They are drawn once at the top of index.html and used by name. */
.drawings { position: absolute; width: 0; height: 0; overflow: hidden; }   /* the drawings themselves take no room */
.hero-art { color: var(--white); }                         /* a drawing takes the text color of what holds it */
.hero-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero-art.bleed { align-self: end; margin: -6px -32px -28px 0; }           /* part 1's wide scene runs to the panel's edge */
.art-lit { fill: var(--sns-path); }                        /* lit windows, the bell, the flag, the open door */
.art-wall { fill: var(--sns-art-wall); }
.art-roof { fill: var(--sns-art-roof); }
.art-cap { fill: var(--sns-art-cap); }
.art-dark { fill: var(--sns-art-dark); }                   /* classmates in the windows, doors */
.art-dark-line { stroke: var(--sns-art-dark); fill: none; } /* clock hands, window bars */
.art-roof-line { stroke: var(--sns-art-roof); fill: none; }   /* part 4: the teacher's arm on the laptop screen */
.art-path { stroke: var(--sns-path); fill: none; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0.1 14; }   /* the dotted path */
.art-lit-line { stroke: var(--sns-path); fill: none; }     /* the tassels on the graduation caps */
.art-far { color: var(--sns-art-cap); }                    /* things standing behind the figures: the chairs at graduation */

/* ---- C5. Chart cards: a plain title, the takeaway under it, then the chart ---- */
.card:first-of-type { border-top: 0; }
.chart-title {
  color: var(--sns-title); font-size: 21px; font-weight: 600;
  border-bottom: 2px solid var(--sns-title); padding-bottom: 6px; margin: 2px 0 8px;
}
.chart-unit { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.takeaway { color: var(--ink); font-size: 19px; font-weight: 600; line-height: 1.35; max-width: 62ch; margin: 0 0 16px; }
.chart-note { color: var(--fine); font-size: 14px; margin: 8px 0 0; max-width: 75ch; }
.source { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.chart-box.tall { height: 340px; }
.chart-box.mini { height: 150px; }
/* Words written on a chart, in its empty space: the point the chart makes (part 1), white in an orange circle.
   charts.js sets the circle's place, size and type size from the chart's own bars */
.callout {
  position: absolute; margin: 0; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--sns-average); color: var(--white);
  font-weight: 600; line-height: 1.25;
  pointer-events: none;                                    /* hovering still reaches the bars underneath */
}

/* Part 1: two chart cards side by side (one under the other on a phone) */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; }
.pair .card { border-top: 0; }
.pair .takeaway { min-height: 2.7em; }                      /* two lines, so the two charts start level */

/* "What we see": one or two sentences that say what the chart shows */
.see { background: var(--sns-panel); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0 0; font-size: 16px; }
.see h4 { color: var(--sns-title); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 4px; }
.see p { color: var(--ink); margin: 0; max-width: 80ch; }
.viz { min-width: 0; }
.nowrap { white-space: nowrap; }

/* Part 3: one small chart ("panel") for each group, all the same size and on the same scale; charts.js writes them.
   Two to a row (a 2 x 2 of four panels, starting from the left), one to a row on a phone (further down). The 16px
   below is the gap between two panels. A panel's height is its number of bars (--rows, set by charts.js) times the
   height of one row, plus the scale. Beside the panels stands a shaded box in the style of part 2's three numbers
   (.with-numbers and .numbers, below): a small heading and one sentence, then two numbers with their words. */
.panels { display: flex; flex-wrap: wrap; justify-content: flex-start; align-content: flex-start; gap: 16px; }
.panels figure {
  flex: 0 0 calc((100% - 16px) / 2); margin: 0; min-width: 0;
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 12px 4px;
}
.panels figcaption { color: var(--ink); font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.panels .chart-box { height: calc(var(--rows, 5) * 40px + 30px); }

/* Part 2: the chart with three big numbers beside it. The numbers share one light blue box (the color of the
   research cards under it), as tall as the chart, with a thin line between them. Under the chart on a tablet
   (side by side) and a phone (stacked). */
.with-numbers { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: stretch; }
.numbers {
  display: grid; gap: 0; align-content: space-between; padding: 2px 22px; border-radius: var(--radius);
  background: var(--sns-panel);
}
.number { display: flex; flex-direction: column; justify-content: center; padding: 14px 0; }
.number + .number { border-top: 1px solid var(--sns-number-line); }
.number .value { color: var(--sns-number); font-size: 38px; font-weight: 700; line-height: 1.1; }
.number p { font-size: 15px; margin: 4px 0 0; }
/* Part 3's box (.numbers.pattern) opens with a small heading and one sentence, the point its two numbers
   illustrate; each of those numbers is a pair ("27% → 52%") kept on one line */
.number h4 { color: var(--sns-title); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 6px; }
.number p.point { color: var(--ink); font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0; }
.number .value { white-space: nowrap; }
/* Part 3's box (and part 4's money box, which copies it) is only as tall as its words and sits in the middle of
   the height beside it, rather than stretching to the full height of the charts with empty space inside
   (Brandon, Nov 16: option 3A). On a tablet or phone, where the box sits under the charts, nothing changes. */
.numbers.pattern { align-self: center; padding: 6px 22px; }
/* Part 4's money box: a short list of what the money pays for */
.number ul.uses { margin: 8px 0 0; padding-left: 18px; }
.number ul.uses li { font-size: 15px; margin: 2px 0; }

/* What research says: two findings side by side */
.research { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.finding { background: var(--sns-panel); border-radius: var(--radius); padding: 16px 18px; }
.finding h4 { color: var(--ink); font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.finding p { font-size: 15px; margin: 0 0 8px; }
.finding .cite { color: var(--muted); font-size: 13px; margin: 0; }
.plain-note { border-left: 4px solid var(--rule); padding: 2px 0 2px 14px; color: var(--fine); font-size: 15px; max-width: 75ch; margin: 16px 0 0; }
/* Part 2: the findings stacked in the left third, a picture in the right two thirds (one column on tablets and phones) */
.research-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; align-items: stretch; }
.research-stack { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.research-art {
  display: flex; align-items: center; justify-content: center; min-height: 240px;
  background: linear-gradient(120deg, var(--sns-sweep-from), var(--sns-sweep-to)); color: var(--white);   /* the same sweep as the opening panels */
  border-radius: var(--radius); padding: 10px; overflow: hidden;
}
.research-art svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---- C6. Part 4: three of the bill's rules, one under another, short lines, "Take action" ----
   Each rule is a wide panel on the blue-to-green sweep, like the opening panels: the picture on the left,
   the rule, its big number and its words in white on the right. On a phone the picture and the words get
   a smaller share and smaller type, but stay side by side. */
.rules { display: grid; gap: 14px; margin-top: 14px; }
/* The three rules on the left, the money box on the right (the layout of part 3: .with-numbers) */
.bill-money { margin-top: 14px; }
.bill-money .rules { margin-top: 0; }
.rule {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: center; margin: 0; min-width: 0;
  background: linear-gradient(120deg, var(--sns-sweep-from), var(--sns-sweep-to)); color: var(--white);
  border-radius: var(--radius); padding: 0 28px 0 0; overflow: hidden;
}
.rule-art { align-self: end; padding-top: 8px; }   /* the picture sits on the panel's bottom edge, so its floor runs into it */
.rule-art svg { display: block; width: 100%; height: auto; }
.rule-text h4 { color: var(--white); font-size: 18px; font-weight: 700; line-height: 1.3; margin: 0 0 6px; }
.rule-text .value { color: var(--white); font-size: 38px; font-weight: 700; line-height: 1.1; }
.rule-text p { color: var(--white); font-size: 16px; line-height: 1.45; margin: 4px 0 0; max-width: 52ch; }
/* Minor misbehavior and the bill's two other rules: one line each, under the three rules */
.also { border-top: 1px solid var(--rule); margin-top: 24px; padding-top: 12px; }
.also p { color: var(--ink); font-size: 15px; margin: 0 0 6px; max-width: 90ch; }

.action { background: var(--sns-panel); border-radius: var(--radius); padding: 20px 22px; margin-top: 8px; }
.action h3 { color: var(--sns-title); font-size: 20px; margin-bottom: 10px; }
.action ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.action li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.action .button {
  display: inline-block; background: var(--sns-title); color: var(--white); text-decoration: none;
  font-weight: 600; font-size: 15px; border-radius: var(--radius); padding: 9px 16px;
}
.action .button:hover, .action .button:focus-visible { background: var(--wca-blue-700); }
.action .fine { margin: 12px 0 0; }

/* The end of a part: the dotted path leads to the next one */
.continue { display: flex; align-items: center; gap: 14px; margin: 30px 0 0; }
.continue::before {
  content: ""; flex: 1; height: 6px;
  background: radial-gradient(circle, var(--sns-path) 2.5px, transparent 3px) left center / 14px 6px repeat-x;
}
.continue button {
  font: inherit; font-weight: 600; color: var(--white); background: var(--sns-title);
  border: 0; border-radius: var(--radius); padding: 10px 18px; cursor: pointer;
}
.continue button:hover, .continue button:focus-visible { background: var(--wca-blue-700); }

/* ---- C7. "Find your district": the list and the town search, the map, the district card ---- */
.finder { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin: 18px 0 16px; }
.finder label { display: block; color: var(--fine); font-size: 14px; margin-bottom: 4px; }
.finder select, .finder input {
  font: inherit; color: var(--ink); width: 100%; max-width: 100%;
  padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; background: var(--white);
}
.finder select:focus-visible, .finder input:focus-visible { outline: 2px solid var(--sns-title); outline-offset: 1px; }
.finder .field { flex: 1 1 240px; min-width: 0; max-width: 340px; position: relative; }
.finder .results {
  list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; z-index: 4;
  background: var(--white); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 6px 16px var(--sns-shadow);
  max-height: 260px; overflow-y: auto;
}
.finder .results button {
  font: inherit; font-size: 15px; text-align: left; width: 100%; color: var(--ink);
  background: none; border: 0; border-radius: 4px; padding: 7px 8px; cursor: pointer;
}
.finder .results button:hover, .finder .results button:focus-visible { background: var(--sns-panel); }
.finder .results small { display: block; color: var(--muted); font-size: 13px; }
.finder .results .empty { color: var(--fine); font-size: 14px; padding: 7px 8px; }

/* Map on the left, the district card on the right */
.map-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.map { width: 100%; height: auto; display: block; max-height: 78vh; }
.district { stroke: var(--map-stroke); stroke-width: 0.8; cursor: pointer; }
.district:hover { stroke: var(--ink); stroke-width: 1.4; }
.district.selected { stroke: var(--ink); stroke-width: 2.2; }
.district.other { fill: var(--map-no-data); cursor: default; }            /* an outline that isn't a Westchester district */
.district.other:hover { stroke: var(--map-stroke); stroke-width: 0.8; }
.map-legend { margin-top: 10px; }
.map-legend .title { flex-basis: 100%; color: var(--ink); font-weight: 600; }
.map-legend .swatch { border: 1px solid var(--rule); }

/* The district card */
.district-card { background: var(--sns-panel); border-radius: var(--radius); padding: 20px 22px; font-size: 15px; }
.district-card h3 { color: var(--sns-title); font-size: 22px; margin-bottom: 2px; }
.district-card .serves { color: var(--fine); font-size: 14px; margin-bottom: 14px; }
.district-card .rate { color: var(--ink); margin: 0 0 12px; }
.district-card .rate .big { color: var(--sns-number); font-size: 40px; font-weight: 700; line-height: 1; margin-right: 4px; }
.district-card h4 { color: var(--ink); font-size: 15px; font-weight: 700; margin: 18px 0 6px; }
.district-card .hint { color: var(--fine); margin: 14px 0 0; }
.district-card .note { color: var(--fine); font-size: 13px; margin: 14px 0 0; }

/* Rows of bars inside the card: a name, a bar, the number */
.bars { display: grid; gap: 6px; }
.bars .row { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr) 40px; gap: 10px; align-items: center; }
.bars .who { color: var(--body); font-size: 14px; line-height: 1.25; }
.bars .track { height: 14px; border-radius: 4px; background: var(--white); overflow: hidden; }
.bars .fill { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--sns-data); }
.bars .fill.average { background: var(--sns-average); }
.bars .fill.other { background: var(--sns-other); }
.bars .val { color: var(--ink); font-weight: 600; font-size: 14px; text-align: right; }
.bars .row.none { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
.bars .row.none .why { color: var(--muted); font-size: 13px; }

/* Two facts side by side in the card */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.facts div { background: var(--white); border-radius: 6px; padding: 10px 12px; color: var(--fine); font-size: 14px; line-height: 1.3; }
.facts b { display: block; color: var(--sns-number); font-size: 24px; line-height: 1.15; }


/* --------------------------------------------------------------------------
   PHONES AND NARROW WINDOWS
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .pair, .with-numbers, .map-layout, .research-split { grid-template-columns: minmax(0, 1fr); }      /* one column; minmax keeps a wide chart from stretching the page */
  .pair .card + .card { border-top: 1px solid var(--rule); }
  .pair .takeaway { min-height: 0; }
  .numbers { grid-template-columns: repeat(3, 1fr); padding: 20px 6px; }      /* side by side: the lines between them stand upright */
  .number { justify-content: flex-start; padding: 2px 20px; }
  .number + .number { border-top: 0; border-left: 1px solid var(--sns-number-line); }
  /* part 3's box: its heading and sentence across the top, its two numbers side by side under them
     (three columns would be too narrow for a pair such as "27% → 52%") */
  .numbers.pattern { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .numbers.pattern .number:first-child { grid-column: 1 / -1; }
  .numbers.pattern .number:nth-child(2) { border-left: 0; }
  .hero { grid-template-columns: 1fr; padding: 24px 24px 22px; gap: 14px; }
  .hero-art { width: min(100%, 520px); justify-self: center; }
  .research-art svg { max-width: 640px; }                  /* under the findings, the picture stops growing here */
  .hero-art.bleed { width: min(100% + 24px, 560px); margin: 0 -24px -22px 0; justify-self: end; }
}
@media (max-width: 600px) {
  .site-banner .inner { min-height: 92px; padding-top: 16px; padding-bottom: 16px; }
  .site-banner .logo { width: 150px; }
  .site-banner .badge { font-size: 13px; padding: 6px 12px; }
  .site-banner .banner-links { flex-direction: column; align-items: stretch; gap: 6px; }   /* the two links stacked */
  .site-banner .badge { justify-content: center; }
  .page-header { padding-top: 20px; }
  .page-header h1 { font-size: 27px; }
  .page-header .subtitle { font-size: 16px; }
  /* The three tiles become three short rows: the number on the left, the words on the right */
  .tiles { grid-template-columns: 1fr; gap: 8px; }
  .tile { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 10px 14px; }
  .tile .value { font-size: 27px; grid-row: 1 / span 2; }
  .tile .value .unit { display: block; font-size: 13px; }
  .tile .label { margin-top: 0; font-size: 14px; line-height: 1.3; }
  .tile .compare { margin-top: 2px; font-size: 13px; }
  .tabbar { margin-top: 20px; }
  .tab { padding: 12px 9px 9px; font-size: 14px; }
  .hero { padding: 20px 18px 18px; margin-top: 18px; }
  .hero h2 { font-size: 24px; margin-bottom: 10px; }
  .hero .lead { font-size: 17px; }
  .hero .lead .big { font-size: 28px; }
  .hero-art.bleed { width: calc(100% + 18px); margin: 0 -18px -18px 0; }
  .chart-title { font-size: 19px; }
  .takeaway { font-size: 17px; }
  br.wide-only { display: none; }                          /* chart titles wrap on their own on a phone */
  .chart-box.tall { height: 320px; }
  .research, .research-split, .numbers { grid-template-columns: minmax(0, 1fr); }
  .panels figure { flex-basis: 100%; }                     /* part 3's panels: one to a row, in shorter rows */
  .panels .chart-box { height: calc(var(--rows, 5) * 31px + 30px); }
  .research-art { min-height: 160px; }
  .numbers { padding: 4px 20px; }                          /* stacked again: the lines between them lie flat */
  .number { padding: 16px 0; }
  .number + .number { border-left: 0; border-top: 1px solid var(--sns-number-line); }
  .number .value { font-size: 36px; }
  .numbers.pattern { grid-template-columns: minmax(0, 1fr); row-gap: 0; }      /* part 3's box: one column again */
  /* part 4: a smaller picture and smaller words, still side by side */
  .rule { grid-template-columns: 42% minmax(0, 1fr); gap: 12px; padding: 0 14px 0 0; }
  .rule-text { padding: 10px 0; }
  .rule-text h4 { font-size: 15px; margin-bottom: 2px; }
  .rule-text .value { font-size: 28px; }
  .rule-text p { font-size: 14px; line-height: 1.35; }
  .continue button { padding: 10px 14px; }
  .district-card { padding: 16px; }
  .district-card .rate .big { font-size: 34px; }
}
/* The smallest phones: a slightly smaller logo and link so both fit on one line */
@media (max-width: 380px) {
  .site-banner .inner { gap: 10px; }
  .site-banner .logo { width: 120px; }
  .site-banner .badge { font-size: 12px; padding: 5px 9px; gap: 5px; }
}
