/* CDF page in the navy look (same style as the home page). Loaded last on cdf.html. Every rule is scoped to
   html:not(.kdc-classic), so the classic look is untouched. The page body carries data-styled, which turns off
   site-chrome.js's automatic colour pass, so every colour on this page comes from here. #main is used in the
   selectors so these rules outrank readability.css and navy-site.css (several of their rules use !important). */

/* Page: full width with the header's side padding, compact spacing. */
html:not(.kdc-classic) #main { max-width: none; width: 100%; margin: 0; padding: 22px var(--kdc-pad) 28px; color: #d4dde8 !important; line-height: 1.55; }
html:not(.kdc-classic) #main .section-wrap { max-width: none !important; margin: 0 !important; padding: 0 !important; }

/* Title block: quiet mono eyebrow (was green), 28px white title, light intro text. */
html:not(.kdc-classic) #main .section-header { text-align: left; margin: 0 0 16px; }
html:not(.kdc-classic) #main .page-eyebrow { font: 500 11px/1.2 'IBM Plex Mono', monospace !important; letter-spacing: 0.08em; text-transform: uppercase; color: #8fa1b7 !important; margin: 0 0 6px; }
html:not(.kdc-classic) #main .page-title { font-size: 28px !important; font-weight: 800 !important; line-height: 1.15; letter-spacing: -0.02em !important; color: #fff !important; margin: 0 0 8px !important; }
html:not(.kdc-classic) #main .section-header p { max-width: 920px; font-size: 14px !important; line-height: 1.55; color: #d4dde8 !important; }

/* Summary figures: one strip on a panel with thin dividers (like the home page's four figures), label above value. */
html:not(.kdc-classic) #main .stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; background: rgba(19, 38, 61, 0.65); border-radius: 12px; }
html:not(.kdc-classic) #main .stat-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: none; margin: 0; padding: 14px 18px; text-align: left;
  background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
html:not(.kdc-classic) #main .stat-card + .stat-card { border-left: 1px solid #243950 !important; }
html:not(.kdc-classic) #main .stat-label { order: -1; margin: 0; font: 500 11px/1.35 'IBM Plex Mono', monospace !important; letter-spacing: 0.08em; text-transform: uppercase; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main .stat-val { margin-top: auto; font-size: 24px !important; font-weight: 800 !important; line-height: 1.15; letter-spacing: -0.02em; color: #fff !important; font-variant-numeric: tabular-nums; }
/* Values sit on one line along the bottom of the strip even when a label wraps (margin-top: auto above). Red only for
   the headline payment total. */
html:not(.kdc-classic) #main #grandTotal { color: #ef3e4a !important; }

/* Tables, one style: a panel that scrolls (sideways on small screens), sticky mono header row, quiet row lines. */
html:not(.kdc-classic) #main .table-scroll { margin: 0 0 10px; background: rgba(19, 38, 61, 0.65) !important; border: 0 !important; border-radius: 12px !important;
  overflow: auto; max-height: max(360px, calc(100svh - 200px)); -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(150, 205, 255, 0.35) transparent; }   /* the panel's own scrollbar in the palette (Chrome draws it light grey otherwise) */
html:not(.kdc-classic) #main table { width: 100%; margin: 0; border: 0 !important; border-radius: 0; border-collapse: separate; border-spacing: 0; overflow: visible; background: transparent !important; font-variant-numeric: tabular-nums; }
html:not(.kdc-classic) #main th { position: sticky; top: 0; z-index: 2; background: #182f4a !important; color: #8fa1b7 !important; border: 0 !important; border-bottom: 1px solid #243950 !important;
  font: 500 11px/1.3 'IBM Plex Mono', monospace !important; letter-spacing: 0.06em !important; text-transform: uppercase !important; padding: 10px 10px !important; white-space: nowrap; text-align: right; }
html:not(.kdc-classic) #main td { padding: 9px 10px !important; font-size: 13.5px !important; line-height: 1.4; color: #d4dde8 !important; background: transparent !important;
  border: 0 !important; border-bottom: 1px solid #243950 !important; text-align: right; vertical-align: middle; font-style: normal; font-weight: 400; }
/* No zebra stripes or top/bottom-ten tints, and no light header-row fill behind the cells (readability.css, the page's own
   styles and navy-site.css paint these rows light). */
html:not(.kdc-classic) #main :is(thead, tbody) tr, html:not(.kdc-classic) #main tbody tr:is(.highlight-top, .highlight-bottom) td { background: transparent !important; }
html:not(.kdc-classic) #main tbody tr:hover td { background: rgba(124, 196, 255, 0.06) !important; }
html:not(.kdc-classic) #main tbody tr:last-child td { border-bottom: 0 !important; }

/* Per-year table: year on the left, Board figure in white, report link in blue, register columns muted. */
html:not(.kdc-classic) #main #yearTable th:first-child, html:not(.kdc-classic) #main #yearTable td:first-child { text-align: left; color: #d4dde8 !important; font-weight: 600; }
html:not(.kdc-classic) #main #yearTable th:first-child { color: #8fa1b7 !important; }
html:not(.kdc-classic) #main #yearTable td:nth-child(2) { color: #fff !important; font-weight: 700; }
html:not(.kdc-classic) #main #yearTable td { white-space: nowrap; }   /* years and amounts stay on one line; narrow screens scroll the panel */
html:not(.kdc-classic) #main #yearTable td:nth-child(4) { color: #8fa1b7 !important; }
/* The two totals rows: bold white. */
html:not(.kdc-classic) #main #yearTable tr.sum-row td { background: #182f4a !important; color: #fff !important; font-weight: 700; border-top: 0 !important; }
html:not(.kdc-classic) #main .year-note { margin: 0 0 18px; text-align: left; font-size: 12px !important; line-height: 1.6; color: #8fa1b7 !important; max-width: 1000px; }

/* Links: light blue, underline only on hover. */
html:not(.kdc-classic) #main a { color: #7cc4ff !important; text-decoration: none; }
html:not(.kdc-classic) #main a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Search: dark pill input with a mono label above it. */
html:not(.kdc-classic) #main .search-bar { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 12px; }
html:not(.kdc-classic) #main .search-bar label { font: 500 11px/1.3 'IBM Plex Mono', monospace !important; letter-spacing: 0.08em; text-transform: uppercase; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main #searchInput { width: 100%; max-width: 420px; min-height: 40px; padding: 8px 16px !important; font-size: 14px !important; color: #fff !important;
  background: #07111d !important; border: 1px solid rgba(150, 205, 255, 0.35) !important; border-radius: 999px !important; outline: none; box-shadow: none; }
html:not(.kdc-classic) #main #searchInput:focus { border-color: #7cc4ff !important; }
html:not(.kdc-classic) #main #searchInput::placeholder { color: #8fa1b7; opacity: 1; }

/* Constituency table: rank muted and centred, name on the left in blue, Total in bold white, register sum muted. */
html:not(.kdc-classic) #main #cdfTable { min-width: 900px; }
html:not(.kdc-classic) #main #cdfTable th { cursor: pointer; user-select: none; }
html:not(.kdc-classic) #main #cdfTable th:hover { color: #fff !important; }
html:not(.kdc-classic) #main #cdfTable th .sort-arrow { font-size: 9px; color: #fff; margin-left: 2px; }
html:not(.kdc-classic) #main #cdfTable :is(th, td):nth-child(1) { text-align: center; width: 44px; }
html:not(.kdc-classic) #main #cdfTable td:nth-child(1) { color: #8fa1b7 !important; font-size: 12px !important; }
html:not(.kdc-classic) #main #cdfTable :is(th, td):nth-child(2) { text-align: left; }
html:not(.kdc-classic) #main #cdfTable td:nth-child(2) { min-width: 200px; font-weight: 600; }
html:not(.kdc-classic) #main #cdfTable td:nth-child(2) > a { font-weight: 600; }
html:not(.kdc-classic) #main #cdfTable td:nth-child(n + 3) { white-space: nowrap; }   /* amounts, including the average row's, never wrap */
html:not(.kdc-classic) #main #cdfTable td.amt-total { color: #fff !important; font-weight: 700; }
html:not(.kdc-classic) #main #cdfTable td.reg, html:not(.kdc-classic) #main #cdfTable td.reg a { color: #8fa1b7 !important; opacity: 1; }
html:not(.kdc-classic) #main #cdfTable td.reg a:hover { color: #7cc4ff !important; }
/* Part-paid amounts: italic with an amber star (was red, which this page keeps for the headline total). */
html:not(.kdc-classic) #main #cdfTable td.part { font-style: italic; }
html:not(.kdc-classic) #main #cdfTable td.part::after { content: '*'; color: #f2a900; margin-left: 2px; font-style: normal; }
/* A zero amount is drawn as a dash with an inline grey colour; keep it muted on navy. */
html:not(.kdc-classic) #main #cdfTable td span[style] { color: #8fa1b7 !important; }
/* Register problem flags under a name: small quiet pills. */
html:not(.kdc-classic) #main #cdfTable .flag-note { display: table; margin: 5px 0 0; padding: 2px 8px; max-width: 340px; border-radius: 8px;
  font-size: 11px !important; font-weight: 500; line-height: 1.4; color: #8fa1b7 !important; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px #243950; }
/* Average row: bold white on the header colour. */
html:not(.kdc-classic) #main #cdfTable tr.avg-row td { background: #182f4a !important; color: #fff !important; font-weight: 700; font-style: normal; border-top: 0 !important; }

/* Notes under the table: small and muted. */
html:not(.kdc-classic) #main #resultCount { text-align: left !important; color: #8fa1b7 !important; font-size: 12px !important; margin: 6px 0 0 !important; }
html:not(.kdc-classic) #main .sources-note { margin: 14px 0 0; font-size: 12px !important; line-height: 1.65; color: #8fa1b7 !important; max-width: 1100px; }
html:not(.kdc-classic) #main .sources-note p { margin: 8px 0; font-size: 12px !important; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main #cdfVerification { color: #d4dde8 !important; }

/* Hover tips (tooltips.js) in the navy palette instead of near-black. */
html:not(.kdc-classic) .kdc-tip { background: #07111d; color: #d4dde8; box-shadow: inset 0 0 0 1px rgba(150, 205, 255, 0.35), 0 10px 30px -10px rgba(0, 0, 0, 0.9); }
html:not(.kdc-classic) .kdc-tip::after { border-bottom-color: #07111d; }
html:not(.kdc-classic) :focus-visible { outline-color: #7cc4ff; }

/* Wide windows: the tables fit, so the panel no longer scrolls itself and the header row sticks just under the site
   header (12px frame + 38px ticker + 52px header = 102px) while the page scrolls. overflow: clip keeps the rounded
   corners without making the panel a scroll box. */
@media (min-width: 1200px) {
  html:not(.kdc-classic) #main .table-scroll { overflow: clip; max-height: none; }
  html:not(.kdc-classic) #main th { top: 102px; }
}

/* Tablets: the strip goes to two by two. */
@media (max-width: 900px) {
  html:not(.kdc-classic) #main .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:not(.kdc-classic) #main .stat-card:nth-child(3) { border-left: 0 !important; }
  html:not(.kdc-classic) #main .stat-card:nth-child(n + 3) { border-top: 1px solid #243950 !important; }
}

/* Phones: smaller title and figures; tables scroll sideways inside their panel only (the page never does). The panel
   is a little shorter than the screen (the header covers the top; the bottom bar ends the page on phones), and its
   header row sticks inside it. */
@media (max-width: 600px) {
  html:not(.kdc-classic) #main { padding: 16px var(--kdc-pad) 22px; }
  html:not(.kdc-classic) #main .page-title { font-size: 26px !important; }
  html:not(.kdc-classic) #main .section-header p { font-size: 13.5px !important; }
  html:not(.kdc-classic) #main .stat-card { padding: 12px 14px; }
  html:not(.kdc-classic) #main .stat-val { font-size: 20px !important; }
  html:not(.kdc-classic) #main .stat-label { font-size: 10.5px !important; }
  html:not(.kdc-classic) #main .table-scroll { max-height: max(320px, calc(100svh - 160px)); }
  html:not(.kdc-classic) #main th { padding: 9px 8px !important; }
  html:not(.kdc-classic) #main td { padding: 8px !important; font-size: 13px !important; }
  html:not(.kdc-classic) #main #yearTable th { white-space: normal; min-width: 90px; vertical-align: bottom; }   /* long headings wrap so the figures show without scrolling far */
  html:not(.kdc-classic) #main #cdfTable td:nth-child(2) { min-width: 170px; }
  html:not(.kdc-classic) #main #searchInput { max-width: none; }
}
