/* City report: a paper sheet on screen, and the same layout in print (Letter or A4).
   On paper nothing depends on color or on dark fills: bands that matter carry a texture, headings
   carry a navy bar that prints as plain ink, and the brand is the mark and a rule.
   On screen the sheet rests on the navy band that holds the controls. */
.hero-slim .hero-inner { padding-bottom: 86px; }
.hero-slim .page-title { font-size: 34px; }
.hero-slim .lede { font-family: var(--font); font-size: 16px; color: var(--on-navy-2); max-width: 66ch; }
.report-page { max-width: 1128px; padding-top: 0; margin-top: -58px; position: relative; }
.report-controls { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.report-controls .filter-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; align-items: end; }
.report-controls .filter-row .field { min-width: 0; }
.report-controls .filter-row .field[hidden] { display: none; }
.report-controls .filter-row select, .report-controls .filter-row input { min-height: 44px; }
.report-controls .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.report-controls .actions .btn { min-height: 44px; }
.report-controls .actions .note { flex-basis: 100%; margin-top: 2px; }
.report-controls .actions .share-status { color: var(--on-navy); }
.report-controls .date-note { margin-top: 12px; }
.report-page > #load-error:not([hidden]), .report-page > #notice-host:not(:empty) { width: min(100%, 816px); margin: 0 auto 14px; }
.report-page > #load-error .state-card { box-shadow: 0 2px 18px rgba(10, 37, 64, 0.16); }

.report {
  width: min(100%, 816px); margin: 0 auto; background: var(--paper-raised); color: var(--ink); border: 1px solid var(--hairline);
  border-radius: 4px; box-shadow: 0 2px 18px rgba(10, 37, 64, 0.16); padding: 52px 58px 44px; container-type: inline-size;
  --surface: var(--paper-raised); --surface-2: var(--paper-sink);
}
.report[aria-busy="true"] { opacity: 0.5; }
.report-skel { display: grid; gap: 18px; }
.report-skel .headline > div { min-height: 64px; }
.report-skel .pair { align-items: center; }
.report-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--ink); }
.report-mark { height: 22px; width: auto; display: block; }
.report-title { font-family: var(--font); font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin-top: 12px; text-align: center; }
/* the line under the title: the district and the dates (founder, UX2 stop 4); the logo line, the title and this line are centered,
   on screen and on paper, and the facts below keep their grid (founder, PL2) */
.report-sub { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); text-align: center; }
/* the scope as a specification block: city, the district word, repair type, reported dates, data as of, report made */
.report-spec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 14px 0 0; }
.report-spec > div { display: grid; gap: 2px; min-width: 0; }
.report-spec dt { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.report-spec dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.report-inshort-sec h2 { margin-top: 22px; }
.report-inshort { margin-top: 10px; font-size: 15px; line-height: 1.55; max-width: 78ch; color: var(--ink); }
.report-inshort strong { font-weight: 600; }
.report-head { padding-bottom: 18px; border-bottom: 3px solid var(--brand-navy); position: relative; }
.report-head::after { content: ""; position: absolute; left: 0; bottom: -7px; width: 72px; height: 3px; background: var(--brand-green); }
/* UX2: the sheet is set like a document on screen as on paper: ink headings with a navy edge, hairlines, spaced-capital labels. */
.report h2 { font-family: var(--font); font-size: 18px; line-height: 1.3; font-weight: 600; margin-top: 30px; letter-spacing: -0.01em;
  color: var(--ink); border-left: 4px solid var(--brand-navy); padding: 2px 0 2px 12px; }
.report .r-sub { margin-top: 8px; }
.report-skel .skel-bar { height: 28px; background: var(--skel); border-left: 4px solid var(--brand-navy); }
.report .r-sub { color: var(--ink-2); font-size: 14px; margin-top: 4px; max-width: 78ch; }
.report .keep { break-inside: avoid; }
/* a chart with its table beside it: the report stays short and nothing is hidden behind a toggle */
.report .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 8px; }
.report .pair .chart { margin-top: 4px; }
/* a table with a fifth column (the on-time table's year earlier, UX2 stop 4; the backlog's "no published target") takes two
   thirds of the row */
.report .pair.pair-wide-table { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.report .pair details.table-view { margin-top: 0; }
.report .pair table.data thead th { white-space: normal; }
.report .pair table.data th, .report .pair table.data td { padding: 4px 6px; }
.report .pair table.data { font-size: 12.5px; }
.report .chart { margin-top: 10px; }
.report details.table-view { border-top: 0; margin-top: 8px; padding-top: 0; }
.report details.table-view > summary { display: none; }
.report table.data { font-size: 13px; }
.report table.data th, .report table.data td { padding: 5px 10px; }
.report table.data thead th { background: none; color: var(--ink); border-radius: 0; border-bottom: 1.5px solid var(--brand-navy); }      /* the sheet's tables: ink and a navy rule, as on paper */
.headline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 12px 0 0; border: 1px solid var(--hairline); border-top: 3px solid var(--brand-navy); border-radius: 0 0 var(--radius-s) var(--radius-s); overflow: hidden; }
.headline > div { padding: 12px 14px; border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); margin: 0 -1px -1px 0; }
.headline dt { font-size: 12px; color: var(--ink-2); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3; }
.headline dd { margin: 3px 0 0; }
.headline dd .v { display: block; font-family: var(--font); font-variant-numeric: lining-nums proportional-nums; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
/* the same dates a year earlier (T7), under the number */
.headline .h-prev { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.headline .h-prev b { color: var(--ink-2); font-weight: 600; }
.headline dd .v.small { font-family: var(--font); font-size: 16px; line-height: 1.35; color: var(--ink-2); letter-spacing: 0; padding: 5px 0 4px; font-weight: 600; }
.headline .h-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.report ul.plain { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.report ul.plain li { margin: 4px 0; max-width: 82ch; }
.report .credit { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
/* A word too long for its line breaks there, and only there (FX2): a city's licence link in the credit and the site's own address in the
   method list are one word each, and ran past a 320 px screen (to 411 px; the address only on the live host, longer than a local one).
   break-word, not anywhere, so no paragraph's or list item's least width changes and no grid or table around one is resized. */
.report p, .report li { overflow-wrap: break-word; }
.report-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--hairline); display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.report-foot .url { overflow-wrap: anywhere; }
.report-foot .url a { color: inherit; }
/* the district map, with the table and the key beside it: seven narrow columns. The table takes the least width
   its words allow and the map gets the rest (about 310px on screen and on Letter, 290px on A4). */
.report .district-layout { grid-template-columns: minmax(0, 1fr) min-content; gap: 12px; margin-top: 10px; align-items: start; }
.report .dmap > svg { max-width: 320px; margin: 0; }
.report .ramp-legend { font-size: 12px; gap: 3px 10px; justify-content: flex-start; }
.report .district-layout table.data { font-size: 12px; }
.report .district-layout table.data th, .report .district-layout table.data td { padding: 5px 3px; }
.report .district-layout table.data thead th { white-space: normal; font-size: 12px; }
.report .barcell .track { max-width: 150px; min-width: 40px; }
.report .stat-pair b { font-size: 20px; }
.report .callout { margin-top: 12px; }

/* When the sheet is narrower than paper, each chart sits above its table instead of beside it. The one column is the sheet's width, never
   a table's least width (FX2: a bare 1fr took the on-time or backlog table's, and the page grew up to 91 px past a 320 px screen): a
   table wider than the sheet scrolls sideways inside its own box (.table-wrap, markScrollers in core.js), never the page. */
@container (max-width: 640px) {
  .report .pair, .report .pair.pair-wide-table { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
.report .district-legend .ramp-legend { margin-top: 12px; padding-left: 3px; }
/* The seven-column district table needs the sheet's full width below 670px. Paper is wider than that
   (Letter 700px, A4 678px between the margins), so print keeps the map beside the table. */
@container (max-width: 670px) {
  .report .district-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }      /* the sheet's width, as the pairs above (FX2) */
  .report .dmap > svg { margin: 0 auto; max-width: 300px; }
  .report .district-side { display: contents; }               /* stacked: map, key, then table */
  .report .district-legend { order: 2; }
  .report .district-legend .ramp-legend { justify-content: center; margin-top: 0; padding-left: 0; }
  .report .district-side .table-wrap { order: 3; }
}
@media screen and (max-width: 899px) {
  .report-controls .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report { padding: 36px 32px 32px; }
}
@media screen and (max-width: 719px) {
  .report-spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-slim .page-title { font-size: 28px; }
  .hero-slim .lede { font-size: 16px; }
  .hero-slim .hero-inner { padding-bottom: 60px; }
  .report-page { margin-top: -40px; padding-left: 8px; padding-right: 8px; }
  .report { padding: 22px 16px 24px; }
  .report-title { font-size: 24px; }
  .headline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-controls .actions .btn { flex: 1 1 100%; }
  .report-controls .actions .share { flex: 1 1 100%; flex-direction: column; align-items: stretch; }
  .report-controls .filter-row .city, .report-controls .filter-row .field:nth-child(4) { grid-column: 1 / -1; }      /* the date menu's longest choice needs the full width */
}
/* Phones: every menu its own full-width row, so the longest choice ("All six repair types") shows in full (founder, PL2); From and
   To stay side by side */
@media screen and (max-width: 479px) {
  .report-controls .filter-row .field:not(.r-custom) { grid-column: 1 / -1; }
}
/* printing from a narrow screen: lay the report out at paper width first */
.report.as-print { width: 816px; padding: 52px 58px 44px; }
.report.as-print .headline { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* No fixed paper size: the print dialog's choice (Letter or A4) applies. Content is laid out to fit both.
   No page margin (founder, PL2): browsers print their own header and footer (the file name, the address, the page count, the date)
   in the page's margins, and with none there is no room for them. The margins are inside the page instead: the sheet's padding,
   repeated on every page (box-decoration-break: clone), and the running line sits in the bottom one. */
@page { margin: 0; }
.print-run { display: none; }
@media print {
  html, body { background: #fff !important; }
  body { font-size: 12pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-header, .site-footer, .skip-link, .no-print { display: none !important; }
  .page, .report-page { max-width: none; padding: 0; margin: 0; }
  .report, .report.as-print { width: auto; border: 0; box-shadow: none; padding: 0.6in; margin: 0; border-radius: 0; background: #fff; --surface: #ffffff; --surface-2: #efede8;
    -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  /* the title and the line under it at the foot of every printed page, and the site's name: fixed, so the browser draws it on each page */
  .print-run { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 18px; position: fixed; left: 0.6in; right: 0.6in; bottom: 0.24in;
    font-size: 8.5pt; line-height: 1.3; color: #3a4e66; }
  /* paper: no dark fills. The heading is ink, with a navy edge that prints as a plain rule. */
  .report h2 { break-after: avoid; margin-top: 20px; }
  .report .r-sub { margin-top: 4px; }
  .report-head { padding-bottom: 14px; }
  .headline > div { padding: 10px 14px; }
  .report .r-sub { break-after: avoid; }
  .report table.data tr { break-inside: avoid; }
  .tooltip { display: none !important; }
  .table-wrap { overflow: visible; }
  /* the district map beside its table as a flex row on paper, the table at its least width as the grid gave it: Firefox splits a
     grid's items across pages without the sheet's repeated padding (a fifty-district table ran into the running line, PL2) */
  .report .district-layout { display: flex; align-items: flex-start; gap: 12px; }
  .report .district-layout > .dmap { flex: 1 1 0; min-width: 0; }
  .report .district-side { flex: none; width: min-content; }
  a { color: inherit; text-decoration: none; }
}
