:root {
  --bg: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-line: rgba(24, 62, 111, 0.12);
  --text: #0f1c2f;
  --muted: #5f7088;
  --accent: #0f76ff;
  --accent-soft: rgba(15, 118, 255, 0.12);
  --warning: #ffcc4d;
  --success: #18a67a;
  --shadow: 0 26px 70px rgba(11, 30, 53, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #edf4fb 0%, #f8fbff 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.panel {
  border-radius: 28px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sidebar {
  padding: 24px;
}

.main-column {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.map-panel,
.table-panel {
  padding: 20px;
}

.map-panel {
  min-height: 430px;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2 {
  margin: 10px 0 0;
}

.lede,
.status-text {
  color: var(--muted);
  line-height: 1.6;
}

.upload-card {
  display: block;
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  border: 1.5px dashed rgba(15, 118, 255, 0.24);
  background: linear-gradient(135deg, rgba(15, 118, 255, 0.08), rgba(24, 166, 122, 0.08));
  cursor: pointer;
}

.upload-title {
  display: block;
  font-weight: 700;
}

.upload-copy {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, #0f76ff, #11a5ff);
  color: white;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(15, 118, 255, 0.24);
}

.ghost-btn {
  background: rgba(15, 28, 47, 0.06);
  color: var(--muted);
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.toggle-card,
.insight-card,
.sample-links {
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.74);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.toggle-row + .toggle-row {
  margin-top: 10px;
}

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

.summary-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.82);
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.summary-value {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 700;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-head h2 {
  font-size: 1rem;
}

.analysis-notes {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
  margin: 12px 0 0;
}

.sample-links h2 {
  font-size: 1rem;
}

.sample-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.sample-link-row a {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.map-frame {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--panel-line);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #edf3fa 0%, #f8fbff 100%);
}

#route-map {
  width: 100%;
  height: 560px;
  display: block;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--panel-line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

thead {
  background: rgba(15, 118, 255, 0.06);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(24, 62, 111, 0.08);
}

th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(15, 118, 255, 0.04);
}

tbody tr.hidden-row {
  opacity: 0.48;
}

.color-pill {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(13, 31, 54, 0.12);
}

.icon-btn {
  border: 0;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  background: rgba(15, 118, 255, 0.08);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.icon-btn.off {
  background: rgba(15, 28, 47, 0.06);
  color: var(--muted);
}

.map-bg {
  fill: rgba(255, 255, 255, 0.86);
}

.map-grid {
  stroke: rgba(15, 118, 255, 0.08);
  stroke-width: 1;
}

.map-label {
  fill: rgba(95, 112, 136, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.bounds-label {
  fill: rgba(15, 28, 47, 0.28);
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overlap-line {
  fill: none;
  stroke: rgba(255, 204, 77, 0.86);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-name-tag {
  fill: rgba(15, 28, 47, 0.9);
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  fill: rgba(95, 112, 136, 0.9);
  font-size: 24px;
  font-weight: 700;
}

.empty-copy {
  fill: rgba(95, 112, 136, 0.9);
  font-size: 16px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  #route-map {
    height: 440px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
    gap: 12px;
  }

  .sidebar,
  .map-panel,
  .table-panel {
    padding: 16px;
  }

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

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
