/* Version 4, recovery (recovery.js): meter, take-offs, timeline, drive check, embed code.
   Uses the tokens and base styles in style.css. Classes that set display need a [hidden] rule. */

.meter[hidden], .meter-faa[hidden], .copy-button[hidden] { display: none; }

.takeoffs, .timeline, .embed-code { margin-bottom: 2.75rem; }

/* Recovery meter: a dashed tile (the main site's .metrics) above the chart. A mono label, the
   sentence, then two ink bars to one scale (recovery.js sets their SVG widths): tonight's lowest
   count as an open bar and the count now as a filled one, so the two differ in shape as well. */
.meter {
  margin: 0 0 1.25rem;
  padding: 14px 18px 16px;
  color: var(--ink);
  border: 1.5px dashed var(--rule);
  border-radius: 8px;
}
.meter p { margin: 0; }
.meter .meter-label { margin: 0 0 6px; }
.meter-main {
  font: 600 1.1875rem/1.35 var(--display);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.meter-bars {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  max-width: 28rem;
  margin: 12px 0 10px;
}
.meter-bar-label { font: 400 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.meter-bar { display: block; width: 100%; height: 10px; overflow: visible; }
.meter-bar-now { fill: var(--ink); }
.meter-bar-low { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.meter-when, .meter-faa { margin-top: 0.35rem; color: var(--muted); font-size: 0.9375rem; }

/* Take-offs */
.takeoffs-summary { margin: 0 0 0.35rem; font-weight: 600; font-size: 1.0625rem; }
.takeoffs .small { margin: 0.6rem 0; }
.takeoffs-table th, .takeoffs-table td { white-space: normal; vertical-align: top; }
.takeoffs-table tbody th {
  position: static;
  font-weight: 400;
  font-size: inherit;
  color: var(--ink);
}
.takeoffs-table .code { font: 500 1em/1 var(--mono); letter-spacing: 0.04em; }
.takeoffs-table td:nth-child(2) { white-space: nowrap; }
/* Phones: the time may wrap before its time zone. On the narrowest phones a long airport name
   (BWI Baltimore/Washington) may also break inside a word, so the numbers never leave the card. */
@media (max-width: 860px) {
  .takeoffs-table td:nth-child(2) { white-space: normal; }
}
@media (max-width: 359px) {
  .takeoffs-table tbody th { overflow-wrap: anywhere; }
}
.takeoffs-table td.none { color: var(--muted); }

/* Timeline: a ruled rail in the margin with an ink ring at each moment, times in mono. */
.timeline .small { margin: 0 0 0.9rem; }
.timeline-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 28px;
}
.timeline-list::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1.5px;
  background: var(--rule);
}
.timeline-list li {
  position: relative;
  margin: 0 0 14px;
}
.timeline-list li::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 3px;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--ground);
}
.timeline-list time {
  display: block;
  margin-bottom: 2px;
  font: 400 12.5px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.timeline-list .timeline-empty::before { display: none; }

/* Drive check */
.drive-intro { margin: 0 0 0.75rem; color: var(--muted); }
.drive-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.drive-field { flex: 1 1 8rem; max-width: 12rem; }
.drive-field input { width: 100%; text-transform: uppercase; }

/* Embed code: a field like the main site's .field textarea, with the code in mono. */
.snippet { margin: 1.1rem 0; }
.snippet label { display: block; margin-bottom: 0.35rem; font-weight: 600; }
.snippet textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: 0.875rem/1.5 var(--mono);
  color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  resize: vertical;
  overflow-wrap: anywhere;
}
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.snippet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.5rem 0 0; }
.snippet-actions a { display: inline-flex; align-items: center; min-height: 44px; }
/* .copy-button is an outlined button (style.css). */

@media (max-width: 30rem) {
  .drive-field { max-width: none; }
  .drive-fields button { flex: 1 1 100%; }
}

/* Forced colours: the meter bars take the system text colour (SVG keeps its tokens there). */
@media (forced-colors: active) {
  .meter-bar-now { fill: CanvasText; }
  .meter-bar-low { stroke: CanvasText; }
}
