:root {
  --bg: #f6f8f6;
  --ink: #13211d;
  --muted: #5e6f69;
  --line: #d9e1dd;
  --accent: #0e8f62;
  --panel: #ffffff;
  --chip: #eff8f4;
  --shadow: 0 20px 40px rgba(19, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #dff4ea 0%, transparent 40%),
    radial-gradient(circle at 90% 0%, #f6efdd 0%, transparent 30%),
    var(--bg);
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 24px 24px 20px;
  border-radius: 18px;
  border: 1px solid #d3e8de;
  background:
    radial-gradient(circle at 85% 20%, rgba(14, 143, 98, 0.16), transparent 48%),
    linear-gradient(140deg, #ffffff 0%, #f3faf7 65%, #eef8f4 100%);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -48px;
  top: -48px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 143, 98, 0.2), rgba(14, 143, 98, 0));
  pointer-events: none;
}

.hero h1 {
  margin: 8px 0 2px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
}

.hero h1 span {
  color: var(--accent);
}

.kicker {
  margin: 0 0 2px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 500;
}

button {
  border: 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.panel {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

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

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.summary-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.78rem;
  background: var(--chip);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 700;
}

.pill:empty {
  display: none;
}

.pill.subtle {
  background: #f4f6f5;
  color: var(--muted);
}

.tabs-panel {
  overflow: hidden;
}

.mobile-route-picker {
  display: none;
  padding: 12px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfc;
}

.mobile-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.mobile-group-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}

.mobile-group-summary::-webkit-details-marker {
  display: none;
}

.mobile-group-name {
  color: var(--ink);
  font-size: 0.92rem;
}

.mobile-group-count {
  flex: 0 0 auto;
  min-width: 24px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--accent);
  background: var(--chip);
  border-radius: 999px;
  padding: 3px 8px;
}

.mobile-route-list {
  padding: 0 10px 10px;
  display: grid;
  gap: 8px;
}

.mobile-route-btn {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.25;
}

.mobile-route-btn.active {
  border-color: var(--accent);
  background: #f3fbf8;
  color: var(--accent);
}

.pair-tabs {
  padding: 12px;
}

.pair-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fbfdfc;
}

.pair-group:last-child {
  margin-bottom: 0;
}

.pair-group-title {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.pair-group-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 170px;
}

.tab-code {
  font-size: 0.86rem;
  font-weight: 700;
}

.tab-airports {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.tab-btn.active {
  border-color: var(--accent);
  background: #f3fbf8;
  color: var(--accent);
}

.tab-btn.active .tab-airports {
  color: var(--accent);
}

.summary-body {
  padding: 12px;
}

.summary-body.empty {
  color: var(--muted);
}

.roundtrip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.direction-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.direction-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #fcfefd;
  border-bottom: 1px solid var(--line);
}

.trip-role {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.direction-head h3 {
  margin: 0;
  font-size: 1rem;
}

.cabin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.cabin-grid section {
  padding: 10px;
}

.cabin-grid h4 {
  margin: 2px 0 8px;
}

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

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

th,
td {
  font-size: 0.84rem;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f8fbfa;
  z-index: 1;
  text-align: left;
}

.seat-open {
  color: inherit;
  font-weight: 600;
}

.miles-high {
  color: #dc2626;
  font-weight: 700;
}

.row-changed td {
  background: #f3fbf8;
}

.new-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e9f7ef;
  color: #15803d;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.muted {
  color: var(--muted);
  padding: 9px;
  font-size: 0.85rem;
}

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

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

@media (max-width: 768px) {
  .shell {
    padding: 16px;
  }

  .hero {
    padding: 20px 18px 18px;
  }

  .panel-head {
    padding: 12px;
  }

  .mobile-route-picker {
    display: flex;
    flex-direction: column;
  }

  .pair-tabs {
    display: none;
  }

  .summary-body {
    padding: 10px;
  }

  .direction-head {
    padding: 10px;
  }

  th,
  td {
    font-size: 0.8rem;
    padding: 7px 6px;
  }
}
