:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef4f3;
  --surface-strong: #172026;
  --line: #d8e0df;
  --line-strong: #bac8c5;
  --text: #172026;
  --muted: #657370;
  --subtle: #87928f;
  --accent: #0b7a75;
  --accent-strong: #075f5b;
  --accent-soft: #d9eeec;
  --warning: #b45309;
  --warning-bg: #fff4df;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --ok: #166534;
  --ok-bg: #e8f6ed;
  --shadow: 0 18px 48px rgba(23, 32, 38, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 22px 16px;
  background: #152126;
  color: #f7fbfa;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f2c14e;
  color: #152126;
  font-weight: 800;
}

.brand-name {
  font-size: 16px;
  font-weight: 750;
}

.brand-subtitle {
  margin-top: 2px;
  color: #a8b5b2;
  font-size: 12px;
}

.tool-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #c7d2cf;
  text-align: left;
}

.nav-button:hover,
.nav-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.nav-button.active {
  background: #eef8f7;
  color: #122025;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
}

.nav-button.active .nav-icon {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 4px 0;
  color: #a8b5b2;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39b97d;
  box-shadow: 0 0 0 4px rgba(57, 185, 125, 0.12);
}

.main-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.tool-host {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.validator {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.tool-header {
  display: grid;
  gap: 18px;
  padding: 24px 28px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.header-copy {
  max-width: 780px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.api-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: #354440;
  font-size: 13px;
}

.route-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 170px auto;
  align-items: end;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #3b4a47;
  font-size: 13px;
  font-weight: 750;
}

.route-input,
.unit-select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.route-input {
  padding: 0 14px;
  font-size: 16px;
  text-transform: uppercase;
}

.route-input:focus,
.unit-select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(11, 122, 117, 0.16);
}

.unit-select {
  padding: 0 12px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 750;
}

.primary-button {
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--accent-strong);
  background: var(--accent);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-strong);
  outline: none;
}

.primary-button:disabled {
  border-color: #9eb0ad;
  background: #9eb0ad;
  cursor: progress;
}

.ghost-button {
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #24312f;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(380px, 0.75fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.globe-area {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #0f171b;
}

.globe-canvas {
  position: absolute;
  inset: 0;
}

.globe-canvas canvas {
  display: block;
}

.globe-gl-host {
  position: absolute;
  inset: 0;
}

.globe-gl-host .scene-container {
  width: 100%;
  height: 100%;
}

.globe-hover-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.globe-hover-path {
  fill: none;
  stroke: transparent;
  stroke-width: 28px;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
  cursor: pointer;
}

.globe-segment-tooltip {
  position: fixed;
  z-index: 1000;
  width: min(340px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 20, 24, 0.92);
  color: #f7fbfa;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  backdrop-filter: blur(12px);
  transform: translateZ(0);
}

.globe-segment-tooltip[hidden] {
  display: none;
}

.globe-tooltip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 850;
}

.globe-tooltip-title strong {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 107, 61, 0.18);
  color: #ffd0ca;
  font-size: 11px;
  text-transform: uppercase;
}

.globe-tooltip-title strong.ok {
  background: rgba(57, 185, 125, 0.2);
  color: #c9f4d7;
}

.globe-tooltip-grid,
.globe-tooltip-endpoints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.globe-tooltip-grid div,
.globe-tooltip-endpoints > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.globe-tooltip-grid span,
.globe-tooltip-endpoints span,
.globe-tooltip-endpoints small {
  display: block;
  color: #a8c3c0;
  font-size: 11px;
  line-height: 1.35;
}

.globe-tooltip-grid b,
.globe-tooltip-endpoints b {
  display: block;
  margin-top: 3px;
  color: #f7fbfa;
  font-size: 12px;
  line-height: 1.35;
}

.globe-tooltip-warnings,
.globe-tooltip-ok {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.globe-tooltip-warnings {
  background: rgba(180, 35, 24, 0.22);
  color: #ffd0ca;
}

.globe-tooltip-ok {
  background: rgba(22, 101, 52, 0.22);
  color: #c9f4d7;
}

.globe-toolbar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.globe-toolbar > * {
  pointer-events: auto;
}

.globe-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(15, 23, 27, 0.72);
  color: #eef8f7;
  font-size: 13px;
  backdrop-filter: blur(12px);
}

.globe-label span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f2c14e;
}

.globe-reset {
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
}

.globe-reset:hover,
.globe-reset:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.details-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: #fbfcfc;
  border-left: 1px solid var(--line);
}

.detail-section {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.detail-section h2,
.detail-section h3 {
  margin: 0;
  font-size: 15px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.pill.warn {
  background: var(--warning-bg);
  color: var(--warning);
}

.pill.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
}

.metric-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.warning-list,
.info-list,
.segment-list,
.airport-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.warning-item,
.info-item,
.segment-item,
.airport-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.warning-item {
  border-color: #f1c781;
  background: var(--warning-bg);
}

.warning-item.error {
  border-color: #f2a49d;
  background: var(--danger-bg);
}

.warning-body,
.info-item,
.segment-item,
.airport-item {
  padding: 12px;
}

.warning-rule {
  color: #5f3b05;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.warning-item.error .warning-rule {
  color: var(--danger);
}

.warning-message {
  margin-top: 4px;
  line-height: 1.42;
}

.warning-segment {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  color: #513f21;
  font-size: 12px;
  font-weight: 750;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.segments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.segments-table th,
.segments-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.segments-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.segments-table tr:last-child td {
  border-bottom: 0;
}

.redemption-note {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.redemption-note strong {
  color: var(--text);
}

.redemption-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.redemption-table th,
.redemption-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.redemption-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.redemption-table tr:last-child td {
  border-bottom: 0;
}

.redemption-row td:first-child {
  font-weight: 850;
}

.redemption-row.economy td:first-child {
  color: #0b7a75;
}

.redemption-row.premiumEconomy td:first-child {
  color: #7c5b00;
}

.redemption-row.business td:first-child {
  color: #244a85;
}

.redemption-row.first td:first-child {
  color: #7b2f55;
}

.code {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 3px 6px;
  border: 1px solid #cad8d5;
  border-radius: 6px;
  background: #eef4f3;
  color: #142321;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.airport-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
}

.airport-name {
  font-weight: 800;
}

.airport-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 90px;
  border-radius: 8px;
  background: #e9efee;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand {
    justify-content: center;
  }

  .brand > div:not(.brand-mark),
  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .nav-button {
    justify-content: center;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 48%) minmax(0, 1fr);
  }

  .details-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    min-height: auto;
    height: auto;
    padding: 12px;
  }

  .brand {
    justify-content: flex-start;
    padding-bottom: 12px;
  }

  .brand > div:not(.brand-mark),
  .nav-label {
    display: block;
  }

  .tool-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, max-content);
    overflow-x: auto;
  }

  .nav-button {
    justify-content: flex-start;
  }

  .tool-header {
    gap: 12px;
    padding: 12px;
  }

  h1 {
    font-size: 21px;
  }

  .header-copy,
  .api-chip {
    display: none;
  }

  .header-top {
    display: grid;
  }

  .api-chip {
    white-space: normal;
  }

  .route-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .route-form .field:first-child {
    grid-column: 1 / -1;
  }

  .route-input,
  .unit-select,
  .primary-button {
    height: 42px;
  }

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

  .workspace {
    grid-template-rows: minmax(180px, 42%) minmax(0, 1fr);
  }

  .globe-area {
    min-height: 0;
  }

  .details-panel {
    padding: 12px;
  }
}

.segment-detail-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.segment-detail-card.warn {
  border-color: #f2a49d;
  background: #fff7f5;
}

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

.detail-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.detail-value {
  margin-top: 3px;
  color: var(--text);
  font-weight: 850;
}

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

.endpoint {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.endpoint-code {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-weight: 850;
}

.segment-warning-strip {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.38;
}

.segment-warning-strip.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.segment-warning-strip.warn {
  background: var(--danger-bg);
  color: var(--danger);
}

.empty-state.compact {
  min-height: 80px;
}

.segment-row {
  cursor: pointer;
}

.segment-row:hover td,
.segment-row:focus-visible td,
.segment-row.active td {
  background: #eef8f7;
}

.segment-row:focus-visible {
  outline: 3px solid rgba(11, 122, 117, 0.18);
  outline-offset: -3px;
}

.segment-row.warn td {
  background: #fff7f5;
}

.segment-row.warn:hover td,
.segment-row.warn:focus-visible td,
.segment-row.warn.active td {
  background: #ffe9e5;
}

@media (max-width: 760px) {
  .segment-detail-grid,
  .segment-endpoints,
  .globe-tooltip-grid,
  .globe-tooltip-endpoints {
    grid-template-columns: 1fr;
  }
}




