/* Where Money Moves — a sea chart for economic currents.
   Paper and sea for ground, ink for type, one current-teal for "faster", ebb-red only for declines.
   Colours are tokens; build.py appends the per-lens map rules at the end of this file. */
:root {
  --paper: #f6f7f4; --surface: #ffffff; --sea: #d5e2e8; --land: #e6e8e1; --grat: #c3d3db;
  --ink: #17212b; --muted: #5b6670; --line: #dcdfd8; --current: #0f7b85; --ebb: #b0413e; --focus: #2f6fdb;
  --s1: #f0e7cf; --s2: #d8e0c6; --s3: #aed2c1; --s4: #7fbdb4; --s5: #51a1a2; --s6: #2a8188; --s7: #0d5d68;
  --null: #f1f1ee; --null-line: #b8bfb9;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --native: "Noto Sans Thai", "Noto Sans Khmer", "Noto Sans Lao", "Noto Sans Myanmar", "Inter", system-ui, sans-serif;
  --r-1: 6px; --r-2: 14px; --r-3: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0f1720; --surface: #16202b; --sea: #0c1821; --land: #1a2530; --grat: #1a2d3a;
  --ink: #e6ecf1; --muted: #93a1ad; --line: #263442; --current: #4fc3cc; --ebb: #ec7a6f; --focus: #8ab4ff;
  --s1: #3a3f3a; --s2: #2f4a48; --s3: #2a5d5b; --s4: #2a7471; --s5: #33908b; --s6: #4fb1aa; --s7: #8adcd3;
  --null: #18232d; --null-line: #34495a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1720; --surface: #16202b; --sea: #0c1821; --land: #1a2530; --grat: #1a2d3a;
    --ink: #e6ecf1; --muted: #93a1ad; --line: #263442; --current: #4fc3cc; --ebb: #ec7a6f; --focus: #8ab4ff;
    --s1: #3a3f3a; --s2: #2f4a48; --s3: #2a5d5b; --s4: #2a7471; --s5: #33908b; --s6: #4fb1aa; --s7: #8adcd3;
    --null: #18232d; --null-line: #34495a;
    color-scheme: dark;
  }
}
@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--body); font-feature-settings: "tnum" 1, "cv11" 1; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h2 { font-size: 22px; }
p { margin: 0; }
.native { font-family: var(--native); font-weight: 400; color: var(--muted); font-size: .62em; letter-spacing: 0; margin-left: .45em; white-space: nowrap; }
td .native, li .native, th .native { font-size: 12px; display: block; margin: 1px 0 0; }
.sub { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: var(--r-1); z-index: 50; }
.skip:focus { top: 12px; }
kbd { font: 500 11px var(--body); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--muted); background: var(--surface); }
.up { color: var(--current); } .down { color: var(--ebb); }

/* header */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; background: var(--current); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); z-index: 40; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 14px; padding: 6px 10px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.cmp .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--current); color: var(--paper); font-size: 11px; font-weight: 600; }
.search-btn, .theme-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font: inherit; font-size: 14px; border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.search-btn { margin-left: auto; min-width: 180px; }
.search-btn span { flex: 1; text-align: left; }
.theme-btn { padding: 7px; }
.search-btn svg, .theme-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 760px) {
  .nav { display: none; }
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd { display: none; }
}

main { max-width: 1240px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 40px; display: grid; gap: 56px; }
main > * { min-width: 0; }
.pagebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 -40px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; margin-left: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper);
  text-decoration: none; font: 500 15px var(--body); border: 1px solid var(--ink); cursor: pointer; transition: transform .15s var(--ease); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); padding: 7px 13px; font-size: 14px; }
.btn.ghost svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.btn.ghost[aria-pressed="true"] { border-color: var(--current); color: var(--current); }
.btn.ghost[aria-pressed="true"] svg { fill: currentColor; }

/* hero */
.hero { display: grid; gap: 14px; padding-top: 40px; max-width: 64rem; }
.hero h1 { font-size: clamp(36px, 6.2vw, 76px); font-weight: 750; letter-spacing: -0.035em; line-height: .98; font-variation-settings: "opsz" 96; text-wrap: balance; }
.hero .lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 44rem; text-wrap: pretty; }
.hero .lede a { color: var(--ink); }
.hero.detail { grid-template-columns: 1fr auto; align-items: center; max-width: none; gap: 24px; }
@media (max-width: 640px) { .hero.detail { grid-template-columns: 1fr; } .hero.detail .map.mini { display: none; } .mini-sea { width: 100%; } }
.hero.detail h1 { font-size: clamp(34px, 5vw, 60px); }
.hero.detail .lede { color: var(--ink); max-width: 62ch; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; }
.hero.detail .formed { margin-top: 8px; }
.warn { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--ebb); background: color-mix(in srgb, var(--ebb) 8%, transparent); font-size: 14px; border-radius: 0 var(--r-1) var(--r-1) 0; }

/* atlas: the memorable thing */
.atlas { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; margin-top: -16px; }
@media (max-width: 980px) { .atlas { grid-template-columns: 1fr; } }
.atlas-map, .split-map { display: grid; gap: 12px; min-width: 0; }
.mapframe { position: relative; border-radius: var(--r-3); overflow: hidden; background: var(--sea); }
.split .mapframe { background: transparent; }
.map { display: block; width: 100%; height: auto; }
.map .sea-bg { fill: var(--sea); }
.map .grat line { stroke: var(--grat); stroke-width: .6; }
.map .ctx path { fill: var(--land); stroke: var(--grat); stroke-width: .5; }
.map .units path, .map .units .dot { fill: var(--s1); stroke: var(--paper); stroke-width: .6; stroke-linejoin: round; transition: fill .45s var(--ease); }
.map.th .units path { stroke-width: .5; }
.map .units a { cursor: pointer; outline: none; }
.map .units a:hover path, .map .units a:focus-visible path, .map .units a.cur path, .map .units a:hover .dot { stroke: var(--ink); stroke-width: 1.4; }
.map .units .on path { stroke: var(--ink); stroke-width: 1.6; }
.map .labels text { font: 600 11px var(--body); fill: var(--ink); paint-order: stroke; stroke: var(--sea); stroke-width: 3px; pointer-events: none; opacity: .8; }
.map .coords text { font: 500 9px var(--body); fill: var(--muted); opacity: .8; }
@media (max-width: 640px) {   /* the map scales to ~40%: size labels in map units so they land near 10px */
  .map .labels text { font-size: 25px; stroke-width: 6px; }
  .map .coords { display: none; }
}
.hb { fill: var(--null); } .hl { stroke: var(--null-line); stroke-width: 1.1; }   /* the shared #hatch pattern */
.map.mini { width: 96px; height: 172px; }
/* Vietnam: merged provinces are several old shapes in one path, so fills carry no stroke; borders are their own layers */
.map.vn .units path { stroke: none; }
.map.vn .units a:hover path, .map.vn .units a:focus-visible path, .map.vn .units a.cur path { stroke: none; filter: brightness(.86) saturate(1.2); }
.map.vn .outline { fill: none; stroke: var(--paper); stroke-width: .9; stroke-linejoin: round; pointer-events: none; }
.map.vn .former { fill: none; stroke: var(--paper); stroke-width: .7; stroke-dasharray: 2 2.4; opacity: .9; pointer-events: none; }
.map.mini.vn { width: 86px; }
.mapframe .map.vn { max-height: 80vh; width: auto; max-width: 100%; margin: 0 auto; }   /* the country is tall and thin */
.map.mini path { fill: var(--line); stroke: var(--paper); stroke-width: .8; }
.map.mini path.on { fill: var(--current); }
.map.mini circle { fill: var(--paper); stroke: var(--ink); stroke-width: .8; }
.mini-sea { width: min(380px, 42vw); border-radius: var(--r-2); overflow: hidden; }
.mini-sea .labels, .mini-sea .coords { display: none; }
.mini-sea .units path, .mini-sea .units .dot { fill: var(--land); }
.mini-sea .units .on path, .mini-sea .units .on .dot { fill: var(--current); }

/* lens switcher */
.lenses { position: relative; display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); justify-self: start; max-width: 100%; }
.lenses button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--muted); font: 500 14px var(--body);
  padding: 7px 14px 7px 11px; border-radius: 999px; cursor: pointer; transition: color .2s; }
.lenses button[aria-pressed="true"] { color: var(--paper); }
.lenses .ic { width: 17px; height: 17px; }
.lens-ink { position: absolute; z-index: 0; top: 4px; left: 0; height: calc(100% - 8px); width: 0; border-radius: 999px; background: var(--ink); transition: transform .35s var(--ease), width .35s var(--ease); }
.lenses:not(.ready) button[aria-pressed="true"] { background: var(--ink); }
@media (max-width: 560px) {     /* keep the words; let the row scroll sideways instead of hiding them */
  .lenses { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-self: stretch; -webkit-overflow-scrolling: touch; }
  .lenses::-webkit-scrollbar { display: none; }
  .lenses button { flex: none; padding: 8px 12px 8px 10px; }
}
.skip-map { position: absolute; left: -9999px; }
.skip-map:focus { position: static; justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14px; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 12px; color: var(--muted); }
.legend .ramp { display: inline-flex; }
.legend .ramp i { width: 20px; height: 8px; }
.legend .ramp i:first-child { border-radius: 4px 0 0 4px; } .legend .ramp i:last-child { border-radius: 0 4px 4px 0; }
.legend .s1 { background: var(--s1); } .legend .s2 { background: var(--s2); } .legend .s3 { background: var(--s3); } .legend .s4 { background: var(--s4); }
.legend .s5 { background: var(--s5); } .legend .s6 { background: var(--s6); } .legend .s7 { background: var(--s7); }
.legend .nd { display: inline-flex; gap: 6px; align-items: center; }
.legend .nd i { width: 14px; height: 8px; border-radius: 2px; background: repeating-linear-gradient(45deg, var(--null) 0 2px, var(--null-line) 2px 3px); }
.legend .note { margin-left: auto; }

/* ranked lists */
.atlas-side { display: grid; gap: 6px; position: sticky; top: 84px; }
.side-h { font-size: 15px; font-family: var(--body); font-weight: 600; letter-spacing: 0; }
.rlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; position: relative; }
.rlist li a { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) 54px 3.6em; align-items: center; gap: 10px; padding: 9px 2px; text-decoration: none; border-top: 1px solid var(--line); }
.rlist li:first-child a { border-top: 0; }
.rlist li a:hover .nm { text-decoration: underline; }
.rlist .pos { color: var(--muted); font-size: 13px; }
.rlist .nm { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rlist .nm .native { display: block; font-size: 12px; margin: 0; line-height: 1.3; }
.rlist .bar { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--current) var(--w), color-mix(in srgb, var(--ink) 8%, transparent) var(--w)); transition: background .4s; }
.rlist .val { text-align: right; font-weight: 600; }
.rlist.plain li a { grid-template-columns: 1.6em minmax(0, 1fr) auto; }
.rlist.plain .nm .native { display: block; }

/* KPI strip: four leaders, one per lens */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 20px 20px 20px 0; text-decoration: none; }
.kpi + .kpi { padding-left: 20px; border-left: 1px solid var(--line); }
@media (max-width: 860px) { .kpi:nth-child(3) { border-left: 0; padding-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--line); } }
.kpi .ic { width: 20px; height: 20px; grid-row: span 3; color: var(--muted); margin-top: 3px; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .v { font-family: var(--display); font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.kpi .s { font-size: 14px; }
.kpi:hover .s { text-decoration: underline; }

/* Thailand split */
.split { display: grid; gap: 24px; }
.split-head { display: grid; gap: 10px; max-width: 44rem; }
.split-head h2 { font-size: clamp(28px, 3.6vw, 44px); }
.split-head p { color: var(--muted); }
.split-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 900px) { .split-body { grid-template-columns: 1fr; } }
.split-map .mapframe { max-width: 460px; }
.split-map .mapframe.tall { max-width: 520px; }
.tlist[hidden] { display: none; }
.tlist .sub { margin-bottom: 4px; }
.asof { margin: 0; display: grid; gap: 16px; }
.asof div { display: grid; grid-template-columns: 22px 1fr; gap: 2px 10px; }
.asof .ic { width: 20px; height: 20px; grid-row: span 2; color: var(--muted); }
.asof dt { font-weight: 600; }
.asof dd { margin: 0; color: var(--muted); font-size: 14px; }

/* movers */
.movers { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
@media (max-width: 860px) { .movers { grid-template-columns: 1fr; } }
.dlist { list-style: none; padding: 0; margin: 10px 0 12px; counter-reset: d; }
.dlist li a { display: grid; grid-template-columns: 1.6em 1fr auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.dlist li a::before { counter-increment: d; content: counter(d); color: var(--muted); font-size: 13px; }
.dlist .nm small { display: block; color: var(--muted); font-size: 13px; }
.dlist .nm .native { display: inline; font-size: 12px; }
.dlist .val { font-weight: 600; }
.more { font-size: 14px; color: var(--muted); }

/* tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
thead th { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; background: var(--paper); }
thead th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
thead th button::after { content: ""; width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; opacity: .35; }
thead th button[data-dir="asc"]::after { border-top-color: transparent; border-bottom-color: currentColor; margin: 0 0 4px; opacity: 1; }
thead th button[data-dir="desc"]::after { opacity: 1; }
thead th button:focus-visible { outline: 2px solid var(--focus); }
td.num, th.num { text-align: right; white-space: nowrap; }
.pos { color: var(--muted); }
tbody th { font-weight: 500; }
tbody th a { text-decoration: none; }
tbody th a:hover { text-decoration: underline; }
tbody th small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.coverage td.yes { color: var(--current); font-weight: 500; }
.coverage td.soon { color: var(--muted); }
.flag { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ebb); color: var(--paper); font-size: 11px; font-weight: 700; margin-left: 4px; cursor: help; }
.sp { width: 92px; }
.spark { display: block; }
.spark path { fill: none; stroke: var(--current); stroke-width: 1.5; }
@media (max-width: 600px) { .sp { display: none; } th, td { padding: 9px 5px; } }
.pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.pill::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--sw, var(--null)); }
.pill.none { color: var(--muted); font-weight: 400; font-size: 13px; }
.pill.b1 { --sw: var(--s1); } .pill.b2 { --sw: var(--s2); } .pill.b3 { --sw: var(--s3); } .pill.b4 { --sw: var(--s4); }
.pill.b5 { --sw: var(--s5); } .pill.b6 { --sw: var(--s6); } .pill.b7 { --sw: var(--s7); }

/* lens panels on detail pages: a 2×2 of rules, not cards */
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
@media (max-width: 860px) { .panels { grid-template-columns: 1fr; } }
.lens-panel { display: grid; gap: 12px; padding: 22px 0 30px; border-top: 2px solid var(--ink); align-content: start; }
.lens-panel header { display: flex; align-items: center; gap: 10px; }
.lens-panel header .ic { width: 20px; height: 20px; }
.lens-panel h2 { font-size: 18px; font-family: var(--body); font-weight: 600; letter-spacing: 0; }
.lens-panel .rank { margin-left: auto; font-size: 13px; color: var(--muted); }
.headline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.headline .v { font-family: var(--display); font-size: clamp(40px, 5vw, 58px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.headline .u { color: var(--muted); font-size: 14px; max-width: 22ch; }
.lens-panel dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px; }
.lens-panel dt { font-size: 13px; color: var(--muted); }
.lens-panel dd { margin: 0; font-weight: 500; }
.note { font-size: 13px; color: var(--muted); }

/* charts */
.chart { margin: 4px 0 0; display: grid; gap: 4px; }
.chart figcaption { font-size: 13px; color: var(--muted); }
.chart svg { width: 100%; height: auto; max-width: 640px; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart text { fill: var(--muted); font: 10.5px var(--body); }
.chart .ln { fill: none; stroke: var(--current); stroke-width: 2.2; stroke-linejoin: round; stroke-dasharray: 1; }
.chart circle { fill: var(--ink); }
.chart circle.pt { fill: var(--paper); stroke: var(--current); stroke-width: 2; }
.chart rect { fill: var(--current); opacity: .8; }
.chart .marks rect:last-child { opacity: 1; }
.chart .base { stroke: var(--muted); stroke-dasharray: 3 3; }
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.stat { display: grid; gap: 2px; padding: 16px 18px 18px 0; border-bottom: 1px solid var(--line); }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-family: var(--display); font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.stat .s { font-size: 13px; color: var(--muted); }

.callout { display: grid; gap: 10px; padding: 28px; border-radius: var(--r-3); background: var(--ink); color: var(--paper); }
.callout p { opacity: .8; max-width: 50ch; }
.callout .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); margin-top: 6px; }
.callout.quiet { background: var(--sea); color: var(--ink); }
.others h2 { font-size: 16px; font-family: var(--body); font-weight: 600; letter-spacing: 0; margin-bottom: 10px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; background: var(--surface); }
.chips a:hover { border-color: var(--ink); }
.prose { max-width: 44rem; display: grid; gap: 10px; }
.prose p { color: color-mix(in srgb, var(--ink) 82%, var(--paper)); }
details summary { cursor: pointer; font-weight: 600; }
.rk-index { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 32px; }
.rk-index a { display: grid; gap: 4px; padding: 18px 0; border-top: 1px solid var(--line); text-decoration: none; }
.rk-index b { font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }
.rk-index span { color: var(--muted); font-size: 14px; }
.rk-index a:hover b { text-decoration: underline; }

/* compare */
.compare .empty { padding: 40px; border: 1px dashed var(--line); border-radius: var(--r-3); text-align: center; display: grid; gap: 6px; }
.cmp-grid { display: grid; gap: 28px; }
.cmp-row h3 { font-size: 15px; font-family: var(--body); font-weight: 600; letter-spacing: 0; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.cmp-row h3 .ic { width: 18px; height: 18px; }
.cmp-bar { display: grid; grid-template-columns: minmax(110px, 220px) 1fr 70px; gap: 12px; align-items: center; padding: 6px 0; font-size: 14px; }
.cmp-bar .track { position: relative; height: 10px; }
.cmp-bar .track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); opacity: .5; }
.cmp-row.score .track::before { display: none; }
.cmp-bar .fill { position: absolute; top: 0; height: 100%; border-radius: 3px; background: var(--current); transition: width .5s var(--ease), left .5s var(--ease); }
.cmp-bar .fill.neg { background: var(--ebb); }
.cmp-bar .num { text-align: right; font-weight: 600; }
.cmp-bar small { color: var(--muted); }
.cmp-head { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-head .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.cmp-head .chip a { text-decoration: none; }
.cmp-head .chip button { all: unset; cursor: pointer; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.cmp-head .chip button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }

/* command palette */
dialog#cmdk { border: 0; padding: 0; background: transparent; width: min(600px, calc(100vw - 32px)); margin-top: 12vh; color: var(--ink); }
dialog#cmdk::backdrop { background: color-mix(in srgb, #17212b 30%, transparent); backdrop-filter: blur(3px); }
dialog#cmdk[open] .cmdk-box { animation: pop .18s var(--ease); }
.cmdk-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .35); overflow: hidden; }
.cmdk-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: 500 18px var(--body); padding: 18px 20px; outline: none; }
.cmdk-box ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.cmdk-box li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.cmdk-box li a small { color: var(--muted); font-size: 13px; font-family: var(--native); }
.cmdk-box li a .kind { grid-row: span 2; align-self: center; font-size: 12px; color: var(--muted); }
.cmdk-box li a[aria-selected="true"] { background: color-mix(in srgb, var(--current) 12%, transparent); }
.cmdk-box li.empty { padding: 18px 14px; color: var(--muted); }
.cmdk-box .hint { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* tooltip */
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 13px; min-width: 190px;
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / .4); transform: translate(-50%, calc(-100% - 14px)); }
.tip b { display: block; font-size: 15px; }
.tip .native { color: inherit; opacity: .7; font-size: 12px; margin: 0; display: block; }
.tip dl, .sheet dl { margin: 6px 0 0; display: grid; grid-template-columns: auto auto; gap: 2px 14px; }
.tip dt, .sheet dt { opacity: .7; } .tip dd, .sheet dd { margin: 0; text-align: right; font-weight: 600; }
.tip .on, .sheet .on { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.sheet dl { grid-template-columns: 1fr auto; font-size: 14px; }
.sheet { display: none; }
@media (hover: none) {
  .sheet { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
  .sheet[hidden] { display: none; }
  .sheet b { font-family: var(--display); font-size: 20px; }
  .sheet .go { color: var(--current); font-size: 14px; font-weight: 500; }
}

/* toasts */
.toasts { position: fixed; z-index: 70; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: 14px;
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / .45); animation: toast-in .32s var(--ease); }
.toast.out { animation: toast-out .22s ease-in forwards; }
.toast button { all: unset; cursor: pointer; font-weight: 600; color: var(--s4); padding: 4px 6px; border-radius: 6px; }
:root[data-theme="dark"] .toast button { color: var(--current); }
.toast button:focus-visible { outline: 2px solid currentColor; }
@keyframes toast-in { from { transform: translateY(14px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { transform: translateY(-8px) scale(.98); } }

/* reveal and the map's arrival run on the Web Animations API (app.js), so the resting state is always visible */

.foot { max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) max(40px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 14px; color: var(--muted); font-size: 14px; }
.foot div { display: grid; gap: 6px; max-width: 60rem; }
.foot b { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* generated */
.map[data-lens="score"] [data-b-score="1"]{fill:var(--s1)}
.map[data-lens="score"] [data-b-score="2"]{fill:var(--s2)}
.map[data-lens="score"] [data-b-score="3"]{fill:var(--s3)}
.map[data-lens="score"] [data-b-score="4"]{fill:var(--s4)}
.map[data-lens="score"] [data-b-score="5"]{fill:var(--s5)}
.map[data-lens="score"] [data-b-score="6"]{fill:var(--s6)}
.map[data-lens="score"] [data-b-score="7"]{fill:var(--s7)}
.map[data-lens="score"] [data-b-score="n"]{fill:url(#hatch)}
.map[data-lens="people"] [data-b-people="1"]{fill:var(--s1)}
.map[data-lens="people"] [data-b-people="2"]{fill:var(--s2)}
.map[data-lens="people"] [data-b-people="3"]{fill:var(--s3)}
.map[data-lens="people"] [data-b-people="4"]{fill:var(--s4)}
.map[data-lens="people"] [data-b-people="5"]{fill:var(--s5)}
.map[data-lens="people"] [data-b-people="6"]{fill:var(--s6)}
.map[data-lens="people"] [data-b-people="7"]{fill:var(--s7)}
.map[data-lens="people"] [data-b-people="n"]{fill:url(#hatch)}
.map[data-lens="jobs"] [data-b-jobs="1"]{fill:var(--s1)}
.map[data-lens="jobs"] [data-b-jobs="2"]{fill:var(--s2)}
.map[data-lens="jobs"] [data-b-jobs="3"]{fill:var(--s3)}
.map[data-lens="jobs"] [data-b-jobs="4"]{fill:var(--s4)}
.map[data-lens="jobs"] [data-b-jobs="5"]{fill:var(--s5)}
.map[data-lens="jobs"] [data-b-jobs="6"]{fill:var(--s6)}
.map[data-lens="jobs"] [data-b-jobs="7"]{fill:var(--s7)}
.map[data-lens="jobs"] [data-b-jobs="n"]{fill:url(#hatch)}
.map[data-lens="biz"] [data-b-biz="1"]{fill:var(--s1)}
.map[data-lens="biz"] [data-b-biz="2"]{fill:var(--s2)}
.map[data-lens="biz"] [data-b-biz="3"]{fill:var(--s3)}
.map[data-lens="biz"] [data-b-biz="4"]{fill:var(--s4)}
.map[data-lens="biz"] [data-b-biz="5"]{fill:var(--s5)}
.map[data-lens="biz"] [data-b-biz="6"]{fill:var(--s6)}
.map[data-lens="biz"] [data-b-biz="7"]{fill:var(--s7)}
.map[data-lens="biz"] [data-b-biz="n"]{fill:url(#hatch)}
.map[data-lens="money"] [data-b-money="1"]{fill:var(--s1)}
.map[data-lens="money"] [data-b-money="2"]{fill:var(--s2)}
.map[data-lens="money"] [data-b-money="3"]{fill:var(--s3)}
.map[data-lens="money"] [data-b-money="4"]{fill:var(--s4)}
.map[data-lens="money"] [data-b-money="5"]{fill:var(--s5)}
.map[data-lens="money"] [data-b-money="6"]{fill:var(--s6)}
.map[data-lens="money"] [data-b-money="7"]{fill:var(--s7)}
.map[data-lens="money"] [data-b-money="n"]{fill:url(#hatch)}
