:root {
  /* Spatial scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Background depth */
  --bg-0: #0b1018;
  --bg-1: #131b27;
  --bg-2: #1a2534;
  --bg-3: #253246;

  /* Semantic surface aliases used by feature views */
  --surface: var(--bg-1);
  --surface-2: var(--bg-2);
  --surface-hover: var(--bg-2);
  --bg-hover: var(--bg-2);

  /* Borders */
  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);

  /* Text */
  --text-primary: #f0f4f8;
  --text-secondary: #afbdcf;
  --text-tertiary: #8b9bb1;
  --text-disabled: #3a4e5e;

  /* Accent */
  --accent: #87a8ff;
  --brand-blue: #2563eb;
  --accent-dim: rgba(59,130,246,0.12);
  --accent-border: rgba(59,130,246,0.30);

  /* Status colors */
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245,158,11,0.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.12);
  --blue: #3b82f6;
  --blue-dim: rgba(59,130,246,0.12);
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,0.12);

  /* Fonts */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  --font-serif: Georgia, 'Times New Roman', Times, serif;

  /* Design system — Wave 1 tokens */
  --accent-surface: rgba(59,130,246,0.14);
  --accent-surface-border: rgba(59,130,246,0.28);

  /* Type scale */
  --text-xs: 0.72rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5625rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --radius: var(--radius-sm);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.5);
  --shadow-drawer: -8px 0 40px rgba(0,0,0,0.6);

  /* Motion */
  --ease: cubic-bezier(0.16,1,0.3,1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 350ms;

  /* Z-index */
  --z-base: 1;
  --z-dropdown: 100;
  --z-drawer: 200;
  --z-modal: 300;
  --z-toast: 400;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--bg-0); color: var(--text-primary); font-family: var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; font-family: var(--font-mono); }

/* ── Top bar ── */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 1.5rem; padding: 0.85rem 1.5rem;
  background: rgba(22,28,36,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-default);
  position: sticky; top: 0; z-index: 50;
  transition: background var(--duration-base) var(--ease);
}
.brand {
  display: flex; align-items: center; gap: 0.85rem; justify-self: start;
  background: transparent; border: none; padding: 0; cursor: pointer; font: inherit; text-align: left;
}
.brand-mark {
  display: inline-grid; place-items: center; flex: 0 0 38px;
  width: 38px; height: 38px; padding: 0;
  font-weight: 800; font-size: 0.93rem; line-height: 1; letter-spacing: 0.055em;
  background: var(--brand-blue); color: #fff;
  border: 1px solid rgba(255,255,255,0.24); border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 12px rgba(0,0,0,0.24);
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), filter var(--duration-fast) var(--ease);
}
.brand:hover .brand-mark { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 6px 14px rgba(0,0,0,0.28); }
.brand-text h1 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; transition: opacity var(--duration-fast) var(--ease); }
.brand-text p { font-size: 0.78rem; color: var(--text-tertiary); transition: color var(--duration-fast) var(--ease); }
.brand:hover .brand-text h1 { opacity: 0.75; text-decoration: underline; text-decoration-color: var(--accent); }
.brand:hover .brand-text p { color: var(--text-secondary); }
.nav { grid-column: 2; display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: center; }
.help-toggle {
  justify-self: end; width: 28px; height: 28px; border-radius: var(--radius-full);
  background: transparent; border: 1px solid var(--border-default); color: var(--text-tertiary);
  font-size: 0.85rem; font-weight: 700; font-family: var(--font-mono); cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.help-toggle:hover { color: var(--text-primary); border-color: var(--accent-border); transform: scale(1.08); }
.help-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.nav-btn {
  position: relative; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary);
  padding: 0.5rem 0.15rem; border-radius: 0; cursor: pointer;
  font-size: 0.92rem; font-weight: 600; transition: color var(--duration-fast) var(--ease);
}
.nav-btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: center;
  transition: transform var(--duration-base) var(--ease);
}
.nav-btn:hover { color: var(--text-primary); }
.nav-btn:hover::after { transform: scaleX(0.6); }
.nav-btn.active { color: var(--text-primary); border-bottom-color: transparent; }
.nav-btn.active::after { transform: scaleX(1); }

/* ── Sectors dropdown (mega-menu) ── */
.nav-dropdown { position: static; }
.nav-dropdown-trigger .caret { font-size: 0.7rem; margin-left: 0.15rem; opacity: 0.8; display: inline-block; transition: transform var(--duration-fast) var(--ease); }
.nav-dropdown.open .nav-dropdown-trigger .caret { transform: rotate(180deg); }
/* While open (but not the active route), show a soft highlight instead of the route underline. */
.nav-dropdown.open .nav-dropdown-trigger { color: var(--text-primary); }
.nav-dropdown.open .nav-dropdown-trigger:not(.active)::after { transform: scaleX(0); }
.nav-dropdown.open .nav-dropdown-trigger:not(.active) { background: rgba(255,255,255,0.06); border-radius: var(--radius-sm); }
.nav-dropdown-menu {
  display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 0.6rem;
  position: absolute; top: 100%; left: 50%; width: min(900px, calc(100vw - 3rem)); max-height: 60vh; overflow-y: auto;
  margin-top: 0.6rem;
  background: rgba(18,23,30,0.86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  padding: 1.1rem; box-shadow: var(--shadow-lg); z-index: 60;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-50%) translateY(-10px); transform-origin: top center;
  transition: opacity var(--duration-base) var(--ease), transform var(--duration-base) var(--ease), visibility var(--duration-base);
}
.nav-dropdown.open .nav-dropdown-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-dropdown-item {
  background: rgba(255,255,255,0.03); border: 1px solid transparent; color: var(--text-secondary); text-align: left;
  padding: 0.7rem 1.05rem; border-radius: var(--radius-md); cursor: pointer;
  font-size: 0.92rem; font-weight: 600; flex: 1 1 190px; max-width: 270px;
  display: flex; align-items: center; gap: 0.6rem;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}
.nav-dropdown-item:hover { color: var(--text-primary); background: rgba(74,158,255,0.14); border-color: var(--accent-border); transform: translateY(-1px); }
.nav-dropdown-item.active { color: #fff; background: var(--accent); }
.nav-dropdown-item .sector-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; transition: transform var(--duration-fast) var(--ease); }
.nav-dropdown-item:hover .sector-dot { transform: scale(1.25); }
.nav-dropdown-item .sector-name { flex: 1; }
.nav-dropdown-item .sector-count { color: var(--text-tertiary); font-size: 0.78rem; font-weight: 600; }
.nav-dropdown-item.active .sector-count { color: rgba(255,255,255,0.75); }

/* ── Help mode (annotation bubbles) ── */
body.help-mode [data-help] {
  position: relative; outline: 1px dashed var(--accent-border); border-radius: var(--radius-md); cursor: help;
  transition: background var(--duration-fast) var(--ease), outline-color var(--duration-fast) var(--ease);
}
body.help-mode [data-help]:hover { background: rgba(74,158,255,0.06); outline-color: var(--accent); }

/* Single floating tooltip, positioned via JS — avoids clipping inside overflow:hidden ancestors */
.help-tooltip {
  position: fixed; z-index: 300; max-width: 260px;
  background: rgba(10,14,20,0.97); color: var(--text-primary); font-size: 0.75rem; font-weight: 500;
  line-height: 1.45; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border); box-shadow: var(--shadow-md); pointer-events: none;
  opacity: 0; transform: translateY(-4px) scale(0.97); transform-origin: top left;
  transition: opacity var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.help-tooltip.visible { opacity: 1; transform: translateY(0) scale(1); }

/* ── Layout ── */
#app { flex: 1; max-width: 1340px; width: 100%; margin: 0 auto; padding: 1.5rem; margin-top: var(--mega-offset, 0px); transition: margin-top var(--duration-base) var(--ease); }
.view { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0.5rem 0 1rem; flex-wrap: wrap; }
.section-head h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.section-head .muted { color: var(--text-tertiary); font-size: 0.85rem; margin-right: auto; }
.section-head > div { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }

/* ── Stat cards ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 1.2rem 1.3rem; }
.stat .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.5px; }
.stat .l { font-size: 0.78rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 0.35rem; }
.stat .v.accent { color: var(--accent); }
.stat .v.green { color: var(--green); }
.stat .v.red { color: var(--red); }

/* ── Panels / charts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.panel {
  background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 1.2rem 1.3rem;
  transition: border-color var(--duration-base) var(--ease), box-shadow var(--duration-base) var(--ease), transform var(--duration-base) var(--ease);
  animation: panelIn var(--duration-slow) var(--ease) both;
}
.panel:hover { border-color: var(--border-default); box-shadow: var(--shadow-md); transform: translateY(-2px); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.grid-2 .panel:nth-child(1), .grid-3 .panel:nth-child(1) { animation-delay: 0ms; }
.grid-2 .panel:nth-child(2), .grid-3 .panel:nth-child(2) { animation-delay: 60ms; }
.grid-3 .panel:nth-child(3) { animation-delay: 120ms; }
.panel h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-secondary); transition: color var(--duration-fast) var(--ease); }
.panel:hover h3 { color: var(--text-primary); }
.chart-wrap { position: relative; height: 240px; }

/* ── Toolbar (filters) ── */
.toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.search {
  flex: 1; min-width: 220px; background: var(--bg-1); border: 1px solid var(--border-default);
  color: var(--text-primary); padding: 0.65rem 0.95rem; border-radius: var(--radius-sm); font-size: 0.9rem;
}
.search::placeholder { color: var(--text-tertiary); }
.search:focus { outline: none; border-color: var(--accent); }
.select {
  background: var(--bg-1); border: 1px solid var(--border-default); color: var(--text-primary);
  padding: 0.65rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.9rem; cursor: pointer;
}
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip {
  background: var(--bg-1); border: 1px solid var(--border-default); color: var(--text-secondary);
  padding: 0.45rem 0.8rem; border-radius: 999px; cursor: pointer; font-size: 0.82rem; font-weight: 600;
  transition: all 0.15s;
}
.chip:hover { color: var(--text-primary); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Cards (Task 3 — hero-number card system) ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.card {
  background: var(--bg-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5) var(--space-4); cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--space-2);
  transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.card:hover { background: var(--bg-2); border-color: var(--border-default); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.card:active { transform: translateY(0); box-shadow: none; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; }
.card h4 { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.card .node { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: 500; margin-top: 0.1rem; }
.card-top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; flex: 0 0 auto; }
.card-date { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }
.card-divider { border-top: 1px solid var(--border-subtle); margin-top: var(--space-2); }
.card-hero { font-size: var(--text-3xl); font-weight: 800; font-variant-numeric: tabular-nums; font-family: var(--font-mono); color: var(--text-primary); line-height: 1; margin: var(--space-4) 0 var(--space-2); }
.card-facts { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-secondary); }
.card-facts b { color: var(--text-primary); font-weight: 700; }
.card-meta-line { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta-line.italic { font-style: italic; color: var(--text-secondary); }
.card-gc { font-size: 0.78rem; font-style: italic; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-news-bubble { position: absolute; top: var(--space-3); left: var(--space-3); background: var(--amber-dim); color: var(--amber); font-size: var(--text-xs); font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); }
.conf-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.card-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin-top: auto; }
.tag { font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.55rem; border-radius: 6px; letter-spacing: 0.3px; }
.tag.ac { background: rgba(74,158,255,0.14); color: var(--accent); }
.tag.th { background: rgba(155,127,224,0.16); color: var(--purple); }

/* status dot + badge (Task 7 — unified badge system) */
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 var(--space-2);
  border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.3px; white-space: nowrap;
}
.badge-closed       { background: var(--green-dim); color: var(--green); }
.badge-market       { background: var(--amber-dim); color: var(--amber); }
.badge-distress     { background: var(--red-dim);   color: var(--red); }
.badge-procurement  { background: var(--blue-dim);  color: var(--blue); }
.badge-construction { background: var(--blue-dim);  color: var(--blue); }
.badge-watch        { background: rgba(90,112,128,0.15); color: var(--text-secondary); }

/* legacy aliases — old s-* badge classes map onto the new system */
.s-green  { background: var(--green-dim); color: var(--green); }
.s-amber  { background: var(--amber-dim); color: var(--amber); }
.s-red    { background: var(--red-dim);   color: var(--red); }
.s-blue   { background: var(--blue-dim);  color: var(--blue); }
.s-gray   { background: rgba(90,112,128,0.15); color: var(--text-secondary); }

/* Sector tags (Task 7) — colour driven by SECTOR_COLORS via inline style */
.tag-sector {
  display: inline-flex; align-items: center; height: 20px; padding: 0 var(--space-2);
  border-radius: var(--radius-full); font-size: 10px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
}

.score { font-size: var(--text-xs); font-weight: 800; color: var(--text-tertiary); }
.score b { color: var(--amber); }

/* ── Map ── */
/* Leaflet panes use z-index up to 700 internally; pin the map to its own low
   stacking context so those panes can never paint above the drawer/overlay. */
#map, #class-map, #geo-map, #drawer-map { position: relative; z-index: 0; }
#map { height: 620px; border-radius: var(--radius-lg); border: 1px solid var(--border-default); overflow: hidden; }
.map-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.leaflet-popup-content-wrapper { background: var(--bg-2); color: var(--text-primary); border-radius: var(--radius-sm); }
.leaflet-popup-tip { background: var(--bg-2); }
.leaflet-popup-content { margin: 0.8rem 1rem; font-family: var(--font); }
.pop h5 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.pop p { font-size: 0.8rem; color: var(--text-secondary); margin: 0.12rem 0; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; padding: 0.85rem 1rem; background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); font-size: 0.82rem; color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* ── Drawer (Task 6 — editorial slide-in) ── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: var(--z-drawer);
  display: flex; justify-content: flex-end; transition: background var(--duration-base) var(--ease); pointer-events: none;
}
.drawer-overlay[hidden] { display: flex; }
.drawer-overlay:not([hidden]) { background: rgba(0,0,0,0.6); pointer-events: all; }
.drawer {
  width: min(560px, 95vw); background: var(--bg-1); border-left: 1px solid var(--border-default);
  height: 100vh; display: flex; flex-direction: column; box-shadow: var(--shadow-drawer);
  transform: translateX(100%); transition: transform var(--duration-slow) var(--ease); overflow: hidden;
}
.drawer-overlay:not([hidden]) .drawer { transform: translateX(0); }
.drawer-header {
  flex-shrink: 0; padding: var(--space-6) var(--space-6) var(--space-4);
  padding-right: calc(var(--space-6) + 28px + var(--space-2));
  border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: flex-start;
  background: var(--bg-1); position: relative; gap: 0.8rem;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 1.2rem 1.4rem; }
.drawer-title-block { flex: 1; min-width: 0; }
.drawer-close {
  position: absolute; top: var(--space-6); right: var(--space-6); width: 28px; height: 28px;
  background: var(--bg-2); border: none; border-radius: var(--radius-sm); color: var(--text-tertiary);
  font-size: 1.1rem; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: all var(--duration-fast) var(--ease);
}
.drawer-close:hover { background: var(--bg-3); color: var(--text-primary); }
.drawer-title-block h3 { font-size: var(--text-xl); font-weight: 800; color: var(--text-primary); margin: 0 0 var(--space-2); }
#drawer-subtitle { color: var(--text-tertiary); font-size: var(--text-sm); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: var(--space-3); }
#drawer-export { font-size: 0.78rem; color: var(--accent); background: none; border: none; cursor: pointer; font-weight: 700; white-space: nowrap; padding: 0.3rem 0; }
#drawer-export:hover { text-decoration: underline; }
.d-image { margin: 0 0 1.1rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-default); }
.d-image img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
#drawer-map { height: 220px; border-radius: var(--radius-lg); border: 1px solid var(--border-default); overflow: hidden; }
.d-grid, .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-6); margin: 0; }
.d-grid .k, .stats-grid .k { font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.3px; }
.d-grid .val, .stats-grid .val { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.d-grid .val.big, .stats-grid .val.big { font-size: var(--text-lg); font-weight: 700; }
.d-block { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); }
.d-block:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* ── Command Palette ─────────────────────────────────────────────────────── */
#palette-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: var(--z-modal);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 15vh;
  pointer-events: none; transition: background var(--duration-base) var(--ease);
}
#palette-overlay[hidden] { display: flex; }
#palette-overlay:not([hidden]) { background: rgba(0,0,0,0.72); pointer-events: all; }
#palette-panel {
  width: min(560px, 90vw); background: var(--bg-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  overflow: hidden; display: flex; flex-direction: column;
  transform: translateY(-10px); opacity: 0;
  transition: transform var(--duration-base) var(--ease), opacity var(--duration-base) var(--ease);
}
#palette-overlay:not([hidden]) #palette-panel { transform: translateY(0); opacity: 1; }
#palette-input {
  width: 100%; padding: 0.85rem 1.1rem; font-size: 0.97rem;
  background: transparent; border: none; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary); outline: none; font-family: inherit;
}
#palette-input::placeholder { color: var(--text-tertiary); }
#palette-results { max-height: 352px; overflow-y: auto; }
.pal-item {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.52rem 1.1rem;
  cursor: pointer; border-bottom: 1px solid var(--border-subtle);
}
.pal-item:last-child { border-bottom: none; }
.pal-item.pal-active, .pal-item:hover { background: var(--bg-2); }
.pal-kind {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0; white-space: nowrap;
}
.pal-name {
  font-size: 0.84rem; font-weight: 500; color: var(--text-primary); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pal-sub {
  font-size: 0.71rem; color: var(--text-tertiary); flex-shrink: 0; white-space: nowrap;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis;
}
.pal-empty { padding: 0.9rem 1.1rem; color: var(--text-tertiary); font-size: 0.84rem; }
#palette-footer {
  padding: 0.38rem 1.1rem; font-size: 0.68rem; color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
}
.palette-trigger {
  font-size: 0.68rem; font-weight: 700; color: var(--text-tertiary);
  background: var(--bg-2); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); padding: 0.22rem 0.48rem; cursor: pointer;
  letter-spacing: 0.3px; transition: all var(--duration-fast) var(--ease); white-space: nowrap;
}
.palette-trigger:hover { color: var(--accent); border-color: var(--accent); }
.d-block h5 { font-size: var(--text-xs); font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: var(--space-3); }
.d-block p { font-size: 0.9rem; font-weight: 400; color: var(--text-secondary); line-height: 1.6; }
.signals { display: flex; flex-direction: column; gap: 0.55rem; }
.signal { background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; }
.signal .sk { font-size: 0.7rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.signal .sv { font-size: 0.88rem; color: var(--text-secondary); margin-top: 0.15rem; line-height: 1.45; }

/* ── Loading / empty ── */
.loading { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 5rem 0; color: var(--text-tertiary); }
.spinner { width: 38px; height: 38px; border: 3px solid var(--border-default); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 3rem 0; color: var(--text-tertiary); }
.error { background: rgba(224,86,86,0.1); border: 1px solid var(--red); color: var(--red); padding: 1rem 1.2rem; border-radius: var(--radius-lg); }

/* ── Micro-interactions and motion (Task 9) ── */
.content-fade { animation: contentFadeIn var(--duration-base) var(--ease); }
@keyframes contentFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

button, .card, .nav-btn, .pursuit-row, tr[data-id], .view-btn {
  transition: background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease);
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skeleton { background: linear-gradient(90deg, var(--bg-1) 25%, var(--bg-2) 50%, var(--bg-1) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Empty states (Task 10) ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-16) var(--space-8); text-align: center; gap: var(--space-4); }
.empty-icon { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--bg-2); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.empty-title { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); }
.empty-body { font-size: var(--text-sm); color: var(--text-tertiary); max-width: 320px; line-height: 1.6; }
.empty-action { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--accent-dim); color: var(--accent); border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 600; cursor: pointer; border: 1px solid var(--accent-border); transition: all var(--duration-fast) var(--ease); }
.empty-action:hover { background: var(--accent); color: white; }

/* ── Footer ── */
.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.5rem; border-top: 1px solid var(--border-default); color: var(--text-tertiary); font-size: 0.82rem; max-width: 1340px; width: 100%; margin: 0 auto; }

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: 1fr; }
  .nav { grid-column: 1; justify-content: center; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-menu { position: static; width: 100%; margin-top: 0.35rem; }
  .control-panel { flex-direction: column; align-items: stretch; }
  .ctrl-zone { width: 100%; }
  .ctrl-map { order: -1; }
}

/* ── Roster table (dense sortable view of all deals) ── */
.roster-wrap { overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--radius-lg); }
table.roster { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.roster thead th { background: var(--bg-1); color: var(--text-tertiary); text-align: left; padding: 0.7rem 0.8rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; white-space: nowrap; cursor: pointer; position: sticky; top: 0; user-select: none; }
.roster thead th:hover { color: var(--text-primary); }
.roster thead th.sorted { color: var(--accent); }
.roster thead th .arrow { font-size: 0.65rem; opacity: 0.8; }
.roster tbody td { padding: 0.7rem 0.8rem; border-top: 1px solid var(--border-default); vertical-align: top; color: var(--text-secondary); white-space: nowrap; }
.roster tbody tr { cursor: pointer; transition: background 0.12s; }
.roster tbody tr:hover { background: var(--bg-2); }
.roster .r-name { color: var(--text-primary); font-weight: 600; white-space: normal; }
.roster .r-addr { color: var(--text-tertiary); font-size: 0.78rem; white-space: normal; }
.roster .r-num { text-align: right; font-variant-numeric: tabular-nums; }
.roster .r-flag { color: var(--amber); margin-left: 0.35rem; cursor: help; }

/* ── News indicators + class-section groups ── */
.nav-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--amber); margin-left:6px; vertical-align:middle; box-shadow:0 0 0 2px rgba(224,162,58,0.25); }
.news-badge { position:absolute; top:-7px; right:-7px; min-width:20px; height:20px; padding:0 6px; border-radius:10px; background:var(--amber); color:#1a1205; font-size:0.72rem; font-weight:800; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 6px rgba(0,0,0,0.4); z-index:2; }
.news-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--amber); margin-left:6px; vertical-align:middle; }
.group-head { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.6px; color:var(--text-tertiary); font-weight:700; margin-top:2rem; padding-top:1rem; border-top:1px solid var(--border-default); margin-bottom:0.85rem; }
.group-head:first-child { margin-top:0.3rem; padding-top:0; border-top:none; }
.news-list { display:flex; flex-direction:column; gap:0.6rem; }
.news-item { background:var(--bg-1); border:1px solid var(--border-default); border-radius:var(--radius-sm); padding:0.7rem 0.85rem; }
.news-item.is-new { border-color:rgba(224,162,58,0.5); }
.news-top { display:flex; align-items:center; gap:0.5rem; margin-bottom:0.25rem; }
.news-date { font-size:0.78rem; color:var(--text-secondary); }
.news-new { font-size:0.62rem; font-weight:800; letter-spacing:0.5px; background:var(--amber); color:#1a1205; padding:0.1rem 0.35rem; border-radius:4px; }
.sentiment-dot { display:inline-block; width:8px; height:8px; border-radius:50%; flex:none; border:1px solid rgba(255,255,255,0.25); }
.news-head { font-size:0.9rem; font-weight:600; color:var(--text-primary); }
.news-sum { font-size:0.85rem; color:var(--text-secondary); margin-top:0.2rem; line-height:1.45; }
.news-src { font-size:0.78rem; color:var(--text-secondary); margin-top:0.3rem; }

/* ── News Hub feed ── */
.news-feed { display:flex; flex-direction:column; gap:0.7rem; }
.news-feed-item { background:var(--bg-1); border:1px solid var(--border-default); border-left:3px solid transparent; border-radius:var(--radius-sm); padding:0.85rem 1rem; }
.news-feed-item.is-new { border-left-color:var(--amber); }
.nf-top { display:flex; align-items:center; justify-content:space-between; gap:0.5rem; margin-bottom:0.35rem; }
.nf-top-left { display:flex; align-items:center; gap:0.5rem; }
.nf-prop { font-weight:700; color:var(--text-primary); margin-bottom:0.15rem; }
.nf-prop:hover { color:var(--accent); }
.nf-clamp { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* ── Drawer text wrapping ── */
.drawer-title-block h3, #drawer-subtitle, .d-block p, .d-grid .val, .news-sum, .news-head, .sub-firm { overflow-wrap: anywhere; word-break: break-word; }
.stats-block { background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 0.9rem 1rem; }
.stats-block h5 { color: var(--accent); }

/* ── Drawer: pursuit stage, contacts, notes ── */
.pursuit-stage-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.contact-mini-list { display: flex; flex-direction: column; gap: 0.35rem; }
.contact-mini { font-size: 0.85rem; color: var(--text-secondary); background: var(--bg-1); border: 1px solid var(--border-default); border-radius: 6px; padding: 0.45rem 0.65rem; }
.contact-mini b { color: var(--text-primary); }
.notes-textarea { width: 100%; min-height: 90px; background: var(--bg-1); border: 1px solid var(--border-default); color: var(--text-primary); border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; font-size: 0.88rem; font-family: var(--font); resize: vertical; }
.notes-textarea:focus { outline: none; border-color: var(--accent); }
.notes-ts { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 0.35rem; }
.subs { display: flex; flex-direction: column; gap: 0.4rem; }
.sub { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; padding: 0.45rem 0.65rem; background: var(--bg-1); border: 1px solid var(--border-default); border-radius: 6px; }
.sub-trade { color: var(--text-tertiary); }
.sub-firm { color: var(--text-primary); font-weight: 600; text-align: right; }
.subs-note { font-size: 0.8rem; color: var(--text-tertiary); font-style: italic; margin-top: -0.3rem; }
/* ── Control panel: filters / view / map zones ── */
.control-panel { display: flex; align-items: stretch; gap: 0.85rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.ctrl-zone {
  background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  padding: 0.7rem 0.9rem;
}
.ctrl-filters { flex: 1; min-width: 320px; }
.ctrl-view { flex: 0 0 auto; }
.ctrl-map { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; }
.ctrl-label { font-size: 0.68rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; margin-bottom: 0.5rem; }
.ctrl-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* ── View switcher (Task 2) ── */
.view-switcher { display: inline-flex; background: var(--bg-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.view-btn { padding: var(--space-1) var(--space-4); border-radius: 4px; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-secondary); cursor: pointer; transition: all var(--duration-fast) var(--ease); border: none; background: none; }
.view-btn.active { background: var(--bg-0); color: var(--text-primary); box-shadow: var(--shadow-sm); }
#sector-content { transition: opacity var(--duration-fast) var(--ease); }

/* ── Stat strip (Task 4) ── */
.stat-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; margin-bottom: var(--space-6); }
.stat-strip-item { position: relative; background: var(--bg-1); padding: var(--space-4) var(--space-5); overflow: hidden; transition: background var(--duration-fast) var(--ease); }
.stat-strip-item::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transform: scaleX(0); transform-origin: left; transition: transform var(--duration-base) var(--ease);
}
.stat-strip-item:hover { background: var(--bg-2); }
.stat-strip-item:hover::before { transform: scaleX(1); }
.stat-strip-item .value { font-size: var(--text-3xl); font-weight: 800; font-family: var(--font-mono); color: var(--text-primary); line-height: 1; transition: transform var(--duration-base) var(--ease); }
.stat-strip-item:hover .value { transform: translateY(-1px); }
.stat-strip-item .label { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-tertiary); margin-top: var(--space-1); transition: color var(--duration-fast) var(--ease); }
.stat-strip-item:hover .label { color: var(--text-secondary); }
@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }

/* ── Pursuit list (Task 4) ── */
.pursuit-list { display: flex; flex-direction: column; gap: 2px; }
.pursuit-row { display: grid; grid-template-columns: 48px 1fr auto auto; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--bg-1); border-radius: var(--radius-sm); cursor: pointer; transition: background var(--duration-fast) var(--ease); }
.pursuit-row:hover { background: var(--bg-2); }
.pursuit-score-pill { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 800; font-size: var(--text-base); }
.pursuit-score-pill.high { background: var(--green-dim); color: var(--green); }
.pursuit-score-pill.mid  { background: var(--amber-dim); color: var(--amber); }
.pursuit-score-pill.low  { background: var(--bg-2); color: var(--text-secondary); }
.pursuit-name { font-weight: 600; color: var(--text-primary); font-size: var(--text-sm); }
.pursuit-meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.pursuit-trigger { font-size: var(--text-xs); color: var(--text-tertiary); text-align: right; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-cols { display: grid; grid-template-columns: 60% 1fr; gap: var(--space-4); align-items: start; }
@media (max-width: 1000px) { .dashboard-cols { grid-template-columns: 1fr; } }

/* ── Sector table — dense list view (Task 5) ── */
.sector-table { width: 100%; border-collapse: collapse; }
.sector-table thead th { background: var(--bg-0); color: var(--text-tertiary); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: var(--space-3) var(--space-4); text-align: left; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--border-default); }
.sector-table thead th.r-num { text-align: right; }
.sector-table tbody tr { border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background var(--duration-fast) var(--ease); }
.sector-table tbody tr:nth-child(even) { background: var(--bg-0); }
.sector-table tbody tr:hover { background: var(--bg-2); }
.sector-table tbody td { padding: var(--space-3) var(--space-4); vertical-align: middle; font-size: var(--text-sm); color: var(--text-secondary); }
.sector-table .td-num { font-family: var(--font-mono); text-align: right; color: var(--text-primary); }
.sector-table .td-name { color: var(--text-primary); font-weight: 600; }
.sector-table .td-sub { color: var(--text-tertiary); font-size: var(--text-xs); font-weight: 400; margin-top: 2px; }
.sector-table .badge { height: 20px; font-size: 10px; }
.pursuit-score-sq { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-weight: 800; font-size: var(--text-xs); }
.pursuit-score-sq.high { background: var(--green-dim); color: var(--green); }
.pursuit-score-sq.mid  { background: var(--amber-dim); color: var(--amber); }
.pursuit-score-sq.low  { background: var(--bg-2); color: var(--text-secondary); }
.sparkline { vertical-align: middle; }
.ctrl-row .search { flex: 1; min-width: 200px; margin: 0; }
.ctrl-view .chips.seg { margin: 0; }
.btn-map {
  background: var(--bg-2); border: 1px solid var(--border-default); color: var(--text-primary);
  padding: 0.65rem 1rem; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.85rem; font-weight: 700; white-space: nowrap; transition: all 0.15s;
}
.btn-map:hover { border-color: var(--accent-border); }
.btn-map.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Sector dashboard: view toggle, intel panels, bars ── */
.view-toggle { margin-left: auto; }
.signal-pill { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.4px; padding: 0.25rem 0.6rem; border-radius: 6px; margin-top: 0.5rem; text-transform: uppercase; }
.signal-pill.green { background: rgba(63,185,107,0.16); color: var(--green); }
.signal-pill.amber { background: rgba(224,162,58,0.16); color: var(--amber); }
.radar-list { display: flex; flex-direction: column; gap: 0.5rem; }
.radar-item { background: var(--bg-1); border: 1px solid var(--border-default); border-left: 3px solid var(--accent); border-radius: 6px; padding: 0.5rem 0.7rem; transition: border-color 0.15s; }
.radar-item:hover { border-color: var(--accent-border); }
.radar-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.radar-top .tag { flex: 0 0 auto; }
.radar-top .radar-name { flex: 1; }
.radar-top .score { flex: 0 0 auto; }
.radar-name { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.radar-meta { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 0.15rem; }

/* ── Overview: hero pulse grid (Task 8) ── */
.pulse-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-8);
}
@media (min-width: 900px) { .pulse-grid { grid-template-columns: repeat(6, 1fr); } }
.pulse-item {
  position: relative; background: var(--bg-1); padding: var(--space-6) var(--space-5);
  transition: background var(--duration-fast) var(--ease); cursor: default; overflow: hidden;
}
.pulse-item::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transform: scaleX(0); transform-origin: left; transition: transform var(--duration-base) var(--ease);
}
.pulse-item:hover { background: var(--bg-2); }
.pulse-item:hover::before { transform: scaleX(1); }
.pulse-value { font-size: var(--text-4xl); font-weight: 800; font-family: var(--font-mono); color: var(--text-primary); line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform var(--duration-base) var(--ease); }
.pulse-value.text { font-size: var(--text-lg); font-family: inherit; text-transform: none; letter-spacing: normal; }
.pulse-item:hover .pulse-value { transform: translateY(-1px); }
.pulse-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-tertiary); margin-top: var(--space-2); transition: color var(--duration-fast) var(--ease); }
.pulse-item:hover .pulse-label { color: var(--text-secondary); }
.pulse-sub { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Overview: charts row, panel footer ── */
.charts-row .chart-wrap { height: 220px; }

/* ── Overview: status breakdown (replaces donut) ── */
.status-breakdown { display: flex; flex-direction: column; height: 220px; justify-content: center; gap: 1.1rem; }
.status-bar { display: flex; height: 12px; border-radius: var(--radius-full); overflow: hidden; background: var(--bg-2); }
.status-bar-seg {
  height: 100%; min-width: 3px; flex: 0 0 auto; transform: scaleX(0); transform-origin: left;
  animation: statusGrow var(--duration-slow) var(--ease) both;
  transition: opacity var(--duration-fast) var(--ease), filter var(--duration-fast) var(--ease);
}
@keyframes statusGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.status-bar-seg:hover { filter: brightness(1.25); }
.status-legend { display: flex; flex-direction: column; gap: 0.5rem; }
.status-legend-row {
  display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; padding: 0.2rem 0.3rem; border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.status-legend-row:hover { background: var(--bg-2); }
.status-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; transition: transform var(--duration-fast) var(--ease); }
.status-legend-row:hover .status-legend-dot { transform: scale(1.25); }
.status-legend-label { flex: 1; color: var(--text-secondary); }
.status-legend-count { font-family: var(--font-mono); font-weight: 700; color: var(--text-primary); min-width: 26px; text-align: right; }
.status-legend-pct { font-size: 0.75rem; color: var(--text-tertiary); min-width: 42px; text-align: right; }
.panel-footer { display: flex; justify-content: flex-end; margin-top: 0.85rem; }
.news-list .news-item[data-rid] { cursor: pointer; transition: border-color 0.15s; }
.news-list .news-item[data-rid]:hover { border-color: var(--accent-border); }
.intel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.bar-list { display: flex; flex-direction: column; gap: 0.55rem; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 0.6rem; align-items: center; font-size: 0.82rem; }
.bar-row .bl-label { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--bg-2); border-radius: 4px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bar-row .bl-val { text-align: right; color: var(--text-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-empty { color: var(--text-tertiary); font-size: 0.85rem; font-style: italic; }
.big-metric { font-size: 2rem; font-weight: 800; color: var(--accent); display: flex; align-items: baseline; gap: 0.5rem; }
.big-metric .unit { font-size: 0.78rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px; }
.metric-sub { font-size: 0.82rem; color: var(--text-tertiary); margin-top: 0.4rem; }
.stack-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; border: 1px solid var(--border-default); }
.stack-seg { height: 100%; }
.stack-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.65rem; font-size: 0.78rem; color: var(--text-secondary); }
.stack-legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 0.35rem; vertical-align: middle; }
.disp-list { display: flex; flex-direction: column; gap: 0.45rem; }
.disp-item { display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.85rem; padding: 0.45rem 0.65rem; background: var(--bg-1); border: 1px solid var(--border-default); border-radius: 6px; }
.disp-name { color: var(--text-primary); font-weight: 600; }
.disp-meta { color: var(--text-tertiary); white-space: nowrap; }
#class-map { height: 560px; border-radius: var(--radius-lg); border: 1px solid var(--border-default); overflow: hidden; }

/* leaflet tooltip themed (hover label, replaces popup) */
.leaflet-tooltip { background: var(--bg-2); border: 1px solid var(--border-default); color: var(--text-primary); font-family: var(--font); font-size: 0.8rem; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }

/* ── News hub ── */
.news-head-row { align-items: center; }
.btn { background: var(--bg-2); border: 1px solid var(--border-default); color: var(--text-primary); padding: 0.55rem 1rem; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; font-weight: 700; white-space: nowrap; transition: all 0.15s; }
.btn:hover { border-color: var(--accent-border); }
.btn:disabled { opacity: 0.6; cursor: default; }
.news-filter-row { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
.news-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.news-sort { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--text-tertiary); }
.news-sort .select { margin: 0; }
.tag.cat { background: rgba(155,127,224,0.16); color: var(--purple); }
.tag.loc { background: rgba(159,176,192,0.16); color: var(--text-secondary); }
.nf-top { align-items: flex-start; }
.nf-top-right { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.nf-bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.4rem; flex-wrap: wrap; }
.nf-link { color: var(--accent); text-decoration: none; }
.nf-link:hover { text-decoration: underline; }
.news-feed-item:not(.is-new) .news-date { color: var(--text-secondary); }
.news-feed-item .nf-prop { font-weight: 700; color: var(--accent); cursor: pointer; margin-bottom: 0; }
.news-feed-item .nf-prop:hover { text-decoration: underline; }
.empty a { color: var(--accent); }

/* ── Learn ── */
.legis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; }
.legis-card { background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 1rem 1.1rem; }
.legis-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.4rem; }
.legis-bill { font-size: 0.78rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; }
.legis-status { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.4px; padding: 0.2rem 0.55rem; border-radius: 6px; text-transform: uppercase; }
.legis-status.in-force { background: rgba(63,185,107,0.16); color: var(--green); }
.legis-status.amended { background: rgba(74,158,255,0.14); color: var(--accent); }
.legis-status.proposed { background: rgba(224,162,58,0.16); color: var(--amber); }
.legis-status.repealed { background: rgba(224,86,86,0.14); color: var(--red); }
.legis-status.passed { background: rgba(63,185,107,0.16); color: var(--green); }
.legis-name { font-size: 1.02rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.35rem; }
.legis-summary { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 0.6rem; }
.legis-card hr { border: none; border-top: 1px solid var(--border-default); margin: 0.6rem 0; }
.legis-card details { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.legis-card summary { cursor: pointer; font-weight: 700; color: var(--text-primary); font-size: 0.8rem; }
.legis-card ul { margin: 0.5rem 0 0 1.1rem; padding: 0; }
.legis-card li { margin-bottom: 0.25rem; }
.legis-impact { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.3rem; }
.legis-impact b { color: var(--text-primary); }
.legis-source { margin-top: 0.6rem; }
.legis-source a { color: var(--accent); text-decoration: none; font-size: 0.82rem; }
.legis-source a:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .legis-grid { grid-template-columns: 1fr; }
}
.leaflet-tooltip-top::before { border-top-color: var(--bg-2); }

/* ── Modal (Contacts add/edit, Task 2) ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-lg); width: min(560px, 92vw); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border-default); position: sticky; top: 0; background: var(--bg-1); }
.modal-head h3 { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.modal-body { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1rem 1.2rem; border-top: 1px solid var(--border-default); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.form-grid label, .form-block { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.72rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.3px; }
.form-grid input, .form-grid select, .form-block input, .form-block textarea {
  background: var(--bg-1); border: 1px solid var(--border-default); color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem; font-size: 0.88rem; font-weight: 400; text-transform: none; letter-spacing: normal; font-family: var(--font);
}
.form-grid input:focus, .form-grid select:focus, .form-block input:focus, .form-block textarea:focus { outline: none; border-color: var(--accent); }
.form-block textarea { min-height: 70px; resize: vertical; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-sm { background: var(--bg-2); border: 1px solid var(--border-default); color: var(--text-secondary); padding: 0.25rem 0.55rem; border-radius: 6px; font-size: 0.75rem; cursor: pointer; font-weight: 700; }
.btn-sm:hover { color: var(--text-primary); border-color: var(--accent-border); }
.link-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.4rem; }
.link-chip { background: var(--bg-2); border: 1px solid var(--border-default); border-radius: 6px; padding: 0.2rem 0.5rem; font-size: 0.8rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.3rem; }
.link-chip button { background: none; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 0.85rem; line-height: 1; }
.link-result { padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.85rem; border-radius: 6px; color: var(--text-secondary); }
.link-result:hover { background: var(--bg-2); color: var(--text-primary); }
#cm-link-results { max-height: 140px; overflow-y: auto; }

/* ── Contacts table (Task 2) ── */
.rel-pill { font-size: 0.75rem; font-weight: 700; border: 1px solid; border-radius: 999px; padding: 0.15rem 0.55rem; }
.contact-expand td { background: var(--bg-1); padding: 0.7rem 0.8rem; font-size: 0.85rem; color: var(--text-secondary); }

/* ── Pursuit Board / Funnel (Task 3) ── */
.funnel-board { display: flex; gap: 0.8rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1.5rem; }
.funnel-col { flex: 0 0 230px; background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 0.7rem; }
.funnel-col-head { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); display: flex; justify-content: space-between; margin-bottom: 0.6rem; }
.funnel-col-body { display: flex; flex-direction: column; gap: 0.5rem; max-height: 520px; overflow-y: auto; }
.funnel-card { background: var(--bg-1); border: 1px solid var(--border-default); border-radius: 6px; padding: 0.55rem 0.65rem; cursor: pointer; transition: border-color 0.15s; }
.funnel-card:hover { border-color: var(--accent-border); }
.funnel-card-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.2rem; line-height: 1.25; }
.funnel-card-meta { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.2rem; flex-wrap: wrap; }
.funnel-card-meta .score { font-size: 0.75rem; color: var(--text-secondary); }
.funnel-card-actions { display: flex; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.funnel-untracked-card { display: flex; flex-direction: column; gap: 0.5rem; }
.funnel-untracked-card .btn { align-self: flex-start; }

/* ── Procurement Calendar (Task 4) ── */
.cal-timeline { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.5rem; }
.cal-event { display: flex; gap: 0.9rem; align-items: baseline; background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; cursor: pointer; transition: border-color 0.15s; }
.cal-event:hover { border-color: var(--accent-border); }
.cal-event-date { font-size: 0.78rem; font-weight: 700; color: var(--text-tertiary); white-space: nowrap; min-width: 80px; font-variant-numeric: tabular-nums; }
.cal-event-body { font-size: 0.88rem; color: var(--text-secondary); }
.cal-event-body .tag { margin-right: 0.4rem; }
/* Calendar month grid */
.cal-month-nav { display:flex; align-items:center; justify-content:space-between; padding:var(--space-2) 0 var(--space-3); }
.cal-month-title { font-size:1.1rem; font-weight:600; color:var(--text-primary); }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; background:var(--border-subtle); border:1px solid var(--border-subtle); border-radius:var(--radius-md); overflow:hidden; margin-bottom:var(--space-4); }
.cal-dow { background:var(--bg-2); padding:0.35rem 0.5rem; font-size:0.68rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-tertiary); font-weight:600; }
.cal-day { background:var(--bg-1); padding:0.4rem 0.5rem; min-height:5.5rem; cursor:pointer; transition:background 0.12s; }
.cal-day:hover { background:var(--bg-hover); }
.cal-day-filler { background:var(--bg-2); min-height:5.5rem; }
.cal-day-num { font-size:0.78rem; font-weight:600; color:var(--text-secondary); margin-bottom:0.3rem; }
.cal-today .cal-day-num { color:var(--accent); font-weight:800; }
.cal-day-selected { background:var(--bg-3) !important; outline:2px solid var(--accent); outline-offset:-2px; }
.cal-pill { font-size:0.6rem; padding:0.08rem 0.3rem; border-radius:2px; color:#fff; margin-bottom:0.15rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-pill-more { font-size:0.6rem; color:var(--text-tertiary); padding:0 0.3rem; }
.cal-day-detail-panel { background:var(--bg-2); border:1px solid var(--border-subtle); border-radius:var(--radius-md); padding:var(--space-3) var(--space-4); margin-bottom:var(--space-4); }
.cal-detail-event { display:flex; align-items:center; gap:0.5rem; padding:0.45rem 0; border-bottom:1px solid var(--border-subtle); flex-wrap:wrap; }
.cal-detail-event:last-child { border-bottom:none; }
.cal-detail-time { font-size:var(--text-sm); color:var(--text-tertiary); }
.cal-detail-label { font-size:var(--text-sm); color:var(--text-primary); flex:1; min-width:120px; }
.cal-detail-link { font-size:var(--text-sm); color:var(--accent); cursor:pointer; }
.cal-detail-link:hover { text-decoration:underline; }
.cal-ics-btn { font-size:0.65rem; padding:0.1rem 0.4rem; margin-left:auto; flex-shrink:0; }
.cal-month-body { display: flex; gap: var(--space-4); align-items: start; }
.cal-month-body .cal-grid { flex: 1; min-width: 0; margin-bottom: 0; }
.cal-sidebar { width: 220px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-3); }
.cal-sidebar-head { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); margin-bottom: var(--space-3); }
.cal-sidebar-item { cursor: pointer; padding: 0.45rem var(--space-1); border-bottom: 1px solid var(--border-subtle); transition: background 0.1s; }
.cal-sidebar-item:last-child { border-bottom: none; }
.cal-sidebar-item:hover { background: var(--bg-hover); border-radius: 3px; }
.cal-sidebar-date { font-size: 0.62rem; color: var(--text-tertiary); margin-bottom: 3px; }
.cal-sidebar-label { font-size: var(--text-sm); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Authority Activity Tracker (Task 5) ── */
.auth-card { cursor: pointer; max-height: none; }
.auth-card.active { border-color: var(--accent-border); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ── Competitive Intelligence (Task 7) ── */
.comp-sector-row { display: grid; grid-template-columns: 160px 1fr; gap: 0.8rem; align-items: start; margin-bottom: 0.8rem; }
.comp-sector-label { font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; }
.comp-stack-wrap { display: flex; flex-direction: column; gap: 5px; }
.comp-stack { display: flex; height: 8px; border-radius: 3px; overflow: hidden; background: var(--bg-1); gap: 2px; }
.comp-seg { display: block; flex-shrink: 0; }
.comp-seg-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.comp-leg-item { display: flex; align-items: center; gap: 3px; font-size: 0.65rem; color: var(--text-secondary); }
.comp-leg-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.comp-leg-more { font-size: 0.65rem; color: var(--text-tertiary); }

/* ── Export Briefs (Task 8) ── */
.export-card { max-height: none; display: flex; flex-direction: column; gap: 0.5rem; }
.export-card .btn { align-self: flex-start; }

/* ── Pro Forma Calculator (Task 9) ── */
.proforma-disclaimer { background: rgba(224,162,58,0.1); border: 1px solid rgba(224,162,58,0.35); color: var(--amber); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; font-size: 0.82rem; margin-bottom: 1.25rem; }
.proforma-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.pf-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.7rem; }
.pf-field label { font-size: 0.72rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.3px; }
.pf-field input, .pf-field select { background: var(--bg-1); border: 1px solid var(--border-default); color: var(--text-primary); border-radius: var(--radius-sm); padding: 0.5rem 0.65rem; font-size: 0.88rem; font-family: var(--font); }
.pf-field input:focus, .pf-field select:focus { outline: none; border-color: var(--accent); }
.pf-row { display: flex; gap: 0.5rem; }
.pf-row input { flex: 1; }
.pf-row select { width: 80px; }
.pf-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
.pf-save-card { max-height: none; }
@media (max-width: 800px) {
  .proforma-grid { grid-template-columns: 1fr; }
}

/* ── Margin sweet-spot gauge (Pro Forma + Land Residual) ── */
.margin-gauge { margin-top: 1rem; }
.margin-gauge-track { position: relative; display: flex; height: 10px; border-radius: 6px; overflow: visible; }
.margin-gauge-zone { height: 100%; }
.margin-gauge-zone.red { background: rgba(224,86,86,0.35); border-radius: 6px 0 0 6px; }
.margin-gauge-zone.amber { background: rgba(224,162,58,0.35); }
.margin-gauge-zone.green { background: rgba(63,185,107,0.35); border-radius: 0 6px 6px 0; }
.margin-gauge-marker { position: absolute; top: -4px; width: 4px; height: 18px; background: var(--text-primary); border-radius: 2px; transform: translateX(-2px); box-shadow: 0 0 0 2px var(--bg-0); }
.margin-gauge-scale { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-tertiary); margin-top: 0.3rem; }
.margin-gauge-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.4rem; }
.margin-gauge-label b { color: var(--text-primary); }

/* ── Subcontractor Trade Directory (Task 10) ── */
.sub-card { max-height: none; display: flex; flex-direction: column; gap: 0.35rem; }

/* ── Theme toggle button ── */
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 0.5rem; }
.theme-toggle {
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: transparent; border: 1px solid var(--border-default); color: var(--text-tertiary);
  font-size: 0.9rem; cursor: pointer; line-height: 1; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--accent-border); transform: scale(1.08); }

/* ── Light mode: variable overrides ── */
body.light-mode {
  --bg-0: #eef0f4;
  --bg-1: #ffffff;
  --bg-2: #f4f6f9;
  --bg-3: #e8eaee;

  --surface: var(--bg-1);
  --surface-2: var(--bg-2);
  --surface-hover: var(--bg-2);
  --bg-hover: var(--bg-2);

  --border-subtle: rgba(0,0,0,0.06);
  --border-default: rgba(0,0,0,0.11);
  --border-strong: rgba(0,0,0,0.22);

  --text-primary: #111827;
  --text-secondary: #374151;
  --text-tertiary: #6b7280;
  --text-disabled: #9ca3af;
  --accent: #355dc5;

  --accent-dim: rgba(59,130,246,0.10);
  --accent-border: rgba(59,130,246,0.35);

  --green-dim: rgba(34,197,94,0.11);
  --amber-dim: rgba(245,158,11,0.11);
  --red-dim: rgba(239,68,68,0.11);
  --blue-dim: rgba(59,130,246,0.11);
  --purple-dim: rgba(168,85,247,0.11);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.14);
  --shadow-drawer: -8px 0 40px rgba(0,0,0,0.12);
}

/* ── Market Signal view ── */
.signal-read-panel { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.signal-read-grid { display: grid; grid-template-columns: auto auto 1fr; gap: var(--space-4); align-items: start; }
@media (max-width: 700px) { .signal-read-grid { grid-template-columns: 1fr 1fr; } .sr-narrative { grid-column: 1/-1; } }
.sr-stat { text-align: center; padding: var(--space-3) var(--space-4); background: var(--bg-2); border-radius: var(--radius-md); }
.sr-val { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; }
.sr-val.sr-neg { color: var(--amber); }
.sr-val.sr-pos { color: #22c55e; }
.sr-lbl { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 4px; }
.sr-narrative { background: var(--bg-2); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.sr-read-label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-2); }
.sr-narrative p { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; line-height: 1.65; }
.rfp-row { padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.rfp-row:last-child { border-bottom: none; }
.rfp-top { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: 6px; }
.rfp-title { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.rfp-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: 6px; }
.rfp-auth { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: 600; }
.rfp-date { font-size: var(--text-xs); color: var(--text-tertiary); }
.rfp-summary { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; margin-bottom: 6px; }
.rfp-dates { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-bottom: 6px; }
.rfp-date-item { display: flex; flex-direction: column; gap: 2px; }
.rfp-date-lbl { font-size: 0.65rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px; }
.rfp-date-highlight .rfp-date-lbl { color: var(--accent); }
.rfp-date-highlight { color: var(--text-primary); font-weight: 600; font-size: var(--text-xs); }
.rfp-model { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: 600; padding: 2px 6px; background: var(--bg-3); border-radius: 4px; }
.signal-method-note { background: var(--bg-2); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-5); }
.signal-method-note summary { font-size: var(--text-xs); color: var(--text-tertiary); cursor: pointer; user-select: none; }
.signal-method-note p { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.65; margin: var(--space-2) 0 0; }
.badge-green { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-blue  { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-default { background: var(--bg-3); color: var(--text-tertiary); }

/* ── Provenance components ── */
.conf-badge { display:inline-flex; align-items:center; gap:4px; font-size:var(--text-xs); font-weight:600; }
.conf-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.source-link { font-size:var(--text-xs); color:var(--text-tertiary); }
.source-link a { color:var(--accent); text-decoration:none; }
.source-link a:hover { text-decoration:underline; }
.provenance-footer { display:flex; align-items:center; gap:var(--space-3); flex-wrap:wrap; padding-top:var(--space-2); margin-top:var(--space-2); border-top:1px solid var(--border-subtle); }
.gaps-marker { font-size:var(--text-xs); color:var(--amber); cursor:help; }

/* ── Light mode: component overrides (hardcoded colours that can't use variables) ── */
body.light-mode html, body.light-mode { background: var(--bg-0); }

body.light-mode .topbar {
  background: rgba(255,255,255,0.88);
  border-bottom-color: rgba(0,0,0,0.09);
}
body.light-mode .nav-dropdown-menu {
  background: rgba(255,255,255,0.97);
  border-color: rgba(0,0,0,0.10);
}
body.light-mode .nav-dropdown.open .nav-dropdown-trigger:not(.active) {
  background: rgba(0,0,0,0.05);
}
body.light-mode .nav-dropdown-item:hover {
  background: rgba(59,130,246,0.08);
}
body.light-mode .help-tooltip {
  background: rgba(255,255,255,0.98);
  color: var(--text-primary);
  border-color: var(--accent-border);
}
body.light-mode .view-btn.active {
  background: #fff;
  color: var(--text-primary);
}
body.light-mode .leaflet-tooltip {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
body.light-mode .leaflet-tooltip-top::before { border-top-color: #fff; }
body.light-mode .leaflet-popup-content-wrapper { background: #fff; color: var(--text-primary); }
body.light-mode .leaflet-popup-tip { background: #fff; }
body.light-mode .modal-overlay { background: rgba(0,0,0,0.45); }
body.light-mode .brand-mark { box-shadow: 0 1px 0 rgba(255,255,255,0.32) inset, 0 3px 10px rgba(37,99,235,0.22); }
body.light-mode .news-badge { color: #1a1205; }

/* ── COMPANIES — Wave 2 ── */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-6);
}
.company-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: var(--space-4);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.company-card:hover { border-color: var(--accent); background: var(--surface-hover); }
.cc-sector-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: var(--space-3); gap: 1px; }
.cc-mix-seg { display: block; flex-shrink: 0; }
.cc-chevron { font-size: 0.85rem; color: var(--text-tertiary); flex-shrink: 0; margin-top: 2px; transition: color 0.15s; }
.company-card:hover .cc-chevron { color: var(--accent); }
.company-card-name { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-2); }
.company-card-stats { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cc-stat { display: flex; flex-direction: column; align-items: center; min-width: 48px; }
.cc-val { font-size: var(--text-sm); font-weight: 700; color: var(--accent); line-height: 1.2; }
.cc-lbl { font-size: var(--text-xs); color: var(--text-tertiary); line-height: 1.2; }

/* Company profile — stat strip */
.stat-strip {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  padding: var(--space-4) var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}
.ss-item { display: flex; flex-direction: column; align-items: flex-start; }
.ss-val { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.ss-lbl { font-size: var(--text-xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }

/* Workforce timeline rows */
.wf-list { display: flex; flex-direction: column; gap: 0; }
.wf-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s;
}
.wf-row:last-child { border-bottom: none; }
.wf-row:hover { background: var(--surface-hover); }
.wf-project { font-size: var(--text-sm); color: var(--text-primary); font-weight: 500; }
.wf-dates { display: flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--text-secondary); white-space: nowrap; }
.wf-arrow { color: var(--text-tertiary); }
.wf-date-start { color: var(--text-tertiary); }
.wf-date-end.wf-past { color: var(--text-tertiary); text-decoration: line-through; }
.wf-date-end.wf-future { color: var(--accent); font-weight: 600; }
.wf-tbd { color: var(--amber); font-style: italic; }
.wf-value { font-size: var(--text-xs); color: var(--text-secondary); white-space: nowrap; min-width: 60px; text-align: right; }
.wf-status { min-width: 110px; }

/* Mini project cards grid */
.proj-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}
.proj-mini-card {
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color 0.15s;
}
.proj-mini-card:hover { border-color: var(--accent); }
.pmc-name { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-1); line-height: 1.3; }
.pmc-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); font-size: var(--text-xs); color: var(--text-secondary); }

/* Back button */
.back-btn {
  background: none; border: 1px solid var(--border-subtle); border-radius: 6px;
  color: var(--text-secondary); cursor: pointer; padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm); transition: border-color 0.12s, color 0.12s; white-space: nowrap;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Scope banner */
.scope-banner {
  display: flex; align-items: flex-start; gap: var(--space-2);
  margin: 0 var(--space-6) var(--space-4);
  padding: var(--space-2) var(--space-3);
  background: rgba(74,158,255,0.07);
  border: 1px solid rgba(74,158,255,0.2);
  border-radius: 6px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}
.scope-icon { color: var(--accent); flex-shrink: 0; margin-top: 1px; }

/* Company sector tags */
.company-sector-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--space-2); }
.company-sector-tag {
  font-size: 10px; font-weight: 600; padding: 1px 5px;
  border: 1px solid; border-radius: 3px; opacity: 0.85;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Company card value line */
.cc-value-line { font-size: 10px; color: var(--text-tertiary); margin-top: var(--space-1); }

/* Workforce section heads */
.wf-section-head {
  font-size: var(--text-xs); font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: var(--space-2) var(--space-4);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-subtle);
}
.wf-section-completed { color: var(--text-tertiary); opacity: 0.7; }
.wf-empty { padding: var(--space-3) var(--space-4); font-size: var(--text-sm); color: var(--text-tertiary); font-style: italic; }

/* JV and estimated markers */
.wf-jv-tag { font-size: 10px; color: var(--text-tertiary); margin-left: 6px; font-weight: 400; font-style: italic; }
.wf-est-tag { font-size: 10px; color: var(--amber); font-style: italic; }
.wf-jv-indicator { font-size: 10px; color: var(--text-tertiary); }
.pmc-jv { font-size: 10px; color: var(--text-tertiary); font-style: italic; }
.pmc-jv-partners { font-size: 10px; color: var(--text-tertiary); font-style: italic; }

/* Stat strip — JV and delivered variants */
.jv-shared-tag {
  display: inline-block; font-size: 9px; font-weight: 600; padding: 0 4px;
  background: rgba(74,158,255,0.15); color: var(--accent);
  border-radius: 3px; vertical-align: middle; margin-left: 3px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ss-val-muted { color: var(--text-tertiary) !important; }
.ss-lbl-muted { color: var(--text-tertiary) !important; opacity: 0.7; }

/* ── Update toast ── */
.intel-toast {
  position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--bg-3); border: 1px solid var(--border-default);
  color: var(--text-primary); padding: 0.65rem 1.25rem;
  border-radius: var(--radius); font-size: 0.85rem; font-weight: 600;
  z-index: var(--z-toast); opacity: 0; transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.intel-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Analytics + Intelligence new views ── */
.analytics-section { padding: var(--space-6); }

/* Pursuit priorities */
.pursuit-bar-row { display:flex; gap:1px; height:8px; margin:4px 0; border-radius:4px; overflow:hidden; }

/* Award cards */
.award-card { border-left: 3px solid var(--accent); }
.award-card details > summary { font-size: 0.8rem; color: var(--text-tertiary); cursor: pointer; user-select: none; }
.award-card details > summary:hover { color: var(--text-secondary); }

/* Design firms league table */
.design-league-table th { font-size: 0.72rem; }

/* Momentum table responsive */
.momentum-arrow-up   { color: #3fb96b; font-size: 1.3rem; font-weight: 800; }
.momentum-arrow-down { color: #e05656; font-size: 1.3rem; font-weight: 800; }
.momentum-arrow-flat { color: var(--text-tertiary); font-size: 1.3rem; font-weight: 800; }

/* Geographic side panel bar */
.geo-node-bar-wrap { height: 4px; background: var(--bg-3); border-radius: 2px; margin-top: 4px; }
.geo-node-bar-fill { height: 4px; background: var(--accent); border-radius: 2px; }

/* Model mix chart wrap */
.model-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); margin-bottom: var(--space-5); }
@media (max-width: 800px) { .model-chart-grid { grid-template-columns: 1fr; } }

/* Sector dot */
.sector-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ════════════════════════════════════════════════════════════════════════════
   VISUAL REDESIGN — RFP Cards + Sector Dashboard (2026-06-20)
   All values reference :root tokens — no hardcoded hex.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── PART 1: RFP Feed — card layout ───────────────────────────────────────── */

/* Feed containers: gap between cards instead of divider rows */
#rfp-feed, #rfpt-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
}

/* The card itself */
.rfp-card {
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-base) var(--ease),
              transform var(--duration-base) var(--ease);
}
.rfp-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Tier 1 — title row */
.rfp-card-primary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.rfp-card-title-wrap { flex: 1; min-width: 0; }
.rfp-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: var(--space-2);
}
.rfp-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.rfp-card-badge-wrap { flex-shrink: 0; }

/* Tier 2 — stat triplet */
.rfp-stat-grid {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.rfp-stat-block {
  flex: 1;
  min-width: 80px;
  padding-right: var(--space-4);
}
.rfp-stat-block + .rfp-stat-block {
  padding-left: var(--space-4);
  border-left: 1px solid var(--border-subtle);
}
.rfp-stat-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}
.rfp-stat-val {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.rfp-stat-block.is-highlight .rfp-stat-lbl { color: var(--accent); }
.rfp-stat-block.is-highlight .rfp-stat-val { color: var(--accent); }

/* Tier 3 — summary + provenance */
.rfp-card-summary {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}
.rfp-card .provenance-footer { padding-top: 0; }

/* ── PART 2: Sector Dashboard ─────────────────────────────────────────────── */

/* Stat strip — accent values so the hero numbers land immediately */
.stat-strip { box-shadow: var(--shadow-md); }
.stat-strip-item .value { color: var(--accent); }
.stat-strip-item:hover .value { color: var(--text-primary); }

/* Depth on the main dashboard panels */
.dashboard-cols > .panel { box-shadow: var(--shadow-sm); }

/* View-toggle (DASHBOARD / LIST / MAP) — accent active state */
.view-switcher { background: var(--bg-2); border-radius: var(--radius-sm); padding: 3px; display: flex; gap: 2px; }
.view-btn { border-radius: var(--radius-sm) !important; }
.view-btn.active {
  background: var(--accent-dim);
  color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent-border);
}

/* Pursuit tiles — proper card structure */
.pursuit-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.pursuit-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4);
  background: var(--bg-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-base) var(--ease),
              transform var(--duration-base) var(--ease);
}
.pursuit-row:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.pursuit-score-pill {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.pursuit-score-pill.high { background: var(--accent); color: #fff; }
.pursuit-score-pill.mid  { background: var(--amber-dim); color: var(--amber); }
.pursuit-score-pill.low  { background: var(--bg-3); color: var(--text-secondary); }
.pursuit-content { flex: 1; min-width: 0; }
.pursuit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.pursuit-name { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.pursuit-meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 3px; }
.pursuit-trigger { font-size: var(--text-xs); color: var(--text-tertiary); line-height: 1.4; margin-top: var(--space-2); }

/* ════════════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — Wave 1 Component Kit (2026-06-20)
   All rules use :root tokens only — no hardcoded hex.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Hero Panel ─────────────────────────────────────────────────────── */
.ds-hero-panel {
  background: var(--accent-surface);
  border: 1px solid var(--accent-surface-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 120px;
}
.ds-hero-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--accent);
  opacity: 0.85;
}
.ds-hero-value {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.ds-hero-interp {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: var(--space-1);
}

/* ── 2. Insight Line ───────────────────────────────────────────────────── */
.ds-insight-line {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-4);
}

/* ── 3. Metric Card ────────────────────────────────────────────────────── */
.ds-metric-card {
  background: var(--bg-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 120px;
}
.ds-mc-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
}
.ds-mc-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.ds-mc-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── 4. Pipeline Split Card ────────────────────────────────────────────── */
.ds-split-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  gap: 2px;
  margin: var(--space-2) 0;
}
.ds-split-seg { border-radius: var(--radius-full); transition: flex 0.3s var(--ease); }
.ds-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.ds-split-item { display: flex; align-items: center; gap: 5px; }
.ds-split-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── 5. Status Pill ────────────────────────────────────────────────────── */
.ds-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.6;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-pill-active    { background: var(--blue-dim);   color: var(--blue); }
.ds-pill-upcoming  { background: var(--amber-dim);  color: var(--amber); }
.ds-pill-done      { background: var(--green-dim);  color: var(--green); }
.ds-pill-market    { background: var(--amber-dim);  color: var(--amber); }
.ds-pill-distress  { background: var(--red-dim);    color: var(--red); }
.ds-pill-neutral   { background: var(--bg-3);       color: var(--text-secondary); }

/* ── 6. Score Chip ─────────────────────────────────────────────────────── */
.ds-score-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 800;
  flex-shrink: 0;
}
.ds-score-hot  { background: var(--accent); color: #fff; }
.ds-score-warm { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-border); }
.ds-score-dim  { background: var(--bg-3); color: var(--text-secondary); }
.ds-score-null { background: transparent; color: var(--text-disabled); font-size: var(--text-xs); }
.ds-td-sf      { color: var(--text-secondary); font-size: var(--text-xs); }
.ds-val-empty  { color: var(--text-disabled); }

/* ── 7. Magnitude Bar ──────────────────────────────────────────────────── */
.ds-mag-bar {
  height: 3px;
  background: var(--bg-3);
  border-radius: var(--radius-full);
  margin-top: 4px;
  overflow: hidden;
}
.ds-mag-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  opacity: 0.55;
  transition: width 0.3s var(--ease);
}

/* ── 8+9. Records Table ────────────────────────────────────────────────── */
.ds-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-5);
}
.ds-table-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
}
.ds-density-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.ds-density-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ds-density-btn {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.ds-density-btn:hover { border-color: var(--border-default); color: var(--text-primary); }
.ds-density-active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-border); }
.ds-reset-sort-btn { background: none; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 4px 10px; font-size: var(--text-xs); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 4px; }
.ds-reset-sort-btn:hover { border-color: var(--border-default); color: var(--text-primary); }

.ds-table {
  width: 100%;
  min-width: 600px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-1);
  box-shadow: var(--shadow-sm);
}
.ds-th {
  background: var(--bg-2);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
  transition: color var(--duration-fast) var(--ease);
  user-select: none;
}
.ds-th:hover { color: var(--text-primary); }
.ds-th-active { color: var(--accent); }
.ds-th-num { text-align: right; }

.ds-tr {
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.ds-tr:hover { background: var(--bg-2); }
.ds-tr + .ds-tr td { border-top: 1px solid var(--border-subtle); }

/* Medium density */
.ds-table-medium .ds-tr td { padding: var(--space-4) var(--space-4); vertical-align: middle; }
/* Dense density */
.ds-table-dense .ds-tr td { padding: 7px var(--space-3); vertical-align: middle; font-size: var(--text-xs); }
.ds-table-dense .ds-td-name { font-size: var(--text-sm); }

.ds-td-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--text-sm);
}
.ds-td-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 400;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-td-status { white-space: nowrap; }
.ds-td-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds-td-gc {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.ds-td-comp { color: var(--text-tertiary); }

/* ── Sector dashboard layout ───────────────────────────────────────────── */
.ds-sector-dash { display: flex; flex-direction: column; gap: var(--space-5); padding-top: var(--space-2); }
.ds-hero-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 900px) {
  .ds-hero-row { grid-template-columns: 1fr; }
}
.ds-bvb-panel { margin-top: 0; }

/* ── Wave 2: decline hero (amber/warning variant) ── */
.ds-hero-panel-decline .ds-hero-panel {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.28);
  height: 100%;
}
.ds-hero-panel-decline .ds-hero-label,
.ds-hero-panel-decline .ds-hero-value { color: var(--amber); }
/* Stretch the wrapper to fill the grid cell */
.ds-hero-panel-decline { display: flex; }

/* ── Wave 2: intelligence view wrapper ── */
.intel-view { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.intel-view .section-head { padding: 0; margin-bottom: var(--space-1); }
.intel-view .ds-insight-line { margin-bottom: 0; }

/* ══ Wave 3A: Analytics redesign ══════════════════════════════════════════ */

/* Shared panel surface (replaces inline styling) */
.intel-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}
.panel-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-tertiary);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

/* Chart panel container */
.ds-chart-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}
.ds-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
@media (max-width: 720px) { .ds-chart-grid { grid-template-columns: 1fr; } }

/* Momentum arrows */
.ds-momentum-up   { color: var(--green);          font-size: 1.15rem; font-weight: 800; }
.ds-momentum-down { color: var(--red);             font-size: 1.15rem; font-weight: 800; }
.ds-momentum-flat { color: var(--text-secondary);  font-size: 1.15rem; font-weight: 700; }

/* Geographic sidebar */
.ds-geo-sidebar {
  padding: var(--space-4);
  overflow-y: auto;
  background: var(--bg-2);
  border-left: 1px solid var(--border-default);
}
.ds-geo-node { margin-bottom: var(--space-3); }
.ds-geo-node-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-geo-node-sub { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.ds-geo-bar { height: 3px; background: var(--bg-3); border-radius: 2px; margin-top: 4px; }
.ds-geo-bar-fill { height: 3px; background: var(--accent); border-radius: 2px; }

/* Pursuit board cards */
.ds-pursuit-card {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.ds-pursuit-card:last-child { border-bottom: none; }
.ds-pursuit-card:hover { background: var(--bg-3); border-radius: var(--radius-sm); }
.ds-pursuit-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}
.ds-pursuit-score {
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 2.4rem;
  text-align: center;
  flex-shrink: 0;
}
.ds-pursuit-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-pursuit-bar {
  display: flex;
  gap: 1px;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  margin: var(--space-1) 0;
}
.ds-pursuit-seg { height: 100%; }
.ds-pursuit-meta {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.ds-pursuit-score-group { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; flex-shrink: 0; }
.ds-pursuit-score-label { font-size: 9px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; line-height: 1; }

/* ── Wave 4A: Gantt, Momentum, Awards, RFP, BD ── */

/* Gantt legend */
.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  margin-top: var(--space-1);
}
.gantt-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.gantt-legend-swatch {
  width: 14px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.gantt-legend-today {
  width: 2.5px;
  height: 14px;
  border-radius: 1px;
  background: #f59e0b;
  flex-shrink: 0;
}

/* Momentum — dim no-activity rows */
.ds-tr-dim { opacity: 0.45; }

/* Award LIVE treatment */
.award-live {
  border-left: 3px solid var(--accent) !important;
}
.award-live-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 5px;
  animation: awardLivePulse 2.5s ease-in-out infinite;
}
@keyframes awardLivePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.award-settled { opacity: 0.9; }

/* RFP card authority row — prominently above title */
.rfp-card-authority-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 3px;
}
.rfp-auth-prominent {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}
/* Near-term award highlight on stat block */
.rfp-stat-block.is-amber .rfp-stat-lbl { color: var(--amber); }
.rfp-stat-block.is-amber .rfp-stat-val { color: var(--amber); font-weight: 600; }

/* Nav dropdown section label separator */
.nav-dropdown-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  padding: var(--space-2) var(--space-3) var(--space-1);
  margin-top: var(--space-1);
  border-top: 1px solid var(--border-subtle);
}

/* Hero warning modifier (amber) — for Overview IO decline signal */
.ds-hero-panel.hero-warning .ds-hero-value { color: var(--amber); }
.ds-hero-panel.hero-warning { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.05); }

/* Overview market briefing */
.ov-sector-snapshot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.ov-snapshot-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.ov-snapshot-item:hover { background: var(--bg-3); }
.ov-snapshot-count { font-size: 0.88rem; font-weight: 800; line-height: 1; min-width: 14px; text-align: center; }
.ov-snapshot-name { color: var(--text-secondary); }
.ov-snapshot-val { color: var(--text-tertiary); }
.ov-snapshot-idle { opacity: 0.45; }
.ov-snapshot-divider {
  width: 100%; display: block;
  font-size: 11px; color: var(--text-tertiary);
  padding: 2px var(--space-1); margin: var(--space-1) 0 2px;
  letter-spacing: 0.04em;
}

/* Overview — Delta Ledger */
#app.overview-mode {
  max-width: 1536px;
  padding: clamp(20px, 2vw, 30px) clamp(24px, 3vw, 44px);
}
.overview-ledger { padding: 0; gap: 28px; }
.overview-ledger .ov-briefing-head { margin: 0; }
.overview-ledger .ov-briefing-head h2 { font-size: clamp(1.45rem, 2vw, 1.75rem); letter-spacing: -0.02em; }
.overview-ledger .update-intel-btn { min-width: 112px; background: var(--bg-1); }
.ov-kicker {
  color: var(--text-tertiary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.ov-summary-strip {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(230px, 0.82fr) minmax(540px, 1.9fr);
  min-height: 64px;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.ov-summary-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3) var(--space-6);
  border-right: 1px solid var(--border-default);
}
.ov-summary-stat strong { color: var(--accent); font-size: 1.55rem; line-height: 1; letter-spacing: -0.03em; }
.ov-summary-stat span,
.ov-confidence-legend span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ov-confidence-legend {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-3) var(--space-5);
}
.ov-confidence-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.ov-confidence-legend i,
.ov-confidence-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

.ov-signal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(330px, 0.95fr);
  align-items: stretch;
  border-bottom: 1px solid var(--border-default);
}
.ov-trend-panel { min-width: 0; padding: 2px var(--space-8) var(--space-6) var(--space-6); }
.ov-trend-heading { display: flex; justify-content: space-between; align-items: start; gap: var(--space-4); }
.ov-trend-delta { color: var(--red); font-size: 2.25rem; font-weight: 700; line-height: 1; margin-top: var(--space-3); letter-spacing: -0.04em; }
.ov-trend-neutral { color: var(--text-tertiary); font-family: var(--font); font-size: var(--text-lg); letter-spacing: 0; }
.ov-axis-head {
  display: flex;
  justify-content: space-between;
  margin: var(--space-3) 0 -8px;
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.ov-trend-chart { position: relative; height: 230px; }
.ov-trend-source,
.ov-insight-source {
  color: var(--text-tertiary);
  font-size: 0.7rem;
  line-height: 1.5;
}
.ov-trend-source { margin-top: var(--space-2); }
.ov-trend-source strong { color: var(--text-secondary); }
.ov-trend-source a,
.ov-insight-source a,
.ov-ledger-source-link { color: var(--accent); text-decoration: none; }
.ov-trend-source a:hover,
.ov-insight-source a:hover,
.ov-ledger-source-link:hover { text-decoration: underline; }
.ov-trend-empty { display: grid; place-items: center; min-height: 230px; color: var(--text-tertiary); font-size: var(--text-sm); }

.ov-insight-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-1) var(--space-5) var(--space-5) var(--space-6);
  border-left: 1px solid var(--border-default);
}
.ov-insight-panel p {
  max-width: 21ch;
  margin: var(--space-5) 0 var(--space-4);
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  font-style: italic;
  line-height: 1.38;
  letter-spacing: -0.018em;
}
.ov-insight-source { margin-top: auto; }

.ov-ledger-panel { border-top: 1px solid var(--border-default); }
.ov-ledger-heading { padding: var(--space-5) var(--space-6) var(--space-3); }
.ov-ledger-heading > div { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.ov-ledger-heading > div > span:last-child { color: var(--text-tertiary); font-size: 0.72rem; }
.ov-ledger-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ov-ledger-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ov-ledger-table th {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-tertiary);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
}
.ov-ledger-table th:nth-child(1) { width: 7%; }
.ov-ledger-table th:nth-child(2) { width: 7%; }
.ov-ledger-table th:nth-child(3) { width: 27%; }
.ov-ledger-table th:nth-child(4) { width: 17%; }
.ov-ledger-table th:nth-child(5) { width: 12%; }
.ov-ledger-table th:nth-child(6) { width: 30%; }
.ov-ledger-table td {
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.35;
  vertical-align: middle;
}
.ov-ledger-row { cursor: pointer; transition: background var(--duration-fast) var(--ease); }
.ov-ledger-row:hover { background: var(--bg-1); }
.ov-ledger-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ov-ledger-project { color: var(--text-primary) !important; font-weight: 600; }
.ov-layer-badge,
.ov-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
}
.ov-layer-deal { background: var(--accent-dim); color: var(--accent); }
.ov-layer-pipeline { background: var(--purple-dim); color: var(--purple); }
.ov-status-nearing { background: var(--amber-dim); color: var(--amber); }
.ov-confidence { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); font-size: 0.7rem; white-space: nowrap; }
.ov-confidence-null,
.ov-ledger-null,
.ov-ledger-source-missing { color: var(--text-tertiary); }
.ov-ledger-source { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.ov-ledger-source > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ov-ledger-source-link { font-size: 0.72rem; white-space: nowrap; }
.ov-ledger-source-missing { font-size: 0.68rem; white-space: nowrap; }
.ov-secondary-panel { margin-top: var(--space-2); }

@media (max-width: 1100px) {
  .ov-summary-strip { grid-template-columns: 1fr 1fr; }
  .ov-summary-stat:nth-child(2) { border-right: 0; }
  .ov-confidence-legend { grid-column: 1 / -1; border-top: 1px solid var(--border-default); }
  .ov-signal-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr); }
  .ov-trend-panel { padding-right: var(--space-5); }
  .ov-insight-panel { padding-left: var(--space-5); }
  .ov-insight-panel p { font-size: 1.55rem; }
  .ov-ledger-table th:nth-child(3) { width: 25%; }
  .ov-ledger-table th:nth-child(6) { width: 32%; }
}

@media (max-width: 820px) {
  #app.overview-mode { padding-inline: var(--space-5); }
  .overview-ledger { gap: var(--space-5); }
  .ov-signal-grid { grid-template-columns: 1fr; }
  .ov-trend-panel { padding: 0 0 var(--space-5); }
  .ov-insight-panel { padding: var(--space-5) 0; border-top: 1px solid var(--border-default); border-left: 0; }
  .ov-insight-panel p { max-width: 30ch; margin: var(--space-4) 0; }
  .ov-insight-source { margin-top: 0; }
  .ov-ledger-table td { font-size: 0.72rem; }
  .ov-ledger-source { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 720px) {
  .ov-summary-stat { padding: var(--space-3) var(--space-4); }
  .ov-confidence-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: start; }
  .ov-ledger-heading { padding-inline: 0; }
  .ov-ledger-scroll { overflow: visible; }
  .ov-ledger-table,
  .ov-ledger-table tbody { display: block; }
  .ov-ledger-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ov-ledger-table tbody { display: grid; gap: var(--space-3); }
  .ov-ledger-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
  }
  .ov-ledger-table td { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; border: 0; white-space: normal; }
  .ov-ledger-table td::before { content: attr(data-label); color: var(--text-tertiary); font-size: 0.61rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
  .ov-ledger-table td:nth-child(3),
  .ov-ledger-table td:nth-child(6) { grid-column: 1 / -1; }
  .ov-ledger-source { width: 100%; grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 480px) {
  #app.overview-mode { padding: 0.75rem; }
  .overview-ledger { gap: var(--space-5); }
  .overview-ledger .ov-briefing-head { align-items: center; }
  .overview-ledger .ov-briefing-head > div { display: block; }
  .overview-ledger .ov-briefing-head .muted { display: block; margin-top: 3px; }
  .overview-ledger .update-intel-btn { min-width: 0; padding-inline: var(--space-3); }
  .ov-summary-strip { display: block; }
  .ov-summary-stat { border-right: 0; border-bottom: 1px solid var(--border-default); }
  .ov-confidence-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; padding: var(--space-4); }
  .ov-trend-delta { font-size: 2rem; }
  .ov-trend-chart { height: 230px; }
  .ov-insight-panel p { font-size: 1.4rem; }
  .ov-ledger-table tr { grid-template-columns: 1fr; }
  .ov-ledger-table td:nth-child(3),
  .ov-ledger-table td:nth-child(6) { grid-column: auto; }
  .ov-ledger-source { grid-template-columns: 1fr; }
}

/* Learn section — content type tab row */
.legis-type-tabs {
  margin: var(--space-3) 0 0;
  padding: 0 0 var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

/* ── News split panel ────────────────────────────────────────────────── */
.news-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 860px) {
  .news-split { grid-template-columns: 1fr; }
}
.news-col { display: flex; flex-direction: column; gap: 0; }
.news-col-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0 var(--space-2);
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: var(--space-2);
}
.news-col-label {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.verified-label { color: var(--green); }
.chatter-label  { color: var(--amber); }
.news-col-hint  { font-size: var(--text-xs); color: var(--text-tertiary); }
.news-col-chatter .news-feed-item.is-chatter {
  border-left: 2px solid var(--amber);
  background: var(--bg-2);
  padding-left: var(--space-3);
}
.nf-chatter-disclaimer {
  font-size: 0.62rem;
  color: var(--amber);
  margin: var(--space-1) 0 0;
  font-style: italic;
}

/* ── Company cards — sector-colored top border + overflow pill ── */
.company-sector-overflow {
  border-color: var(--border-default) !important;
  color: var(--text-tertiary) !important;
  opacity: 1 !important;
}
.cc-val-lg { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); line-height: 1; }

/* ── Competitive Intelligence — leader cards ── */
.ci-leader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.ci-leader-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--space-3);
  cursor: default;
}
.ci-leader-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-leader-sectors { display: flex; gap: 4px; margin-bottom: var(--space-2); }
.ci-sector-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.ci-count-bar-wrap {
  height: 3px; background: var(--border-subtle); border-radius: 2px; margin-bottom: var(--space-2);
}
.ci-count-bar { height: 100%; background: var(--accent); border-radius: 2px; }
.ci-leader-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.ci-stat-big { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.ci-stat-lbl { font-size: var(--text-xs); color: var(--text-tertiary); }
.ci-stat-val { font-size: var(--text-xs); color: var(--text-secondary); margin-left: auto; }
.ci-thru-tag {
  font-size: 0.68rem; font-weight: 700; color: var(--green);
  background: rgba(63,185,107,0.1); border: 1px solid rgba(63,185,107,0.25);
  border-radius: 3px; padding: 1px 5px;
}

/* ── Competitive Intelligence — leaderboard (replaces ci-leader-grid cards) ── */
.ci-leaderboard { margin-top: var(--space-3); }
.ci-lb-head {
  display: grid;
  grid-template-columns: 12px 1fr 60px 100px 80px;
  gap: var(--space-2);
  padding: 0.3rem var(--space-2);
  border-bottom: 1px solid var(--border-default);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.ci-lb-head span:nth-child(n+3) { text-align: right; }
.ci-lb-row {
  display: grid;
  grid-template-columns: 12px 1fr 60px 100px 80px;
  align-items: start;
  gap: var(--space-2);
  padding: 0.5rem var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}
.ci-lb-row:hover { background: var(--bg-hover); }
.ci-lb-row-jv { opacity: 0.55; }
.ci-lb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; }
.ci-lb-firm { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); word-break: break-word; line-height: 1.35; }
.ci-lb-row-jv .ci-lb-firm { font-weight: 400; color: var(--text-secondary); }
.ci-lb-num { font-size: var(--text-sm); color: var(--text-secondary); text-align: right; font-variant-numeric: tabular-nums; padding-top: 2px; }
.ci-lb-badge { font-size: var(--text-xs); color: var(--text-tertiary); text-align: right; padding-top: 3px; }

/* ── Awards — live hero treatment ── */
.awards-live-panel { border-color: var(--accent); background: rgba(74,158,255,0.03); }
.award-live-hero {
  border: 1px solid rgba(74,158,255,0.3);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: rgba(74,158,255,0.04);
}
.award-live-hero-top { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.award-live-sector {
  font-size: 0.7rem; font-weight: 700; border-radius: 3px;
  padding: 1px 6px; letter-spacing: 0.04em;
}
.award-live-model { font-size: 0.72rem; color: var(--text-tertiary); font-weight: 600; }
.award-live-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: var(--space-2); line-height: 1.3;
}
.award-live-meta-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.award-live-value {
  font-size: 1rem; font-weight: 800; color: var(--accent);
}
.award-shortlist-grid { margin-top: var(--space-3); }
.award-shortlist-head {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-tertiary); margin-bottom: var(--space-3);
}
.award-teams-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.award-team-card {
  flex: 1; min-width: 180px;
  background: var(--bg-2); border: 1px solid var(--border-subtle);
  border-radius: 6px; padding: var(--space-3);
}
.award-team-label {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--accent); margin-bottom: var(--space-1);
}
.award-team-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.award-team-role { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 2px; }

/* ── Market Pulse hero (News Hub) ─────────────────────────────────────────── */
.pulse-hero-row {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.pulse-hero-headline { font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-2); }
.pulse-sent {
  display: inline-block;
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 3px; margin-right: 0.4rem;
}
.pulse-bullish  { background: rgba(74,198,119,0.18); color: var(--green); }
.pulse-cautious { background: rgba(242,153,74,0.18); color: var(--amber); }
.pulse-neutral, .pulse-mixed { background: var(--bg-3); color: var(--text-tertiary); }
.pulse-themes { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: var(--space-3); }
.pulse-theme { font-size: var(--text-sm); color: var(--text-secondary); }
.pulse-signal-line { font-size: var(--text-sm); color: var(--text-secondary); font-style: italic; border-top: 1px solid var(--border-subtle); padding-top: var(--space-2); margin-top: var(--space-2); }
.pulse-meta { font-size: 0.65rem; color: var(--text-tertiary); margin-top: var(--space-2); }

/* ── News card: related records strip ─────────────────────────────────────── */
.nf-related { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: var(--space-2) 0; }
.nf-rel-btn {
  font-size: 0.68rem; background: var(--bg-3); border: 1px solid var(--border-subtle);
  border-radius: 3px; padding: 0.15rem 0.4rem; color: var(--accent);
  cursor: pointer; white-space: nowrap;
}
.nf-rel-btn:hover { background: var(--bg-hover); }

@media (max-width: 480px) {

  /* Compact two-row shell: brand + controls, then the scrollable nav. */
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .brand { grid-column: 1; grid-row: 1; min-width: 0; gap: 0.6rem; }
  .brand-mark { flex-basis: 36px; width: 36px; height: 36px; padding: 0; font-size: 0.88rem; }
  .brand-text { min-width: 0; }
  .brand-text h1 { font-size: 1rem; white-space: nowrap; }
  .brand-text p { font-size: 0.68rem; white-space: nowrap; }
  .topbar-right { grid-column: 2; grid-row: 1; gap: 0.35rem; }

  /* Content container — reduce side padding on small screens */
  #app { padding: 0.75rem; margin-top: 0 !important; }

  /* Topbar — tighter padding */
  .topbar { padding: 0.6rem 0.85rem; gap: 0.5rem; }

  /* Nav — horizontal scroll strip instead of wrapping to multiple rows */
  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    padding-left: 0.5rem;
    gap: 0.4rem;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn,
  .nav-dropdown-trigger {
    font-size: 0.72rem;
    padding: 0.3rem 0.55rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .nav { position: relative; }
  .nav-dropdown { flex-shrink: 0; width: auto !important; }
  .nav-dropdown-menu {
    position: fixed;
    top: 90px;
    left: 0.75rem;
    width: calc(100vw - 1.5rem);
    margin-top: 0.4rem;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: var(--radius-md) !important;
    z-index: 999 !important;
    transform: translateY(-10px);
  }
  .nav-dropdown.open .nav-dropdown-menu { transform: translateY(0); }

  /* Hero numbers — scale down from 4xl to 2xl on phone */
  .ds-hero-value { font-size: var(--text-2xl) !important; }
  .ds-hero-panel { min-height: auto !important; padding: var(--space-4); }
  .ds-metric-card { min-height: auto !important; }
  .ds-hero-label { font-size: var(--text-xs); }
  .ds-hero-interp { font-size: var(--text-xs); }

  /* Sector snapshot chips — slightly smaller on phone */
  .ov-snapshot-item {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    gap: 0.25rem;
  }

  /* Awards team cards — 2-column on phone instead of 4-column */
  .award-teams-row { flex-wrap: wrap; }
  .award-team-card {
    min-width: calc(50% - 0.5rem);
    flex: 1 1 calc(50% - 0.5rem);
  }

  /* Drawer — full width on phone */
  .drawer { width: 100vw !important; }
  #drawer-map { height: 150px; }

  /* Design Firms — sidebar stacks above cards on phone */
  .cons-layout { flex-direction: column !important; }
  .cons-sidebar { width: 100% !important; }

}

/* ════════════════════════════════════════════════════════════════════════════
   STAGE 2 — DELTA LEDGER VIEW SHELL
   Shared, route-scoped presentation only. Overview retains its dedicated
   reference treatment above; interactions and data selectors remain intact.
   ═══════════════════════════════════════════════════════════════════════════ */

#app.delta-shell {
  --delta-gap: clamp(1rem, 1.6vw, 1.4rem);
  max-width: 1536px;
  padding: clamp(1.25rem, 2vw, 1.9rem) clamp(1.5rem, 3vw, 2.75rem);
}

#app.delta-shell > .view,
#app.delta-shell > .intel-view {
  display: flex;
  flex-direction: column;
  gap: var(--delta-gap);
  padding: 0;
}

/* Brief heads and evidence labels */
#app.delta-shell > .view > .section-head,
#app.delta-shell > .intel-view > .section-head,
#app.delta-shell > .intel-view > .view-header {
  align-items: flex-end;
  gap: var(--space-3) var(--space-5);
  margin: 0;
  padding: 0 0 var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

#app.delta-shell > .view > .section-head:first-child h2,
#app.delta-shell > .intel-view > .section-head:first-child h2,
#app.delta-shell .view-title {
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

#app.delta-shell > .view > .section-head .muted,
#app.delta-shell > .intel-view > .section-head .muted,
#app.delta-shell .view-subtitle {
  max-width: 78ch;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  line-height: 1.5;
}

#app.delta-shell .group-head,
#app.delta-shell .panel-label,
#app.delta-shell .ctrl-label,
#app.delta-shell .wf-section-head {
  color: var(--text-tertiary);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

#app.delta-shell .group-head {
  margin: var(--space-2) 0 calc(-1 * var(--space-2));
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-default);
}

/* Compact control rails */
#app.delta-shell .control-panel {
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

#app.delta-shell .ctrl-zone {
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border-default);
  border-radius: 0;
}

#app.delta-shell .ctrl-zone:last-child { border-right: 0; }
#app.delta-shell .ctrl-row { gap: var(--space-2); }
#app.delta-shell .search,
#app.delta-shell .select,
#app.delta-shell .filter-select,
#app.delta-shell .pf-field input,
#app.delta-shell .pf-field select {
  border-radius: 3px;
}

/* Summary strips */
#app.delta-shell .stats,
#app.delta-shell .stat-strip,
#app.delta-shell .ds-hero-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
  margin: 0;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

#app.delta-shell .delta-compact-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

#app.delta-shell .delta-summary-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
  min-height: 66px;
  padding: var(--space-3) var(--space-5);
  border-left: 1px solid var(--border-default);
}

#app.delta-shell .delta-summary-item:first-child { border-left: 0; }
#app.delta-shell .delta-summary-item strong {
  color: var(--accent);
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.035em;
}
#app.delta-shell .delta-summary-item span {
  color: var(--text-tertiary);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#app.delta-shell .stat,
#app.delta-shell .stat-strip-item,
#app.delta-shell .ds-hero-panel,
#app.delta-shell .ds-metric-card {
  min-height: 104px;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-1);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#app.delta-shell .stats > *,
#app.delta-shell .stat-strip > *,
#app.delta-shell .ds-hero-row > * {
  border-left: 1px solid var(--border-default);
}

#app.delta-shell .stats > :first-child,
#app.delta-shell .stat-strip > :first-child,
#app.delta-shell .ds-hero-row > :first-child { border-left: 0; }

#app.delta-shell .stat-strip-item::before { display: none; }
#app.delta-shell .stat-strip-item:hover,
#app.delta-shell .stat-strip-item:hover .value { background: var(--bg-1); color: var(--accent); transform: none; }
#app.delta-shell .stat .v,
#app.delta-shell .stat-strip-item .value,
#app.delta-shell .ds-hero-value,
#app.delta-shell .ds-mc-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}
#app.delta-shell .stat .v,
#app.delta-shell .stat-strip-item .value { font-size: clamp(1.45rem, 2vw, 1.85rem); }
#app.delta-shell .ds-hero-value { font-size: clamp(1.75rem, 2.4vw, 2.35rem); }
#app.delta-shell .ds-mc-value { font-size: clamp(1.35rem, 1.8vw, 1.7rem); }
#app.delta-shell .ds-hero-label,
#app.delta-shell .ds-mc-label,
#app.delta-shell .stat .l,
#app.delta-shell .stat-strip-item .label { font-size: 0.66rem; letter-spacing: 0.07em; }
#app.delta-shell .ds-hero-interp,
#app.delta-shell .ds-mc-sub { line-height: 1.45; }
#app.delta-shell .ds-hero-panel.hero-warning {
  background: var(--bg-1);
  border-color: var(--border-default);
}

/* Existing insight copy becomes the editorial half of the ledger. */
#app.delta-shell .ds-insight-line {
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
  margin: 0;
  padding: var(--space-5) 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  border-radius: 0;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: clamp(1.12rem, 1.5vw, 1.38rem);
  font-style: italic;
  line-height: 1.5;
}

#app.delta-shell .ds-insight-line::before,
#app[data-route="news"].delta-shell .pulse-hero-row::before {
  content: "What matters";
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

/* Evidence panels: thin rules, small radii, no ornamental lift. */
#app.delta-shell .panel,
#app.delta-shell .intel-panel,
#app.delta-shell .ds-chart-panel {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: none;
  animation: none;
}

#app.delta-shell .panel:hover,
#app.delta-shell .dashboard-cols > .panel {
  border-color: var(--border-default);
  box-shadow: none;
  transform: none;
}

#app.delta-shell .panel:hover h3 { color: var(--text-secondary); }
#app.delta-shell .panel h3 {
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

#app.delta-shell .ds-chart-grid,
#app.delta-shell .model-chart-grid,
#app.delta-shell .dashboard-cols { gap: var(--space-4); }
#app.delta-shell .chart-wrap { height: 225px; }

/* Ledger tables */
#app.delta-shell .roster-wrap,
#app.delta-shell .ds-table-wrap {
  overflow-x: auto;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

#app.delta-shell .ds-table-wrap .ds-table { border: 0; }
#app.delta-shell .roster thead th,
#app.delta-shell .sector-table thead th,
#app.delta-shell .ds-table .ds-th {
  padding: 9px var(--space-3);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-tertiary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

#app.delta-shell .roster tbody td,
#app.delta-shell .sector-table tbody td,
#app.delta-shell .ds-table .ds-tr td {
  padding: 10px var(--space-3);
  border-top: 0;
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

#app.delta-shell .roster tbody tr:last-child td,
#app.delta-shell .sector-table tbody tr:last-child td,
#app.delta-shell .ds-table .ds-tr:last-child td { border-bottom: 0; }
#app.delta-shell .sector-table tbody tr:nth-child(even) { background: transparent; }

/* Card collections retain their controls, but read as compact evidence units. */
#app.delta-shell .card,
#app.delta-shell .company-card,
#app.delta-shell .proj-mini-card,
#app.delta-shell .legis-card,
#app.delta-shell .rfp-card,
#app.delta-shell .award-team-card,
#app.delta-shell .ci-leader-card {
  border-color: var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

#app.delta-shell .card:hover,
#app.delta-shell .company-card:hover,
#app.delta-shell .proj-mini-card:hover,
#app.delta-shell .rfp-card:hover {
  box-shadow: none;
  transform: none;
}

#app.delta-shell .company-grid { padding: 0; }
#app.delta-shell .scope-banner,
#app.delta-shell .signal-method-note,
#app.delta-shell .provenance-footer {
  border-color: var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: none;
}
#app.delta-shell .scope-banner {
  margin: 0;
  background: var(--bg-1);
}
#app.delta-shell .signal-method-note {
  margin: 0;
  padding: var(--space-3) 0;
  background: transparent;
  border-width: 1px 0;
}

/* Sector routes — the records ledger is primary; pipeline health is evidence. */
#app[data-route-group="sector"] .ds-sector-dash { gap: var(--space-4); padding-top: 0; }
#app[data-route-group="sector"] .ds-table-controls { margin-bottom: var(--space-2); }
#app[data-route-group="sector"] .delta-sector-evidence .ds-metric-card {
  min-height: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route-group="sector"] .ds-bvb-panel { margin: 0; }
#app[data-route-group="sector"] .sector-visual-grid { align-items: stretch; }
#app[data-route-group="sector"] .sector-visual-grid .chart-wrap { height: 230px; }
.visual-scope-note {
  margin-top: var(--space-2);
  color: var(--text-tertiary);
  font-size: 0.68rem;
  line-height: 1.4;
}
.sector-visual-empty { display: flex; flex-direction: column; justify-content: center; min-height: 292px; }

/* Operations and BD ledgers */
#app[data-route="pursuit"] .pursuit-list { gap: 0; border: 1px solid var(--border-default); border-radius: var(--radius-sm); overflow: hidden; }
#app[data-route="pursuit"] .pursuit-row { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
#app[data-route="pursuit"] .pursuit-row:last-child { border-bottom: 0; }

#app[data-route="funnel"] .funnel-board {
  gap: 0;
  margin: 0;
  padding: 0;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="funnel"] .funnel-col {
  flex-basis: 224px;
  padding: var(--space-3);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border-default);
  border-radius: 0;
}
#app[data-route="funnel"] .funnel-col:first-child { border-left: 0; }
#app[data-route="funnel"] .funnel-col-body { gap: var(--space-2); }
#app[data-route="funnel"] .funnel-card { border-radius: 3px; }

#app[data-route="calendar"] .cal-event {
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
}
#app[data-route="calendar"] .cal-timeline { gap: 0; border: 1px solid var(--border-default); border-radius: var(--radius-sm); overflow: hidden; }
#app[data-route="calendar"] .cal-event:last-child { border-bottom: 0; }
#app[data-route="calendar"] .cal-grid,
#app[data-route="calendar"] .cal-sidebar,
#app[data-route="calendar"] .cal-day-detail-panel { border-radius: var(--radius-sm); }
#app[data-route="subtrades"] .sub-card { cursor: default; }
#app[data-route="export"] .export-card { cursor: default; }
#app[data-route="subtrades"] #sub-cards { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0; border: 1px solid var(--border-default); border-radius: var(--radius-sm); overflow: hidden; }
#app[data-route="subtrades"] .sub-card { border-width: 0 1px 1px 0; border-radius: 0; }
#app[data-route="subtrades"] .sub-ledger-kicker {
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
#app[data-route="export"] .export-card { min-height: 0; }

/* Calculators share one assumptions/results composition. */
#app[data-route="proforma"] .proforma-grid,
#app[data-route="landresidual"] .proforma-grid,
#app[data-route="caprate"] .proforma-grid {
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 0;
  margin: 0;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="proforma"] .proforma-grid > .panel,
#app[data-route="landresidual"] .proforma-grid > .panel,
#app[data-route="caprate"] .proforma-grid > .panel {
  border: 0;
  border-radius: 0;
}
#app[data-route="proforma"] .proforma-grid > .panel + .panel,
#app[data-route="landresidual"] .proforma-grid > .panel + .panel,
#app[data-route="caprate"] .proforma-grid > .panel + .panel { border-left: 1px solid var(--border-default); }
#app[data-route="proforma"] .proforma-disclaimer,
#app[data-route="landresidual"] .proforma-disclaimer,
#app[data-route="caprate"] .proforma-disclaimer {
  margin: 0;
  border-radius: var(--radius-sm);
}
#app[data-route="proforma"] .proforma-grid .d-grid,
#app[data-route="landresidual"] .proforma-grid .d-grid,
#app[data-route="caprate"] .proforma-grid .d-grid {
  gap: 0;
  border-top: 1px solid var(--border-default);
}
#app[data-route="proforma"] .proforma-grid .d-grid > div,
#app[data-route="landresidual"] .proforma-grid .d-grid > div,
#app[data-route="caprate"] .proforma-grid .d-grid > div {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
#app[data-route="proforma"] .proforma-grid .d-grid .val,
#app[data-route="landresidual"] .proforma-grid .d-grid .val,
#app[data-route="caprate"] .proforma-grid .d-grid .val {
  margin-top: 3px;
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
}

/* Intelligence evidence feeds */
#app[data-route="news"] .pulse-hero-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(0, 1fr);
  gap: var(--space-6);
  margin: 0;
  padding: var(--space-5) 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  border-radius: 0;
}
#app[data-route="news"] .pulse-hero-row > :not(:first-child) { grid-column: 2; }
#app[data-route="news"] .pulse-signal-line {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.55;
}
#app[data-route="news"] .news-feed-item {
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
}
#app[data-route="news"] .news-col {
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="news"] .news-col-head { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); }
#app[data-route="news"] .news-col-chatter .news-feed-item.is-chatter { background: var(--bg-1); }
#app[data-route="news"] .nf-top-left { flex: 0 0 auto; flex-wrap: nowrap; white-space: nowrap; }
#app[data-route="news"] .nf-top-right { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
#app[data-route="news"] .news-date { white-space: nowrap; }
#app[data-route="news"] .nf-top-left .conf-badge { color: var(--text-tertiary); font-size: 0.65rem; }
#app[data-route="news"] .nf-data-gaps {
  margin-top: var(--space-2);
  color: var(--amber);
  font-size: 0.68rem;
  line-height: 1.45;
}
#app[data-route="news"] .nf-data-gaps summary { cursor: pointer; font-weight: 700; }
#app[data-route="news"] .nf-data-gaps span { display: block; margin-top: 3px; color: var(--text-tertiary); }

#app[data-route="learn"] .legis-grid {
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="learn"] .legis-card { border: 0; border-bottom: 1px solid var(--border-default); border-radius: 0; }
#app[data-route="learn"] .legis-card:last-child { border-bottom: 0; }
#app[data-route="learn"] .legis-ledger-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-2) 0 var(--space-3);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}
#app[data-route="learn"] .legis-ledger-meta > span { display: inline-flex; align-items: center; gap: 5px; }
#app[data-route="learn"] .legis-ledger-meta b { color: var(--text-tertiary); font-size: 0.61rem; letter-spacing: 0.05em; text-transform: uppercase; }
#app[data-route="learn"] .legis-ledger-sectors i {
  padding: 2px 5px;
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 2px;
  font-style: normal;
}

#app[data-route="signal"] .signal-read-grid { grid-template-columns: minmax(110px, auto) minmax(110px, auto) minmax(0, 1fr); }
#app[data-route="signal"] .sr-narrative p {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.55;
}

#app[data-route="signal"] #rfp-feed,
#app[data-route="rfptracker"] #rfpt-feed {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="signal"] .rfp-card,
#app[data-route="rfptracker"] .rfp-card {
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-bottom: 1px solid var(--border-default);
  border-radius: 0;
}
#app[data-route="signal"] .rfp-card:last-child,
#app[data-route="rfptracker"] .rfp-card:last-child { border-bottom: 0; }

#app[data-route="competitive"] .ci-leaderboard,
#app[data-route="competitive"] .comp-sector-row,
#app[data-route="companies"] .company-grid,
#app[data-route^="company:"] .proj-mini-grid,
#app[data-route="designfirms"] .cons-main,
#app[data-route="awards"] .awards-live-panel {
  border-color: var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: none;
}
#app[data-route="companies"] .company-grid,
#app[data-route^="company:"] .proj-mini-grid {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
}
#app[data-route="companies"] .company-card,
#app[data-route^="company:"] .proj-mini-card { border-width: 0 1px 1px 0; border-radius: 0; }

#app[data-route="designfirms"] .cons-card,
#app[data-route="awards"] .award-live-hero,
#app[data-route="awards"] .award-team-card { box-shadow: none; border-radius: var(--radius-sm); }

/* ── Stage 3C: editorial intelligence depth ───────────────────────────── */
/* News: current filtered coverage leads into a verified-priority feed. */
#app[data-route="news"] .news-lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: var(--space-4);
  align-items: stretch;
}
#app[data-route="news"] .news-lead-grid-single { grid-template-columns: 1fr; }
#app[data-route="news"] .news-lead-grid .pulse-hero-row {
  display: block;
  height: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="news"] .news-lead-grid .pulse-hero-row::before {
  display: block;
  margin-bottom: var(--space-3);
}
#app[data-route="news"] .news-lead-grid .pulse-hero-row > :not(:first-child) { grid-column: auto; }
#app[data-route="news"] .news-coverage-panel {
  min-width: 0;
  padding: var(--space-4);
  background: var(--bg-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="news"] .news-coverage-head,
#app[data-route="news"] .news-trust-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
#app[data-route="news"] .news-coverage-head {
  color: var(--text-tertiary);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
#app[data-route="news"] .news-coverage-head strong { color: var(--text-primary); font-size: var(--text-sm); letter-spacing: 0; text-transform: none; }
#app[data-route="news"] .news-trust-band {
  display: flex;
  height: 9px;
  margin: var(--space-3) 0 var(--space-2);
  overflow: hidden;
  background: var(--border-subtle);
  border-radius: 2px;
}
#app[data-route="news"] .news-trust-band i { display: block; height: 100%; }
#app[data-route="news"] .is-verified { background: var(--green); }
#app[data-route="news"] .is-chatter { background: var(--amber); }
#app[data-route="news"] .news-trust-labels { justify-content: flex-start; color: var(--text-secondary); font-size: 0.68rem; }
#app[data-route="news"] .news-trust-labels span { display: inline-flex; align-items: center; gap: 5px; }
#app[data-route="news"] .news-trust-labels span > i { width: 7px; height: 7px; border-radius: 50%; }
#app[data-route="news"] .news-trust-labels b { color: var(--text-primary); }
#app[data-route="news"] .news-coverage-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
#app[data-route="news"] .news-coverage-kicker { margin-bottom: var(--space-2); color: var(--text-tertiary); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
#app[data-route="news"] .news-coverage-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 22px; gap: var(--space-2); align-items: center; min-height: 22px; color: var(--text-secondary); font-size: 0.68rem; }
#app[data-route="news"] .news-coverage-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app[data-route="news"] .news-coverage-track { height: 4px; overflow: hidden; background: var(--border-default); }
#app[data-route="news"] .news-coverage-track i { display: block; height: 100%; background: var(--accent); }
#app[data-route="news"] .news-coverage-row strong { color: var(--text-primary); text-align: right; }
#app[data-route="news"] .news-coverage-empty { color: var(--text-tertiary); font-size: var(--text-sm); }
#app[data-route="news"] .news-split { grid-template-columns: minmax(0, 1.86fr) minmax(290px, 1fr); }
#app[data-route="news"] .news-col-verified { border-top: 2px solid var(--green); }
#app[data-route="news"] .news-col-chatter { border-top: 2px solid var(--amber); }
#app[data-route="news"] .news-col-count { color: var(--text-primary); font-size: var(--text-sm); }
#app[data-route="news"] .news-col-hint { margin-left: auto; text-align: right; }

/* Learn: desktop index/reader; the same evidence becomes native disclosures on mobile. */
#app[data-route="learn"] .legis-grid { display: block; overflow: visible; border: 0; border-radius: 0; }
#app[data-route="learn"] .legis-reader-shell {
  display: grid;
  grid-template-columns: minmax(270px, 0.38fr) minmax(0, 0.62fr);
  align-items: start;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="learn"] .legis-index { max-height: 760px; overflow-y: auto; background: var(--bg-2); }
#app[data-route="learn"] .legis-index-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-2); border-bottom: 1px solid var(--border-default);
  color: var(--text-tertiary); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
}
#app[data-route="learn"] .legis-index-item {
  display: grid; width: 100%; gap: 4px;
  padding: var(--space-3) var(--space-4);
  background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--border-subtle); border-left: 3px solid transparent;
  font: inherit; text-align: left; cursor: pointer;
}
#app[data-route="learn"] .legis-index-item:hover { background: var(--bg-hover); }
#app[data-route="learn"] .legis-index-item.active { background: var(--accent-dim); border-left-color: var(--accent); }
#app[data-route="learn"] .legis-index-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#app[data-route="learn"] .legis-index-date { color: var(--accent); font-family: var(--font-mono); font-size: 0.65rem; }
#app[data-route="learn"] .legis-index-name { color: var(--text-primary); font-size: var(--text-sm); font-weight: 700; line-height: 1.35; }
#app[data-route="learn"] .legis-index-meta { color: var(--text-tertiary); font-size: 0.66rem; }
#app[data-route="learn"] .legis-index-meta i { color: var(--text-secondary); font-style: normal; }
#app[data-route="learn"] .legis-index-summary { display: -webkit-box; overflow: hidden; color: var(--text-secondary); font-size: 0.72rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#app[data-route="learn"] .legis-reader { min-width: 0; max-height: 760px; overflow-y: auto; padding: clamp(24px, 4vw, 52px); border-left: 1px solid var(--border-default); }
#app[data-route="learn"] .legis-reader-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
#app[data-route="learn"] .legis-reader-title { max-width: 760px; margin: var(--space-4) 0; color: var(--text-primary); font-family: var(--font-serif); font-size: clamp(1.55rem, 2.4vw, 2.25rem); font-weight: 400; line-height: 1.15; }
#app[data-route="learn"] .legis-reader-dates { display: flex; flex-wrap: wrap; gap: var(--space-4); padding-block: var(--space-3); border-block: 1px solid var(--border-subtle); }
#app[data-route="learn"] .legis-reader-dates span { display: flex; gap: var(--space-2); color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.7rem; }
#app[data-route="learn"] .legis-reader-dates b { color: var(--text-tertiary); font-family: var(--font); font-size: 0.61rem; letter-spacing: 0.06em; text-transform: uppercase; }
#app[data-route="learn"] .legis-reader-sectors { display: flex; flex-wrap: wrap; gap: 5px; margin-top: var(--space-3); }
#app[data-route="learn"] .legis-reader-sectors span { padding: 3px 7px; color: var(--text-secondary); border: 1px solid var(--border-default); border-left: 3px solid var(--sector-color); border-radius: 2px; font-size: 0.66rem; }
#app[data-route="learn"] .legis-reader-summary { max-width: 74ch; margin: var(--space-5) 0; color: var(--text-secondary); font-size: var(--text-base); line-height: 1.75; }
#app[data-route="learn"] .legis-reader-section { max-width: 78ch; padding: var(--space-5) 0; border-top: 1px solid var(--border-default); }
#app[data-route="learn"] .legis-reader-section h4,
#app[data-route="learn"] .legis-impact-grid h4 { margin-bottom: var(--space-3); color: var(--text-tertiary); font-size: 0.66rem; letter-spacing: 0.07em; text-transform: uppercase; }
#app[data-route="learn"] .legis-reader-section p,
#app[data-route="learn"] .legis-reader-section li,
#app[data-route="learn"] .legis-impact-grid p { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.7; }
#app[data-route="learn"] .legis-reader-section ul { margin-left: 1.1rem; }
#app[data-route="learn"] .legis-reader-section li + li { margin-top: var(--space-2); }
#app[data-route="learn"] .legis-impact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); max-width: 78ch; padding-block: var(--space-5); border-top: 1px solid var(--border-default); }
#app[data-route="learn"] .legis-impact-grid section { padding: var(--space-4); background: var(--bg-2); border: 1px solid var(--border-subtle); }
#app[data-route="learn"] .legis-context { padding-inline: var(--space-4); background: var(--amber-dim); border-left: 3px solid var(--amber); }
#app[data-route="learn"] .legis-evidence-line { max-width: 78ch; margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
#app[data-route="learn"] .legis-evidence-line > div { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
#app[data-route="learn"] .legis-gaps summary { margin-top: var(--space-2); color: var(--amber); font-size: var(--text-xs); cursor: pointer; }
#app[data-route="learn"] .legis-gaps p { margin-top: var(--space-2); color: var(--text-secondary); font-size: var(--text-xs); line-height: 1.6; }
#app[data-route="learn"] .legis-mobile-list { display: none; }

/* Competitive: assignment evidence is ranked before the full ledger. */
#app[data-route="competitive"] .comp-plot-note { margin: var(--space-2) 0 var(--space-4); color: var(--text-tertiary); font-size: var(--text-xs); }
#app[data-route="competitive"] .comp-rank-plot { overflow-x: auto; }
#app[data-route="competitive"] .comp-rank-row {
  display: grid; grid-template-columns: 26px minmax(170px, 1.1fr) minmax(180px, 2fr) 38px 92px 92px;
  gap: var(--space-3); align-items: center; min-width: 720px;
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle);
}
#app[data-route="competitive"] .comp-rank-row:last-child { border-bottom: 0; }
#app[data-route="competitive"] .comp-rank-num { color: var(--text-tertiary); font-size: 0.68rem; }
#app[data-route="competitive"] .comp-rank-firm { display: grid; gap: 2px; min-width: 0; }
#app[data-route="competitive"] .comp-rank-firm strong { overflow: hidden; color: var(--text-primary); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
#app[data-route="competitive"] .comp-rank-firm span { color: var(--text-tertiary); font-size: 0.65rem; }
#app[data-route="competitive"] .comp-rank-track { height: 10px; overflow: hidden; background: var(--bg-3); border: 1px solid var(--border-subtle); }
#app[data-route="competitive"] .comp-rank-track i { display: block; height: 100%; min-width: 3px; }
#app[data-route="competitive"] .comp-rank-count { color: var(--text-primary); text-align: right; }
#app[data-route="competitive"] .comp-rank-value,
#app[data-route="competitive"] .comp-rank-horizon { color: var(--text-secondary); font-size: 0.7rem; text-align: right; }
#app[data-route="competitive"] .comp-sector-total { margin-left: auto; color: var(--text-tertiary); font-size: 0.65rem; }

/* Market Signal: sourced endpoint bridge stays adjacent to the trend. */
#app[data-route="signal"] .signal-evidence-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr); gap: var(--space-4); align-items: stretch; }
#app[data-route="signal"] .signal-evidence-grid > .panel { margin: 0; }
#app[data-route="signal"] .signal-chart-wrap { height: 290px; }
#app[data-route="signal"] .signal-change-bridge { display: flex; flex-direction: column; }
#app[data-route="signal"] .signal-bridge-period { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-2); align-items: center; margin: var(--space-3) 0; color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.7rem; }
#app[data-route="signal"] .signal-bridge-period i { height: 1px; background: var(--border-strong); }
#app[data-route="signal"] .signal-bridge-row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); padding: var(--space-4) 0; border-top: 1px solid var(--border-default); }
#app[data-route="signal"] .signal-bridge-row > span { color: var(--text-tertiary); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
#app[data-route="signal"] .signal-bridge-row > div { display: flex; align-items: center; gap: var(--space-2); grid-column: 1; }
#app[data-route="signal"] .signal-bridge-row > div b { color: var(--text-primary); font-size: 1.15rem; }
#app[data-route="signal"] .signal-bridge-row > div i { color: var(--text-tertiary); font-style: normal; }
#app[data-route="signal"] .signal-bridge-row > strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.2rem; }
#app[data-route="signal"] .signal-bridge-row .is-negative { color: var(--amber); }
#app[data-route="signal"] .signal-bridge-row .is-positive { color: var(--green); }
#app[data-route="signal"] .signal-bridge-current > b { color: var(--text-primary); font-size: 1.25rem; text-align: right; }
#app[data-route="signal"] .signal-bridge-current > small { grid-column: 1 / -1; color: var(--text-tertiary); }
#app[data-route="signal"] .signal-endpoint-sources { display: grid; gap: var(--space-3); margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--border-default); }
#app[data-route="signal"] .signal-endpoint-sources > div { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
#app[data-route="signal"] .signal-endpoint-sources > div > b { flex-basis: 100%; color: var(--text-tertiary); font-size: 0.61rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* Design firms: top filtered depth, then complete firm/project evidence. */
#app[data-route="designfirms"] .cons-depth-panel { margin-bottom: var(--space-3); }
#app[data-route="designfirms"] .cons-depth-head { display: flex; justify-content: space-between; gap: var(--space-4); align-items: start; margin-bottom: var(--space-3); }
#app[data-route="designfirms"] .cons-depth-head p { margin-top: var(--space-1); color: var(--text-tertiary); font-size: var(--text-xs); }
#app[data-route="designfirms"] .cons-depth-coverage { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); color: var(--text-tertiary); font-size: 0.66rem; white-space: nowrap; }
#app[data-route="designfirms"] .cons-depth-coverage b { color: var(--text-primary); }
#app[data-route="designfirms"] .cons-depth-plot { overflow-x: auto; }
#app[data-route="designfirms"] .cons-depth-row {
  display: grid; grid-template-columns: 24px minmax(180px, 0.85fr) minmax(220px, 1.6fr) 34px;
  gap: var(--space-3); align-items: center; min-width: 620px; width: 100%;
  padding: var(--space-2) 0; background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--border-subtle); font: inherit; text-align: left; cursor: pointer;
}
#app[data-route="designfirms"] .cons-depth-row:hover { background: var(--bg-hover); }
#app[data-route="designfirms"] .cons-depth-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#app[data-route="designfirms"] .cons-depth-rank { color: var(--text-tertiary); font-size: 0.65rem; }
#app[data-route="designfirms"] .cons-depth-name { display: grid; min-width: 0; }
#app[data-route="designfirms"] .cons-depth-name b { overflow: hidden; color: var(--text-primary); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
#app[data-route="designfirms"] .cons-depth-name small { color: var(--text-tertiary); font-size: 0.62rem; }
#app[data-route="designfirms"] .cons-depth-track { height: 9px; background: var(--bg-3); }
#app[data-route="designfirms"] .cons-depth-track > span { display: flex; height: 100%; min-width: 3px; overflow: hidden; }
#app[data-route="designfirms"] .cons-depth-track i { display: block; height: 100%; }
#app[data-route="designfirms"] .cons-depth-row > strong { color: var(--text-primary); text-align: right; }
#app[data-route="designfirms"] .cons-firm-card { margin-bottom: var(--space-3); padding: var(--space-4); }
#app[data-route="designfirms"] .cons-project-list { border-top: 1px solid var(--border-subtle); }
#app[data-route="designfirms"] .cons-project-row { display: flex; gap: var(--space-3); align-items: start; padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
#app[data-route="designfirms"] .cons-project-copy { flex: 1; min-width: 0; }
#app[data-route="designfirms"] .cons-project-name { color: var(--text-primary); font-size: var(--text-sm); font-weight: 600; }
#app[data-route="designfirms"] .cons-project-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 2px; color: var(--text-tertiary); font-size: 0.62rem; }
#app[data-route="designfirms"] .cons-project-meta span:first-child { padding-left: 5px; border-left: 2px solid var(--sector-color); }
#app[data-route="designfirms"] .cons-project-role { margin-top: 3px; color: var(--text-secondary); font-size: var(--text-xs); line-height: 1.45; }
#app[data-route="designfirms"] .cons-project-status { flex: 0 0 auto; }
#app[data-route="designfirms"] .cons-project-more { margin-top: var(--space-2); }
#app[data-route="designfirms"] .cons-project-more summary,
#app[data-route="designfirms"] .cons-data-gaps summary { color: var(--accent); font-size: var(--text-xs); cursor: pointer; }
#app[data-route="designfirms"] .cons-data-gaps p { margin-top: var(--space-2); color: var(--text-secondary); font-size: var(--text-xs); line-height: 1.55; }

/* Awards: exact milestones and raw outcome counts, with visible evidence gaps. */
#app[data-route="awards"] .award-milestone-rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: var(--space-4) 0; }
#app[data-route="awards"] .award-milestone { position: relative; display: grid; gap: 4px; padding-top: 20px; padding-right: var(--space-3); }
#app[data-route="awards"] .award-milestone-node { position: absolute; top: 2px; left: 0; width: 10px; height: 10px; background: var(--bg-1); border: 2px solid var(--accent); border-radius: 50%; z-index: 1; }
#app[data-route="awards"] .award-milestone.is-missing .award-milestone-node { border-color: var(--text-tertiary); }
#app[data-route="awards"] .award-milestone-link { position: absolute; top: 6px; left: 10px; right: 0; height: 1px; background: var(--border-strong); }
#app[data-route="awards"] .award-milestone-label { color: var(--text-tertiary); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
#app[data-route="awards"] .award-milestone strong { color: var(--text-primary); font-size: var(--text-xs); line-height: 1.35; }
#app[data-route="awards"] .award-milestone.is-missing strong { color: var(--text-tertiary); font-weight: 500; }
#app[data-route="awards"] .award-evidence { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
#app[data-route="awards"] .award-source-line { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
#app[data-route="awards"] .award-gaps summary { margin-top: var(--space-2); color: var(--amber); font-size: var(--text-xs); cursor: pointer; }
#app[data-route="awards"] .award-gaps p { margin-top: var(--space-2); color: var(--text-secondary); font-size: var(--text-xs); line-height: 1.55; }
#app[data-route="awards"] .award-winner-note { margin: var(--space-2) 0 var(--space-3); color: var(--text-tertiary); font-size: var(--text-xs); }
#app[data-route="awards"] .award-winner-row { display: grid; grid-template-columns: 24px minmax(180px, 1fr) minmax(160px, 2fr) 64px 90px; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
#app[data-route="awards"] .award-winner-row:last-child { border-bottom: 0; }
#app[data-route="awards"] .award-winner-row > span:first-child { color: var(--text-tertiary); font-size: 0.65rem; }
#app[data-route="awards"] .award-winner-row > strong { overflow: hidden; color: var(--text-primary); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
#app[data-route="awards"] .award-winner-track { height: 8px; overflow: hidden; background: var(--bg-3); }
#app[data-route="awards"] .award-winner-track i { display: block; height: 100%; min-width: 3px; background: var(--green); }
#app[data-route="awards"] .award-winner-row > b { color: var(--green); font-size: 0.72rem; text-align: right; }
#app[data-route="awards"] .award-winner-row > small { color: var(--text-tertiary); font-size: 0.65rem; text-align: right; }
#app[data-route="awards"] .award-evidence-cell { min-width: 220px; white-space: normal; }
#app[data-route="awards"] .award-evidence-cell .award-evidence { margin: 0; padding: 0; border: 0; }

/* Analytics: charts remain evidence, while rankings and schedules read as ledgers. */
#app[data-route-group="analytics"] .wf-list,
#app[data-route-group="analytics"] .ci-leaderboard {
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route-group="analytics"] .wf-row { background: var(--bg-1); }
#app[data-route-group="analytics"] .geo-node-bar-wrap { border-radius: 0; }
#app[data-route-group="analytics"] .geo-node-bar-fill { border-radius: 0; }
#app[data-route="momentum"] .momentum-chart-wrap { height: 280px; }
#app[data-route="winloss"] .winloss-chart-wrap { height: 380px; }
#app[data-route="velocity"] .velocity-chart-wrap { height: 260px; }
#app[data-route-group="analytics"] .analytics-visual-panel { overflow: hidden; }

#app[data-route="companies"] .company-timeline-wrap {
  position: relative;
  width: 100%;
  padding-bottom: var(--space-2);
}

/* Map is the evidence surface; title and status legend stay compact. */
#app[data-route="map"] .map-layout { gap: var(--space-3); }
#app[data-route="map"] .legend { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: 0.73rem; }
#app[data-route="map"] .map-coverage { padding-right: var(--space-3); border-right: 1px solid var(--border-default); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
#app[data-route="map"] .map-coverage strong { color: var(--accent); font-size: 0.85rem; }
#app[data-route="map"] #map {
  height: clamp(500px, calc(100vh - 220px), 760px);
  border-radius: var(--radius-sm);
}
#app[data-route="map"] .map-status-rail {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
#app[data-route="map"] .map-coverage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 90px;
  padding: var(--space-2) var(--space-3);
  border-right: 1px solid var(--border-default);
  color: var(--text-tertiary);
}
#app[data-route="map"] .map-coverage strong { color: var(--accent); font-size: 0.9rem; line-height: 1.1; }
#app[data-route="map"] .map-coverage small { margin-top: 2px; font-size: 0.6rem; letter-spacing: 0.07em; text-transform: uppercase; }
.map-filter-chip {
  display: inline-grid;
  grid-template-columns: auto minmax(max-content, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  text-align: left;
  white-space: nowrap;
}
.map-filter-chip:last-child { border-right: 0; }
.map-filter-chip i { width: 9px; height: 9px; border-radius: 50%; }
.map-filter-chip strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.map-filter-chip[aria-pressed="false"] { color: var(--text-tertiary); opacity: 0.52; }
.map-filter-chip[aria-pressed="false"] i { filter: grayscale(1); }
.map-filter-chip:hover,
.map-filter-chip:focus-visible { background: var(--surface-hover); outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 520px;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.map-canvas-shell { min-width: 0; }
#app[data-route="map"] .map-workspace #map { height: 100%; min-height: 520px; border: 0; border-radius: 0; }
.map-context-rail {
  overflow-y: auto;
  padding: var(--space-4);
  background: var(--bg-1);
  border-left: 1px solid var(--border-default);
}
.map-selection {
  min-height: 116px;
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-4);
  padding: var(--space-4);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-default);
}
.map-selection .panel-label { display: block; margin-bottom: var(--space-2); }
.map-selection > strong { display: block; color: var(--text-primary); font-size: var(--text-sm); line-height: 1.35; }
.map-selection > small,
.map-selection > p { display: block; margin: var(--space-1) 0 0; color: var(--text-secondary); font-size: var(--text-xs); line-height: 1.45; }
.map-clear-focus {
  margin-top: var(--space-3);
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
}
.map-clear-focus:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.map-node-list { display: flex; flex-direction: column; }
.map-node-button {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: var(--space-2) 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.map-node-button > span { min-width: 0; }
.map-node-button strong,
.map-node-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-node-button strong { color: var(--text-primary); font-size: var(--text-xs); }
.map-node-button small { margin-top: 2px; color: var(--text-tertiary); font-size: 0.65rem; }
.map-node-button > i { display: block; height: 3px; overflow: hidden; background: var(--bg-3); }
.map-node-button > i > b { display: block; height: 100%; background: var(--accent); }
.map-node-button:hover strong,
.map-node-button:focus-visible strong { color: var(--accent); }
.map-node-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shared evidence drawer and command deck. */
.drawer { width: min(580px, 96vw); }
.drawer-header {
  padding: var(--space-5) var(--space-6) var(--space-4);
  padding-right: calc(var(--space-6) + 28px + var(--space-2));
  border-bottom-color: var(--border-default);
}
.drawer-title-block::before {
  content: "Record detail";
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-tertiary);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}
.drawer-title-block h3 { font-size: 1.35rem; letter-spacing: -0.02em; }
.drawer-body { padding: var(--space-5) var(--space-6) var(--space-7); }
.drawer .d-grid {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.drawer .d-grid > div { padding: var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.drawer .d-block { margin-top: var(--space-4); padding-top: var(--space-4); }
.drawer .signals { gap: 0; overflow: hidden; border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
.drawer .signal { border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
.drawer .signal:last-child { border-bottom: 0; }
.drawer .d-image,
.drawer #drawer-map { border-radius: var(--radius-sm); }

#palette-panel {
  width: min(620px, calc(100vw - 2rem));
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-drawer);
}
#palette-input { padding: var(--space-4) var(--space-5); }
.pal-item { gap: var(--space-3); padding: 0.62rem var(--space-5); }
.pal-kind { min-width: 70px; border-radius: 2px; text-align: center; }
#palette-footer { padding: var(--space-2) var(--space-5); }

@media (max-width: 1000px) {
  #app.delta-shell .stats,
  #app.delta-shell .stat-strip,
  #app.delta-shell .ds-hero-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app.delta-shell .stats > :nth-child(odd),
  #app.delta-shell .stat-strip > :nth-child(odd),
  #app.delta-shell .ds-hero-row > :nth-child(odd) { border-left: 0; }
  #app.delta-shell .stats > :nth-child(n+3),
  #app.delta-shell .stat-strip > :nth-child(n+3),
  #app.delta-shell .ds-hero-row > :nth-child(n+3) { border-top: 1px solid var(--border-default); }
  #app[data-route="proforma"] .proforma-grid,
  #app[data-route="landresidual"] .proforma-grid,
  #app[data-route="caprate"] .proforma-grid { grid-template-columns: 1fr; }
  #app[data-route="proforma"] .proforma-grid > .panel + .panel,
  #app[data-route="landresidual"] .proforma-grid > .panel + .panel,
  #app[data-route="caprate"] .proforma-grid > .panel + .panel { border-top: 1px solid var(--border-default); border-left: 0; }
  .map-workspace { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (max-width: 760px) {
  #app.delta-shell { padding: var(--space-4); }
  #app.delta-shell > .view,
  #app.delta-shell > .intel-view { gap: var(--space-4); }
  #app.delta-shell > .view > .section-head,
  #app.delta-shell > .intel-view > .section-head,
  #app.delta-shell > .intel-view > .view-header { align-items: flex-start; }
  #app.delta-shell .control-panel { display: block; }
  #app.delta-shell .ctrl-zone { width: 100%; border-right: 0; border-bottom: 1px solid var(--border-default); }
  #app.delta-shell .ctrl-zone:last-child { border-bottom: 0; }
  #app.delta-shell .ctrl-filters { min-width: 0; }
  #app.delta-shell .ds-insight-line,
  #app[data-route="news"].delta-shell .pulse-hero-row { grid-template-columns: 1fr; gap: var(--space-3); }
  #app[data-route="news"] .pulse-hero-row > :not(:first-child) { grid-column: 1; }
  #app[data-route="signal"] .signal-read-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app[data-route="signal"] .sr-narrative { grid-column: 1 / -1; }
  #app[data-route="calendar"] .cal-month-body { display: block; }
  #app[data-route="calendar"] .cal-sidebar { width: 100%; margin-top: var(--space-3); }
  #app[data-route="map"] #map { height: max(480px, calc(100vh - 240px)); }
  #app[data-route-group="sector"] .sector-visual-grid { grid-template-columns: 1fr; }
  #app[data-route="companies"] .company-timeline-wrap { min-width: 720px; }
  #app[data-route="companies"] .company-timeline-panel { overflow-x: auto; }
  .map-workspace { grid-template-columns: 1fr; }
  .map-context-rail { max-height: none; border-top: 1px solid var(--border-default); border-left: 0; }
  #app[data-route="map"] .map-workspace #map { min-height: 500px; }
}

@media (max-width: 520px) {
  #app.delta-shell { padding: 0.75rem; }
  #app.delta-shell .stats,
  #app.delta-shell .stat-strip,
  #app.delta-shell .ds-hero-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app.delta-shell .delta-compact-summary { grid-template-columns: 1fr; }
  #app.delta-shell .delta-summary-item { min-height: 52px; padding: var(--space-3); border-top: 1px solid var(--border-default); border-left: 0; }
  #app.delta-shell .delta-summary-item:first-child { border-top: 0; }
  #app.delta-shell .stat,
  #app.delta-shell .stat-strip-item,
  #app.delta-shell .ds-hero-panel,
  #app.delta-shell .ds-metric-card { min-height: 94px; padding: var(--space-3); }
  #app.delta-shell .ds-hero-value { font-size: 1.55rem !important; }
  #app.delta-shell .ds-mc-value { font-size: 1.25rem; }
  #app.delta-shell .cards,
  #app.delta-shell .company-grid,
  #app.delta-shell .proj-mini-grid,
  #app.delta-shell .legis-grid { grid-template-columns: 1fr; }
  #app[data-route="signal"] .signal-read-grid { grid-template-columns: 1fr; }
  #app[data-route="signal"] .sr-narrative { grid-column: auto; }
  #app[data-route="momentum"] .momentum-chart-wrap,
  #app[data-route="velocity"] .velocity-chart-wrap { height: 300px; }
  #app[data-route="winloss"] .winloss-chart-wrap { height: 420px; }
  .map-filter-chip { min-width: max-content; }
  #app[data-route="map"] .map-workspace #map { min-height: 460px; }
  #app[data-route="calendar"] .cal-event { align-items: flex-start; gap: var(--space-2); }
  #app[data-route="calendar"] .cal-event-date { min-width: 72px; }
  .drawer { width: 100vw; }
  .drawer-header,
  .drawer-body { padding-left: var(--space-4); padding-right: var(--space-4); }
  .drawer-header { padding-right: calc(var(--space-4) + 28px + var(--space-2)); }
  .pal-sub { display: none; }
}

@media (max-width: 1000px) {
  #app[data-route="news"] .news-lead-grid,
  #app[data-route="signal"] .signal-evidence-grid { grid-template-columns: 1fr; }
  #app[data-route="signal"] .signal-endpoint-sources { margin-top: var(--space-4); }
  #app[data-route="designfirms"] .cons-depth-head { display: grid; }
  #app[data-route="designfirms"] .cons-depth-coverage { justify-content: flex-start; }
}

@media (max-width: 860px) {
  #app[data-route="news"] .news-split { grid-template-columns: 1fr; }
  #app[data-route="competitive"] .comp-sector-row { grid-template-columns: 1fr; gap: var(--space-2); }
  #app[data-route="competitive"] .comp-sector-label { white-space: normal; }
  #app[data-route="awards"] .award-winner-plot { overflow-x: auto; }
  #app[data-route="awards"] .award-winner-row { min-width: 650px; }
}

@media (max-width: 760px) {
  #app[data-route="news"] .news-coverage-columns { gap: var(--space-3); }
  #app[data-route="learn"] .legis-reader-shell { display: none; }
  #app[data-route="learn"] .legis-mobile-list { display: grid; gap: var(--space-3); }
  #app[data-route="learn"] .legis-mobile-item { overflow: hidden; background: var(--bg-1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
  #app[data-route="learn"] .legis-mobile-item > summary { display: grid; gap: 4px; padding: var(--space-4); cursor: pointer; list-style-position: inside; }
  #app[data-route="learn"] .legis-mobile-item[open] > summary { background: var(--accent-dim); border-bottom: 1px solid var(--border-default); }
  #app[data-route="learn"] .legis-mobile-body { padding: var(--space-4); }
  #app[data-route="learn"] .legis-mobile-body .legis-reader-title { font-size: 1.45rem; }
  #app[data-route="learn"] .legis-impact-grid { grid-template-columns: 1fr; }
  #app[data-route="designfirms"] .cons-layout { flex-direction: column; margin-top: 0 !important; }
  #app[data-route="designfirms"] .cons-sidebar {
    display: flex; width: 100% !important; gap: var(--space-2); padding: var(--space-2) !important;
    overflow-x: auto; position: static; border-radius: var(--radius-sm);
  }
  #app[data-route="designfirms"] .cons-sidebar .panel-label { display: none; }
  #app[data-route="designfirms"] .cons-sidebar .cons-sector-row { flex: 0 0 auto; width: auto !important; margin: 0 !important; padding: var(--space-2) var(--space-3) !important; white-space: nowrap; border: 1px solid var(--border-default) !important; border-radius: 3px !important; }
  #app[data-route="designfirms"] .cons-cards-panel { width: 100%; }
  #app[data-route="awards"] .award-teams-row { display: grid; grid-template-columns: 1fr; }
  #app[data-route="awards"] .award-team-card { min-width: 0; }
}

@media (max-width: 520px) {
  #app[data-route="news"] .news-lead-grid .pulse-hero-row,
  #app[data-route="news"] .news-coverage-panel { padding: var(--space-3); }
  #app[data-route="news"] .news-coverage-columns { grid-template-columns: 1fr; }
  #app[data-route="news"] .news-col-hint { flex-basis: 100%; margin-left: 0; text-align: left; }
  #app[data-route="news"] .news-feed-item { padding-inline: var(--space-3); }
  #app[data-route="signal"] .signal-chart-wrap { height: 250px; }
  #app[data-route="signal"] .signal-bridge-row { grid-template-columns: 1fr auto; }
  #app[data-route="designfirms"] .cons-depth-panel { padding-inline: var(--space-3); }
  #app[data-route="designfirms"] .cons-depth-coverage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app[data-route="designfirms"] .cons-project-row { display: grid; }
  #app[data-route="designfirms"] .cons-project-status { justify-self: start; }
  #app[data-route="awards"] .award-live-hero { padding: var(--space-3); }
  #app[data-route="awards"] .award-milestone { padding-right: var(--space-2); }
  #app[data-route="awards"] .award-milestone strong { font-size: 0.68rem; overflow-wrap: anywhere; }
}

/* CREMI refresh — composed metric cards and quiet dashboard surfaces.
   Visual reference: 21st.dev/@ravikatiyar162/components/stats-card.
   Native CSS adaptation; no external component/runtime dependency. */
body { background: var(--bg-0); }
button, input, select, textarea { font-family: var(--font); }
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 4px;
}
.topbar {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px; padding: 16px 32px;
  background: var(--bg-0); backdrop-filter: none; -webkit-backdrop-filter: none;
}
.brand { gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; flex-basis: 36px;
  font-size: 23px; letter-spacing: -0.08em; padding-right: 2px;
  border-radius: 11px; background: #4969d5; box-shadow: none;
}
.brand-text h1 { display: flex; align-items: center; gap: 9px; font-size: 19px; letter-spacing: 0.06em; }
.brand-region { font-size: 9px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-secondary); border: 1px solid var(--border-default); border-radius: 4px; padding: 3px 5px; }
.brand-text p { margin-top: 4px; font-size: 10px; letter-spacing: 0.015em; }
.brand:hover .brand-text h1 { text-decoration: none; }
.nav { gap: 4px; flex-wrap: nowrap; min-width: 0; }
.nav-btn { font-family: var(--font); font-size: 12px; font-weight: 500; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; }
.nav-btn::after { display: none; }
.nav-btn:hover { background: var(--bg-2); }
.nav-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-border); }
.nav-dropdown-trigger { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.nav-dot { box-shadow: none; }
.palette-trigger { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 36px; padding: 7px 10px; font-size: 11px; font-weight: 400; letter-spacing: 0; background: var(--bg-1); }
.palette-trigger kbd { font: 10px var(--font); padding: 2px 4px; border: 1px solid var(--border-default); border-radius: 4px; }
.theme-toggle, .help-toggle { width: 32px; height: 32px; color: var(--text-secondary); font-size: 14px; }
.nav-dropdown-menu { background: var(--bg-1); padding: 16px; gap: 8px; border-radius: 16px; }
.nav-dropdown-item { font-family: var(--font); font-size: 13px; padding: 14px; }
.nav-dropdown-item.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-border); }
.nav-dropdown-item.active .sector-count { color: var(--text-secondary); }
#app.overview-mode, #app.delta-shell { padding-top: 32px; }
.overview-ledger { gap: 24px; }
.overview-ledger .ov-briefing-head { align-items: center; padding-bottom: 4px; }
.section-head .ov-title-block { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.ov-eyebrow { color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: 0.13em; }
.overview-ledger .ov-briefing-head h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 600; line-height: 1.15; letter-spacing: -0.055em; }
.heading-period { color: var(--accent); }
.overview-ledger .ov-briefing-head .muted { font-size: 12px; color: var(--text-tertiary); line-height: 1.6; }
.overview-ledger .update-intel-btn { min-height: 38px; padding: 9px 14px; font-size: 11px; font-weight: 500; border-radius: 8px; box-shadow: none; }
.ov-summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.ov-summary-stat {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  gap: 14px; min-height: 146px; padding: 20px;
  background: var(--bg-1); border: 1px solid var(--border-default); border-radius: 14px;
}
.ov-summary-stat:first-child { background: linear-gradient(120deg, var(--accent-dim), transparent), var(--bg-1); border-color: var(--accent-border); }
.ov-summary-stat:nth-child(2) { border-right: 1px solid var(--border-default); }
.ov-summary-stat > span { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-secondary); }
.ov-summary-stat strong { font-family: var(--font); font-size: clamp(27px, 2.8vw, 36px); font-weight: 600; letter-spacing: -0.055em; color: var(--text-primary); }
.ov-summary-stat:first-child strong { color: var(--accent); }
.ov-summary-stat strong em { font-size: 12px; font-style: normal; font-weight: 400; letter-spacing: 0; color: var(--text-tertiary); margin-left: 8px; }
.ov-summary-stat small { color: var(--text-tertiary); font-size: 10px; line-height: 1.5; }
.ov-signal-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; border: 0; }
.ov-trend-panel, .ov-insight-panel { padding: 24px; background: var(--bg-1); border: 1px solid var(--border-default); border-radius: 16px; }
.ov-kicker { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; color: var(--text-secondary); }
.ov-trend-heading { align-items: center; }
.ov-trend-heading > div { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ov-trend-delta { flex-shrink: 0; margin-top: 0; padding: 7px 9px; font: 600 13px var(--font); letter-spacing: -0.02em; border-radius: 6px; color: #ff9e9e; background: var(--red-dim); }
.ov-axis-head { color: var(--text-tertiary); margin-top: 22px; font-size: 9px; text-transform: none; }
.ov-trend-chart { height: 205px; }
.ov-trend-source { font-size: 10px; }
.ov-insight-panel { background: linear-gradient(155deg, var(--accent-dim), transparent 75%), var(--bg-1); }
.ov-insight-panel > .ov-kicker { color: var(--accent); }
.ov-insight-panel p { max-width: 33ch; margin: 23px 0; font-family: var(--font); font-size: clamp(17px, 1.6vw, 21px); font-weight: 400; font-style: normal; line-height: 1.65; letter-spacing: -0.025em; }
.ov-insight-source { border-top: 1px solid var(--border-default); padding-top: 14px; font-size: 11px; }
.ov-ledger-panel { overflow: hidden; border: 1px solid var(--border-default); background: var(--bg-1); border-radius: 16px; }
.ov-ledger-heading { padding: 22px 22px 10px; }
.ov-ledger-heading .ov-kicker { color: var(--text-primary); font-size: 15px; letter-spacing: -0.02em; text-transform: none; }
.ov-ledger-heading > div { justify-content: space-between; }
.ov-confidence-legend { display: flex; flex-wrap: wrap; justify-content: flex-start; padding: 0 22px 18px; gap: 16px; border: 0; }
.ov-confidence-legend span { font-size: 9px; font-weight: 500; letter-spacing: 0.04em; }
.ov-confidence-legend i { width: 5px; height: 5px; }
.ov-ledger-table th { padding: 11px 16px; background: var(--bg-2); font-weight: 500; font-size: 9px; }
.ov-ledger-table td { padding: 15px 16px; border-color: var(--border-subtle); line-height: 1.5; }
.ov-ledger-table tr:last-child td { border-bottom: 0; }
.ov-ledger-row:hover { background: var(--bg-2); }
.ov-ledger-table th:nth-child(3) { width: 29%; }
.ov-ledger-table th:nth-child(6) { width: 28%; }
.ov-layer-badge { border-radius: 5px; font-size: 10px; }
.ov-secondary-panel { margin-top: 0; }
.ov-sector-snapshot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.ov-snapshot-item { padding: 16px; font-family: var(--font); text-align: left; border-radius: 10px; background: var(--bg-0); transition: background 150ms, border-color 150ms; }
.ov-snapshot-item:hover { background: var(--accent-dim); border-color: var(--accent-border); }
.ov-snapshot-count { font-size: 20px; min-width: 25px; font-weight: 600; }
.ov-snapshot-name { flex: 1; font-size: 11px; }
.ov-snapshot-val { font-size: 11px; }
.ov-snapshot-idle { opacity: 1; }
.ov-snapshot-divider { grid-column: 1 / -1; margin: 5px 0; }
.panel, .intel-panel { border-radius: 14px; }
#app.delta-shell .panel, #app.delta-shell .intel-panel, #app.delta-shell .ds-chart-panel,
#app.delta-shell .card, #app.delta-shell .company-card, #app.delta-shell .proj-mini-card,
#app.delta-shell .legis-card, #app.delta-shell .rfp-card, #app.delta-shell .ci-leader-card { border-radius: 12px; }
#app.delta-shell .stats, #app.delta-shell .stat-strip, #app.delta-shell .ds-hero-row,
#app.delta-shell .delta-compact-summary, #app.delta-shell .control-panel, #app.delta-shell .roster-wrap { border-radius: 12px; }
#app.delta-shell .search, #app.delta-shell .select, #app.delta-shell .filter-select { border-radius: 7px; }
#app.delta-shell > .view > .section-head:first-child h2, #app.delta-shell .view-title { font-size: 30px; font-weight: 600; letter-spacing: -0.045em; }
.drawer { border-left: 1px solid var(--border-strong); }
.drawer-header { background: var(--bg-1); }
#palette-panel { border-radius: 16px; }
.footer { color: var(--text-tertiary); font-size: 10px; padding: 22px 32px; }
body.light-mode .topbar { background: var(--bg-1); }
body.light-mode .ov-trend-delta { color: #aa303b; }
body.light-mode .brand-mark { box-shadow: none; }
@media (max-width: 1180px) {
  .topbar { gap: 14px; padding-inline: 22px; }
  .nav-btn { padding-inline: 9px; }
  .palette-trigger > span { display: none; }
  .palette-trigger { gap: 0; }
}
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; gap: 12px; }
  .brand { grid-column: 1; grid-row: 1; }
  .topbar-right { grid-column: 2; grid-row: 1; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  .nav-dropdown { flex-shrink: 0; }
  .nav-dropdown-trigger { max-width: 180px; }
  .palette-trigger > span { display: inline; }
  .palette-trigger { gap: 16px; }
  .ov-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-signal-grid { grid-template-columns: 1fr; }
  .ov-insight-panel p { max-width: none; font-size: 19px; }
  .ov-sector-snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ov-ledger-heading { padding: 18px 16px 10px; }
  .ov-confidence-legend { padding-inline: 16px; gap: 12px; }
  .ov-ledger-table tbody { gap: 0; }
  .ov-ledger-table tr { border: 0; border-top: 1px solid var(--border-default); border-radius: 0; }
  .ov-ledger-table td { padding: 0; }
}
@media (max-width: 480px) {
  .topbar { padding: 12px 16px; }
  .brand-text h1 { font-size: 17px; }
  .brand-text p { font-size: 9px; }
  .brand-region { display: none; }
  .palette-trigger > span { display: none; }
  .palette-trigger { padding: 6px; }
  .nav { padding: 0 0 3px; position: static; gap: 3px; }
  .nav-btn { font-size: 11px; padding: 9px 10px; }
  .nav-dropdown-menu { top: 112px; max-height: calc(100dvh - 140px); width: calc(100vw - 24px); }
  #app.overview-mode, #app.delta-shell { padding: 24px 16px; }
  .overview-ledger { gap: 18px; }
  .overview-ledger .ov-briefing-head { align-items: flex-start; }
  .overview-ledger .ov-briefing-head .muted { font-size: 11px; }
  .overview-ledger .update-intel-btn { min-height: 34px; font-size: 10px; }
  .ov-summary-strip { display: grid; gap: 10px; }
  .ov-summary-stat { min-height: 143px; padding: 16px; gap: 12px; }
  .ov-summary-stat strong { font-size: 28px; }
  .ov-summary-stat strong em { display: block; margin: 5px 0 0; font-size: 10px; }
  .ov-summary-stat > span { white-space: normal; }
  .ov-trend-panel, .ov-insight-panel { padding: 18px; }
  .ov-trend-heading .ov-kicker { max-width: 22ch; line-height: 1.6; }
  .ov-trend-chart { height: 220px; }
  .ov-insight-panel p { font-size: 18px; }
  .ov-sector-snapshot { grid-template-columns: 1fr; }
  .ov-confidence-legend span { font-size: 8px; }
  .ov-ledger-heading > div > span:last-child { line-height: 1.6; }
  .footer { padding: 20px 16px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Residential investor workspace: shared CREMI shell, independent content tokens. */
.topbar { grid-template-columns: auto minmax(220px,1fr) auto; }
.wing-switch { display:flex; justify-self:center; padding:4px; border:1px solid var(--border-default); border-radius:10px; background:var(--bg-1); }
.wing-switch button { padding:9px 18px; border:0; border-radius:7px; background:transparent; color:var(--text-secondary); font-size:12px; font-weight:600; cursor:pointer; }
.wing-switch button.active { background:var(--bg-3); color:var(--text-primary); box-shadow:0 1px 3px #0002; }
.topbar .nav { grid-column:1/-1; grid-row:2; justify-content:center; width:100%; }
.topbar .topbar-right { grid-column:3; grid-row:1; }
[hidden] { display:none !important; }
body.residential-wing { --bg-0:#0d1718; --bg-1:#142224; --bg-2:#1c2e30; --bg-3:#293c3d; --accent:#ace1c7; --accent-dim:#ace1c70d; --accent-border:#ace1c733; --text-primary:#f1f1e8; --text-secondary:#b4c5c1; --text-tertiary:#94aaa5; --ri-green:#ace1c7; --ri-paper:#eaf1e3; --ri-line:#a0c4b320; }
body.residential-wing.light-mode { --bg-0:#f5f5ef; --bg-1:#fffef8; --bg-2:#e9eee5; --bg-3:#dce7de; --accent:#28684f; --accent-dim:#28684f0a; --accent-border:#28684f35; --text-primary:#1b3430; --text-secondary:#4d665e; --text-tertiary:#596f66; --ri-green:#2f7357; --ri-paper:#e7efde; --ri-line:#244d3020; --border-default:#244d3026; --border-subtle:#244d3015; --border-strong:#244d3045; }
.residential-wing .brand-mark { background:#ace1c7; color:#173e30; }
.residential-wing .wing-switch button.active { background:#ace1c7; color:#123d2c; }
.residential-wing .topbar { border-bottom:1px solid var(--ri-line); }
#app[data-route-group="residential"] { max-width:1440px; padding:32px 40px 64px; margin:0 auto; }
.ri-shell { --ri-gap:24px; color:var(--text-primary); font-size:14px; line-height:1.65; }
.ri-shell * { box-sizing:border-box; }
.ri-shell h2,.ri-shell h3,.ri-shell h4,.ri-shell p { margin:0; }
.ri-shell h3 { font-size:21px; font-weight:500; letter-spacing:-.035em; line-height:1.35; }
.ri-shell h4 { margin:14px 0 8px; }
.ri-shell p { color:var(--text-secondary); margin:10px 0; }
.ri-shell small,.ri-small { display:block; font-size:11px; line-height:1.65; color:var(--text-tertiary); }
.ri-shell ul { margin:10px 0; padding-left:18px; color:var(--text-secondary); }
.ri-shell li { margin:6px 0; }
.ri-shell b { font-weight:600; }
.ri-shell a { color:var(--accent); text-underline-offset:3px; text-decoration-thickness:1px; }
.ri-shell a:hover { text-decoration:underline; }
.ri-eyebrow { color:var(--accent); font-size:10px; font-weight:600; letter-spacing:.13em; line-height:1.7; text-transform:uppercase; }
.ri-hero { display:grid; grid-template-columns:1.4fr 1fr; gap:48px; align-items:stretch; margin:12px 0 32px; }
.ri-hero-copy { display:flex; flex-direction:column; align-items:flex-start; padding:18px 0 10px; }
.ri-hero h2 { margin:22px 0 16px; font-family:var(--font-serif); font-size:clamp(38px,4.5vw,66px); line-height:1.05; font-weight:400; letter-spacing:-.045em; }
.ri-hero h2 em { font-weight:400; color:var(--accent); }
.ri-hero-copy>p { max-width:47ch; font-size:15px; line-height:1.8; }
.ri-live-dot { display:inline-block; width:6px; height:6px; margin-right:6px; border-radius:50%; background:var(--accent); }
.ri-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:22px 0; }
.ri-btn { display:inline-flex; gap:20px; justify-content:center; align-items:center; min-height:40px; padding:10px 16px; border:1px solid var(--border-strong); border-radius:7px; background:transparent; color:var(--text-primary); font:500 12px var(--font); line-height:1.4; cursor:pointer; text-align:center; }
.ri-btn:hover { background:var(--bg-2); border-color:var(--accent); }
.ri-btn:disabled { cursor:not-allowed; opacity:.5; }
.ri-btn.ri-primary { background:var(--accent); border-color:var(--accent); color:var(--bg-0); }
.ri-btn.ri-primary:hover { filter:brightness(1.08); }
.ri-btn.ri-text-btn { color:var(--accent); background:transparent; border-color:transparent; padding-inline:0; }
.ri-hero-foot { font-size:10px; color:var(--text-tertiary); margin-top:auto; padding-top:12px; }
.ri-hero-foot span { padding:0 6px; }
.ri-thesis { background:var(--ri-paper); color:#1c3e32; border-radius:3px 3px 36px 3px; padding:30px 34px; }
.ri-thesis .ri-eyebrow { color:#44775e; }
.ri-thesis h3 { font-family:var(--font-serif); font-size:32px; font-weight:400; letter-spacing:-.025em; margin-top:14px; }
.ri-thesis>p { font-size:12px; color:#466453; max-width:44ch; margin:15px 0 20px; }
.ri-thesis-row { display:flex; gap:18px; align-items:center; border-top:1px solid #37613c25; padding:13px 0; }
.ri-thesis-row>span { font-family:var(--font-serif); color:#587456; font-size:20px; }
.ri-thesis-row strong { font-size:12px; font-weight:600; }
.ri-thesis-row small { color:#4b6453; font-size:10px; }
.ri-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--ri-line); border-radius:10px; margin:24px 0 36px; overflow:hidden; background:var(--bg-1); }
.ri-stat { padding:22px; min-width:0; border-right:1px solid var(--ri-line); }
.ri-stat:last-child { border-right:0; }
.ri-stat-label { color:var(--text-secondary); font-size:11px; line-height:1.4; min-height:30px; }
.ri-stat>strong { display:block; font-size:32px; font-weight:500; letter-spacing:-.04em; line-height:1.4; margin:8px 0; font-variant-numeric:tabular-nums; }
.ri-stat>strong>span { font-size:13px; letter-spacing:0; margin-left:5px; }
.ri-stat details { font-size:10px; margin-top:10px; }
.ri-stat details p { font-size:11px; }
.ri-shell details>summary { cursor:pointer; color:var(--text-secondary); font-size:12px; padding-block:10px; }
.ri-shell details[open]>summary { color:var(--accent); }
.ri-section-title { display:flex; justify-content:space-between; align-items:center; gap:24px; margin:36px 0 18px; }
.ri-section-title h3 { margin-top:5px; }
.ri-grid { display:grid; gap:var(--ri-gap); align-items:start; }
.ri-grid-two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ri-grid-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.ri-card { min-width:0; background:var(--bg-1); border:1px solid var(--ri-line); border-radius:10px; padding:24px; }
.ri-card>p { font-size:13px; }
.ri-card-number { font-size:9px; font-weight:600; letter-spacing:.12em; color:var(--text-tertiary); padding-bottom:17px; }
.ri-card-top { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:15px; }
.ri-card .ri-takeaway { border-top:1px solid var(--ri-line); margin-top:18px; padding-top:16px; }
.ri-takeaway b { font-size:11px; color:var(--accent); }
.ri-takeaway p { margin-top:5px; font-size:12px; }
.ri-citations { display:flex; gap:7px; flex-wrap:wrap; margin-top:15px; }
.ri-source-link { font-size:10px; padding:3px 8px; border:1px solid var(--border-default); border-radius:4px; }
.ri-card-actions { display:flex; align-items:center; justify-content:space-between; gap:15px; border-top:1px solid var(--ri-line); padding-top:15px; margin-top:20px; }
.ri-next { display:flex; align-items:center; justify-content:space-between; gap:40px; border-block:1px solid var(--ri-line); padding:32px 0; margin:36px 0; }
.ri-next>div { max-width:70ch; }
.ri-next h3 { margin-top:10px; }
.ri-next .ri-btn { flex-shrink:0; }
.ri-page-head { display:flex; align-items:center; justify-content:space-between; gap:30px; margin:16px 0 30px; }
.ri-page-head h2 { font-family:var(--font-serif); font-weight:400; font-size:42px; line-height:1.15; letter-spacing:-.04em; margin:14px 0; }
.ri-page-head p { max-width:86ch; font-size:13px; }
.ri-page-head .ri-btn { flex-shrink:0; }
.ri-filterbar { display:flex; flex-wrap:wrap; align-items:end; gap:20px; margin:26px 0; padding-bottom:20px; border-bottom:1px solid var(--ri-line); }
.ri-filterbar>span { margin-left:auto; font-size:11px; color:var(--text-tertiary); padding-bottom:10px; }
.ri-shell label { display:flex; flex-direction:column; gap:7px; font-size:11px; font-weight:500; color:var(--text-secondary); }
.ri-shell input:not([type=checkbox]),.ri-shell select { width:100%; min-width:0; min-height:42px; border:1px solid var(--border-strong); border-radius:6px; padding:10px 12px; color:var(--text-primary); background:var(--bg-0); font:400 13px var(--font); }
.ri-shell select { cursor:pointer; padding-right:30px; }
.ri-filterbar select { min-width:200px; }
.ri-badge { display:inline-block; font-size:10px; font-weight:600; line-height:1.45; color:var(--accent); background:var(--accent-dim); border:1px solid var(--accent-border); border-radius:4px; padding:4px 8px; }
.ri-badge.ri-caution { color:#eec691; background:#cc852112; border-color:#cc85213a; }
.light-mode .ri-badge.ri-caution { color:#865015; }
.ri-tags { display:flex; flex-wrap:wrap; gap:6px; margin:17px 0; }
.ri-tags span { font-size:10px; padding:4px 8px; color:var(--text-tertiary); background:var(--bg-2); border-radius:4px; }
.ri-split { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin:22px 0; }
.ri-split b { font-size:11px; }
.ri-split li,.ri-split p { font-size:12px; }
.ri-buy b { color:var(--accent); }
.ri-pass b { color:#eec691; }
.light-mode .ri-pass b { color:#865015; }
.ri-callout { display:flex; gap:18px; align-items:baseline; padding:17px 20px; margin:20px 0; border-left:3px solid var(--accent); background:var(--accent-dim); font-size:12px; }
.ri-callout b { flex-shrink:0; color:var(--accent); }
.ri-callout span { color:var(--text-secondary); }
.ri-rule-path { margin:15px 0; font-family:var(--font-serif); font-size:23px; line-height:1.4; color:var(--accent); }
.ri-rule-path+p { margin:15px 0; }
.ri-source-row { display:grid; grid-template-columns:1fr 160px; gap:32px; padding:26px 4px; border-bottom:1px solid var(--ri-line); }
.ri-source-row h3 { font-size:16px; margin:8px 0; }
.ri-source-row h3 a { color:var(--text-primary); }
.ri-source-row p { font-size:12px; max-width:105ch; }
.ri-source-date { font-size:11px; color:var(--text-secondary); }
.ri-source-date span { display:block; margin-top:10px; color:var(--text-tertiary); }
.ri-search-label { flex:1; }
.ri-lab-layout { display:grid; grid-template-columns:minmax(280px,.75fr) minmax(0,1.25fr); gap:28px; align-items:start; }
.ri-input-panel { background:var(--bg-1); border:1px solid var(--ri-line); border-radius:10px; padding:24px; }
.ri-input-head label { margin-top:18px; }
.ri-field-group { border-top:1px solid var(--ri-line); margin-top:22px; padding-top:8px; }
.ri-field-group>summary { font-weight:600; }
.ri-field-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:10px 0; }
.ri-field-grid label { justify-content:space-between; }
.ri-verification { border:0; border-top:1px solid var(--ri-line); padding:20px 0; margin:25px 0 0; }
.ri-verification legend { padding:0 10px 0 0; font-size:12px; font-weight:600; }
.ri-verification p { font-size:11px; margin:0 0 15px; }
.ri-verification label { display:flex; flex-direction:row; align-items:center; gap:10px; margin:14px 0; font-size:11px; }
.ri-verification input { accent-color:var(--accent); width:16px; height:16px; flex-shrink:0; }
.ri-results { display:grid; gap:22px; min-width:0; }
.ri-verdict { padding:24px; background:var(--accent-dim); border:1px solid var(--accent-border); border-radius:10px; }
.ri-verdict h3 { margin:10px 0; font-size:26px; }
.ri-verdict p { font-size:12px; }
.ri-verdict.ri-caution { background:#cc85210c; border-color:#cc85213d; }
.ri-verdict.ri-caution .ri-eyebrow { color:#eec691; }
.light-mode .ri-verdict.ri-caution .ri-eyebrow { color:#865015; }
.ri-result-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border:1px solid var(--ri-line); border-radius:10px; overflow:hidden; background:var(--bg-1); }
.ri-result-metrics .ri-stat { border-bottom:1px solid var(--ri-line); }
.ri-result-metrics .ri-stat:nth-child(even) { border-right:0; }
.ri-result-metrics .ri-stat:nth-child(n+3) { border-bottom:0; }
.ri-result-metrics .ri-stat>strong { font-size:28px; }
.ri-result-metrics .ri-stat-label { min-height:0; }
.ri-ledger { margin-top:18px; }
.ri-ledger>div { display:flex; justify-content:space-between; gap:20px; padding:10px 0; font-size:12px; color:var(--text-secondary); }
.ri-ledger .total { border-block:1px solid var(--ri-line); color:var(--text-primary); margin:7px 0; padding:13px 0; }
.ri-ledger b { font-variant-numeric:tabular-nums; }
.ri-negative { color:#ffad9c !important; }
.light-mode .ri-negative { color:#a5412b !important; }
.ri-mini-stats { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin:22px 0 4px; }
.ri-mini-stats b { display:block; font-size:18px; margin-top:5px; font-weight:500; letter-spacing:-.025em; }
.ri-table-wrap { overflow-x:auto; margin:18px 0; }
.ri-shell table { width:100%; border-collapse:collapse; font-size:11px; }
.ri-shell td,.ri-shell th { border-bottom:1px solid var(--ri-line); text-align:right; padding:12px 10px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.ri-shell td:first-child,.ri-shell th:first-child { text-align:left; padding-left:0; }
.ri-shell th { color:var(--text-tertiary); font-weight:500; }
.ri-empty { padding:48px 24px; text-align:center; color:var(--text-secondary); }
.ri-empty p { max-width:65ch; margin:16px auto 24px; }
.ri-error { color:#ffad9c; }
.light-mode .ri-error { color:#a5412b; }
.ri-market-table td:nth-child(2) { color:var(--accent); font-size:16px; }
.ri-market-table td { white-space:normal; min-width:130px; text-align:left; vertical-align:top; }
.ri-market-table th { text-align:left; }
.ri-market-table td:last-child { min-width:250px; }
.ri-flow { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin:20px 0 32px; }
.ri-flow-step { border-top:2px solid var(--accent); padding:18px; background:var(--bg-1); }
.ri-flow-step strong { display:block; margin:9px 0; font-weight:500; }
.ri-flow-step p { font-size:12px; }
.ri-flow-step button { margin-top:8px; }
@media (max-width:1100px) {
  #app[data-route-group="residential"] { padding:24px; }
  .ri-hero { gap:28px; grid-template-columns:1.2fr 1fr; }
  .ri-hero h2 { font-size:46px; }
  .ri-thesis { padding:26px; }
  .ri-grid-three { grid-template-columns:1fr; }
  .ri-grid-three .ri-card { display:block; }
  .ri-lab-layout { grid-template-columns:minmax(270px,.85fr) minmax(0,1.15fr); gap:20px; }
  .ri-field-grid { grid-template-columns:1fr; }
  .ri-stat { padding:18px; }
  .ri-stat>strong { font-size:27px; }
  .ri-next { gap:24px; }
}
@media (max-width:760px) {
  .topbar { grid-template-columns:1fr auto; gap:14px; padding:16px; position:relative; }
  .topbar .topbar-right { grid-column:2; grid-row:1; }
  .wing-switch { grid-column:1/-1; grid-row:2; justify-self:stretch; }
  .wing-switch button { flex:1; }
  .topbar .nav { grid-row:3; justify-content:flex-start; overflow-x:auto; padding-bottom:5px; }
  .topbar .nav-dropdown-menu { position:fixed; left:16px; right:16px; top:180px; }
  .brand-text p { max-width:200px; }
  #app[data-route-group="residential"] { padding:20px 16px 40px; }
  .ri-hero { grid-template-columns:1fr; gap:25px; margin-top:0; }
  .ri-hero-copy { padding:6px 0; }
  .ri-hero h2 { font-size:43px; }
  .ri-thesis h3 br { display:none; }
  .ri-thesis { padding:24px; border-radius:8px; }
  .ri-thesis h3 { font-size:29px; }
  .ri-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ri-metrics .ri-stat:nth-child(2) { border-right:0; }
  .ri-metrics .ri-stat:nth-child(-n+2) { border-bottom:1px solid var(--ri-line); }
  .ri-grid-two,.ri-lab-layout { grid-template-columns:1fr; }
  .ri-grid { gap:18px; }
  .ri-page-head { display:block; }
  .ri-page-head h2 { font-size:34px; }
  .ri-page-head .ri-btn { margin-top:10px; }
  .ri-card { padding:20px; }
  .ri-next { flex-direction:column; align-items:flex-start; gap:12px; }
  .ri-callout { display:block; }
  .ri-callout b { display:block; margin-bottom:6px; }
  .ri-filterbar { gap:12px; }
  .ri-filterbar>span { margin-left:0; width:100%; padding-bottom:0; }
  .ri-filterbar label { width:100%; }
  .ri-source-row { grid-template-columns:1fr; gap:10px; }
  .ri-source-date { display:flex; flex-wrap:wrap; gap:10px; }
  .ri-source-date span { margin-top:0; }
  .ri-flow { grid-template-columns:1fr 1fr; }
  .ri-field-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:420px) {
  .ri-split,.ri-field-grid { grid-template-columns:1fr; gap:14px; }
  .ri-stat>strong { font-size:25px; }
  .ri-card-top { flex-wrap:wrap; }
  .ri-result-metrics .ri-stat { padding:16px; }
  .ri-result-metrics .ri-stat>strong { font-size:24px; }
  .ri-hero h2 { font-size:37px; }
}
@media (prefers-reduced-motion:reduce) { .ri-shell * { scroll-behavior:auto !important; transition:none !important; } }
.ri-export-label { display:block; margin-top:18px; }
.ri-export-label textarea { display:block; width:100%; margin-top:8px; padding:12px; color:var(--text); background:var(--bg-1); border:1px solid var(--ri-line); border-radius:6px; font:12px/1.5 monospace; }
@media (max-width:600px) { .ri-flow { grid-template-columns:1fr; } }
.ri-rate-value { font-size:46px; font-weight:500; letter-spacing:-2px; margin:22px 0; }
.ri-rate-value small { font-size:24px; }
.ri-payment-bar { display:flex; height:20px; overflow:hidden; border-radius:4px; background:#ad8350; margin:20px 0; }
.ri-payment-bar span { display:block; height:100%; background:var(--accent); }
#ri-mortgage-form input,#ri-mortgage-form select { width:100%; }
.ri-btn:disabled { opacity:.55; cursor:not-allowed; }
.ri-mode-switch { display:inline-flex; align-items:center; gap:3px; padding:3px; border:1px solid var(--accent-border); border-radius:8px; background:var(--bg-1); flex-shrink:0; }
.ri-mode-switch button { border:0; border-radius:5px; padding:8px 12px; background:transparent; color:var(--text-secondary); font:600 11px var(--font); white-space:nowrap; cursor:pointer; }
.ri-mode-switch button.active { background:var(--accent); color:var(--bg-0); }
.ri-rent-hero { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr); gap:32px; align-items:stretch; margin:14px 0 28px; }
.ri-rent-hero>div { display:flex; flex-direction:column; align-items:flex-start; padding:22px 0; }
.ri-rent-hero h2 { font:400 clamp(40px,5vw,72px)/1.04 var(--font-serif); letter-spacing:-.055em; margin:24px 0 18px; }
.ri-rent-hero h2 em { color:var(--accent); font-weight:400; }
.ri-rent-hero>div>p { max-width:52ch; font-size:15px; line-height:1.8; }
.ri-rent-hero>div>small { margin-top:auto; }
.ri-rent-hero-aside { padding:30px; border:1px solid var(--accent-border); border-radius:10px; background:linear-gradient(145deg,var(--bg-2),var(--bg-1)); }
.ri-rent-hero-aside h3 { font:400 clamp(28px,3vw,42px)/1.12 var(--font-serif); letter-spacing:-.04em; margin:35px 0 26px; }
.ri-rent-hero-aside p { max-width:38ch; }
.ri-rent-area { border-top:2px solid var(--accent); }
.ri-rent-area .ri-lead { min-height:4em; }
.ri-rent-warning { border-left:2px solid #c58f4d; padding:5px 0 5px 14px; margin:18px 0; background:#c58f4d0b; }
.ri-rent-warning p { margin:3px 0; }
.ri-rent-checks { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; border-top:1px solid var(--ri-line); padding-top:17px; }
.ri-rent-checks p { font-size:11px; }
.ri-rent-forms { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; margin:22px 0; }
.ri-rent-forms .ri-input-panel { min-width:0; }
.ri-rent-forms h3 { margin:7px 0 20px; }
.ri-rent-checklist { display:flex; flex-wrap:wrap; gap:18px; margin-top:20px; }
.ri-rent-checklist label { display:flex; flex-direction:row; align-items:flex-start; gap:9px; max-width:42ch; }
.ri-rent-checklist input { accent-color:var(--accent); margin-top:3px; }
.ri-rent-live { margin:20px 0 32px; border-color:var(--accent-border); }
.ri-badge.ri-neutral { color:var(--text-secondary); background:var(--bg-2); border-color:var(--ri-line); }
.ri-rent-live .ri-mini-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media (max-width:950px) { .ri-rent-forms { grid-template-columns:1fr; } .ri-rent-hero { grid-template-columns:1fr; } .ri-rent-hero-aside h3 { margin:15px 0; } }
@media (max-width:760px) { .topbar .nav { justify-content:flex-start; } .ri-mode-switch { position:sticky; left:0; z-index:2; } .ri-rent-hero h2 { font-size:44px; } .ri-rent-checks { grid-template-columns:1fr; gap:4px; } .ri-rent-area .ri-lead { min-height:0; } .ri-rent-live .ri-mini-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:420px) { .ri-rent-hero h2 { font-size:38px; } .ri-rent-hero-aside { padding:23px; } .ri-rent-live .ri-mini-stats { grid-template-columns:1fr 1fr; } .ri-card-actions { flex-wrap:wrap; } }
