/* Kenya Debt Clock: the Dashboard page in the navy look (the same design as the home page). Loaded last, after
   navy-site.css and chrome.css. Every rule is scoped to html:not(.kdc-classic), so the classic look is untouched.
   The page's <body> carries data-styled, which turns off site-chrome.js's automatic colour pass, so every colour on
   the page comes from here. !important is used only to beat the page's inline styles and readability.css. */

/* Page: navy, content as wide as the header (same side padding), compact spacing. On desktops the content is at least
   one window tall (window minus the 12px frame, ticker, header and bottom bar), so the bottom bar sits at the bottom. */
html:not(.kdc-classic) body.page-dashboard { background: #0b1a2c !important; }
html:not(.kdc-classic) .page-dashboard .page-main { max-width: none; margin: 0; padding: 16px var(--kdc-pad) 20px; color: #d4dde8;
  min-height: calc(100vh - 24px - 38px - 52px - 42px); }

/* Title block: small label, then the title and its one-line summary side by side. */
html:not(.kdc-classic) .page-dashboard .section-header { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 18px; row-gap: 2px; margin: 0 0 14px; }
html:not(.kdc-classic) .page-dashboard .page-eyebrow { flex-basis: 100%; margin: 0; color: #8fa1b7;
  font: 500 11px/1.4 'IBM Plex Mono', monospace !important; letter-spacing: 0.08em; text-transform: uppercase; }
html:not(.kdc-classic) .page-dashboard .page-main .page-title { margin: 0; color: #f2f5f9; font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
html:not(.kdc-classic) .page-dashboard .section-header p { margin: 0; max-width: none; color: #d4dde8; font-size: 14px; line-height: 1.5; }

/* The four groups as a grid of plain panels: no outline, no coloured edges. */
html:not(.kdc-classic) .page-dashboard .page-main .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; max-width: none; }
html:not(.kdc-classic) .page-dashboard .grid > .card { min-width: 0; max-width: none; padding: 16px 18px; border: 0 !important; border-radius: 12px;
  background: rgba(19, 38, 61, 0.65) !important; box-shadow: none !important; color: #d4dde8 !important; }

/* Panel title (Inter, white) with its source underneath in small quiet type; no red rule under it. */
html:not(.kdc-classic) .page-dashboard .card-title { margin: 0 0 6px; padding: 0; border: 0; color: #f2f5f9; font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em; text-transform: none; line-height: 1.3; }
html:not(.kdc-classic) .page-dashboard .card-title > span { display: block; margin-top: 3px; white-space: normal; color: #8fa1b7 !important;
  font: 400 12px/1.5 'Inter', sans-serif !important; letter-spacing: 0 !important; }
/* The source lines start with a "--" or "-" separator, which only made sense when the source sat beside the title. */
html:not(.kdc-classic) .page-dashboard .card-title .kdc-sep { display: none; }

/* Rows: label on the left, figure on the right, thin dividers between rows. */
html:not(.kdc-classic) .page-dashboard .metric { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: baseline; justify-content: space-between;
  gap: 10px; margin: 0; padding: 6px 0; border-bottom: 1px solid #243950; }
html:not(.kdc-classic) .page-dashboard .metric:last-child { border-bottom: 0; }
html:not(.kdc-classic) .page-dashboard .metric-label { flex: 1 1 auto; min-width: 0; padding: 0; color: #d4dde8; font-size: 13.5px; font-weight: 500; line-height: 1.35; }
html:not(.kdc-classic) .page-dashboard .metric-value { flex: none; margin: 0; text-align: right; white-space: nowrap; color: #f2f5f9;
  font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
/* Red only for the debt itself and what is being borrowed: total debt, debt added today, annual borrowing, the deficit. */
html:not(.kdc-classic) .page-dashboard :is(#totalDebt, #dailyDebt, #brTotal, #annualDeficit) { color: #ef3e4a; }
html:not(.kdc-classic) .page-dashboard #totalDebt { font-size: 17px; }
html:not(.kdc-classic) .page-dashboard .unit-suffix { margin-left: 1px; color: inherit; font-size: 1em; font-weight: inherit; letter-spacing: 0; }
/* Dates and the midnight countdown beside a label go on their own quiet line (steady width while the clock ticks). */
html:not(.kdc-classic) .page-dashboard .metric-label > span[style] { display: block; color: #8fa1b7 !important; font-size: 12px !important;
  font-weight: 400 !important; line-height: 1.4; font-variant-numeric: tabular-nums; }

/* Borrowing panel: the per-day/hour/second group keeps a divider (navy line), and the explanation is a quiet note. */
html:not(.kdc-classic) .page-dashboard .card > div[style*="border-top"] { margin: 0 !important; padding: 0 !important; border-top: 1px solid #243950 !important; }
html:not(.kdc-classic) .page-dashboard .card > div[style*="0.82rem"],
html:not(.kdc-classic) .page-dashboard #socialSources { margin-top: 8px !important; color: #8fa1b7 !important; font-size: 12px !important; line-height: 1.5 !important; }

/* Sources line under the panels. */
html:not(.kdc-classic) .page-dashboard .page-main .sources-note { margin: 12px 0 0; padding: 0; max-width: none; text-align: left; color: #8fa1b7;
  font-size: 12.5px; line-height: 1.6; }

/* Contact: one wide panel, the heading and line on the left, the form on the right. The id in :has() is needed to beat
   readability.css's own rule for this box. */
html:not(.kdc-classic) .page-dashboard .page-main > div:has(#contactForm) { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); column-gap: 24px;
  grid-template-rows: auto 1fr; align-items: start; max-width: none !important; margin: 16px 0 0 !important; padding: 16px 18px !important; border: 0 !important; border-radius: 12px;
  background: rgba(19, 38, 61, 0.65) !important; }
html:not(.kdc-classic) .page-dashboard .page-main > div:has(#contactForm) .projects-title { grid-column: 1; margin: 0 0 4px; color: #f2f5f9 !important;
  text-align: left !important; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; text-transform: none; }
html:not(.kdc-classic) .page-dashboard .page-main > div:has(#contactForm) > p { grid-column: 1; margin: 0 !important; text-align: left !important;
  color: #d4dde8 !important; font-size: 13.5px !important; line-height: 1.5; }
html:not(.kdc-classic) .page-dashboard #contactForm { grid-column: 2; grid-row: 1 / span 2; display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 10px !important; align-items: center; }
html:not(.kdc-classic) .page-dashboard #contactEmail { grid-column: 1; grid-row: 1; }
html:not(.kdc-classic) .page-dashboard #contactForm > div { grid-column: 2; grid-row: 1; white-space: nowrap; color: #d4dde8 !important; font-size: 13px !important; }
html:not(.kdc-classic) .page-dashboard #contactBtn { grid-column: 3; grid-row: 1; }
html:not(.kdc-classic) .page-dashboard #contactMsg { grid-column: 1 / -1; grid-row: 2; height: 58px; }
html:not(.kdc-classic) .page-dashboard #contactStatus { grid-column: 1 / -1; margin: 0; text-align: left !important; font-size: 13px !important; }
/* The form's own success and error colours (set by its script) were dark red and dark green; light versions on navy. */
html:not(.kdc-classic) .page-dashboard #contactStatus[style*="rgb(0, 102, 0)"] { color: #5cc98b !important; }
html:not(.kdc-classic) .page-dashboard #contactStatus[style*="rgb(204, 0, 0)"] { color: #ff6b74 !important; }
html:not(.kdc-classic) .page-dashboard #contactForm :is(input, textarea) { min-height: 38px; padding: 8px 12px !important; border: 0 !important; border-radius: 8px !important;
  background: #07111d !important; box-shadow: inset 0 0 0 1px rgba(150, 205, 255, 0.35); color: #f2f5f9 !important; font-size: 13.5px !important; }
html:not(.kdc-classic) .page-dashboard #contactForm :is(input, textarea)::placeholder { color: #8fa1b7; opacity: 1; }
html:not(.kdc-classic) .page-dashboard #contactForm :is(input, textarea):focus { outline: none; box-shadow: inset 0 0 0 1px #7cc4ff; }
/* Send: the pill button style, in the emphasised (red-tint) state used for the main action. */
html:not(.kdc-classic) .page-dashboard #contactBtn { min-height: 38px; padding: 8px 18px !important; border: 0 !important; border-radius: 999px !important;
  background: rgba(239, 62, 74, 0.18) !important; box-shadow: inset 0 0 0 1px rgba(239, 62, 74, 0.6); color: #fff !important;
  font-size: 13.5px !important; font-weight: 600 !important; white-space: nowrap; }
html:not(.kdc-classic) .page-dashboard #contactBtn:hover:not(:disabled) { background: rgba(239, 62, 74, 0.28) !important; color: #fff !important; }

/* Taller windows: the rows get more air as the window grows (6px at 900px tall up to 12px at 1040px and up), so a big
   screen is not left with a large empty band under the panels. Grows slower than the window, so it always fits. */
@media (min-width: 1101px) {
  html:not(.kdc-classic) .page-dashboard .metric { padding: clamp(6px, calc((100vh - 800px) / 20), 12px) 0; }
}
/* Large screens (about 1920x1080): slightly bigger type and panels. */
@media (min-width: 1600px) and (min-height: 1000px) {
  html:not(.kdc-classic) .page-dashboard .page-main { padding-top: 22px; }
  html:not(.kdc-classic) .page-dashboard .section-header { margin-bottom: 18px; }
  html:not(.kdc-classic) .page-dashboard .page-main .page-title { font-size: 30px; }
  html:not(.kdc-classic) .page-dashboard .section-header p { font-size: 15px; }
  html:not(.kdc-classic) .page-dashboard .page-main .grid { gap: 16px; }
  html:not(.kdc-classic) .page-dashboard .grid > .card { padding: 20px 22px; }
  html:not(.kdc-classic) .page-dashboard .card-title { font-size: 18px; margin-bottom: 8px; }
  html:not(.kdc-classic) .page-dashboard .card-title > span { font-size: 12.5px !important; }
  html:not(.kdc-classic) .page-dashboard .metric-label { font-size: 15px; }
  html:not(.kdc-classic) .page-dashboard .metric-value { font-size: 16px; }
  html:not(.kdc-classic) .page-dashboard #totalDebt { font-size: 20px; }
  html:not(.kdc-classic) .page-dashboard .metric-label > span[style],
  html:not(.kdc-classic) .page-dashboard .card > div[style*="0.82rem"],
  html:not(.kdc-classic) .page-dashboard #socialSources { font-size: 12.5px !important; }
  html:not(.kdc-classic) .page-dashboard .page-main .sources-note { margin-top: 16px; font-size: 13px; }
  html:not(.kdc-classic) .page-dashboard .page-main > div:has(#contactForm) { margin-top: 18px !important; padding: 20px 22px !important; }
  html:not(.kdc-classic) .page-dashboard .page-main > div:has(#contactForm) .projects-title { font-size: 18px; }
  html:not(.kdc-classic) .page-dashboard #contactForm :is(input, textarea), html:not(.kdc-classic) .page-dashboard #contactBtn { min-height: 42px; }
  html:not(.kdc-classic) .page-dashboard #contactMsg { height: 72px; }
}

/* Tablets and small laptops: two panels per row; the contact panel stacks its heading above the form. */
@media (max-width: 1100px) {
  html:not(.kdc-classic) .page-dashboard .page-main .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:not(.kdc-classic) .page-dashboard .page-main { min-height: 0; }
}
@media (max-width: 760px) {
  html:not(.kdc-classic) .page-dashboard .page-main > div:has(#contactForm) { grid-template-columns: minmax(0, 1fr); }
  html:not(.kdc-classic) .page-dashboard #contactForm { grid-column: 1; grid-row: auto; margin-top: 12px; }
}

/* Phones: one column, nothing wider than the screen. */
@media (max-width: 600px) {
  html:not(.kdc-classic) .page-dashboard .page-main { padding: 14px 16px 18px; }
  html:not(.kdc-classic) .page-dashboard .page-main .page-title { font-size: 26px; }
  html:not(.kdc-classic) .page-dashboard .section-header p { font-size: 13.5px; }
  html:not(.kdc-classic) .page-dashboard .page-main .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  html:not(.kdc-classic) .page-dashboard .grid > .card { padding: 14px 16px; }
  html:not(.kdc-classic) .page-dashboard .metric-label { min-width: 0; }
  html:not(.kdc-classic) .page-dashboard .metric-value { margin-left: 0; font-size: 14px; }
  html:not(.kdc-classic) .page-dashboard #totalDebt { font-size: 16px; }
  html:not(.kdc-classic) .page-dashboard .page-main .sources-note { word-break: normal; overflow-wrap: anywhere; }
  html:not(.kdc-classic) .page-dashboard .page-main > div:has(#contactForm) { padding: 14px 16px !important; }
  /* The form goes to one column: email, the message, the sum check, then Send across the full width. */
  html:not(.kdc-classic) .page-dashboard #contactForm { grid-template-columns: minmax(0, 1fr); }
  html:not(.kdc-classic) .page-dashboard #contactEmail { grid-column: 1; grid-row: 1; }
  html:not(.kdc-classic) .page-dashboard #contactMsg { grid-column: 1; grid-row: 2; height: 76px; }
  html:not(.kdc-classic) .page-dashboard #contactForm > div { grid-column: 1; grid-row: 3; }
  html:not(.kdc-classic) .page-dashboard #contactBtn { grid-column: 1; grid-row: 4; }
  html:not(.kdc-classic) .page-dashboard #contactStatus { grid-row: 5; }
}
