/* #region zone:flights.style-hero — การ์ดสรุปเที่ยวบิน ลูกโลก และตัวเลขสด (การ์ดสรุปอยู่ก่อนลูกโลก ไม่ลอยทับ) */
#detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}
@media (min-width: 1024px) {
  #detail {
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    grid-template-areas:
      'summary hero'
      'stats hero'
      'later later'
      'details details';
    grid-template-rows: auto 1fr auto auto;
    column-gap: var(--space-5);
    align-items: start;
  }
  .summary {
    grid-area: summary;
  }
  .hero {
    grid-area: hero;
  }
  .stats {
    grid-area: stats;
  }
  .details-later {
    grid-area: later;
  }
  .details {
    grid-area: details;
  }
}
.summary {
  padding: 18px 20px;
  display: grid;
  gap: 14px;
}
.sum-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
}
.sum-controls {
  display: flex;
  align-items: center;
  gap: var(--u-space-2);
  min-width: 0;
}
.summary,
.summary * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.route > div:not(.track),
.times > div {
  container-type: inline-size;
}
.summary .route {
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
}
.route .airport-name {
  display: inline-block;
  white-space: nowrap;
  --flights-text-fluid: clamp(0.75rem, 12cqi, 0.875rem);
  font-size: var(--flights-text-fluid);
}
.summary .route.partial {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.summary .route b,
.summary .times b {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  --flights-text-fluid: clamp(1rem, 24cqi, 1.6rem);
  font-size: var(--flights-text-fluid);
}
.sum-ident b {
  font-size: var(--u-text-lg);
  font-weight: 800;
  display: block;
  line-height: 1.3;
}
.sum-ident small {
  color: var(--muted);
  font-size: 0.875rem;
  display: block;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.sum-meaning {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.logo {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--accent-surface);
  display: grid;
  place-items: center;
  font: 800 0.875rem var(--sans);
  color: var(--accent);
}
.live {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 14px;
  font-size: 0.875rem;
  font-weight: 600;
}
.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.top-status {
  display: none;
}
.eta-row small,
.times small {
  color: var(--muted);
  font-size: 0.875rem;
  display: block;
}
.eta {
  font-weight: 800;
  --flights-text-fluid: clamp(2rem, 6vw, 2.75rem);
  font-size: var(--flights-text-fluid);
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.eta span {
  font-weight: 600;
  font-size: 0.5em;
  color: var(--muted);
  margin-left: 2px;
}
.eta.soft {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}
.summary.has-arrived .eta.soft {
  font-size: 0.875rem;
  line-height: 1.5;
}
.route {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
}
.route b {
  font-weight: 800;
  font-size: 1.6rem;
  display: block;
  line-height: 1;
}
.route small {
  color: var(--muted);
  font-size: 0.875rem;
}
.route .r,
.times .r {
  text-align: right;
}
.track {
  position: relative;
  height: 24px;
}
.track .rail,
.track .fill {
  position: absolute;
  left: 0;
  top: 11px;
  height: 3px;
  border-radius: 2px;
}
.track .rail {
  right: 0;
  background: var(--line);
}
.track .fill {
  width: 0;
  background: linear-gradient(90deg, var(--accent-primary-soft), var(--accent-primary));
}
.track .jet {
  display: block;
  overflow: visible;
  z-index: 1;
  position: absolute;
  top: 0;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  left: 0;
  fill: var(--fg);
}
.route.partial {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.route.partial .track {
  display: none;
}
.times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
}
.times div {
  display: grid;
  align-content: start;
}
.times b {
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.times em {
  font-style: normal;
  color: var(--dim);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.hero {
  position: relative;
  border-radius: var(--u-radius-dialog);
  overflow: hidden;
  height: clamp(520px, 74vh, 700px);
  background: radial-gradient(100% 80% at 50% 45%, var(--panel-raised), var(--bg) 75%);
  border: 1px solid var(--stroke);
}
.stage {
  position: absolute;
  inset: 0;
}
.stage canvas {
  /* Resolve light-dark tokens to a concrete computed color for Canvas and Three materials. */
  color: var(--accent);
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  cursor: grab;
}
.globe-tools {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 3;
  display: grid;
  gap: var(--space-2);
}
.view-switch {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.tool-icons {
  display: grid;
  grid-template-columns: repeat(2, 44px);
  gap: var(--space-2);
}
.tools-more {
  display: none;
}
.globe-tools .btn {
  min-width: 44px;
  padding: var(--u-space-2) var(--u-space-3);
}
.globe-legend {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  z-index: 3;
  margin: 0;
  font-size: 0.875rem;
  color: var(--dim);
  pointer-events: none;
}
.globe-info {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 5;
}
.globe-info #globe-info {
  width: 44px;
  height: 44px;
  padding: 0;
  font:
    700 1rem Georgia,
    serif;
  border-radius: 50%;
  color: #14272b;
  background: #fff;
}
.hero .globe-info .globe-legend {
  position: absolute;
  left: auto;
  right: 0;
  bottom: 52px;
  width: min(290px, calc(100vw - 80px));
  padding: var(--u-space-3);
  margin: 0;
  border-radius: 12px;
  background: #14272b;
  color: #f2f6f6;
  font-size: 0.8125rem;
  pointer-events: auto;
}
.departure-delay {
  display: block;
  color: var(--status-waiting);
  font-size: 0.8125rem;
}
.age {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 3;
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  padding: var(--u-space-1) 10px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}
@media (min-width: 1024px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.stat {
  padding: var(--u-space-3) 14px;
  border-radius: 18px;
}
.stat small {
  color: var(--muted);
  font-size: 0.875rem;
  display: block;
}
.stat b {
  font-weight: 700;
  font-size: var(--u-text-lg);
  font-variant-numeric: tabular-nums;
}
.stat em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.875rem;
  margin-left: 3px;
}
.details-later {
  margin: 0 2px;
}
/* #endregion */
/* #region zone:flights.style-details — ขั้นตอนการบินและกราฟความสูง */
.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: var(--space-4);
}
.panel h2 {
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-3);
  row-gap: 0;
}
.panel h2 b {
  font-weight: 600;
  white-space: nowrap;
}
.phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.phase {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 5.5ch;
  gap: var(--space-3);
  align-items: start;
  position: relative;
  padding-bottom: 14px;
}
.phase:last-child {
  padding-bottom: 0;
}
.phase::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 20px;
  bottom: -2px;
  width: 2px;
  background: var(--line);
}
.phase:last-child::before {
  display: none;
}
.phase.done::before {
  background: linear-gradient(var(--blue), var(--cyan));
}
.dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}
.phase.done .dot {
  background: var(--blue);
  border-color: var(--blue);
}
.phase.now .dot {
  border-color: var(--cyan);
  background: var(--panel);
}
.phase.now .dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}
.phase b {
  font-weight: 600;
  font-size: var(--u-text-ui);
  display: block;
}
.phase small {
  color: var(--dim);
  font-size: 0.875rem;
}
.phase time {
  font-weight: 600;
  font-size: var(--u-text-md);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.phase.now b {
  color: var(--cyan);
}
/* #endregion */
