:root {
  color-scheme: light;
  --bg: #fdfffe;
  --ink: #0c3124;
  --ink-strong: #0d0d0d;
  --muted: #5a6b64;
  --faint: #83968f;
  --faintest: #b0c4bb;
  --line: #e5eeea;
  --line-hover: #c5ddd4;
  --line-soft: #eef3f0;
  --surface: #fafbfa;
  --surface-2: #f2f8f5;
  --green: #009859;
  --green-bright: #12d16b;
  --shadow-pop: 0 12px 40px rgba(12, 49, 36, 0.14);
  --font-ui: "Archivo", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "DM Mono", monospace;
  --font-serif: "Playfair Display", Georgia, serif;
}

* {
  box-sizing: border-box;
}

/* Component display rules below would otherwise defeat the hidden attribute */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

::selection {
  background: #c9f4dd;
  color: var(--ink);
}

@keyframes asspin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes asrise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.as-scroll::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
.as-scroll::-webkit-scrollbar-thumb {
  background: #d6e4dd;
  border-radius: 999px;
}
.as-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* Hero */

.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f4fbf7 0%, #fdfffe 100%);
  overflow: hidden;
}

.bracket {
  position: absolute;
  width: 30px;
  height: 30px;
  pointer-events: none;
}
.bracket-tl {
  top: 18px;
  left: 14px;
  border-top: 5px solid var(--green-bright);
  border-left: 5px solid var(--green-bright);
  border-top-left-radius: 8px;
}
.bracket-br {
  bottom: 18px;
  right: 14px;
  border-bottom: 5px solid var(--green-bright);
  border-right: 5px solid var(--green-bright);
  border-bottom-right-radius: 8px;
}

.hero-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px clamp(20px, 3.5vw, 46px) clamp(18px, 2.6vw, 30px);
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(18px, 2.4vw, 26px);
}

.brand-wordmark {
  height: 26px;
  width: auto;
  display: block;
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  max-width: 18ch;
  text-wrap: balance;
}

.hero-lede {
  margin: 16px 0 0;
  max-width: 62ch;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.55;
  color: var(--muted);
}

/* Wave spine — narrative only, intentionally non-interactive */

.wave-spine {
  display: flex;
  gap: 10px;
  margin-top: clamp(20px, 2.6vw, 28px);
  overflow-x: auto;
  padding-bottom: 6px;
}

.spine-card {
  flex: 1 0 158px;
  min-width: 158px;
  text-align: left;
  border: 1.5px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  padding: 13px 14px;
  --spine-accent: var(--ink);
}
.spine-card.is-current {
  border-color: var(--line-hover);
  background: var(--surface-2);
  --spine-accent: var(--green);
}

.spine-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--spine-accent);
  letter-spacing: 0;
}

.spine-name {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  min-height: 31px;
}

.spine-count-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.spine-count {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--spine-accent);
}

.spine-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.spine-bar-fill {
  display: block;
  height: 100%;
  background: var(--spine-accent);
  border-radius: 999px;
}

/* Sticky controls */

.controls {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(253, 255, 254, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.controls-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px clamp(20px, 3.5vw, 46px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  background: transparent;
  color: var(--faint);
  font-weight: 500;
}
.view-tab.is-active {
  background: #ffffff;
  color: var(--green);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(12, 49, 36, 0.1);
}

.search {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
  display: block;
}
.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 14px 0 38px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: 0;
  transition: border-color 0.15s, background 0.15s;
}
.search input:focus {
  border-color: var(--green);
  background: var(--surface-2);
}

.filter {
  position: relative;
}

.filter-button {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  min-width: 150px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  justify-content: space-between;
}
.filter-button-status {
  min-width: 140px;
}
.filter.is-open .filter-button,
.filter.has-selection .filter-button {
  border-color: var(--green);
}

.filter-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.filter.is-open .chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  width: max(280px, 100%);
  max-height: min(440px, 70vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-pop);
  animation: asrise 0.16s cubic-bezier(0.34, 1.1, 0.64, 1);
}
.filter-menu-theme {
  width: max(300px, 100%);
}
.filter-menu-status {
  left: auto;
  right: 0;
  width: max(220px, 100%);
}

.filter-clear {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
}

.filter-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
}
.filter-menu-status .filter-option {
  align-items: center;
}
.filter-option:hover {
  background: var(--surface-2);
}
.filter-option input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--green);
}
.filter-menu-status .filter-option input {
  margin-top: 0;
}
.filter-option span {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.3;
}

/* Main */

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(16px, 2.4vw, 26px) clamp(20px, 3.5vw, 46px) 56px;
}

.state-panel {
  min-height: 50vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 20px;
}
.state-error {
  max-width: 420px;
}
.state-error-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #fdecec;
  display: grid;
  place-items: center;
  color: #c53030;
  font-size: 24px;
  font-weight: 700;
}
.state-error-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.state-error-hint {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--faint);
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.summary-card {
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  background: #ffffff;
}
.summary-value {
  display: block;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.summary-card.is-green .summary-value {
  color: var(--green);
}
.summary-label {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--faint);
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 20px;
}
.result-count {
  font-size: 13px;
  color: var(--faint);
}
.result-count strong {
  color: var(--ink);
  font-weight: 600;
}
.clear-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--green);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.clear-all:hover {
  background: var(--surface-2);
}

.view-panel {
  display: none;
}
.view-panel.is-active {
  display: block;
}

/* Status pills */

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  background: #f1f3f2;
  color: #6b7280;
}
.status-pill.status-active {
  background: rgba(0, 152, 89, 0.1);
  color: #047857;
}
.status-pill.status-acquired {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}
.status-pill.status-public {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}
.status-pill--sm {
  height: 18px;
  padding: 0 7px;
  font-size: 11px;
}

/* Logos */

.logo {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--faint);
  font-weight: 700;
  flex: 0 0 auto;
}
.logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.logo-card {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.logo-mini {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #ffffff;
  font-size: 11px;
}
.logo-row {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 12px;
}
.logo-drawer {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  font-size: 18px;
}

/* Timeline view */

.timeline {
  display: grid;
  gap: clamp(18px, 2.4vw, 30px);
}

.wave-block {
  display: grid;
  grid-template-columns: minmax(190px, 238px) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 22px);
  align-items: start;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}

.wave-head {
  position: sticky;
  top: 78px;
  align-self: start;
}
.wave-head-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 8px;
}
.wave-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.wave-head-summary {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--faint);
}
.wave-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wave-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}
.wave-chip-count {
  border: 0;
  background: var(--ink);
  color: #ffffff;
  font-weight: 500;
}
.wave-chip-theme {
  background: var(--surface-2);
  color: var(--ink);
}

.wave-cloud {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 8px;
  min-height: 48px;
}

.company-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.company-card:hover {
  border-color: var(--line-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(12, 49, 36, 0.09);
}
.company-card-body {
  min-width: 0;
  display: block;
}
.company-card-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.company-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.company-card-year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}
.company-card-theme {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}

/* Category view */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 14px;
}

.category-card {
  border: 1.5px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
}
.category-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.category-count {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--faint);
}
.category-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.keyword-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
}
.category-bars {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}
.category-bar {
  display: grid;
  grid-template-columns: 78px 1fr 34px;
  gap: 9px;
  align-items: center;
  font-size: 11.5px;
  color: var(--faint);
}
.category-bar-label {
  font-family: var(--font-mono);
}
.category-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.category-bar-fill {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 999px;
}
.category-bar-count {
  text-align: right;
  color: var(--ink);
  font-weight: 600;
}

.category-companies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.mini-card {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.mini-card:hover {
  border-color: var(--line-hover);
  background: #ffffff;
}
.mini-card-body {
  min-width: 0;
  display: block;
}
.mini-card-name {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-card-year {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
}

.category-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
}

/* Location view */

.location-note {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--faint);
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 14px;
  align-items: start;
}

.location-card {
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
}
.location-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.location-card h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.location-count {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.location-subtitle {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--faint);
}
.location-bar {
  display: block;
  height: 8px;
  margin: 12px 0 14px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.location-bar-fill {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 999px;
}
.location-companies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.location-more {
  margin-top: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--green);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.location-more:hover {
  text-decoration: underline;
}

/* Company panels (map city drill-down, word drill-down) */

.companies-panel {
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  margin: 0 0 16px;
  animation: asrise 0.25s ease;
}
#wordCompanies {
  margin: 16px 0 0;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.panel-close {
  margin-left: auto;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.panel-close:hover {
  border-color: var(--line-hover);
  color: var(--ink);
}
.panel-sub {
  margin: 4px 0 12px;
  font-size: 12.5px;
  color: var(--faint);
}

/* Location map */

.location-map-wrap {
  position: relative;
  margin: 0 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.map-svg {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #f5fbf8 0%, #fdfffe 70%);
}
.location-map-wrap.is-armed {
  border-color: var(--line-hover);
}
.location-map-wrap.is-zoomed .map-svg {
  cursor: grab;
}
.location-map-wrap.is-zoomed .map-svg.is-dragging {
  cursor: grabbing;
}

.map-graticule {
  fill: none;
  stroke: #edf4f0;
  stroke-width: 1;
}

.map-land {
  fill: #e2ebe5;
  stroke: #cfdfd6;
  stroke-width: 1;
}

.map-bubble {
  fill: rgba(0, 152, 89, 0.4);
  stroke: #00794a;
  stroke-width: 1.1;
  cursor: pointer;
  transition: fill 0.15s;
}
.map-bubble:hover {
  fill: rgba(0, 152, 89, 0.74);
}
.map-bubble.is-selected {
  fill: rgba(0, 152, 89, 0.8);
  stroke: var(--ink);
  stroke-width: 1.6;
}

.map-label {
  font-family: var(--font-mono);
  fill: #44574e;
  stroke: rgba(253, 255, 254, 0.92);
  stroke-linejoin: round;
  paint-order: stroke;
  pointer-events: none;
}

.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-ctrl {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.map-ctrl:hover:not(:disabled) {
  border-color: var(--line-hover);
  color: var(--green);
}
.map-ctrl:disabled {
  color: var(--faintest);
  cursor: default;
}
.map-ctrl-reset {
  font-size: 14px;
}

.map-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px dashed var(--line);
  background: var(--surface);
}
.map-offmap-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.map-offmap-pill:hover {
  border-color: var(--line-hover);
  color: var(--ink);
}
.map-offmap-pill strong {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
}
.map-missing {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}
.map-hint {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faintest);
}
@media (hover: none) {
  .map-hint {
    display: none;
  }
}
/* viewBox-proportional labels shrink below legibility on phones */
@media (max-width: 560px) {
  .map-labels {
    display: none;
  }
}

/* Words view */

.word-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: clamp(18px, 3.5vw, 32px);
}
.word-cloud .cloud-empty {
  flex: 1 1 100%;
}

.word-chip {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink);
  opacity: var(--word-opacity, 1);
  cursor: pointer;
  transition: color 0.15s, opacity 0.15s;
}
.word-chip:hover {
  color: var(--green);
  opacity: 1;
}
.word-chip.is-top {
  color: var(--green);
  font-weight: 600;
}

.word-freq {
  margin-left: 3px;
  font-family: var(--font-mono);
  font-size: 0.52em;
  font-weight: 400;
  color: var(--faint);
}

/* Table view */

.table-wrap {
  overflow: auto;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

#companyTable {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 13.5px;
}

#companyTable th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-2);
  border-bottom: 1.5px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.sort-arrow {
  color: var(--green);
}

#companyTable tbody tr {
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
#companyTable tbody tr:hover {
  background: var(--surface);
}

#companyTable td {
  padding: 11px 14px;
  vertical-align: top;
}

.row-company {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 220px;
}
.row-company-body {
  min-width: 0;
}
.row-company-name {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}
.row-company-oneliner {
  display: block;
  margin-top: 2px;
  max-width: 380px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--faint);
}
.row-year {
  font-family: var(--font-mono);
  color: var(--muted);
}
.row-wave {
  color: var(--muted);
  white-space: nowrap;
}
.row-subindustry {
  color: var(--muted);
}
.row-location {
  color: var(--muted);
  max-width: 200px;
  font-size: 12.5px;
}
.row-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 260px;
}
.row-theme-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
}

.table-empty {
  padding: 32px;
  text-align: center;
  color: var(--faint);
  font-size: 14px;
}

/* Footer */

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 10px;
}
.footer-wordmark {
  height: 22px;
  width: auto;
}
.footer-credit {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.footer-credit strong {
  color: var(--ink);
  font-weight: 600;
}
.footer-credit a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}
.footer-social {
  display: flex;
  gap: 8px;
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12.5px;
  text-decoration: none;
}
.footer-social a:hover {
  background: var(--surface-2);
}
.footer-source {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--faint);
}
.footer-source a {
  color: var(--muted);
}
.footer-updated {
  font-family: var(--font-mono);
  color: var(--ink);
}

/* Tooltip */

.tooltip {
  position: fixed;
  z-index: 80;
  left: 0;
  top: 0;
  width: min(330px, calc(100vw - 24px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.tooltip-inner {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #ffffff;
  box-shadow: 0 12px 40px rgba(12, 49, 36, 0.16);
}
.tooltip-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 7px;
}
.tooltip-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tooltip-oneliner {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.tooltip-founders {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--faint);
}
.tooltip-founders strong {
  color: var(--ink);
  font-weight: 600;
}
.tooltip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tooltip-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 11px;
}
.tooltip-unclassified {
  font-size: 11px;
  color: var(--faint);
}
.tooltip-signals {
  margin: 9px 0 0;
  font-size: 11px;
  color: var(--faint);
}
.tooltip-signals strong {
  color: var(--ink);
  font-weight: 600;
}
.tooltip-citycount {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--green);
}
.tooltip-maphint {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: var(--faintest);
}

/* Drawer */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(12, 49, 36, 0.3);
  transition: opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}
.scrim.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: min(520px, 100vw);
  height: 100vh;
  overflow: auto;
  background: #ffffff;
  box-shadow: -12px 0 50px rgba(12, 49, 36, 0.16);
  transform: translateX(102%);
  transition: transform 0.26s cubic-bezier(0.23, 1, 0.32, 1);
}
.drawer.is-open {
  transform: translateX(0);
}

.drawer-body {
  position: relative;
  padding: clamp(18px, 3vw, 26px);
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.drawer-close:hover {
  background: var(--surface-2);
}

.drawer-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding-right: 44px;
}
.drawer-head h2 {
  margin: 0 0 7px;
  font-size: clamp(1.4rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.drawer-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.drawer-head-body {
  min-width: 0;
}
.drawer-batch {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.badge-top {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
}
.badge-hiring {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--green);
  font-size: 11px;
  font-weight: 500;
}

.drawer-section {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.drawer-section-label {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.drawer-section-wave .drawer-section-label {
  margin-bottom: 4px;
}
.drawer-section-text .drawer-section-label {
  margin-bottom: 8px;
}
.drawer-wave-line {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.drawer-wave-line .wave-code {
  font-family: var(--font-mono);
  color: var(--green);
}
.drawer-wave-summary {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--faint);
}
.drawer-oneliner {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.drawer-longdesc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-line;
}

.founder-list {
  display: grid;
  gap: 8px;
}
.founder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--surface);
}
.founder-id {
  min-width: 0;
}
.founder-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.founder-title {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--faint);
}
.founder-links {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.founder-links a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
}
.founder-links a:hover {
  background: var(--surface-2);
}
.founder-nolinks {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
  color: var(--faintest);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 9px;
}
.detail-cell {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  background: var(--surface);
}
.detail-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--faint);
}
.detail-value {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.signal-list {
  display: grid;
  gap: 8px;
}
.signal-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}
.signal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}
.signal-hits {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.4;
}

.drawer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.drawer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  transition: opacity 0.15s;
}
.drawer-links a.is-primary {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}
.drawer-links a:hover {
  opacity: 0.86;
}

/* Wave rail — floating jump navigation for the timeline view */

.wave-rail {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 10px 8px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.wave-rail::before {
  content: "";
  position: absolute;
  left: 12.25px;
  top: 20px;
  bottom: 20px;
  width: 1.5px;
  background: var(--line);
}

.wave-rail-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  padding: 7px 0;
  cursor: pointer;
  font-family: inherit;
}

.wave-rail-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1.5px solid var(--faintest);
  background: #ffffff;
  flex: 0 0 auto;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.wave-rail-node:hover .wave-rail-dot {
  border-color: var(--green);
}
.wave-rail-node.is-active .wave-rail-dot {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 152, 89, 0.15);
}

.wave-rail-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  transition: color 0.15s;
}
.wave-rail-node.is-active .wave-rail-label {
  color: var(--green);
  font-weight: 500;
}

/* Below this width the gutter can't fit inline labels: collapse to dots and
   float only the active label as a chip so the position stays readable. */
@media (max-width: 1499px) {
  .wave-rail-label {
    display: none;
  }
  .wave-rail-node.is-active .wave-rail-label {
    display: block;
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 9px;
    box-shadow: 0 4px 14px rgba(12, 49, 36, 0.1);
  }
}

/* Narrow screens — the prototype switched these with a JS breakpoint at 760px */

@media (max-width: 759px) {
  .wave-block {
    grid-template-columns: 1fr;
  }
  .wave-head {
    position: static;
  }
  /* Contacts-style fast scroller on the right, where the thumb is */
  .wave-rail {
    left: auto;
    right: 4px;
  }
  .wave-rail-node.is-active .wave-rail-label {
    left: auto;
    right: 22px;
  }
}
