/* vTAC Hangar web — a lit hangar bay. Deep blue-black structure, one volt-green
   signal colour for "you are here" and "press this", cyan for everything else. */
:root {
  --bg: #050a12;
  --sheet: #0a131f;
  --card: #101b27;
  --card-2: #0c1621;
  --line: #1a2634;
  --line-2: #263647;
  --text: #eef4fb;
  --muted: #8ba0b6;
  --accent: #2ecbff;
  --accent-ink: #04141d;
  /* The signal colour. Nothing else on the page is this loud, so it always means
     one of two things: the section you are standing in, or the button to press. */
  --volt: #c9ff3b;
  --volt-ink: #0a1104;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  /* One colour per package type, used for the chip dot and the tag on the card.
     Colour is a label here, not decoration: a glance says livery or scenery. */
  --type-livery: #ff7ab8;
  --type-scenery: #45d6a4;
  --type-addon: #ffc65e;
  --type-document: #a99bff;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  /* Two soft washes behind everything, fixed so the light does not slide as you scroll. */
  background:
    linear-gradient(rgba(46, 203, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, rgba(46, 203, 255, 0.035) 1px, transparent 1px) 0 0 / 64px 100%,
    radial-gradient(1100px 620px at 8% -12%, rgba(46, 203, 255, 0.18), transparent 62%),
    radial-gradient(900px 560px at 100% -10%, rgba(169, 155, 255, 0.12), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(46, 203, 255, 0.32); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.boot { padding: 48px; color: var(--muted); text-align: center; }

/* ---- top bar: brand, search, actions ---------------------------------------- */
.topbar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 11px 22px;
  background: rgba(5, 10, 18, 0.86);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(9px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .patch { width: 34px; height: 34px; border-radius: 50%; display: block; }
.brand .logo {
  font-weight: 800; font-size: 18px; letter-spacing: 0.005em; white-space: nowrap;
  background: linear-gradient(100deg, #f2f8ff 34%, var(--volt));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.search { position: relative; display: flex; align-items: center; justify-self: center; width: min(520px, 100%); color: var(--muted); }
.search > svg { position: absolute; left: 15px; pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 16px 0 42px;
  background: #0b1621; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); font: inherit; font-size: 14px;
}
.search input::placeholder { color: #6d8398; }
.search input:focus { border-color: rgba(46, 203, 255, 0.55); outline: none; box-shadow: 0 0 0 3px rgba(46, 203, 255, 0.12); }
.search-gap { display: block; }
.top-actions { display: flex; align-items: center; gap: 9px; justify-self: end; }
/* The outside links (vTAC Management System, TMS, Hub) read as plain links, not
   pills, so they don't compete with Admin/Approvals for weight in a row that's
   already tight on phone width. */
.ext-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; white-space: nowrap;
}
.ext-link:hover { color: var(--text); text-decoration: none; }
.ext-link svg { flex: none; }
/* A member with an approving Discord role but no Hangar publish rights still
   needs a way in, so this pill is independent of the Admin/Publish one. */
/* Quiet, not a green traffic light: approving accounts is routine staff work, and a
   filled lime pill in the header read as an alert competing with the catalogue. */
.pill.approvals-pill {
  background: rgba(74, 222, 128, 0.14); border-color: rgba(74, 222, 128, 0.55); color: #b9f7cf;
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.16);
}
.pill.approvals-pill:hover { background: rgba(74, 222, 128, 0.22); border-color: rgba(74, 222, 128, 0.85); }

/* Second row under the main top bar: the outside links (vTAC Management
   System, TMS, Hub) plus Missions, kept visible everywhere but out of the way of
   Admin/Approvals/account in the row above. */
.toplinks-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 7px 22px;
  background: rgba(5, 10, 18, 0.72);
  border-bottom: 1px solid var(--line);
}
/* On a laptop the labels made this row wrap onto a second line and shove the sheet
   down; the icons carry the same links with their titles on hover. */
@media (max-width: 1180px) { .ext-label { display: none; } }
.toplinks-bar .pill { height: 32px; padding: 0 14px; font-size: 13px; margin-left: auto; }

/* ---- section nav: vTAC RAF / vTAC USAF / vTAC-AAR-Weapons-Mod --------------- */
/* The section you are standing in is the page's biggest label, so it gets the signal
   colour: a lit chip in a row of quiet outlined ones. */
.section-nav {
  display: flex; gap: 8px; padding: 10px 22px;
  background: rgba(5, 10, 18, 0.72); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-tab {
  display: inline-flex; align-items: center; white-space: nowrap;
  color: var(--muted); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.11em;
  padding: 9px 18px; border-radius: 999px; border: 1px solid transparent;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.section-tab:hover { color: var(--text); text-decoration: none; border-color: var(--line-2); background: #0d1824; }
.section-tab.is-active {
  background: var(--volt); border-color: var(--volt); color: var(--volt-ink);
  box-shadow: 0 0 22px rgba(201, 255, 59, 0.34);
}
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 18px;
  border-radius: 999px; background: var(--volt); color: var(--volt-ink);
  font-size: 13px; font-weight: 800; letter-spacing: 0.04em;
  border: 1px solid var(--volt); white-space: nowrap;
  box-shadow: 0 6px 18px rgba(201, 255, 59, 0.18);
}
.pill:hover { text-decoration: none; background: #d9ff6f; border-color: #d9ff6f; }
.pill svg { flex: none; }
/* A pill that is a destination rather than the page's action: outlined, so the lit
   pill stays the thing the header is pointing at. */
.pill.ghost {
  background: transparent; border-color: #2b4055; color: var(--text);
  box-shadow: none; font-weight: 700;
}
.pill.ghost:hover { background: #14222f; border-color: var(--accent); color: var(--accent); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, #2ecbff, #6a7dff); color: #05121b;
  font-size: 14px; font-weight: 700; border: 1px solid rgba(255, 255, 255, 0.16);
}
.avatar:hover { text-decoration: none; filter: brightness(1.1); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: #0d1824; border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; list-style: none;
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
details.menu { position: relative; }
details.menu[open] > .icon-btn { color: var(--text); border-color: var(--line-2); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 186px;
  background: #0d1824; border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; gap: 2px; z-index: 30;
}
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border-radius: 8px; border: none; background: none;
  color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.menu-panel a svg, .menu-panel button svg { flex: none; color: var(--muted); }
.menu-panel a:hover, .menu-panel button:hover { background: #16232f; text-decoration: none; }

/* ---- the sheet: everything under the header --------------------------------- */
.sheet {
  background: linear-gradient(180deg, #0b1521, #070d16 520px);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 18px 18px 0 0;
  margin: 0 12px; padding: 34px 34px 60px;
  min-height: calc(100vh - 62px);
}
.page { max-width: 1200px; margin: 0 auto; }

/* ---- radio: the relay's own panel, filling the sheet ------------------------ */
/* Wider than the default page cap: the head unit lays itself out across the width. */
.page-radio { max-width: 1600px; }
.radio-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.radio-note a { margin-left: 6px; }
.radio-frame {
  width: 100%; height: calc(100vh - 220px); min-height: 620px;
  border: 1px solid var(--line); border-radius: 12px; background: #05090f;
}
@media (max-width: 720px) { .radio-frame { height: 72vh; min-height: 460px; } }

/* ---- page head -------------------------------------------------------------- */
.page-head { position: relative; display: flex; align-items: baseline; gap: 16px; margin: 0 0 18px; padding-left: 14px; }
.page-head::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 2px;
  background: var(--volt); box-shadow: 0 0 14px rgba(201, 255, 59, 0.55);
}
.page-head h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.03em; }
.page-head .count { margin-left: auto; color: var(--muted); font-size: 13.5px; white-space: nowrap; }

/* ---- catalogue masthead ----------------------------------------------------- */
/* The catalogue opens on a lit banner instead of a line of grey type: this is the
   hangar, and the page should say so before you have read a single package name. */
.cat-hero {
  position: relative; overflow: hidden; margin: 0 0 18px; padding: 22px 28px 20px;
  border: 1px solid #263a4e; border-radius: 18px;
  background:
    radial-gradient(120% 200% at 0% 0%, rgba(201, 255, 59, 0.18), transparent 55%),
    radial-gradient(90% 170% at 100% 0%, rgba(46, 203, 255, 0.22), transparent 58%),
    linear-gradient(180deg, #101e2b, #0a141f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 40px rgba(0, 0, 0, 0.35);
}
/* Diagonal hazard hatching, barely there: it reads as a hangar floor without
   turning into a pattern that competes with the package art. */
.cat-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(115deg, transparent 0 22px, rgba(201, 255, 59, 0.055) 22px 24px),
    linear-gradient(90deg, transparent 60%, rgba(46, 203, 255, 0.07));
}
.cat-hero > * { position: relative; z-index: 1; }
.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--volt);
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--volt); box-shadow: 0 0 12px var(--volt); }
.cat-hero h1 {
  margin: 9px 0 7px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.03;
  font-weight: 800; letter-spacing: -0.035em;
}
.cat-hero-sub { margin: 0; color: #a9bccd; font-size: 14.5px; max-width: 64ch; }

/* ---- filters: one wrapping row of chips, facets and sort -------------------- */
/* Type, base, squadron, sort and the result count in a single band. It was three
   labelled rows, which cost more vertical space than the first row of cards. */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.filters .count {
  margin-left: auto; padding: 6px 13px; border-radius: 999px;
  border: 1px solid rgba(201, 255, 59, 0.42); background: rgba(201, 255, 59, 0.10);
  color: var(--volt); font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.filter-split { width: 1px; height: 22px; background: var(--line); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #0d1824; border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 8px 15px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.chip:hover { background: #111e2b; border-color: var(--line-2); }
.chip.is-active { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); font-weight: 800; }
/* The type icon carries the type colour; on the active chip it borrows the ink
   colour so it stays legible on cyan. */
.chip svg { flex: none; color: var(--muted); }
.chip[data-type="livery"] svg { color: var(--type-livery); }
.chip[data-type="scenery"] svg { color: var(--type-scenery); }
.chip[data-type="addon"] svg { color: var(--type-addon); }
.chip[data-type="document"] svg { color: var(--type-document); }
.chip.is-active svg { color: currentColor; }
.select-pill {
  appearance: none; -webkit-appearance: none;
  background: #0d1824 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%238ba0b6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); color: var(--text); border-radius: 999px;
  padding: 8px 36px 8px 15px; font: inherit; font-size: 13.5px; cursor: pointer;
  max-width: 240px;
}
.select-pill:hover { background-color: #111e2b; border-color: var(--line-2); }
.filter-row .sort { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip-count { margin-left: 2px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip.is-active .chip-count { color: inherit; opacity: 0.75; }
.link-btn {
  background: none; border: none; color: var(--muted); font: inherit; font-size: 13px;
  cursor: pointer; padding: 8px 6px; border-radius: 8px;
}
.link-btn:hover { color: var(--text); text-decoration: underline; }

/* ---- the grid --------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 20px; }
.card {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
/* A coloured edge over the artwork, keyed to the package type: from across the room a
   row of cards reads as liveries / scenery / kit before any tag is legible. */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent); z-index: 2;
}
.card[data-type="livery"]::before { background: var(--type-livery); }
.card[data-type="scenery"]::before { background: var(--type-scenery); }
.card[data-type="addon"]::before { background: var(--type-addon); }
.card[data-type="document"]::before { background: var(--type-document); }
.card:hover {
  border-color: rgba(46, 203, 255, 0.55); transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(46, 203, 255, 0.22);
}
.art { position: relative; aspect-ratio: 16 / 9; background: #091420; overflow: hidden; }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 10, 17, 0.5), rgba(4, 10, 17, 0) 42%, rgba(4, 10, 17, 0.22));
}
/* No picture: a coloured plate with the station code, so the grid keeps its rhythm
   instead of showing a grey hole. --hue comes from the station name. */
.art-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background:
    radial-gradient(120% 130% at 18% 0%, hsl(var(--hue, 200) 70% 40% / 0.5), transparent 62%),
    linear-gradient(160deg, #16232f, #0a1420);
}
/* The watermark repeats the card's type, so a row of plates still says what they are. */
.art-fallback svg { color: var(--plate, #8ba0b6); opacity: 0.45; }
.art-fallback[data-type="livery"] { --plate: var(--type-livery); }
.art-fallback[data-type="scenery"] { --plate: var(--type-scenery); }
.art-fallback[data-type="addon"] { --plate: var(--type-addon); }
.art-fallback[data-type="document"] { --plate: var(--type-document); }
.art-fallback b { font-size: 28px; letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.6); font-weight: 700; }
.tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(6, 14, 22, 0.74); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.01em;
}
.tag svg { flex: none; }
.tag[data-type="livery"] { color: var(--type-livery); }
.tag[data-type="scenery"] { color: var(--type-scenery); }
.tag[data-type="addon"] { color: var(--type-addon); }
.tag[data-type="document"] { color: var(--type-document); }
/* The card's round action: go to the source site, or the lock while approval is
   pending. A hosted package has no browser action, so it shows only the hand-off. */
.go {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38);
}
.go:hover { background: #6adeff; text-decoration: none; }
.go:disabled { opacity: 0.55; cursor: default; }
/* Admin-only shortcut into the edit form, sitting just left of the main action so it
   never competes with it for attention. Neutral colour marks it as the secondary,
   staff-only control rather than the thing every visitor is meant to click. */
.edit-pkg {
  right: 50px; width: 28px; height: 28px;
  background: rgba(6, 14, 22, 0.78); color: #cfe3f2;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
/* The launcher hand-off is the only action a hosted package has, so it takes the
   slot the download button used to: neutral rather than accent, since pressing it
   hands over to another app rather than doing the thing itself here. */
.go.launch {
  right: 10px; width: 28px; height: 28px;
  background: rgba(6, 14, 22, 0.78); color: #cfe3f2;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.edit-pkg:hover { background: rgba(10, 22, 34, 0.92); color: #fff; }
.card-body { padding: 12px 15px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.card-title {
  margin: 0; font-size: 16.5px; line-height: 1.3; font-weight: 750; letter-spacing: -0.015em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.card-sub { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.card-sub .base { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub .base .icao { color: #657b91; letter-spacing: 0.04em; }
.ver {
  margin-left: auto; flex: none; font-size: 11.5px;
  padding: 2px 9px; border-radius: 999px;
  background: #182634; border: 1px solid var(--line-2); color: #cfdcea;
}
.card-credit {
  margin-top: auto; display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: #6f859b; min-width: 0;
}
/* The card's action, labelled and at the foot of the card where a button belongs.
   Full width so a row of cards reads as a set of equally weighted choices. */
.card-foot { margin-top: 12px; display: flex; gap: 8px; }
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; height: 36px; padding: 0 12px;
  background: #182635; border: 1px solid #2c4157; border-radius: 10px;
  color: var(--text); font: inherit; font-size: 12px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cta:hover { background: #20313f; border-color: #3a5470; text-decoration: none; }
/* "Get from flightsim.to" is a real action too, just one that leaves the site: cyan
   keeps it pressable next to the volt install buttons without claiming their weight. */
.cta[href] { border-color: rgba(46, 203, 255, 0.42); color: #8ce4ff; background: rgba(46, 203, 255, 0.08); }
.cta[href]:hover { background: rgba(46, 203, 255, 0.18); border-color: rgba(46, 203, 255, 0.7); color: #b7efff; }
/* Installing is the whole point of the page, so the installable cards get a lit
   button and the rest stay quiet: a glance down the grid shows what you can have. */
.cta.primary {
  background: var(--volt); border-color: var(--volt); color: var(--volt-ink);
  box-shadow: 0 8px 20px rgba(201, 255, 59, 0.18);
}
.cta.primary:hover { background: #dcff77; border-color: #dcff77; box-shadow: 0 10px 26px rgba(201, 255, 59, 0.32); }
.cta:disabled { opacity: 0.5; cursor: default; text-transform: none; letter-spacing: 0.02em; }
/* Staff-only shortcut into the editor: there when you are hovering the card, invisible
   when you are just browsing it. */
.card .edit-pkg { opacity: 0; transition: opacity 120ms ease; }
.card:hover .edit-pkg, .card:focus-within .edit-pkg { opacity: 1; }
@media (hover: none) { .card .edit-pkg { opacity: 1; } }
.card-credit svg { flex: none; opacity: 0.75; }
.card-credit .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-credit .sep { opacity: 0.45; }
.empty-note { color: var(--muted); padding: 48px 20px; text-align: center; grid-column: 1 / -1; }
/* The card itself opens the detail view now, so it needs to read as clickable —
   but the two circular buttons sitting on top of it keep their own cursor via the
   normal button default, which wins because they're on top. */
.card { cursor: pointer; }
/* A warning-coloured twin of .tag, pinned to the opposite corner of the art so it
   reads as a flag rather than competing with the type label for the same spot. */
.tag.update-flag {
  top: auto; bottom: 10px; left: 10px;
  background: rgba(64, 44, 10, 0.88); border-color: rgba(251, 191, 36, 0.4); color: var(--warn);
}
/* A hosted file waiting on approval -- the opposite corner from update-flag so
   the two never collide on a card that happens to carry both. */
.tag.lock-flag {
  top: auto; bottom: 10px; right: 10px;
  background: rgba(20, 33, 46, 0.88); border-color: var(--line-2); color: var(--muted);
}

/* ---- package detail: a dialog over everything, opened from a card ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(3, 7, 12, 0.72); backdrop-filter: blur(3px);
}
.detail-panel {
  position: relative; width: min(560px, 100%); max-height: min(88vh, 760px); overflow-y: auto;
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}
.detail-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 14, 22, 0.78); color: var(--text); display: grid; place-items: center; cursor: pointer;
}
.detail-close:hover { background: rgba(10, 22, 34, 0.92); }
.detail-art { aspect-ratio: 16 / 8; background: #091420; overflow: hidden; }
.detail-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.detail-status {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 10px; font-size: 13.5px;
  background: var(--card-2); border: 1px solid var(--line);
}
.detail-status svg { flex: none; }
.detail-status.ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.3); }
.detail-status.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(64, 44, 10, 0.3); }
.detail-status.muted { color: var(--muted); }
.detail-desc { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.detail-desc.muted { color: var(--muted); font-style: italic; }
.detail-section h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }
.detail-section p { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.detail-section ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip {
  font-size: 12px; padding: 4px 11px; border-radius: 999px;
  background: #0d1824; border: 1px solid var(--line); color: var(--muted);
}
.detail-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.detail-actions .btn { display: inline-flex; align-items: center; gap: 7px; }
.detail-actions .btn svg { flex: none; }
.detail-edit { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.detail-edit:hover { color: var(--accent); text-decoration: none; }

/* ---- notes and credits under the grid -------------------------------------- */
.page-foot { margin: 34px 0 0; display: flex; flex-direction: column; gap: 8px; }
.page-note { margin: 0; color: #6f859b; font-size: 12px; }
.credits { color: #6f859b; font-size: 12px; }
.credits > summary { cursor: pointer; list-style: none; padding: 2px 0; }
.credits > summary::-webkit-details-marker { display: none; }
.credits > summary::before { content: "+ "; }
.credits[open] > summary::before { content: "- "; }
.credits > summary:hover { color: var(--text); }
.credits ul {
  list-style: none; margin: 10px 0 0; padding: 12px 16px; max-width: 720px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px;
  display: grid; gap: 6px;
}
.credits .credit-station { color: var(--text); font-weight: 600; }

/* ---- buttons and forms ------------------------------------------------------ */
.btn {
  background: #14212e; color: var(--text); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 8px 14px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn.primary:hover { background: #63dcff; }
/* A package that lives on someone else's site is a different promise from one we
   host, so it is coloured differently: warm, and never blue. */
.btn.outbound { background: linear-gradient(180deg, #ffd98c, #f0a63a); border-color: #f0a63a; color: #26190a; }
.btn.outbound:hover { background: linear-gradient(180deg, #ffe6ac, #ffbe5c); }
.btn.danger { border-color: #6d2b2b; color: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: default; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; max-width: 430px; margin: 40px auto;
}
.panel h1 { margin: 0 0 12px; font-size: 20px; letter-spacing: -0.01em; }
.panel.auth { text-align: center; }
.panel.auth::before {
  content: ''; display: block; width: 84px; height: 84px; margin: 2px auto 16px;
  border-radius: 50%; background: url("/logo.png") center / contain no-repeat;
  box-shadow: 0 0 48px rgba(46, 203, 255, 0.22);
}
.panel.auth h1 { margin-bottom: 6px; }
.panel.auth .note { margin-top: 4px; }
.panel.auth label, .panel.auth .error { text-align: left; }
.panel.auth .btn.sso {
  display: block; width: 100%; margin-top: 4px; padding: 11px 14px;
  font-size: 15px; text-align: center; text-decoration: none;
}
.panel.auth .btn.sso:hover { text-decoration: none; }
/* Discord is the one place a colour from outside this palette is right: the button is
   recognised as "this leaves the site" by its blurple, not by the label. */
.panel.auth .btn.sso.discord { background: #5865f2; color: #fff; box-shadow: 0 6px 18px rgba(88, 101, 242, 0.28); }
.panel.auth .btn.sso.discord:hover { background: #4752c4; }
.panel.auth .or { color: var(--muted); font-size: 12px; margin: 20px 0 0; }
.panel label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); text-align: left; }
.panel input, .panel textarea, .panel select {
  width: 100%; background: #0b1621; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font-size: 14px; font-family: inherit;
}
.panel .row { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.panel .row > label { flex: 0 0 150px; }
.panel .row > input, .panel .row > select, .panel .row > textarea { flex: 1 1 auto; min-width: 0; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 14px; line-height: 1.5; }
.hint b { color: var(--text); font-weight: 600; }
.hint.warn { color: var(--warn); }
.error { color: var(--bad); font-size: 13.5px; margin-top: 10px; min-height: 18px; }
.note { color: var(--muted); font-size: 13px; }
.note.small { font-size: 12.5px; }
.temp-password { background: #0b1621; border: 1px dashed #2f6f8a; padding: 10px 12px; border-radius: 9px; font-family: ui-monospace, monospace; margin-top: 8px; }
.tabs { display: flex; gap: 4px; padding: 0 0 10px; flex-wrap: wrap; }
.tabs button {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.tabs button.active { background: #14212e; color: var(--text); border-color: var(--line-2); }
.section-title { margin: 30px 0 10px; font-size: 15px; letter-spacing: 0.01em; }
/* Admin is a working page, not a form page: its panels line up with the tables
   rather than floating in the middle of the window. */
.admin .panel { margin: 0 0 12px; max-width: 560px; }
.admin .panel .row > label { flex: 0 0 110px; }
/* Mission planning + route map: fields on the left in a scrolling panel,
   the map as its own tall pane on the right -- same split a dispatch/flight
   planning tool like SimBrief uses, rather than a map squeezed into a form. */
/* Wider than the default .page cap (1200px) -- the map column (1fr) is what
   soaks up the extra room, so this is what actually fixes "the map is tiny
   with empty space around it" on anything wider than a laptop screen. */
.page-missions { max-width: 1600px; }
.mission-form-layout, .mission-detail-layout {
  display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 20px;
  align-items: start; margin: 4px 0 40px;
}
.mission-form-layout .panel, .mission-detail-layout .panel { margin: 0; max-width: none; }
.mission-form-left, .mission-detail-left { max-height: min(80vh, 880px); overflow-y: auto; padding-right: 6px; }
.mission-map-pane {
  position: sticky; top: 78px; height: min(80vh, 880px);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--card); display: flex; flex-direction: column;
}
.mission-map-pane #mission-map, .mission-map-pane #mission-detail-map { flex: 1 1 auto; width: 100%; }
.mission-map-pane .mission-map-hint { padding: 10px 14px; margin: 0; border-top: 1px solid var(--line); }
@media (max-width: 880px) {
  .mission-form-layout, .mission-detail-layout { grid-template-columns: 1fr; }
  .mission-form-left, .mission-detail-left { max-height: none; overflow: visible; padding-right: 0; }
  .mission-map-pane { position: static; height: 420px; top: auto; }
}
.muted { opacity: 0.8; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2);
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.badge.ok { color: var(--ok); border-color: #2c5a3c; }
.badge.warn { color: var(--warn); border-color: #6b5518; }
.badge.bad { color: var(--bad); border-color: #7f2d2d; }

/* ---- tables (admin) --------------------------------------------------------- */
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: top; }
table.list th { background: #0d1824; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }
table.list tr:last-child td { border-bottom: none; }

/* ---- home: trending this week, quick tiles, newest categories --------------- */
.home-section { margin: 0 0 34px; }
.home-section-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; }
.home-section-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.home-section-head h2 svg { color: var(--warn); }
.home-view-all { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; color: var(--muted); }
.home-view-all:hover { color: var(--accent); text-decoration: none; }
.home-view-all svg { flex: none; }

.trend-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.trend-tab {
  background: none; border: 1px solid transparent; border-radius: 999px; padding: 6px 14px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.trend-tab:hover { color: var(--text); background: #0d1824; }
.trend-tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.trend-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 20px; align-items: stretch; }
.trend-hero {
  position: relative; min-height: 320px; border-radius: var(--radius); overflow: hidden;
  background: var(--card) center/cover no-repeat; border: 1px solid var(--line); cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; text-align: left; padding: 0;
  font: inherit; color: var(--text); width: 100%;
}
.trend-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 10, 18, 0.05) 0%, rgba(5, 10, 18, 0.55) 55%, rgba(5, 10, 18, 0.92) 100%);
}
.trend-hero-badge {
  position: absolute; top: 16px; left: 16px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(180deg, #ff8a6a, #e2473f);
  color: #2a0a06; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.trend-hero-body { position: relative; z-index: 1; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.trend-hero-body h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.trend-hero-meta { display: flex; align-items: center; gap: 6px; color: #cfe3f5; font-size: 13.5px; }
.trend-hero-meta svg { flex: none; }

.trend-list { display: flex; flex-direction: column; gap: 8px; }
.trend-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font: inherit; color: var(--text); cursor: pointer;
}
.trend-row:hover { border-color: rgba(46, 203, 255, 0.45); }
.trend-rank { width: 20px; flex: none; text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; }
.trend-thumb { position: relative; width: 44px; height: 44px; flex: none; border-radius: 8px; overflow: hidden; background: #091420; }
.trend-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trend-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trend-name { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-count { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.trend-count svg { flex: none; }

.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.home-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.home-tile svg { color: var(--accent); }
.home-tile:hover { border-color: rgba(46, 203, 255, 0.45); }
.home-tile.is-active { border-color: var(--accent); background: #0d1f2b; }
.home-tile-label { font-weight: 650; font-size: 14px; }
.home-tile-stat { font-size: 12.5px; color: var(--muted); }
#tile-body:not(:empty) { margin-top: 18px; }

.home-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.followed-group { margin: 0 0 22px; }
.followed-group:last-child { margin-bottom: 0; }
.followed-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.followed-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.link-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px; background: none; border: none;
  color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0;
}
.link-btn:hover { color: var(--bad); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; background: #0d1824; border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip-count { color: var(--muted); font-size: 11.5px; }

.chip-cat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-cat {
  display: inline-flex; align-items: stretch; background: #0d1824; border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden;
}
.chip-cat-label {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: none;
  color: var(--text); font: inherit; font-size: 13px; padding: 8px 6px 8px 14px; cursor: pointer;
}
.chip-cat-label:hover { color: var(--accent); }
.chip-cat-label .chip-count { color: var(--muted); font-size: 11.5px; }
.chip-cat-follow {
  display: inline-flex; align-items: center; justify-content: center; width: 32px;
  background: none; border: none; border-left: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.chip-cat-follow:hover { color: var(--accent); background: #101d2a; }
.chip-cat-follow.is-following { color: var(--ok); }
@media (max-width: 760px) {
  .trend-layout { grid-template-columns: 1fr; }
  .trend-hero { min-height: 220px; }
}

/* ---- public landing page ---------------------------------------------------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing-top {
  display: flex; align-items: center; gap: 14px; padding: 12px 26px;
  border-bottom: 1px solid var(--line); background: rgba(5, 10, 18, 0.86);
}
.landing-top nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; align-items: center; }
.hero { flex: 1; text-align: center; padding: 72px 24px 56px; max-width: 620px; margin: 0 auto; }
.hero .patch {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 22px; display: block;
  box-shadow: 0 0 70px rgba(46, 203, 255, 0.24), 0 0 0 1px rgba(46, 203, 255, 0.12);
}
.hero h1 { margin: 0 0 10px; font-size: 34px; letter-spacing: -0.02em; font-weight: 700; }
.hero .tagline { color: var(--muted); font-size: 16px; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.hero .cta .pill { height: 44px; padding: 0 24px; font-size: 15px; }
.landing-foot { border-top: 1px solid var(--line); padding: 28px 24px 44px; }
.landing-foot h2 { font-size: 13px; max-width: 620px; margin: 0 auto 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; }
.landing-foot ol { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 14px; padding-left: 20px; }
.landing-foot li::marker { color: var(--accent); font-weight: 700; }
.landing-foot li { margin-bottom: 6px; }

/* ---- toasts ----------------------------------------------------------------- */
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: #14212e; border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  color: var(--text); padding: 10px 14px; border-radius: 9px; font-size: 13.5px; max-width: 360px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.toast.error { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }
/* "Saved, but not live yet" — a large upload waiting on an admin. */
.toast.warn { border-left-color: var(--warn); }

/* ---- narrow windows --------------------------------------------------------- */
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; gap: 10px; padding: 10px 14px; }
  .topbar .search { grid-column: 1 / -1; order: 3; width: 100%; }
  .search-gap { display: none; }
  /* The two outside links keep their icon (and a title tooltip) but drop their
     text at this width -- there just isn't room on a narrow second row either. */
  .ext-label { display: none; }
  .toplinks-bar { padding: 8px 14px; gap: 12px; }
  .section-nav { padding: 8px 14px; }
  .sheet { margin: 0 6px; padding: 22px 16px 48px; border-radius: 14px 14px 0 0; }
  .page-head { flex-wrap: wrap; gap: 4px 12px; }
  .cat-hero { padding: 20px 18px 18px; border-radius: 14px; }
  .cat-hero h1 { font-size: 28px; }
  .cat-hero-sub { font-size: 13.5px; }
  /* The bar wraps rather than scrolling, and the count drops to its own line
     instead of squeezing the selects. */
  .filters { gap: 8px; }
  /* Right-aligned after the sort control rather than forced onto its own line: at
     this width it still fits beside it, and a lone "92 results" line is wasted height. */
  .filters .count { margin-left: auto; }
  .filter-split { display: none; }
  /* Three across here, not four: at this width a 150px minimum squeezed titles
     into ellipses under a 220px gap of unused space. */
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
  .card .art { aspect-ratio: 4 / 3; }
  .panel { margin: 20px auto; padding: 18px; }
}
/* Phone width: two cards across, with the metadata allowed to wrap instead of
   squeezing the base name into an ellipsis. */
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 11px 12px 13px; gap: 7px; }
  .card-title { font-size: 13.5px; }
  .card-sub { flex-wrap: wrap; gap: 4px 8px; font-size: 12px; }
  .ver { margin-left: 0; font-size: 11px; }
  .card-credit { font-size: 11.5px; }
  .art .tag { font-size: 10.5px; padding: 3px 8px; top: 8px; left: 8px; }
  .go { width: 28px; height: 28px; top: 8px; right: 8px; }
  .edit-pkg { width: 24px; height: 24px; top: 10px; right: 42px; }
  .go.launch { width: 24px; height: 24px; top: 8px; right: 8px; }
  .sheet { margin: 0 4px; padding: 18px 12px 40px; }
}
