:root {
  --asphalt: #4a4f55;
  --runway-asphalt: #3a3f45;
  --concrete: #8b9196;
  --marking-white: #e8ecec;
  --glasshouse-white: #dfe6e6;
  --terminal-glass: #a8bfc4;
  --klm-blue: #009fd8;
  --polder-green: #5c8a4a;
  --water: #3f5f6e;
  --runway-edge: #1b3a5c;
  --apron-flood: #6b5a2c;
  --stop-bar: #5c1b1b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--runway-asphalt);
  color: var(--marking-white);
  font-family: system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.stage {
  position: fixed;
  inset: 0;
  touch-action: none;
  cursor: grab;
}

.stage:active {
  cursor: grabbing;
}

.layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--asphalt);
  border-top: 2px solid var(--concrete);
}

.hud-level,
.hud-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 10px;
  font: inherit;
  color: inherit;
  background: var(--runway-asphalt);
  border: 2px solid var(--concrete);
  border-radius: 4px;
}

.hud-level[aria-pressed="true"],
.hud-toggle[aria-expanded="true"] {
  background: var(--runway-edge);
  border-color: var(--klm-blue);
}

.hud-level:focus-visible,
.hud-toggle:focus-visible {
  outline: 3px solid var(--apron-flood);
  outline-offset: 2px;
}

.icon {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
  font-size: 20px;
  line-height: 1;
}

.status,
.counter {
  margin: 0;
  padding: 4px 8px;
  color: var(--glasshouse-white);
  background: var(--water);
  border-radius: 4px;
}

.tooltip,
.modal {
  position: fixed;
  max-width: 30ch;
  padding: 8px 10px;
  background: var(--asphalt);
  color: var(--marking-white);
  border: 2px solid var(--terminal-glass);
  border-radius: 4px;
}

.tooltip {
  top: 12px;
  left: 12px;
}

.aircraft-card {
  position: fixed;
  top: 12px;
  right: 12px;
  min-width: 22ch;
  max-width: 30ch;
  padding: 8px 10px;
  background: var(--asphalt);
  color: var(--marking-white);
  border: 2px solid var(--terminal-glass);
  border-radius: 4px;
}

.aircraft-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}

.aircraft-card-close {
  min-width: 28px;
  min-height: 28px;
  padding: 2px 6px;
  font: inherit;
  color: inherit;
  background: var(--runway-asphalt);
  border: 2px solid var(--concrete);
  border-radius: 4px;
}

.aircraft-card-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.aircraft-card-row .label {
  color: var(--concrete);
}

.stage.pointer {
  cursor: pointer;
}

.modal {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 28ch;
  max-width: min(92vw, 760px);
  width: 92vw;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-height: min(68vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
}

.panel-canvas {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: clamp(240px, 46vh, 560px);
  background: var(--runway-asphalt);
  border: 2px solid var(--concrete);
  border-radius: 4px;
}

.panel-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.panel-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--marking-white);
  background: var(--asphalt);
  border: 2px solid var(--concrete);
  border-radius: 4px;
  font: inherit;
  text-align: left;
}

.panel-row[data-selected="true"] {
  background: var(--runway-edge);
  border-color: var(--klm-blue);
}

.panel-empty {
  padding: 6px 10px;
  color: var(--concrete);
}

.footer {
  position: fixed;
  right: 12px;
  bottom: 76px;
  width: 300px;
  max-height: 26px;
  overflow: hidden;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--concrete);
  background: var(--runway-asphalt);
  border-radius: 6px;
  opacity: 0.85;
}

.footer::before {
  content: "Sources and credits";
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.footer:hover,
.footer:focus-within {
  max-height: 60vh;
  width: min(560px, 90vw);
  overflow: auto;
  opacity: 1;
}

.footer a {
  color: var(--klm-blue);
  word-break: break-all;
}

.footer .attribution-row {
  margin: 0 0 6px;
}

[hidden] {
  display: none;
}

@media (max-width: 639px) {
  .hud {
    gap: 6px;
    padding: 6px 8px;
  }

  .panel-canvas {
    height: 40vh;
  }

  .panel {
    max-height: 74vh;
  }

  .panel-row {
    min-height: 44px;
    font-size: 13px;
  }

  .hud-level .label,
  .hud-toggle .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .footer {
    font-size: 11px;
  }
}
