:root {
  color-scheme: dark;
  --background: #06111f; --panel: #0b1c31; --panel-strong: #081727;
  --line: #173352; --line-bright: #28547e;
  --text: #f5f8fc; --muted: #91a8c0;
  --accent: #f3a712; --accent-ink: #101820;
  --cancelled: #ff6b67; --delayed: #ffc14d; --complete: #60d394; --focus: #7db7ed;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100%;
  margin: 0;
  padding: 28px;
  background:
    radial-gradient(circle at 50% -30%, rgb(23 51 82 / 35%), transparent 45%),
    var(--background);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.shell {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 21px;
  font-weight: 950;
}

.brand-name,
.brand-tagline {
  display: block;
}

.brand-name {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-tagline {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.airport-search {
  display: flex;
  width: min(100%, 460px);
  gap: 8px;
}

.airport-search input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0a1728;
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px;
}

.airport-search input::placeholder {
  color: #7790aa;
}

.airport-search input:focus {
  border-color: var(--line-bright);
}

.airport-search button {
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.search-message {
  min-height: 20px;
  margin: 0;
  color: var(--delayed);
  font-size: 13px;
  text-align: right;
}

.board-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 0 12px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 950;
  letter-spacing: -0.045em;
}

.board-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.direction-tabs {
  display: flex;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.direction-tab {
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 10px 15px;
  font-weight: 800;
  cursor: pointer;
}

.direction-tab:first-child {
  border-left: 0;
}

.direction-tab.is-active {
  background: #16304e;
  color: var(--text);
}

.direction-tab:disabled {
  cursor: default;
  opacity: 0.55;
}

.stale-warning {
  margin-bottom: 10px;
  border: 1px solid #76571e;
  border-radius: 10px;
  background: #2b220f;
  color: #ffd88c;
  padding: 9px 12px;
  font-size: 13px;
}

.board {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}

.board-row {
  display: grid;
  grid-template-columns: 108px 104px minmax(230px, 1fr) 82px 108px 180px;
  align-items: center;
}

.board-head {
  min-height: 42px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-head > div,
.board-cell {
  min-width: 0;
  padding: 10px 13px;
}

.flight-row {
  min-height: 70px;
  border-top: 1px solid var(--line);
}

.flight-row.status-cancelled {
  box-shadow: inset 4px 0 var(--cancelled);
}

.flight-row.status-delayed,
.flight-row.status-retimed {
  box-shadow: inset 4px 0 var(--accent);
}

.date-separator {
  border-top: 1px solid var(--line-bright);
  background: #102844;
  color: #bed1e4;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: capitalize;
}

.time-cell {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.scheduled-time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.airline-cell,
.gate-cell,
.flight-cell {
  font-weight: 850;
}

.gate-cell {
  font-size: 18px;
}

.route-name {
  overflow: hidden;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-details {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
}

.status-code {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1;
  opacity: 0.75;
}

.status-cancelled .status-cell {
  color: var(--cancelled);
}

.status-delayed .status-cell,
.status-retimed .status-cell {
  color: var(--delayed);
}

.status-normal .status-cell:has(.status-code[title="Avinor-status A"]),
.status-normal .status-cell:has(.status-code[title="Avinor-status D"]) {
  color: var(--complete);
}

.mobile-airline {
  display: none;
}

.board-message {
  margin: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 30px;
}

.board-message-error {
  color: #ffaaa7;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #bfd0e1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

noscript {
  display: block;
  margin: 16px auto;
  color: var(--cancelled);
  text-align: center;
}

@media (max-width: 820px) {
  body {
    padding: 16px;
  }

  .site-header,
  .board-toolbar,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .airport-search {
    width: 100%;
  }

  .search-message {
    text-align: left;
  }

  .board-toolbar {
    margin-top: 14px;
  }

  .direction-tabs {
    align-self: flex-start;
  }

  .board-head {
    display: none;
  }

  .flight-row {
    grid-template-columns: 82px minmax(0, 1fr) 68px;
    grid-template-rows: auto auto auto;
    align-items: start;
    min-height: 0;
    padding: 12px 10px 11px;
  }

  .board-cell {
    padding: 3px 7px;
  }

  .time-cell {
    grid-column: 1;
    grid-row: 1 / span 2;
    font-size: 20px;
  }

  .airline-cell {
    display: none;
  }

  .route-cell {
    grid-column: 2;
    grid-row: 1;
  }

  .gate-cell {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .gate-cell::before {
    display: block;
    color: var(--muted);
    content: "Gate";
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .flight-cell {
    display: flex;
    grid-column: 2 / 4;
    grid-row: 2;
    gap: 8px;
    color: #dbe7f2;
    font-size: 13px;
  }

  .mobile-airline {
    display: inline;
    color: var(--muted);
    font-weight: 650;
  }

  .status-cell {
    grid-column: 1 / 4;
    grid-row: 3;
    margin-top: 6px;
    border-top: 1px solid rgb(40 84 126 / 55%);
    padding-top: 8px;
    font-size: 13px;
  }

  .date-separator {
    padding-left: 17px;
  }
}

@media (max-width: 430px) {
  .brand-name {
    font-size: 25px;
  }

  .airport-search button {
    padding-inline: 14px;
  }

  .direction-tab {
    padding-inline: 13px;
  }
}
