:root {
  /* Palette drawn from Sudan's 1956 independence flag: Nile blue, desert yellow, field green. */
  --nile: #143f96;
  --desert: #f2cf1d;
  --field: #0a7a3a;
  --bg: #ffffff;
  --fg: #0e1c3d;
  --muted: #55607a;
  --accent: var(--nile);
  --card: #f6f7f9;
  --border: #d9dee6;
  /* The two banks of the home page: White Nile silt, Blue Nile water. */
  --silt: #dde2e4;
  --bank: #123a8c;
  --on-bank: #eef3ff;
  --display: "Bodoni Moda", Didot, "Iowan Old Style", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --nile: #86a9ff;
    --desert: #f2d84b;
    --field: #57c98b;
    --bg: #0d1626;
    --fg: #e8edf5;
    --muted: #9fb0c8;
    --card: #142037;
    --border: #26375a;
    --silt: #172338;
    --bank: #0f2a66;
    --on-bank: #e6edff;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Commissioner, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  line-height: 1.6;
}
header, main, footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
/* Both flags meet across the top, like the two Niles: today's flag (red, white, black, green
   triangle) from the left, the 1956 independence flag (blue, yellow, green) from the right.
   Fixed colours, so dark mode keeps them true. */
body::before {
  content: "";
  display: block;
  height: 14px;
  background:
    linear-gradient(to bottom right, #007229 50%, transparent 50.5%) left top / 34px 50% no-repeat,
    linear-gradient(to top right, #007229 50%, transparent 50.5%) left bottom / 34px 50% no-repeat,
    linear-gradient(to bottom, #d21034 0 33.34%, #ffffff 33.34% 66.67%, #000000 66.67%)
      left / 50% 100% no-repeat,
    linear-gradient(to bottom, #1f4fbf 0 33.34%, #f2cf1d 33.34% 66.67%, #0a7a3a 66.67%)
      right / 50% 100% no-repeat;
}
h1, h2 {
  font-family: var(--display);
  text-wrap: balance;
}
header h1 { margin: 0; font-size: 2.2rem; color: var(--nile); letter-spacing: -0.01em; }
.tagline { margin: 0.25rem 0 0; color: var(--muted); font-size: 1.1rem; }
h2 { margin-top: 2rem; font-size: 1.35rem; }
h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  margin-top: 0.35rem;
  background: var(--desert);
}
ul { padding-left: 1.25rem; }
.facts { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.facts li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.figure {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--field);
  font-variant-numeric: tabular-nums;
}
.source { display: block; color: var(--muted); font-size: 0.9rem; }
footer { color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border); }
footer p { margin: 0.25rem 0; }
nav { max-width: 760px; margin: 0 auto; padding: 0 1rem; }
nav a, header a { color: var(--accent); }
.case {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}
.case h2 { margin-top: 0; }
.case h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.reviewed, .empty { color: var(--muted); font-size: 0.9rem; }
blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 4px solid var(--field);
  color: var(--muted);
}
@media (min-width: 600px) {
  .facts { grid-template-columns: 1fr 1fr; }
  header h1 { font-size: 2.6rem; }
}

/* ---- fonts (self-hosted) ---- */
@font-face { font-family: "Bodoni Moda"; src: url("fonts/BodoniModa-latin.woff2?v=202610100009") format("woff2");
  font-weight: 400 800; font-display: swap; }
@font-face { font-family: Commissioner; src: url("fonts/Commissioner-latin.woff2?v=202610100009") format("woff2");
  font-weight: 400 700; font-display: swap; }
/* ---- app shell ---- */
[hidden] { display: none !important; }
html.js .no-js-only, html.no-js .js-only { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
}
.appbar { view-transition-name: appbar; position: sticky; top: 0; z-index: 30; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; max-width: none; margin: 0;
  padding: calc(env(safe-area-inset-top, 0px) + .55rem) max(16px, calc((100vw - 1240px) / 2)) .55rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); }
.appbar .brand { display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-size: 1.35rem; font-weight: 700; color: var(--fg); text-decoration: none;
  letter-spacing: -.01em; }
.appbar .brand img { border-radius: 7px; }
.aboutlink { margin-left: auto; padding: .4rem .2rem; color: var(--muted); font-size: .92rem; text-decoration: none; }
.aboutlink:hover { color: var(--fg); }
@media (min-width: 900px) { .aboutlink { margin-left: 0; } }
.topnav { display: none; gap: .25rem; margin: 0; padding: 0; max-width: none; }
.topnav a { padding: .4rem .7rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.topnav a:hover { color: var(--fg); background: var(--card); }
.topnav a[aria-current] { color: var(--fg); font-weight: 600; border-radius: 0; background: none;
  box-shadow: inset 0 -2px var(--desert); }
.tabbar { view-transition-name: tabbar; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid;
  grid-template-columns: repeat(4, 1fr); max-width: none; margin: 0;
  padding: .3rem max(8px, env(safe-area-inset-left, 0px)) max(.35rem, env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); }
.tabbar a { display: grid; justify-items: center; gap: .1rem; min-height: 48px; padding: .3rem 0; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current] { color: var(--nile); }
.tabbar a[aria-current] svg { stroke-width: 2.3; }
body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}
body::before { view-transition-name: flagband; }
.netstatus { position: sticky; top: 3.1rem; z-index: 29; margin: 0; padding: .5rem 1rem; text-align: center;
  font-size: .82rem; font-weight: 600; background: var(--desert); color: #1b1600; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 60; padding: .55rem 1rem; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: .85rem;
  box-shadow: 0 6px 24px rgb(0 0 0 / .25); }
@media (min-width: 900px) { .toast { bottom: 2rem; } }
:focus-visible { outline: 2px solid var(--nile); outline-offset: 2px; }

/* ---- Three columns (Today, All headlines, Influence tracker): pale left bank, middle channel, blue right bank.
   On phones a switcher shows one column at a time. ---- */
.seg { display: grid; grid-template-columns: 1fr 1.5fr 1fr; font-size: .82rem; font-weight: 600; text-align: center; }
.seg label { padding: .7rem .3rem; cursor: pointer; background: var(--silt); color: var(--fg); }
.seg label:nth-of-type(2) { background: var(--bg); }
.seg label:nth-of-type(3) { background: var(--bank); color: var(--on-bank); }
.banksel { position: absolute; opacity: 0; pointer-events: none; }
.banksel:nth-of-type(1):checked ~ .seg label:nth-of-type(1), .banksel:nth-of-type(2):checked ~ .seg label:nth-of-type(2),
.banksel:nth-of-type(3):checked ~ .seg label:nth-of-type(3) { box-shadow: inset 0 -3px var(--desert); }
.banksel:nth-of-type(1):focus-visible ~ .seg label:nth-of-type(1), .banksel:nth-of-type(2):focus-visible ~ .seg label:nth-of-type(2),
.banksel:nth-of-type(3):focus-visible ~ .seg label:nth-of-type(3) { outline: 2px solid var(--nile); outline-offset: -4px; }
.banks > section { display: none; }
.banksel:nth-of-type(1):checked ~ .banks > section:nth-of-type(1), .banksel:nth-of-type(2):checked ~ .banks > section:nth-of-type(2),
.banksel:nth-of-type(3):checked ~ .banks > section:nth-of-type(3) { display: block; }
.bank { padding: 1.25rem max(16px, 2vw) 1.5rem; }
.bank.l { background: var(--silt); }
.bank.r { background: var(--bank); color: var(--on-bank); }
.bank.r a { color: inherit; }
.mid { padding: 1.25rem max(16px, 2vw) 1.75rem; }
.banks h2.col { margin: 0; font: 700 .95rem/1.3 Commissioner, system-ui, sans-serif; color: inherit; }
.banks h2.col::after { display: none; }
.why { margin: .2rem 0 1rem; font-size: .8rem; opacity: .78; }
.seam { display: none; }
@media (min-width: 1100px) {
  .seg { display: none; }
  .banks { display: grid; grid-template-columns: 290px 18px minmax(0, 1fr) 18px 320px; max-width: 1320px; margin: 0 auto; }
  .banks > section { display: block; }
  .banks > .seam { display: block; background: repeating-linear-gradient(90deg, #7d8fa3 0 1px, transparent 1px 4px); }
  .banks > .seam.b { background: repeating-linear-gradient(90deg, var(--bank) 0 2px, transparent 2px 4px); }
  .mid { padding: 1.5rem 2.2rem 2rem; }
}
/* One screen: the page never scrolls; each column scrolls inside itself. */
html:has(body.app) { height: 100%; }
body.app { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 0; }
body.app > * { flex: none; }
body.app .banks { flex: 1 1 auto; min-height: 0; }
body.app .banks > section { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
@media (max-width: 1099px) { body.app .banks { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 1100px) { body.app .banks { grid-template-rows: minmax(0, 1fr); } }
@media (max-height: 500px) {  /* a phone held sideways: scroll normally rather than squeeze */
  body.app { height: auto; overflow: visible; display: block; }
  body.app .banks > section { height: auto; overflow: visible; }
}
/* Panels opened by link (About): full screen, scroll inside, close with #close. */
.sheet { position: fixed; inset: 0; z-index: 55; display: none; overflow-y: auto; background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px); }
.sheet:target { display: block; }
.sheet .close { position: sticky; top: 0; z-index: 1; display: block; width: max-content; margin: 0 0 0 auto;
  padding: .8rem max(16px, 2vw); font-weight: 600; color: var(--nile); background: var(--bg); }

/* ---- Map rivers ---- */
.rv { fill: none; stroke: #3d7bd9; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.rv.blue { stroke: #1f4fbf; stroke-width: 2.6; }
.rv.white { stroke: #8fb3e0; }
.rv-label { fill: #1f4fbf; font: italic 600 11px "Bodoni Moda", Georgia, serif; pointer-events: none;
  paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
@media (prefers-color-scheme: dark) { .rv { stroke: #6f9cf0; } .rv.blue { stroke: #4f86f7; } .rv.white { stroke: #b9cff0; }
  .rv-label { fill: #9fc0ff; } }
