/* Scandals page ("Where Did Some of the Money Go?") in the navy look, matching the home page.
   Loaded last on scandals.html. Every rule is scoped to html:not(.kdc-classic), so the classic look is untouched.
   <body data-styled> turns off site-chrome.js's automatic colour pass, so every colour on this page comes from here,
   including the cards the page's script draws from data.json. !important is used only to beat inline styles and the
   !important rules in readability.css / site-fonts.css / navy-site.css. */

html:not(.kdc-classic) body.page-scandals {
  --sc-panel: rgba(19, 38, 61, 0.65); --sc-head: #182f4a; --sc-line: #243950;
  --sc-ink: #f2f5f9; --sc-text: #d4dde8; --sc-quiet: #8fa1b7; --sc-red: #ef3e4a; --sc-link: #7cc4ff;
  --sc-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* Page body: full width with the same side padding as the header, compact top and bottom. */
html:not(.kdc-classic) body.page-scandals .page-main { max-width: none; margin: 0; padding: 20px var(--kdc-pad) 24px; }
/* Short tabs (Presidents) still fill the window, so the bottom bar sits at the bottom of the frame, not mid-screen:
   window height minus the frame (12px top and bottom), ticker (38px), header (52px) and bottom bar (42px). Under 901px the bar stacks into three rows, so this is left off there. */
@media (min-width: 901px) { html:not(.kdc-classic) body.page-scandals .page-main { min-height: calc(100vh - 156px); } }

/* Title block: small mono eyebrow, white title, one line of body text. */
html:not(.kdc-classic) body.page-scandals .section-header { text-align: left; margin: 0 0 16px; }
html:not(.kdc-classic) body.page-scandals .page-eyebrow { font: 500 11px/1.4 var(--sc-mono) !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-quiet); margin: 0 0 6px; }
html:not(.kdc-classic) body.page-scandals .page-main .page-title { font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: var(--sc-ink); margin: 0 0 6px; }
html:not(.kdc-classic) body.page-scandals .section-header p { font-size: 14.5px; line-height: 1.55; color: var(--sc-text); max-width: 860px; }

/* Tabs as pills: the active one red-tinted, the others quiet (replaces the green / boxed buttons). */
html:not(.kdc-classic) body.page-scandals .tab-bar { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; border: 0; margin: 0 0 16px; }
html:not(.kdc-classic) body.page-scandals .tab-bar .tab-btn {
  min-height: 34px; margin: 0; padding: 0 16px; border: 0 !important; border-radius: 999px !important;
  font-size: 13px !important; font-weight: 600; letter-spacing: 0 !important; line-height: 34px;
  background: rgba(255, 255, 255, 0.05) !important; color: var(--sc-text) !important; box-shadow: inset 0 0 0 1px rgba(150, 205, 255, 0.35); }
html:not(.kdc-classic) body.page-scandals .tab-bar .tab-btn:hover { background: rgba(124, 196, 255, 0.10) !important; color: #fff !important; }
html:not(.kdc-classic) body.page-scandals .tab-bar .tab-btn.active { background: rgba(239, 62, 74, 0.18) !important; color: #fff !important; box-shadow: inset 0 0 0 1px rgba(239, 62, 74, 0.6); }
html:not(.kdc-classic) body.page-scandals :focus-visible { outline: 2px solid var(--sc-link); outline-offset: 2px; }

/* Each tab's intro line (inline styles set it dark grey and tiny). */
html:not(.kdc-classic) body.page-scandals .tab-panel > p { font-size: 14px !important; line-height: 1.55; color: var(--sc-text) !important; margin: 0 0 14px !important; max-width: 980px; }

/* ---- Presidents: the table in one panel, mono header row, red only for the debt each president added. ---- */
html:not(.kdc-classic) body.page-scandals #tab-presidents .table-scroll { background: var(--sc-panel); border: 0; border-radius: 12px; margin: 0 0 12px; }
html:not(.kdc-classic) body.page-scandals #tab-presidents table { background: transparent !important; border: 0 !important; border-radius: 0 !important; font-variant-numeric: tabular-nums; }
html:not(.kdc-classic) body.page-scandals #tab-presidents tr { background: transparent !important; border: 0 !important; }
html:not(.kdc-classic) body.page-scandals #tab-presidents th {
  background: var(--sc-head) !important; color: var(--sc-quiet) !important; padding: 9px 12px !important;
  font: 500 11px/1.4 var(--sc-mono) !important; letter-spacing: 0.08em !important; text-transform: uppercase !important; border: 0 !important; }
html:not(.kdc-classic) body.page-scandals #tab-presidents td {
  padding: 10px 12px !important; font-size: 14px !important; line-height: 1.4; color: var(--sc-text) !important; font-weight: 500 !important;
  background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--sc-line) !important; }
html:not(.kdc-classic) body.page-scandals #tab-presidents tbody tr:last-child td { border-bottom: 0 !important; }
html:not(.kdc-classic) body.page-scandals #tab-presidents tbody tr:hover td { background: rgba(124, 196, 255, 0.06) !important; }
/* Numbers right-aligned, including the years column (was centred). */
html:not(.kdc-classic) body.page-scandals #tab-presidents :is(th, td):nth-child(3) { text-align: right !important; }
/* President name, debt at the end of the term and the 2026 value in white; debt added in red; the old orange is gone. */
html:not(.kdc-classic) body.page-scandals #tab-presidents td:is(:nth-child(1), :nth-child(5), :nth-child(8)) { color: var(--sc-ink) !important; font-weight: 600 !important; }
html:not(.kdc-classic) body.page-scandals #tab-presidents td:nth-child(6) { color: var(--sc-red) !important; font-weight: 700 !important; }
/* Notes and sources under the table: small and quiet, left-aligned. */
html:not(.kdc-classic) body.page-scandals #tab-presidents > div > div:not(.table-scroll) {
  max-width: 980px; margin: 6px 0 0 !important; text-align: left !important; font-size: 12px !important; line-height: 1.6 !important; color: var(--sc-quiet) !important; }
html:not(.kdc-classic) body.page-scandals #tab-presidents > div > div:empty { display: none; }

/* ---- Cards (Debt events, Scandals, Missing funds, Resources): one quiet panel each, no outlines or coloured tops. ---- */
html:not(.kdc-classic) body.page-scandals :is(.projects-grid, .defaults-grid) { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
html:not(.kdc-classic) body.page-scandals :is(.project-card, .default-card) {
  background: var(--sc-panel) !important; border: 0 !important; border-radius: 12px; padding: 16px 18px; box-shadow: none !important; opacity: 1; color: var(--sc-text) !important; }
/* navy-site.css gives a card's last block (the source line) its own panel colour: no box inside the box. */
html:not(.kdc-classic) body.page-scandals .project-card > div:last-child { background: transparent !important; }

/* Status / year labels at the top of a card: plain mono text, no coloured pills. */
html:not(.kdc-classic) body.page-scandals :is(.project-status, .badge-ongoing, .badge-resolved) {
  display: inline; padding: 0; margin: 0; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important;
  font: 500 11px/1.5 var(--sc-mono) !important; letter-spacing: 0.08em !important; text-transform: uppercase; color: #a9b8cb !important; }
/* "Media report": a quiet grey pill (overrides its inline light-grey style). */
html:not(.kdc-classic) body.page-scandals .badge:not(.badge-ongoing):not(.badge-resolved) {
  display: inline-block; margin-left: 8px !important; padding: 2px 8px; border: 0 !important; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06) !important; color: #a9b8cb !important; box-shadow: inset 0 0 0 1px rgba(150, 205, 255, 0.25);
  font: 500 10.5px/1.4 var(--sc-mono) !important; letter-spacing: 0.08em !important; text-transform: uppercase; vertical-align: 1px; }
/* The president tag (inline coloured pill from the script) as a small mono label; the year line on scandal cards too. */
html:not(.kdc-classic) body.page-scandals :is(.project-card, .default-card) span[style*="text-transform:uppercase"]:not(.badge) {
  background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 !important; border-radius: 0 !important;
  font: 500 10.5px/1.4 var(--sc-mono) !important; letter-spacing: 0.08em !important; color: var(--sc-quiet) !important; }
html:not(.kdc-classic) body.page-scandals .project-card > span[style*="display:block"] {
  margin: 6px 0 0 !important; font: 500 10.5px/1.4 var(--sc-mono) !important; letter-spacing: 0.08em !important; text-transform: uppercase; color: var(--sc-quiet) !important; }
html:not(.kdc-classic) body.page-scandals :is(.project-card, .default-card) > div[style*="margin"]:has(> span) { margin: 4px 0 4px !important; }

/* Titles. */
html:not(.kdc-classic) body.page-scandals .project-name { font-size: 16px !important; font-weight: 700; line-height: 1.35; color: var(--sc-ink) !important; margin: 4px 0 10px; }
html:not(.kdc-classic) body.page-scandals .default-card-year { font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; color: var(--sc-ink) !important; margin: 8px 0 2px; }
/* The event type is a full phrase ("World Bank $750M ... loan"), so it reads as the card's subtitle, not a mono label. */
html:not(.kdc-classic) body.page-scandals .default-card-type { font-size: 14.5px !important; font-weight: 600; line-height: 1.4; letter-spacing: 0 !important; text-transform: none; color: var(--sc-ink) !important; margin: 2px 0 8px; }

/* Money: big red figures with a small mono label under each. */
html:not(.kdc-classic) body.page-scandals .project-nums { gap: 20px; margin: 0 0 10px; }
html:not(.kdc-classic) body.page-scandals .pn-val { font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--sc-red) !important; }
html:not(.kdc-classic) body.page-scandals .pn-lbl { font: 500 10.5px/1.5 var(--sc-mono) !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-quiet) !important; margin-top: 2px; }
/* Resources are value Kenya holds, not a loss or debt: white instead of the old green. */
html:not(.kdc-classic) body.page-scandals #resourcesGrid .pn-val { color: var(--sc-ink) !important; }
html:not(.kdc-classic) body.page-scandals .default-card-amount { font-size: 15px !important; font-weight: 700; color: var(--sc-red) !important; margin: 8px 0 !important; font-variant-numeric: tabular-nums; }
html:not(.kdc-classic) body.page-scandals .project-multiplier { font-size: 13px !important; font-weight: 600; color: var(--sc-ink) !important; margin: 0 0 8px !important; }

/* Body text and the source line. */
html:not(.kdc-classic) body.page-scandals :is(.project-detail, .default-card-desc) { font-size: 14px !important; line-height: 1.55 !important; color: var(--sc-text) !important; margin: 0 0 10px; }
html:not(.kdc-classic) body.page-scandals .project-source { font-size: 12px !important; line-height: 1.55; color: var(--sc-quiet) !important; border-top: 1px solid var(--sc-line); padding-top: 10px; margin: 0; }
html:not(.kdc-classic) body.page-scandals :is(.project-source, .sources-note, #tab-presidents) a { color: var(--sc-link) !important; text-decoration: none; }
html:not(.kdc-classic) body.page-scandals :is(.project-source, .sources-note, #tab-presidents) a:hover { text-decoration: underline; }

/* ---- Missing funds totals: one strip, two halves split by a divider; unaccounted in red, irregular in white.
   The script writes "label: <span>amount</span><br>label: <span>amount</span><div>note</div>", so the strip is a
   grid: each label sits over its amount, ::before is the divider column, and the note runs underneath. ---- */
html:not(.kdc-classic) body.page-scandals #unaccountedTotal {
  display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); grid-template-rows: auto auto auto; grid-auto-flow: column;
  column-gap: 20px; align-items: end; margin: 14px 0 0 !important; padding: 14px 18px; border-radius: 12px; background: var(--sc-panel);
  text-align: left !important; font: 500 11px/1.4 var(--sc-mono) !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-quiet) !important; }
html:not(.kdc-classic) body.page-scandals #unaccountedTotal:empty { display: none; }
html:not(.kdc-classic) body.page-scandals #unaccountedTotal::before { content: ""; grid-column: 2; grid-row: 1 / 3; align-self: stretch; background: #33465c; }
html:not(.kdc-classic) body.page-scandals #unaccountedTotal br { display: none; }
html:not(.kdc-classic) body.page-scandals #unaccountedTotal > span {
  font: 800 24px/1.2 'Inter', sans-serif !important; letter-spacing: -0.01em; text-transform: none; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--sc-red) !important; }
html:not(.kdc-classic) body.page-scandals #unaccountedTotal > span ~ span { color: var(--sc-ink) !important; }
html:not(.kdc-classic) body.page-scandals #unaccountedTotal > div {
  grid-column: 1 / -1; grid-row: 3; margin: 12px 0 0 !important; padding-top: 10px; border-top: 1px solid var(--sc-line);
  font: 400 12px/1.5 'Inter', sans-serif !important; letter-spacing: 0; text-transform: none; color: var(--sc-quiet) !important; }

/* Resources total: the same panel, plain text with the figures in white (no green or red: not a loss). */
html:not(.kdc-classic) body.page-scandals #resourcesTotal {
  margin: 14px 0 0 !important; padding: 14px 18px; border-radius: 12px; background: var(--sc-panel); text-align: left !important;
  font: 500 14px/1.5 'Inter', sans-serif !important; color: var(--sc-text) !important; }
html:not(.kdc-classic) body.page-scandals #resourcesTotal:empty { display: none; }
html:not(.kdc-classic) body.page-scandals #resourcesTotal > span { color: var(--sc-ink) !important; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
html:not(.kdc-classic) body.page-scandals #resourcesTotal > div { margin-top: 6px !important; font-size: 12px !important; color: var(--sc-quiet) !important; }

/* Sources line at the end of the page. */
html:not(.kdc-classic) body.page-scandals .page-main .sources-note { margin: 18px 0 0; padding: 0; text-align: left; font-size: 12px; line-height: 1.7; color: var(--sc-quiet) !important; }

/* Phones: one column, tighter cards, the tab pills wrap, the table scrolls inside its panel. */
@media (max-width: 600px) {
  html:not(.kdc-classic) body.page-scandals .page-main { padding: 16px var(--kdc-pad) 20px; }
  html:not(.kdc-classic) body.page-scandals .page-main .page-title { font-size: 26px; }
  html:not(.kdc-classic) body.page-scandals .section-header p { font-size: 14px; }
  html:not(.kdc-classic) body.page-scandals .tab-bar { gap: 6px; }
  html:not(.kdc-classic) body.page-scandals .tab-bar .tab-btn { flex: 0 1 auto; padding: 0 13px; min-height: 36px; line-height: 36px; }
  html:not(.kdc-classic) body.page-scandals :is(.projects-grid, .defaults-grid) { grid-template-columns: 1fr; gap: 12px; }
  html:not(.kdc-classic) body.page-scandals :is(.project-card, .default-card) { padding: 14px 16px; }
  html:not(.kdc-classic) body.page-scandals #tab-presidents table { min-width: 760px; }
  html:not(.kdc-classic) body.page-scandals #tab-presidents :is(th, td) { padding: 8px 10px !important; }
  html:not(.kdc-classic) body.page-scandals #tab-presidents td { font-size: 13px !important; }
  html:not(.kdc-classic) body.page-scandals #unaccountedTotal { column-gap: 14px; padding: 12px 14px; }
  html:not(.kdc-classic) body.page-scandals #unaccountedTotal > span { font-size: 20px !important; }
}
