/* Debt register page in the navy look (same style as the home page). Loaded last on debt-register.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 debt-register.css and navy-site.css. display is never forced with !important,
   so the page's [hidden] rule still hides the loading, error and empty messages. */

/* 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; font-size: 14px; }

/* Title block: quiet mono eyebrow (was green), 28px white title, light intro text. */
html:not(.kdc-classic) #main .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 h1 { margin: 0 0 8px; font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: #fff !important; }
html:not(.kdc-classic) #main :is(h2, strong, b) { color: #fff !important; }
html:not(.kdc-classic) #main .intro { margin: 0 0 12px; font-size: 14px; color: #d4dde8 !important; }
/* "Not added to today's clock": a plain panel. */
html:not(.kdc-classic) #main .boundary { max-width: 920px; margin: 0 0 10px; padding: 10px 16px; font-size: 13.5px; color: #d4dde8 !important;
  background: rgba(19, 38, 61, 0.65) !important; border: 0 !important; border-radius: 12px; }
/* Revised-edition note: amber left border at low opacity, light text, no fill. */
html:not(.kdc-classic) #main .revision-note { max-width: 920px; margin: 0 0 10px; padding: 4px 16px; font-size: 13px; color: #d4dde8 !important;
  background: transparent !important; border: 0 !important; border-left: 3px solid rgba(242, 169, 0, 0.55) !important; }
html:not(.kdc-classic) #main .source-links { margin: 0 0 16px; font-size: 13px; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main #loading, html:not(.kdc-classic) #main noscript p { font-size: 13px; color: #8fa1b7 !important; }

/* 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; }

/* Summary figures: one panel with thin dividers (like the home page's four figures), label above value. The external
   total leads in red (the headline debt figure); the four details sit beside it, two by two (four across on very wide
   screens). The full-shilling figures are long, so they never wrap. */
html:not(.kdc-classic) #main .summary { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0 0 8px; padding: 0;
  background: rgba(19, 38, 61, 0.65) !important; border: 0 !important; border-radius: 12px; box-shadow: none !important; }
html:not(.kdc-classic) #main .external-total { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 16px 22px; background: transparent !important; color: #d4dde8 !important; }
html:not(.kdc-classic) #main .external-total h2 { 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 #external-total { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; white-space: nowrap; overflow-wrap: normal; color: #ef3e4a !important; font-variant-numeric: tabular-nums; }
html:not(.kdc-classic) #main .external-total span { font-size: 12px; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main .summary-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; border-left: 1px solid #243950; }
html:not(.kdc-classic) #main .summary-details div { display: flex; flex-direction: column; gap: 4px; padding: 12px 18px; border: 0; font-weight: 400; }
html:not(.kdc-classic) #main .summary-details div:nth-child(even) { border-left: 1px solid #243950; }
html:not(.kdc-classic) #main .summary-details div:nth-child(n + 3) { border-top: 1px solid #243950; }
html:not(.kdc-classic) #main .summary-details dt { 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 .summary-details dd { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; color: #fff !important; font-variant-numeric: tabular-nums; }
html:not(.kdc-classic) #main .coverage { margin: 0 0 20px; max-width: 1100px; font-size: 12px; line-height: 1.6; color: #8fa1b7 !important; }

/* Explorer: no card around it (the table has its own panel); heading with the view pills on the right. */
html:not(.kdc-classic) #main .explorer { margin: 0 0 16px; padding: 0; background: transparent !important; border: 0 !important; box-shadow: none !important; }
html:not(.kdc-classic) #main .section-heading { gap: 12px; padding: 0 0 12px; border: 0; }
html:not(.kdc-classic) #main .section-heading h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }

/* Buttons (view switch, reset, paging): pills. Active view: red tint with a red rim; the rest: faint fill, blue rim. */
html:not(.kdc-classic) #main button { min-height: 34px; padding: 6px 16px; font-size: 13px; font-weight: 600; color: #d4dde8 !important; cursor: pointer;
  background: rgba(255, 255, 255, 0.05) !important; border: 0 !important; border-radius: 999px !important; box-shadow: inset 0 0 0 1px rgba(150, 205, 255, 0.35); }
html:not(.kdc-classic) #main button:hover:not(:disabled) { color: #fff !important; background: rgba(124, 196, 255, 0.12) !important; }
html:not(.kdc-classic) #main button[aria-pressed="true"] { color: #fff !important; background: rgba(239, 62, 74, 0.18) !important; box-shadow: inset 0 0 0 1px rgba(239, 62, 74, 0.6); }
html:not(.kdc-classic) #main button:disabled { opacity: 0.4; cursor: default; }

/* Filters: mono labels; search as a dark pill; the category list matches it (dark list via color-scheme). */
html:not(.kdc-classic) #main .filters { gap: 10px 12px; margin: 0 0 10px; }
html:not(.kdc-classic) #main .filters label { gap: 6px; 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 .filters label:first-child { flex: 1 1 320px; max-width: 560px; }
html:not(.kdc-classic) #main :is(input, select) { min-height: 40px; padding: 8px 16px; font: 400 14px/1.3 'Inter', -apple-system, 'Segoe UI', sans-serif !important; letter-spacing: 0; text-transform: none;
  color: #fff !important; background: #07111d !important; border: 1px solid rgba(150, 205, 255, 0.35) !important; border-radius: 999px !important; outline: none; color-scheme: dark; }
html:not(.kdc-classic) #main select { min-width: 200px; cursor: pointer; }
html:not(.kdc-classic) #main :is(input, select):focus { border-color: #7cc4ff !important; }
html:not(.kdc-classic) #main input::placeholder { color: #8fa1b7; opacity: 1; }
html:not(.kdc-classic) #main #reset { min-height: 40px; }
html:not(.kdc-classic) #main #results { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #d4dde8 !important; }
html:not(.kdc-classic) #main .table-note { margin: 0 0 10px; font-size: 12px; color: #8fa1b7 !important; }

/* Table, the site-wide style: a panel (scrolls sideways on small screens), sticky mono header row, quiet row lines,
   numbers right-aligned in tabular figures, a faint blue row hover. */
html:not(.kdc-classic) #main .table-scroll { max-width: 100%; overflow: auto; max-height: max(360px, calc(100svh - 200px)); border: 0 !important; border-radius: 12px;
  background: rgba(19, 38, 61, 0.65) !important; -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%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; background: transparent !important; font-variant-numeric: tabular-nums; }
html:not(.kdc-classic) #main caption { padding: 10px 12px 8px; text-align: left; font-size: 12px; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main th { position: sticky; top: 0; z-index: 2; padding: 10px 12px; text-align: left; white-space: nowrap; 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; text-transform: uppercase; }
html:not(.kdc-classic) #main td { padding: 9px 12px; font-size: 13.5px; line-height: 1.4; color: #d4dde8 !important; background: transparent !important; border: 0 !important; border-bottom: 1px solid #243950 !important; vertical-align: top; }
html:not(.kdc-classic) #main tbody tr { background: transparent !important; }   /* no grey zebra stripes */
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; }
html:not(.kdc-classic) #main :is(th, td).numeric { text-align: right; white-space: nowrap; }
html:not(.kdc-classic) #main td.numeric { color: #fff !important; font-weight: 600; }
/* Loans view: the title opens its details (blue, like a link); the details and source links are secondary. */
html:not(.kdc-classic) #main .loan-details summary { color: #7cc4ff !important; font-weight: 600; }
html:not(.kdc-classic) #main .loan-details p { margin: 4px 0; font-size: 12.5px; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main .loans-table td:last-child a { color: #8fa1b7 !important; white-space: nowrap; }
html:not(.kdc-classic) #main .loans-table td:last-child a:hover { color: #7cc4ff !important; }
html:not(.kdc-classic) #main .zero-note { font-size: 11px; font-weight: 400; color: #8fa1b7 !important; }

/* Paging and the empty message. */
html:not(.kdc-classic) #main .pagination { gap: 14px; margin: 12px 0 0; }
html:not(.kdc-classic) #main #page-status { font: 500 12px/1 'IBM Plex Mono', monospace !important; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main #empty { padding: 16px; font-size: 13px; color: #8fa1b7 !important; }

/* Source and reconciliation: a plain panel; the text inside is small and muted. */
html:not(.kdc-classic) #main .provenance { padding: 12px 18px; font-size: 12.5px; background: rgba(19, 38, 61, 0.65) !important; border: 0 !important; border-radius: 12px; box-shadow: none !important; }
html:not(.kdc-classic) #main .provenance summary { font-size: 13.5px; font-weight: 600; color: #fff !important; }
html:not(.kdc-classic) #main .provenance p { margin: 8px 0; font-size: 12.5px; color: #8fa1b7 !important; }
html:not(.kdc-classic) #main code { font: 500 11.5px/1.5 'IBM Plex Mono', monospace !important; color: #d4dde8 !important; }

/* Load error: a panel with a red left border at low opacity. */
html:not(.kdc-classic) #main #load-error { padding: 12px 16px; margin: 0 0 12px; background: rgba(19, 38, 61, 0.65) !important; border: 0 !important; border-left: 3px solid rgba(239, 62, 74, 0.55) !important; border-radius: 0 12px 12px 0; }
html:not(.kdc-classic) #main #load-error p { margin: 0 0 10px; color: #d4dde8 !important; }

/* Hover tips (tooltips.js) in the navy palette instead of near-black; keyboard focus ring in light blue (was amber). */
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; }

/* Very wide screens: the four details go four across, so the figures read as one strip. */
@media (min-width: 1700px) {
  html:not(.kdc-classic) #main .summary-details { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html:not(.kdc-classic) #main .summary-details div + div { border-left: 1px solid #243950; }
  html:not(.kdc-classic) #main .summary-details div:nth-child(n + 3) { border-top: 0; }
}

/* 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 external total sits above the four details. */
@media (max-width: 900px) {
  html:not(.kdc-classic) #main .summary { grid-template-columns: minmax(0, 1fr); }
  html:not(.kdc-classic) #main .summary-details { border-left: 0; border-top: 1px solid #243950; }
}

/* Phones: one figure per row; filters stacked; 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: 640px) {
  html:not(.kdc-classic) #main { padding: 16px var(--kdc-pad) 22px; }
  html:not(.kdc-classic) #main h1 { font-size: 26px; }
  html:not(.kdc-classic) #main .external-total { padding: 14px 16px; }
  html:not(.kdc-classic) #main #external-total { font-size: 22px; }
  html:not(.kdc-classic) #main .summary-details { grid-template-columns: minmax(0, 1fr); }
  html:not(.kdc-classic) #main .summary-details div { padding: 10px 16px; border-left: 0 !important; }
  html:not(.kdc-classic) #main .summary-details div + div { border-top: 1px solid #243950; }
  html:not(.kdc-classic) #main .filters label:first-child { flex: none; max-width: none; }   /* the filters stack here, so no 320px basis (it became height) */
  html:not(.kdc-classic) #main select { min-width: 0; }
  html:not(.kdc-classic) #main .table-scroll { max-height: max(320px, calc(100svh - 160px)); }
  html:not(.kdc-classic) #main :is(th, td) { padding: 8px 10px; }
  html:not(.kdc-classic) #main td { font-size: 13px; }
}
