/* ============ RESET & TOKENS ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:          #141413;
  --ink-2:        #4a4843;
  --muted:        #6f6d66;          /* >= 4.5:1 on page and card backgrounds */
  --faint:        #a8a69e;          /* decorative only, never body text */
  --bg:           #faf9f5;
  --surface:      #ffffff;
  --surface-2:    #f5f4ee;
  --border:       #e8e6dc;
  --border-light: #f0ede4;

  --orange:       #d97757;          /* brand accent (fills, rules) */
  --orange-dim:   #f6e7df;
  --orange-ink:   #a9532f;          /* text/links on light backgrounds (5.3:1) */
  --orange-deep:  #8a3f22;
  --navy-1:       #182033;
  --navy-2:       #24324d;
  --navy-3:       #35507a;
  --hero-accent:  #f2b9a3;          /* light accent on the dark hero and footer */
  --hero-glow:    rgba(217,119,87,0.22);
  --hero-btn-shadow: rgba(217,119,87,0.35);
  --hero-btn-hover:  #e3876a;
  --focus-glow:   rgba(217,119,87,0.16);
  --accent-border: #ecc9b8;
  --highlight-bg: #fdf1ea;

  --nav-height:    100px;
  --nav-top-height: 56px;
  --sidebar-width: 290px;
  --content-max:   1180px;
  --radius:        10px;
  --radius-lg:     16px;

  --shadow-sm: 0 1px 2px rgba(20,20,19,0.05);
  --shadow:    0 1px 3px rgba(20,20,19,0.06), 0 0 0 1px rgba(20,20,19,0.04);
  --shadow-md: 0 4px 18px rgba(20,20,19,0.07), 0 0 0 1px rgba(20,20,19,0.04);
  --shadow-lg: 0 10px 36px rgba(20,20,19,0.14);

  --font-heading: 'Poppins', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-body:    'Lora', Georgia, 'Times New Roman', serif;
  --t: 0.18s ease;
}

/* Climate Change Exposure section: green accent and a dark green hero (text tokens keep >= 4.5:1) */
[data-section="climate"] {
  --orange:       #2b9a6e;
  --orange-dim:   #e2f2e9;
  --orange-ink:   #1d6b4c;
  --orange-deep:  #145238;
  --navy-1:       #0f2622;
  --navy-2:       #173b33;
  --navy-3:       #245a4b;
  --hero-accent:  #a8e0c5;
  --hero-glow:    rgba(43,154,110,0.28);
  --hero-btn-shadow: rgba(43,154,110,0.35);
  --hero-btn-hover:  #33ad7d;
  --focus-glow:   rgba(43,154,110,0.18);
  --accent-border: #b9dfca;
  --highlight-bg: #e8f5ee;
}

/* Hub landing page: slate-blue accent and a deep indigo hero, distinct from both projects
   (the project cards pin their own orange/green accents) */
[data-section="home"] {
  --orange:       #5568b8;
  --orange-dim:   #e7eaf6;
  --orange-ink:   #3a4a8f;
  --orange-deep:  #2c3766;
  --navy-1:       #15142b;
  --navy-2:       #232650;
  --navy-3:       #384274;
  --hero-accent:  #b3c2ef;
  --hero-glow:    rgba(85,104,184,0.30);
  --hero-btn-shadow: rgba(85,104,184,0.35);
  --hero-btn-hover:  #6a7ec9;
  --focus-glow:   rgba(85,104,184,0.18);
  --accent-border: #c7cfee;
  --highlight-bg: #eef1fa;
}

html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
[hidden] { display: none !important; }
a { color: var(--orange-ink); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--orange-deep); text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
code, pre { font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; }
:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: 2px; border-radius: 4px; }
.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-link { position: absolute; left: 12px; top: -48px; z-index: 300; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; font-family: var(--font-heading); font-size: .85rem; }
.skip-link:focus { top: 10px; color: #fff; }

/* ============ NAVBAR (two tiers: dataset sections, then the pages of the current section) ============ */
.navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(250,249,245,0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  display: flex; flex-direction: column;
}
.nav-top { height: var(--nav-top-height); display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.nav-sub { height: calc(var(--nav-height) - var(--nav-top-height)); display: flex; align-items: center; padding: 0 24px; border-top: 1px solid var(--border-light); }
.navbar .brand {
  font-family: var(--font-heading); font-weight: 700; font-size: 1rem;
  color: var(--ink); white-space: nowrap; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 9px; min-width: 0;
}
.navbar .brand::before {
  content: ""; width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  background: url("../favicon-hub.svg") center/contain no-repeat;
}
.navbar .brand:hover { text-decoration: none; color: var(--ink); }
.brand-text { display: none; overflow: hidden; text-overflow: ellipsis; }
.navbar nav { display: flex; gap: 2px; }
.navbar nav a {
  padding: 6px 12px; border-radius: 8px;
  font-family: var(--font-heading); font-size: .82rem; font-weight: 500;
  color: var(--ink-2);
  transition: background var(--t), color var(--t);
}
.navbar nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.navbar nav a.active { background: var(--orange-dim); color: var(--orange-deep); font-weight: 600; }
.section-nav { gap: 4px; }
.navbar .section-nav a { font-size: .9rem; font-weight: 600; padding: 7px 14px; color: var(--ink-2); }
.navbar .section-nav a.active { background: var(--ink); color: #fff; }
.section-nav-mobile { display: none !important; }
.hamburger {
  display: none; margin-left: auto; width: 40px; height: 40px;
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.hamburger span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.hamburger:hover { background: var(--surface-2); }

/* ============ LAYOUT ============ */
.page-wrapper { margin-top: var(--nav-height); display: flex; flex: 1; }
.page-wrapper.no-sidebar { display: block; }
.main-content { flex: 1; min-width: 0; padding: 30px 36px 0; }
.no-sidebar .main-content { max-width: var(--content-max); margin: 0 auto; padding: 30px 32px 0; }

.sidebar {
  width: var(--sidebar-width); flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  padding: 24px 20px 40px;
  position: sticky; top: var(--nav-height);
  height: calc(100vh - var(--nav-height)); overflow-y: auto;
}

/* ============ TYPOGRAPHY ============ */
.page-eyebrow, .eyebrow {
  font-family: var(--font-heading); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; color: var(--orange-ink);
  margin-bottom: 4px;
}
h1 { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 6px; }
h2 { font-family: var(--font-heading); font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; margin: 30px 0 10px; }
h3 { font-family: var(--font-heading); font-size: .95rem; font-weight: 600; margin-bottom: 4px; }
.subtitle { color: var(--ink-2); font-size: .95rem; margin-bottom: 18px; max-width: 760px; }
.muted { color: var(--muted); }

/* ============ SECTIONS (landing & profile) ============ */
.section { margin-top: 44px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 1.3rem; letter-spacing: -0.015em; }
.section-head .lede { color: var(--ink-2); font-size: .93rem; margin-top: 4px; max-width: 680px; }
.section-link { font-family: var(--font-heading); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.section-link::after { content: " →"; }

/* ============ HERO ============ */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(130deg, var(--navy-1) 0%, var(--navy-2) 55%, var(--navy-3) 100%);
  color: #fff; border-radius: var(--radius-lg);
  padding: 40px 44px 36px;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 36px; align-items: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 0%, var(--hero-glow) 0%, transparent 50%);
}
.hero > * { position: relative; }
.hero .eyebrow { color: var(--hero-accent); }
.hero h1 { color: #fff; font-size: 2.3rem; margin: 2px 0 12px; }
.hero-desc { color: rgba(255,255,255,0.84); font-size: 1.02rem; max-width: 560px; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-stat { border-left: 1px solid rgba(255,255,255,0.18); padding-left: 32px; }
.hero-stat .big { font-family: var(--font-heading); font-size: 4.2rem; font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: #fff; }
.hero-stat .big small { font-size: 1.6rem; font-weight: 600; margin-left: 2px; letter-spacing: 0; }
.hero-stat p { color: rgba(255,255,255,0.86); font-size: .98rem; margin-top: 10px; max-width: 340px; }
.hero-stat .from { color: rgba(255,255,255,0.62); font-family: var(--font-heading); font-size: .8rem; margin-top: 10px; }
.hero-spark { margin-top: 14px; height: 54px; max-width: 340px; }
.hero-spark .spark { width: 100%; height: 54px; }

.facts {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 2px 0;
  font-family: var(--font-heading); font-size: .8rem; color: var(--muted);
}
.facts strong { color: var(--ink); font-weight: 600; }

/* Search box (hero + firm page) */
.search-box { position: relative; flex: 1; min-width: 240px; max-width: 360px; }
.search-box input[type="search"] {
  width: 100%; height: 42px; padding: 0 14px 0 38px;
  border-radius: 9px; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") 13px center no-repeat;
  color: #fff; font-family: var(--font-heading); font-size: .88rem;
}
.search-box input::placeholder { color: rgba(255,255,255,0.7); }
.search-box input[type="search"]:focus { outline: none; border-color: var(--hero-accent); background-color: rgba(255,255,255,0.16); }
.search-box.light input[type="search"] {
  border-color: var(--border); background-color: var(--surface); color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236f6d66' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
}
.search-box.light input::placeholder { color: var(--muted); }
.search-box.light input[type="search"]:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--focus-glow); }
.search-box .dropdown-list { color: var(--ink); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; min-height: 36px;
  font-family: var(--font-heading); font-size: .82rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  transition: background var(--t), border-color var(--t), box-shadow var(--t), transform var(--t);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.btn-primary { background: var(--orange-ink); border-color: var(--orange-ink); color: #fff; }
.btn-primary:hover { background: var(--orange-deep); border-color: var(--orange-deep); color: #fff; }
.btn-hero { background: var(--orange); border-color: var(--orange); color: #fff; height: 42px; padding: 0 20px; box-shadow: 0 4px 16px var(--hero-btn-shadow); }
.btn-hero:hover { background: var(--hero-btn-hover); border-color: var(--hero-btn-hover); color: #fff; transform: translateY(-1px); }
.btn-sm { padding: 5px 12px; min-height: 30px; font-size: .78rem; }
.icon-btn { background: none; border: 0; width: 34px; height: 34px; border-radius: 8px; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--orange-ink); font-family: var(--font-heading); font-size: .78rem; font-weight: 600; }
.link-btn:hover { color: var(--orange-deep); text-decoration: underline; }

/* Segmented control */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 4px 12px; border-radius: 6px; font-family: var(--font-heading); font-size: .78rem; font-weight: 500; color: var(--ink-2); transition: background var(--t), color var(--t), box-shadow var(--t); white-space: nowrap; }
.seg:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), 0 0 0 1px rgba(20,20,19,0.06); }
.seg input:focus-visible + span { outline: 2px solid var(--orange-ink); outline-offset: 1px; }
.seg.disabled { opacity: .45; cursor: not-allowed; }
.seg.disabled input { cursor: not-allowed; }

.sidebar .segmented { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.sidebar .seg span { text-align: center; }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: var(--font-heading); font-size: .78rem; color: var(--ink-2); user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 30px; height: 18px; border-radius: 10px; background: #d6d4cc; position: relative; cursor: pointer; transition: background var(--t); flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--t); }
.switch input:checked { background: var(--orange-ink); }
.switch input:checked::after { transform: translateX(12px); }
.switch input:disabled { opacity: .45; cursor: not-allowed; }

/* ============ FORMS & FILTERS ============ */
.filter-group { margin-bottom: 18px; }
.filter-label, .filter-group > label {
  display: block; font-family: var(--font-heading); font-size: .7rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px;
}
select, input[type="text"], input[type="search"], input[type="number"] {
  width: 100%; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font-heading); font-size: .84rem; color: var(--ink); background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
}
select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%236f6d66' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E") right 11px center no-repeat; }
select:focus, input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--focus-glow); }
.year-range { display: flex; gap: 8px; align-items: center; }
.year-range input { width: 78px; text-align: center; }
.year-range span { color: var(--muted); font-family: var(--font-heading); font-size: .8rem; }

.measure-list { display: flex; flex-direction: column; gap: 2px; }
.measure-item { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 7px; cursor: pointer; font-family: var(--font-heading); font-size: .82rem; color: var(--ink-2); transition: background var(--t); }
.measure-item:hover { background: var(--surface-2); }
.measure-item input { accent-color: var(--orange-ink); width: 15px; height: 15px; cursor: pointer; }
.measure-item input:disabled { cursor: not-allowed; }
.measure-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.measure-line { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex-shrink: 0; }

/* Combobox / chips */
.combo { position: relative; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.chip-row:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink);
  padding: 3px 4px 3px 10px; border-radius: 14px; font-size: .78rem;
  font-family: var(--font-heading); font-weight: 500; max-width: 100%;
}
.chip .chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .chip-swatch { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-left: -3px; }
.chip button { background: none; border: 0; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; font-size: 1rem; line-height: 1; color: var(--muted); flex-shrink: 0; }
.chip button:hover { background: var(--border); color: var(--ink); }
.dropdown-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  max-height: 300px; overflow-y: auto; z-index: 60; box-shadow: var(--shadow-lg); display: none; padding: 4px;
}
.dropdown-list.open { display: block; }
.dropdown-list .option { padding: 7px 10px; cursor: pointer; border-radius: 7px; display: flex; flex-direction: column; gap: 1px; }
.dropdown-list .option:hover, .dropdown-list .option.active { background: var(--orange-dim); }
.option-label { font-family: var(--font-heading); font-size: .84rem; font-weight: 500; color: var(--ink); }
.option-sub { font-family: var(--font-heading); font-size: .72rem; color: var(--muted); }
.option-empty { padding: 10px; font-family: var(--font-heading); font-size: .8rem; color: var(--muted); }

.filter-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.filter-hint { color: var(--muted); font-family: var(--font-heading); font-size: .8rem; line-height: 1.6; margin: 0 0 16px; max-width: 820px; }

/* View controls row (one filter row above the charts it scopes) */
.view-controls {
  display: flex; gap: 14px 22px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 16px;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
}
.ctrl { display: flex; align-items: center; gap: 8px; }
.ctrl > .ctrl-label { font-family: var(--font-heading); font-size: .7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.ctrl select { width: auto; min-width: 120px; height: 32px; font-size: .8rem; }
.ctrl input[type="number"] { width: 74px; height: 32px; font-size: .8rem; text-align: center; padding: 0 6px; }
.ctrl-spacer { flex: 1; }

/* Notices */
.notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 9px; font-family: var(--font-heading); font-size: .82rem; margin-bottom: 14px; }
.notice-info { background: #eef4fc; color: #173f6e; border: 1px solid #d5e5f8; }
.notice-warn { background: #fdf3e2; color: #6b4300; border: 1px solid #f5dfb5; }
.notice .btn { margin-left: auto; }

/* Slice pill */
.slice-pill { display: inline-flex; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-family: var(--font-heading); font-size: .78rem; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 4px 14px; color: var(--ink-2); }
.slice-pill .pill-sep { margin: 0 8px; color: var(--faint); }
.slice-pill .pill-val { color: var(--ink); font-weight: 600; }

/* ============ CHART CARDS ============ */
.chart-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); margin: 0 0 18px; display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 4px; }
.chart-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; margin: 0; color: var(--ink); }
.chart-sub { font-family: var(--font-heading); font-size: .8rem; color: var(--muted); margin-top: 2px; }
.chart-tools { display: flex; gap: 4px; flex-shrink: 0; opacity: .7; transition: opacity var(--t); }
.chart-card:hover .chart-tools, .chart-tools:focus-within { opacity: 1; }
.chart-btn { padding: 4px 9px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-family: var(--font-heading); font-size: .7rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t); }
.chart-btn:hover { background: var(--orange-dim); color: var(--orange-deep); border-color: var(--accent-border); }
.chart-body { position: relative; padding: 8px 18px 6px 12px; height: 400px; transition: opacity var(--t); }
.chart-body canvas { width: 100% !important; }
.chart-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 8px 20px 16px; border-top: 1px solid var(--border-light); margin-top: 6px; }
.chart-caption { font-family: var(--font-heading); font-size: .76rem; color: var(--muted); line-height: 1.55; max-width: 820px; }
.table-toggle { flex-shrink: 0; }
.chart-table { padding: 0 20px 18px; }
.table-scroll { max-height: 360px; overflow: auto; border: 1px solid var(--border-light); border-radius: 8px; }

/* Loading: keep the previous render, dim it, spinner after a delay */
.is-loading { opacity: .45; pointer-events: none; }
.show-spinner::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border: 2.5px solid var(--border); border-top-color: var(--orange-ink); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--muted); }
.empty-state-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.empty-state p { font-size: .9rem; max-width: 360px; }

/* Coverage mini chart */
.coverage-card { padding: 14px 18px 10px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.coverage-card h3 { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 4px; }
.coverage-card .chart-body { height: 110px; padding: 0; }

/* ============ LANDING: FEATURED COMPANIES ============ */
.tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.spark-legend { display: flex; gap: 16px; font-family: var(--font-heading); font-size: .76rem; color: var(--muted); align-items: center; }
.spark-legend span { display: inline-flex; align-items: center; gap: 6px; }
.featured-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.firm-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px;
  padding: 14px 16px 12px; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.firm-card:hover { text-decoration: none; color: var(--ink); box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border); }
.firm-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.firm-card-name { font-family: var(--font-heading); font-weight: 600; font-size: .95rem; line-height: 1.3; }
.firm-card-ctry { font-family: var(--font-heading); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.firm-card .spark { width: 100%; height: 58px; }
.firm-card-foot { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-heading); font-size: .72rem; color: var(--muted); align-items: center; }
.firm-card-foot .tag { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 500; min-width: 0; }
.firm-card-foot .tag span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Insight tiles */
.insights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.insight {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px;
  padding: 18px 18px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px;
}
.insight .value { font-family: var(--font-heading); font-size: 2.1rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; color: var(--ink); }
.insight .label { font-family: var(--font-heading); font-size: .84rem; color: var(--ink-2); line-height: 1.4; font-weight: 500; }
.insight .sub { font-family: var(--font-heading); font-size: .74rem; color: var(--muted); margin-top: auto; padding-top: 6px; }
.insight .bar-accent { width: 28px; height: 3px; border-radius: 2px; background: var(--orange); margin-bottom: 6px; }

/* Who / what layout */
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.split .chart-card { margin: 0; }
.domain-list { display: flex; flex-direction: column; }
.domain-row {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 11px 20px; border-top: 1px solid var(--border-light); color: var(--ink);
  transition: background var(--t);
}
.domain-row:first-child { border-top: 0; }
.domain-row:hover { background: #fcfbf8; text-decoration: none; color: var(--ink); }
.domain-name { display: flex; align-items: center; gap: 9px; font-family: var(--font-heading); font-size: .86rem; font-weight: 600; }
.domain-name small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); }
.domain-row .spark { width: 100%; height: 36px; }
.domain-val { text-align: right; font-family: var(--font-heading); }
.domain-val strong { display: block; font-size: 1.05rem; font-weight: 700; }
.domain-val span { font-size: .7rem; color: var(--muted); white-space: nowrap; }

/* Dumbbell (countries then vs now) */
.dumbbell { padding: 6px 20px 4px; }
.db-legend { display: flex; gap: 18px; font-family: var(--font-heading); font-size: .76rem; color: var(--muted); margin: 0 0 6px; flex-wrap: wrap; }
.db-legend span { display: inline-flex; align-items: center; gap: 6px; }
.db-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.db-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) 92px; gap: 12px; align-items: center; height: 28px; border-radius: 6px; color: var(--ink); }
.db-row:hover { background: #fcfbf8; text-decoration: none; color: var(--ink); }
.db-name { font-family: var(--font-heading); font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.db-row.hl .db-name { color: var(--ink); font-weight: 700; }
.db-track { position: relative; height: 100%; }
.db-line { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: #d6d4cc; border-radius: 2px; }
.db-pt { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.db-ref { position: absolute; top: 0; bottom: 0; width: 1px; background: repeating-linear-gradient(to bottom, #b9b7af 0 3px, transparent 3px 6px); }
.db-val { font-family: var(--font-heading); font-size: .76rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-val strong { color: var(--ink); font-weight: 600; }
.db-axis { display: grid; grid-template-columns: 180px minmax(0, 1fr) 92px; gap: 12px; margin-top: 4px; }
.db-ticks { position: relative; height: 18px; border-top: 1px solid var(--border); }
.db-ticks span { position: absolute; top: 3px; transform: translateX(-50%); font-family: var(--font-heading); font-size: .7rem; color: var(--muted); }

/* Quick links */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px; padding: 18px 18px 16px;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t); box-shadow: var(--shadow-sm); color: var(--ink);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border); text-decoration: none; color: var(--ink); }
.card h3 { margin-bottom: 4px; }
.card h3::after { content: " →"; color: var(--orange-ink); }
.card p { font-size: .85rem; color: var(--ink-2); line-height: 1.5; }

/* Citation block */
.citation-block {
  margin-top: 44px; padding: 22px 26px;
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center;
}
.citation-block h2 { margin: 0 0 6px; font-size: 1rem; }
.citation-block p { font-size: .88rem; color: var(--ink-2); line-height: 1.6; }
.citation-actions { display: flex; flex-direction: column; gap: 8px; }

/* ============ TABLES ============ */
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th, td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border-light); font-variant-numeric: tabular-nums; }
thead th {
  font-family: var(--font-heading); font-size: .7rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2);
  position: sticky; top: 0; z-index: 2;
}
tbody th { font-family: var(--font-heading); font-weight: 500; font-size: .8rem; color: var(--ink-2); }
td.num, th.num { text-align: right; }
td.num { font-family: var(--font-heading); font-size: .82rem; white-space: nowrap; }
tbody tr { transition: background var(--t); }
tbody tr:hover td, tbody tr:hover th { background: #fcfbf8; }
.table-container { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; border: 1px solid var(--border-light); }

/* ============ RANKING ============ */
.ranking-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ranking-toolbar .combo { flex: 1; min-width: 240px; max-width: 420px; }
.ranking-summary {
  position: sticky; top: var(--nav-height); z-index: 4; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 10px 16px; background: rgba(255,255,255,0.97); border-bottom: 1px solid var(--border);
  font-family: var(--font-heading); font-size: .76rem; color: var(--muted);
}
.ranking-summary .tag { padding: 2px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); font-weight: 600; }
#ranking-table { font-family: var(--font-heading); }
#ranking-table thead th { position: static; }
#ranking-table td { font-size: .82rem; padding: 8px 14px; }
#ranking-table td.rank { color: var(--muted); width: 56px; text-align: right; }
#ranking-table td.name { font-weight: 500; color: var(--ink); max-width: 340px; }
#ranking-table td.name a { color: var(--ink); }
#ranking-table td.name a:hover { color: var(--orange-ink); }
#ranking-table td.sub { color: var(--ink-2); white-space: nowrap; }
.valbar { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.valbar .bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.valbar .bar i { display: block; height: 100%; border-radius: 4px; }
.valbar .v { width: 52px; text-align: right; font-weight: 600; color: var(--ink); }
#ranking-table tr.highlight td { background: var(--highlight-bg); }
#ranking-table tr.highlight td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.ranking-more { padding: 12px 16px; font-family: var(--font-heading); font-size: .8rem; color: var(--muted); }
.controls-toggle { display: none; }
.name-sub { display: none; font-size: .72rem; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ============ FIRM PROFILE ============ */
.firm-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.firm-hero h1 { font-size: 2rem; }
.firm-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-heading); font-size: .84rem; color: var(--ink-2); }
.firm-meta span strong { color: var(--muted); font-weight: 500; margin-right: 4px; }
.firm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .k-label { font-family: var(--font-heading); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi .k-value { font-family: var(--font-heading); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.kpi .k-sub { font-family: var(--font-heading); font-size: .76rem; color: var(--ink-2); margin-top: 2px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.two-col .chart-card { margin: 0; }
.domain-multiples { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 4px 8px 6px; }
.dm { padding: 10px 12px; border-left: 1px solid var(--border-light); }
.dm:first-child { border-left: 0; }
.dm-name { display: flex; align-items: center; gap: 7px; font-family: var(--font-heading); font-size: .78rem; font-weight: 600; color: var(--ink-2); min-height: 32px; }
.dm .spark { width: 100%; height: 70px; margin: 6px 0 4px; }
.dm-val { font-family: var(--font-heading); font-size: .74rem; color: var(--muted); }
.dm-val strong { color: var(--ink); font-size: .95rem; }
.peers-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.firm-empty { text-align: center; padding: 56px 20px 20px; }
.firm-empty h1 { margin-bottom: 8px; }
.firm-empty .search-box { margin: 18px auto 0; max-width: 520px; }

/* ============ PATTERNS: MAP + HEATMAP ============ */
.legend-scale { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-size: .74rem; color: var(--muted); }
.legend-scale .ramp { width: 180px; height: 10px; border-radius: 5px; }
.legend-scale .na { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.legend-scale .na i { width: 12px; height: 12px; border-radius: 3px; background: #f0efea; border: 1px solid #e3e1d9; display: inline-block; }
.tilemap-wrap { padding: 8px 20px 10px; overflow-x: auto; }
.tilemap { display: grid; gap: 3px; min-width: 760px; }
.tile {
  aspect-ratio: 1 / 1; border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: .66rem; font-weight: 600; color: var(--ink); line-height: 1.1;
  cursor: pointer; border: 0; padding: 0; transition: transform .12s ease, box-shadow .12s ease; position: relative;
}
.tile small { font-weight: 400; font-size: .58rem; opacity: .85; }
.tile:hover, .tile:focus-visible { transform: scale(1.12); box-shadow: 0 4px 12px rgba(20,20,19,.25); z-index: 2; }
.tile.na { background: #f0efea; color: var(--faint); cursor: default; }
.tile.na:hover { transform: none; box-shadow: none; }
.map-controls { display: flex; align-items: center; gap: 12px; padding: 4px 20px 0; flex-wrap: wrap; }
.map-controls input[type="range"] { flex: 1; min-width: 200px; accent-color: var(--orange-ink); }
.map-year { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; min-width: 64px; letter-spacing: -0.02em; }
.play-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.play-btn:hover { background: var(--surface-2); }
.heatmap-wrap { padding: 6px 20px 12px; overflow-x: auto; }
.heatmap { display: grid; gap: 2px; min-width: 760px; font-family: var(--font-heading); }
.hm-label { font-size: .72rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; display: block; text-align: right; line-height: 20px; height: 20px; }
.hm-label a { color: var(--ink-2); }
.hm-label a:hover { color: var(--orange-ink); }
.hm-cell { height: 20px; border-radius: 3px; cursor: pointer; border: 0; padding: 0; }
.hm-cell:hover, .hm-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; z-index: 1; position: relative; }
.hm-year { font-size: .66rem; color: var(--muted); text-align: center; height: 18px; }
.viz-tip {
  position: fixed; z-index: 150; pointer-events: none; background: rgba(20,20,19,0.94); color: #fff;
  padding: 8px 11px; border-radius: 8px; font-family: var(--font-heading); font-size: .76rem; line-height: 1.45;
  box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .1s; max-width: 260px;
}
.viz-tip.show { opacity: 1; }
.viz-tip strong { font-weight: 600; }
.viz-tip .tip-sub { color: #c3c2b7; }

/* ============ DATA PAGE ============ */
.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 8px; }
.download-card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.dl-head { display: flex; gap: 14px; align-items: center; }
.dl-head h2 { margin: 0; font-size: 1.15rem; }
.dl-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--orange-dim); color: var(--orange-ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dl-sub { font-family: var(--font-heading); font-size: .8rem; color: var(--muted); }
.dl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dl-stats div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.dl-stats dt { font-family: var(--font-heading); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dl-stats dd { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.dl-label { font-family: var(--font-heading); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: -6px; }
.dl-cols { display: flex; flex-wrap: wrap; gap: 5px; }
.dl-cols code { font-size: .74rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; color: var(--ink-2); }
.dl-grid { overflow-x: auto; border: 1px solid var(--border-light); border-radius: 8px; }
.dl-grid table { font-size: .74rem; }
.dl-grid th, .dl-grid td { padding: 6px 8px; white-space: nowrap; }
.dl-grid thead th { font-size: .64rem; letter-spacing: .04em; position: static; }
.dl-grid tbody th { font-size: .74rem; }
.dl-grid code { font-size: .7rem; color: var(--ink-2); }
.dl-col { font-family: var(--font-heading); font-size: .74rem; color: var(--muted); }
.dl-col code { font-size: .74rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; color: var(--ink-2); }
.dl-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.dl-file { font-family: var(--font-heading); font-size: .74rem; color: var(--muted); line-height: 1.45; }
.cite-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap;
  margin-top: 18px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
}
.cite-bar p { font-family: var(--font-heading); font-size: .84rem; color: var(--ink-2); }
.doc-card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 26px 34px 22px; max-width: 900px;
}
.doc-card .doc-title { font-size: 1.15rem; margin: 0 0 12px; }
.doc-card h4 { font-family: var(--font-heading); font-size: .98rem; font-weight: 600; margin: 24px 0 8px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.doc-card p { font-size: .93rem; line-height: 1.75; color: var(--ink-2); margin-bottom: 10px; }
.doc-card ul { margin: 0 0 12px 20px; font-size: .93rem; line-height: 1.75; color: var(--ink-2); }
.doc-card ul li::marker { color: var(--faint); }
.doc-inset { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--orange-dim); background: #fcfbf8; border-radius: 0 8px 8px 0; font-size: .9rem; line-height: 1.7; color: var(--ink-2); }
.doc-card a { overflow-wrap: anywhere; }
.doc-card p, .doc-card li, .doc-inset { overflow-wrap: break-word; }

/* ============ TEAM ============ */
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.team-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  padding: 24px 16px 20px; box-shadow: var(--shadow-sm); color: var(--ink);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.team-card:hover { text-decoration: none; color: var(--ink); box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border); }
.team-card img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); }
.team-name { font-family: var(--font-heading); font-weight: 600; font-size: .98rem; }
.team-aff { font-family: var(--font-heading); font-size: .8rem; color: var(--ink-2); line-height: 1.45; margin-top: -8px; max-width: 220px; }
.team-initials {
  width: 112px; height: 112px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3)); color: #fff;
  font-family: var(--font-heading); font-size: 2rem; font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border);
}
.team-link { margin-top: auto; }

/* ============ CLIMATE: topic composition bars ============ */
.list-label { padding: 12px 20px 6px; border-top: 1px solid var(--border-light); font-family: var(--font-heading); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.list-label + .domain-row { border-top: 0; }
.stackbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.stackbar i { display: block; height: 100%; }
.stackbar i + i { box-shadow: inset 1px 0 0 #fff; }
.ind-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.6fr) 70px; gap: 14px; align-items: center;
  padding: 10px 20px; border-top: 1px solid var(--border-light); color: var(--ink); transition: background var(--t); }
.ind-row:first-child { border-top: 0; }
.ind-row:hover { background: #fcfbf8; text-decoration: none; color: var(--ink); }
.ind-row .domain-val strong { font-size: .98rem; }
.ind-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 20px 10px; font-family: var(--font-heading); font-size: .76rem; color: var(--muted); }
.ind-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ind-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.domain-multiples.dm-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dm-3 .dm, .dm-3 .dm:nth-child(4), .dm-3 .dm:nth-child(odd) { border-left: 1px solid var(--border-light); }
.dm-3 .dm:first-child { border-left: 0; }
.dm-3 .dm { padding: 10px 10px; }
.team-link { font-family: var(--font-heading); font-size: .76rem; color: var(--orange-ink); }
.team-card:hover .team-link { text-decoration: underline; }

/* ============ METHODS ============ */
.method-section { margin-bottom: 34px; }
.method-section p { font-size: .93rem; line-height: 1.75; margin-bottom: 10px; color: var(--ink-2); max-width: 820px; }
.method-section .table-container.scroll { max-height: 520px; }
.tax-domain { font-family: var(--font-heading); font-weight: 600; vertical-align: top; }
.tax-domain .measure-dot { margin-right: 8px; vertical-align: 1px; }
.coverage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.coverage-grid h2 { margin-top: 0; font-size: .95rem; }

/* ============ DIALOG ============ */
.dialog { border: 0; border-radius: var(--radius-lg); padding: 22px 24px; width: min(640px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); background: var(--surface); margin: auto; }
.dialog::backdrop { background: rgba(20,20,19,0.45); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-head h2 { margin: 0; }
.dialog-label { font-family: var(--font-heading); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 0 6px; }
.cite-text { font-size: .88rem; line-height: 1.6; color: var(--ink-2); background: var(--surface-2); padding: 12px 14px; border-radius: 8px; }
.cite-bib { font-size: .76rem; line-height: 1.5; background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; white-space: pre; }
.dialog-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ============ TOAST / DRAWER ============ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 9px; font-family: var(--font-heading); font-size: .82rem; font-weight: 500; z-index: 400; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(20,20,19,0.4); z-index: 88; }
.drawer-toggle { display: none; position: fixed; bottom: 22px; right: 18px; z-index: 90; background: var(--ink); color: #fff; border: 0; border-radius: 40px; padding: 11px 20px; font-family: var(--font-heading); font-size: .84rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-lg); }

/* ============ FOOTER ============ */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.72); padding: 22px 32px; font-family: var(--font-heading); font-size: .8rem; margin-top: 56px; }
.footer-inner { max-width: var(--content-max); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: center; }
.footer-cite { color: rgba(255,255,255,0.86); }
.footer-links { display: flex; gap: 18px; align-items: center; }
.footer-links a, .footer-cite-btn { color: rgba(255,255,255,0.86); background: none; border: 0; cursor: pointer; font-family: var(--font-heading); font-size: .8rem; padding: 0; }
.footer-links a:hover, .footer-cite-btn:hover { color: var(--hero-accent); text-decoration: underline; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .peers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .domain-multiples { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dm:nth-child(4) { border-left: 0; }
  .coverage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .download-grid { grid-template-columns: minmax(0, 1fr); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --nav-height: 56px; --nav-top-height: 56px; }
  .nav-top { padding: 0 12px 0 18px; }
  .brand-text { display: inline; }
  .nav-top .section-nav { display: none; }
  .hamburger { display: flex; }
  .nav-sub {
    display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; height: auto;
    background: var(--bg);
    flex-direction: column; align-items: stretch; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--nav-height)); overflow-y: auto;
  }
  .nav-sub.open { display: flex; }
  .section-nav-mobile { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border-light); }
  .navbar .section-nav-mobile a { text-align: center; font-size: .82rem; padding: 9px 8px; line-height: 1.25; background: var(--surface-2); }
  .navbar .section-nav-mobile a.active { background: var(--ink); }
  .page-nav { flex-direction: column; }
  .navbar .page-nav a { padding: 10px 12px; font-size: .9rem; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-stat { border-left: 0; padding-left: 0; border-top: 1px solid rgba(255,255,255,0.18); padding-top: 22px; }
  .split, .two-col { grid-template-columns: 1fr; }
  .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .citation-block { grid-template-columns: 1fr; }
  .citation-actions { flex-direction: row; flex-wrap: wrap; }

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: min(88vw, 340px); z-index: 89;
    transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
    padding-top: calc(var(--nav-height) + 16px);
  }
  .sidebar.open { transform: translateX(0); }
  .drawer-overlay.open { display: block; }
  .drawer-toggle { display: inline-flex; }
  .main-content, .no-sidebar .main-content { padding: 20px 16px 0; }

  .controls-toggle { display: inline-flex; }
  .view-controls.collapsible { display: none; }
  .view-controls.collapsible.open { display: flex; }
}
@media (max-width: 768px) {
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .firm-card { padding: 12px; }
  .firm-card-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
  .peers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .domain-multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dm:nth-child(odd) { border-left: 0; }
  .dm:nth-child(4) { border-left: 1px solid var(--border-light); }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 1.75rem; }
  .hero-stat .big { font-size: 3.3rem; }
  .chart-head { flex-direction: column; }
  .chart-body { height: 320px; padding: 6px 8px 4px 4px; }
  .chart-foot { flex-direction: column; gap: 8px; }
  .db-row, .db-axis { grid-template-columns: 96px minmax(0, 1fr) 64px; gap: 8px; }
  .db-val { font-size: .7rem; }
  .site-footer { padding: 20px 18px; }
  .footer-inner { grid-template-columns: 1fr; }
  .domain-row { padding: 10px 14px; gap: 10px; }
  .ind-row { grid-template-columns: minmax(0, 1fr) 58px; gap: 6px 10px; padding: 10px 14px; }
  .ind-row .stackbar { grid-column: 1 / -1; grid-row: 2; }
  .ind-legend { padding: 4px 14px 10px; }
  .team-initials { width: 88px; height: 88px; font-size: 1.6rem; }
  #ranking-table .col-sub { display: none; }
  #ranking-table .name-sub { display: block; }
  #ranking-table td, #ranking-table th { padding: 8px 8px; }
  #ranking-table td.rank { width: 32px; }
  .valbar { min-width: 120px; gap: 6px; }
  .valbar .v { width: 40px; }
  .ranking-toolbar .combo { min-width: 100%; }
}
@media (max-width: 520px) {
  .doc-card { padding: 20px 18px; }
  .team-card img { width: 88px; height: 88px; }
  .dl-stats dd { font-size: 1.05rem; }
  .insights, .kpis, .card-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  .section-head h2 { font-size: 1.15rem; }
  .featured-grid { grid-template-columns: 1fr 1fr; }
  .firm-card-name { font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ============ HUB (project landing page) ============ */
[data-section="home"] { --nav-height: 56px; }
.nav-sub-home { display: none; }

.hub-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 64px 40px 56px; }
.hub-hero .hero-desc { margin-left: auto; margin-right: auto; }
.hub-hero .hero-actions { justify-content: center; }

.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border-light); border-top: 3px solid var(--orange);
  border-radius: var(--radius-lg); padding: 26px 26px 22px;
  box-shadow: var(--shadow-sm); color: var(--ink);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  /* pin the Social Exposure palette: the card is a project brand, not hub chrome */
  --orange: #d97757; --orange-ink: #a9532f; --orange-dim: #f6e7df;
  --accent-border: #ecc9b8; --focus-glow: rgba(217,119,87,0.16);
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-card.proj-climate {
  --orange: #2b9a6e; --orange-ink: #1d6b4c; --orange-dim: #e2f2e9;
  --accent-border: #b9dfca; --focus-glow: rgba(43,154,110,0.18);
}
.project-head { display: flex; align-items: center; gap: 12px; }
.project-head img { width: 40px; height: 40px; flex: none; }
.project-head h3 { margin: 0; font-size: 1.05rem; }
.project-authors { color: var(--muted); font-size: .84rem; }
.project-desc { color: var(--ink-2); font-size: .93rem; }
.project-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin: 8px 0 4px; padding: 14px 0; list-style: none;
  border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
}
.project-stats strong { display: block; font-family: var(--font-heading); font-size: 1rem; color: var(--ink); overflow-wrap: anywhere; }
.project-stats span { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }
.project-link { font-family: var(--font-heading); font-weight: 600; font-size: .86rem; color: var(--orange-ink); margin-top: auto; }
.project-link::after { content: " →"; }

@media (max-width: 960px) {
  .projects-grid { grid-template-columns: 1fr; }
  .project-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
