/* uVidNova — application stylesheet
   Plain CSS, custom properties, mobile-first.
   No Tailwind, no preprocessor. Targets evergreen browsers. */

/* ── Variables ───────────────────────────────────────────────────────────────── */
:root {
  --header-h: 56px;
  --viewbar-h: 44px;
  --map-top: 100px;
  --bar-h: 52px;
  --colour-navy:        #1a3a6b;
  --colour-navy-light:  #2a5298;
  --colour-gold:        #f0a500;
  --colour-gold-light:  #f5c842;
  --colour-bg:          #f4f6f9;
  --colour-surface:     #ffffff;
  --colour-border:      #d0d8e8;
  --colour-text:        #1a1d23;
  --colour-text-muted:  #5a6272;
  --colour-danger:      #c0392b;
  --colour-warning:     #e67e22;
  --colour-pending:     #8e44ad;
  --colour-grant:       #27ae60;
  --colour-era:         #1e8449;
  --colour-first-loss:  #52be80;
  --colour-concessional:#2980b9;
  --colour-senior-ifi:  #1a6fa8;
  --colour-dfi-equity:  #5dade2;
  --colour-pub-equity:  #7f8c8d;
  --colour-diaspora:    #a9cce3;
  --colour-commercial:  #884ea0;
  --colour-private:     #2c3e50;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Mono', ui-monospace, monospace;
}

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--colour-bg);
  color: var(--colour-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  /* Prevent pull-to-refresh and over-scroll from stealing map gestures */
  overscroll-behavior: none;
}
a { color: var(--colour-navy-light); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── Header ──────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--colour-navy);
  color: #fff;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── Map view bar — separate fixed strip between header and map ─────────── */
.map-view-bar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--viewbar-h);
  background: rgba(10,20,50,0.88);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0 1rem;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img { border-radius: 4px; }
.wordmark-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.wordmark-text .u    { color: #fff; }
.wordmark-text .vid  { color: var(--colour-gold-light); }
.wordmark-text .nova { color: #fff; }
.tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  flex: 1;
  min-width: 0;
}
/* ── Header centre: primary action buttons ── */
.header-centre {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  justify-content: center;
}
.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 14px;
  padding: 0.45rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: var(--font-sans);
  cursor: pointer;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  text-decoration: none;
  border: none;
}
.header-action-btn:hover { transform: translateY(-2px); text-decoration: none; }
.header-action-btn:active { transform: translateY(0); }
.header-action-finance,
.header-action-trust {
  background: #f0a500;
  color: #0a1628;
  box-shadow: 0 3px 10px rgba(240,165,0,0.40);
}
.header-action-finance:hover,
.header-action-trust:hover { background: #f5b820; box-shadow: 0 5px 16px rgba(240,165,0,0.55); }
.site-nav { display: flex; gap: 1.25rem; align-items: center; }
.site-nav a { color: rgba(255,255,255,0.85); font-size: 0.875rem; }
.site-nav a:hover { color: #fff; text-decoration: none; }
.nav-finance-link {
  color: var(--colour-gold-light) !important;
  font-weight: 600;
}
.lang-toggle {
  font-size: 1.35rem;
  line-height: 1;
  font-family: var(--font-sans);
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.lang-toggle:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.6); transform: scale(1.08); }

/* ── Map layout — map always fills the frame; panels slide over as overlays ─── */
.map-layout {
  position: fixed;
  inset: 0;
  top: var(--map-top);
  bottom: var(--bar-h);
  overflow: hidden;
  background: #deeeff; /* light blue — JS overrides on view switch but same colour */
  transition: background 0.4s ease;
}
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #deeeff;
  transition: background 0.4s ease;
  /* Prevent browser scroll/zoom from intercepting Leaflet touch gestures */
  touch-action: none;
}
/* Leaflet container inherits touch-action so pinch/pan are handled exclusively by Leaflet */
.leaflet-container { touch-action: none; }

/* ── Map view tab bar — lives in the sub-nav row below the main header ─────── */
.map-view-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 0.3rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  height: 30px;
  display: inline-flex;
  align-items: center;
}
.map-view-tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
/* active colour is set via inline style by JS (matches view palette) */
.map-view-tab-active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 700;
}
.map-view-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(10,20,45,0.82);
  border: 1px solid rgba(201,162,39,0.35);
  color: rgba(255,255,255,0.7);
  font-size: 0.76rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

/* Map overlay toggle buttons — fixed pills just below the view tab bar */
.map-toggle-btn {
  position: fixed;
  top: calc(var(--map-top) + 0.75rem);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(13,34,72,0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.map-toggle-btn:hover {
  background: rgba(13,34,72,0.95);
  border-color: rgba(255,255,255,0.3);
}
.map-toggle-btn.active {
  border-color: #c9a227;
  color: #c9a227;
}
.map-toggle-left  { left: 0.75rem; }
.map-toggle-right { right: 0.75rem; }

/* Panel close button (inside panel header) */
.panel-close-btn {
  background: none;
  border: none;
  color: var(--colour-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.panel-close-btn:hover { color: var(--colour-navy); background: var(--colour-bg); }

/* Shared panel base */
.filter-panel,
.asset-list-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 500;
  background: var(--colour-surface);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.22);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  /* Panels off-screen must not intercept map touches */
  pointer-events: none;
}
.filter-panel.panel-open,
.asset-list-panel.panel-open { pointer-events: auto; }

/* Filter panel — slides in from left */
.filter-panel {
  left: 0;
  width: 280px;
  border-right: 1px solid var(--colour-border);
  transform: translateX(-100%);
  overflow-y: auto;
  padding: 1rem;
}
.filter-panel.panel-open { transform: translateX(0); }

/* Asset list panel — slides in from right */
.asset-list-panel {
  right: 0;
  width: 300px;
  border-left: 1px solid var(--colour-border);
  transform: translateX(100%);
  overflow: hidden;
}
.asset-list-panel.panel-open { transform: translateX(0); }

/* Asset list panel header */
.asset-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.6rem;
  border-bottom: 1px solid var(--colour-border);
  flex-shrink: 0;
}
.asset-list-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--colour-navy);
  margin: 0 0 0.2rem;
}
.asset-count { font-size: 0.75rem; color: var(--colour-text-muted); }

/* ── Filter panel internals ──────────────────────────────────────────────────── */
.panel-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--colour-text-muted); margin-bottom: 0.75rem; }
.filter-group { margin-bottom: 1.25rem; }
.filter-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--colour-text-muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }
.chip-group { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  font-size: 0.75rem;
  font-family: var(--font-sans);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1.5px solid var(--colour-border);
  background: var(--colour-bg);
  color: var(--colour-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.chip.active {
  border-color: var(--colour-navy);
  background: var(--colour-navy);
  color: #fff;
}
.chip:hover:not(.active) { border-color: var(--colour-navy-light); color: var(--colour-navy-light); }

/* ── Asset list ──────────────────────────────────────────────────────────────── */
.asset-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.asset-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--colour-border);
  color: var(--colour-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.1s;
  flex-shrink: 0;
}
.asset-list-item:hover { background: var(--colour-bg); text-decoration: none; }
.ali-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.ali-body { display: flex; flex-direction: column; gap: 0.15rem; }
.ali-name { font-weight: 600; line-height: 1.3; }
.ali-meta { font-size: 0.75rem; color: var(--colour-text-muted); }

/* ── Leaflet popup overrides ─────────────────────────────────────────────────── */
.asset-popup .leaflet-popup-content-wrapper { border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.popup-inner { font-family: var(--font-sans); }
.popup-name { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; line-height: 1.3; }
.popup-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.popup-sector { font-size: 0.75rem; background: var(--colour-bg); padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); }
.popup-level { font-size: 0.75rem; padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); background: #fee; color: var(--colour-danger); }
.popup-level.light { background: #fff8e1; color: #e67e22; }
.popup-level.moderate { background: #fff3e0; color: #d35400; }
.popup-level.severe { background: #fdecea; color: var(--colour-danger); }
.popup-level.destroyed { background: #c0392b; color: #fff; }
.popup-status { font-size: 0.8rem; color: var(--colour-text-muted); margin-bottom: 0.4rem; }
.popup-cost { font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 0.5rem; }
.popup-pending { font-size: 0.8rem; color: var(--colour-pending); display: block; margin-bottom: 0.5rem; }
.popup-redamage { font-size: 0.8rem; color: var(--colour-danger); display: block; margin-bottom: 0.3rem; font-weight: 600; }
.popup-link { font-size: 0.85rem; font-weight: 600; color: var(--colour-navy-light); display: block; margin-top: 0.25rem; }
.oblast-tooltip { background: rgba(26,58,107,0.9); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 0.8rem; }

/* ── Capital city markers (Ukraine view) ────────────────────────────────── */
.capital-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.7);
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}
.capital-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.capital-label {
  font-size: 0.67rem;
  font-weight: 600;
  color: #1a3a6b;
  text-shadow: 0 1px 2px rgba(255,255,255,0.9), 0 0 4px #fff;
  white-space: nowrap;
  pointer-events: none;
}
.capital-label-occupied {
  color: #7a0000;
}

.load-error { padding: 2rem; color: var(--colour-danger); }

/* ── Asset detail page ───────────────────────────────────────────────────────── */
body.asset-page { display: flex; flex-direction: column; }
.asset-main {
  flex: 1;
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
}
.loading-state { padding: 3rem; text-align: center; color: var(--colour-text-muted); }
.error-state { padding: 3rem; text-align: center; }
.error-state a { color: var(--colour-navy-light); }

.asset-section {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.asset-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--colour-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--colour-border);
}
.asset-section h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }

.asset-name { font-size: 1.5rem; font-weight: 700; line-height: 1.25; margin-bottom: 0.3rem; }
.asset-name-uk { font-size: 1rem; color: var(--colour-text-muted); margin-bottom: 0.75rem; }
.redamage-alert {
  background: #fdecea;
  border: 1.5px solid var(--colour-danger);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--colour-danger);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.asset-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-sector    { background: var(--colour-navy); color: #fff; }
.badge-type      { background: var(--colour-bg); border: 1px solid var(--colour-border); color: var(--colour-text-muted); font-family: var(--font-mono); }
.badge-lifecycle { background: #e8f4fd; color: #1a6aa1; }
.badge-rebuild   { background: #eafaf1; color: #196f3d; }

/* ── Field table ─────────────────────────────────────────────────────────────── */
.field-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.field-table th, .field-table td { padding: 0.45rem 0.5rem; vertical-align: top; text-align: left; border-bottom: 1px solid var(--colour-border); }
.field-table th { width: 38%; font-weight: 600; color: var(--colour-text-muted); font-size: 0.8rem; }
.field-note { font-size: 0.75rem; color: var(--colour-warning); margin-left: 0.5rem; }

/* ── Source chips ────────────────────────────────────────────────────────────── */
.source-chip {
  display: inline-block;
  font-size: 0.7rem;
  background: #e8f4fd;
  color: var(--colour-navy-light);
  border: 1px solid #b8d4ef;
  border-radius: var(--radius-sm);
  padding: 0.05rem 0.35rem;
  margin-left: 0.25rem;
  vertical-align: middle;
  cursor: help;
}
.source-list { list-style: none; padding: 0; margin-top: 0.75rem; }
.source-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--colour-border); font-size: 0.85rem; }
.source-list li:last-child { border-bottom: none; }

/* ── Cost paths ──────────────────────────────────────────────────────────────── */
.pending-note { font-size: 0.85rem; color: var(--colour-pending); margin-bottom: 0.75rem; }
.disclaimer-inline {
  font-size: 0.78rem;
  color: var(--colour-text-muted);
  background: #fffbf0;
  border: 1px solid #f0d080;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.disclaimer-inline-dismiss {
  background: none;
  border: 1px solid #c8a840;
  color: #7a6010;
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.disclaimer-inline-dismiss:hover { background: #f0d080; }
.cost-path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cost-card {
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--colour-bg);
}
.cost-card-title { font-size: 0.85rem; font-weight: 700; color: var(--colour-navy); margin-bottom: 0.2rem; }
.cost-card-desc { font-size: 0.75rem; color: var(--colour-text-muted); margin-bottom: 0.5rem; }
.cost-range { font-size: 0.85rem; color: var(--colour-text-muted); }
.cost-central { font-size: 1rem; margin-top: 0.25rem; }
.tech-overlays { margin-top: 0.6rem; }
.overlays-label { font-size: 0.72rem; color: var(--colour-text-muted); display: block; margin-bottom: 0.25rem; }
.overlay-chip {
  display: inline-block;
  font-size: 0.7rem;
  background: #e8f8f0;
  border: 1px solid #a9dfbf;
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.35rem;
  margin: 0.1rem;
  color: #196f3d;
}
.calc-details { margin-top: 0.75rem; }
.calc-details summary { font-size: 0.85rem; cursor: pointer; color: var(--colour-navy-light); }
.calc-pending { font-size: 0.85rem; color: var(--colour-text-muted); padding: 0.75rem; background: var(--colour-bg); border-radius: var(--radius-sm); margin-top: 0.5rem; }
.calc-pending code { font-family: var(--font-mono); font-size: 0.8rem; }
.calc-working { padding: 0.75rem; }
.calc-formula { font-size: 0.8rem; margin-bottom: 0.75rem; }
.calc-formula code { font-family: var(--font-mono); }
.calc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.calc-table th, .calc-table td { padding: 0.35rem 0.5rem; border: 1px solid var(--colour-border); }
.calc-table th { background: var(--colour-bg); font-weight: 600; }

/* ── Financing structures ────────────────────────────────────────────────────── */
.section-note { font-size: 0.8rem; color: var(--colour-text-muted); margin-bottom: 1rem; }
.financing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.financing-card { border: 1px solid var(--colour-border); border-radius: var(--radius-md); padding: 1rem; }
.financing-card h3 { font-size: 0.85rem; font-weight: 700; color: var(--colour-navy); margin-bottom: 0.6rem; }
.stack-bar {
  height: 32px;
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.6rem;
  border: 1px solid var(--colour-border);
}
.stack-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: opacity 0.1s;
}
.stack-seg .seg-pct   { font-size: 0.7rem; font-weight: 700; line-height: 1; }
.stack-seg .seg-label { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 0.55rem; font-weight: 400; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack-seg.grant          { background: var(--colour-grant); }
.stack-seg.era            { background: var(--colour-era); }
.stack-seg.first-loss     { background: var(--colour-first-loss); }
.stack-seg.concessional   { background: var(--colour-concessional); }
.stack-seg.senior-ifi     { background: var(--colour-senior-ifi); }
.stack-seg.dfi-equity     { background: var(--colour-dfi-equity); }
.stack-seg.public-equity  { background: var(--colour-pub-equity); }
.stack-seg.diaspora       { background: var(--colour-diaspora); }
.stack-seg.eca            { background: #6c5ce7; }
.stack-seg.commercial-debt{ background: var(--colour-commercial); }
.stack-seg.institutional  { background: #a29bfe; }
.stack-seg.private-equity { background: var(--colour-private); }
.financing-rationale { font-size: 0.8rem; color: var(--colour-text-muted); margin-top: 0.5rem; line-height: 1.4; }
.comparable-refs { font-size: 0.75rem; color: var(--colour-text-muted); margin-top: 0.35rem; }

/* ── Tranche detail expander ─────────────────────────────────────────────────── */
.tranche-details { margin-top: 0.5rem; }
.tranche-details summary { font-size: 0.78rem; color: var(--colour-navy-light); cursor: pointer; user-select: none; }
.tranche-details summary:hover { text-decoration: underline; }
.tranche-breakdown { margin-top: 0.5rem; }
.tranche-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.tranche-table th { background: var(--colour-bg); font-weight: 600; padding: 0.25rem 0.4rem; border-bottom: 1px solid var(--colour-border); text-align: left; }
.tranche-table td { padding: 0.2rem 0.4rem; border-bottom: 1px solid var(--colour-border); }
.tranche-table tr.tranche-zero { opacity: 0.4; }
.tranche-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tranche-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-right: 0.35rem; vertical-align: middle; }
.tranche-dot.grant          { background: var(--colour-grant); }
.tranche-dot.era            { background: var(--colour-era); }
.tranche-dot.first-loss     { background: var(--colour-first-loss); }
.tranche-dot.concessional   { background: var(--colour-concessional); }
.tranche-dot.senior-ifi     { background: var(--colour-senior-ifi); }
.tranche-dot.dfi-equity     { background: var(--colour-dfi-equity); }
.tranche-dot.public-equity  { background: var(--colour-pub-equity); }
.tranche-dot.diaspora       { background: var(--colour-diaspora); }
.tranche-dot.eca            { background: #6c5ce7; }
.tranche-dot.commercial-debt{ background: var(--colour-commercial); }
.tranche-dot.institutional  { background: #a29bfe; }
.tranche-dot.private-equity { background: var(--colour-private); }
.tranche-note { font-size: 0.75rem; color: var(--colour-text-muted); margin-top: 0.35rem; line-height: 1.45; }
.pri-note strong, .structure-note strong { color: var(--colour-navy); }
.template-ref code { font-size: 0.7rem; }

/* ── Donor pathway ───────────────────────────────────────────────────────────── */
.donor-list { list-style: none; padding: 0; }
.donor-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--colour-border); font-size: 0.875rem; }
.donor-list li:last-child { border-bottom: none; }
.osm-link { font-size: 0.85rem; }

/* ── About page ──────────────────────────────────────────────────────────────── */
.about-main { max-width: 800px; margin: 2rem auto; padding: 0 1.5rem; flex: 1; }
.about-main h1 { font-size: 1.75rem; color: var(--colour-navy); margin-bottom: 0.5rem; }
.about-main h2 { font-size: 1.1rem; color: var(--colour-navy); margin: 2rem 0 0.5rem; }
.about-main p, .about-main li { font-size: 0.9rem; line-height: 1.7; margin-bottom: 0.5rem; }
.about-main code { font-family: var(--font-mono); font-size: 0.85rem; background: var(--colour-bg); padding: 0.1rem 0.3rem; border-radius: var(--radius-sm); }
.about-main pre { background: var(--colour-bg); border: 1px solid var(--colour-border); border-radius: var(--radius-md); padding: 1rem; overflow-x: auto; font-size: 0.8rem; margin: 0.75rem 0; }
.about-main table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin: 0.75rem 0; }
.about-main th, .about-main td { padding: 0.4rem 0.6rem; border: 1px solid var(--colour-border); }
.about-main th { background: var(--colour-bg); font-weight: 600; }
.sources-table code { font-size: 0.8rem; }
.about-lead { font-size: 1rem; line-height: 1.75; color: var(--colour-navy); font-weight: 500; border-left: 3px solid var(--colour-gold); padding-left: 1rem; margin-bottom: 1.5rem; }
.about-blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--colour-navy-light);
  background: var(--colour-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--colour-navy);
  font-style: italic;
  line-height: 1.65;
}

/* ── Landing overlay ─────────────────────────────────────────────────────── */
.landing-overlay {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  transition: opacity 0.5s ease, visibility 0.5s;
  overflow: hidden;
  background-image: url('/assets/ukraine-bg.svg');
  background-size: cover;
  background-position: center bottom;
}
/* Readability overlay (pseudo, non-interactive) */
.landing-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(2,8,28,0.72) 0%,
    rgba(4,12,40,0.58) 50%,
    rgba(2,8,28,0.78) 100%
  );
  pointer-events: none;
  z-index: 0;
}
.landing-overlay.dismissed {
  opacity: 0;
  visibility: hidden;
  /* pointer-events stays auto until fully invisible so click-through isn't jarring */
}
.landing-overlay.dismissed * { pointer-events: none; }
.landing-content {
  position: relative;
  z-index: 1;
  max-width: 540px;
  width: 100%;
  text-align: center;
  color: #fff;
  background: rgba(4,12,40,0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 1.5rem;
  padding: 2.5rem 2.5rem 1.75rem;
  box-shadow: 0 8px 48px rgba(0,0,0,0.55);
}
.landing-logo {
  border-radius: 6px;
  margin-bottom: 1rem;
}
.landing-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.landing-title .u    { color: #fff; }
.landing-title .vid  { color: var(--colour-gold-light); }
.landing-title .nova { color: #fff; }

/* ── Name etymology grid ───────────────────────────────────────────────────── */
/*
  Three-row, three-column grid:
    [Ukraine]  [ ]  [Відновa — Restoration]   ← sources, muted
    [  u    ] [+]  [  VidNova             ]   ← the wordmark, bright
    [ you   ]  [ ]  [Nova ★ — New Star    ]   ← poetic meanings, muted italic
  Columns: left glyph | connector | right glyph
*/
.name-etymology {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto;
  align-items: center;
  column-gap: 0.55rem;
  row-gap: 0;
  margin: 0.5rem 0 1.2rem;
  width: 100%;
  max-width: 360px;
}

/* ── row 1: sources ── */
.etym-source {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  padding-bottom: 0.28rem;
  white-space: nowrap;
}
.etym-source-u   { text-align: right; }
.etym-source-vid { text-align: left; }

/* ── row 2: wordmark ── */
.etym-mark {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}
.etym-mark-u   { text-align: right; }
.etym-mark-vid { text-align: left; }
.etym-plus {
  color: rgba(255,255,255,0.3);
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
  padding: 0 0.1rem;
  line-height: 1;
}

/* ── row 3: poetic meanings ── */
.etym-meaning {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.38);
  font-style: italic;
  letter-spacing: 0.04em;
  padding-top: 0.28rem;
  white-space: nowrap;
}
.etym-meaning-u    { text-align: right; }
.etym-meaning-nova { text-align: left; }

/* invisible grid fillers for the centre column in rows 1 & 3 */
.etym-connector-top,
.etym-connector-bot { display: block; }

/* Nova star animation */
.nova-star-inline { color: #fff; font-style: normal; font-weight: 700; }
.etym-star {
  font-size: 0.7rem;
  color: var(--colour-gold-light);
  margin-left: 0.15rem;
  vertical-align: middle;
  animation: nova-pulse 3.5s ease-in-out infinite;
}
@keyframes nova-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.3); }
}

.landing-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
  font-weight: 600;
}
.landing-desc {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.landing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.landing-features li {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  padding-left: 1.4rem;
  position: relative;
  text-align: left;
}
.landing-features li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--colour-gold-light);
  font-weight: 700;
}
.landing-cta {
  display: inline-block;
  background: var(--colour-gold);
  color: #1a1d23;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  padding: 0.75rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}
.landing-cta:hover { background: var(--colour-gold-light); transform: translateY(-1px); }
.landing-cta:active { transform: translateY(0); }
.landing-other-products {
  display: block;
  margin-top: 1.6rem;
  text-decoration: none;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(240,165,0,0.12) 0%, rgba(255,255,255,0.04) 100%);
  border: 1.5px solid rgba(240,165,0,0.30);
  box-shadow: 0 4px 24px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.07);
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s, transform 0.18s;
}
.landing-other-products:hover {
  border-color: rgba(240,165,0,0.70);
  background: linear-gradient(135deg, rgba(240,165,0,0.20) 0%, rgba(255,255,255,0.06) 100%);
  box-shadow: 0 6px 32px rgba(240,165,0,0.22), inset 0 1px 0 rgba(255,255,255,0.10);
  transform: translateY(-2px);
  text-decoration: none;
}
.lop-inner {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.85rem 1.1rem;
}
.lop-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
}
.lop-wordmark {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--colour-gold);
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.lop-tagline {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255,255,255,0.42);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lop-divider {
  flex-shrink: 0;
  width: 1px;
  height: 2rem;
  background: rgba(255,255,255,0.14);
  margin: 0 1rem;
}
.lop-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.lop-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.01em;
  transition: color 0.18s;
}
.landing-other-products:hover .lop-cta {
  color: #fff;
}
.lop-arrow {
  font-size: 1.05rem;
  color: var(--colour-gold);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.landing-other-products:hover .lop-arrow {
  transform: translateX(4px);
}
.landing-audience {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.4rem;
}
.landing-disclaimer-small {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}
.landing-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.landing-version {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.landing-force-reload {
  background: rgba(10,30,80,0.55);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.38);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.landing-force-reload:hover { color: rgba(255,255,255,0.65); border-color: rgba(255,255,255,0.25); background: rgba(10,30,80,0.75); }
.landing-force-reload:disabled { opacity: 0.4; cursor: default; }
.landing-lang-toggle {
  font-size: 0.78rem;
  padding: 0.22rem 0.6rem;
  margin-right: auto;  /* push version+reload to the right */
}
.landing-update-prompt {
  color: var(--colour-gold-light);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}
.landing-update-btn {
  background: none;
  border: none;
  color: var(--colour-gold-light);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0;
}

/* ── Version bar ─────────────────────────────────────────────────────────── */
/* version-bar removed — version label lives in .bab-version inside .bottom-action-bar */
.version-label { font-family: var(--font-mono); }
.force-reload-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.60);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.force-reload-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
}
.force-reload-btn:disabled { opacity: 0.5; cursor: default; }
.update-prompt { color: rgba(255,255,255,0.8); }
.update-reload-btn {
  background: none;
  border: none;
  color: var(--colour-gold-light);
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: var(--font-sans);
}

/* ── Bottom action bar — Feedback left · Occupied centre · Ask AI right ───── */
.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5100;
  height: var(--bar-h);
  background: rgba(8,18,38,0.97);
  border-top: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  gap: 0.5rem;
}
.bab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.46rem 1.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  border: 1.5px solid transparent;
  text-transform: none;
  min-width: 110px;
}
.bab-btn:hover  { transform: translateY(-2px); }
.bab-btn:active { transform: translateY(0); }
/* Feedback — clean frosted glass */
.bab-feedback {
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.80);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.bab-feedback:hover {
  background: rgba(255,255,255,0.17);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
}
/* Occupied territories — crimson accent */
.bab-occupied {
  background: linear-gradient(135deg, rgba(140,10,10,0.60) 0%, rgba(80,0,0,0.60) 100%);
  color: #ffbbbb;
  border-color: rgba(200,50,50,0.55);
  box-shadow: 0 2px 14px rgba(160,0,0,0.30);
  font-weight: 700;
}
.bab-occupied:hover {
  background: linear-gradient(135deg, rgba(185,15,15,0.78) 0%, rgba(110,0,0,0.78) 100%);
  color: #ffd5d5;
  border-color: rgba(255,70,70,0.68);
  box-shadow: 0 4px 22px rgba(200,0,0,0.42);
}
.bab-occupied.war-active {
  background: linear-gradient(135deg, #8b0000 0%, #500000 100%);
  border-color: rgba(255,60,60,0.75);
  color: #f5c842;
  box-shadow: 0 4px 22px rgba(220,0,0,0.50);
}
/* Ask AI — indigo/violet gradient */
.bab-ai {
  background: linear-gradient(135deg, rgba(79,70,229,0.30) 0%, rgba(139,92,246,0.30) 100%);
  color: #b5c8fd;
  border-color: rgba(139,92,246,0.45);
  box-shadow: 0 2px 14px rgba(99,102,241,0.22);
}
.bab-ai:hover {
  background: linear-gradient(135deg, rgba(79,70,229,0.52) 0%, rgba(139,92,246,0.52) 100%);
  color: #d4ddff;
  border-color: rgba(139,92,246,0.68);
  box-shadow: 0 4px 22px rgba(99,102,241,0.38);
}

/* ── War occupation legend ───────────────────────────────────────────────── */
.war-legend {
  position: fixed;
  bottom: calc(var(--bar-h) + 0.75rem);
  left: 0.75rem;
  background: rgba(10,22,40,0.94);
  border: 1px solid rgba(204,0,0,0.5);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.85);
  z-index: 420;
  min-width: 240px;
  backdrop-filter: blur(4px);
}
.war-legend-title {
  font-weight: 700;
  color: #f5c842;
  margin-bottom: 0.45rem;
  font-size: 0.73rem;
  letter-spacing: 0.03em;
}
.war-legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.war-legend-swatch {
  display: inline-block;
  width: 16px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.war-legend-note {
  margin-top: 0.4rem;
  font-size: 0.63rem;
  color: rgba(255,255,255,0.45);
  font-style: italic;
}

/* ── Disclaimer banner — sits above bottom action bar ────────────────────── */
.disclaimer-banner {
  background: #fff8e1;
  border-top: 2px solid var(--colour-gold);
  padding: 0.6rem 1.5rem;
  font-size: 0.8rem;
  color: #5a4000;
  position: fixed;
  bottom: var(--bar-h);
  left: 0;
  right: 0;
  z-index: 2000;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
.disclaimer-banner p { display: flex; align-items: center; gap: 1rem; max-width: 1200px; margin: 0 auto; }
.dismiss-btn {
  margin-left: auto;
  font-size: 0.8rem;
  background: var(--colour-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── City markers on zoomed-in oblast ────────────────────────────────────── */
.city-dot {
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.7);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.city-label {
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  color: #1a3a6b !important;
  background: rgba(255,255,255,0.88) !important;
  border: none !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
  border-radius: 3px !important;
  padding: 1px 4px !important;
  white-space: nowrap !important;
}
.leaflet-tooltip.city-label::before { display: none !important; }

/* ── FAB compatibility shim — old .fab selectors kept for finance wizard ── */
.fab { transition: transform 0.15s, box-shadow 0.15s; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.18); }
.fab:active { transform: translateY(0); }

/* ── Feedback modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--colour-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
}
.modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--colour-navy);
  flex: 1;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--colour-text-muted);
  line-height: 1;
  padding: 0.1rem 0.3rem;
}
.modal-close:hover { color: var(--colour-text); }
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--colour-text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--colour-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--colour-text);
  background: var(--colour-bg);
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--colour-navy-light);
  background: var(--colour-surface);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-actions { display: flex; justify-content: flex-end; }
.form-submit {
  background: var(--colour-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.form-submit:hover { background: var(--colour-navy-light); }
.form-submit:disabled { opacity: 0.6; cursor: default; }
.form-sent {
  font-size: 0.875rem;
  color: var(--colour-grant);
  font-weight: 600;
  margin-top: 0.75rem;
  text-align: center;
}

/* ── Chat panel ──────────────────────────────────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: 26px;
  right: 0;
  z-index: 5000;
  width: 360px;
  height: 520px;
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}
.chat-panel[hidden] { display: none; }
.chat-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--colour-navy);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}
.chat-header-title { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.chat-title { font-size: 0.9rem; font-weight: 700; color: #fff; }
.chat-powered { font-size: 0.7rem; color: rgba(255,255,255,0.5); }
.chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}
.chat-close:hover { color: #fff; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.chat-welcome { padding: 0.5rem 0; }
.chat-welcome p { font-size: 0.85rem; color: var(--colour-text-muted); margin-bottom: 0.75rem; }
.chat-suggestions { display: flex; flex-direction: column; gap: 0.4rem; }
.chat-suggestion {
  background: var(--colour-bg);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  color: var(--colour-navy-light);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.chat-suggestion:hover { background: #e8f4fd; }
.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 90%;
}
.chat-message.user { align-self: flex-end; align-items: flex-end; }
.chat-message.assistant { align-self: flex-start; }
.chat-bubble {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-message.user .chat-bubble {
  background: var(--colour-navy);
  color: #fff;
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
}
.chat-message.assistant .chat-bubble {
  background: var(--colour-bg);
  border: 1px solid var(--colour-border);
  color: var(--colour-text);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
}
.chat-message.error .chat-bubble {
  background: #fdecea;
  color: var(--colour-danger);
  border: 1px solid #f5b7b1;
  font-size: 0.8rem;
}
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0.75rem;
  background: var(--colour-bg);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
  align-self: flex-start;
  width: fit-content;
}
.chat-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--colour-text-muted);
  animation: chatDot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
.chat-input-area {
  display: flex;
  padding: 0.6rem;
  gap: 0.5rem;
  border-top: 1px solid var(--colour-border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--colour-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  background: var(--colour-bg);
  color: var(--colour-text);
}
.chat-input:focus { outline: none; border-color: var(--colour-navy-light); background: var(--colour-surface); }
.chat-send {
  background: var(--colour-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.chat-send:hover { background: var(--colour-navy-light); }
.chat-send:disabled { opacity: 0.5; cursor: default; }

/* ── Accessibility ───────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Mobile — comprehensive overrides for phones (≤ 640 px) ─────────────── */
@media (max-width: 640px) {

  /* Header: hide tagline, shrink logo, hide text nav links */
  .tagline { display: none; }
  .logo-img { width: 28px; height: 28px; }
  .wordmark-text { font-size: 1.05rem; }
  .site-nav a { display: none; }      /* nav links hidden — accessible via tabs */
  .header-finance-btn { display: none; } /* Finance tab covers this */
  .lang-toggle { font-size: 0.75rem; padding: 0.22rem 0.45rem; }

  /* Landing — smaller card so the background landscape shows */
  .landing-overlay {
    padding: 0.75rem;
    align-items: flex-start;
    padding-top: max(2.5rem, env(safe-area-inset-top, 2.5rem));
  }
  .landing-content {
    padding: 1rem 1.1rem 0.85rem;
    border-radius: 1rem;
    max-height: 82vh;
    overflow-y: auto;
  }
  .landing-logo { width: 44px; height: 44px; margin-bottom: 0.5rem; }
  .landing-title { font-size: 1.85rem; }
  .landing-sub { font-size: 0.8rem; margin-bottom: 0.4rem; }
  .landing-desc { font-size: 0.73rem; line-height: 1.5; margin-bottom: 0.6rem; }
  .landing-features { font-size: 0.73rem; padding-left: 1.1rem; margin-bottom: 0.6rem; }
  .landing-features li { margin-bottom: 0.2rem; }
  .landing-cta { font-size: 0.88rem; padding: 0.55rem 1.4rem; margin: 0.5rem 0 0.4rem; }
  .landing-audience { font-size: 0.68rem; }
  .landing-disclaimer-small { font-size: 0.65rem; }
  .landing-actions { margin-top: 0.5rem; }
  .landing-version { font-size: 0.65rem; }
  .landing-force-reload { font-size: 0.63rem; }
  .name-etymology { column-gap: 0.35rem; margin: 0.3rem 0 0.8rem; max-width: 280px; }
  .etym-mark { font-size: 1.3rem; }
  .etym-source, .etym-meaning { font-size: 0.54rem; }
  .etym-plus { font-size: 0.85rem; }

  /* Map view tabs — compact on mobile, no scrollbar, bigger tap targets */
  .map-view-tabs {
    max-width: calc(100vw - 130px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .map-view-tabs::-webkit-scrollbar { display: none; }
  .map-view-tab {
    font-size: 0.68rem;
    padding: 0.45rem 0.55rem;
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  /* Map toggle buttons — bigger tap area */
  .map-toggle-btn {
    font-size: 0.7rem;
    padding: 0.5rem 0.75rem;
    min-height: 40px;
  }
  .map-toggle-left  { left: 0.5rem; }
  .map-toggle-right { right: 0.5rem; }

  /* Panels — full-width drawers on mobile */
  .filter-panel,
  .asset-list-panel {
    width: 100%;
    max-height: 72vh;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  }
  /* Filter draws down from top */
  .filter-panel {
    left: 0;
    right: 0;
    bottom: auto;
    height: auto;
    max-height: 72vh;
    transform: translateY(-105%);
    padding: 0.85rem 0.9rem;
  }
  .filter-panel.panel-open { transform: translateY(0); }
  /* Asset list draws up from bottom */
  .asset-list-panel {
    right: 0;
    left: 0;
    top: auto;
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
  }
  .asset-list-panel.panel-open { transform: translateY(0); }

  /* Smaller chip/filter text — bigger tap target */
  .chip {
    font-size: 0.68rem;
    padding: 0.3rem 0.55rem;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }
  .filter-label { font-size: 0.67rem; }
  .panel-title { font-size: 0.7rem; }
  .asset-list-title { font-size: 0.7rem; }
  .asset-count { font-size: 0.68rem; }
  .asset-list-item { font-size: 0.78rem; padding: 0.65rem 0.75rem; }
  .ali-meta { font-size: 0.68rem; }
  .filter-group { margin-bottom: 0.9rem; }

  /* Bottom action bar — compact on small screens */
  .bab-btn { padding: 0.4rem 0.85rem; font-size: 0.72rem; min-width: 80px; }

  /* Disclaimer — wraps cleanly, bigger dismiss button */
  .disclaimer-banner { font-size: 0.72rem; padding: 0.5rem 1rem; }
  .disclaimer-banner p { flex-wrap: wrap; gap: 0.4rem; }
  .dismiss-btn { font-size: 0.75rem; padding: 0.4rem 0.75rem; min-height: 36px; margin-left: auto; }

  /* Modal — scrollable on small screens */
  .modal-box { max-height: 88vh; overflow-y: auto; padding: 1rem; }

  /* Chat full-width, height capped to viewport */
  .chat-panel { width: 100%; right: 0; height: min(520px, calc(78vh - 24px)); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

  /* Bottom action bar on mobile — safe-area aware */
  .bottom-action-bar {
    height: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .version-label { font-size: 0.65rem; }

  /* Oblast info panel — bottom drawer, clears version bar + safe area */
  .oblast-info-panel {
    width: 100%;
    max-width: 100%;
    top: auto;
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 68vh;
  }

  /* Leaflet zoom control — hide on phones (pinch-to-zoom is the natural gesture) */
  .leaflet-control-zoom { display: none; }

  /* Map controls (filter/assets buttons) — ensure they don't overlap each other */
  .map-toggle-left  { top: calc(var(--map-top) + 0.5rem); }
  .map-toggle-right { top: calc(var(--map-top) + 0.5rem); }
}

/* ── Filter panel enhancements (Weekend 5) ───────────────────────────────── */
.filter-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.reset-filters-btn {
  font-size: 0.7rem;
  font-family: var(--font-sans);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1.5px solid var(--colour-border);
  background: transparent;
  color: var(--colour-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.reset-filters-btn:hover { border-color: var(--colour-danger); color: var(--colour-danger); }

.chip-sm { font-size: 0.7rem; padding: 0.18rem 0.5rem; }

.chip-group-scroll {
  max-height: 5.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--colour-border) transparent;
  padding-right: 0.2rem;
}

.filter-group-inline { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.filter-group-inline .filter-label { margin-bottom: 0; white-space: nowrap; }

.chip-flag {
  background: var(--colour-bg);
  border-color: #e67e22;
  color: #e67e22;
}
.chip-flag.active {
  background: #e67e22;
  border-color: #e67e22;
  color: #fff;
}

/* ── Aggregation panel ───────────────────────────────────────────────────── */
.agg-panel {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--colour-border);
}
.agg-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}
.agg-total-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--colour-text-muted); }
.agg-total-value { font-size: 1.1rem; font-weight: 700; color: var(--colour-navy); white-space: nowrap; }

.agg-details { margin-bottom: 0.5rem; }
.agg-summary {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--colour-text-muted);
  cursor: pointer;
  padding: 0.2rem 0;
  user-select: none;
  list-style: none;
}
.agg-summary::-webkit-details-marker { display: none; }
.agg-summary::before { content: '▶ '; font-size: 0.6rem; }
details[open] .agg-summary::before { content: '▼ '; }

.agg-section { padding: 0.4rem 0 0.25rem; }

.agg-row {
  display: grid;
  grid-template-columns: 6rem 1fr 3.2rem 1.4rem;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  margin-bottom: 0.22rem;
}
.agg-simple-row {
  display: grid;
  grid-template-columns: 1fr 3.2rem 1.4rem;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}
.agg-label {
  color: var(--colour-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agg-bar-wrap { height: 5px; background: var(--colour-border); border-radius: 3px; overflow: hidden; }
.agg-bar { height: 100%; background: var(--colour-navy-light); border-radius: 3px; transition: width 0.3s; }
.agg-value { text-align: right; font-weight: 600; color: var(--colour-navy); font-size: 0.7rem; }
.agg-count { text-align: right; color: var(--colour-text-muted); font-size: 0.68rem; }

.agg-redamage {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #e67e22;
  font-weight: 600;
}
.agg-note {
  margin-top: 0.5rem;
  font-size: 0.65rem;
  color: var(--colour-text-muted);
  font-style: italic;
}
.agg-empty { font-size: 0.8rem; color: var(--colour-text-muted); text-align: center; padding: 1rem 0; }

/* ── Donor pathway enhancements ──────────────────────────────────────────── */
.donor-pipeline-note {
  font-size: 0.8rem;
  color: #e67e22;
  background: #fff8f0;
  border: 1px solid #f5cba7;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.donor-note {
  display: block;
  font-size: 0.72rem;
  color: var(--colour-text-muted);
  font-style: italic;
  margin-top: 0.15rem;
}

/* ── Calc working panel ──────────────────────────────────────────────────── */
.calc-loading { font-size: 0.85rem; color: var(--colour-text-muted); padding: 0.5rem; }
.calc-error { font-size: 0.85rem; color: var(--colour-danger); padding: 0.5rem; }
.calc-working { font-size: 0.85rem; padding: 0.75rem 0; }
.calc-formula-text { margin-bottom: 0.75rem; }
.calc-formula-text code { font-family: var(--font-mono); font-size: 0.78rem; }
.calc-working h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--colour-text-muted); margin: 0.75rem 0 0.35rem; }
.calc-inputs, .calc-paths { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 0.5rem; }
.calc-inputs th, .calc-inputs td, .calc-paths th, .calc-paths td { padding: 0.3rem 0.45rem; border: 1px solid var(--colour-border); }
.calc-inputs th, .calc-paths th { background: var(--colour-bg); font-weight: 600; font-size: 0.75rem; }
.calc-mismatch td { background: #fdecea; }
.calc-disclaimer { font-size: 0.75rem; color: var(--colour-text-muted); margin-top: 0.5rem; }

/* ── Admin page ──────────────────────────────────────────────────────────── */

/* Password gate */
.admin-gate {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--colour-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.admin-gate-box {
  background: var(--colour-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.admin-gate-logo {
  margin-bottom: 1rem;
}
.admin-gate-logo img {
  border-radius: 50%;
  border: 3px solid var(--colour-border);
}
.admin-gate-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--colour-navy);
  margin-bottom: 0.35rem;
}
.admin-gate-desc {
  font-size: 0.825rem;
  color: var(--colour-text-muted);
  margin-bottom: 1.5rem;
}
.admin-gate-form {
  display: flex;
  gap: 0.5rem;
}
.admin-gate-input {
  flex: 1;
}
.admin-gate-error {
  font-size: 0.825rem;
  color: var(--colour-danger);
  margin-top: 0.75rem;
  font-weight: 600;
}

/* Admin main layout */
.admin-main {
  flex: 1;
  max-width: 900px;
  margin: 2rem auto 3rem;
  padding: 0 1.5rem;
  width: 100%;
}
.admin-header-bar {
  margin-bottom: 2rem;
}
.admin-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--colour-navy);
  margin-bottom: 0.4rem;
}
.admin-page-sub {
  font-size: 0.875rem;
  color: var(--colour-text-muted);
  line-height: 1.6;
  max-width: 680px;
}

/* Admin sections */
.admin-section {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.admin-section-locked {
  opacity: 0.6;
  pointer-events: none;
}
.admin-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--colour-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-locked-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--colour-bg);
  border: 1.5px solid var(--colour-border);
  color: var(--colour-text-muted);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  letter-spacing: 0;
  text-transform: none;
}
.admin-section-desc {
  font-size: 0.85rem;
  color: var(--colour-text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  max-width: 680px;
}
.admin-section-desc code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--colour-bg);
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius-sm);
}

/* Admin form */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.admin-form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-form-group-half {
  flex: 1;
  min-width: 200px;
}
.admin-textarea-lg {
  min-height: 130px;
}
.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

/* Admin buttons */
.admin-btn {
  font-size: 0.9rem;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.admin-btn-primary {
  background: var(--colour-navy);
  color: #fff;
}
.admin-btn-primary:hover:not(:disabled) { background: var(--colour-navy-light); }
.admin-btn-primary:disabled { opacity: 0.45; cursor: default; }

.admin-btn-sm {
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border: 1.5px solid var(--colour-border);
  border-radius: var(--radius-sm);
  background: var(--colour-bg);
  color: var(--colour-navy);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.admin-btn-sm:hover { background: var(--colour-surface); border-color: var(--colour-navy); }
.admin-btn-sm-primary {
  background: var(--colour-navy);
  color: #fff;
  border-color: var(--colour-navy);
}
.admin-btn-sm-primary:hover { background: var(--colour-navy-light); border-color: var(--colour-navy-light); }

.admin-spinner {
  font-size: 0.85rem;
  color: var(--colour-text-muted);
  font-style: italic;
}

/* Admin error */
.admin-error {
  margin-top: 1rem;
  background: #fdecea;
  border: 1.5px solid #f5b7b1;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--colour-danger);
  line-height: 1.5;
}
.admin-review-block {
  margin-top: 0.75rem;
}
.admin-review-title {
  font-size: 0.825rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Admin output */
.admin-output {
  margin-top: 1.25rem;
  border: 1.5px solid var(--colour-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.admin-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--colour-bg);
  border-bottom: 1px solid var(--colour-border);
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-output-header-mt {
  border-top: 1px solid var(--colour-border);
}
.admin-output-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--colour-text-muted);
}
.admin-output-actions {
  display: flex;
  gap: 0.4rem;
}
.admin-pre {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 1rem;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  background: var(--colour-surface);
  color: var(--colour-text);
  max-height: 420px;
  overflow-y: auto;
}
.admin-pre-sm {
  max-height: 200px;
}
.admin-narration {
  padding: 1rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--colour-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.admin-output-note {
  font-size: 0.78rem;
  color: var(--colour-text-muted);
  background: #fffbf0;
  border-top: 1px solid #f0d080;
  padding: 0.6rem 0.75rem;
  line-height: 1.5;
}
.admin-output-note code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: rgba(0,0,0,0.05);
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
}

@media (max-width: 600px) {
  .admin-main { padding: 0 1rem; margin-top: 1.25rem; }
  .admin-section { padding: 1.25rem 1rem; }
  .admin-gate-form { flex-direction: column; }
}

/* ── Oblast war risk panel (Damaged view) ───────────────────────────────── */
.oblast-war-panel {
  position: absolute;
  bottom: 58px;
  left: 14px;
  z-index: 600;
  width: 300px;
  max-height: calc(100% - 130px);
  overflow-y: auto;
  background: rgba(8,16,36,0.95);
  border: 1px solid rgba(201,162,39,0.5);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.88);
  font-size: 0.82rem;
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.oblast-war-panel.visible { opacity: 1; transform: translateY(0); }
/* Visual block — gauge + bars */
.owp-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.9rem 0.5rem;
  border-bottom: 1px solid rgba(201,162,39,0.12);
}
.owp-gauge-svg { width: 100%; max-width: 200px; }
.owp-bars { width: 100%; display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.6rem; }
.owp-bar-row { display: flex; align-items: center; gap: 0.5rem; }
.owp-bar-lbl { font-size: 0.68rem; color: rgba(255,255,255,0.5); width: 120px; flex-shrink: 0; }
.owp-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.owp-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.owp-bar-num { font-size: 0.68rem; font-weight: 700; width: 16px; text-align: right; }

.owp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.85rem 0.9rem 0.5rem;
  border-bottom: 1px solid rgba(201,162,39,0.2);
}
.owp-name { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 0.35rem; }
.owp-risk-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.risk-severe   { background: rgba(139,0,0,0.55); color: #ff9999; border: 1px solid #b00; }
.risk-high     { background: rgba(180,80,0,0.45); color: #ffbb77; border: 1px solid #c55; }
.risk-moderate { background: rgba(180,140,0,0.35); color: #ffe066; border: 1px solid #aa9; }
.risk-low      { background: rgba(20,100,40,0.4); color: #88ee99; border: 1px solid #396; }
.owp-photo { width: 100%; height: 140px; object-fit: cover; display: block; }
.owp-section { padding: 0.65rem 0.9rem 0; }
.owp-section-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c9a227;
  margin-bottom: 0.25rem;
}
.owp-section p { line-height: 1.5; color: rgba(255,255,255,0.75); margin: 0; font-size: 0.78rem; }
.owp-stats {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid rgba(201,162,39,0.15);
  margin-top: 0.65rem;
}
.owp-stat { display: flex; flex-direction: column; gap: 0.1rem; }
.owp-stat-n { font-size: 1.15rem; font-weight: 700; color: #f5c842; line-height: 1.1; }
.owp-stat-l { font-size: 0.68rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.04em; }
.owp-hint { font-size: 0.68rem; color: rgba(255,255,255,0.35); padding: 0 0.9rem 0.75rem; margin: 0; }
.owp-close {
  background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 1.2rem; cursor: pointer; padding: 0 0.2rem; line-height: 1; flex-shrink: 0;
}
.owp-close:hover { color: #fff; }

@media (max-width: 640px) {
  .oblast-war-panel {
    width: calc(100vw - 28px);
    left: 14px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    max-height: calc(55vh - env(safe-area-inset-bottom, 0px));
  }
}

/* ── Oblast info panel ───────────────────────────────────────────────────── */
.oblast-info-panel {
  position: fixed;
  top: 70px;
  right: 0;
  width: 340px;
  max-width: 92vw;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  background: var(--colour-navy);
  border-left: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-radius: 0 0 0 var(--radius-md);
  z-index: 3000;
  box-shadow: -4px 4px 24px rgba(0,0,0,0.45);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.oblast-info-panel[hidden] { display: none; }
.oblast-info-panel.visible {
  opacity: 1;
  transform: translateX(0);
}
.oblast-photo-wrap {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #0d1b36;
}
.oblast-photo-loading {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #0d1b36 25%, #1e3d7a 50%, #0d1b36 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.oblast-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.oblast-panel-body {
  padding: 1rem 1.1rem 1.25rem;
}
.oblast-panel-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.85rem;
}
.oblast-panel-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  background: rgba(0,0,0,0.45);
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 1.25rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
}
.oblast-panel-close:hover { background: rgba(0,0,0,0.7); color: #fff; }
.oblast-panel-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 0.75rem;
  font-size: 0.83rem;
}
.oblast-panel-dl dt {
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding-top: 0.1rem;
}
.oblast-panel-dl dd {
  color: rgba(255,255,255,0.85);
  line-height: 1.55;
  margin: 0;
}

.oblast-panel-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.oblast-panel-sh {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(201,162,39,0.9);
  margin: 0 0 0.35rem;
}

.oblast-panel-p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.6;
  margin: 0;
}

.oblast-panel-history .oblast-panel-p {
  font-style: italic;
  color: rgba(255,255,255,0.72);
  border-left: 2px solid rgba(201,162,39,0.35);
  padding-left: 0.6rem;
}

/* ── Development opportunities panel ────────────────────────────────────── */
.dev-opps-panel {
  position: fixed;
  top: var(--map-top);
  left: 0;
  width: 360px;
  max-width: 96vw;
  height: calc(100vh - var(--map-top) - var(--bar-h));
  display: flex;
  flex-direction: column;
  background: rgba(4,22,12,0.97);
  border-right: 1px solid rgba(39,174,96,0.3);
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 3000;
  box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.dev-opps-panel.visible { opacity: 1; transform: translateX(0); }

.dev-opps-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid rgba(39,174,96,0.2);
  background: rgba(39,174,96,0.08);
}
.dev-opps-region {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.dev-opps-subtitle {
  font-size: 0.7rem;
  color: rgba(39,174,96,0.9);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
}
.dev-opps-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0 0 0.5rem;
  line-height: 1;
}
.dev-opps-close:hover { color: #fff; }

.dev-opps-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(39,174,96,0.3) transparent;
}
.dev-opp-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(39,174,96,0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dev-opp-card:hover { background: rgba(39,174,96,0.08); border-color: rgba(39,174,96,0.45); }
.dev-opp-card.expanded { border-color: rgba(39,174,96,0.6); background: rgba(39,174,96,0.06); }
.dev-opp-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.dev-opp-icon { font-size: 1.1rem; flex-shrink: 0; }
.dev-opp-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
  line-height: 1.3;
}
.dev-opp-size {
  font-size: 0.75rem;
  font-weight: 700;
  color: #c9a227;
  white-space: nowrap;
  background: rgba(201,162,39,0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.dev-opp-rationale {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  margin: 0;
}
.dev-opp-empty {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 1.5rem 0;
  margin: 0;
}
.dev-opp-expand-hint {
  font-size: 0.65rem;
  color: rgba(39,174,96,0.6);
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
}
.dev-opp-financing {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(39,174,96,0.18);
}
.dev-opp-card.expanded .dev-opp-financing { display: block; }
.dev-fin-title {
  font-size: 0.67rem;
  font-weight: 700;
  color: rgba(39,174,96,0.85);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.dev-fin-stack {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  gap: 1px;
}
.dev-fin-seg { height: 100%; transition: flex 0.3s; }
.dev-fin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.55rem;
}
.dev-fin-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.72);
}
.dev-fin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dev-fin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.dev-fin-stat {
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
}
.dev-fin-stat-val { font-size: 0.82rem; font-weight: 700; color: #f5c842; }
.dev-fin-stat-lbl { font-size: 0.62rem; color: rgba(255,255,255,0.45); margin-top: 0.1rem; }
.dev-fin-investors {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  margin-top: 0.4rem;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .dev-opps-panel {
    width: 100%;
    max-width: 100%;
    top: auto;
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
    height: 72vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(20px);
  }
  .dev-opps-panel.visible { transform: translateY(0); }
}

/* ── Oblast reconstructed panel (Reconstructed view) ────────────────────── */
.oblast-recon-panel {
  position: absolute;
  bottom: 58px;
  left: 14px;
  z-index: 600;
  width: 300px;
  max-height: calc(100% - 130px);
  overflow-y: auto;
  background: rgba(4,14,36,0.96);
  border: 1px solid rgba(201,162,39,0.55);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.88);
  font-size: 0.82rem;
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.oblast-recon-panel.visible { opacity: 1; transform: translateY(0); }

.orp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.85rem 0.9rem 0.6rem;
  border-bottom: 1px solid rgba(201,162,39,0.25);
}
.orp-name { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 0.2rem; }
.orp-subtitle { font-size: 0.72rem; color: #c9a227; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.orp-close {
  background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 1.2rem; cursor: pointer; padding: 0 0.2rem; line-height: 1; flex-shrink: 0;
}
.orp-close:hover { color: #fff; }
.orp-photo { width: 100%; height: 120px; object-fit: cover; display: block; }

.orp-projects { padding: 0.5rem 0; }

.orp-project {
  display: block;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(201,162,39,0.1);
  transition: background 0.12s;
}
.orp-project:hover { background: rgba(255,255,255,0.04); text-decoration: none; }
.orp-project:last-child { border-bottom: none; }

.orp-project-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.9rem 0.35rem 0.75rem;
}
.orp-project-sector {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.orp-project-cost {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f5c842;
}

.orp-project-body {
  padding: 0.4rem 0.9rem 0.55rem;
}
.orp-project-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  line-height: 1.35;
  margin-bottom: 0.3rem;
}
.orp-cost-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.orp-cost-item {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
}
.orp-cost-lbl {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.2rem;
}

.orp-project-stage {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.5);
  flex: 1;
  text-align: center;
}
.orp-project-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.orp-detail-btn, .orp-finance-btn {
  font-size: 0.7rem;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid rgba(201,162,39,0.4);
  background: rgba(201,162,39,0.1);
  color: #f5c842;
  transition: background 0.12s, border-color 0.12s;
}
.orp-detail-btn:hover, .orp-finance-btn:hover {
  background: rgba(201,162,39,0.25);
  border-color: #f5c842;
}
.orp-finance-btn {
  background: rgba(39,174,96,0.15);
  border-color: rgba(39,174,96,0.45);
  color: #7ee8a2;
}
.orp-finance-btn:hover { background: rgba(39,174,96,0.3); border-color: #7ee8a2; }

.orp-empty {
  padding: 1rem 0.9rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  line-height: 1.5;
}

.orp-stats {
  padding: 0.6rem 0.9rem;
  border-top: 1px solid rgba(201,162,39,0.18);
  font-size: 0.82rem;
}
.orp-stat-n { font-weight: 700; color: #f5c842; }
.orp-stat-l { color: rgba(255,255,255,0.5); }

.orp-hint { font-size: 0.68rem; color: rgba(255,255,255,0.3); padding: 0 0.9rem 0.7rem; margin: 0; }

@media (max-width: 640px) {
  .oblast-recon-panel {
    width: calc(100vw - 28px);
    left: 14px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    max-height: calc(55vh - env(safe-area-inset-bottom, 0px));
  }
}

/* ── Finance It wizard — right-side panel, map stays visible ─────────────── */
.fw-overlay {
  position: fixed;
  top: var(--map-top);
  right: 0;
  bottom: var(--bar-h);
  width: 420px;
  max-width: 100vw;
  z-index: 3500;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.fw-overlay[hidden] { display: none; }
.fw-overlay.fw-open {
  transform: translateX(0);
  pointer-events: all;
}

.fw-modal {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--colour-surface);
  box-shadow: -6px 0 32px rgba(0,0,0,0.35);
  border-left: 1px solid rgba(255,255,255,0.06);
  position: relative;
}

.fw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--colour-border);
  flex-shrink: 0;
  background: var(--colour-navy);
  color: #fff;
}
.fw-header-left { display: flex; flex-direction: column; gap: 0.5rem; }
.fw-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin: 0; }
.fw-progress { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.fw-ps {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.45);
  font-weight: 600;
}
.fw-ps-active { background: var(--colour-gold); color: #1a1d23; }
.fw-ps-done   { background: rgba(39,174,96,0.4); color: #88ee99; }

.fw-close {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; flex-shrink: 0;
}
.fw-close:hover { color: #fff; }

.fw-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.fw-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--colour-border);
  flex-shrink: 0;
  gap: 0.75rem;
  background: var(--colour-bg);
}
.fw-step-label { font-size: 0.75rem; color: var(--colour-text-muted); }
.fw-btn {
  font-size: 0.875rem;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.fw-btn-back { background: none; border: 1px solid var(--colour-border); color: var(--colour-text-muted); }
.fw-btn-back:hover { border-color: var(--colour-navy); color: var(--colour-navy); }
.fw-btn-next { background: var(--colour-navy); border: none; color: #fff; }
.fw-btn-next:hover { background: var(--colour-navy-light); }

.fw-error {
  flex: 1;
  font-size: 0.8rem;
  color: var(--colour-danger);
  font-weight: 600;
  text-align: center;
}

/* Step layout */
.fw-step { display: flex; flex-direction: column; gap: 1.1rem; color: var(--colour-navy); position: relative; }
.fw-sh { font-size: 1rem; font-weight: 700; color: var(--colour-navy); margin: 0; }

/* Scope row */
.fw-scope-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}
.fw-radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  padding: 0.85rem 0.65rem;
  border: 1.5px solid var(--colour-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--colour-bg);
}
.fw-radio-card:hover { border-color: var(--colour-navy-light); }
.fw-rc-checked { border-color: var(--colour-navy); background: #e8f0fc; }
.fw-sr { position: absolute; opacity: 0; pointer-events: none; }
.fw-rc-icon { font-size: 1.5rem; }
.fw-rc-label { font-size: 0.82rem; font-weight: 700; color: var(--colour-navy); }
.fw-rc-desc  { font-size: 0.72rem; color: var(--colour-text-muted); line-height: 1.35; }
.fw-rc-cost  { font-size: 0.85rem; font-weight: 700; color: var(--colour-navy); margin-top: 0.2rem; }

/* Path cards (3 in a row) */
.fw-radio-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem; }
.fw-path-card { align-items: flex-start; text-align: left; }

/* Scope detail / asset lists */
.fw-scope-summary {
  background: #e8f0fc;
  border: 1px solid #b8d0ef;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}
.fw-field-group { display: flex; flex-direction: column; gap: 0.35rem; }
.fw-fg-inline { flex-direction: row; align-items: center; gap: 0.75rem; }
.fw-label { font-size: 0.75rem; font-weight: 600; color: var(--colour-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.fw-input {
  width: 100%; padding: 0.45rem 0.65rem;
  border: 1.5px solid var(--colour-border); border-radius: var(--radius-sm);
  font-size: 0.875rem; font-family: var(--font-sans); color: var(--colour-text);
  background: var(--colour-bg);
}
.fw-input:focus { outline: none; border-color: var(--colour-navy-light); background: #fff; }
.fw-select { padding: 0.4rem 0.6rem; border: 1.5px solid var(--colour-border); border-radius: var(--radius-sm); font-size: 0.85rem; font-family: var(--font-sans); background: var(--colour-bg); cursor: pointer; }
.fw-select-sm { padding: 0.3rem 0.5rem; font-size: 0.8rem; }

.fw-asset-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--colour-border); border-radius: var(--radius-sm); }
.fw-asset-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--colour-border);
  cursor: pointer; transition: background 0.1s; font-size: 0.85rem;
  color: var(--colour-navy);
}
.fw-asset-row:last-child { border-bottom: none; }
.fw-asset-row:hover { background: var(--colour-bg); }
.fw-ar-sel { background: #e8f0fc; }
.fw-ar-name { flex: 1; font-weight: 600; line-height: 1.3; color: var(--colour-navy); }
.fw-ar-meta { font-size: 0.72rem; color: var(--colour-text-muted); white-space: nowrap; }

.fw-group-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.fw-group-links { display: flex; gap: 0.75rem; }
.fw-link-btn { background: none; border: none; color: var(--colour-navy-light); font-size: 0.8rem; cursor: pointer; text-decoration: underline; padding: 0; }
.fw-sel-count { font-size: 0.75rem; color: var(--colour-text-muted); text-align: right; }

/* Scenario */
.fw-selection-pill {
  background: #e8f0fc; border: 1px solid #b8d0ef;
  border-radius: 999px; padding: 0.3rem 0.9rem;
  font-size: 0.8rem; color: var(--colour-navy); font-weight: 600;
  align-self: flex-start;
}
.fw-info-note {
  background: #e8f8f0; border: 1px solid #a9dfbf;
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
  font-size: 0.8rem; color: #196f3d;
}
.fw-war-note {
  background: #fff8e1; border: 1px solid #f0d080;
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
  font-size: 0.8rem; color: #7a6010;
}

/* Tranche builder */
.fw-tranche-hdr { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.fw-total-lbl { font-size: 0.875rem; color: var(--colour-text-muted); }
.fw-alloc-sum { font-size: 0.82rem; font-weight: 700; }
.fw-alloc-ok   { color: var(--colour-grant); }
.fw-alloc-warn { color: var(--colour-danger); }

.fw-alloc-bar {
  height: 14px; display: flex; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--colour-border);
}
.fw-bar-seg { height: 100%; transition: width 0.2s; }
.fw-bar-gap { background: repeating-linear-gradient(45deg, #f4f6f9 0px, #f4f6f9 4px, #e0e0e0 4px, #e0e0e0 8px); }

.fw-tranche-row {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--colour-border);
}
.fw-tranche-row:last-child { border-bottom: none; }
.fw-tr-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 0.55rem; }
.fw-tr-fields { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.fw-tr-nums { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; }
.fw-tr-lbl { font-size: 0.72rem; font-weight: 600; color: var(--colour-text-muted); display: flex; flex-direction: column; gap: 0.2rem; }
.fw-tr-input-wrap { display: flex; align-items: center; gap: 0.2rem; }
.fw-tr-num { width: 64px; padding: 0.3rem 0.45rem; font-size: 0.82rem; text-align: right; }
.fw-tr-unit { font-size: 0.75rem; color: var(--colour-text-muted); }
.fw-tr-amt { font-size: 0.82rem; font-weight: 600; color: var(--colour-navy); align-self: flex-end; padding-bottom: 0.05rem; }
.fw-tr-remove {
  background: none; border: 1px solid var(--colour-border); color: var(--colour-text-muted);
  font-size: 1rem; line-height: 1; width: 26px; height: 26px;
  border-radius: 50%; cursor: pointer; flex-shrink: 0; margin-top: 0.45rem;
  display: flex; align-items: center; justify-content: center;
}
.fw-tr-remove:hover { border-color: var(--colour-danger); color: var(--colour-danger); }
.fw-rep-note { font-size: 0.7rem; color: #8e44ad; background: #f5eeff; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); }
.fw-add-tranche {
  background: none; border: 1.5px dashed var(--colour-border);
  color: var(--colour-navy-light); font-size: 0.82rem; font-family: var(--font-sans);
  font-weight: 600; padding: 0.4rem 1rem; border-radius: var(--radius-sm);
  cursor: pointer; width: 100%; transition: border-color 0.15s, color 0.15s;
}
.fw-add-tranche:hover { border-color: var(--colour-navy); color: var(--colour-navy); }

.fw-metrics-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.fw-mini-metric { display: flex; flex-direction: column; gap: 0.1rem; }
.fw-mm-val { font-size: 1rem; font-weight: 700; color: var(--colour-navy); }
.fw-mm-lbl { font-size: 0.7rem; color: var(--colour-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Results */
.fw-results { gap: 0; }
.fw-results-meta { font-size: 0.8rem; color: var(--colour-text-muted); margin-bottom: 0.75rem; }
.fw-results-sect { padding: 0.9rem 0; border-bottom: 1px solid var(--colour-border); }
.fw-results-sect:last-child { border-bottom: none; }
.fw-results-h4 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--colour-text-muted); margin: 0 0 0.6rem; }

.fw-cost-display { display: flex; flex-direction: column; gap: 0.2rem; }
.fw-cost-central { font-size: 1.6rem; font-weight: 700; color: var(--colour-navy); }
.fw-cost-lbl { font-size: 0.8rem; font-weight: 400; color: var(--colour-text-muted); }
.fw-cost-range { font-size: 0.82rem; color: var(--colour-text-muted); }

.fw-results-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 0.6rem; }
.fw-results-table th, .fw-results-table td { padding: 0.35rem 0.5rem; border: 1px solid var(--colour-border); }
.fw-results-table th { background: var(--colour-bg); font-weight: 600; font-size: 0.75rem; }
.fw-type-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; vertical-align: middle; }
.fw-war-tag { font-size: 0.65rem; background: #fff8e1; color: #7a6010; border: 1px solid #f0d080; border-radius: 3px; padding: 0.05rem 0.3rem; margin-left: 0.2rem; }

.fw-metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; }
.fw-mc { padding: 0.6rem 0.75rem; border: 1px solid var(--colour-border); border-radius: var(--radius-md); background: var(--colour-bg); }
.fw-mc-hl { border-color: var(--colour-navy); background: #e8f0fc; }
.fw-mc-val { font-size: 1.05rem; font-weight: 700; color: var(--colour-navy); display: block; }
.fw-mc-lbl { font-size: 0.68rem; color: var(--colour-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.fw-mob-note { font-size: 0.8rem; color: var(--colour-text-muted); margin-top: 0.5rem; }

.fw-support-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.fw-support-card {
  padding: 0.85rem; border: 1.5px solid var(--colour-border);
  border-radius: var(--radius-md); display: flex; flex-direction: column; gap: 0.25rem;
}
.fw-sc-during { border-color: #f0d080; background: #fffbf0; }
.fw-sc-after  { border-color: #a9dfbf; background: #f0faf4; }
.fw-sc-lbl { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--colour-text-muted); }
.fw-sc-val { font-size: 1.3rem; font-weight: 700; color: var(--colour-navy); }
.fw-sc-note { font-size: 0.72rem; color: var(--colour-text-muted); }

.fw-rep-ctx { font-size: 0.75rem; color: var(--colour-text-muted); margin-bottom: 0.5rem; }
.fw-rep-bar-track { height: 12px; background: #e0e0e0; border-radius: 6px; overflow: hidden; }
.fw-rep-bar-fill { height: 100%; background: #9b59b6; border-radius: 6px; min-width: 2px; }
.fw-rep-bar-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--colour-text-muted); margin-top: 0.25rem; }
.fw-rep-stats { display: flex; gap: 1.5rem; font-size: 0.8rem; color: var(--colour-text-muted); margin-top: 0.4rem; }
.fw-disclaimer {
  font-size: 0.72rem; color: var(--colour-text-muted);
  background: #fffbf0; border: 1px solid #f0d080;
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
  line-height: 1.5; margin-top: 0.75rem;
}

/* Finance FAB — unused, kept as fallback */
.fab-finance {
  left: 50%;
  transform: translateX(-50%);
  background: var(--colour-gold);
  color: #1a1d23;
  border: none;
}
.fab-finance:hover { background: var(--colour-gold-light); }

/* ── Bottom bar: hide when finance wizard is open on mobile (drawer covers it) */
@media (max-width: 640px) {
  body:has(.fw-open) .bottom-action-bar { display: none; }
}

@media (max-width: 640px) {
  /* On phones: finance wizard becomes a bottom drawer */
  .fw-overlay {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 88vh;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .fw-overlay.fw-open { transform: translateY(0); }
  .fw-modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .fw-footer {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .fw-overlay { align-items: flex-end; padding: 0; }
  .fw-scope-row { grid-template-columns: 1fr; }
  .fw-radio-card { flex-direction: row; text-align: left; padding: 0.6rem 0.75rem; }
  .fw-rc-icon { font-size: 1.1rem; }
  .fw-support-row { grid-template-columns: 1fr; }
  .fw-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .fw-body { padding: 0.9rem; }
}
/* ── Hide bottom bar when finance wizard drawer covers the bottom on mobile */
/* ── Finance wizard: tranche name label (replaces type select) ───────────── */
.fw-tr-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--colour-navy);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.fw-tr-rep-label {
  font-size: 0.75rem;
  color: var(--colour-text-muted);
  font-style: italic;
  align-self: center;
}

/* ── Step 3 header with help button ─────────────────────────────────────── */
.fw-step3-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fw-help-btn {
  font-size: 0.72rem;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1.5px solid var(--colour-navy);
  background: transparent;
  color: var(--colour-navy);
  cursor: pointer;
  transition: all 0.15s;
}
.fw-help-btn:hover { background: var(--colour-navy); color: #fff; }

/* ── Tranche catalog grid ────────────────────────────────────────────────── */
.fw-catalog-section { margin-bottom: 0.5rem; }
.fw-catalog-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--colour-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.fw-catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.fw-catalog-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.45rem;
  row-gap: 0.05rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--colour-border);
  border-radius: var(--radius-sm);
  background: var(--colour-bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
  font-family: var(--font-sans);
}
.fw-catalog-card:hover { border-color: var(--colour-navy-light); background: #f0f4fb; }
.fw-catalog-active { border-color: var(--colour-navy); background: #e8f0fc; }
.fw-catalog-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  grid-row: 1 / 3;
  flex-shrink: 0;
}
.fw-catalog-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--colour-navy);
  grid-column: 2;
  grid-row: 1;
  line-height: 1.2;
}
.fw-catalog-ret {
  font-size: 0.62rem;
  color: var(--colour-text-muted);
  grid-column: 2;
  grid-row: 2;
}
.fw-catalog-desc {
  display: none; /* shown on hover via title attr */
}
.fw-catalog-check {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--colour-navy);
  grid-row: 1 / 3;
  grid-column: 3;
}
.fw-catalog-active .fw-catalog-check { color: #27ae60; }

/* ── Tranche help overlay ────────────────────────────────────────────────── */
.fw-help-panel {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--colour-surface);
  overflow-y: auto;
  padding: 0;
}
.fw-help-inner { padding: 1rem; }
.fw-help-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  color: var(--colour-navy);
}
.fw-help-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: var(--colour-text-muted); line-height: 1;
}
.fw-help-close:hover { color: var(--colour-text); }
.fw-help-row {
  display: flex;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--colour-border);
}
.fw-help-row:last-child { border-bottom: none; }
.fw-help-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.fw-help-row div { font-size: 0.8rem; color: var(--colour-text); }
.fw-help-row div strong { color: var(--colour-navy); font-size: 0.82rem; }
.fw-help-row p { font-size: 0.75rem; color: var(--colour-text-muted); margin: 0.2rem 0 0; line-height: 1.5; }

/* ── Results summary banner ──────────────────────────────────────────────── */
.fw-summary-banner {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--colour-navy);
  border-radius: var(--radius-md);
}
.fw-sb-item {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.fw-sb-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
}
.fw-sb-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.fw-sb-sub { font-size: 0.62rem; color: rgba(255,255,255,0.5); }
.fw-sb-russia .fw-sb-value { color: #f5c842; }
.fw-sb-market .fw-sb-value { color: #7ee8a2; }

/* ── Wizard AI memo ──────────────────────────────────────────────────────── */
.fw-memo-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--colour-text-muted);
  padding: 0.5rem 0;
}
.fw-memo-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--colour-border);
  border-top-color: var(--colour-navy-light);
  border-radius: 50%;
  animation: fwSpin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes fwSpin { to { transform: rotate(360deg); } }
.fw-memo-text {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--colour-text);
  white-space: pre-wrap;
  background: #f8faff;
  border-left: 3px solid var(--colour-navy-light);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.fw-memo-error { font-size: 0.8rem; color: var(--colour-text-muted); font-style: italic; }
.fw-growth-placeholder { background: var(--colour-bg); border-radius: var(--radius-sm); }
.fw-growth-note { font-size: 0.8rem; color: var(--colour-text-muted); line-height: 1.55; }
.fw-growth-note code { font-family: var(--font-mono); font-size: 0.75rem; }

/* ── Finance page hero card ──────────────────────────────────────────────── */
.fp-hero {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 600;
  width: 100%;
  max-width: 520px;
  background: rgba(4,12,40,0.92);
  border: 1px solid rgba(201,162,39,0.45);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem 2rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 48px rgba(0,0,0,0.55);
  text-align: center;
  color: #fff;
}
.fp-hero-badge {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(201,162,39,0.25); color: #f5c842;
  border: 1px solid rgba(201,162,39,0.45);
  border-radius: 999px; padding: 0.25rem 0.8rem; margin-bottom: 1rem;
}
.fp-hero-title {
  font-size: 1.65rem; font-weight: 800; line-height: 1.25;
  color: #fff; margin-bottom: 0.85rem; letter-spacing: -0.01em;
}
.fp-hero-desc {
  font-size: 0.875rem; color: rgba(255,255,255,0.72);
  line-height: 1.65; margin-bottom: 1rem;
}
.fp-hero-stats { font-size: 0.78rem; color: #f5c842; font-weight: 600; margin-bottom: 1rem; }
.fp-hero-features {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.4rem 0.75rem; margin-bottom: 1.5rem;
}
.fp-hero-features span { font-size: 0.75rem; color: rgba(255,255,255,0.6); }
.fp-begin-btn {
  display: inline-block;
  background: var(--colour-gold); color: #1a1d23;
  font-size: 1rem; font-weight: 700; font-family: var(--font-sans);
  padding: 0.7rem 2.25rem; border: none; border-radius: var(--radius-md);
  cursor: pointer; transition: background 0.15s, transform 0.1s;
  margin-bottom: 0.85rem; letter-spacing: 0.01em;
}
.fp-begin-btn:hover { background: var(--colour-gold-light); transform: translateY(-1px); }
.fp-begin-btn:active { transform: translateY(0); }
.fp-disclaimer { font-size: 0.7rem; color: rgba(255,255,255,0.3); line-height: 1.5; margin: 0; }
.fp-back-link { color: rgba(255,255,255,0.75) !important; font-size: 0.875rem; font-weight: 600; }
.fp-back-link:hover { color: #fff !important; text-decoration: none !important; }

@media (max-width: 640px) {
  .fp-hero { max-width: calc(100vw - 28px); padding: 1.5rem 1.25rem 1.25rem; top: 48%; }
  .fp-hero-title { font-size: 1.25rem; }
  .fp-hero-desc  { font-size: 0.8rem; }
}

/* ── Scenario toggles ── */
.scenario-bar {
  background: #0d2248;
  border-bottom: 1px solid rgba(201,162,39,0.25);
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 700;
}
.scenario-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}
.scenario-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.38);
  white-space: nowrap;
  flex-shrink: 0;
}
.scenario-pills {
  display: flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  overflow: hidden;
}
.scenario-pill {
  font-size: 0.72rem;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.scenario-pill:last-child { border-right: none; }
.scenario-pill:hover:not(.active) {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
}
.scenario-pill.active {
  background: rgba(201,162,39,0.18);
  color: #f5c842;
  border-right-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1.5px rgba(201,162,39,0.55);
}
.scenario-reset {
  font-size: 0.65rem;
  font-family: var(--font-sans);
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: auto;
  white-space: nowrap;
  transition: color 0.15s;
}
.scenario-reset:hover { color: rgba(255,255,255,0.65); }

/* ── Finance page tabs ── */
.fp-tabs {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 650;
  display: flex;
  background: rgba(10,20,45,0.92);
  border: 1px solid rgba(201,162,39,0.35);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.fp-tab {
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border: none;
  border-right: 1px solid rgba(201,162,39,0.2);
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.fp-tab:last-child { border-right: none; }
.fp-tab.active {
  background: rgba(201,162,39,0.18);
  color: #f5c842;
}
.fp-tab:hover:not(.active) { color: rgba(255,255,255,0.85); }

/* ── Capital Gap panel ── */
.fp-gap-panel {
  position: absolute;
  inset: 0;
  z-index: 600;
  overflow-y: auto;
  background: rgba(4,10,32,0.96);
  color: rgba(255,255,255,0.85);
  padding: 1.25rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.fp-gap-panel[hidden] { display: none; }

.gap-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.gap-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #c9a227;
  margin: 0;
}
.gap-sub-tabs {
  display: flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px;
  overflow: hidden;
}
.gap-sub-tab {
  font-size: 0.7rem;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.gap-sub-tab:last-child { border-right: none; }
.gap-sub-tab.active { background: rgba(201,162,39,0.18); color: #f5c842; }

.gap-interpretation {
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.62);
  border-left: 3px solid rgba(201,162,39,0.45);
  padding-left: 0.9rem;
  margin: 0;
}
.gap-interpretation strong { color: #f5c842; }

/* SVG bar chart */
.gap-chart-wrap {
  flex: 1;
  overflow: hidden;
}
.gap-chart-wrap svg {
  width: 100%;
  overflow: visible;
}
.gap-bar-label {
  font-size: 11px;
  fill: rgba(255,255,255,0.65);
  dominant-baseline: middle;
}
.gap-bar-value {
  font-size: 10px;
  fill: rgba(255,255,255,0.45);
  dominant-baseline: middle;
}
.gap-bar-req { fill: #2980b9; }
.gap-bar-addr { fill: #27ae60; }
.gap-bar-gap-text { fill: #e67e22; font-size: 10px; dominant-baseline: middle; }
.gap-axis-line { stroke: rgba(255,255,255,0.12); stroke-width: 1; }
.gap-axis-label { font-size: 10px; fill: rgba(255,255,255,0.3); text-anchor: middle; }
.gap-legend {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
}
.gap-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.gap-sector-finding {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.38);
  margin-top: 0.25rem;
  font-style: italic;
}

/* ── Confidence badges ── */
.conf-badge-medium {
  font-size: 0.72rem;
  color: var(--colour-text-muted);
  margin-left: 0.2rem;
  font-weight: 700;
  cursor: help;
}
.conf-badge-low {
  font-size: 0.7rem;
  color: var(--colour-warning);
  margin-left: 0.2rem;
  cursor: help;
}

/* ── Lang toggle ─────────────────────────────────────────────────────────── */
.lang-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.75);
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.lang-toggle:hover { border-color: rgba(255,255,255,0.55); color: #fff; }

/* ── Growth sectors panel (asset page) ──────────────────────────────────── */
.gs-panel { margin-top: 1.5rem; }
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 0.75rem; }
.gs-card { background: var(--colour-card); border: 1px solid var(--colour-border); border-radius: 8px; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.gs-card-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.gs-icon { font-size: 1.25rem; }
.gs-name { font-weight: 700; font-size: 0.92rem; flex: 1; }
.gs-gate { font-size: 0.62rem; padding: 0.15rem 0.45rem; border-radius: 10px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.gs-gate-green { background: rgba(39,174,96,0.18); color: #2ecc71; border: 1px solid rgba(39,174,96,0.3); }
.gs-gate-amber { background: rgba(243,156,18,0.18); color: #f39c12; border: 1px solid rgba(243,156,18,0.3); }
.gs-gate-red   { background: rgba(231,76,60,0.15);  color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.gs-thesis  { font-size: 0.8rem; font-style: italic; color: rgba(255,255,255,0.75); margin: 0; }
.gs-position{ font-size: 0.78rem; color: rgba(255,255,255,0.6); margin: 0; }
.gs-meta { display: flex; flex-direction: column; gap: 0.3rem; }
.gs-dfi-badge { font-size: 0.68rem; color: var(--colour-gold-light); letter-spacing: 0.05em; }
.gs-archetypes { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.gs-archetype { font-size: 0.68rem; background: rgba(255,255,255,0.07); border-radius: 4px; padding: 0.15rem 0.4rem; }
.gs-risks { margin-top: 0.25rem; }
.gs-risks summary { font-size: 0.72rem; color: rgba(255,255,255,0.45); cursor: pointer; }
.gs-risks ul { margin: 0.35rem 0 0; padding-left: 1.2em; font-size: 0.72rem; color: rgba(255,255,255,0.55); }
.gs-risks li { margin-bottom: 0.2rem; }
.gs-finance-link { margin-top: 0.75rem; font-size: 0.8rem; }
.gs-cta-link { color: var(--colour-gold-light); text-decoration: none; }
.gs-cta-link:hover { text-decoration: underline; }

/* ── Growth sectors wizard picker ───────────────────────────────────────── */
.gs-wiz-wrap { margin-top: 0.75rem; }
.gs-wiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
.gs-wiz-card { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.6rem; border: 1px solid var(--colour-border); border-radius: 6px; cursor: pointer; text-align: center; transition: border-color 0.15s, background 0.15s; }
.gs-wiz-card:hover { border-color: var(--colour-gold-light); background: rgba(201,162,39,0.08); }
.gs-wiz-sel { border-color: var(--colour-gold-light); background: rgba(201,162,39,0.12); }
.gs-wiz-blocked { opacity: 0.35; cursor: not-allowed; }
.gs-wiz-dim { opacity: 0.6; }
.gs-wiz-icon { font-size: 1.4rem; }
.gs-wiz-name { font-size: 0.7rem; font-weight: 600; line-height: 1.2; }
.gs-gate-sm { font-size: 0.55rem; padding: 0.1rem 0.3rem; }
.gs-arch-picker { margin-top: 1rem; padding: 0.75rem; background: rgba(255,255,255,0.04); border-radius: 6px; border: 1px solid var(--colour-border); }
.gs-arch-title { font-size: 0.85rem; margin: 0 0 0.35rem; }
.gs-arch-thesis { font-size: 0.75rem; color: rgba(255,255,255,0.6); font-style: italic; margin: 0 0 0.75rem; }
.gs-arch-list { display: flex; flex-direction: column; gap: 0.4rem; }
.gs-arch-card { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.5rem 0.65rem; border: 1px solid var(--colour-border); border-radius: 5px; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.gs-arch-card:hover { border-color: var(--colour-gold-light); background: rgba(201,162,39,0.07); }
.gs-arch-sel { border-color: var(--colour-gold-light); background: rgba(201,162,39,0.1); }
.gs-arch-name { font-size: 0.82rem; font-weight: 600; flex: 1; }
.gs-arch-scale { font-size: 0.82rem; color: var(--colour-gold-light); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gs-arch-note { font-size: 0.7rem; color: rgba(255,255,255,0.5); }
.gs-capital-note { font-size: 0.7rem; color: rgba(255,255,255,0.45); margin: 0.5rem 0 0; }
.gs-arch-prompt { font-size: 0.8rem; color: rgba(255,255,255,0.4); font-style: italic; margin: 1rem 0; text-align: center; }

/* ── Trust page ──────────────────────────────────────────────────────────── */
.trust-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  width: 100%;
}

/* Overview section */
.trust-hero {
  margin-bottom: 2.5rem;
}
.trust-hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--colour-navy);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.trust-hero-sub {
  font-size: 0.88rem;
  color: var(--colour-text-muted);
  max-width: 780px;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}
.trust-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.trust-stat-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: var(--shadow-sm);
}
.trust-stat-card.highlight {
  border-color: var(--colour-gold);
  background: linear-gradient(135deg, #fff9ee 0%, #fff 100%);
}
.tsc-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--colour-navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tsc-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--colour-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tsc-note {
  font-size: 0.72rem;
  color: var(--colour-text-muted);
  margin-top: 0.2rem;
}

/* Section headings */
.trust-section {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.trust-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #c9a227;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--colour-border);
}
.trust-section-desc {
  font-size: 0.88rem;
  color: var(--colour-text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

/* Portfolio builder layout */
.trust-builder-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 760px) {
  .trust-builder-layout { grid-template-columns: 1fr; }
}

/* Inputs column */
.trust-inputs-col { display: flex; flex-direction: column; gap: 1.25rem; }
.trust-input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.trust-input-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--colour-navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.trust-radio-group { display: flex; flex-direction: column; gap: 0.4rem; }
.trust-radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--colour-border);
  background: var(--colour-bg);
  transition: border-color 0.12s, background 0.12s;
}
.trust-radio-option:has(input:checked) {
  border-color: var(--colour-navy);
  background: #eef2f9;
}
.trust-radio-option input { accent-color: var(--colour-navy); }
.trust-slider-wrap { display: flex; flex-direction: column; gap: 0.4rem; }
.trust-slider {
  width: 100%;
  accent-color: var(--colour-navy);
  cursor: pointer;
}
.trust-slider-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--colour-navy);
  font-variant-numeric: tabular-nums;
}

/* Comparison table */
.trust-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.trust-compare-table th {
  background: #f0f4fb;
  color: var(--colour-navy);
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  text-align: left;
  border: 1px solid var(--colour-border);
  font-size: 0.78rem;
  line-height: 1.5;
}
.trust-compare-table th.col-25 { background: #eef5f0; color: #2c7a4e; }
.trust-compare-table th.col-4  { background: #eef2fb; color: var(--colour-navy); }
.trust-compare-table th.col-5  { background: #fef6e8; color: #8a5a00; }
.trust-compare-table td {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--colour-border);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.trust-compare-table td.perpetual {
  color: var(--colour-grant);
  font-weight: 600;
}
.trust-compare-table tr:nth-child(even) td { background: #f9fafc; }
.trust-row-label {
  font-weight: 600;
  color: var(--colour-text);
  white-space: nowrap;
}
.trust-highlight-val {
  font-weight: 700;
  color: var(--colour-navy);
}

/* 50-year trajectory chart */
.trust-chart-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.75rem;
}
.trust-chart-wrap svg { max-height: 260px; }
.trust-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.trust-chart-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.75rem;
}
.trust-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.trust-legend-swatch {
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
}
/* SVG chart animation */
@keyframes trust-draw {
  from { stroke-dashoffset: 4000; }
  to   { stroke-dashoffset: 0; }
}
.trust-series {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4000;
  animation: trust-draw 0.8s ease-out forwards;
}
.trust-series-2  { stroke: #1a3a6b; animation-delay: 0ms; }
.trust-series-4  { stroke: #f0a500; animation-delay: 80ms; }
.trust-series-5  { stroke: #e67e22; animation-delay: 160ms; }

/* Trust footnote in asset page */
.trust-footnote {
  font-size: 0.78rem;
  color: var(--colour-text-muted);
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #f8f9fc;
  border-left: 3px solid var(--colour-navy);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.trust-footnote a { color: var(--colour-navy-light); }

/* BBB+Trust column in financing table */
.financing-card.bbb-trust {
  border-top: 3px solid var(--colour-gold);
}
.bbb-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #8a5a00;
  background: #fef6e4;
  border: 1px solid #f0c060;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-bottom: 0.5rem;
}
.trust-annual-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2c7a4e;
  background: #eef7f2;
  border: 1px solid #b8dcc8;
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.45rem;
  margin-left: 0.3rem;
}

/* Finance wizard Trust toggle */
.fw-trust-toggle-row {
  margin-top: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: #f8f6fd;
  border: 1px solid #d8c8f0;
  border-radius: var(--radius-sm);
}
.fw-trust-mode-btns {
  display: flex;
  gap: 0;
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 0.5rem;
}
.fw-trust-mode-btn {
  font-size: 0.78rem;
  font-family: var(--font-sans);
  padding: 0.3rem 0.75rem;
  border: none;
  background: var(--colour-bg);
  color: var(--colour-text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border-right: 1px solid var(--colour-border);
}
.fw-trust-mode-btn:last-child { border-right: none; }
.fw-trust-mode-btn.active {
  background: var(--colour-navy);
  color: #fff;
  font-weight: 600;
}
.fw-trust-computed {
  font-size: 0.82rem;
  color: var(--colour-text);
}
.fw-trust-computed strong { color: var(--colour-navy); }
.fw-trust-note {
  font-size: 0.75rem;
  color: var(--colour-text-muted);
  margin-top: 0.4rem;
  font-style: italic;
}

/* ── Phone-specific improvements ────────────────────────────────────────── */

/* War legend — safe-area aware on phones */
@media (max-width: 640px) {
  .war-legend {
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 0.5rem);
    left: 0.5rem;
    right: 0.5rem;
    min-width: unset;
    font-size: 0.7rem;
  }
  /* Asset list panel safe area */
  .asset-list-panel {
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
  }
  /* Disclaimer safe area — above bottom bar */
  .disclaimer-banner {
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
  }
  /* Finance wizard overlay — align to bottom on phone */
  .fw-overlay { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Very small phones (SE, Pixel 4a) */
@media (max-width: 390px) {
  .wordmark-text { font-size: 0.9rem; }
  .logo-img { width: 24px; height: 24px; }
  .map-view-tab { font-size: 0.62rem; padding: 0.4rem 0.4rem; }
  .lang-toggle { font-size: 0.68rem; padding: 0.2rem 0.35rem; }
  .landing-title { font-size: 1.55rem; }
  .landing-cta { font-size: 0.82rem; padding: 0.5rem 1.1rem; }
}

/* Touch-action: allow pan on map panels that scroll */
.oblast-info-panel,
.oblast-war-panel,
.oblast-recon-panel,
.dev-opps-panel,
.asset-list-panel,
.filter-panel { -webkit-overflow-scrolling: touch; }

/* Increase base tap-target height for all Leaflet controls on mobile */
@media (max-width: 640px) {
  .leaflet-control-zoom a { width: 34px !important; height: 34px !important; line-height: 34px !important; font-size: 18px !important; }
  .leaflet-control-zoom { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
}

/* ── Map hint strip ──────────────────────────────────────────────────────────── */
.map-hint-strip {
  position: fixed;
  top: var(--map-top);
  left: 0;
  right: 0;
  z-index: 250;
  background: linear-gradient(90deg, #0d2248 0%, #1a3a6b 100%);
  border-bottom: 2px solid #f5c842;
  padding: 0.45rem 1rem;
  animation: mhs-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transition: opacity 0.4s ease;
}
.map-hint-strip.mhs-fade { opacity: 0; pointer-events: none; }
@keyframes mhs-slide-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.mhs-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 900px;
  margin: 0 auto;
}
.mhs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
}
.mhs-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(245, 200, 66, 0.12);
  border: 1px solid rgba(245, 200, 66, 0.3);
  color: #e8d99a;
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.74rem;
  white-space: nowrap;
}
.mhs-close {
  flex-shrink: 0;
  background: #f5c842;
  color: #0d2248;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.mhs-close:hover { background: #ffd86e; }
@media (max-width: 640px) {
  .mhs-chips { gap: 0.25rem; }
  .mhs-chip { font-size: 0.68rem; padding: 0.15rem 0.5rem; }
  .mhs-close { font-size: 0.68rem; padding: 0.25rem 0.5rem; }
}

/* ── Finance wizard intro screen ─────────────────────────────────────────────── */
.fw-intro {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
}
.fw-intro-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.fw-intro-icon { font-size: 2rem; line-height: 1; }
.fw-intro-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--colour-navy);
  margin: 0;
}
.fw-intro-body {
  font-size: 0.85rem;
  color: var(--colour-text-muted);
  line-height: 1.6;
  margin: 0;
}
.fw-intro-steps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #f7f9fc;
  border: 1px solid var(--colour-border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}
.fw-intro-step {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--colour-navy);
  line-height: 1.45;
}
.fw-is-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--colour-navy);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}
.fw-intro-start {
  align-self: flex-start;
  margin-top: 0.25rem;
}

/* ── Portfolio + Growth Picker ───────────────────────────────────────────────── */
.fw-growth-toggle-btn {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--colour-navy);
  color: #f5c842;
  border: 1.5px solid #f5c842;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fw-growth-toggle-btn:hover { background: #f5c842; color: var(--colour-navy); }

.fw-growth-picker { margin-top: 0.75rem; }
.fw-growth-intro  { font-size: 0.78rem; color: var(--colour-text-muted); margin: 0 0 0.6rem; }

.fw-growth-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.fw-growth-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #1a3a6b22;
  border: 1px solid var(--colour-accent);
  color: var(--colour-navy);
  border-radius: 12px;
  padding: 0.2rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
}
.fw-gc-scale { font-weight: 400; color: var(--colour-text-muted); }
.fw-growth-total-chip {
  display: inline-flex;
  align-items: center;
  background: var(--colour-accent);
  color: var(--colour-navy);
  border-radius: 12px;
  padding: 0.2rem 0.7rem;
  font-size: 0.74rem;
}
.fw-growth-empty { font-size: 0.78rem; color: var(--colour-text-muted); margin: 0 0 0.6rem; font-style: italic; }

.fw-gs-sectors { display: flex; flex-direction: column; gap: 0.3rem; }

.fw-gs-sector-item {
  border: 1px solid var(--colour-border);
  border-radius: 6px;
  overflow: hidden;
}
.fw-gs-sector-item[open] { border-color: var(--colour-accent); }

.fw-gs-sector-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--colour-surface);
  user-select: none;
  list-style: none;
}
.fw-gs-sector-summary::-webkit-details-marker { display: none; }
.fw-gs-sector-summary::before { content: '▶'; font-size: 0.6rem; color: var(--colour-text-muted); transition: transform 0.15s; }
.fw-gs-sector-item[open] .fw-gs-sector-summary::before { transform: rotate(90deg); }

.fw-gs-icon    { font-size: 1rem; }
.fw-gs-sname   { flex: 1; color: var(--colour-navy); }
.fw-gs-sel-count {
  background: var(--colour-accent);
  color: var(--colour-navy);
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.fw-gs-arch-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: #f7f9fc;
}

.fw-gs-arch-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1.5px solid var(--colour-border);
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.8rem;
}
.fw-gs-arch-item:hover { border-color: var(--colour-accent); background: #fffef0; }
.fw-gs-arch-checked   { border-color: var(--colour-accent) !important; background: #fffbe6 !important; }
.fw-gs-arch-name { flex: 1; font-weight: 600; color: var(--colour-navy); }
.fw-gs-arch-scale { font-size: 0.75rem; color: var(--colour-accent-dark, #b8920f); font-weight: 700; }
.fw-gs-arch-note  { font-size: 0.7rem; color: var(--colour-text-muted); }

/* ── Cost breakdown in results ───────────────────────────────────────────────── */
.fw-cost-breakdown {
  margin-top: 0.75rem;
  border: 1px solid var(--colour-border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.8rem;
}
.fw-cb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--colour-border);
  gap: 0.5rem;
}
.fw-cb-row:last-child { border-bottom: none; }
.fw-cb-lbl    { flex: 1; color: var(--colour-navy); }
.fw-cb-val    { font-weight: 700; color: var(--colour-navy); }
.fw-cb-sector { font-size: 0.72rem; color: var(--colour-text-muted); font-weight: 400; }
.fw-cb-growth { background: #fffbe6; }
.fw-cb-total  { background: var(--colour-navy); }
.fw-cb-total .fw-cb-lbl,
.fw-cb-total .fw-cb-val { color: #fff; font-weight: 700; }

/* ── Growth mode selector (Generic / Specific) ───────────────────────────────── */
.fw-growth-mode-row {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.fw-growth-mode-opt {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border: 1.5px solid var(--colour-border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.fw-growth-mode-opt:hover { border-color: var(--colour-navy-light); background: #f5f8ff; }
.fw-gmo-active { border-color: var(--colour-navy) !important; background: #edf3ff !important; }
.fw-gmo-icon { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.fw-gmo-text { display: flex; flex-direction: column; gap: 0.15rem; }
.fw-gmo-text strong { font-size: 0.82rem; color: var(--colour-navy); }
.fw-gmo-sub { font-size: 0.72rem; color: var(--colour-text-muted); }

/* Generic sector recovery rows */
.fw-generic-sectors { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; }
.fw-generic-intro   { font-size: 0.78rem; color: var(--colour-text-muted); margin-bottom: 0.5rem; }
.fw-generic-sector-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.65rem;
  border: 1.5px solid var(--colour-border);
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  font-size: 0.8rem;
  transition: border-color 0.15s, background 0.15s;
}
.fw-generic-sector-row:hover { border-color: var(--colour-navy-light); background: #f5f8ff; }
.fw-gsr-sel { border-color: var(--colour-navy) !important; background: #edf3ff !important; }
.fw-gsr-label { flex: 1; font-weight: 600; color: var(--colour-navy); }
.fw-gsr-scale { font-weight: 700; color: #c9a227; font-size: 0.82rem; }
.fw-gsr-note  { font-size: 0.7rem; color: var(--colour-text-muted); }

/* Quantity controls on specific growth project chips */
.fw-qty-ctrl  { display: inline-flex; align-items: center; gap: 0.2rem; margin: 0 0.3rem; }
.fw-qty-btn   { background: rgba(0,0,0,0.12); border: none; border-radius: 4px; width: 18px; height: 18px;
                font-size: 0.82rem; line-height: 1; cursor: pointer; padding: 0; color: var(--colour-navy);
                display: inline-flex; align-items: center; justify-content: center; }
.fw-qty-btn:hover { background: rgba(0,0,0,0.22); }
.fw-qty-val   { font-size: 0.75rem; font-weight: 700; color: var(--colour-navy); min-width: 20px; text-align: center; }

/* ── Return Viability / DSCR section ─────────────────────────────────────────── */
.fw-viability-sect { border-left: 3px solid #9b59b6; padding-left: 0.75rem; }
.fw-viability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 0.6rem 0;
}
.fw-vg-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem;
  background: #f7f9fc;
  border-radius: 6px;
  border: 1px solid var(--colour-border);
}
.fw-vg-val  { font-size: 1.1rem; font-weight: 700; color: var(--colour-navy); }
.fw-vg-lbl  { font-size: 0.75rem; font-weight: 600; color: var(--colour-navy); }
.fw-vg-note { font-size: 0.68rem; color: var(--colour-text-muted); }
.fw-vg-dscr .fw-vg-val { font-size: 1.3rem; }

/* Russian funding gap box */
.fw-russia-gap {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1.5px solid #9b59b6;
  background: #f9f3ff;
}
.fw-rg-green { border-color: #27ae60 !important; background: #f0fff5 !important; }
.fw-rg-header  { font-size: 0.85rem; font-weight: 700; color: var(--colour-navy); margin-bottom: 0.4rem; }
.fw-rg-green .fw-rg-header { color: #27ae60; }
.fw-rg-calc    { font-size: 0.78rem; color: var(--colour-text-muted); margin-bottom: 0.4rem; }
.fw-rg-extra   { color: #9b59b6; font-weight: 700; }
.fw-rg-total   { font-size: 0.82rem; color: var(--colour-navy); padding: 0.4rem 0.6rem;
                  background: rgba(155,89,182,0.1); border-radius: 4px; }
.fw-rg-total-val  { font-size: 1rem; color: #9b59b6; font-weight: 700; }
.fw-rg-breakdown  { font-size: 0.72rem; color: var(--colour-text-muted); display: block; margin-top: 0.15rem; }

/* PRI/war-risk wrap flag badge in tranche rows */
.fw-tr-flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  background: rgba(230,126,34,0.12);
  border: 1px solid rgba(230,126,34,0.4);
  color: #e67e22;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  margin-top: 0.2rem;
}

/* ── Finance wizard: Russia headline box (step 4 results top) ────────────── */
.fw-russia-headline {
  background: linear-gradient(135deg, rgba(120,0,0,0.20) 0%, rgba(10,20,50,0.25) 100%);
  border: 1.5px solid rgba(220,60,60,0.38);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}
.fw-rh-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.fw-rh-item { display: flex; flex-direction: column; gap: 0.2rem; }
.fw-rh-label { font-size: 0.72rem; color: rgba(255,255,255,0.65); font-weight: 600; }
.fw-rh-value { font-size: 1.3rem; font-weight: 800; color: #fff; line-height: 1.1; }
.fw-rh-russia .fw-rh-value { color: #ff9999; }
.fw-rh-sub { font-size: 0.67rem; color: rgba(255,255,255,0.48); line-height: 1.4; }
.fw-rh-gap-note {
  padding: 0.4rem 0.75rem;
  background: rgba(220,60,60,0.14);
  border-radius: var(--radius-sm);
  font-size: 0.73rem;
  color: #ffaaaa;
  border-left: 3px solid #cc3333;
}
.fw-rh-gap-note.fw-rh-ok {
  background: rgba(39,174,96,0.12);
  color: #7de8a8;
  border-left-color: #27ae60;
}
.fw-rh-no-russia {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  padding: 0.75rem 1rem;
}
.fw-rh-no-russia .fw-rh-label { color: rgba(255,255,255,0.7); }
.fw-rh-no-russia .fw-rh-value { font-size: 1.1rem; color: #f5c842; }
@media (max-width: 640px) { .fw-rh-row { grid-template-columns: 1fr; } }

/* ── Finance wizard header subtitle ─────────────────────────────────────── */
.fw-header-sub {
  font-size: 0.71rem;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

/* ── Trust panel (trust-panel.js) ───────────────────────────────────────── */
.tp-section {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(10,22,40,0.10);
}
.tp-section:last-child { border-bottom: none; }
.tp-sh {
  font-size: 0.73rem;
  font-weight: 700;
  color: rgba(10,22,40,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}
.tp-slider-row { margin-bottom: 0.8rem; }
.tp-sl-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.3rem; }
.tp-sl-label { font-size: 0.77rem; color: rgba(10,22,40,0.72); }
.tp-sl-val { font-size: 0.88rem; font-weight: 700; color: #b07800; font-family: var(--font-mono); }
.tp-slider { width: 100%; accent-color: var(--colour-gold); margin: 0; cursor: pointer; }
.tp-sl-ends { display: flex; justify-content: space-between; font-size: 0.64rem; color: rgba(10,22,40,0.35); margin-top: 0.2rem; }
.tp-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.tp-metric {
  background: rgba(10,22,40,0.05);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tp-m-val { font-size: 1.1rem; font-weight: 800; color: #0a1628; font-family: var(--font-mono); }
.tp-m-lbl { font-size: 0.68rem; color: rgba(10,22,40,0.62); }
.tp-m-note { font-size: 0.63rem; color: rgba(10,22,40,0.42); }
.tp-m-primary .tp-m-val { color: #b07800; font-size: 1.2rem; }
.tp-m-total .tp-m-val { color: #1a7a4a; }
.tp-traj-table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.tp-traj-table th {
  padding: 0.3rem 0.5rem; text-align: left;
  font-size: 0.67rem; color: rgba(10,22,40,0.48);
  font-weight: 600; border-bottom: 1px solid rgba(10,22,40,0.10);
}
.tp-traj-table td {
  padding: 0.25rem 0.5rem; color: rgba(10,22,40,0.80);
  border-bottom: 1px solid rgba(10,22,40,0.06);
  font-family: var(--font-mono); font-size: 0.72rem;
}
.tp-traj-table tbody tr:first-child td { font-weight: 700; color: #b07800; }
.tp-tr-low td { color: rgba(180,40,40,0.82); }
.tp-depletion-note { font-size: 0.72rem; color: #b03030; margin-top: 0.4rem; }
.tp-ok-note { font-size: 0.72rem; color: #1a7a4a; margin-top: 0.4rem; }
.tp-ctx-bar-wrap { margin-bottom: 0.6rem; }
.tp-ctx-bar-track { height: 10px; background: rgba(10,22,40,0.10); border-radius: 5px; overflow: hidden; margin-bottom: 0.3rem; }
.tp-ctx-bar-fill { height: 100%; background: linear-gradient(90deg, #9b59b6, #e74c3c); border-radius: 5px; transition: width 0.35s ease; }
.tp-ctx-bar-labels { display: flex; justify-content: space-between; font-size: 0.64rem; color: rgba(10,22,40,0.42); }
.tp-ctx-note { font-size: 0.73rem; color: rgba(10,22,40,0.65); line-height: 1.55; }
.tp-footer { padding-top: 0.85rem; }
.tp-full-btn {
  display: block;
  text-align: center;
  background: #f0a500;
  color: #0a1628;
  font-weight: 800;
  font-size: 0.83rem;
  border-radius: 14px;
  padding: 0.6rem 1rem;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 10px rgba(240,165,0,0.35);
}
.tp-full-btn:hover { background: #f5c842; box-shadow: 0 5px 16px rgba(240,165,0,0.50); text-decoration: none; }
.tp-disclaimer { font-size: 0.65rem; color: rgba(10,22,40,0.38); line-height: 1.5; }
@media (max-width: 640px) { .tp-metrics { grid-template-columns: 1fr; } }

/* ── Trust panel (trust-panel.js) ───────────────────────────────────────────── */
.tp-overlay { z-index: 3600; }
.tp-modal {
  max-width: 440px;
  background: #f5f8ff !important;
  color: #0a1628;
}
.fw-header-sub {
  font-size: 0.72rem;
  color: rgba(10,22,40,0.55);
  margin-top: 2px;
}

/* Finance wizard Russia headline box */
.fw-russia-headline {
  background: linear-gradient(135deg, rgba(120,0,0,0.18) 0%, rgba(10,20,50,0.22) 100%);
  border: 1.5px solid rgba(220,60,60,0.35);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}
.fw-rh-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.fw-rh-item { display: flex; flex-direction: column; gap: 0.2rem; }
.fw-rh-label { font-size: 0.72rem; color: rgba(255,255,255,0.65); font-weight: 600; }
.fw-rh-value { font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1.1; }
.fw-rh-russia .fw-rh-value { color: #ff9999; }
.fw-rh-sub { font-size: 0.68rem; color: rgba(255,255,255,0.5); }
.fw-rh-gap-note {
  margin-top: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: rgba(220,60,60,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.73rem;
  color: #ffaaaa;
  border-left: 3px solid #cc3333;
}
.fw-rh-gap-note.fw-rh-ok {
  background: rgba(39,174,96,0.12);
  color: #7de8a8;
  border-left-color: #27ae60;
}
.fw-rh-no-russia {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
}
.fw-rh-no-russia .fw-rh-label { color: rgba(255,255,255,0.7); }
.fw-rh-no-russia .fw-rh-value { font-size: 1.1rem; color: #f5c842; }

/* Investor param cards — step 2 */
.fw-radio-card.fw-investor-card { padding: 0.5rem 0.75rem; }

/* Trust panel body */
.tp-section {
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(10,22,40,0.10);
}
.tp-section:last-child { border-bottom: none; }
.tp-sh {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(10,22,40,0.55);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}
.tp-slider-row { margin-bottom: 0.75rem; }
.tp-sl-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.3rem; }
.tp-sl-label { font-size: 0.78rem; color: rgba(10,22,40,0.72); }
.tp-sl-val { font-size: 0.85rem; font-weight: 700; color: #b07800; font-family: var(--font-mono); }
.tp-slider { width: 100%; accent-color: var(--colour-gold); margin: 0; }
.tp-sl-ends { display: flex; justify-content: space-between; font-size: 0.65rem; color: rgba(10,22,40,0.35); margin-top: 0.2rem; }
.tp-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.tp-metric {
  background: rgba(10,22,40,0.05);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tp-m-val { font-size: 1.1rem; font-weight: 800; color: #0a1628; font-family: var(--font-mono); }
.tp-m-lbl { font-size: 0.68rem; color: rgba(10,22,40,0.62); }
.tp-m-note { font-size: 0.63rem; color: rgba(10,22,40,0.42); }
.tp-m-primary .tp-m-val { color: #b07800; font-size: 1.25rem; }
.tp-m-total .tp-m-val { color: #1a7a4a; }
.tp-traj-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.tp-traj-table th { padding: 0.3rem 0.5rem; text-align: left; font-size: 0.68rem; color: rgba(10,22,40,0.48); font-weight: 600; border-bottom: 1px solid rgba(10,22,40,0.10); }
.tp-traj-table td { padding: 0.25rem 0.5rem; color: rgba(10,22,40,0.80); border-bottom: 1px solid rgba(10,22,40,0.06); font-family: var(--font-mono); font-size: 0.73rem; }
.tp-traj-table tr:first-child td { font-weight: 700; color: #b07800; }
.tp-tr-low td { color: rgba(180,40,40,0.80); }
.tp-depletion-note { font-size: 0.72rem; color: #b03030; margin-top: 0.4rem; }
.tp-ok-note { font-size: 0.72rem; color: #1a7a4a; margin-top: 0.4rem; }
.tp-ctx-bar-wrap { margin-bottom: 0.6rem; }
.tp-ctx-bar-track { height: 12px; background: rgba(10,22,40,0.10); border-radius: 6px; overflow: hidden; margin-bottom: 0.3rem; }
.tp-ctx-bar-fill { height: 100%; background: linear-gradient(90deg, #9b59b6, #e74c3c); border-radius: 6px; transition: width 0.3s; }
.tp-ctx-bar-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: rgba(10,22,40,0.42); }
.tp-ctx-note { font-size: 0.73rem; color: rgba(10,22,40,0.65); line-height: 1.5; }
.tp-footer { padding-top: 0.9rem; }
.tp-full-btn {
  display: block;
  text-align: center;
  background: var(--colour-gold);
  color: #0a1628;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 14px;
  padding: 0.6rem 1rem;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: background 0.15s;
}
.tp-full-btn:hover { background: var(--colour-gold-light); text-decoration: none; }
.tp-disclaimer { font-size: 0.65rem; color: rgba(10,22,40,0.38); line-height: 1.5; }
@media (max-width: 640px) {
  .fw-rh-row { grid-template-columns: 1fr; }
  .tp-metrics { grid-template-columns: 1fr; }
}
