/* hormuz.now — editorial design system
   Light by default; [data-theme="dark"] on <html> switches every token.
   Headlines: Newsreader (self-hosted, OFL). UI and data: system sans.  */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-italic.woff2") format("woff2");
  font-weight: 400 600; font-style: italic; font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fcfbf8;
  --paper-2: #f4f1ea;
  --paper-3: #ebe6db;
  --rule: #ddd7cb;
  --rule-2: #c9c1b1;
  --ink: #16140f;
  --ink-2: #3f3b33;
  --ink-3: #6d675c;
  --ink-4: #8f887b;
  --link: #0b5c8f;
  --link-hover: #073f63;
  --accent: #0b5c8f;
  --focus: #1f6fd1;

  --open: #1b7d3a;
  --restricted: #b3470c;
  --closed: #b0241b;
  --unknown: #6a6f78;
  --open-bg: #e6f3ea;
  --restricted-bg: #fbece2;
  --closed-bg: #f9e5e3;
  --unknown-bg: #eceef1;

  --c-in: #1f5fa8;        /* inbound, into the Gulf */
  --c-out: #d9730d;       /* outbound, to the Gulf of Oman */
  --c-tanker: #a3243a;
  --c-cargo: #2c7a3f;
  --c-gas: #6a449b;
  --c-passenger: #1f7fa8;
  --c-other: #8b8578;
  --c-pw: #a39d90;        /* IMF PortWatch */
  --c-ours: #0b5c8f;      /* hormuz.now */
  --c-base: #1b7d3a;      /* pre-crisis baseline */
  --land: #e8e2d4;
  --land-line: #c9bfa9;
  --sea: #dbe7ee;
  --sea-label: #4f7690;
  --gate: #c2410c;

  --serif: "Newsreader", "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1240px;
  --measure: 68ch;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121315;
  --paper-2: #1a1c1f;
  --paper-3: #23262a;
  --rule: #2e3136;
  --rule-2: #454a51;
  --ink: #efece6;
  --ink-2: #d1ccc2;
  --ink-3: #a39e94;
  --ink-4: #7d786f;
  --link: #7fc0ec;
  --link-hover: #b3dbf6;
  --accent: #7fc0ec;
  --focus: #8ab8ff;

  --open: #4cc36f;
  --restricted: #f29a52;
  --closed: #f2736a;
  --unknown: #a3a9b3;
  --open-bg: #16281c;
  --restricted-bg: #2e1f14;
  --closed-bg: #311918;
  --unknown-bg: #22252a;

  --c-in: #6aa7ea;
  --c-out: #f2a64b;
  --c-tanker: #ea6e83;
  --c-cargo: #6cc585;
  --c-gas: #b394e3;
  --c-passenger: #6cc1e3;
  --c-other: #8c877e;
  --c-pw: #767168;
  --c-ours: #7fc0ec;
  --c-base: #4cc36f;
  --land: #25282c;
  --land-line: #3a3e44;
  --sea: #15222c;
  --sea-label: #7ea3bf;
  --gate: #f29a52;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.12; margin: 0 0 .45em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.1rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1vw, 1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
strong { font-weight: 650; }
small, .small { font-size: .86rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
code { font-family: var(--mono); font-size: .86em; }
pre.code { background: var(--paper-2); border: 1px solid var(--rule); border-left: 3px solid var(--ink); padding: 12px 14px; margin: 8px 0 16px; overflow-x: auto; font: .84rem/1.55 var(--mono); color: var(--ink); }
pre.code code { white-space: pre; font: inherit; color: inherit; }
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
main { flex: 1; padding-bottom: 56px; }

/* --------------------------------------------------------------- masthead */
.utility { border-bottom: 1px solid var(--rule); font-size: .8rem; color: var(--ink-3); }
.utility .wrap { display: flex; align-items: center; gap: 16px; min-height: 36px; }
.utility .u-date { white-space: nowrap; }
.utility .u-day { white-space: nowrap; }
.utility .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--rule-2);
  color: var(--ink-2); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .78rem; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink-3); color: var(--ink); }
.theme-toggle svg { width: 14px; height: 14px; }
.masthead .wrap { display: flex; align-items: flex-end; gap: 20px; padding-top: 18px; padding-bottom: 14px; flex-wrap: wrap; }
.wordmark { font-family: var(--serif); font-weight: 750; font-size: clamp(1.9rem, 1.3rem + 2vw, 2.7rem); letter-spacing: -.03em; color: var(--ink); text-decoration: none; line-height: 1; }
.wordmark:hover { color: var(--ink); }
.wordmark .dot { color: var(--accent); }
.tagline { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 1.02rem; padding-bottom: 3px; }
.masthead .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; padding-bottom: 2px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 3px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: .9rem; text-decoration: none; border: 1px solid var(--ink); white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--ink-2); color: var(--paper); border-color: var(--ink-2); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn-line:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink-3); }
.btn .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #e0412f; box-shadow: 0 0 0 0 rgba(224,65,47,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224,65,47,.55); } 70% { box-shadow: 0 0 0 7px rgba(224,65,47,0); } 100% { box-shadow: 0 0 0 0 rgba(224,65,47,0); } }
@media (prefers-reduced-motion: reduce) { .btn .live-dot, .pulse { animation: none; } }

.sections { border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 40; }
.sections .wrap { display: flex; align-items: center; gap: 4px; }
.sections nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; flex: 1; }
.sections nav::-webkit-scrollbar { display: none; }
.sections nav a {
  flex: none; padding: 10px 11px; font-size: .88rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
  letter-spacing: .01em; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.sections nav a:hover { color: var(--ink); border-bottom-color: var(--rule-2); }
.sections nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.status-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px; text-decoration: none; margin-left: 8px;
}
.status-chip .sq { width: 8px; height: 8px; background: currentColor; }
.status-chip:hover { text-decoration: underline; }
@media (max-width: 720px) { .status-chip .chip-n { display: none; } .tagline { display: none; } }

/* status colouring (text + background tints) */
.lvl-open { color: var(--open); } .lvl-restricted { color: var(--restricted); } .lvl-closed { color: var(--closed); } .lvl-unknown { color: var(--unknown); }
.bg-open { background: var(--open-bg); color: var(--open); } .bg-restricted { background: var(--restricted-bg); color: var(--restricted); }
.bg-closed { background: var(--closed-bg); color: var(--closed); } .bg-unknown { background: var(--unknown-bg); color: var(--unknown); }

/* ------------------------------------------------------------ page header */
.crumbs { font-size: .8rem; color: var(--ink-3); margin: 18px 0 0; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--rule-2); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.page-head { margin: 14px 0 26px; max-width: 860px; }
.kicker { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.kicker .sep { color: var(--rule-2); margin: 0 6px; }
.standfirst { font-family: var(--serif); font-size: clamp(1.12rem, 1rem + .4vw, 1.32rem); line-height: 1.45; color: var(--ink-2); max-width: var(--measure); margin-top: 6px; }
.byline { font-size: .84rem; color: var(--ink-3); margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.byline strong { color: var(--ink-2); font-weight: 600; }

/* --------------------------------------------------------------- modules */
.module { margin: 44px 0; }
.module-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; border-top: 2px solid var(--ink); padding-top: 10px; margin-bottom: 18px; }
.module-head h2 { margin: 0; font-size: clamp(1.35rem, 1.1rem + .7vw, 1.7rem); }
.module-head .label { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.module-head .more { margin-left: auto; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.module-intro { color: var(--ink-2); max-width: var(--measure); margin-top: -6px; }
.subhead { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; font-family: var(--sans); }
.cols { display: grid; gap: 32px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.rule-left > * + * { border-left: 1px solid var(--rule); padding-left: 32px; }
@media (max-width: 960px) {
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main { grid-template-columns: 1fr; }
  .rule-left > * + * { border-left: 0; padding-left: 0; }
}
@media (max-width: 680px) { .cols-2, .cols-3 { grid-template-columns: 1fr; gap: 24px; } }
.panel { background: var(--paper-2); border: 1px solid var(--rule); padding: 18px 20px; }
.panel > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------- lead / status */
.lead { padding: 22px 0 8px; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 960px) { .lead-grid { grid-template-columns: 1fr; gap: 26px; } }
.lead-title { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 4.1rem); line-height: 1.02; letter-spacing: -.025em; margin: 0 0 14px; font-weight: 700; }
.lead-title .word { white-space: nowrap; }
.lead-title .word.lvl-open, .lead-title .word.lvl-restricted, .lead-title .word.lvl-closed, .lead-title .word.lvl-unknown {
  background-image: linear-gradient(currentColor, currentColor); background-size: 100% 4px; background-position: 0 92%; background-repeat: no-repeat; padding-bottom: 2px;
}
.sublevel { display: inline-block; font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; margin-bottom: 14px; }
.editor-note { border-left: 3px solid var(--ink); padding: 8px 14px; margin: 16px 0; background: var(--paper-2); font-size: .95rem; }
.editor-note .tag { margin-right: 6px; }

.scale { margin: 38px 0 8px; } /* room for the marker label above the bar */
.scale-bar { position: relative; display: grid; grid-template-columns: 10fr 30fr 31fr 29fr; height: 12px; }
.scale-bar span { border-right: 2px solid var(--paper); }
.scale-bar span:nth-child(1) { background: color-mix(in srgb, var(--closed) 80%, var(--paper)); }
.scale-bar span:nth-child(2) { background: color-mix(in srgb, var(--restricted) 80%, var(--paper)); }
.scale-bar span:nth-child(3) { background: color-mix(in srgb, var(--restricted) 45%, var(--paper)); }
.scale-bar span:nth-child(4) { background: color-mix(in srgb, var(--open) 70%, var(--paper)); border-right: 0; }
.scale-marker { font-style: normal; position: absolute; top: -9px; width: 2px; height: 30px; background: var(--ink); transform: translateX(-1px); }
.scale-marker::after { content: attr(data-label); position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .74rem; font-weight: 700; white-space: nowrap; color: var(--ink); }
.scale-marker.lo::after { left: -1px; transform: none; }
.scale-marker.hi::after { left: auto; right: -1px; transform: none; }
.scale-labels { display: grid; grid-template-columns: 10fr 30fr 31fr 29fr; font-size: .72rem; color: var(--ink-3); margin-top: 6px; }
.scale-labels span { padding-right: 4px; line-height: 1.25; }
.scale-note { font-size: .8rem; color: var(--ink-3); margin-top: 8px; }

.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.figures.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.figure { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); }
.figures .figure:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
.figures.four .figure { border-left: 1px solid var(--rule); padding-left: 16px; }
.figures.four .figure:first-child { border-left: 0; padding-left: 0; }
.figure-num { font-family: var(--serif); font-size: clamp(1.9rem, 1.4rem + 1.4vw, 2.6rem); font-weight: 650; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; }
.figure-num small { font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.figure-label { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.figure-note { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }
@media (max-width: 860px) { .figures.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figures.four .figure:nth-child(3) { border-left: 0; padding-left: 0; } }
@media (max-width: 420px) { .figures, .figures.four { grid-template-columns: 1fr; } .figures .figure, .figures.four .figure { border-left: 0 !important; padding-left: 0 !important; } }

.dir { font-weight: 650; white-space: nowrap; }
.dir-in, .in { color: var(--c-in); }
.dir-out, .out { color: var(--c-out); }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border: 1px solid var(--rule-2); color: var(--ink-3); border-radius: 2px; vertical-align: 1px; }
.tag.est { border-style: dashed; }
.tag.live { color: #d93a2b; border-color: currentColor; }
.chip-health { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.chip-health.live { color: var(--open); } .chip-health.delayed, .chip-health.starting { color: var(--restricted); } .chip-health.stale { color: var(--closed); }

/* ------------------------------------------------------------------ lists */
.river { list-style: none; margin: 0; padding: 0; }
.river li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.river li:first-child { padding-top: 0; }
.river .when { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 2px; }
.river .what { font-family: var(--serif); font-size: 1.08rem; line-height: 1.35; color: var(--ink); }
.river .src { font-size: .8rem; color: var(--ink-3); }
.river .tag { margin-left: 4px; }
.xlist { list-style: none; margin: 0; padding: 0; }
.xlist li { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.xlist .t { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.xlist .v a { font-weight: 650; color: var(--ink); text-decoration: none; }
.xlist .v a:hover { text-decoration: underline; }
.xlist .v small { display: block; color: var(--ink-3); font-size: .8rem; }
.xlist .d { font-size: .82rem; text-align: right; }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--ink); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.data th, .data td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data th { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; border-bottom: 1px solid var(--rule-2); }
.data th:first-child, .data td:first-child { padding-left: 0; }
.data td.r, .data th.r { text-align: right; }
.data tbody tr:hover { background: var(--paper-2); }
.data .name { font-weight: 650; color: var(--ink); text-decoration: none; }
.data .name:hover { text-decoration: underline; }
.data .sub { display: block; font-size: .78rem; color: var(--ink-3); }
.data .empty { text-align: center; color: var(--ink-3); padding: 22px; }
.data .bar-cell { width: 28%; min-width: 90px; }
.inline-bar { height: 8px; background: var(--paper-3); position: relative; }
.inline-bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink-2); }
.pct-up { color: var(--open); } .pct-down { color: var(--closed); }
@media (max-width: 720px) { .hide-sm { display: none; } }
@media (max-width: 980px) { .hide-md { display: none; } }

.barlist { list-style: none; margin: 0; padding: 0; }
.barlist li { display: grid; grid-template-columns: minmax(96px, 40%) 1fr 3.5ch; gap: 10px; align-items: center; padding: 5px 0; font-size: .9rem; }
.barlist .bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist .bl-bar { height: 8px; background: var(--paper-3); }
.barlist .bl-bar span { display: block; height: 100%; background: var(--accent); }
.barlist .bl-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }

/* ----------------------------------------------------------------- charts */
figure.chart-fig { margin: 0; }
figure.chart-fig figcaption, .chart-title { font-family: var(--serif); font-weight: 650; font-size: 1.12rem; margin-bottom: 4px; color: var(--ink); }
.chart-sub { font-size: .84rem; color: var(--ink-3); margin: 0 0 10px; }
.chart-src { font-size: .76rem; color: var(--ink-4); margin-top: 6px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
/* Each chart is drawn at three widths (1000/640/380); show the one nearest
   the space available so its text stays readable. Old browsers get the wide one. */
.chart-set { container-type: inline-size; }
.chart-set > .cv-m, .chart-set > .cv-s { display: none; }
@container (max-width: 820px) { .chart-set > .cv-l { display: none; } .chart-set > .cv-m { display: block; } }
@container (max-width: 500px) { .chart-set > .cv-m { display: none; } .chart-set > .cv-s { display: block; } }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .grid.zero { stroke: var(--ink-3); }
.chart .axis { fill: var(--ink-3); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .b-in { fill: var(--c-in); }
.chart .b-out { fill: var(--c-out); }
.chart .b-pw { fill: var(--c-pw); opacity: .55; }
.chart .b-ours { fill: var(--c-ours); }
.chart .bar .hit { fill: transparent; }
.chart .bar:hover .hit { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.chart .bar.partial .b-in, .chart .bar.partial .b-out { opacity: .5; }
.chart .hatch-line { stroke: var(--paper); stroke-width: 1.6; }
.chart .avg { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart .avg.ours { stroke: var(--c-ours); stroke-width: 2.4; }
.chart .avg.pw { stroke: var(--c-pw); stroke-width: 1.6; }
.chart .area-pw { fill: var(--c-pw); opacity: .28; }
.chart .area-ours { fill: var(--c-ours); opacity: .16; }
.chart .line-tanker { fill: none; stroke: var(--c-tanker); stroke-width: 2; stroke-linejoin: round; }
.chart .area-tanker { fill: var(--c-tanker); opacity: .14; }
.chart .pw { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.3; }
.chart .baseline { stroke: var(--c-base); stroke-width: 1.4; stroke-dasharray: 5 4; }
.chart .threshold { stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .ref-label { fill: var(--c-base); font: 600 11px var(--sans); }
.chart .ref-label.dim { fill: var(--ink-3); }
.chart .annot line { stroke: var(--ink-3); stroke-width: 1; }
.chart .annot text { fill: var(--ink-2); font: 11px var(--sans); }
.chart .annot circle { fill: var(--ink); }
.chart .val { fill: var(--ink); font: 600 11px var(--sans); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--ink-3); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 10px; }
.legend i.l-in { background: var(--c-in); } .legend i.l-out { background: var(--c-out); }
.legend i.l-avg { height: 2px; background: var(--ink); } .legend i.l-ours { height: 3px; background: var(--c-ours); }
.legend i.l-pw { width: 9px; height: 9px; border-radius: 50%; border: 1.4px solid var(--ink-2); }
.legend i.l-pwbar { background: var(--c-pw); opacity: .6; }
.legend i.l-base { height: 0; border-top: 2px dashed var(--c-base); }
.legend i.l-legacy { background: repeating-linear-gradient(45deg, var(--c-in), var(--c-in) 2px, var(--paper) 2px, var(--paper) 4px); }
.legend i.l-tanker { height: 3px; background: var(--c-tanker); }
svg.spark { display: block; width: 100%; height: 36px; }
.spark .s-bar { fill: var(--ink-3); }
.spark .s-bar.hi { fill: var(--accent); }
.spark .s-base { stroke: var(--c-base); stroke-dasharray: 3 3; stroke-width: 1; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.6; }
details.data-table { margin-top: 10px; font-size: .88rem; }
details.data-table summary { cursor: pointer; color: var(--ink-3); font-size: .82rem; }

/* ------------------------------------------------------------------- maps */
svg.map { width: 100%; height: auto; display: block; }
.map .sea { fill: var(--sea); }
.map .land { fill: var(--land); stroke: var(--land-line); stroke-width: .8; }
.map .gate { stroke: var(--gate); stroke-width: 2.4; stroke-dasharray: 6 4; fill: none; }
.map .lane { fill: none; stroke-width: 1.8; stroke-dasharray: 4 3; }
.map .lane-in { stroke: var(--c-in); } .map .lane-out { stroke: var(--c-out); }
.map .area { fill: color-mix(in srgb, var(--gate) 8%, transparent); stroke: color-mix(in srgb, var(--gate) 45%, transparent); stroke-width: 1; }
.map circle { stroke: var(--paper); stroke-width: .7; }
.map .v-tanker { fill: var(--c-tanker); } .map .v-cargo { fill: var(--c-cargo); }
.map circle.idle { opacity: .55; }
.map text { paint-order: stroke; stroke: var(--sea); stroke-width: 3px; font-family: var(--sans); }
.map .lbl-country { fill: var(--ink-3); font-size: 12px; font-weight: 700; letter-spacing: .2em; stroke: var(--land); }
.map .lbl-sea { fill: var(--sea-label); font-size: 13px; font-style: italic; font-family: var(--serif); }
.map .lbl-strait { fill: var(--gate); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.map .lbl-port { fill: var(--ink-2); font-size: 11px; stroke: var(--land); }
.map .lbl-island { fill: var(--ink-3); font-size: 10.5px; font-style: italic; }
.map .scale line { stroke: var(--ink-2); stroke-width: 2; }
.map .scale text { fill: var(--ink-2); font-size: 11px; }
.map-frame { border: 1px solid var(--rule); background: var(--sea); }
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--ink-3); margin-top: 8px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.dash { display: inline-block; width: 16px; height: 0; border-top: 2px dashed var(--gate); margin-right: 5px; vertical-align: 3px; }

/* ------------------------------------------------------------------ prose */
.prose { font-family: var(--serif); font-size: 1.12rem; line-height: 1.62; max-width: var(--measure); color: var(--ink); }
.prose h2 { margin-top: 1.8em; font-size: 1.6rem; }
.prose h3 { margin-top: 1.5em; font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose .source, .source { font-family: var(--sans); font-size: .78rem; color: var(--ink-3); }
.prose blockquote, .pull { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--ink); font-style: italic; color: var(--ink-2); }
.dropcap::first-letter { float: left; font-family: var(--serif); font-size: 3.6em; line-height: .82; padding: 6px 8px 0 0; font-weight: 700; }
.note { font-size: .88rem; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 10px; margin-top: 14px; }
.callout { border-top: 2px solid var(--ink); background: var(--paper-2); padding: 14px 18px; margin: 18px 0; font-size: .95rem; }
.callout.warn { border-top-color: var(--restricted); }
.callout > :last-child { margin-bottom: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 24px; font-size: .88rem; font-weight: 600; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc a { text-decoration: none; color: var(--ink-2); }
.toc a:hover { color: var(--link); text-decoration: underline; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0; font-weight: 600; }
dl.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 24px; margin: 0; }
dl.kv div { border-top: 1px solid var(--rule); padding-top: 6px; }
dl.kv dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
dl.kv dd { margin: 2px 0 0; font-weight: 600; }

/* FAQ */
.qa { border-bottom: 1px solid var(--rule); }
.qa > summary { list-style: none; cursor: pointer; padding: 14px 32px 14px 0; font-family: var(--serif); font-size: 1.14rem; font-weight: 600; position: relative; }
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-family: var(--sans); font-size: 1.3rem; color: var(--ink-3); }
.qa[open] > summary::after { content: "−"; }
.qa .qa-body { padding: 0 0 16px; font-family: var(--serif); font-size: 1.06rem; line-height: 1.6; max-width: var(--measure); }
.qa .qa-body p:last-child { margin-bottom: 0; }
.qa-src { font-family: var(--sans); font-size: .78rem; color: var(--ink-3); margin-top: 8px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 124px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.timeline time { font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); padding-top: 4px; }
.timeline h3 { margin: 0 0 4px; font-size: 1.12rem; }
.timeline p { margin: 0 0 4px; color: var(--ink-2); }
.timeline .cat { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cat-military { color: var(--closed); } .cat-diplomacy { color: var(--link); } .cat-energy { color: var(--c-gas); } .cat-shipping { color: var(--c-out); } .cat-history { color: var(--ink-3); }
@media (max-width: 600px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* ports small multiples */
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 28px; }
.port-card { border-top: 1px solid var(--rule); padding: 12px 0 14px; }
.port-card h3 { font-size: 1.05rem; margin: 0 0 2px; }
.port-card h3 a { color: var(--ink); text-decoration: none; }
.port-card h3 a:hover { text-decoration: underline; }
.port-card .pc-meta { font-size: .78rem; color: var(--ink-3); }
.port-card .pc-pct { font-family: var(--serif); font-size: 1.6rem; font-weight: 650; line-height: 1.1; margin-top: 6px; }
.port-card .pc-pct small { font-family: var(--sans); font-size: .76rem; color: var(--ink-3); font-weight: 600; }

/* ---------------------------------------------------------------- footer */
.colophon { border-top: 3px double var(--ink); background: var(--paper-2); padding: 34px 0 44px; font-size: .88rem; color: var(--ink-2); }
.colophon .wordmark { font-size: 1.7rem; }
.colophon-grid { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 16px; }
.colophon h4 { font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.colophon ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.colophon a { color: var(--ink-2); text-decoration: none; }
.colophon a:hover { color: var(--ink); text-decoration: underline; }
.colophon .fine { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: .78rem; color: var(--ink-3); max-width: 100ch; }
@media (max-width: 900px) { .colophon-grid { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------- live map page */
body.page-live main { padding-bottom: 0; }
body.page-live .sections { position: static; }
.live-shell { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 200px); height: calc(100dvh - 200px); min-height: 520px; border-top: 1px solid var(--rule); }
.live-side { overflow-y: auto; border-right: 1px solid var(--rule); padding: 16px 18px; background: var(--paper); }
.live-side h1 { font-size: 1.45rem; margin: 0 0 4px; }
.live-map { position: relative; min-height: 420px; background: var(--sea); }
.live-map #map { position: absolute; inset: 0; }
.live-figs { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); margin: 12px 0 16px; }
.live-figs .figure { padding: 10px 10px 10px 0; }
.live-figs .figure:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--rule); }
.live-figs .figure-num { font-size: 1.6rem; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--rule-2); background: var(--paper); color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; border-radius: 2px; }
.filter-chip[aria-pressed="false"] { opacity: .45; }
.filter-chip .sw { width: 9px; height: 9px; border-radius: 50%; }
.filter-chip .cnt { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.field { width: 100%; background: var(--paper); border: 1px solid var(--rule-2); color: var(--ink); padding: 8px 10px; font: inherit; font-size: .9rem; border-radius: 2px; }
.field:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-2); margin: 6px 0; }
.conn { font-size: .78rem; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.conn .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); }
.conn[data-state="live"] .pulse { background: #d93a2b; animation: pulse 2s infinite; }
.conn[data-state="error"] .pulse { background: var(--closed); }
.vessel-panel { position: absolute; right: 14px; top: 14px; width: 340px; max-width: calc(100% - 28px); max-height: calc(100% - 28px); overflow-y: auto; background: var(--paper); border: 1px solid var(--rule-2); box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 16px 18px; z-index: 5; }
.vessel-panel[hidden] { display: none; }
.vessel-panel h2 { font-size: 1.3rem; margin: 0 30px 2px 0; }
.vessel-panel .close { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: var(--ink-3); font-size: 1.5rem; cursor: pointer; }
.vessel-panel dl.kv { grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 12px 0; }
.map-key { position: absolute; left: 12px; bottom: 28px; background: color-mix(in srgb, var(--paper) 92%, transparent); border: 1px solid var(--rule); padding: 8px 10px; font-size: .76rem; color: var(--ink-2); z-index: 4; display: grid; gap: 3px; }
.below-map { padding: 28px 0 8px; }
@media (max-width: 900px) {
  .live-shell { grid-template-columns: 1fr; height: auto; }
  .live-map { order: -1; height: 64vh; }
  .live-side { border-right: 0; border-top: 1px solid var(--rule); }
  .vessel-panel { top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; max-height: 55%; }
}
.maplibregl-ctrl-attrib { font-size: 10px; }

/* utilities */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.right { margin-left: auto; }
.center { text-align: center; }
.w-measure { max-width: var(--measure); }
