/* GridIberia region comparator. Typefaces are self-hosted from /fonts (SIL OFL 1.1). */
@font-face{font-family:"Bricolage Grotesque";font-style:normal;font-weight:200 800;font-stretch:75% 100%;font-display:swap;
src:url(/fonts/bricolage-latin-ext.woff2) format("woff2");
unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Bricolage Grotesque";font-style:normal;font-weight:200 800;font-stretch:75% 100%;font-display:swap;
src:url(/fonts/bricolage-latin.woff2) format("woff2");
unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:400 700;font-stretch:75% 100%;font-display:swap;
src:url(/fonts/instrument-latin-ext.woff2) format("woff2");
unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:400 700;font-stretch:75% 100%;font-display:swap;
src:url(/fonts/instrument-latin.woff2) format("woff2");
unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}


:root {
  /* GridIberia palette (shared with editorial pages and the map). */
  --gold: #fcdc4d;
  --crimson: #9a031e;
  --copper: #cb793a;

  --navy: #142a6b;
  --navy-deep: #0b1a47;
  --navy-2: #fcdc4d;
  --blue: #2a4fb8;
  --emerald: #2a4fb8;
  --emerald-bright: #8fa8ec;
  --cyan: #2a4fb8;
  --cyan-bright: #8fa8ec;
  --coral: #9a031e;
  --amber: #cb793a;
  --avail-ink: #7a5600;
  --on-emerald: #ffffff;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --soft: #f4f6fb;
  --soft-hover: #e9eef8;
  --text: #0e1a3f;
  --text-secondary: #2f3b5e;
  --muted: #4a5578;
  --border: #dde3f0;
  --border-strong: #c3cce2;
  --link: #2a4fb8;
  --accent-soft: rgba(42, 79, 184, 0.07);
  --info-bg: #f4f6fb;
  --info-border: #dde3f0;
  --warn-bg: rgba(203, 121, 58, 0.09);
  --warn-border: rgba(203, 121, 58, 0.34);
  --chart-grid: #dde3f0;
  --chart-axis: #4a5578;

  --series-0: #2a4fb8;
  --series-1: #cb793a;
  --series-2: #9a031e;
  --series-3: #b38600;

  --shadow-sm: 0 1px 2px rgba(20, 42, 107, 0.06);
  --shadow-md: 0 4px 14px rgba(20, 42, 107, 0.08);
  --shadow-lg: 0 12px 28px rgba(20, 42, 107, 0.12);

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html[data-theme="dark"] {
  --emerald: #fcdc4d;
  --emerald-bright: #fff0a8;
  --cyan: #8fa8ec;
  --cyan-bright: #b7c6f2;
  --coral: #ff8a75;
  --amber: #e0965c;
  --avail-ink: #fcdc4d;
  --on-emerald: #142a6b;

  --bg: #0b1a47;
  --surface: #102258;
  --surface-elevated: #152a66;
  --soft: #152a66;
  --soft-hover: #1b3274;
  --text: #f4f6fc;
  --text-secondary: #d5dcf0;
  --muted: #aebbe0;
  --border: rgba(244, 246, 252, 0.14);
  --border-strong: rgba(244, 246, 252, 0.26);
  --link: #fcdc4d;
  --accent-soft: rgba(252, 220, 77, 0.1);
  --info-bg: rgba(244, 246, 252, 0.05);
  --info-border: rgba(244, 246, 252, 0.2);
  --warn-bg: rgba(224, 150, 92, 0.11);
  --warn-border: rgba(224, 150, 92, 0.36);
  --chart-grid: rgba(244, 246, 252, 0.14);
  --chart-axis: #aebbe0;

  --series-0: #fcdc4d;
  --series-1: #8fa8ec;
  --series-2: #e0965c;
  --series-3: #ff8a75;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

.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: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 8px;
  z-index: 50;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Top Navbar */
.topbar {
  background: var(--navy);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  flex-wrap: wrap;
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo {
  flex: none;
  display: block;
}

.logo-bg {
  fill: var(--navy-2);
}

.logo-line {
  stroke: #ffffff;
}

.logo-dot {
  fill: var(--gold);
}

.mainnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.mainnav a {
  color: #d5dcf0;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.mainnav a:hover,
.mainnav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lang-switcher {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: #d5dcf0;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  color: #ffffff;
}

.lang-btn.active {
  background: var(--gold);
  color: var(--navy);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* Main Content */
.main-content {
  flex: 1;
  padding-top: 22px;
  padding-bottom: 52px;
}

/* Hero */
.hero {
  margin-bottom: 20px;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-copy {
  flex: 1;
  min-width: 280px;
}

.hero-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.eyebrow {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0;
  color: var(--cyan);
  font-weight: 700;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  border: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.lede {
  margin: 0;
  max-width: 740px;
  color: var(--muted);
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
}

.action-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--link);
}

.action-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-btn-primary {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--on-emerald);
}

.action-btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  border-color: var(--emerald);
  color: var(--on-emerald);
}

/* Status Panel */
.status-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.status-panel[hidden] {
  display: none;
}

.status-text {
  margin: 0;
  color: var(--muted);
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.panel-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.section-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 700;
}

.hint-text {
  font-size: 12.5px;
  color: var(--muted);
}

/* Presets */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 8px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.preset-btn:hover {
  border-color: var(--cyan);
  background: var(--surface);
}

.preset-btn.active {
  border-color: var(--emerald);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--emerald);
}

.preset-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.preset-regions {
  font-size: 12px;
  color: var(--muted);
}

/* Region Selector Slots */
.add-region-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--link);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.add-region-btn:hover {
  background: var(--soft);
  border-color: var(--cyan);
}

.add-region-btn[hidden] {
  display: none;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 10px;
}

.region-slot {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.slot-trigger {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.slot-trigger:hover,
.slot-trigger[aria-expanded="true"] {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--info-bg);
}

.slot-trigger-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.series-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.slot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-badge {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  flex-shrink: 0;
}

.slot-chevron {
  flex-shrink: 0;
  color: var(--muted);
}

.slot-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.slot-remove:hover {
  background: rgba(232, 87, 63, 0.12);
  border-color: var(--coral);
  color: var(--coral);
}

/* Searchable Dropdown Popover */
.slot-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 260px;
  z-index: 40;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.slot-popover[hidden] {
  display: none;
}

.popover-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--soft);
}

.popover-search {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
}

.popover-search:focus {
  border-color: var(--cyan);
}

.popover-list {
  max-height: 290px;
  overflow-y: auto;
  padding: 6px 0;
}

.popover-group-label {
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--muted);
}

.popover-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.popover-option:hover,
.popover-option.focused {
  background: var(--soft);
}

.popover-option.is-current {
  background: var(--accent-soft);
  font-weight: 700;
}

.popover-option-meta {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.popover-empty {
  padding: 14px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* Unit Honesty Banner & Market Context */
.unit-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--text);
  margin-bottom: 14px;
  font-size: 13.5px;
}

.unit-banner[hidden] {
  display: none;
}

.unit-banner-icon {
  color: var(--amber);
  flex-shrink: 0;
  margin-top: 2px;
}

.unit-banner-text {
  margin: 0;
}

.market-context-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.market-context-bar[hidden] {
  display: none;
}

.market-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* KPI Table */
.block {
  margin: 22px 0;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.block h2 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.015em;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.kpi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 600px;
}

.kpi-table th,
.kpi-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.kpi-table thead th {
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
}

.kpi-table thead th:first-child {
  width: 210px;
  font-size: 11.5px;
  letter-spacing: 0;
  color: var(--muted);
}

.kpi-table tbody th[scope="row"] {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  white-space: nowrap;
}

.kpi-table tbody tr:last-child th,
.kpi-table tbody tr:last-child td {
  border-bottom: 0;
}

.kpi-table tbody tr:hover td,
.kpi-table tbody tr:hover th {
  background: var(--soft);
}

.region-col-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.region-col-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
}

.region-col-meta {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.val-primary {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.val-unit {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

.val-sub {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font);
  margin-top: 2px;
}

.val-leader {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--emerald);
  vertical-align: middle;
}

.delta-pos {
  color: var(--emerald);
}

.delta-neg {
  color: var(--coral);
}

.delta-zero {
  color: var(--muted);
}

.sat-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 110px;
}

.sat-bar-track {
  width: 100%;
  max-width: 136px;
  height: 7px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.sat-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.sat-low {
  background: var(--emerald);
}

.sat-mid {
  background: var(--amber);
}

.sat-high {
  background: var(--coral);
}

.op-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.op-pill {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cell-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.cell-link:hover {
  border-color: var(--cyan);
  color: var(--link);
  text-decoration: none;
}

.cell-link-primary {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--on-emerald);
}

.cell-link-primary:hover {
  filter: brightness(1.06);
  border-color: var(--emerald);
  color: var(--on-emerald);
}

/* Dynamic Multi-Region Alert Capture Card */
.compare-alert-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px 24px;
  margin: 22px 0;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.compare-alert-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.compare-alert-header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.compare-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--emerald);
  flex-shrink: 0;
  margin-top: 1px;
}

.compare-alert-copy {
  min-width: 0;
}

.compare-alert-heading {
  margin: 0 0 3px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
}

.compare-alert-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.compare-alert-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compare-alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.compare-alert-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.compare-alert-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.compare-alert-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.compare-alert-input::placeholder {
  color: var(--muted);
}

.compare-alert-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--info-bg);
}

.compare-alert-submit {
  flex: 0 0 auto;
  white-space: nowrap;
}

.compare-alert-status {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  min-height: 0;
}

.compare-alert-status:empty {
  margin: 0;
  padding: 0;
  min-height: 0;
}

.compare-alert-status.is-sending {
  color: var(--muted);
}

.compare-alert-status.is-success {
  color: var(--emerald);
  font-weight: 600;
}

.compare-alert-status.is-error {
  color: var(--coral);
  font-weight: 500;
}

.compare-alert-status a {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
}

.compare-alert-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 11.5px;
  color: var(--muted);
}

.compare-alert-rss {
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  white-space: nowrap;
}

.compare-alert-rss:hover {
  text-decoration: underline;
}

/* Charts */
.charts-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chart-head h2 {
  margin: 0 0 3px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.chart-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.bars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.bar-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--bg);
}

.bar-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.bar-panel-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
}

.inline-legend {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.segmented {
  display: inline-flex;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 10px;
}

.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.trend-legend-line {
  width: 16px;
  height: 3px;
  border-radius: 99px;
  display: inline-block;
}

.trend-legend-delta {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 600;
}

.svg-host {
  width: 100%;
  overflow-x: auto;
}

.chart-svg {
  width: 100%;
  min-width: 480px;
  height: auto;
  display: block;
}

#trend-chart-host .chart-svg {
  min-width: 640px;
}

.svg-label {
  fill: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
}

.svg-muted {
  fill: var(--chart-axis);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.svg-value {
  fill: var(--text-secondary);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
}

.svg-grid {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.svg-point {
  cursor: pointer;
  transition: r 0.12s ease;
}

.chart-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* Footer */
.sitefoot {
  background: var(--navy);
  color: #d5dcf0;
  padding: 26px 0;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.foot-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.foot-brand-col {
  max-width: 560px;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-weight: 700;
  margin: 0 0 6px;
}

.foot-note {
  margin: 0;
  font-size: 12.5px;
  color: #b8c4e6;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 13px;
  align-items: center;
}

.foot-links a {
  color: #fcdc4d;
  text-decoration: none;
}

.foot-links a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .mainnav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .mainnav a {
    white-space: nowrap;
  }

  .kpi-table th,
  .kpi-table td {
    padding: 8px 10px;
  }

  .bars-grid {
    grid-template-columns: 1fr;
  }

  .compare-alert-card {
    grid-template-columns: 1fr;
    padding: 15px 14px;
    gap: 14px;
  }
}

@media (max-width: 520px) {
  .compare-alert-row {
    flex-direction: column;
  }

  .compare-alert-submit {
    width: 100%;
  }
}


/* ==========================================================================
   Modern layer: light chrome matching the editorial pages, display type for
   headings and figures, flat panels separated by space rather than boxes.
   ========================================================================== */

[hidden] {
  display: none !important;
}

body {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

html[data-theme="dark"] :focus-visible,
.sitefoot :focus-visible {
  outline-color: var(--gold);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 650;
  font-stretch: 90%;
  letter-spacing: -0.015em;
  color: var(--navy);
  text-wrap: balance;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
  color: #ffffff;
}

.wrap {
  max-width: 1160px;
  padding: 0 24px;
}

/* Header: the navy structural bar (same as the editorial pages) */
.topbar,
html[data-theme="dark"] .topbar {
  position: static;
  background: var(--navy);
  color: #f4f6fc;
  border-bottom: 0;
}

html[data-theme="dark"] .topbar {
  background: var(--navy-deep);
  border-bottom: 1px solid var(--border);
}

.topbar :focus-visible {
  outline-color: var(--gold);
}

.topbar-inner {
  min-height: 72px;
  gap: 8px 32px;
}

.brand,
html[data-theme="dark"] .brand {
  color: #ffffff;
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 88%;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.logo-bg {
  fill: var(--gold);
}

.logo-line {
  stroke: var(--navy);
}

.logo-dot {
  fill: var(--navy);
}

.mainnav {
  gap: 4px 26px;
}

.mainnav a {
  color: #f4f6fc;
  background: transparent;
  border-radius: 0;
  padding: 6px 0;
  font-size: 15px;
  font-weight: 500;
  text-underline-offset: 9px;
}

.mainnav a:hover,
.mainnav a[aria-current="page"] {
  background: transparent;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.mainnav a[aria-current="page"] {
  font-weight: 600;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
}

.topbar-controls {
  gap: 12px;
}

/* Primary action: yellow plate, navy type; hover inverts */
.cta-map {
  display: inline-flex;
  align-items: center;
  background: var(--gold);
  color: var(--navy);
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
  padding: 9px 16px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
}

.cta-map:hover {
  background: var(--navy-deep);
  color: var(--gold);
}

.lang-switcher {
  background: transparent;
}

.lang-btn {
  color: #b8c4e6;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 7px;
}

.lang-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active,
html[data-theme="dark"] .lang-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: none;
}

.theme-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: transparent;
  color: #ffffff;
  border-radius: var(--radius);
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: transparent;
  color: #ffffff;
}

/* Hero: white, generous, no eyebrow */
.main-content {
  padding-top: 0;
  padding-bottom: 96px;
}

.hero {
  padding: 48px 0 40px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow-row {
  margin-bottom: 0;
}

.eyebrow {
  display: none;
}

.date-pill {
  order: 2;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 14px;
  margin-top: 16px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
}

.hero-copy h1 {
  order: 0;
}

.hero-copy .lede {
  order: 1;
}

.hero-eyebrow-row {
  order: 3;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.04;
  font-weight: 700;
  font-stretch: 86%;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  max-width: 18ch;
}

.lede {
  max-width: 62ch;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text);
}

/* Panels: flat, separated by space and one hairline */
.panel,
.chart-card,
.compare-alert-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  padding: 28px 0 12px;
  margin-bottom: 24px;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.preset-btn {
  border-radius: var(--radius);
  box-shadow: none;
}

.preset-btn.active {
  border-color: var(--link);
  background: var(--accent-soft);
}

.action-btn {
  border-radius: var(--radius);
  box-shadow: none;
}

.action-btn-primary,
.compare-alert-submit,
html[data-theme="dark"] .action-btn-primary,
html[data-theme="dark"] .compare-alert-submit {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  font-weight: 650;
}

.action-btn-primary:hover:not(:disabled),
.compare-alert-submit:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--gold);
  filter: none;
}

html[data-theme="dark"] .action-btn-primary:hover:not(:disabled),
html[data-theme="dark"] .compare-alert-submit:hover {
  background: #ffe680;
  border-color: #ffe680;
  color: var(--navy);
}

.compare-alert-submit {
  border-radius: var(--radius);
}

.kpi-table th,
.kpi-table td {
  border-color: var(--border);
}

.kpi-table thead th {
  border-bottom: 1px solid var(--navy);
  background: transparent;
}

.table-wrap {
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.val-primary {
  font-family: var(--display) !important;
  font-stretch: 88%;
  font-weight: 650;
  letter-spacing: -0.015em;
}

/* Progressive disclosure */
details.disclosure {
  margin: 12px 0;
}

details.disclosure > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--link);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 0;
}

html[data-theme="dark"] details.disclosure > summary {
  color: var(--gold);
}

details.disclosure > summary::-webkit-details-marker {
  display: none;
}

details.disclosure > summary::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 9px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 9px no-repeat,
    var(--soft-hover);
}

details.disclosure[open] > summary::before {
  background:
    linear-gradient(currentColor, currentColor) center / 9px 1.5px no-repeat,
    var(--soft-hover);
}

details.disclosure > summary:hover {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

html[data-theme="dark"] details.disclosure > summary:hover {
  color: #ffffff;
}

.hero-share {
  margin: 0;
}

.hero-share .hero-actions {
  margin-top: 8px;
}

.trend-more {
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

/* Footer: deep navy, yellow for hover */
.sitefoot {
  background: var(--navy-deep);
  color: #f4f6fc;
  border-top: 0;
}

.sitefoot a {
  color: #f4f6fc;
}

.sitefoot a:hover {
  color: var(--gold);
}

.sitefoot .foot-note {
  color: #b8c4e6;
}

/* Figures in the text face with tabular numerals, never monospace */
.val-unit,
.val-sub,
.date-pill,
.region-col-meta,
.market-context-bar,
.svg-host text {
  font-family: var(--font) !important;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding: 28px 0 28px;
  }
}

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

/* Bar charts: no boxes, and never wider than a phone screen */
.bars-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 32px 56px;
}

.bar-panel {
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.bar-panel-head h3 {
  font-size: 15px;
}

/* The JS lays the bars out at the panel's own width, so they fit without a
   minimum width or an inner scrollbar, in both themes. */
.bar-panel .svg-host {
  overflow: visible;
}

.bar-panel .chart-svg {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.compare-unit-note,
.market-context-bar {
  border-radius: var(--radius);
}
