.airport-field label,
.speed-control label,
.custom-speed label,
.departure-control > label:not(.manual-time-toggle) {
  display: block;
  margin: 0 0 9px 3px;
  color: #738097;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(170px, .85fr) auto minmax(420px, 1.65fr) auto;
}

.time-direction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e2e5e8;
}

.time-direction > span {
  color: #737a82;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.time-direction-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid #cbd0d4;
  border-radius: 10px;
  background: #e8ebed;
}

.time-direction-options button {
  min-width: 104px;
  height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6d737a;
  font: 600 12px "DM Sans", sans-serif;
  cursor: pointer;
}

.time-direction-options button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(41,44,48,.12);
}

.time-direction-options button:focus-visible {
  outline: 3px solid rgba(179,32,45,.16);
  outline-offset: 2px;
}

.time-direction + .settings-row {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}

.departure-inputs {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1.25fr .8fr .8fr;
  gap: 8px;
  transition: opacity .2s;
}

.departure-inputs:disabled {
  opacity: .5;
}

.departure-inputs label {
  min-width: 0;
}

.departure-inputs label > span {
  display: block;
  margin: 0 0 6px 2px;
  color: #8994a5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.departure-inputs input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 11px;
  border: 1px solid #ccd6e3;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: 500 13px "DM Sans", sans-serif;
}

#departureTime,
#departureZuluTime {
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

.manual-time-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  margin: 0 0 9px 2px;
  color: #53627a;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.manual-time-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid #b8c4d4;
  border-radius: 4px;
  background: #fff;
  transition: .18s;
}

.manual-time-toggle input:checked + .checkmark {
  border-color: var(--blue);
  background: var(--blue);
}

.manual-time-toggle input:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.manual-time-toggle input:focus-visible + .checkmark {
  outline: 3px solid rgba(40,104,232,.18);
  outline-offset: 2px;
}

.toggle-copy small {
  margin-left: 6px;
  color: #9aa4b4;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.manual-enabled .toggle-copy {
  color: var(--blue);
}

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

.metric.arrival-metric {
  padding-right: 0;
  border-left: 1px solid rgba(255,255,255,.12);
}

.arrival-metric strong {
  margin-top: 15px;
  font-size: clamp(27px, 3.25vw, 40px);
  white-space: nowrap;
}

.arrival-metric strong small {
  font-size: 15px;
}

.arrival-metric strong b {
  margin: 0 2px;
  color: #60718b;
  font: 400 24px "Instrument Serif", serif;
}

@media (min-width: 901px) {
  .settings-row {
    padding-top: 46px;
    align-items: end;
  }

  .time-direction + .settings-row { padding-top: 28px; }

  .departure-control {
    position: relative;
  }

  .manual-time-toggle {
    position: absolute;
    top: -25px;
    left: 2px;
    margin: 0;
  }

  .speed-control select,
  .departure-inputs input,
  .calculate {
    height: 48px;
  }
}

@media (max-width: 900px) {
  .settings-row { grid-template-columns: 1fr 1fr; }
  .departure-control { grid-column: 1 / -1; }
  .calculate { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric.arrival-metric {
    grid-column: 1 / -1;
    padding-left: 0;
    border-top: 1px solid rgba(255,255,255,.12);
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .time-direction { align-items: stretch; flex-direction: column; }
  .time-direction > span { text-align: center; }
  .time-direction-options button { width: 100%; min-width: 0; }
  .departure-inputs { grid-template-columns: 1fr 1fr; }
  .departure-inputs label:first-child { grid-column: 1 / -1; }
  .toggle-copy small { display: block; margin: 2px 0 0; }
}

@media (max-width: 720px) {
  .settings-row { grid-template-columns: 1fr; }
  .departure-control { grid-column: auto; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric.arrival-metric { grid-column: auto; }
}

/* Silver and aviation-red theme */
:root {
  --ink: #282b2f;
  --muted: #6d737a;
  --line: #d2d5d8;
  --navy: #292c30;
  --blue: #b3202d;
  --paper: #eef1f3;
}

.sky-glow {
  background:
    radial-gradient(circle at 70% 5%, rgba(151, 158, 166, .2), transparent 38%),
    linear-gradient(180deg, #e4e8eb 0%, rgba(238, 241, 243, 0) 100%);
}

.calculator {
  background: rgba(250, 251, 252, .94);
  border-color: #d4d7da;
  box-shadow: 0 24px 70px rgba(43, 47, 52, .13);
}

.input-row,
.speed-control select,
.custom-speed > div,
.departure-inputs input,
.checkmark,
.detail-grid {
  background: #fbfcfc;
  border-color: #cbd0d4;
}

.input-row:focus-within {
  border-color: #c4444f;
  box-shadow: 0 0 0 3px rgba(179, 32, 45, .1);
}

.suggestion:hover,
.suggestion.active {
  background: #f8ecee;
}

.calculate {
  background: linear-gradient(135deg, #383b3f, #242629);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.calculate span {
  color: #e34350;
}

.calculate:hover {
  background: var(--blue);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(41, 44, 48, .1);
  border-radius: 11px;
  background: rgba(255, 255, 255, .5);
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: #70757b;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a.active,
.site-nav a:hover {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(41, 44, 48, .08);
}

@media (max-width: 720px) {
  header { gap: 10px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 28px; height: 28px; }
  .database-status { display: none; }
  .site-nav { margin-left: auto; }
  .site-nav a { padding: 7px 9px; font-size: 10px; }
}

.calculate:hover span {
  color: #fff;
}

.results {
  background: linear-gradient(135deg, #35383c 0%, #232529 100%);
  box-shadow: 0 22px 60px rgba(32, 34, 38, .2);
}

.route-line span {
  background: #6f747a;
}

.route-line svg {
  stroke: #e04450;
}

.metric-label,
.metric p,
.notice p,
.route-summary small {
  color: #b7bbc0;
}

.metric strong small,
.arrival-metric strong small {
  color: #d6d8da;
}

.arrival-metric strong b {
  color: #858a90;
}

.notice > span {
  border-color: #858a90;
  color: #d4d6d8;
}

.notice strong {
  color: #f1f2f3;
}
