
/* Layout: dense news front page — brand-colored menu bar, lead + 4 side stories,
   one hand-curated signature module, then section clusters with a utility sidebar. */
:root {
  --brand: #455060;       /* menu, buttons, emphasis */
  --bar: #455060;         /* menu bar stays saturated in both themes */
  --on-brand: #FFFFFF;
  --brand-tint: #EEF1F5;   /* thumbnails and signature band */
  --bg: #FFFFFF;
  --surface: #F3F5F8;
  --surface-2: #E7EBF0;
  --line: #DCE1E8;
  --ink: #172431;
  --muted: #586474;
  --warn-bg: #FFF4D6; --warn-ink: #6B4A00;
  --bad: #B3261E;
  --f-head: "Noto Serif", Georgia, "Times New Roman", serif;
  --f-ui: "Noto Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1280px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #9AA5B3; --on-brand: #0E141B; --brand-tint: #1E2834;
    --bg: #0E141B; --surface: #161F29; --surface-2: #1E2834; --line: #2B3644;
    --ink: #E6EBF1; --muted: #9AA5B3; --warn-bg: #3A2E10; --warn-ink: #F3D58A; --bad: #F2867E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #9AA5B3; --on-brand: #0E141B; --brand-tint: #1E2834;
  --bg: #0E141B; --surface: #161F29; --surface-2: #1E2834; --line: #2B3644;
  --ink: #E6EBF1; --muted: #9AA5B3; --warn-bg: #3A2E10; --warn-ink: #F3D58A; --bad: #F2867E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 15px; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bar); }
a { color: inherit; text-decoration: none; }
a:hover .hl, a.hl:hover { color: var(--brand); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.serif { font-family: var(--f-head); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.chip.demo { background: var(--warn-bg); color: var(--warn-ink); letter-spacing: .04em; }
.chip.brand { background: var(--brand); color: var(--on-brand); }
h1, h2, h3 { text-wrap: balance; margin: 0; }

/* utility + masthead */
.util { background: var(--surface); font-size: 13px; color: var(--muted); }
.util .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; min-height: 36px; padding-block: 6px; }
.util .sp { flex: 1; }
.util a:hover { color: var(--brand); }
.mast .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; padding-block: 18px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo svg { width: 46px; height: 46px; flex: none; }
.word { font-family: var(--f-ui); font-weight: 800; font-size: 28px; letter-spacing: -.01em; line-height: 1; }
.word b { color: var(--brand); font-weight: 800; }
.tag { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.search { margin-left: auto; display: flex; flex: 0 1 340px; min-width: 0; }
.search input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; padding: 0 12px; background: var(--bg); }
.search button { height: 42px; padding: 0 16px; border: 0; border-radius: 0 6px 6px 0; background: var(--brand); color: var(--on-brand); font-weight: 600; cursor: pointer; }

/* menu */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--bar); color: #fff; }
.nav .wrap { display: flex; align-items: stretch; gap: 0; }
.nav ul { list-style: none; display: flex; margin: 0; padding: 0; flex: 1; min-width: 0; }
.nav li a { display: flex; align-items: center; height: 48px; padding: 0 14px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.nav li:first-child a { padding-left: 0; }
.nav li a:hover, .nav li a[aria-current="page"] { box-shadow: inset 0 -3px 0 #fff; }
.nav .home-ico { padding-right: 16px; }
.nav .allbtn { display: none; background: none; border: 0; color: #fff; font-weight: 600; padding: 0 0 0 12px; cursor: pointer; min-height: 48px; }
.panel { background: var(--bar); color: #fff; border-top: 1px solid rgba(255,255,255,.25); }
.panel .wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 20px; padding-block: 12px 16px; }
.panel a { display: flex; align-items: center; min-height: 44px; font-weight: 600; }
.topics { border-bottom: 1px solid var(--line); }
.topics .wrap { display: flex; gap: 8px 16px; align-items: center; padding-block: 10px; overflow-x: auto; scrollbar-width: none; }
.topics .wrap::-webkit-scrollbar { display: none; }
.topics .lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.topics a { font-size: 14px; white-space: nowrap; }
.topics a::before { content: "#"; color: var(--brand); margin-right: 2px; font-weight: 700; }

/* grid */
main { padding-block: 24px 48px; }
.g { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.c8 { grid-column: span 8; min-width: 0; } .c4 { grid-column: span 4; min-width: 0; } .c12 { grid-column: span 12; min-width: 0; }
.sec-h { display: flex; align-items: baseline; gap: 12px; border-top: 3px solid var(--ink); padding-top: 10px; margin: 0 0 16px; }
.sec-h h2 { font-family: var(--f-ui); font-size: 18px; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }
.sec-h a.more { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 600; }
.sec-h a.more:hover { color: var(--brand); }

/* thumbnails: honest tinted panels with a format glyph, never stock photos */
.thumb { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: var(--brand-tint); border-radius: 4px; overflow: hidden; display: grid; place-items: center; color: var(--brand); }
.thumb svg { width: 46%; height: auto; max-height: 70%; }
.thumb.ill svg { width: 100%; height: 100%; max-height: none; display: block; }
.thumb.ill { display: block; }
.thumb .tl { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--bg); color: var(--ink); padding: 2px 7px; border-radius: 3px; }

/* lead */
.lead .thumb { aspect-ratio: 16 / 7; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 86%; counter-reset: s; }
.flow div { background: var(--bg); color: var(--ink); border-radius: 6px; padding: 12px 12px 14px; font-weight: 700; font-size: clamp(12px, 1.4vw, 16px); position: relative; }
.flow div::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 13px; margin-bottom: 8px; }
.flow div:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--brand); font-weight: 800; z-index: 1; }
.lead h1 { font-family: var(--f-head); font-size: clamp(24px, 3vw, 34px); line-height: 1.22; margin: 14px 0 10px; }
.lead p.sapo { font-size: 16px; color: var(--muted); margin: 0 0 10px; max-width: 64ch; }
.byline { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.side { display: grid; gap: 0; }
.side a { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.side a:first-child { padding-top: 0; }
.side h3 { font-family: var(--f-head); font-size: 17px; line-height: 1.32; }
.side .k { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* signature band */
.sig { background: var(--surface); margin-block: 32px; }
.sig .wrap { padding-block: 26px 28px; }
.sig-top { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: end; margin-bottom: 18px; }
.sig-top h2 { font-family: var(--f-head); font-size: 26px; }
.sig-top p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.sig-note { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* lists */
.list a { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.list h3 { font-family: var(--f-head); font-size: 19px; line-height: 1.3; }
.list p { margin: 6px 0 8px; color: var(--muted); font-size: 14.5px; }
.cluster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 34px; }
.cluster a h3 { font-family: var(--f-head); font-size: 16.5px; line-height: 1.32; margin-top: 10px; }
.cluster a p { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }

/* sidebar */
.box { border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin-bottom: 24px; }
.box h3 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.prof a { display: block; padding: 10px 0; border-top: 1px solid var(--line); }
.prof a:first-of-type { border-top: 0; padding-top: 0; }
.prof b { font-family: var(--f-head); font-size: 16px; display: block; }
.mkt table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.mkt td { padding: 7px 0; border-top: 1px solid var(--line); }
.mkt td:last-child { text-align: right; color: var(--muted); }
.mkt p { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.nl input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; background: var(--bg); margin: 8px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--brand); color: var(--on-brand); font-weight: 700; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.ad { display: grid; place-items: center; text-align: center; background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 10px, var(--surface-2) 10px, var(--surface-2) 20px); color: var(--muted); font-size: 12.5px; border-radius: 4px; }
.ad.wide { height: 250px; max-width: 970px; margin: 0 auto 32px; }
.ad.mr { height: 250px; margin-bottom: 24px; }
.ad b { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* article */
.crumb { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.crumb a:hover { color: var(--brand); }
.demo-bar { background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; }
.art h1 { font-family: var(--f-head); font-size: clamp(26px, 3.4vw, 40px); line-height: 1.2; margin: 6px 0 14px; }
.art .sapo { font-size: 18px; font-weight: 600; line-height: 1.6; margin: 0 0 16px; }
.art .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13.5px; color: var(--muted); padding: 12px 0; border-block: 1px solid var(--line); margin-bottom: 22px; }
.art .meta .sp { flex: 1; }
.fig { margin: 0 0 26px; }
.fig .thumb { aspect-ratio: 16 / 7; }
.fig figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.body { max-width: 720px; }
.body p { font-size: 18px; line-height: 1.7; margin: 0 0 1.1em; }
.src { background: var(--surface); border-radius: 6px; padding: 16px 18px; font-size: 14.5px; margin: 28px 0; max-width: 720px; }
.src h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-size: 14px; z-index: 80; }
.plan { border: 1px dashed var(--line); border-radius: 6px; padding: 18px; max-width: 720px; }
.plan dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.plan dt { color: var(--muted); font-size: 14px; }
.plan dd { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.filters button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 14px; min-height: 36px; cursor: pointer; font-weight: 600; font-size: 14px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cat-head { background: var(--surface); }
.cat-head .wrap { padding-block: 22px; }
.cat-head h1 { font-family: var(--f-head); font-size: clamp(26px, 3.4vw, 38px); margin: 4px 0 6px; }
.cat-head p { margin: 0; color: var(--muted); max-width: 70ch; }
.page { max-width: 760px; }
.page h1 { font-family: var(--f-head); font-size: 32px; margin: 8px 0 14px; }
.page p { font-size: 17px; line-height: 1.7; }
.empty { padding: 28px; text-align: center; background: var(--surface); border-radius: 6px; color: var(--muted); }

/* footer */
footer { border-top: 4px solid var(--brand); background: var(--surface); font-size: 14px; }
footer .wrap { padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 24px; }
footer h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer a:hover { color: var(--brand); }
footer .fine { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 14px; }

/* signature: map */
.map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.map a { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 14px; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.map a:hover { border-color: var(--brand); }
.map b { font-size: 16px; }
.map span { font-size: 12.5px; color: var(--brand); font-weight: 700; }
.map a.river { background: var(--brand-tint); }
/* signature: countries */
.ctry { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ctry a { background: var(--bg); border-radius: 6px; padding: 16px; display: grid; gap: 10px; border-top: 3px solid var(--brand); }
.ctry .code { font-family: var(--f-head); font-size: 26px; color: var(--brand); line-height: 1; }
.ctry b { font-size: 16px; }
.ctry p { margin: 0; font-size: 14px; color: var(--muted); }
/* signature: timeline */
.tl-wrap { overflow-x: auto; }
.tl { min-width: 720px; }
.tl-head, .tl-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(0, 1fr)); align-items: center; }
.tl-head div { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 0 8px; }
.tl-row { background: var(--bg); border-radius: 6px; margin-bottom: 8px; min-height: 58px; }
.tl-row > a { padding: 10px 14px; font-weight: 600; }
.tl-row .cell { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.tl-row .cell.on::before { content: ""; position: absolute; left: 0; right: 50%; top: 50%; height: 3px; background: var(--brand); }
.tl-row .cell.done::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; background: var(--brand); opacity: .35; }
.tl-row .dot { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.tl-row .done .dot { background: var(--brand); opacity: .6; }
.tl-row .on .dot { display: none; }
.tl-row .on .chip { position: relative; z-index: 1; }
/* signature: stack */
.stack { display: grid; gap: 6px; }
.stack a { display: grid; grid-template-columns: 54px minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: center; background: var(--bg); border-radius: 6px; padding: 14px 16px; border-left: 6px solid var(--brand); }
.stack .lv { font-family: var(--f-head); font-size: 22px; color: var(--brand); }
.stack b { font-size: 16px; }
.stack small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.stack span { font-size: 14px; }
/* signature: practice */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 10px 14px; min-height: 44px; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.guide section { background: var(--bg); border-radius: 6px; padding: 16px; }
.guide h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-bottom: 10px; }
.guide ul, .guide ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.guide label { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; padding: 6px 0; cursor: pointer; }
.guide input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); flex: none; margin: 1px 0 0; }
.guide .prog { font-size: 13px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
/* signature: anatomy */
.anat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
.anat form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.anat label { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.anat input { height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: var(--bg); font-variant-numeric: tabular-nums; width: 100%; }
.bar { display: flex; height: 54px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.bar div { height: 100%; transition: width .3s ease; }
.legend { display: grid; gap: 6px; margin-top: 14px; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.legend div { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.legend i { width: 14px; height: 14px; border-radius: 3px; }
.legend .pct { color: var(--muted); min-width: 52px; text-align: right; }
.net { margin-top: 14px; padding: 14px 16px; border-radius: 6px; background: var(--bg); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.net b { font-family: var(--f-head); font-size: 26px; font-variant-numeric: tabular-nums; }
.net.neg b { color: var(--bad); }

@media (max-width: 1199px) {
  .c8, .c4 { grid-column: span 12; }
  .lead-g .c4 .side { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .ctry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .anat { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .search { flex-basis: 100%; margin-left: 0; }
  .word { font-size: 23px; }
  .nav .allbtn { display: block; flex: none; box-shadow: -14px 0 12px -6px var(--bar); position: relative; }
  .nav ul { overflow-x: auto; scrollbar-width: none; }
  .nav ul::-webkit-scrollbar { display: none; }
  .tl { min-width: 0; }
  .tl-head { display: none; }
  .tl-row { grid-template-columns: minmax(0, 1fr) auto; padding-right: 12px; }
  .tl-row .cell:not(.on) { display: none; }
  .tl-row .on::before { display: none; }
  .lead-g .c4 .side, .sidebar { grid-template-columns: minmax(0, 1fr); }
  .side a { grid-template-columns: 104px minmax(0, 1fr); }
  .list a { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
  .list h3 { font-size: 16.5px; }
  .list p { display: none; }
  .cluster { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cluster a { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .cluster a h3 { margin-top: 0; }
  .cluster a p { display: none; }
  .flow { width: 92%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow div:nth-child(2)::after { display: none; }
  .map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ctry, .guide { grid-template-columns: minmax(0, 1fr); }
  .stack a { grid-template-columns: 34px minmax(0, 1fr); }
  .stack a > :nth-child(n+3) { grid-column: 2; }
  .plan dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .plan dd { margin-bottom: 10px; }
  .body p { font-size: 17.5px; }
  .ad.wide { height: 120px; }
  footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .anat form { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
