@font-face {
  font-family: "Bebas Neue";
  src: url(/static/fonts/bebas-neue-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  font-display: swap;
}
@font-face {
  font-family: "Bebas Neue";
  src: url(/static/fonts/bebas-neue-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}

:root {
  --bg: #0a0a0b;
  --panel: #111113;
  --panel-2: #17181b;
  --line: #25262a;
  --ink: #ececec;
  --muted: #8d9199;
  --accent: #ef3e42;
  --link: #8bb8ff;
  --display: "Bebas Neue", "Oswald", Impact, "Arial Narrow", sans-serif;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 52px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
header .brand { color: var(--ink); font-family: var(--display); font-size: 24px; letter-spacing: .03em; }
header nav { display: flex; gap: 18px; }
header nav a { color: var(--muted); }
header nav a:hover { color: var(--ink); text-decoration: none; }
header .spacer { flex: 1; }
.lang-toggle { border: 1px solid var(--line, #333); border-radius: 999px; padding: 2px 10px; font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.lang-toggle:hover { color: var(--ink); border-color: var(--muted); text-decoration: none; }
.banner { background: #6b4e00; color: #fff3cc; padding: 10px 20px; font-weight: 600; }
main { flex: 1; }
footer { padding: 14px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: var(--panel); }
.page { max-width: 1100px; margin: 0 auto; padding: 20px; }
.prose { max-width: 760px; line-height: 1.6; }
h1 { font-family: var(--display); font-weight: 400; font-size: 44px; letter-spacing: .02em; margin: 8px 0 12px; }
h2 { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: .03em; margin: 28px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* tables, forms, badges (flight log, stats, admin) */
table { border-collapse: collapse; width: 100%; background: var(--panel); font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--panel-2); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.flights td:first-child, table.flights td:nth-child(2) { white-space: nowrap; }
table.compact { width: auto; min-width: 320px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } table.flights { font-size: 12px; } }
.status { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #23252a; white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.status-airborne { background: rgba(239, 62, 66, .18); color: #ff8a8d; }
.status-lost { background: #2a2b30; color: #b7bac0; }
.status-landed { background: rgba(46, 160, 90, .16); color: #7fd49f; }
.status-incomplete { background: rgba(214, 150, 20, .16); color: #f0c060; }
.tag { font-size: 10px; color: #b3b7be; border: 1px solid #3d4046; border-radius: 4px; padding: 0 4px; text-transform: uppercase; letter-spacing: .06em; vertical-align: 1px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.filters .spacer { flex: 1; }
input, select, button { font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--ink); }
button { cursor: pointer; }
button:hover { border-color: #3a3c42; }
button.danger { background: var(--accent); color: #fff; border-color: var(--accent); }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.route { font-size: 18px; }
.facts { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; margin-top: 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.cards { display: flex; gap: 12px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; min-width: 160px; }
.card b { display: block; font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: .02em; }
.card span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.map { height: 440px; border-radius: 8px; border: 1px solid var(--line); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--c); margin-right: 10px; vertical-align: 6px; }
.ac-profile { display: grid; grid-template-columns: minmax(0, 440px) 1fr; gap: 24px; margin-bottom: 18px; line-height: 1.55; }
.ac-profile figure { margin: 0; }
.ac-profile img { width: 100%; border-radius: 8px; }
@media (max-width: 760px) { .ac-profile { grid-template-columns: 1fr; } }
.credit { font-size: 11px; color: var(--muted); margin: 4px 0 6px; }
.credit a { color: var(--muted); text-decoration: underline; }

/* Leaflet on the dark theme */
.leaflet-container { background: #0e0f11; font: inherit; }
.dark-tiles { filter: invert(1) hue-rotate(180deg) saturate(.3) brightness(.78) contrast(.92); }
.leaflet-tooltip { background: var(--panel-2); color: var(--ink); border: 1px solid #2c2e33; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); font-size: 12px; }
.leaflet-tooltip-top:before { border-top-color: var(--panel-2); }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--panel-2); }
.leaflet-tooltip-left:before { border-left-color: var(--panel-2); }
.leaflet-tooltip-right:before { border-right-color: var(--panel-2); }
.leaflet-bar a { background: var(--panel-2); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: #22242a; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: none !important; }
.leaflet-control-attribution { background: rgba(10, 10, 11, .7) !important; color: #6d7179; }
.leaflet-control-attribution a { color: #8d9199; }
.ac-icon { background: none; border: 0; }
.ac-label { font-size: 12px; }

/* ---- home: map stage on the left, flight log on the right ---------------------------- */
body.home { height: 100dvh; overflow: hidden; }
body.home main { min-height: 0; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 460px; height: 100%; min-height: 0; }
.stage { position: relative; min-height: 0; border-right: 1px solid var(--line); }
.stage #map { position: absolute; inset: 0 0 44px 0; }
.stage-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; gap: 18px;
  padding: 0 24px; background: var(--bg); border-top: 1px solid var(--line); font-size: 13px; z-index: 500;
}
.stage-bar a { color: var(--ink); text-decoration: underline; text-decoration-color: #444; text-underline-offset: 3px; }
.stage-bar .brand { font-family: var(--display); font-size: 20px; letter-spacing: .04em; text-decoration: none; margin-right: 6px; }
.stage-bar .spacer { flex: 1; }
.hero {
  position: absolute; left: 0; right: 0; bottom: 44px; z-index: 450; padding: 120px 36px 26px;
  background: linear-gradient(to top, rgba(10, 10, 11, .92) 30%, rgba(10, 10, 11, 0));
  pointer-events: none; transition: opacity .25s;
}
.stage.focused .hero { opacity: .25; }
.hero > * { max-width: 760px; }
.hero .kicker { font-family: var(--display); font-size: 22px; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.hero h1 { font-size: clamp(32px, 3.6vw, 56px); line-height: .98; margin: 0 0 14px; text-transform: uppercase; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; color: #b9bcc2; max-width: 560px; line-height: 1.5; font-size: 15px; }
.live-pill {
  position: absolute; top: 16px; left: 16px; z-index: 460; display: flex; flex-direction: column; gap: 6px;
}
.live-pill > button, .live-pill > span {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 12px; border-radius: 999px;
  background: rgba(17, 17, 19, .9); border: 1px solid var(--line); color: var(--ink); width: fit-content;
}
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.live-pill .on .dot { box-shadow: 0 0 0 0 var(--c); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

.log { display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.log-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.log-title { display: flex; align-items: center; gap: 8px; }
.log-title h2 { margin: 0; flex: 1; font-size: 30px; }
.log-title a, .log-title button {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; background: var(--panel-2); text-decoration: none;
}
.log-search { display: flex; gap: 8px; }
.log-search input { flex: 1; min-width: 0; }
.log-search select { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}
.chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c); opacity: .55; }
.chip.all { padding-left: 10px; }
.chip.on { color: var(--ink); border-color: var(--c, #555); background: color-mix(in srgb, var(--c, #555) 16%, var(--panel-2)); }
.chip.on img { opacity: 1; }
.profile { display: grid; grid-template-columns: 132px 1fr; gap: 12px; font-size: 13px; line-height: 1.45; }
.profile img { width: 132px; height: 88px; object-fit: cover; border-radius: 6px; border: 2px solid var(--c); }
.profile b { font-size: 14px; }
.profile p { margin: 4px 0 0; color: #c3c6cc; }
.profile .credit { grid-column: 1 / -1; margin: 0; }

.log-list { flex: 1; overflow-y: auto; min-height: 0; }
.month {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 18px; padding: 12px 20px;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.month h3 { font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: .04em; margin: 0; flex: 1; }
.stat { text-align: center; line-height: 1; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .03em; }
.stat span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.row { border-bottom: 1px solid var(--line); }
.row-main {
  display: grid; grid-template-columns: 1fr auto 22px; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 14px 20px 14px 17px; border: 0; border-left: 3px solid transparent; border-radius: 0; background: none;
}
.row-main:hover, .row.hot .row-main { background: #16171a; border-left-color: var(--c); }
.row.open .row-main { background: color-mix(in srgb, var(--c) 12%, var(--panel)); border-left-color: var(--c); }
.row-reg { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--c); }
.row-reg span { color: var(--muted); font-weight: 400; letter-spacing: .02em; }
.place { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.5; }
.place svg { flex: none; color: var(--muted); }
.place .code { color: var(--muted); font-size: 12px; }
.place .unknown { color: var(--muted); font-style: italic; }
.row-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row-num { text-align: right; font-family: var(--display); font-size: 30px; line-height: 1; letter-spacing: .02em; }
.row-num small { display: block; font-family: system-ui, sans-serif; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.chev { width: 22px; height: 22px; color: var(--muted); transition: transform .2s; }
.row.open .chev { transform: rotate(180deg); color: var(--ink); }
.row-details { padding: 6px 20px 20px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 5%, var(--panel)); }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.facts-grid dt { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.facts-grid dd { margin: 0; font-size: 15px; }
.facts-grid .code { color: var(--accent); font-size: 13px; }
.facts-grid .note { display: block; font-size: 12px; color: var(--muted); }
.facts-grid button { margin-top: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; }
.row-details .ac-line { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.row-details .ac-line img { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; }
.row-details .ac-line .spacer { flex: 1; }
.pill { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; font-weight: 700; vertical-align: 2px; }
.pill.airborne { background: rgba(239, 62, 66, .2); color: #ff8a8d; }
.pill.lost { background: #2a2b30; color: #b7bac0; }
.pill.incomplete { background: rgba(214, 150, 20, .16); color: #f0c060; }
.empty { padding: 28px 20px; color: var(--muted); }
.log-totals { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding: 12px 8px; background: var(--bg); }
.log-totals .stat b { font-size: 26px; }

@media (max-width: 900px) {
  body.home { height: auto; overflow: auto; }
  .home-grid { grid-template-columns: 1fr; height: auto; }
  .stage { height: 75vh; border-right: 0; }
  .hero { padding: 60px 16px 14px; }
  .hero .kicker, .hero p { display: none; }
  .hero h1 { font-size: 30px; margin: 0; }
  .live-pill { right: 64px; }
  .live-pill > span, .live-pill > button { width: auto; font-size: 12px; }
  .stage-bar { gap: 12px; padding: 0 14px; overflow-x: auto; white-space: nowrap; }
  .log-list { overflow: visible; }
}
