/* By Program — the emailed workbook, plus BridgeBI's own numbers beside it.
 *
 * This table is allowed to be dense. It is a spreadsheet he already reads every week, and
 * familiarity is the entire point: same tree, same column order, collapsed on arrival.
 * The design-system rules still hold — Outfit for text, JetBrains Mono + tabular-nums for
 * every figure, navy #0D2A5E, warm off-white ground.
 *
 * The one visual job beyond fidelity: the reader must never confuse a report number with a
 * BridgeBI number. So the two groups are separated by a real gap, the BridgeBI group sits
 * on a tinted ground, and the header labels the source of each.
 */

.bp-page { padding-bottom: 80px; }
.bp-root { display: flex; flex-direction: column; gap: 18px; }

.bp-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.bp-h1 { font-size: 26px; font-weight: 700; color: var(--navy); letter-spacing: -0.02em; }
.bp-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ------------------------------------------------------------------ intake --- */

.bp-drop {
  background: #fff; border: 2px dashed var(--border); border-radius: 14px;
  padding: 44px 24px; text-align: center;
}
.bp-drop-h { font-size: 16px; font-weight: 700; color: var(--navy); }
.bp-drop-s { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 16px; }
.bp-btn {
  display: inline-block; background: var(--navy); color: #fff; border: none;
  border-radius: 9px; padding: 10px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.bp-btn:hover { background: var(--navy-light); }
.bp-btn-sm { padding: 6px 12px; font-size: 12px; }
.bp-err {
  margin-top: 14px; font-size: 12.5px; color: var(--red);
  background: rgba(178, 59, 59, 0.08); border-radius: 8px; padding: 9px 12px;
}

.bp-tabs { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.bp-tab {
  border: 1px solid var(--border); background: #fff; color: var(--navy);
  border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.bp-tab:hover { background: var(--off-white); }
.bp-tab.bp-on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ------------------------------------------------------------------- table --- */

.bp-card {
  background: #fff; border: 1px solid var(--border); border-radius: 13px;
  box-shadow: 0 1px 3px var(--shadow); overflow: hidden;
}
.bp-card-h {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.bp-title { font-size: 17px; font-weight: 700; color: var(--navy); }
.bp-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-muted); }
.bp-legend span { display: flex; align-items: center; gap: 6px; }
.bp-legend i { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.bp-k-file { background: var(--text-muted); }
.bp-k-bb { background: var(--navy); }

/* Wide content scrolls in its own box; the page body never scrolls sideways. */
.bp-scroll { overflow-x: auto; }

.bp-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bp-t th, .bp-t td { padding: 6px 10px; white-space: nowrap; }

.bp-hg th {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); background: var(--off-white); text-align: center;
  border-bottom: 1px solid var(--border);
}
.bp-hg-bb { background: rgba(13, 42, 94, 0.07) !important; color: var(--navy) !important; }
.bp-hm th {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); background: var(--warm-white); text-align: right;
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
}
.bp-hm th.bp-lbl { text-align: left; }

.bp-lbl { text-align: left; color: var(--navy); }
.bp-lbl-s { padding-left: 30px !important; color: var(--text-muted); font-weight: 500; }
.bp-car { color: var(--text-muted); font-size: 10px; margin-right: 6px; }

/* Every figure is monospace + tabular so columns line up like the spreadsheet does. */
.bp-n {
  text-align: right; font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.bp-dim { color: var(--text-muted); }
.bp-pos { color: var(--green); font-weight: 600; }
.bp-neg { color: var(--red); font-weight: 600; }

/* The visual firewall between the two sources. */
.bp-sep { width: 14px; padding: 0 !important; background: var(--off-white); }
.bp-bb { background: rgba(13, 42, 94, 0.045); }

.bp-e { cursor: pointer; border-top: 1px solid var(--border); }
.bp-e:hover td { background: rgba(13, 42, 94, 0.03); }
.bp-e:hover td.bp-bb { background: rgba(13, 42, 94, 0.075); }

/* An expandable row is a BANNER, the way the workbook draws it: solid navy, white text. This
 * is the row you click to open, so it has to read as the lid of the group. */
.bp-total td, .bp-school td { background: var(--navy); color: #fff; font-weight: 700; }
.bp-total td.bp-n, .bp-school td.bp-n,
.bp-total td.bp-dim, .bp-school td.bp-dim,
.bp-total td.bp-pos, .bp-school td.bp-pos { color: #fff; }

/* A NEGATIVE STAYS RED, on a navy band as much as anywhere else. Painting the whole banner
 * white swallowed the losses: Business (25) -44%, Culinary (32) -21%, Technology (12) -50% all
 * read the same as a gain. The sign is the single most important thing in the column, so it
 * gets its own step — --red is far too dark to read on navy, this one clears 6:1 against it. */
.bp-total td.bp-neg, .bp-school td.bp-neg { color: #FF9A9A; }
.bp-total .bp-car, .bp-school .bp-car { color: rgba(255, 255, 255, 0.7); }
.bp-total .bp-kids, .bp-school .bp-kids {
  background: rgba(255, 255, 255, 0.18); color: #fff;
}
/* Keep the report/BridgeBI firewall visible THROUGH the navy band — a light gap instead of the
 * warm one, so the band still reads as one row. */
.bp-total td.bp-sep, .bp-school td.bp-sep { background: rgba(255, 255, 255, 0.22); }
.bp-total td.bp-bb, .bp-school td.bp-bb { background: var(--navy-light); }
.bp-e.bp-total:hover td, .bp-e.bp-school:hover td { background: var(--navy-light); }
.bp-e.bp-total:hover td.bp-sep, .bp-e.bp-school:hover td.bp-sep { background: rgba(255, 255, 255, 0.3); }

/* A program sits between a school banner and its sources: same shape, lighter weight, so three
 * tiers stay tellable apart. The workbook only ever shows two of them open at once. */
.bp-prog td { background: rgba(13, 42, 94, 0.10); font-weight: 600; }
.bp-prog td.bp-bb { background: rgba(13, 42, 94, 0.14); }
.bp-prog .bp-lbl { font-weight: 600; }
.bp-e.bp-prog:hover td { background: rgba(13, 42, 94, 0.16); }
.bp-kids {
  display: inline-block; margin-left: 7px; font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  background: var(--off-white); border-radius: 5px; padding: 1px 5px;
}

.bp-s td { border-top: 1px solid rgba(0, 0, 0, 0.05); background: #fff; }

/* Group subtotals sit on a gray band in the workbook — TOTAL LEADS w/o HS, Digital Leads,
 * Paid Digital Leads, No-Paid Digital Leads. That band is what makes the tree readable at a
 * glance: bold navy text alone left every one of the 17 rows looking equally important. */
.bp-grp td { background: #DBD7D0; font-weight: 700; color: var(--navy); }
.bp-grp td.bp-bb { background: #CFCEC9; }
.bp-grp .bp-lbl-s { color: var(--navy); font-weight: 700; font-style: normal; }

/* Single sources are italic in the sheet. Indentation is set per row from the tree's real
 * depth, so Paid Search sits under Paid Digital Leads, which sits under Digital Leads. */
.bp-leaf .bp-lbl-s { font-style: italic; color: var(--text); font-weight: 500; }

/* The cycle-alignment notice. Loud on purpose: an unaligned gap column is a wrong number
 * wearing the clothes of a finding. */
.bp-align {
  background: rgba(199, 125, 27, 0.09); border: 1px solid rgba(199, 125, 27, 0.4);
  border-radius: 12px; padding: 14px 16px;
}
.bp-align-ok {
  background: rgba(46, 125, 82, 0.08); border-color: rgba(46, 125, 82, 0.4);
  font-size: 12.5px; color: var(--text);
}
.bp-align-h { font-size: 14px; font-weight: 700; color: var(--amber); }
.bp-align-b { font-size: 12.5px; line-height: 1.6; color: var(--text); margin: 6px 0 12px; max-width: 92ch; }
.bp-align-warn {
  font-size: 12px; line-height: 1.5; color: var(--text); margin-bottom: 12px;
  background: rgba(178, 59, 59, 0.08); border-left: 3px solid var(--red);
  border-radius: 0 7px 7px 0; padding: 8px 10px;
}
.bp-align-busy {
  background: rgba(13, 42, 94, 0.06); border-color: rgba(13, 42, 94, 0.3);
  font-size: 12.5px; color: var(--navy); font-weight: 600;
}

/* Why the BridgeBI column is empty, when it is. */
.bp-diag {
  font-size: 11.5px; line-height: 1.55; color: var(--text-muted);
  background: var(--off-white); border-radius: 9px; padding: 9px 12px;
}
.bp-diag b { color: var(--navy); }
.bp-diag-bad {
  background: rgba(178, 59, 59, 0.07); border-left: 3px solid var(--red);
  border-radius: 0 9px 9px 0; color: var(--text);
}

/* Metric sections. These are the seven blocks the workbook stacks vertically — lead
 * volume, enrollment, conversion — so they are the primary control, not a detail. */
.bp-secs {
  display: flex; gap: 6px; padding: 12px 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); background: var(--warm-white);
}
.bp-sec {
  border: 1px solid var(--border); background: #fff; border-radius: 9px;
  padding: 7px 12px; cursor: pointer; font-family: inherit; text-align: left;
  font-size: 11.5px; font-weight: 600; color: var(--navy); line-height: 1.3;
}
.bp-sec:hover { background: var(--off-white); }
.bp-sec b {
  display: block; font-family: 'JetBrains Mono', monospace; font-size: 14px;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.bp-sec.bp-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.bp-sec.bp-on b { color: #fff; }
.bp-align-h2 { font-size: 13.5px; font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.bp-align-ok .bp-align-b { color: var(--text); }

/* ------------------------------------------------------- history + report card --- */

/* The week selector. History is the point of storing these files, so the weeks are the
 * first control on the page, above the divisions. */
.bp-weeks { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bp-weeks-k {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-muted); margin-right: 3px;
}
.bp-wk {
  display: inline-flex; align-items: baseline; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--navy);
  border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.bp-wk:hover { background: var(--off-white); }
.bp-wk i {
  font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  font-variant-numeric: tabular-nums; color: var(--text-muted);
}
.bp-wk.bp-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.bp-wk.bp-on i { color: rgba(255, 255, 255, 0.75); }
.bp-btn-ghost { background: transparent; color: var(--navy); border: 1px dashed var(--border); }
.bp-btn-ghost:hover { background: var(--off-white); }

/* The report card: where the number is, which way it moved, and against prior year.
 * Visual first — he reads this before the table, and the table is opt-in from here. */
.bp-rc {
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: 13px;
  box-shadow: 0 1px 3px var(--shadow); overflow: hidden;
}
.bp-rc > div { padding: 16px 20px; }
.bp-rc-main { flex: 1 1 260px; border-top: 3px solid var(--navy); }
.bp-rc-py { flex: 0 1 200px; border-left: 1px solid var(--border); border-top: 3px solid transparent; }
.bp-rc-spark { flex: 1 1 300px; border-left: 1px solid var(--border); border-top: 3px solid transparent; }
.bp-rc-k {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.bp-rc-v {
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1.15; margin-top: 4px;
}
.bp-rc-d { margin-top: 5px; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.bp-wow {
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 13.5px; font-weight: 700;
}
.bp-wow-na, .bp-wow-vs { font-family: inherit; font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
/* No `color` here: .bp-pos / .bp-neg are also single-class selectors and are defined EARLIER
 * in this file, so declaring a color on this rule silently won the tie and painted every
 * prior-year delta the same neutral ink. The default is scoped to the un-signed case instead. */
.bp-rc-pyv {
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 24px; font-weight: 700; margin-top: 6px;
}
.bp-rc-pyv:not(.bp-pos):not(.bp-neg) { color: var(--text); }
.bp-rc-pys { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* One series, one hue, magnitude — so only the newest bar is labelled and the rest carry
 * their value on hover. 2px gaps keep adjacent bars from reading as one block. */
.bp-bars { display: flex; align-items: stretch; gap: 2px; margin-top: 9px; }
.bp-bar { flex: 1 1 0; display: flex; flex-direction: column; min-width: 26px; cursor: default; }
/* The fill is a percentage of the TRACK, not of the whole column. Sizing it against the
 * column made a 100% bar plus its label overflow the box and clip the newest week's date. */
.bp-bar-track { height: 62px; display: flex; align-items: flex-end; }
.bp-bar-fill {
  width: 100%; background: rgba(13, 42, 94, 0.28); border-radius: 4px 4px 0 0; min-height: 3px;
}
.bp-bar-on .bp-bar-fill { background: var(--navy); }
.bp-bar-x {
  font-size: 9.5px; color: var(--text-muted); text-align: center; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bp-bar-on .bp-bar-x { color: var(--navy); font-weight: 700; }

/* Week-over-week on the metric tabs, so the control he already clicks is the report card. */
.bp-sec u {
  display: block; text-decoration: none; margin-top: 1px;
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 10.5px; font-weight: 700; color: var(--text-muted);
}
.bp-sec.bp-on u, .bp-sec.bp-on u.bp-pos, .bp-sec.bp-on u.bp-neg { color: rgba(255, 255, 255, 0.85); }

.bp-load { padding: 34px 20px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* -------------------------------------------- Δ vs reporte: agreement, not performance --- */

/* This column answers "do the two systems agree", so it deliberately does NOT use the red =
 * loss / plain = gain vocabulary of the report columns beside it. Sharing that vocabulary is
 * what put "+2,771" in red and made a 0.1% match shout as loud as a 99.8% miss.
 *
 * Three steps by how far apart the numbers are: a close match is quiet, a big gap is loud.
 * `td.` prefixes so these outrank `.bp-grp td`, which sets a colour of its own.
 * Contrast measured against every background this cell actually sits on:
 *   #7E4F0A -> 6.98:1 white, 4.86:1 gray band | #E8A33D -> 6.45:1 navy | #FF9A9A -> 6.85:1 navy
 */
td.bp-gap-ok { color: var(--text-muted); }
td.bp-gap-warn { color: #7E4F0A; font-weight: 600; }
td.bp-gap-bad { color: var(--red); font-weight: 700; }

.bp-total td.bp-bb.bp-gap-ok,   .bp-school td.bp-bb.bp-gap-ok   { color: rgba(255, 255, 255, 0.7); }
.bp-total td.bp-bb.bp-gap-warn, .bp-school td.bp-bb.bp-gap-warn { color: #E8A33D; }
.bp-total td.bp-bb.bp-gap-bad,  .bp-school td.bp-bb.bp-gap-bad  { color: #FF9A9A; }

/* Status colour never carries the meaning alone — the legend says what the steps mean. */
.bp-legend i.bp-k-gap { background: linear-gradient(90deg, var(--text-muted) 0 33%, #7E4F0A 33% 66%, var(--red) 66%); }

/* ------------------------------------------------------- loading skeleton --- */

/* The page's own shape while the history is still on the wire. NOT the empty state — showing
 * "no hay reportes guardados" before asking the server told him to upload files he had already
 * stored, and then swapped itself out a second later. And not a bare spinner either: these
 * boxes sit exactly where the real content lands, so data FILLS them instead of replacing a
 * different page and shoving everything down.
 */
.bp-skel { display: flex; flex-direction: column; gap: 18px; }

/* The status sits in the header's subtitle slot — same line height as the text it replaces, so
 * nothing below it moves when the data arrives. */
.bp-sub-load { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bp-sk-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--navy);
  animation: bp-pulse 1.15s ease-in-out infinite;
}
@keyframes bp-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1); }
}

/* One shimmer definition for every placeholder. */
.bp-sk {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(13, 42, 94, 0.055) 0%, rgba(13, 42, 94, 0.115) 50%, rgba(13, 42, 94, 0.055) 100%);
  background-size: 220% 100%;
  animation: bp-shimmer 1.5s linear infinite;
}
@keyframes bp-shimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
/* Motion is decoration here; the layout already communicates "loading". */
@media (prefers-reduced-motion: reduce) {
  .bp-sk, .bp-sk-dot { animation: none; }
  .bp-sk-dot { opacity: 0.6; }
}

.bp-sk-bar { display: flex; gap: 7px; flex-wrap: wrap; }
.bp-sk-chip { height: 34px; border-radius: 9px; }

.bp-sk-card {
  display: flex; gap: 0; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: 13px;
  box-shadow: 0 1px 3px var(--shadow); overflow: hidden;
}
.bp-sk-pane {
  flex: 1 1 260px; padding: 16px 20px; display: flex; flex-direction: column; gap: 9px;
  border-top: 3px solid transparent;
}
.bp-sk-pane:first-child { border-top-color: var(--navy); }
.bp-sk-pane + .bp-sk-pane { border-left: 1px solid var(--border); }
.bp-sk-pane-sm { flex: 0 1 200px; }
.bp-sk-k { height: 10px; width: 96px; }
.bp-sk-big { height: 34px; width: 152px; }
.bp-sk-mid { height: 24px; width: 96px; }
.bp-sk-s { height: 11px; width: 132px; }
.bp-sk-bars { display: flex; align-items: flex-end; gap: 2px; height: 62px; }
.bp-sk-bars .bp-sk { flex: 1 1 0; border-radius: 4px 4px 0 0; }

.bp-sk-table {
  background: #fff; border: 1px solid var(--border); border-radius: 13px;
  box-shadow: 0 1px 3px var(--shadow); overflow: hidden;
}
.bp-sk-secs { padding: 12px 18px; background: var(--warm-white); border-bottom: 1px solid var(--border); }
.bp-sk-secs .bp-sk-chip { height: 40px; }
.bp-sk-rows { padding: 0; }
.bp-sk-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px;
  border-top: 1px solid var(--border);
}
.bp-sk-row:first-child { border-top: none; }
.bp-sk-lbl { height: 12px; }
.bp-sk-num { height: 12px; width: 62px; margin-left: auto; }
.bp-sk-row .bp-sk-num + .bp-sk-num { margin-left: 0; }
/* Inside the already-drawn table card, the placeholder rows need no card of their own. */
.bp-sk-inline { border-top: 1px solid var(--border); }

/* A history read that failed is a connection problem, not missing data — say which. */
.bp-align-warnbox {
  background: rgba(178, 59, 59, 0.07); border: 1px solid rgba(178, 59, 59, 0.35);
}
.bp-align-warnbox .bp-align-h2 { color: var(--red); }

/* ---------------------------------------------------------------- scope bar --- */

/* Chips, not paragraphs. The scope has to be visible — a filter nobody can see is how this app
 * once read 6,215 leads against 59,395 — but it states itself the way an instrument does: short,
 * exact, and with the reasoning in the hover title. Explanatory body copy in a bordered box
 * reads as a prototype, which is not what gets shown to Omaika, Jennifer and Goncal. */
.bp-scope { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  color: var(--text-muted); background: #fff;
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px;
  cursor: default;
}
.bp-chip-n { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
/* A chip carrying a caveat is tinted, never filled — it annotates the data, it does not compete
 * with the table's own red. */
.bp-chip-ok   { color: var(--navy); border-color: rgba(13, 42, 94, 0.3); }
.bp-chip-warn { color: #7E4F0A; border-color: rgba(199, 125, 27, 0.45); background: rgba(199, 125, 27, 0.06); }
.bp-chip-bad  { color: var(--red);  border-color: rgba(178, 59, 59, 0.45); background: rgba(178, 59, 59, 0.06); }
.bp-chip-busy { color: var(--navy); border-style: dashed; }
.bp-chip[title] { cursor: help; }

/* The second week row: the weeks INSIDE the selected report cut. Smaller than the cut chips,
 * because a cut is the coarser, more complete thing and must stay the primary choice. */
.bp-weeks-sub { margin-top: -8px; }
.bp-wk-sm { padding: 5px 10px; font-size: 12px; }

/* --------------------------------------------------- reorder, picker, marks --- */

.bp-tab[draggable="true"] { cursor: grab; }
.bp-tab-drag { opacity: 0.45; }
.bp-tab-over { box-shadow: inset 3px 0 0 var(--navy); }
.bp-tab-ghost { border-style: dashed; color: var(--text-muted); padding: 8px 11px; }

/* The metric picker. Hiding Net Starts / Show Rate is his focus decision, so the button carries
 * the count — an omission you cannot see is the part that bites. */
.bp-sec-cog { color: var(--text-muted); border-style: dashed; }
.bp-pick {
  position: absolute; z-index: 40; margin-top: 44px;
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 8px 24px var(--shadow); padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.bp-pick-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 7px;
  font-size: 12.5px; color: var(--navy); cursor: pointer; white-space: nowrap;
}
.bp-pick-row:hover { background: var(--off-white); }
.bp-secs { position: relative; }

/* HIS mark has to out-read everything else on the row — it is a judgement, not a computed
 * formatting rule. A left rule plus a tint, so it survives the navy banner and the gray group
 * band alike without repainting either. */
/* A 16% tint disappeared on the navy banner, and a mark that has to be hunted for is not a mark.
 * So: a fat left bar on every row type, plus a tint strong enough to survive navy. The bar is
 * what carries it — the tint only has to make the row scannable in a wall of banners. */
.bp-mk-bad  td:first-child { box-shadow: inset 6px 0 0 var(--red); }
.bp-mk-good td:first-child { box-shadow: inset 6px 0 0 var(--green); }
.bp-mk-bad  td { background-image: linear-gradient(rgba(178, 59, 59, 0.42), rgba(178, 59, 59, 0.42)); }
.bp-mk-good td { background-image: linear-gradient(rgba(46, 125, 82, 0.42), rgba(46, 125, 82, 0.42)); }
/* On the light rows a 42% wash would drown the numbers; they get a softer one plus the bar.
 * ('eh' is already handled further down, in grey — neutral has no colour by design.) */
.bp-s.bp-mk-bad  td, .bp-prog.bp-mk-bad  td { background-image: linear-gradient(rgba(178, 59, 59, 0.14), rgba(178, 59, 59, 0.14)); }
.bp-s.bp-mk-good td, .bp-prog.bp-mk-good td { background-image: linear-gradient(rgba(46, 125, 82, 0.14), rgba(46, 125, 82, 0.14)); }

.bp-menu {
  position: absolute; z-index: 50; min-width: 190px;
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 10px 28px var(--shadow); padding: 7px;
}
.bp-menu-h {
  font-size: 12px; font-weight: 700; color: var(--navy); padding: 5px 9px 7px;
  border-bottom: 1px solid var(--border); margin-bottom: 5px;
}
.bp-menu-h i { display: block; font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.bp-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 7px; padding: 7px 9px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--navy); cursor: pointer;
}
.bp-menu button:hover { background: var(--off-white); }
.bp-menu button.bp-on { background: var(--off-white); }
.bp-sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.bp-sw-bad { background: var(--red); }
.bp-sw-good { background: var(--green); }

/* A disabled recinto chip: the weekly tab is Total-only, so the combination does not exist.
 * Disabled and explained beats silently showing Total under a recinto's name. */
.bp-wk[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Neutral. Not a colour between red and green — an explicit "seen it, not a finding". Amber
 * would read as a mild warning; a grey rule reads as a decision that nothing is wrong. */
.bp-sw-eh { background: var(--text-muted); }
.bp-mk-eh td:first-child { box-shadow: inset 6px 0 0 var(--text-muted); }
.bp-mk-eh td { background-image: linear-gradient(rgba(120, 120, 120, 0.26), rgba(120, 120, 120, 0.26)); }
.bp-s.bp-mk-eh td, .bp-prog.bp-mk-eh td { background-image: linear-gradient(rgba(120, 120, 120, 0.1), rgba(120, 120, 120, 0.1)); }

/* ------------------------------------------------------------ trend chart --- */

/* Canvas, not SVG or DOM: the capture button has to produce the EXACT chart, and a canvas is one
 * toBlob away from a PNG. No library either — the CSP is script-src 'self'. */
.bp-trend .bp-card-h { align-items: center; }
.bp-trend-wrap { position: relative; padding: 6px 10px 12px; }
.bp-trend-wrap canvas { display: block; width: 100%; }
.bp-sec-sm { padding: 6px 11px; font-size: 11.5px; }

/* The hover layer. A canvas has nothing to hover, so this floats over it and is fed by the same
 * scales the draw kept — recomputing them would let the tooltip describe a different chart. */
.bp-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 176px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 22px var(--shadow); padding: 9px 11px;
  font-size: 11.5px; color: var(--text);
}
.bp-tip > b { display: block; font-size: 12.5px; color: var(--navy); }
.bp-tip > i {
  display: block; font-style: normal; font-size: 10.5px; color: var(--text-muted);
  margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid var(--border);
}
.bp-tip span { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.bp-tip span > i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.bp-tip span > b {
  margin-left: auto; font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  color: var(--navy);
}
.bp-tip span > u {
  text-decoration: none; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--text-muted); margin-left: 6px;
}

/* The PY toggle sits after a divider, because it is not another metric — it is a layer on all of
 * them. The dashes in its label are the legend: same hue, dashed, means last year. */
.bp-trend-div { width: 1px; align-self: stretch; background: var(--border); margin: 0 5px; }
.bp-sec-py { font-family: 'JetBrains Mono', monospace; letter-spacing: -0.04em; }

/* The view dropdown. A native select on purpose: it is a one-of-many choice, it is keyboard and
 * screen-reader correct for free, and it costs no JS. */
.bp-trend-act { display: flex; align-items: center; gap: 8px; }
.bp-select {
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--navy);
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; cursor: pointer; max-width: 250px;
}
.bp-select:hover { background: var(--off-white); }

/* ----------------------------------------------------------------- the brush --- */

/* PowerBI's scrubber, and deliberately in the DOM rather than on the canvas: the capture button
 * exists so this chart can be pasted into an e-mail, and a scrubber baked into that PNG would be
 * a control nobody can use. */
.bp-brush { padding: 4px 14px 12px; }
.bp-brush-track {
  position: relative; height: 26px; margin: 0 10px;
  background: var(--off-white); border-radius: 7px;
}
.bp-brush-tick {
  position: absolute; top: 9px; width: 2px; height: 8px; margin-left: -1px;
  background: rgba(13, 42, 94, 0.18); border-radius: 1px;
}
.bp-brush-tick.on { background: rgba(13, 42, 94, 0.5); }
.bp-brush-span {
  position: absolute; top: 0; bottom: 0;
  background: rgba(13, 42, 94, 0.12); border-radius: 7px;
  border-left: 1px solid rgba(13, 42, 94, 0.3); border-right: 1px solid rgba(13, 42, 94, 0.3);
}
/* Real buttons, so they are focusable and the arrow keys work — a drag-only control is unusable
 * without a pointer. */
.bp-brush-h {
  position: absolute; top: -3px; transform: translateX(-50%);
  min-width: 34px; height: 32px; padding: 0 6px;
  background: var(--navy); color: #fff; border: 2px solid #fff; border-radius: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  cursor: grab; box-shadow: 0 2px 6px var(--shadow); touch-action: none;
}
.bp-brush-h:active { cursor: grabbing; }
.bp-brush-h:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.bp-brush-foot {
  display: flex; align-items: center; gap: 10px; margin: 10px 10px 0;
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.bp-brush-all {
  margin-left: auto; border: 1px solid var(--border); background: #fff; color: var(--navy);
  border-radius: 7px; padding: 4px 10px; font-family: inherit; font-size: 10.5px;
  font-weight: 700; cursor: pointer;
}
.bp-brush-all:hover { background: var(--off-white); }

/* The two full-year deltas BridgeBI computes. The file states the other five, so these are set
 * apart by a left hairline and a dotted header underline rather than by colour — they are the
 * same KIND of number, just not from the workbook, and colouring them would read as a value
 * judgment about the figure instead of a note about its source. */
.bp-th-calc { border-left: 1px solid var(--border); text-decoration: underline dotted; text-underline-offset: 3px; }
td.bp-calc { border-left: 1px solid var(--border); }
