:root {
  color-scheme: dark;
  --paper: #f5f2ea;
  --paper-bright: #fbfaf6;
  --paper-deep: #e9e4d9;
  --ink: #15161d;
  --ink-soft: #42434a;
  --paper-line: #d5d0c5;
  --night: #07101f;
  --night-2: #0a1426;
  --night-3: #101c32;
  --night-4: #16233b;
  --text: #f6f7fb;
  --muted: #a8b1c2;
  --faint: #6f7b91;
  --line: rgba(221, 229, 245, 0.14);
  --line-strong: rgba(221, 229, 245, 0.28);
  --signal: #6675ff;
  --signal-bright: #8290ff;
  --signal-violet: #7b61d8;
  --positive: #7f91ff;
  --negative: #ef8c9f;
  --warning: #d8ad74;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --header-h: 68px;
  --metric-h: 92px;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--night);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button,
select,
input { font: inherit; }

a { color: inherit; text-decoration: none; }

button,
summary,
select { cursor: pointer; }

button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--signal-bright);
  outline-offset: 3px;
}

h1,
h2,
h3,
p { margin: 0; }

fieldset { margin: 0; padding: 0; border: 0; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 12px 16px;
  background: var(--paper-bright);
  color: var(--ink);
  border: 1px solid var(--paper-line);
  transition: top 180ms ease;
}

.skip-link:focus { top: 16px; }

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr);
}

/* Studio2 ecosystem shell */
.ecosystem-header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(72px, 1fr);
  align-items: stretch;
  background: var(--paper-bright);
  color: var(--ink);
  border-bottom: 1px solid var(--paper-line);
  position: relative;
  z-index: 50;
}

.studio2-wordmark {
  align-self: center;
  justify-self: start;
  padding-left: 34px;
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.ecosystem-nav {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.ecosystem-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 17px;
  color: #3c3d43;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.ecosystem-nav a::after {
  content: "";
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: 0;
  height: 2px;
  background: transparent;
}

.ecosystem-nav a:hover::after,
.ecosystem-nav a.active::after { background: var(--ink); }

.ecosystem-nav a.active { color: var(--ink); font-weight: 700; }
.ecosystem-nav span { color: #686971; font-size: 0.58rem; }

.studio2-avatar {
  width: 34px;
  height: 34px;
  align-self: center;
  justify-self: end;
  margin-right: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #8f8e8a;
  border-radius: 50%;
  font: 500 0.68rem var(--serif);
}

/* Main Velocity composition */
.velocity-app {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--metric-h);
  background: var(--night);
}

.velocity-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(225px, 17.5vw, 292px) minmax(420px, 1fr) clamp(300px, 24vw, 390px);
  background: var(--night);
}

.product-intro,
.velocity-window {
  background:
    radial-gradient(circle at 40% 14%, rgba(70, 92, 163, 0.12), transparent 30%),
    linear-gradient(180deg, #081222 0%, #07101f 100%);
}

.product-intro {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3.5vw, 58px) clamp(22px, 2.2vw, 38px) 25px;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.section-index,
.product-subtitle,
.coverage-label,
.intro-guidance > span,
.eyebrow,
.popover-label {
  color: var(--signal-bright);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.product-intro h1 {
  margin: 10px 0 5px;
  font: 500 clamp(3.4rem, 5.2vw, 5.8rem) / 0.9 var(--serif);
  letter-spacing: -0.055em;
}

.product-subtitle { color: #d7dbe5; margin-top: 15px; }

.product-description {
  max-width: 26ch;
  margin-top: 17px;
  color: #bac2d1;
  font-size: 0.82rem;
  line-height: 1.65;
}

.coverage-summary {
  margin-top: auto;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.coverage-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
  color: #d8dde8;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-dot,
.pulse-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--signal-bright);
  box-shadow: 0 0 0 5px rgba(102, 117, 255, 0.11), 0 0 20px rgba(102, 117, 255, 0.85);
}

.coverage-label { color: var(--faint); margin-bottom: 5px; }
.coverage-summary strong { display: block; font-size: 0.78rem; color: #edf0f7; }
.coverage-summary small {
  display: -webkit-box;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.48;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.intro-guidance { padding: 18px 0 4px; }
.intro-guidance > span { color: var(--faint); }
.intro-guidance p { margin-top: 6px; color: var(--muted); font-size: 0.68rem; line-height: 1.48; }

.lens-summary {
  margin-top: 15px;
  color: #6f7b91;
  font-size: 0.62rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-region {
  min-width: 0;
  min-height: 0;
  position: relative;
  background: #06101f;
}

.map-shell {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 65% 35%, rgba(58, 73, 154, 0.18), transparent 32%),
    #06101f;
}

#map { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Compact top filters */
.filter-dock {
  position: absolute;
  z-index: 20;
  top: 17px;
  left: 17px;
  right: 17px;
  display: grid;
  grid-template-columns: minmax(108px, 0.7fr) minmax(120px, 0.8fr) minmax(160px, 1.15fr) minmax(142px, 1fr) 48px;
  gap: 6px;
  pointer-events: none;
}

.filter-dock > * { pointer-events: auto; }

.compact-filter,
.filter-menu > summary {
  height: 45px;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 16, 31, 0.88);
  color: var(--text);
  backdrop-filter: blur(18px);
  list-style: none;
}

.filter-dock > :first-child { border-radius: 3px 0 0 3px; }
.filter-menu:last-child > summary { border-radius: 0 3px 3px 0; }

.compact-filter > span,
.filter-menu > summary > span:not(.tools-icon) {
  color: #8792a8;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.compact-filter strong,
.filter-menu > summary > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eff1f7;
  font-size: 0.67rem;
  font-weight: 600;
}

.filter-menu { position: relative; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary::marker { content: ""; }
.filter-menu:not(.tools-menu) > summary { padding-right: 27px; }
.filter-menu:not(.tools-menu) > summary::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 20px;
  width: 5px;
  height: 5px;
  border-right: 1px solid #8d98ad;
  border-bottom: 1px solid #8d98ad;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}
.filter-menu[open]:not(.tools-menu) > summary::after { transform: rotate(225deg); top: 22px; }

.select-filter { padding: 0; }
.select-filter > span { padding: 7px 28px 0 13px; }
.select-filter select {
  width: 100%;
  min-width: 0;
  height: 24px;
  margin: -1px 0 0;
  padding: 0 28px 6px 13px;
  appearance: none;
  border: 0;
  outline: 0;
  background:
    linear-gradient(45deg, transparent 50%, #8792a8 50%) calc(100% - 17px) 7px / 4px 4px no-repeat,
    linear-gradient(135deg, #8792a8 50%, transparent 50%) calc(100% - 13px) 7px / 4px 4px no-repeat;
  color: #eff1f7;
  font-size: 0.67rem;
  font-weight: 600;
}

.select-filter select option,
.control-grid select option { background: #101a2e; color: white; }

.tools-menu > summary {
  place-items: center;
  padding: 0;
}

.tools-icon { width: 20px; display: grid; gap: 4px; }
.tools-icon i { height: 1px; background: #aab3c4; position: relative; }
.tools-icon i:nth-child(1)::after,
.tools-icon i:nth-child(2)::after,
.tools-icon i:nth-child(3)::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 5px;
  height: 5px;
  border: 1px solid #aab3c4;
  border-radius: 50%;
  background: #07101f;
}
.tools-icon i:nth-child(1)::after { left: 3px; }
.tools-icon i:nth-child(2)::after { right: 3px; }
.tools-icon i:nth-child(3)::after { left: 8px; }

.filter-popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 80;
  border: 1px solid var(--line-strong);
  background: rgba(8, 17, 33, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.tier-popover { left: 0; right: auto; width: 300px; padding: 18px; }
.period-popover { width: min(360px, 80vw); padding: 18px; }
.tools-popover {
  width: min(620px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 150px));
  overflow: auto;
  padding: 22px;
}

.tier-filter legend,
.control-grid label,
.case-study-label {
  color: #8e99ad;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tier-filter-header,
.tier-shortcuts,
.timeline-header,
.section-title-row,
.stream-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tier-filter-header { margin-top: 10px; }
.tier-filter-header p { color: var(--muted); font-size: 0.68rem; line-height: 1.4; }
.tier-shortcuts { gap: 6px; }

button,
.case-artist-input {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  border-radius: 2px;
}

button {
  min-height: 34px;
  padding: 8px 11px;
  font-weight: 600;
}

button:hover { background: rgba(255, 255, 255, 0.10); }
button:disabled { cursor: progress; opacity: 0.58; }

.mini-button { min-height: 28px; padding: 5px 8px; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.08em; }

.tier-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.check-chip {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  color: #e8ebf2;
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.check-chip:hover { border-color: var(--line-strong); }
.check-chip input { width: 14px; height: 14px; margin: 0; accent-color: var(--signal); }
.check-chip input:checked + span { color: var(--signal-bright); }
.control-note { display: block; margin-top: 12px; color: var(--faint); font-size: 0.62rem; line-height: 1.42; }

.timeline-header strong,
.popover-section-heading h2,
.activity-section h2 { font: 500 1.4rem / 1.05 var(--serif); }

.timeline-header button,
.stream-title-row button { min-height: 30px; font-size: 0.64rem; }

input[type="range"] {
  width: 100%;
  margin-top: 18px;
  accent-color: var(--signal);
}

.popover-label { color: var(--faint); margin-bottom: 5px; }
.advanced-controls { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 17px; }
.control-grid label { display: grid; gap: 7px; }
.control-grid select {
  width: 100%;
  min-height: 42px;
  appearance: none;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background:
    linear-gradient(45deg, transparent 50%, #8792a8 50%) calc(100% - 17px) 18px / 4px 4px no-repeat,
    linear-gradient(135deg, #8792a8 50%, transparent 50%) calc(100% - 13px) 18px / 4px 4px no-repeat,
    rgba(255,255,255,.035);
  color: var(--text);
  font-size: 0.7rem;
}

.activity-section { padding-top: 22px; }
.activity-section + .activity-section { margin-top: 22px; border-top: 1px solid var(--line); }
.section-note { color: var(--faint); font-size: 0.62rem; }

.movers-list { display: grid; gap: 0; margin-top: 13px; }
.mover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.mover strong { display: block; color: #eef1f7; font-size: 0.72rem; }
.mover small { display: block; margin-top: 3px; color: var(--faint); font-size: 0.61rem; line-height: 1.35; }
.pill { align-self: center; color: var(--signal-bright); font: 500 1.05rem var(--serif); }
.pill.down { color: var(--negative); }

.stream-log { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 7px; }
.stream-log li { padding: 9px 10px; border-left: 2px solid var(--signal); background: rgba(255,255,255,.03); color: var(--muted); font-size: 0.64rem; line-height: 1.4; }

/* Map overlays */
.map-floating,
.formula {
  position: absolute;
  z-index: 8;
  border: 1px solid var(--line-strong);
  background: rgba(7, 16, 31, 0.78);
  backdrop-filter: blur(18px);
}

.map-status {
  left: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  color: #aab3c4;
  font-size: 0.63rem;
  letter-spacing: 0.04em;
}

.velocity-key {
  left: 20px;
  bottom: 73px;
  width: 160px;
  padding: 13px;
}

.legend-title { display: block; color: #e8ebf2; font-size: 0.65rem; font-weight: 600; }
.legend-scale { display: flex; align-items: center; gap: 7px; margin: 13px 0 8px; }
.legend-scale i { display: block; border-radius: 50%; background: #35426c; box-shadow: 0 0 14px rgba(103,118,255,.28); }
.legend-scale i:nth-child(1) { width: 7px; height: 7px; opacity: .5; }
.legend-scale i:nth-child(2) { width: 9px; height: 9px; opacity: .65; }
.legend-scale i:nth-child(3) { width: 11px; height: 11px; background: #4f5fba; }
.legend-scale i:nth-child(4) { width: 13px; height: 13px; background: #6575ee; }
.legend-scale i:nth-child(5) { width: 15px; height: 15px; background: #8290ff; }
.legend-labels { display: flex; justify-content: space-between; color: var(--faint); font-size: 0.52rem; }

.map-instruction {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  color: #7d899d;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.formula {
  right: 20px;
  bottom: 20px;
  width: min(350px, calc(100% - 40px));
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.5;
}
.formula summary { padding: 10px 12px; list-style: none; color: #dfe3eb; font-weight: 600; }
.formula summary::-webkit-details-marker { display: none; }
.formula p { padding: 0 12px 13px; }
.formula:not([open]) { width: auto; }

/* Signal read */
.velocity-window {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 43px minmax(0, 1fr);
  border-left: 1px solid var(--line);
  transition: transform 240ms ease;
}

.signal-read-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: #9ea8ba;
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.signal-read-header b { color: #eef1f7; font-size: 0.61rem; }
.close-button { display: none; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; }

.velocity-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(23px, 2.25vw, 38px) clamp(20px, 2.2vw, 34px) 35px;
}

.velocity-content h2 {
  font: 500 clamp(2.15rem, 2.6vw, 3.25rem) / 0.98 var(--serif);
  letter-spacing: -0.045em;
}

.velocity-content h3 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.025em; }
.velocity-content p,
.velocity-content li { color: var(--muted); font-size: 0.72rem; line-height: 1.58; }
.velocity-content ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; }
.velocity-content code { padding: 2px 4px; background: rgba(255,255,255,.05); color: #e4e8f1; }
.empty-state { align-content: center; }
.empty-state > p { max-width: 35ch; }
.empty-read-lines { display: grid; gap: 8px; margin-top: 8px; }
.empty-read-lines span { display: block; height: 1px; background: var(--line); }
.empty-read-lines span:nth-child(2) { width: 72%; }
.empty-read-lines span:nth-child(3) { width: 45%; }

.eyebrow { margin-bottom: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: #9da7b9;
  font-size: 0.57rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.read-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.metric-card { padding: 14px 10px 14px 0; }
.metric-card + .metric-card { padding-left: 12px; border-left: 1px solid var(--line); }
.metric-card span { display: block; color: var(--signal-bright); font-size: 0.54rem; letter-spacing: 0.08em; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 5px; font: 500 1.85rem var(--serif); }

.read-section { display: grid; gap: 9px; padding-top: 17px; border-top: 1px solid var(--line); }
.read-section > h3 { color: #e8ebf2; text-transform: uppercase; letter-spacing: 0.09em; font-size: 0.58rem; }
.driver-card { display: grid; gap: 7px; padding: 13px 0; border-top: 1px solid var(--line); }
.driver-card:first-of-type { border-top: 0; padding-top: 3px; }
.driver-card h3 { font: 500 1.2rem / 1.05 var(--serif); }
.driver-card strong { color: #dce1eb; }
.source-note { color: #8995aa !important; font-size: 0.62rem !important; }

.artist-moment-list { display: grid; gap: 0; }
.artist-moment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.artist-moment-card strong { display: block; color: #eff2f8; font-size: 0.74rem; }
.artist-moment-card small { display: block; margin-top: 4px; color: #8e99ac; font-size: 0.59rem; line-height: 1.4; }
.artist-moment-card p { margin-top: 5px; font-size: 0.64rem; }
.artist-moment-card button { min-height: 28px; font-size: 0.58rem; }

.case-study-section,
.export-section { gap: 12px; }
.case-study-label { display: grid; gap: 7px; }
.case-artist-input { width: 100%; min-height: 40px; padding: 9px 11px; outline: 0; }
#caseStudyButton,
#copyCaseStudyButton,
#downloadPptButton,
#downloadVelocityPptButton { width: 100%; background: linear-gradient(90deg, #30337f, #393d9e); border-color: rgba(133,143,255,.45); }
.case-study-result { display: grid; gap: 12px; }
.case-study-card { display: grid; gap: 11px; padding: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.linkedin-post { white-space: pre-wrap; padding: 12px; background: rgba(0,0,0,.16); border-left: 2px solid var(--signal); color: #dfe3eb; font-size: 0.68rem; line-height: 1.48; }
.export-button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.loading-card { display: grid; gap: 13px; align-self: center; }
.loader { display: flex; gap: 6px; }
.loader span { width: 7px; height: 7px; border-radius: 50%; background: var(--signal-bright); animation: blink 1s ease-in-out infinite; }
.loader span:nth-child(2) { animation-delay: 120ms; }
.loader span:nth-child(3) { animation-delay: 240ms; }
@keyframes blink { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* Bottom score strip */
.metric-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: 0.8fr 1.1fr 0.9fr 0.9fr 1.65fr;
  background: linear-gradient(180deg, #091325, #07101f);
  border-top: 1px solid var(--line);
}

.metric-strip article {
  min-width: 0;
  display: grid;
  align-content: center;
  padding: 14px 22px;
  border-right: 1px solid var(--line);
}
.metric-strip article:first-child { padding-left: 30px; }
.metric-strip article:last-child { border-right: 0; }
.metric-strip span { color: #768299; font-size: 0.53rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.metric-strip b {
  min-width: 0;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f0f2f7;
  font: 500 1.35rem / 1 var(--serif);
}
.metric-strip .evidence-basis b { font: 500 0.69rem var(--sans); }
.metric-strip small { display: block; margin-top: 5px; color: #68758b; font-size: 0.55rem; }

/* MapLibre refinement */
.maplibregl-canvas { filter: saturate(.78) contrast(1.06); }
.maplibregl-ctrl-group {
  border: 1px solid var(--line-strong) !important;
  border-radius: 2px !important;
  background: rgba(7,16,31,.8) !important;
  box-shadow: none !important;
}
.maplibregl-ctrl-group button { min-height: 29px; border: 0; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) opacity(.8); }
.maplibregl-ctrl-attrib { background: rgba(7,16,31,.68) !important; color: #7c879b !important; font-size: 8px !important; }
.maplibregl-ctrl-attrib a { color: #9ba6b8 !important; }
.maplibregl-popup-content {
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(7,16,31,.97);
  color: #e9ecf3;
  box-shadow: var(--shadow);
  font: 0.68rem/1.5 var(--sans);
}
.maplibregl-popup-tip { border-top-color: rgba(7,16,31,.97) !important; }
.popup-link { display: inline-block; margin-top: 7px; color: var(--signal-bright); font-weight: 600; }

/* Responsive states */
@media (max-width: 1280px) {
  .velocity-workspace { grid-template-columns: 230px minmax(420px, 1fr) 330px; }
  .filter-dock { grid-template-columns: 95px 110px minmax(142px, 1fr) minmax(125px, .9fr) 45px; }
  .product-intro { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 1080px) {
  .ecosystem-header { grid-template-columns: 155px 1fr 58px; }
  .studio2-wordmark { padding-left: 22px; }
  .ecosystem-nav { justify-content: center; gap: 0; }
  .ecosystem-nav a { padding: 0 11px; }
  .studio2-avatar { margin-right: 14px; }

  .velocity-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .velocity-window {
    position: fixed;
    z-index: 100;
    top: calc(var(--header-h) + 12px);
    right: 12px;
    bottom: 12px;
    width: min(400px, calc(100vw - 24px));
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateX(calc(100% + 30px));
  }
  .velocity-window.is-open { transform: translateX(0); }
  .close-button { display: grid; place-items: center; }
  .metric-strip { grid-template-columns: repeat(4, 1fr); }
  .metric-strip .evidence-basis { display: none; }
}

@media (max-width: 780px) {
  :root { --header-h: 58px; --metric-h: auto; }
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .ecosystem-header { position: sticky; top: 0; grid-template-columns: 1fr auto; }
  .ecosystem-nav { display: none; }
  .studio2-wordmark { padding-left: 18px; }
  .studio2-avatar { margin-right: 14px; }
  .velocity-app { display: flex; flex-direction: column; }
  .velocity-workspace { display: flex; flex-direction: column; min-height: auto; }
  .map-region { order: 1; height: 68vh; min-height: 520px; }
  .product-intro { order: 2; border-right: 0; border-top: 1px solid var(--line); min-height: auto; }
  .coverage-summary { margin-top: 36px; }
  .filter-dock {
    left: 10px;
    right: 10px;
    top: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
  }
  .market-filter { display: grid; grid-column: 1; grid-row: 1; }
  .select-filter:not(.market-filter) { grid-column: 2; grid-row: 1; }
  .tier-menu { grid-column: 1; grid-row: 2; }
  .period-menu { grid-column: 2; grid-row: 2; }
  .tools-menu { grid-column: 3; grid-row: 1 / 3; }
  .filter-menu:last-child > summary { height: 96px; }
  .tools-popover { right: -1px; width: min(620px, calc(100vw - 20px)); }
  .tier-popover { left: 0; }
  .velocity-key { bottom: 68px; }
  .map-status { bottom: 15px; }
  .map-instruction { display: none; }
  .formula { right: 10px; bottom: 15px; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article { min-height: 82px; }
  .metric-strip article:first-child { padding-left: 22px; }
  .velocity-window { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 76vh; transform: translateY(calc(100% + 28px)); }
  .velocity-window.is-open { transform: translateY(0); }
}

@media (max-width: 520px) {
  .map-region { min-height: 470px; }
  .product-intro h1 { font-size: 4.3rem; }
  .tools-popover { padding: 17px; }
  .control-grid { grid-template-columns: 1fr; }
  .tier-popover { width: min(300px, calc(100vw - 20px)); }
  .period-popover { width: min(330px, calc(100vw - 20px)); }
  .velocity-key { display: none; }
  .formula { max-width: 210px; }
  .read-meta { grid-template-columns: 1fr; }
  .metric-card + .metric-card { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .export-button-row { grid-template-columns: 1fr; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
