:root {
  color-scheme: light;
  --bg: #eef3f5;
  --bg-grad-top: #f5f9fa;
  --bg-grad-bottom: #e8eef1;
  --band: #ffffff;
  --surface-2: #f6fafb;
  --ink: #102027;
  --ink-soft: #2c3a43;
  --muted: #647682;
  --line: #e5ebef;
  --line-strong: #d6dee3;
  --track: rgba(15, 30, 38, 0.05);

  --teal: #0e7d86;
  --teal-600: #0b6a72;
  --teal-700: #07505a;
  --teal-050: #e6f3f3;
  --gold: #c98a1b;
  --gold-050: #fbf1da;
  --green: #3f9e6b;
  --red: #cf5a5a;
  --blue: #3f6d9d;
  --purple: #7b5ea7;

  --ring: rgba(14, 125, 134, 0.18);
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(16, 32, 40, 0.04), 0 1px 3px rgba(16, 32, 40, 0.06);
  --shadow: 0 8px 22px rgba(16, 32, 40, 0.07), 0 2px 6px rgba(16, 32, 40, 0.04);
  --shadow-lg: 0 22px 48px rgba(16, 32, 40, 0.16);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Sora", var(--font-sans);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bottom)) fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection {
  background: var(--teal-050);
}

/* ---------- Header ---------- */

.app-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 26px 32px 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--gold) 70%, transparent);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.02;
  font-weight: 800;
  background: linear-gradient(120deg, var(--ink) 30%, var(--teal-700));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.header-meta span {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 11px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.header-meta a {
  color: var(--teal-700);
  font-weight: 700;
  text-decoration: none;
}

.header-meta a:hover {
  text-decoration: underline;
}

.tabs,
main {
  max-width: 1600px;
  margin: 0 auto;
}

/* ---------- Buttons ---------- */

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  background: linear-gradient(135deg, var(--teal), var(--teal-700));
  color: #fff;
  border-radius: 11px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(14, 125, 134, 0.28);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.filter-toggle::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16M7 12h10M10 19h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16M7 12h10M10 19h4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.filter-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(14, 125, 134, 0.34);
}

.icon-text {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 10px;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.icon-text:hover {
  border-color: var(--teal);
  color: var(--teal-700);
  background: var(--teal-050);
}

.icon-text:active {
  transform: translateY(1px);
}

/* ---------- Filter panel ---------- */

.filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  display: none;
  background: rgba(16, 25, 32, 0.4);
  backdrop-filter: blur(2px);
}

.filter-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: min(440px, calc(100vw - 24px));
  height: 100vh;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(22, 32, 42, 0.2);
  padding: 22px;
}

body.filters-open {
  overflow: hidden;
}

body.filters-open .filter-backdrop {
  display: block;
}

body.filters-open .filter-panel {
  transform: translateX(0);
}

.filter-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-panel-head h2 {
  font-size: 18px;
}

.filter-row {
  display: grid;
  gap: 16px;
}

.peak-search {
  min-width: 0;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface-2);
  padding: 3px;
  gap: 3px;
}

.segment {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease;
}

.segment:hover {
  color: var(--teal-700);
}

.segment.is-active {
  background: #fff;
  color: var(--teal-700);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.range-pair {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.range-pair b {
  font-weight: 600;
  text-align: center;
}

.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.filter-grid .wide-filter,
.filter-grid .peak-search {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Inputs & dropdowns ---------- */

select,
input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  min-width: 0;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input::placeholder {
  color: #9aa7af;
}

select:hover,
input:hover {
  border-color: #b8c5cc;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--ring);
}

select,
input[list] {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23647682' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  padding-right: 34px;
  cursor: pointer;
}

input[list]::-webkit-calendar-picker-indicator {
  opacity: 0;
}

input[type="number"],
input[type="search"] {
  background-image: none;
  padding-right: 12px;
  cursor: text;
}

.combo-field {
  position: relative;
  min-width: 0;
}

.combo-field input.combo-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23647682' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  cursor: text;
  padding-right: 34px;
}

.combo-field.combo-open input.combo-input {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--ring);
}

.combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 35;
  display: grid;
  gap: 2px;
  max-height: min(310px, calc(100vh - 170px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid rgba(91, 111, 122, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 18px 42px rgba(22, 32, 42, 0.18), 0 2px 8px rgba(22, 32, 42, 0.08);
}

.combo-menu[hidden] {
  display: none;
}

.combo-option {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.combo-option:hover,
.combo-option.is-active {
  background: var(--teal-050);
  color: var(--teal-700);
}

.combo-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.combo-option-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.combo-empty,
.combo-more {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.combo-more {
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 6px;
  padding: 22px 32px 0;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 11px;
  min-height: 38px;
  min-width: 96px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.tab:hover {
  color: var(--teal-700);
  background: var(--teal-050);
}

.tab.is-active {
  background: linear-gradient(135deg, var(--teal), var(--teal-700));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(14, 125, 134, 0.26);
}

main {
  padding: 22px 32px 40px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: viewIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .view.is-active {
    animation: none;
  }
}

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

/* ---------- KPI cards ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  min-height: 92px;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--teal);
}

.kpi:nth-child(8n + 1)::before { background: var(--teal); }
.kpi:nth-child(8n + 2)::before { background: var(--gold); }
.kpi:nth-child(8n + 3)::before { background: var(--green); }
.kpi:nth-child(8n + 4)::before { background: var(--red); }
.kpi:nth-child(8n + 5)::before { background: var(--blue); }
.kpi:nth-child(8n + 6)::before { background: var(--purple); }
.kpi:nth-child(8n + 7)::before { background: var(--teal-600); }
.kpi:nth-child(8n + 8)::before { background: var(--gold); }

.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.kpi .label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.kpi .value {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.kpi .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Peak spotlight ---------- */

.peak-spotlight {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  margin-bottom: 16px;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.peak-photo {
  position: relative;
  min-height: 260px;
  background:
    linear-gradient(160deg, rgba(14, 125, 134, 0.22), rgba(201, 138, 27, 0.16)),
    #dfe8ec;
}

.peak-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 70%, rgba(255, 255, 255, 0.18));
  pointer-events: none;
}

.peak-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.6s ease;
}

.peak-photo.has-image img {
  opacity: 1;
}

.peak-image-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end start;
  padding: 20px;
  color: #1f444b;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.peak-photo.has-image .peak-image-fallback {
  display: none;
}

.peak-copy {
  padding: 28px 28px 24px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.peak-copy h2 {
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.04;
}

.peak-copy p {
  margin: 0;
  color: var(--muted);
}

.peak-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.peak-facts div {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-width: 0;
  background: var(--surface-2);
}

.peak-facts span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.peak-facts b {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.image-credit {
  font-size: 11.5px;
  color: var(--muted);
}

.image-credit a {
  color: var(--teal-700);
  font-weight: 700;
  text-decoration: none;
}

.image-credit a:hover {
  text-decoration: underline;
}

.image-credit-block {
  margin: 12px 0 0;
}

/* ---------- Peak cards ---------- */

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

.peak-card {
  display: grid;
  grid-template-rows: 122px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.peak-card:hover {
  transform: translateY(-3px);
  border-color: var(--teal);
  box-shadow: var(--shadow-lg);
}

.peak-card img {
  width: 100%;
  height: 122px;
  object-fit: cover;
  background: #dfe8ec;
  transition: transform 0.45s ease;
}

.peak-card:hover img {
  transform: scale(1.06);
}

.peak-card-body {
  display: grid;
  gap: 4px;
  padding: 11px;
}

.peak-card-rank {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.peak-card-title {
  font-weight: 800;
  line-height: 1.15;
}

.peak-card-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

/* ---------- Panels & layout ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: 1 / -1;
}

.panel {
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
  margin-bottom: 16px;
}

.dashboard-grid .panel {
  margin-bottom: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.panel-head select {
  max-width: 180px;
  height: 36px;
}

/* ---------- Charts ---------- */

.chart {
  min-height: 300px;
  height: 300px;
  width: 100%;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.chart::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.chart::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 9px;
  border: 2px solid var(--band);
}

.chart::-webkit-scrollbar-thumb:hover {
  background: #aebdc4;
}

.chart::-webkit-scrollbar-track {
  background: transparent;
}

.chart-tall {
  min-height: 360px;
  height: 360px;
}

#heightRanking {
  height: 460px;
}

#nationalityBars {
  height: 440px;
}

#deepRouteVolume {
  height: 380px;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.axis-label,
.legend,
.chart-note {
  fill: var(--muted);
  font-size: 11px;
}

.chart-note {
  font-size: 13px;
  font-weight: 600;
}

.grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.axis-line {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.bar-track {
  fill: var(--track);
}

.bar-fill,
.vbar rect {
  transition: opacity 0.15s ease;
}

.bar:hover .bar-fill,
.vbar:hover rect {
  opacity: 0.82;
}

.bar-name {
  fill: var(--ink-soft);
  font-weight: 600;
}

.bar-value {
  fill: var(--muted);
  font-weight: 700;
}

.bar-value.inside {
  fill: #fff;
}

.bar-value.success {
  fill: var(--teal-700);
}

.bar-value.death {
  fill: var(--red);
}

.vbar .bar-value {
  font-size: 10px;
}

.donut-total {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
}

.legend-label {
  fill: var(--muted);
}

.legend-value {
  fill: var(--ink-soft);
  font-weight: 700;
}

[data-tip] {
  cursor: pointer;
}

.chart-tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: rgba(16, 32, 39, 0.96);
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: var(--shadow-lg);
  max-width: 260px;
}

.chart-tip b {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.chart-tip span {
  color: rgba(255, 255, 255, 0.76);
}

.chart-tip[hidden] {
  display: none;
}

/* ---------- Benchmark ---------- */

.benchmark {
  display: grid;
  gap: 16px;
  align-content: center;
  height: 100%;
}

.bench-row {
  display: grid;
  gap: 7px;
}

.bench-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.bench-name {
  font-weight: 700;
}

.bench-delta {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.bench-delta.good {
  background: #e3f1ea;
  color: #237049;
}

.bench-delta.bad {
  background: #f7e0e0;
  color: #9a3636;
}

.bench-delta.neutral {
  background: var(--surface-2);
  color: var(--muted);
}

.bench-bar {
  display: grid;
  grid-template-columns: 86px 1fr 56px;
  gap: 12px;
  align-items: center;
}

.bench-tag {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bench-track {
  height: 15px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}

.bench-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.bench-fill.peak {
  background: linear-gradient(90deg, var(--teal), #56a4aa);
}

.bench-fill.avg {
  background: var(--line-strong);
}

.bench-val {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Answer list ---------- */

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

.answer {
  position: relative;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  background: var(--surface-2);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.answer:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.answer b {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.answer p {
  margin: 0;
  color: var(--ink-soft);
}

/* ---------- Mini stack ---------- */

.mini-stack {
  display: grid;
  gap: 2px;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 11px 2px;
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row span {
  color: var(--muted);
}

.mini-row b {
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: right;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow: auto;
  max-height: 510px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.people-table-wrap {
  max-height: 680px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-strong);
}

td {
  font-size: 12.5px;
}

tbody tr {
  transition: background 0.1s ease;
}

tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

tbody tr:hover td {
  background: var(--teal-050);
}

.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e3f1ea;
  color: #237049;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.warn {
  background: var(--gold-050);
  color: #8a5d13;
}

.status-pill.risk {
  background: #f7e0e0;
  color: #9a3636;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

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

  .peak-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 780px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .header-actions {
    justify-items: stretch;
    width: 100%;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .filter-toggle {
    width: 100%;
    justify-content: center;
  }

  .filter-panel {
    width: 100vw;
  }

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

  .span-2 {
    grid-column: span 1;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 18px 20px 0;
  }

  main {
    padding: 18px 20px 28px;
  }

  .peak-spotlight {
    grid-template-columns: 1fr;
  }

  .peak-facts {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .dashboard-grid,
  .answer-list,
  .peak-card-grid {
    grid-template-columns: 1fr;
  }

  .chart,
  .chart-tall,
  #heightRanking,
  #nationalityBars,
  #deepRouteVolume {
    height: 320px;
  }
}
