:root {
  --background: #071216;
  --surface: rgba(10, 19, 24, 0.82);
  --surface-solid: #0d1820;
  --surface-soft: #101f29;
  --surface-muted: #152632;
  --foreground: #f5f7f8;
  --muted: #98a7b3;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #6c7df6;
  --accent-2: #7e53f2;
  --accent-soft: rgba(108, 125, 246, 0.18);
  --success: #59d1a5;
  --warning: #f2c14e;
  --danger: #d97d7d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--foreground);
  background:
    radial-gradient(circle at top left, rgba(126, 83, 242, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(89, 209, 165, 0.08), transparent 30%),
    var(--background);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: transparent;
}

body,
button,
input,
select {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 18, 22, 0.72);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.header-actions,
.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-size: 12px;
  color: #dce6ee;
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 24px rgba(108, 125, 246, 0.3);
}

.brand__wordmark {
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.site-nav {
  font-size: 13px;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--foreground);
}

.source-pill,
.map-badge {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(89, 209, 165, 0.1);
  border: 1px solid rgba(89, 209, 165, 0.18);
  color: #c7f4e2;
  font-size: 12px;
  font-weight: 600;
}

.source-pill::before,
.map-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--success);
}

.ghost-button,
.primary-button,
.text-button,
.drawer-close {
  border: 0;
}

.ghost-button {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--foreground);
  font-weight: 600;
}

.ghost-button--small {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.auth-gate {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px 0;
}

.auth-gate__card {
  max-width: 540px;
  margin: 0 auto;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(10, 19, 24, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-gate__card h1 {
  margin: 0;
  font-size: 36px;
  letter-spacing: -0.05em;
}

.auth-copy {
  margin: 16px auto 0;
  max-width: 440px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  margin-top: 22px;
  display: grid;
  gap: 12px;
  text-align: left;
}

.auth-form label {
  font-size: 13px;
  font-weight: 600;
  color: #dce6ee;
}

.auth-message {
  min-height: 22px;
  margin: 16px 0 0;
  color: #c7d3ff;
  font-size: 13px;
}

.ghost-button:hover,
.primary-button:hover,
.search-mode:hover {
  filter: brightness(1.05);
}

.hero-section {
  position: relative;
  overflow: hidden;
  padding: 96px 24px 42px;
}

.hero-content {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.hero-glow {
  position: absolute;
  inset: auto;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.4;
}

.hero-glow--left {
  top: -40px;
  left: -100px;
  background: rgba(108, 125, 246, 0.3);
}

.hero-glow--right {
  top: 24px;
  right: -120px;
  background: rgba(89, 209, 165, 0.15);
}

.eyebrow {
  margin: 0 0 10px;
  color: #c9d0d6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-copy {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.search-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 44px;
}

.search-card,
.filter-card,
.map-card,
.results-card,
.stat-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.search-card {
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 26px;
}

.search-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 360px;
  margin: 0 auto 16px;
}

.search-mode {
  height: 38px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.search-mode.is-active {
  color: var(--foreground);
  background: linear-gradient(135deg, rgba(108, 125, 246, 0.22), rgba(126, 83, 242, 0.2));
  border-color: rgba(108, 125, 246, 0.45);
}

.mode-panels {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}

.mode-panel {
  padding: 22px;
}

.primary-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.suggestion-shell {
  position: relative;
}

.suggestion-list {
  position: absolute;
  z-index: 25;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
  color: #0d1820;
  box-shadow: var(--shadow);
}

.suggestion-option {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  display: block;
  background: transparent;
  color: #0d1820;
  text-align: left;
}

.suggestion-option:hover,
.suggestion-option:focus-visible {
  background: #eef1ff;
}

.suggestion-option strong,
.suggestion-option span {
  display: block;
}

.suggestion-option span {
  margin-top: 3px;
  color: #5b6875;
  font-size: 12px;
}

.suggestion-empty {
  padding: 12px 14px;
  color: #5b6875;
  font-size: 14px;
}

.primary-button {
  height: 54px;
  padding: 0 22px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(108, 125, 246, 0.32);
}

.mode-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.panel-action {
  margin-top: 14px;
  min-width: 160px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.filter-card {
  position: sticky;
  top: 92px;
  border-radius: var(--radius-lg);
  padding: 24px;
}

.content-stack {
  display: grid;
  gap: 20px;
}

.panel-heading,
.results-toolbar,
.map-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.panel-heading h2,
.map-card__header h2,
.results-toolbar h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.text-button {
  padding: 0;
  color: #c7d3ff;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

.input-label {
  display: block;
  margin: 0 0 8px;
  color: #d9e0e5;
  font-size: 13px;
  font-weight: 600;
}

.input-label.compact {
  margin-top: 18px;
}

input,
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.035);
}

select option {
  color: #0d1820;
  background: #ffffff;
}

input::placeholder {
  color: #8392a1;
}

input:focus,
select:focus {
  outline: 2px solid rgba(108, 125, 246, 0.28);
  border-color: rgba(108, 125, 246, 0.5);
}

.filter-group {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.filter-group h3 {
  margin: 0 0 14px;
  color: #d9e0e5;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.split-grid + .split-grid {
  margin-top: 12px;
}

.split-grid span {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  color: #d9e0e5;
  font-size: 13px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.filter-note {
  margin-top: 24px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(108, 125, 246, 0.12), rgba(89, 209, 165, 0.08));
  border: 1px solid rgba(108, 125, 246, 0.18);
}

.filter-note strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.filter-note p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.map-card,
.results-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.map-card__header,
.results-toolbar {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.map-surface {
  min-height: 320px;
  position: relative;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(126, 83, 242, 0.14), rgba(9, 16, 22, 0.98));
  background-size: 28px 28px, 28px 28px, cover;
}

.map-placeholder {
  min-height: 320px;
  display: grid;
  place-content: center;
  padding: 28px;
  text-align: center;
}

.map-placeholder strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.map-placeholder p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

#mapSurface.is-live {
  background: #0a1117;
}

#mapCanvas {
  width: 100%;
  min-height: 320px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  border-radius: var(--radius-md);
  min-height: 112px;
  padding: 18px 20px;
}

.stat-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  font-size: 30px;
  letter-spacing: -0.05em;
}

.results-toolbar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sort-field {
  display: block;
  min-width: 240px;
}

.sort-field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

td {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.company-link {
  padding: 0;
  color: var(--foreground);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.firm-link {
  padding: 0;
  color: #c7d3ff;
  background: transparent;
  border: 0;
  text-align: left;
  font-weight: 700;
}

.company-no {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.money {
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(89, 209, 165, 0.18);
  color: #c7f4e2;
  background: rgba(89, 209, 165, 0.1);
  font-size: 12px;
  font-weight: 600;
}

.status-pill.is-warning {
  color: #f7e0a4;
  background: rgba(242, 193, 78, 0.12);
  border-color: rgba(242, 193, 78, 0.18);
}

.status-pill.is-muted {
  color: #d1d8de;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.empty {
  height: 140px;
  text-align: center;
  color: var(--muted);
}

.company-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  z-index: 30;
  width: min(420px, 100vw);
  height: 100vh;
  padding: 32px 28px;
  background: #09141a;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.35);
  transition: right 180ms ease;
}

.company-drawer.is-open {
  right: 0;
}

.company-drawer h2 {
  margin: 8px 0 10px;
  font-size: 26px;
  letter-spacing: -0.05em;
}

.drawer-number {
  margin: 0 0 28px;
  color: var(--muted);
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.company-drawer dt {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.company-drawer dd {
  margin: 7px 0 0;
  font-size: 15px;
  line-height: 1.55;
}

@media (max-width: 1080px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .filter-card {
    position: static;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header__inner,
  .search-section,
  .hero-section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .site-nav,
  .ghost-button {
    display: none;
  }

  .primary-search-row,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .results-toolbar,
  .map-card__header,
  .panel-heading {
    display: block;
  }

  .toolbar-actions {
    margin-top: 16px;
  }

  .sort-field {
    min-width: 0;
  }

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

  .hero-section {
    padding-top: 72px;
  }

  .hero-copy {
    font-size: 15px;
  }
}
