:root {
  --ink: #0f172a;
  --quiet: #475569;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(15, 23, 42, 0.12);
  --blue: #1f46d8;
  --orange: #ff8a1f;
  --green: #2fbf71;
  font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #dbe9fb; }

.stage { position: fixed; inset: 0; overflow: hidden; }
.stage__canvas { position: absolute; inset: 0; touch-action: none; }
.stage__labels { position: absolute; inset: 0; pointer-events: none; }

.tag {
  position: absolute; left: 0; top: 0;
  padding: 1px 6px; border-radius: 6px;
  background: rgba(15, 23, 42, 0.85); color: #fff;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border-left: 4px solid #f472b6;
}

.panel {
  position: absolute; z-index: 1;
  background: var(--panel); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}
.panel--top {
  top: 16px; left: 16px; right: 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px;
}
.panel--top h1 { margin: 0; font-size: 18px; }
.panel--top h1 span { color: var(--blue); }
.clock { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.panel__link { color: var(--blue); font-weight: 600; text-decoration: none; }
.panel__link:hover { text-decoration: underline; }

.status { display: inline-flex; align-items: center; gap: 6px; color: var(--quiet); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.2); }

.panel--board {
  top: 84px; right: 16px; width: min(360px, calc(100% - 32px));
  max-height: calc(100% - 140px); overflow: auto; padding: 12px 16px;
}
.panel--board h2 { margin: 0 0 6px; font-size: 14px; }
.board__count, .board__empty { margin: 0 0 8px; color: var(--quiet); }
.board__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board__table th { text-align: left; font-weight: 600; color: var(--quiet); font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.board__table td { padding: 4px 0; border-bottom: 1px solid var(--line); }
.board__table tr[data-hex] { cursor: pointer; }
.board__table tr[data-hex]:hover td { background: rgba(37, 99, 235, 0.08); }
.board__table tr[data-hex]:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.board__table tr.is-followed td { background: rgba(37, 99, 235, 0.16); font-weight: 600; }
.board__phase { font-weight: 600; }
.board__phase--landing { color: #b45309; }
.board__phase--departing { color: #15803d; }
.board__phase--on-ground { color: #0e7490; }

.panel--warn { left: 16px; bottom: 56px; max-width: 520px; padding: 12px 16px; margin: 0; }

.credits {
  position: absolute; left: 16px; bottom: 12px; z-index: 1;
  color: var(--quiet); font-size: 12px;
}
.credits a { color: inherit; }

@media (max-width: 640px) {
  .panel--board { top: auto; bottom: 40px; max-height: 40%; }
}

/* The compass, as in wms-sim: top right, left of the movements board. */
.compass {
  position: absolute; top: 84px; right: 392px; z-index: 2;
  width: 58px; height: 58px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.14); background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
  color: #1f2937; cursor: pointer;
}
.compass:hover { background: rgba(255, 255, 255, 0.95); }
.compass:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.compass svg { display: block; width: 100%; height: 100%; }
.compass__tick { stroke: currentColor; stroke-width: 1.2; opacity: 0.5; }
.compass__n { fill: #dc2626; font: 700 11px system-ui, sans-serif; }
.compass__l { fill: currentColor; font: 600 8.5px system-ui, sans-serif; opacity: 0.75; }
.compass__needle-n { fill: #dc2626; }
.compass__needle-s { fill: currentColor; opacity: 0.35; }
@media (max-width: 640px) { .compass { right: 16px; width: 50px; height: 50px; } }

/* The settings menu in the top bar, after wms-sim's Performance menu. */
.settings { position: relative; }
.settings__toggle {
  font: inherit; font-size: 0.85rem; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.settings__toggle[aria-expanded='true'] { border-color: var(--blue); }
.settings__toggle:focus-visible, .settings__menu select:focus-visible, .settings__menu input:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.settings__badge { font-size: 0.7rem; font-weight: 600; color: #fff; background: var(--blue); border-radius: 999px; padding: 1px 7px; }
.settings__menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 3; width: 290px;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}
.settings__field { display: grid; gap: 4px; font-size: 0.85rem; }
.settings__field select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); }
.settings__switch { display: flex; gap: 8px; align-items: center; font-size: 0.85rem; }
.settings__feed { margin: 0; display: flex; gap: 8px; align-items: baseline; font-size: 0.8rem; color: var(--quiet); }
.settings__feed .dot { flex: none; }
.settings__feed[data-state='typical'] .dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 138, 31, 0.2); }
.settings__feed[data-state='off'] .dot { background: #94a3b8; box-shadow: none; }
.board__road { margin: 0 0 8px; font-size: 0.85rem; }
.board__road b { color: var(--orange); }
.settings__menu[hidden] { display: none; }

/* "A new version is available" (js/update.js) */
.update-bar {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  background: var(--ink); color: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  font-size: 14px; max-width: calc(100vw - 32px);
}
.update-bar button {
  font: inherit; font-weight: 600; color: var(--ink); background: #fff; border: 0; border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
}
.update-bar button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.legend {
  position: absolute; z-index: 1; left: 12px; bottom: 40px;
  display: flex; gap: 12px; margin: 0; padding: 6px 10px; list-style: none;
  border-radius: 8px; background: rgba(15, 23, 42, 0.85); color: #fff;
  font-size: 12px; font-weight: 600;
}
.legend li { display: flex; align-items: center; gap: 6px; }
.legend__dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(15, 23, 42, 0.85); box-shadow: 0 0 0 1px #fff; }
@media (max-width: 640px) {
  .legend { flex-wrap: wrap; left: 8px; right: 8px; bottom: auto; top: 8px; gap: 8px; }
}

.build { font-size: 12px; color: var(--quiet); font-variant-numeric: tabular-nums; }

.view { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.view__label { color: var(--quiet); }
.view select {
  font: inherit; color: var(--ink); background: #fff; max-width: 15rem;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
}
.view select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
@media (max-width: 640px) { .view__label { display: none; } .view select { max-width: 9rem; } }

/* The airports in the header: click a name to go there, the box switches it off. */
.airports { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.airport {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px 2px 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.airport input { margin: 0; accent-color: var(--blue); }
.airport button {
  border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink);
  padding: 2px 6px; border-radius: 999px; cursor: pointer;
}
.airport button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.airport button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.airport--off button { color: var(--quiet); text-decoration: line-through; }
.airport--off button[aria-pressed="true"] { background: none; color: var(--quiet); }

.board__sub { margin: 12px 0 6px; font-size: 13px; }
.board__table--schedule s { color: var(--quiet); }
.board__status { font-weight: 600; color: var(--quiet); }
.board__status--air { color: #b45309; }
.board__status--ground { color: #0e7490; }
.board__table--schedule td:nth-child(-n+2) { white-space: nowrap; padding-right: 8px; }
