:root {
  --bg: #0f172a;
  --card: #dee1e6;
  --text: #1e2732;
  --muted: #525b68;
  --primary: #2563eb;
  --error: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--card);
  width: 100%;
  max-width: 420px;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

h1, h2 { margin: 0 0 8px; }

.muted { color: var(--muted); }

form { display: grid; gap: 12px; margin-top: 16px; }

label { display: grid; gap: 6px; font-size: 14px; }

input, textarea {
  padding: 10px 12px;
  border: 1px solid #aeb4bd;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: var(--input-bg, #e8eaed);
  color: var(--input-text, #1e2732);
}

textarea { resize: vertical; min-height: 76px; }

button {
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

button:hover { filter: brightness(0.95); }

.error { color: var(--error); font-size: 14px; }

.container.wide { align-items: flex-start; }
.card.wide { max-width: 900px; }

.row-inline { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 12px 0; }
.row-inline label { min-width: 160px; }

select, input[type="number"] {
  padding: 10px 12px;
  border: 1px solid #aeb4bd;
  border-radius: 8px;
  font-size: 15px;
  background: var(--input-bg, #e8eaed);
  color: var(--input-text, #1e2732);
}

.table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { border-bottom: 1px solid #aeb4bd; padding: 10px 12px; text-align: center; vertical-align: middle; }
.table th { white-space: nowrap; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-soft, #d0d4d9); }
.table tbody tr:nth-child(even) { background: rgba(15, 23, 42, 0.09); }
.table tbody tr:hover { background: rgba(15, 23, 42, 0.16); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---- Aircraft rent/lease spec cells: uniform, centered, tidy ---- */
.table td.spec-cell { text-align: center; vertical-align: middle; }
.spec-cell .spec-title { font-weight: 700; font-size: 14px; }
.spec-cell .spec-line { font-size: 13px; margin-top: 3px; }
.spec-cell .spec-sub { font-size: 12px; color: var(--muted, #64748b); margin-top: 3px; }
.table th[data-msort], .table th[data-rsort], .table th[data-hsort], .table th[data-logsort], .table th[data-txsort] { cursor: pointer; white-space: nowrap; user-select: none; }
/* ---- Airport leases owner tabs: chooser, active tab highlighted ---- */
.lease-tabs { gap: 10px; }
.lease-tabs button { min-width: 200px; font-weight: 700; }
.lease-tabs button.active { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; }

/* ---- Company edit form: uniform grid, fields + Save aligned ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; margin: 12px 0; }
.form-grid label { display: grid; gap: 4px; font-size: 13px; min-width: 0; margin: 0; }
.form-grid input, .form-grid select { width: 100% !important; min-width: 0; max-width: none; box-sizing: border-box; }
.form-grid button[type="submit"] { justify-self: start; white-space: nowrap; }

/* Logs filters: label text stacked above the input, aligned with button row. */
.logs-filters { align-items: end; }
.logs-filters label { display: grid; gap: 4px; font-size: 13px; min-width: 0; margin: 0; }
.logs-filters label > span { line-height: 1.2; text-align: center; }
.logs-filters input { width: 100%; padding: 10px 12px; font-size: 15px; }
.logs-filters #logs-q { min-width: 220px; }
.logs-filters button, .logs-filters .muted { align-self: end; }

button.link { background: none; color: var(--primary); padding: 0 0 0 8px; font-size: 14px; }

/* ---- App shell ---- */
body { background: var(--page-bg, #c9cdd3); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* Header row 1: brand + user pills. Row 2: grouped nav full-width. */
.topbar-main {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  width: 100%;
}

.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand small { display: inline; color: #94a3b8; font-size: 11px; }
/* V logo + "Economy" read as one wordmark (VEconomy): tight joint, slight overlap. */
.brand-logo + strong { margin-left: -6px; }
.logo { width: 38px; height: 38px; }
.brand-logo { width: 40px; height: 40px; border-radius: 0; object-fit: contain; background: transparent; flex: none; }
.login-brand img.brand-logo { width: 44px; height: 44px; }

.mainnav { display: flex; gap: 4px; flex: none; width: 100%; flex-wrap: wrap; align-items: center; padding: 0 20px 10px; overflow: visible; }
.mainnav button {
  background: transparent;
  color: #cbd5e1;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  white-space: nowrap;
}
.mainnav button:hover { background: rgba(255, 255, 255, 0.1); }
.mainnav button.active { background: var(--primary); color: #fff; }

/* ---- Hamburger toggle (hidden on desktop, shown on small screens) ---- */
.nav-toggle {
  display: none;
  flex: none;
  width: 42px;
  height: 38px;
  padding: 8px 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.15); }
.nav-toggle:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.topbar.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.topbar.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Nav dropdowns (My Flights ▸ Track, Aircraft ▸ Market/Materials) ---- */
.nav-drop { position: relative; display: inline-flex; align-items: center; gap: 0; border-radius: 8px; }
.nav-drop.group-active { background: rgba(37, 99, 235, 0.22); box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.35); }
.nav-drop.group-active .nav-main { background: transparent; }
.nav-drop.group-active .nav-main.active { background: var(--primary); color: #fff; }
.nav-main { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.nav-caret {
  padding: 8px 8px 8px 4px !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  font-size: 12px !important;
  line-height: 1;
  opacity: 0.85;
}
.nav-caret:hover { opacity: 1; }
.nav-drop.open .nav-caret { background: rgba(255, 255, 255, 0.12); }
.nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 40;
}
.nav-menu[hidden] { display: none; }
.nav-menu button { text-align: left; width: 100%; }
.nav-menu button.active { background: var(--primary); color: #fff; }

.userbox { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 14px; margin-left: auto; min-width: 0; }
.userbox .link { color: #93c5fd; }

/* ---- Top-right account actions: always on header row 1 (never wraps below) ---- */
.top-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: 0; white-space: nowrap; flex: none; order: 5; }
.top-actions #user-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
/* Phase 81: Discord avatar in the header (PC: avatar + name, mobile: avatar only). */
.top-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid rgba(255,255,255,.25); background: var(--input-bg); }
.top-avatar[hidden] { display: none; }
.top-avatar-fallback { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff; background: var(--primary, #2563eb); border: 1px solid rgba(255,255,255,.25); }
.top-avatar-fallback[hidden] { display: none; }

/* ---- Logout button: red pill with icon, contrasts with dark topbar ---- */
.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
  transition: transform 0.15s ease, filter 0.2s, box-shadow 0.2s;
}
.logout-btn svg { width: 17px; height: 17px; flex: none; }
.logout-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45); }
.logout-btn:active { transform: translateY(0); filter: brightness(0.97); }
.logout-btn:focus-visible { outline: 2px solid #fecaca; outline-offset: 2px; }
.logout-btn:disabled { opacity: 0.7; cursor: wait; transform: none; }
@media (max-width: 480px) {
  .logout-btn span { display: none; }
  .logout-btn { padding: 7px 10px; }
}

/* ---- Spectacular header skin (theme-aware: driven by --bg / --primary) ----
   Topbar is always dark (navy), so light-on-dark glass + the theme's own
   --primary accent adapt automatically on light and dark. */
.topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 55%),
    var(--bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
/* Animated accent sweep under the header. */
.topbar::after {
  content: '';
  display: block;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--primary) 30%, var(--primary) 70%, transparent);
  background-size: 200% 100%;
  box-shadow: 0 0 12px var(--primary);
  animation: header-sheen 7s ease-in-out infinite;
}
@keyframes header-sheen {
  0%, 100% { background-position: 0% 0; opacity: 0.55; }
  50% { background-position: 100% 0; opacity: 0.95; }
}

/* Brand: gradient wordmark, glowing logo, live ops dot. */
.brand strong {
  font-size: 16px;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #ffffff 20%, #c7d7fe 60%, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo { filter: drop-shadow(0 0 10px var(--primary)); }
.brand small { display: block; }
@keyframes ops-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

/* Nav: glass buttons, glowing gradient active pill. */
.mainnav button {
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s, transform 0.15s ease;
}
.mainnav button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.mainnav > button.active,
.nav-menu button.active,
.nav-drop.group-active .nav-main.active {
  background: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 20px -6px var(--primary);
}
.nav-drop.group-active {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--primary), 0 0 16px -6px var(--primary);
}
.nav-drop.group-active .nav-main.active { background: var(--primary); }
/* Glass dropdown menus tinted with the theme's own topbar color. */
.nav-menu {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 35%),
    var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

/* Pills: inset glass gloss; colored glows preserved. */
.wallet { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.wallet-cash:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 3px rgba(74, 222, 128, 0.12), 0 0 18px -4px #4ade80; }
.wallet-bank:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 3px rgba(125, 211, 252, 0.12), 0 0 18px -4px #7dd3fc; }
.rank-pill { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px -8px #fbbf24; }
.duty-pill { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
#user-label { color: #e2e8f0; font-weight: 600; }
.logout-btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px rgba(220, 38, 38, 0.35);
}
.logout-btn:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 14px rgba(220, 38, 38, 0.45), 0 0 20px -4px #ef4444;
}

@media (prefers-reduced-motion: reduce) {
  .topbar::after { animation: none; }
  .mainnav button, .wallet, .rank-pill, .logout-btn { transition: none; }
}

/* ---- Wallet pills (cash + bank in header) ---- */
.wallet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  color: #f1f5f9;
  font-size: 13.5px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.wallet:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.wallet:active { transform: translateY(0); }
.wallet:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.wallet svg { width: 17px; height: 17px; flex: none; }
.wallet-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
}
.wallet strong { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.wallet-cash svg { color: #4ade80; }
.wallet-cash strong { color: #bbf7d0; }
.wallet-cash:hover { border-color: rgba(74, 222, 128, 0.55); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12); }
.wallet-bank svg { color: #7dd3fc; }
.wallet-bank strong { color: #bae6fd; }
.wallet-bank:hover { border-color: rgba(125, 211, 252, 0.55); box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.12); }

/* ---- Rank pill (phase 25 pilot career: compact level button + dropdown) ---- */
.rank-drop { position: relative; }
.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.35);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
  color: #fef3c7;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, transform 0.15s ease;
}
.rank-pill:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.rank-pill:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.rank-pill[hidden] { display: none; }
.rank-pill strong { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 250px;
  padding: 14px 15px;
  border-radius: 12px;
  background: var(--card, #dee1e6);
  border: 1px solid var(--border, #aeb4bd);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.35);
  color: var(--text, #1e2732);
  white-space: normal;
}
.rank-menu[hidden] { display: none; }
.rank-menu-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
.rank-menu-head span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #64748b);
  text-align: right;
}
.rank-menu-title { font-size: 12.5px; color: var(--muted, #64748b); margin-top: 2px; }
.rank-menu-xp { font-size: 12.5px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.rank-bar {
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.3);
  overflow: hidden;
  flex: none;
}
.rank-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.4s ease;
}
.rank-bar-wide { width: 100%; margin-top: 6px; }
.rank-menu-insignia { font-size: 11.5px; color: var(--muted, #64748b); margin-top: 8px; }
/* Epaulette: dark shoulder board, gold/silver bars per tier + marker star. */
.rank-stripes {
  width: 30px;
  height: 16px;
  border-radius: 3px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
  flex: none;
  overflow: hidden;
}
.rank-stripes::before {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 2px;
  bottom: 2px;
  background: var(--bars);
}
.rank-stripes::after {
  content: var(--mark, '');
  position: absolute;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  line-height: 1;
  color: var(--markc, #e5e7eb);
}
/* T1: 1 thin silver · T2: 1 gold · T3: 1 + silver star · T4: 2 gold */
.tier-1 { --bars: linear-gradient(to bottom, transparent 0 5px, #e5e7eb 5px 7px, transparent 7px 12px); }
.tier-2 { --bars: linear-gradient(to bottom, transparent 0 4px, #fbbf24 4px 8px, transparent 8px 12px); }
.tier-3 { --bars: linear-gradient(to bottom, transparent 0 4px, #fbbf24 4px 8px, transparent 8px 12px); --mark: '★'; --markc: #e5e7eb; }
.tier-4 { --bars: linear-gradient(to bottom, transparent 0 1px, #fbbf24 1px 3px, transparent 3px 5px, #fbbf24 5px 7px, transparent 7px 12px); }
/* T5: 3 gold · T6: 3 + gold star · T7: 4 gold · T8: 4 broad */
.tier-5 { --bars: linear-gradient(to bottom, #fbbf24 0 2px, transparent 2px 4px, #fbbf24 4px 6px, transparent 6px 8px, #fbbf24 8px 10px, transparent 10px 12px); }
.tier-6 { --bars: linear-gradient(to bottom, #fbbf24 0 2px, transparent 2px 4px, #fbbf24 4px 6px, transparent 6px 8px, #fbbf24 8px 10px, transparent 10px 12px); --mark: '★'; --markc: #fbbf24; }
.tier-7 { --bars: linear-gradient(to bottom, #fbbf24 0 2px, transparent 2px 3px, #fbbf24 3px 5px, transparent 5px 6px, #fbbf24 6px 8px, transparent 8px 9px, #fbbf24 9px 11px, transparent 11px 12px); }
.tier-8 { --bars: linear-gradient(to bottom, #fbbf24 0 3px, transparent 3px 4px, #fbbf24 4px 7px, transparent 7px 8px, #fbbf24 8px 11px, transparent 11px 12px); }
/* T9: 4 + laurel · T10: double broad + diamond */
.tier-9 { --bars: linear-gradient(to bottom, #fbbf24 0 2px, transparent 2px 3px, #fbbf24 3px 5px, transparent 5px 6px, #fbbf24 6px 8px, transparent 8px 9px, #fbbf24 9px 11px, transparent 11px 12px); --mark: '✦'; --markc: #fde68a; }
.tier-10 { --bars: linear-gradient(to bottom, #fbbf24 0 4px, transparent 4px 5px, #fbbf24 5px 9px, transparent 9px 12px); --mark: '◆'; --markc: #a5f3fc; }

/* ---- Duty pill (phase 17 anti 24/7 farming) ---- */
.duty-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #e0e7ff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.duty-pill:hover { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.12); }
.duty-pill[hidden] { display: none; }
.duty-clock { width: 16px; height: 16px; flex: none; opacity: 0.9; }
.duty-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.75;
}
.duty-bar {
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
  flex: none;
}
.duty-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  transition: width 0.4s ease;
}
.duty-pill.warn { border-color: rgba(251, 191, 36, 0.6); color: #fde68a; }
.duty-pill.warn .duty-bar span { background: linear-gradient(90deg, #fbbf24, #f97316); }
.duty-pill.blocked {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
  background: rgba(220, 38, 38, 0.25);
  animation: duty-pulse 1.6s ease-in-out infinite;
}
.duty-pill.blocked .duty-bar span { background: linear-gradient(90deg, #f87171, #dc2626); }
@keyframes duty-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(248, 113, 113, 0); }
}

/* ---- On-Duty Clock breakdown modal ---- */
.duty-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.duty-table th, .duty-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); text-align: left; }
.duty-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.duty-table td.num, .duty-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.duty-modal-summary { font-size: 14px; margin: 6px 0 2px; }
.duty-modal-sub { font-size: 12px; opacity: 0.75; }

.content { max-width: 1600px; margin: 0 auto; padding: 24px 32px; }

.page { display: none; }
.page.active { display: block; }
.page h1 { color: var(--text); margin-bottom: 16px; }

.page .card {
  max-width: none;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
.page .card h2 { font-size: 18px; }

.hero { text-align: center; padding: 48px 28px; }
.hero h1 { font-size: 28px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.grid .card { margin-bottom: 0; }
.grid .card h3 { margin: 0 0 8px; }

.card.stat { text-align: center; padding: 18px; min-width: 0; max-width: none; overflow-wrap: anywhere; }
.card.stat small { color: var(--muted); text-transform: uppercase; font-size: 12px; display: block; line-height: 1.35; }
.card.stat strong { display: block; font-size: clamp(18px, 1.4vw + 14px, 24px); margin-top: 6px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; line-height: 1.2; }
.card.stat-inline { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.card.stat-inline strong { display: inline; margin-top: 0; }
.card.stat-inline .stat-icon { width: 20px; height: 20px; flex: none; align-self: center; }
.card.stat-inline.stat-cash .stat-icon { color: #16a34a; }
.card.stat-inline.stat-bank .stat-icon { color: #0284c7; }

.table-wrap { overflow-x: auto; }
/* ---- Aircraft Market: dropdown A-Z + search filter ---- */
#catalog-select { max-width: 100%; }
.market-detail { margin-top: 12px; padding: 14px; border: 1px solid var(--border, #aeb4bd); border-radius: 12px; background: var(--panel-soft, #d0d4d9); }
.market-detail[hidden] { display: none; }
.market-detail h3 { margin: 0 0 8px; }
.market-buy-row { display: grid; gap: 8px; margin-top: 12px; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  text-transform: capitalize;
}
/* Flags: real PNG pack (public domain, vendored in img/flags/). Hover
   (title attr) shows the full country name. */
.flag-emoji {
  display: inline-block;
  font-size: 1.25em;
  line-height: 1;
  vertical-align: -0.15em;
  margin-right: 2px;
  cursor: help;
}
.flag-img {
  display: inline-block;
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: -0.2em;
  margin-right: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
  cursor: help;
  background: #e5e7eb;
}
/* Airport cells (flag + ICAO): always stacked flag-over-code, identical on
   every row whether the column is wide or narrow — no random wrapping. */
.apt-cell { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.35; }
.apt-cell .flag-img, .apt-cell .flag-emoji { margin: 0; }
.apt-cell .apt-icao { font-weight: 600; }
.apt-link { background: none; border: none; padding: 0; margin: 0; font: inherit; font-weight: 600; color: #2563eb; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.apt-link:hover { color: #1d4ed8; }
.badge.completed { background: #dcfce7; color: #166534; }
.badge.src-pill { text-transform: none; font-weight: 700; letter-spacing: .02em; }
.badge.src-msfs24 { background: #0ea5e9; color: #f0f9ff; }
.badge.src-msfs20 { background: #0369a1; color: #e0f2fe; }
.badge.src-xp { background: #7c3aed; color: #ede9fe; }
.badge.src-other { background: #475569; color: #f1f5f9; }
.badge.fuel-jet { background: #0ea5e9; color: #f0f9ff; text-transform: none; font-weight: 700; }
.badge.fuel-avgas { background: #16a34a; color: #f0fdf4; text-transform: none; font-weight: 700; }
.badge.active { background: #fef9c3; color: #854d0e; }
.badge.rejected { background: #fee2e2; color: #991b1b; }
.badge.sup-red { background: #ff0000; color: #fff; font-weight: 800; }
html[data-theme="dark"] .badge.sup-red { background: #ff0000; color: #fff; }
#sup-nav-count.sup-red, #sup-nav-count-main.sup-red { background: #ff0000; color: #fff; font-weight: 800; }
/* Support menu alert: red badge + glow on the top-level Support button while any ticket awaits the pilot (status answered). */
.nav-drop[data-group="support"].has-sup-alert .nav-main {
  box-shadow: inset 0 0 0 1px rgba(255, 0, 0, 0.65), 0 0 10px rgba(255, 0, 0, 0.45);
}
.badge.sup-red.js-sup-count:not([hidden]) { animation: sup-pulse 1.6s ease-in-out infinite; }
@keyframes sup-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .badge.sup-red.js-sup-count:not([hidden]) { animation: none; }
}
.badge.vip { background: #fae8ff; color: #86198f; }
.apt-block-wide { grid-column: 1 / -1; }
.metar-loading { opacity: .7; }
.metar-badge { display: inline-block; padding: 3px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.metar-vfr { background: #dcfce7; color: #166534; }
.metar-mvfr { background: #dbeafe; color: #1e40af; }
.metar-ifr { background: #fee2e2; color: #991b1b; }
.metar-lifr { background: #f3e8ff; color: #6b21a8; }
.metar-none { background: #e5e7eb; color: #374151; }
.metar-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; border-top: 4px solid #9ca3af; background: transparent; }
.metar-card-vfr { border-top-color: #22c55e; }
.metar-card-mvfr { border-top-color: #3b82f6; }
.metar-card-ifr { border-top-color: #ef4444; }
.metar-card-lifr { border-top-color: #a855f7; }
.metar-card-none { border-top-color: #9ca3af; }
.metar-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.metar-obs { font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.metar-obs .ve-icon { width: 14px; height: 14px; }
.metar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.metar-tile { background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.metar-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .7; display: flex; align-items: center; justify-content: center; gap: 4px; }
.metar-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .7; display: flex; align-items: center; gap: 4px; }
.metar-tile-label .ve-icon { width: 13px; height: 13px; }
.metar-tile-value { font-size: 15px; font-weight: 700; margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.metar-tile-value .ve-icon { width: 22px; height: 22px; }
.metar-head .ve-icon { width: 26px; height: 26px; }
.metar-gust { color: #b45309; font-weight: 800; }
.metar-tile-value { flex-wrap: wrap; row-gap: 0; }
.metar-cond { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.25; }
.metar-cond-main { font-weight: 800; }
.metar-cond-sub { font-size: 12px; font-weight: 600; opacity: .85; }
.metar-gust-line { flex-basis: 100%; font-size: 12.5px; color: #b45309; font-weight: 800; text-align: center; }
.metar-var-line { flex-basis: 100%; font-size: 12px; color: #b45309; font-weight: 700; text-align: center; }
.metar-rawbox { background: rgba(127,127,127,.08); border: 1px dashed var(--border); border-radius: 8px; padding: 7px 10px; margin: 6px 0; }
.metar-rawbox-label { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; opacity: .6; margin-bottom: 2px; }
.metar-raw { font-family: ui-monospace, monospace; font-size: 12.5px; word-break: break-word; }
.metar-taf { margin: 6px 0; font-size: 12.5px; }
.metar-taf summary { cursor: pointer; font-weight: 700; }
.metar-foot { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 6px; font-size: 11.5px; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.badge.express { background: #b45309; color: #fffbeb; }
.badge.bonus { background: #15803d; color: #f0fdf4; }
.badge.tx-pay { background: #dcfce7; color: #166534; border: 1px solid #86efac; text-transform: none; font-weight: 700; }
.badge.tx-fuel { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; text-transform: none; font-weight: 700; }
.badge.tx-food { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; text-transform: none; font-weight: 700; }
.badge.tx-travel { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; text-transform: none; font-weight: 700; }
.badge.tx-fleet { background: #ccfbf1; color: #115e59; border: 1px solid #5eead4; text-transform: none; font-weight: 700; }
.badge.tx-base { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; text-transform: none; font-weight: 700; }
.badge.tx-bank { background: #cffafe; color: #0e7490; border: 1px solid #67e8f9; text-transform: none; font-weight: 700; }
.badge.tx-admin { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; text-transform: none; font-weight: 700; }
.badge.tx-admin-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; text-transform: none; font-weight: 700; }
.badge.tx-other { background: #f1f5f9; color: #475569; border: 1px dashed #94a3b8; text-transform: none; font-weight: 700; }
html[data-theme="dark"] .badge.tx-pay { background: rgba(34,197,94,.18); color: #86efac; border-color: rgba(34,197,94,.5); }
html[data-theme="dark"] .badge.tx-fuel { background: rgba(14,165,233,.2); color: #7dd3fc; border-color: rgba(125,211,252,.5); }
html[data-theme="dark"] .badge.tx-food { background: rgba(245,158,11,.18); color: #fcd34d; border-color: rgba(252,211,77,.5); }
html[data-theme="dark"] .badge.tx-travel { background: rgba(139,92,246,.2); color: #c4b5fd; border-color: rgba(196,181,253,.5); }
html[data-theme="dark"] .badge.tx-fleet { background: rgba(45,212,191,.16); color: #5eead4; border-color: rgba(94,234,212,.5); }
html[data-theme="dark"] .badge.tx-base { background: rgba(249,115,22,.18); color: #fdba74; border-color: rgba(253,186,116,.5); }
html[data-theme="dark"] .badge.tx-bank { background: rgba(34,211,238,.16); color: #67e8f9; border-color: rgba(103,232,249,.5); }
html[data-theme="dark"] .badge.tx-admin { background: rgba(148,163,184,.16); color: #cbd5e1; border-color: rgba(203,213,225,.4); }
html[data-theme="dark"] .badge.tx-admin-danger { background: rgba(248,113,113,.18); color: #fca5a5; border-color: rgba(252,165,165,.5); }
html[data-theme="dark"] .badge.tx-other { background: rgba(148,163,184,.12); color: #cbd5e1; border-color: rgba(148,163,184,.5); }
.badge.left { background: #1e293b; color: #f8fafc; border: 1px solid #64748b; padding: 2px 10px; font-size: 11px; font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.badge.cycle { background: #1e3a8a; color: #eef2ff; border: 1px solid #93c5fd; padding: 2px 10px; font-size: inherit; font-weight: 700; text-transform: none; white-space: nowrap; }
/* Hidden badges must stay hidden: .badge sets display:inline-block which
   overrides the UA [hidden]{display:none}. Empty badges never render. */
.badge[hidden] { display: none !important; }
.badge:empty { display: none !important; }
.table th:last-child, .table td:last-child { white-space: nowrap; }
/* Board + airport results inherit the centered base: columns hug their
   content instead of stretching across the full width. */
.board-table td.board-cat, .board-table td.board-cat-info { text-align: left; }
.board-table td.cargo-label { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* BRG (FSEconomy-style bearing): circular badge + compass label, stacked. */
.brg-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap; }
.brg-arrow { display: inline-flex; width: 30px; height: 30px; }
.brg-arrow .ve-icon { width: 30px; height: 30px; margin: 0; }
.brg-label { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; line-height: 1.1; }
/* Fixed identical layout for pax + cargo boards: same column proportions,
   no horizontal scrollbar, content wraps or ellipsizes inside its column. */
.board-table { table-layout: fixed; width: 100%; }
.board-table thead th { white-space: normal; overflow-wrap: anywhere; }
.board-table td { overflow-wrap: anywhere; }
.board-table td:nth-child(7) { white-space: nowrap; }
.board-table input[type="number"] { max-width: 100%; box-sizing: border-box; }
.claim-paxnum { width: 4.6em; text-align: center; font-variant-numeric: tabular-nums; margin-right: 2px; padding-left: 4px; padding-right: 4px; -moz-appearance: textfield; appearance: textfield; }
.claim-step, .cargo-step { min-width: 26px; padding-left: 6px; padding-right: 6px; font-weight: 700; }
.claim-step + .claim-step, .cargo-step + .cargo-step { margin-left: 2px; }
.cargo-mult { font-weight: 700; background: transparent; color: var(--text, #0f172a); border: 1px solid var(--border, #aeb4bd); }
.cargo-mult:hover { background: var(--panel-soft, #d0d4d9); }
.cargo-mult.on, .cargo-mult[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.cargo-mult:disabled { opacity: 0.55; cursor: not-allowed; }
.claim-cgnum { width: 5.5em; text-align: center; font-variant-numeric: tabular-nums; margin-right: 4px; padding-left: 4px; padding-right: 4px; -moz-appearance: textfield; appearance: textfield; }
/* Cargo kg controls (−/+ ×100 Max): flex wrapper so the buttons wrap as a
   group instead of leaving "Max" orphaned on a second line. */
.cargo-ctl { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cargo-ctl .claim-cgnum { flex: 1 1 62px; min-width: 58px; width: 4.2em; margin-right: 0; }
.cargo-btns { display: inline-flex; flex-wrap: nowrap; gap: 2px; align-items: center; }
.cargo-btns .cargo-mult { margin-left: 2px; }
.cargo-btns .cargo-max { margin-left: 2px; }
.claim-paxnum::-webkit-outer-spin-button, .claim-paxnum::-webkit-inner-spin-button,
.claim-cgnum::-webkit-outer-spin-button, .claim-cgnum::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.board-table button { padding: 5px 8px; font-size: 13px; }
.board-table .badge { white-space: normal; }
.board-table th:last-child, .board-table td:last-child { white-space: normal; }
/* ---- Custom assignments locked (Lv 25+): modern greyed-out card ---- */
.custom-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.custom-head h2 { margin: 0; }
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e2e8f0;
  background: linear-gradient(135deg, #475569, #1e293b);
  border: 1px solid #334155;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
  text-transform: uppercase;
}
.lock-badge[hidden] { display: none; }
.custom-card.locked {
  background: linear-gradient(180deg, var(--card, #dee1e6), rgba(100, 116, 139, 0.25));
  border: 1px dashed #94a3b8;
  filter: saturate(0.4);
}
.custom-card.locked #custom-form.is-locked {
  opacity: 0.45;
  filter: grayscale(1);
  pointer-events: none;
  user-select: none;
}
.custom-card.locked #custom-quote {
  color: #64748b;
  font-weight: 600;
}
.board-cat {
  background: var(--panel-soft, #d0d4d9);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.board-cat-info {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.pos { color: #166534; }
.neg { color: var(--error); }
/* Money amounts: never wrap (fixes split decimals like "30,50 0.00"), align right with tabular figures. */
.table td.amt { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
/* Payment history + group transactions: short ID/date columns left-aligned
   like the rest, dates unwrapped, detail on one line with ellipsis
   (full text in the tooltip). */
#page-bank .table td.txdate, #page-groups .table td.txdate { white-space: nowrap; }
#page-flights .table td.txdate { white-space: nowrap; }
#page-bank .table .txdetail, #page-groups .table .txdetail {
  display: block; max-width: 480px; margin: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-align: left;
}
/* Helper: long-text columns — header aligned left over its left-aligned content. */
.table th.text-left, .table td.text-left { text-align: left; }
/* Flight logs: Flight ID aligned with its header, tabular figures. */
#page-logs .table td.logfid { font-variant-numeric: tabular-nums; }
/* Bank investments: same left alignment as the rest of the tables. */
#page-bank .table td.invid, #page-bank .table td.invamt { font-variant-numeric: tabular-nums; }
#page-bank .table td.invamt, #page-bank .table td.invdate { white-space: nowrap; }

/* Flight earnings report (Logs -> Details). */
.flight-report { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.fr-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent, #2563eb), var(--accent-2, #7c3aed)); color: #fff; }
.fr-route { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.fr-sub { display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: 0.95; }
.fr-ac { font-size: 13px; opacity: 0.95; }
.fr-dur { font-size: 16px; font-weight: 700; }
.fr-note { font-size: 13px; color: var(--muted); background: var(--panel-soft, #d0d4d9);
  border-radius: 8px; padding: 8px 12px; }
.fr-section { display: flex; flex-direction: column; gap: 6px; padding: 2px 4px; }
.fr-sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.fr-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.fr-row.total span:last-child { font-size: 18px; font-weight: 700; }
.fr-row.subtotal { font-weight: 700; border-top: 1px dashed var(--border, #aeb4bd); padding-top: 6px; }
.fr-row.earnings { font-size: 18px; font-weight: 700; }
.fr-row.earnings span:last-child { font-size: 22px; }
.fr-bonus-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px;
  padding: 4px 0 4px 12px; border-left: 3px solid var(--accent, #2563eb); }
hr.fr-sep { border: 0; border-top: 1px solid var(--border, #aeb4bd); margin: 2px 0; }

.detail { display: grid; gap: 8px; margin: 0; }
.detail > div { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--card, #dee1e6);
  border-radius: 12px;
  padding: 24px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-close { position: absolute; top: 12px; right: 12px; padding: 6px 12px; font-size: 14px; }
/* Title must clear the absolute Close button (long "Manage REG — Type" titles ran underneath it). */
.modal-card h2 { padding-right: 96px; overflow-wrap: anywhere; }

/* ---- Global message modal (success/error feedback for every action) ---- */
#msg-modal-title.msg-ok { color: #16a34a; }
#msg-modal-title.msg-err { color: #dc2626; }
#msg-modal-body { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
#msg-modal-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary, #2563eb); }
#msg-modal-kicker.k-err { color: var(--error, #dc2626); }
#msg-modal-kicker.k-ok { color: #16a34a; }

/* ---- Claim result cards (pax + cargo share the same design) ---- */
.claim-hero { background: var(--panel-soft, #d0d4d9); border: 1px solid var(--border, #aeb4bd); border-radius: 12px;
  padding: 12px 14px; margin: 10px 0; text-align: center; }
.claim-route { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.claim-icao { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: var(--primary, #1d4ed8); }
.claim-plane { font-size: 20px; }
.claim-sub { font-size: 13px; color: var(--muted, #64748b); margin-top: 4px; }
.claim-pay { font-size: 26px; font-weight: 800; margin: 10px 0 2px; color: var(--text, #0f172a); }
.claim-rows { display: grid; gap: 6px; margin: 10px 0; }
.claim-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 14px; padding: 6px 2px; border-bottom: 1px dashed var(--border, #aeb4bd); }
.claim-row span:first-child { color: var(--muted, #64748b); }
.claim-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; justify-content: center; }
.claim-note { background: var(--panel-soft, #d0d4d9); border: 1px solid var(--border, #aeb4bd); border-radius: 8px;
  padding: 10px 12px; margin: 10px 0; font-size: 13.5px; line-height: 1.5; }
.claim-note.ok { background: rgba(34,197,94,.12); border-color: #16a34a; }
.claim-note.warn { background: #fef3c7; border: 1px solid #f59e0b; color: #451a03; }
.claim-note.err { background: #fee2e2; border: 1px solid #dc2626; color: #991b1b; }
html[data-theme="dark"] .claim-note.warn { background: rgba(245,158,11,.12); border-color: #f59e0b; color: var(--text); }
html[data-theme="dark"] .claim-note.err { background: rgba(220,38,38,.15); border-color: var(--error,#dc2626); color: var(--text); }
html[data-theme="dark"] .claim-note.ok { background: rgba(34,197,94,.14); border-color: #16a34a; color: var(--text); }
.claim-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.claim-actions .btn-ghost { background: transparent; border: 1px solid var(--border, #aeb4bd); color: var(--text, #0f172a); }

/* ---- Compact claim-confirmed layout (route · pay · total · actions) ---- */
.claim-done { display: grid; gap: 10px; margin-top: 10px; }
.claim-leg { background: rgba(0,0,0,0.35); border: 1px solid var(--border, #aeb4bd); border-radius: 12px;
  padding: 14px 16px; text-align: center; }
.claim-done .claim-route { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.claim-done .claim-icao { font-size: 30px; font-weight: 800; letter-spacing: 1px; color: #fff; }
.claim-done .claim-plane { font-size: 22px; color: #fff; }
.claim-done .claim-meta { font-size: 14px; color: #d8a7b1; margin-top: 4px; }
.claim-done .claim-pay { font-size: 32px; font-weight: 800; margin-top: 6px; color: #fff; }
.claim-return-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.claim-return-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #d8a7b1; }
.claim-reserved { font-size: 12px; font-weight: 800; font-style: italic; color: #ffd9a8;
  background: rgba(245,158,11,.25); border: 1px solid #f59e0b; border-radius: 8px; padding: 3px 12px; }
.claim-unlock { font-size: 13px; font-style: italic; color: #d8a7b1; margin-top: 6px; }
.claim-total { background: linear-gradient(180deg, rgba(34,197,94,.22), rgba(34,197,94,.10));
  border: 1px solid #22c55e; border-radius: 12px; padding: 12px 16px; text-align: center; }
.claim-total-label { font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4ade80; }
.claim-total-pay { font-size: 34px; font-weight: 800; color: #fff; margin: 2px 0; }
.claim-total-note { font-size: 13px; font-style: italic; color: #4ade80; }
#claim-modal-preview .claim-hero { margin-top: 6px; }

/* ---- Instant auto-ferry modal ---- */
.ferry-steps { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 13px; }
.ferry-step { color: var(--muted, #64748b); }
.ferry-step .ferry-step-n { display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border, #aeb4bd);
  font-size: 12px; margin-right: 4px; }
.ferry-step.active { color: var(--text, #0f172a); font-weight: 700; }
.ferry-step.active .ferry-step-n { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; }
.ferry-step.done { color: #16a34a; }
.ferry-step-sep { color: var(--muted, #64748b); }
.ferry-price { font-size: 26px; font-weight: 800; margin: 12px 0 4px; color: var(--text, #0f172a); }
.ferry-route { background: var(--panel-soft, #d0d4d9); border: 1px solid var(--border, #aeb4bd); border-radius: 10px;
  padding: 12px 14px; margin: 10px 0; text-align: center; }
.ferry-ports { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ferry-icao { font-size: 24px; font-weight: 800; letter-spacing: 1px; color: var(--primary, #1d4ed8); }
.ferry-plane { font-size: 20px; }
.ferry-names { font-size: 13px; color: var(--muted, #64748b); margin-top: 4px; }
.ferry-ac { font-size: 13px; margin-top: 4px; color: var(--text, #0f172a); }
.ferry-rows { display: grid; gap: 6px; margin: 10px 0; }
.ferry-row { display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; padding: 6px 2px; border-bottom: 1px dashed var(--border, #aeb4bd); }
.ferry-cash { font-size: 13px; color: var(--muted, #64748b); margin: 8px 0; }
.ferry-note { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px;
  padding: 10px 12px; margin: 10px 0; font-size: 14px; line-height: 1.45; color: #451a03; }
.ferry-err { background: #fee2e2; border: 1px solid #dc2626; color: #991b1b; border-radius: 8px;
  padding: 10px 12px; margin: 10px 0; font-size: 14px; line-height: 1.45; }
html[data-theme="dark"] .ferry-note { background: rgba(245, 158, 11, 0.12); border-color: #f59e0b; color: var(--text); }
html[data-theme="dark"] .ferry-err { background: rgba(220, 38, 38, 0.15); border-color: var(--error, #dc2626); color: var(--text); }
#ferry-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
#ticket-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Flight ticket banner in the airport header (theme-aware) ---- */
.airport-ticket { display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap;
  background: var(--panel-soft, #d0d4d9); border: 1px solid var(--border, #aeb4bd);
  border-left: 4px solid var(--primary, #2563eb);
  border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.airport-ticket[hidden] { display: none; }
.airport-ticket-icon { font-size: 40px; line-height: 1; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }

/* ---- Hangar coverage indicator pills (theme-aware) ---- */
.hg-pill { display: inline-flex; align-items: center; gap: 4px; margin: 2px 4px 0 0;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border, #aeb4bd); white-space: nowrap; }
.hg-ok { background: rgba(34,197,94,.15); color: #15803d; border-color: rgba(34,197,94,.45); }
.hg-out { background: rgba(249,115,22,.15); color: #c2410c; border-color: rgba(249,115,22,.45); }
.hg-total { background: rgba(128,128,128,.15); color: var(--text); border-color: var(--border, #aeb4bd); }
html[data-theme="dark"] .hg-ok { color: #86efac; }
html[data-theme="dark"] .hg-out { color: #fdba74; }
#airport-ticket-loc { flex: 1 1 240px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
#info-ticket-dest { flex: none; text-transform: uppercase; }

/* ---- Flight ticket modal (boarding pass, theme-aware) ---- */
.ticket-card { max-width: 560px; }
.ticket-hero { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 12px; }
.ticket-takeoff { font-size: 48px; line-height: 1; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.ticket-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary, #2563eb); }
.ticket-title { margin: 2px 0 4px; font-size: 22px; color: var(--text); }
.ticket-sub { margin: 0; font-size: 13.5px; }
.ticket-pass { display: grid; grid-template-columns: 1fr 130px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border, #aeb4bd); background: var(--panel-soft, #d0d4d9);
  margin: 10px 0 12px; }
.ticket-main { padding: 14px 16px; }
.ticket-ports { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket-icao { font-size: 30px; font-weight: 800; letter-spacing: 1px; color: var(--primary, #1d4ed8); }
.ticket-emoji { font-size: 22px; }
.ticket-meta { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted, #64748b); margin: 2px 0 10px; }
.ticket-seat { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px;
  border-top: 2px dashed var(--border, #aeb4bd); padding-top: 10px; }
.ticket-seat span { color: var(--muted, #64748b); }
.ticket-seat strong { color: var(--text); text-align: right; }
.ticket-stub { background: var(--primary, #1d4ed8); color: #fff; padding: 14px 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; border-left: 2px dashed rgba(255,255,255,.55); position: relative; }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; left: -9px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--card, #fff); border: 1px solid var(--border, #aeb4bd); }
.ticket-stub::before { top: -8px; }
.ticket-stub::after { bottom: -8px; }
.ticket-stub-label { font-size: 11px; font-weight: 800; letter-spacing: .18em; color: rgba(255,255,255,.75); }
.ticket-stub-code { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.ticket-stub .muted-small { color: rgba(255,255,255,.75); }
@media (max-width: 520px) { .ticket-pass { grid-template-columns: 1fr; } .ticket-stub { border-left: none; border-top: 2px dashed rgba(255,255,255,.55); } }

/* ---- Track map (Leaflet + OSM, no API key) ---- */
#track-map { height: 600px; min-height: 320px; border-radius: 12px; border: 1px solid var(--border, #aeb4bd); z-index: 0; }
#live-map { height: 480px; min-height: 300px; border-radius: 12px; border: 1px solid var(--border, #aeb4bd); z-index: 0; }
#rent-map { height: 480px; min-height: 380px; border-radius: 12px; border: 1px solid var(--border, #aeb4bd); z-index: 0; }
#track-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 13px; }
#track-legend .swatch { display: inline-block; width: 22px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
#live-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 13px; }
#live-legend .swatch { display: inline-block; width: 22px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
/* Multiplayer Live Map: pilot name tags above each plane. The marker is a
   zero-size anchor at the plane position; the label centers itself with
   translate(-50%,-100%) so ANY nick length stays centered above its plane. */
.live-name-wrap { background: transparent; border: none; overflow: visible; }
.live-name-label {
  display: inline-block; white-space: nowrap; pointer-events: none;
  transform: translate(-50%, -38px);
  font-size: 11px; font-weight: 700; line-height: 1.4;
  background: rgba(15, 23, 42, 0.88); color: #fff;
  border: 1.5px solid #2563eb; border-radius: 8px;
  padding: 1px 7px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.4);
}
.live-name-label.self { border-color: #f59e0b; background: rgba(120, 53, 15, 0.94); }
.plane-icon-wrap { background: transparent; border: none; }
.plane-icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: #dee1e6;
  border: 2px solid #2563eb; border-radius: 50%;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.35);
}
.plane-icon svg { display: block; }
/* FBO airport icons on the Track map (color + glyph per type) */
.fbo-icon-wrap { background: transparent; border: none; }
.fbo-dot {
  width: 16px; height: 16px; line-height: 16px; text-align: center;
  font-size: 9px; font-weight: 700; color: #fff;
  border-radius: 50%; border: 1.5px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.4);
  cursor: pointer;
}
.fbo-dot-key { display: inline-block; vertical-align: middle; margin-right: 4px; }
.fbo-key { white-space: nowrap; margin-right: 10px; }

/* ---- UTC floating clock (bottom-left, collapsible) ---- */
.utc-clock {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(74, 222, 128, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  color: #e2e8f0;
  font-size: 13px;
  backdrop-filter: blur(8px);
}
.utc-clock[hidden] { display: none; }
.utc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.9);
  flex: none;
}
.utc-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  color: #86efac; opacity: 0.9;
}
.utc-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px; font-weight: 700; letter-spacing: 0.06em;
  color: #4ade80; font-variant-numeric: tabular-nums;
}
.utc-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; color: #94a3b8; font-variant-numeric: tabular-nums;
}
.utc-toggle {
  padding: 2px 9px; font-size: 14px; line-height: 1.2;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}
.utc-toggle:hover { background: rgba(255, 255, 255, 0.2); }
/* Small screens: shrink the fixed clock so it covers less content
   (it can also be collapsed to the “UTC” pill with the – button). */
@media (max-width: 760px) {
  .utc-clock { left: 8px; bottom: 8px; padding: 5px 8px 5px 10px; gap: 6px; }
  .utc-date { display: none; }
  .utc-time { font-size: 15px; }
  .utc-open { left: 8px; bottom: 8px; }
}
.utc-open {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 60;
  padding: 8px 14px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.utc-open[hidden] { display: none; }

/* ---- My Flights status boxes ---- */
.flight-status {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #aeb4bd);
  background: var(--panel-soft, #d0d4d9);
}
.flight-status.ok {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
  font-weight: 600;
}
.flight-status.ok .muted { color: #15803d; }
.flight-status.alert {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
  font-weight: 600;
}
.flight-status.alert .muted { color: #b91c1c; }

@media (max-width: 1280px) {
  .topbar-main { flex-wrap: wrap; gap: 10px; padding: 10px 14px; row-gap: 10px; }
  .brand { flex: 1 1 auto; min-width: 0; order: 0; }
  /* Sign out stays on the top row next to brand + hamburger. */
  .top-actions { order: 1; flex: 0 0 auto; margin-left: 0; }
  .nav-toggle { display: inline-flex; margin-left: 0; order: 2; }
  /* User pills go to their own row, wrapping nicely instead of squeezing the brand. */
  .userbox {
    order: 3;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 8px;
    row-gap: 8px;
    margin-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    white-space: normal;
  }
  #user-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Collapsible vertical nav panel. */
  .mainnav {
    order: 0;
    flex: none;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 6px 0 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    overflow-y: auto;
  }
  .topbar.menu-open .mainnav { display: flex; }
  .mainnav > button,
  .mainnav .nav-drop { width: 100%; }
  .mainnav > button { text-align: left; padding: 10px 12px; }
  /* Grouped items (Home ▾, My Flights ▾, Aircraft ▾): main button + caret
     side-by-side on the row, submenu spanning below. */
  .nav-drop {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }
  .nav-drop .nav-main { text-align: left; padding: 10px 12px; border-radius: 8px 0 0 8px; min-width: 0; }
  .nav-drop > .nav-caret { padding: 10px 14px !important; border-radius: 0 8px 8px 0; }
  .nav-drop .nav-menu { grid-column: 1 / -1; }
  /* Submenus become inline expandable sections, never floating off-screen. */
  .nav-menu {
    position: static;
    min-width: 0;
    width: 100%;
    margin: 2px 0 4px;
    box-shadow: none;
  }
  .nav-menu button { padding: 10px 12px; }
}

@media (max-width: 720px) {
  .topbar-main { padding: 10px 12px; }
  .content { padding: 12px; }
  .hero { padding: 32px 16px; }
  .detail > div { grid-template-columns: 110px 1fr; }
  .duty-pill { padding: 5px 10px; font-size: 12px; }
  .duty-bar { width: 44px; }
  .rank-pill { padding: 5px 10px 5px 8px; font-size: 12px; }
  .rank-menu {
    position: fixed;
    top: auto;
    right: 8px;
    left: 8px;
    width: auto;
  }
  .wallet { padding: 5px 10px 5px 8px; font-size: 12.5px; }
  .wallet strong { font-size: 12.5px; }
  .wallet-label { display: none; }
  #user-label { display: none; }
  #track-map { height: min(420px, 62vh); height: min(420px, 62dvh); }
  .row-inline label, .row-inline input, .row-inline select { max-width: 100%; }
}

@media (max-height: 700px) and (min-width: 1281px) {
  /* Short desktop monitors (e.g. 1366x768 with browser chrome): tighter header. */
  .topbar-main { padding: 6px 16px; gap: 10px; }
  .mainnav button { padding: 6px 10px; }
  .content { padding-top: 16px; }
}

/* ---- Display preferences: currency symbol is JS-only, theme via vars ---- */
:root {
  color-scheme: light;
  --page-bg: #c9cdd3;
  --border: #aeb4bd;
  --input-bg: #e8eaed;
  --input-text: #1e2732;
  --panel-soft: #d0d4d9;
  --link: #1d4ed8;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --page-bg: #0b1220;
  --border: #334155;
  --input-bg: #0f172a;
  --input-text: #f1f5f9;
  --panel-soft: #0f172a;
  --link: #93c5fd;
}
/* Global links: never browser-default purple, readable on every theme. */
a, a:visited { color: var(--link, var(--primary)); }
a:hover { text-decoration: underline; }
html[data-theme="dark"] body { background: var(--page-bg); color: var(--text); }
html[data-theme="dark"] .page h1 { color: var(--text); }
html[data-theme="dark"] .page .card { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .table th, html[data-theme="dark"] .table td { border-bottom-color: var(--border); }
html[data-theme="dark"] .table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .table tbody tr:hover { background: rgba(255, 255, 255, 0.14); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: var(--input-bg); color: var(--input-text); border-color: var(--border); }
/* Native date/time icons are black by default: paint our own light icon in dark mode. */
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="time"] {
  color-scheme: dark;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 34px;
}
/* Chrome/Edge/Safari: hide the native black glyph but keep it clickable above our icon. */
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0; cursor: pointer;
  position: absolute; right: 0; top: 0;
  width: 38px; height: 100%; margin: 0; padding: 0;
}
/* Light theme: keep the native icon visible and clickable. */
input[type="date"], input[type="datetime-local"], input[type="time"] { position: relative; color-scheme: light; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 1; }
/* Date filter inputs must never be covered: no overlay eats the calendar click. */
.logs-filters input[type="date"] { pointer-events: auto; position: relative; z-index: 1; }
.logs-filters label { pointer-events: auto; }
/* Firefox draws its own icon (light thanks to color-scheme): avoid a doubled icon. */
@supports (-moz-appearance: none) {
  html[data-theme="dark"] input[type="date"],
  html[data-theme="dark"] input[type="datetime-local"],
  html[data-theme="dark"] input[type="time"] { background-image: none; padding-right: 12px; }
}
html[data-theme="dark"] .modal-card { background: var(--card); color: var(--text); }
html[data-theme="dark"] .flight-status { background: var(--panel-soft); border-color: var(--border); }
html[data-theme="dark"] .badge { filter: brightness(0.95); }
html[data-theme="dark"] #track-map { border-color: var(--border); }
html[data-theme="dark"] #live-map { border-color: var(--border); }
html[data-theme="dark"] .plane-icon { background: #0f172a; }
html[data-theme="dark"] .detail dt { color: var(--muted); }
html[data-theme="dark"] .board-cat { background: var(--panel-soft); color: var(--text); }
html[data-theme="dark"] .board-cat-info { background: #0f172a; color: #94a3b8; }

/* ---- Settings page ---- */
.settings-card { text-align: left; }
.settings-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.settings-head h2 { margin: 0; }
.settings-head p { margin: 4px 0 0; }
.settings-icon { width: 34px; height: 34px; flex: none; color: var(--primary); background: rgba(37, 99, 235, 0.1); border-radius: 10px; padding: 6px; }
.settings-form { display: grid; gap: 12px; margin-top: 12px; }
.settings-form[hidden] { display: none; }
.settings-form label { display: grid; gap: 6px; font-size: 14px; }
.settings-form select, .settings-form input { width: 100%; }
.settings-msg { min-height: 1.2em; font-size: 14px; }
.settings-msg.ok { color: #16a34a; }
.settings-msg.err { color: var(--error); }
.settings-hint { font-size: 13px; margin: 0; }
/* Phase 81: live password checklist (green ticks when a rule is met). */
.pw-check { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.pw-check li { display: flex; align-items: center; gap: 8px; color: var(--muted, #64748b); }
.pw-check li::before { content: "○"; flex: none; width: 1.2em; text-align: center; font-weight: 800; }
.pw-check li.ok { color: #16a34a; }
.pw-check li.ok::before { content: "✓"; }
/* Phase 81: security row — 2FA + recent activity side by side, no squeeze. */
.security-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.danger-card { border: 1px solid #dc2626; }
.danger-card h2 { color: #dc2626; }
.delack-row { display: flex !important; flex-direction: row; align-items: flex-start; gap: 8px; cursor: pointer; }
.delack-row input[type="checkbox"] { width: 18px !important; height: 18px; flex: none; margin-top: 2px; accent-color: #dc2626; }
.btn-danger { background: #dc2626; color: #fff; border: 1px solid #dc2626; cursor: pointer; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger:not(:disabled):hover { background: #b91c1c; }
.security-row .table-wrap { overflow-x: auto; }
.session-table { table-layout: fixed; width: 100%; }
.session-table th:nth-child(1), .session-table td:nth-child(1) { width: 11em; }
.session-table th:nth-child(2), .session-table td:nth-child(2) { width: 8em; }
.session-table td { overflow-wrap: anywhere; }
.session-src small { display: block; color: var(--muted, #64748b); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .security-row { grid-template-columns: minmax(0, 1fr); } }
.totp-qr { max-width: 220px; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 8px; }
.totp-secret { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
/* Phase 81: forced password rotation — centered blocking modal. */
.force-pw-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15,23,42,.72); backdrop-filter: blur(4px); animation: fpw-in .25s ease; }
.force-pw-overlay[hidden] { display: none; }
@keyframes fpw-in { from { opacity: 0; } to { opacity: 1; } }
.force-pw-card { width: 100%; max-width: 480px; margin: 0 auto; background: var(--card, #fff); color: var(--text, inherit); border: 1px solid var(--border); border-top: 6px solid #dc2626; border-radius: 18px; padding: 30px 30px 26px; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,.45); max-height: 90vh; overflow-y: auto; animation: fpw-pop .3s ease; }
@keyframes fpw-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.force-pw-badge { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #dc2626, #f59e0b); box-shadow: 0 8px 20px rgba(220,38,38,.4); }
.force-pw-badge svg { width: 30px; height: 30px; }
.force-pw-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #dc2626; }
.force-pw-card h2 { margin: 6px 0 8px; font-size: 24px; padding: 0; }
.force-pw-sub { font-size: 14px; margin: 0 0 18px; }
.force-pw-card .settings-form { text-align: left; margin-top: 0; }
.force-pw-card .pw-check { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.force-pw-submit { width: 100%; padding: 13px; font-size: 16px; font-weight: 800; border-radius: 12px; background: #dc2626; color: #fff; border: 0; cursor: pointer; }
.force-pw-submit:hover { background: #b91c1c; }
@media (max-width: 520px) { .force-pw-card { padding: 24px 20px; } .force-pw-card .pw-check { grid-template-columns: 1fr; } }
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-soft); }
.theme-row strong { display: block; }
.theme-row p { margin: 4px 0 0; font-size: 13px; }
.theme-toggle { position: relative; width: 56px; height: 30px; padding: 0; border-radius: 999px; background: #a8afb9; border: 0; cursor: pointer; flex: none; transition: background 0.2s; }
.theme-toggle .theme-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #e8eaed; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.theme-toggle[aria-checked="true"] { background: var(--primary); }
.theme-toggle[aria-checked="true"] .theme-knob { transform: translateX(26px); }
.theme-toggle:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.theme-row select { width: auto; min-width: 170px; flex: none; }

/* ---- Local raster icons (public/img/icons/, WebP default + GIF legacy) ----
   Same pixels in every browser: no dependency on the visitor's emoji font.
   Tiles carry their own colors, so themes must NOT recolor them. */
.ve-icon { width: 1.15em; height: 1.15em; vertical-align: -0.22em; border-radius: 22%; }
/* Inside solid badges the icon sits on a colored chip: keep it readable. */
.badge .ve-icon { width: 1em; height: 1em; vertical-align: -0.15em; }

/* ---- Refuel pump (My Flights, no dropdown) ---- */
.fuel-card { overflow: hidden; }
.fuel-pump { display: block; margin-top: 12px; }
.fuel-pump[hidden] { display: none; }
.fuel-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fuel-switch[hidden] { display: none; }
.fuel-switch button { padding: 6px 14px; font-size: 13px; border-radius: 999px; background: var(--panel-soft); color: var(--text); border: 1px solid var(--border); }
.fuel-switch button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.fuel-main { display: flex; gap: 20px; align-items: stretch; flex-wrap: wrap; }
/* Station: pump + hose + plane over a drawn airport */
.fuel-station {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  flex: 1 1 320px;
  padding: 16px 14px 72px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #bae6fd;
}
.airport-bg, .airport-bg div { pointer-events: none; }
.airport-bg { position: absolute; inset: 0; z-index: 0; }
.bg-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 55%, #e0f2fe 75%, #bbf7d0 75.5%, #86efac 100%); }
.bg-tower { position: absolute; left: 8px; bottom: 56px; width: 14px; height: 62px; background: linear-gradient(90deg, #94a3b8, #cbd5e1 50%, #64748b); border: 2px solid #475569; border-bottom: 0; }
.bg-tower i { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); display: block; width: 34px; height: 20px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #38bdf8, #0369a1); border: 2px solid #0c4a6e; }
.bg-tower i::after { content: ""; position: absolute; left: 2px; right: 2px; top: 9px; height: 2px; background: rgba(255,255,255,0.7); }
.bg-hangar { position: absolute; left: 34%; bottom: 56px; width: 120px; height: 44px; border-radius: 60px 60px 0 0; background: linear-gradient(180deg, #cbd5e1, #94a3b8); border: 2px solid #475569; border-bottom: 0; }
.bg-hangar::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 28px; border-radius: 40px 40px 0 0; background: #1e293b; }
.bg-grass { position: absolute; left: 0; right: 0; bottom: 34px; height: 24px; background: linear-gradient(180deg, #4ade80, #16a34a); }
.bg-runway { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: #334155; }
.bg-runway::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; transform: translateY(-50%); background: repeating-linear-gradient(90deg, #d0d4d9 0 26px, transparent 26px 52px); }
.gas-pump, .fuel-hose, .fuel-jerry, .fuel-cans { position: relative; z-index: 1; }
/* Classic gas pump cabinet (bigger, centered with the jerrycan) */
.gas-pump {
  position: relative;
  width: 208px;
  flex: none;
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(180deg, #ef4444, #b91c1c 70%, #7f1d1d);
  border: 3px solid #450a0a;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  padding: 12px 12px 20px;
  margin-bottom: 8px;
}
.gas-sign {
  text-align: center;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: #fef08a;
  background: #0f172a;
  border-radius: 8px;
  padding: 7px 4px;
  border: 2px solid #fbbf24;
}
.gas-screen {
  margin-top: 10px;
  background: #d8dbe0;
  border: 2px inset #a8a29e;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden;
}
.gas-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.gas-row small { font-size: 11px; color: #78716c; letter-spacing: 0.1em; flex: none; }
.gas-row strong { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: right; font-size: 16px; color: #0f172a; font-variant-numeric: tabular-nums; }
.gas-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.gas-keypad i { display: block; height: 8px; border-radius: 3px; background: rgba(255,255,255,0.75); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.4); }
.gas-nozzle {
  position: absolute;
  right: -14px;
  top: 64px;
  width: 20px;
  height: 44px;
  border-radius: 6px;
  background: linear-gradient(180deg, #1f2937, #030712);
  border: 2px solid #000;
}
.gas-nozzle::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -16px;
  width: 8px;
  height: 18px;
  border-radius: 0 0 6px 6px;
  background: #1f2937;
}
.gas-base { position: absolute; left: -6px; right: -6px; bottom: -3px; height: 12px; border-radius: 4px; background: #0f172a; }
/* Hose: tall drape from pump nozzle up to the jerrycan cap.
   End hardware overlaps inside both bodies (overflow visible) so the
   hose is never left floating in the air. */
.fuel-hose { width: 150px; height: 250px; max-width: 100%; flex: none; margin: 0 -16px 8px -2px; overflow: visible; align-self: flex-end; }
/* Both jerrycans travel as one unit: side by side on wide screens, wrapped and
   centered on narrow ones. Bottom padding reserves room for the absolute
   aircraft label so it never overlaps the content below. */
.fuel-cans { display: flex; align-items: flex-end; justify-content: flex-start; gap: 14px; row-gap: 56px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; margin-bottom: 8px; }
#fuel-hose-flow { stroke-dasharray: 10 10; }
.fuel-pump-pumping #fuel-hose-flow { stroke: #22c55e; stroke-width: 5; }
/* Fuel jerrycan with sight glass: hose plugs into the cap.
   The aircraft label hangs absolutely below so the can body sits
   on the ground, level with the pump base. */
.fuel-jerry { display: flex; flex-direction: column; align-items: center; flex: none; margin-bottom: 8px; position: relative; }
.fuel-jerry #fuel-ac-label { position: absolute; top: 100%; margin-top: 6px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(300px, 60vw); white-space: normal; text-align: center; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; margin-left: 0; margin-right: 0; z-index: 2; }
.jerry-handle { display: flex; gap: 8px; margin-bottom: -4px; z-index: 2; }
.jerry-handle i { display: block; width: 16px; height: 26px; border-radius: 5px; background: linear-gradient(180deg, #7f1d1d, #450a0a); border: 2px solid #450a0a; }
.jerry-top { width: 118px; height: 16px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #ef4444, #b91c1c); border: 3px solid #450a0a; border-bottom: 0; position: relative; }
.jerry-cap {
  position: absolute;
  left: 12px;
  top: -14px;
  width: 30px;
  height: 18px;
  border-radius: 5px;
  background: repeating-linear-gradient(90deg, #44403c 0 4px, #78716c 4px 8px);
  border: 2px solid #1c1917;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.jerry-body {
  position: relative;
  width: 142px;
  height: 178px;
  border-radius: 10px 10px 14px 14px;
  border: 3px solid #450a0a;
  background: linear-gradient(90deg, #991b1b, #dc2626 30%, #ef4444 50%, #b91c1c 75%, #7f1d1d);
  overflow: hidden;
  box-shadow: inset 0 -10px 18px rgba(0,0,0,0.35), 0 8px 16px rgba(0,0,0,0.35);
}
.jerry-x, .jerry-x::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: 50%;
  height: 22px;
  background: rgba(69,10,10,0.45);
  border-top: 2px solid rgba(69,10,10,0.7);
  border-bottom: 2px solid rgba(69,10,10,0.7);
}
.jerry-x { transform: rotate(38deg); }
.jerry-x::after { left: 0; right: 0; top: -2px; transform: rotate(-76deg); transform-origin: center; }
.jerry-window {
  position: absolute;
  right: 12px;
  top: 12px;
  bottom: 12px;
  width: 30px;
  border-radius: 8px;
  border: 3px solid #450a0a;
  background: rgba(222,225,230,0.55);
  overflow: hidden;
  z-index: 2;
}
.jerry-label {
  position: absolute;
  left: 8px;
  bottom: 10px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,0.7);
  pointer-events: none;
  z-index: 2;
  line-height: 1.5;
}
#fuel-tank-pct { font-size: 17px; }
#fuel-tank-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(34,197,94,0.95), rgba(21,128,61,0.95));
  transition: height 0.25s ease;
}
#fuel-tank-add {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: repeating-linear-gradient(-45deg, rgba(254,240,138,0.95) 0 8px, rgba(202,138,4,0.95) 8px 16px);
  border-top: 3px dashed #713f12;
  transition: bottom 0.25s ease, height 0.25s ease;
}
#fuel-tank-pct {
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,0.8);
  font-variant-numeric: tabular-nums;
}
/* Aircraft label under the jerrycan (e.g. "S340-1 Saab 340B @ ?"):
   fixed dark-on-light pill so it stays readable in EVERY theme.
   Do NOT use var(--text)/inherit here: the pill background is always
   light, while dark sets a light page text color,
   which made the label invisible. Keeping explicit colors here makes
   future themes safe by default (inheritance never beats this rule). */
.fuel-station {
  --fuel-label-fg: #0f172a;
  --fuel-label-bg: rgba(255, 255, 255, 0.96);
  --fuel-label-border: #0f172a;
}
.fuel-ac { font-weight: 700; font-size: 13px; text-align: center; width: max-content; max-width: min(300px, 60vw); white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.3; margin-top: 0; margin-bottom: 0; color: var(--fuel-label-fg, #0f172a); background: var(--fuel-label-bg, rgba(255, 255, 255, 0.96)); border: 2px solid var(--fuel-label-border, #0f172a); border-radius: 8px; padding: 2px 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); text-shadow: none; }
.fuel-controls { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 10px; }
.fuel-stats { font-size: 14px; font-variant-numeric: tabular-nums; }
.fuel-bar {
  position: relative;
  height: 16px;
  border-radius: 8px;
  background: #0f172a;
  border: 2px solid #475569;
  overflow: hidden;
  display: flex;
}
.fuel-bar::before, .fuel-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: repeating-linear-gradient(180deg, #94a3b8 0 3px, #475569 3px 6px);
  z-index: 2;
}
.fuel-bar::before { left: 0; border-right: 2px solid #334155; }
.fuel-bar::after { right: 0; border-left: 2px solid #334155; }
#fuel-bar-fill { display: block; flex: none; height: 100%; width: 0%; max-width: 100%; background: linear-gradient(90deg, #f59e0b, #ea580c); transition: width 0.25s ease; }
#fuel-bar-add { display: block; flex: none; height: 100%; width: 0%; max-width: 100%; background: repeating-linear-gradient(-45deg, #22c55e 0 6px, #bbf7d0 6px 12px); transition: width 0.25s ease; }
.fuel-bar span:first-child { order: 0; }
.fuel-bar span:last-child { order: 1; }
.fuel-slider-row { display: grid; gap: 10px; }
#fuel-gallons-range { width: 100%; accent-color: var(--primary); padding: 0; border: 0; }
.fuel-qty-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: nowrap; }
.fuel-gal-label { display: grid; gap: 6px; font-size: 14px; }
.fuel-gal-label input { width: 110px; height: 42px; box-sizing: border-box; }
#fuel-fill-btn { height: 42px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; font-size: 14px; background: #0f172a; flex: none; }
.fuel-presets { display: flex; gap: 8px; margin-left: auto; margin-right: auto; align-items: flex-end; justify-content: center; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; }
.fuel-presets button { height: 42px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; font-size: 14px; font-weight: 700; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-soft); color: var(--text); cursor: pointer; min-width: 58px; flex: none; }
.fuel-presets button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.fuel-presets button:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 720px) {
  .fuel-qty-row { flex-wrap: wrap; }
  .fuel-presets { margin-left: 0; margin-right: 0; width: 100%; flex-wrap: wrap; }
}
.fuel-pay-row { margin: 0; }
#fuel-buy-btn { font-weight: 800; }
#fuel-buy-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.fuel-cost-line strong { color: var(--text); font-size: 16px; }
.fuel-status { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-soft); font-size: 14px; }
.fuel-status[hidden] { display: none; }
.fuel-status.pumping { border-color: var(--primary); background: #dbeafe; color: #1e3a8a; font-weight: 600; }
.depot-notice { padding: 10px 12px; border-radius: 10px; border: 1px solid #86efac; background: #dcfce7; color: #166534; font-size: 14px; }
.depot-notice[hidden] { display: none; }
.depot-notice button { margin-left: 8px; font-weight: 800; }
.depot-picker-row { margin-top: 10px; }
.depot-picker-row select { min-width: 250px; }
/* ---- Depot total gauges (car-style fuel dials, 270° sweep E -> F) ---- */
.depot-gauges { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 4px; }
.depot-gauge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 18px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-soft); }
.depot-gauge-dial { position: relative; width: 150px; }
.depot-gauge-dial svg { display: block; width: 100%; height: auto; }
.depot-gauge-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 46px; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; pointer-events: none; }
.depot-gauge-num small { font-size: 12px; font-weight: 700; margin-left: 4px; opacity: 0.75; }
.depot-gauge-label { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; }
.depot-pager { margin-top: 8px; align-items: center; }
.depot-pager[hidden] { display: none; }
.depot-detail { margin-top: 10px; }
.depot-detail[hidden] { display: none; }
.depot-detail-card {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 14px;
  border: 2px solid #b45309;
  background: linear-gradient(120deg, #fffbeb 0%, #fef3c7 60%, #fde68a 100%);
  color: #451a03;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.depot-detail-icao { font-size: 28px; font-weight: 900; letter-spacing: 0.04em; }
.depot-detail-icao .ve-icon { width: 1em; height: 1em; }
.depot-detail-fuels { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.depot-detail-fuel { display: flex; gap: 8px; align-items: center; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.depot-detail-fuel small { font-size: 13px; font-weight: 700; }
.depot-detail .muted-small { margin: 6px 2px 0; }
.defuel-row { margin-top: 8px; }
form.fuel-pay-form, form.defuel-row { margin: 0; }
/* ---- Defuel panel: own bar + second jerrycan, never mixed with the pump preview ----
   The pump preview paints #fuel-tank-add / #fuel-bar-add (pending inflow, green).
   Defuel paints only #defuel-* elements (planned outflow, amber/red), so a pending
   pump amount and a planned defuel never overwrite each other. */
.defuel-panel { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); display: grid; gap: 10px; }
.defuel-panel .fuel-bar { margin: 0; }
#defuel-bar-fill { display: block; flex: none; height: 100%; width: 0%; max-width: 100%; background: linear-gradient(90deg, #f59e0b, #ea580c); transition: width 0.25s ease; }
#defuel-bar-remove { display: block; flex: none; height: 100%; width: 0%; max-width: 100%; background: repeating-linear-gradient(-45deg, #ef4444 0 6px, #fecaca 6px 12px); transition: width 0.25s ease; }
#defuel-btn { font-weight: 800; }
#defuel-btn:disabled { opacity: 0.55; cursor: not-allowed; }
#defuel-gallons-range { width: 100%; accent-color: #b45309; padding: 0; border: 0; }
#defuel-gallons-range:disabled { opacity: 0.55; }
/* Second jerrycan (amber): total stored at this airport (no limit, no window). */
.fuel-jerry-defuel { transform-origin: bottom center; }
/* Slightly smaller only where room allows: transforms do not affect layout,
   so on small screens both cans share the same box to avoid overlap. */
@media (min-width: 641px) {
  .fuel-jerry-defuel { transform: scale(0.88); }
}
.fuel-jerry-defuel .jerry-handle i { background: linear-gradient(180deg, #92400e, #451a03); border-color: #451a03; }
.fuel-jerry-defuel .jerry-top { background: linear-gradient(180deg, #f59e0b, #b45309); border-color: #451a03; }
.fuel-jerry-defuel .jerry-body { border-color: #451a03; background: linear-gradient(90deg, #92400e, #d97706 30%, #f59e0b 50%, #b45309 75%, #78350d); }
.fuel-jerry-defuel .jerry-x, .fuel-jerry-defuel .jerry-x::after { background: rgba(69,26,3,0.45); border-top-color: rgba(69,26,3,0.7); border-bottom-color: rgba(69,26,3,0.7); }
#defuel-can-pct {
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,0.8);
  font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .gas-screen { background: #0f172a; }
html[data-theme="dark"] .airport-bg { filter: brightness(0.82); }
html[data-theme="dark"] .gas-row strong { color: #fef08a; }
html[data-theme="dark"] .fuel-status.pumping { background: rgba(37,99,235,0.25); color: #bfdbfe; }
@media (max-width: 720px) {
  .fuel-main { flex-direction: column; align-items: center; }
  .fuel-controls { width: 100%; }
}
/* Small screens / portrait phones: the decorative hose would wrap onto its own
   row and break the scene, so it is hidden; pump + cans stack centered. The
   aircraft label is allowed to wrap to two lines instead of spilling over the
   neighbouring can. */
/* ---- Fuel station scene prefs (Settings > Display, per device) ---- */
html.no-fuel-scene .fuel-station { display: none; }
/* Forced compact scene = same stacked layout as small screens, any width. */
html.force-fuel-compact .fuel-hose { display: none; }
html.force-fuel-compact .fuel-station { flex-direction: column; align-items: center; padding: 10px 8px 72px; }
html.force-fuel-compact .gas-pump { width: min(190px, 94%); }
html.force-fuel-compact .fuel-cans { flex: none; width: 100%; flex-direction: column; align-items: center; gap: 44px; row-gap: 64px; zoom: 0.85; }
html.force-fuel-compact .fuel-ac { width: max-content; max-width: min(220px, 72vw); white-space: normal; font-size: 11px; overflow-wrap: anywhere; word-break: break-word; }
/* Station scene: pump + hose + cans need ~700px in a row. Below that the
   layout is a fixed column (pump on top, cans centered below) so nothing
   jumps around or gets cut when rotating portrait/landscape. The decorative
   hose is hidden there: stacked, it would dangle unconnected. */
@media (max-width: 820px) {
  .fuel-hose { display: none; }
  .fuel-station { flex-direction: column; align-items: center; padding: 10px 8px 72px; }
  .gas-pump { width: min(190px, 94%); }
  /* Compact scene: cans slightly smaller (zoom affects layout, unlike
     transform) and stacked with just enough gap for the aircraft label. */
  .fuel-cans { flex: none; width: 100%; flex-direction: column; align-items: center; gap: 44px; row-gap: 64px; zoom: 0.85; }
  .fuel-ac { width: max-content; max-width: min(220px, 72vw); white-space: normal; font-size: 11px; overflow-wrap: anywhere; word-break: break-word; }
}

/* ---- Fuel Calculator (My Flights, compact) ---- */
.fuel-calc-card { padding: 14px 16px; }
.fuel-calc-head { display: flex; align-items: center; gap: 12px; }
.fuel-calc-head h2 { margin: 0; }
.fuel-calc-head .muted { margin: 2px 0 0; }
.fuel-calc-icon { width: 52px; height: 52px; flex: none; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.fuel-calc-titles { min-width: 0; }
.fuel-calc-row { align-items: flex-end; margin-top: 10px; }
.fuel-calc-row input { text-transform: uppercase; }
#fuel-calc-ac { margin-left: auto; }
.fuel-calc-result { display: grid; gap: 8px; margin-top: 10px; font-size: 13.5px; }
.fuel-calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.fuel-calc-stat { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-soft); }
.fuel-calc-stat small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fuel-calc-stat strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.fuel-calc-stat.hero { border-color: var(--primary); }
.fuel-calc-stat.hero strong { font-size: 19px; color: var(--primary); }
.fuel-calc-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 12.5px; border: 1px solid transparent; }
.fuel-calc-badge.ok { background: #dcfce7; color: #166534; border-color: #86efac; }
.fuel-calc-badge.warn { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.fuel-calc-badge.bad { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
@media (max-width: 640px) {
  #fuel-calc-ac { margin-left: 0; width: 100%; }
}

/* ---- My Aircraft redesign: aligned cards ---- */
.ac-page-head { margin-bottom: 12px; }
.ac-page-head p { margin: 0; }
.rentals-card { padding: 16px 18px; }
.rentals-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rentals-head h2 { margin: 0; }
.muted-small { font-size: 12.5px; color: var(--muted); }
.rentals-list { display: grid; gap: 8px; }
.rental-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-soft); font-size: 14px; }
.rental-reg { font-weight: 800; }
.rental-type { color: var(--text); }
.rental-at { font-weight: 700; }
.rental-price { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: stretch; }
/* ---- Passports (phase 66): stamp-style cards ---- */
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.pass-stamp { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 14px 14px; border-radius: 6px; background: var(--panel-soft); border: 2px dashed var(--border); transform: rotate(-1.2deg); text-align: center; overflow: hidden; }
.pass-stamp:nth-child(even) { transform: rotate(1.1deg); }
.pass-stamp-flag img, .pass-stamp-flag .flag-img { width: 72px; height: auto; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.25); font-size: 44px; }
.pass-stamp-code { font-size: 26px; font-weight: 800; letter-spacing: 0.12em; }
.pass-stamp-name { font-weight: 700; }
.pass-stamp-seal { margin-top: 4px; padding: 4px 14px; border: 3px double #2563eb; border-radius: 999px; color: #2563eb; font-weight: 800; letter-spacing: 0.08em; opacity: 0.85; transform: rotate(-4deg); text-transform: uppercase; font-size: 13px; }
.pass-stamp-seal em { display: block; font-style: normal; font-size: 11px; letter-spacing: 0.04em; }
.pass-stamp.is-claimed .pass-stamp-seal { border-color: #16a34a; color: #16a34a; }
.pass-stamp-route { margin-top: 4px; }
html[data-theme="dark"] .pass-stamp-seal { border-color: #60a5fa; color: #93c5fd; }
html[data-theme="dark"] .pass-stamp.is-claimed .pass-stamp-seal { border-color: #4ade80; color: #4ade80; }
.ac-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; margin: 0; height: 100%; box-sizing: border-box; }
.ac-card.is-active { outline: 2px solid var(--primary); outline-offset: -2px; }
.ac-card.is-rented { border-style: dashed; }
.ac-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ac-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-reg { font-size: 18px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; overflow-wrap: anywhere; }
.ac-type { font-size: 13.5px; color: var(--muted); }
.ac-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 55%; }
.rental-expiry { flex-basis: 100%; text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap; }
.pill-owned { background: #dcfce7; color: #166534; border-color: #86efac; }
.pill-rented { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.pill-active { background: var(--primary); color: #fff; }
.pill-sale { background: #fae8ff; color: #86198f; border-color: #f0abfc; text-transform: none; }
.pill-rent { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; text-transform: none; }
.pill-crate { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.pill-company { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; text-transform: none; }
.badge.crate { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; text-transform: none; font-weight: 700; }
.ac-card.is-crated { outline: 2px dashed #fb923c; outline-offset: -2px; }
/* ---- Crate panel (phase 58: boxed airframes) ---- */
.crate-panel { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid #fdba74; background: linear-gradient(180deg, rgba(251,146,60,0.12), rgba(251,146,60,0.04)); }
.crate-panel.is-ready { border-color: #22c55e; background: linear-gradient(180deg, rgba(34,197,94,0.12), rgba(34,197,94,0.04)); }
.crate-panel.is-busy { border-style: dashed; }
.crate-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.crate-head .ve-icon { width: 22px; height: 22px; }
.crate-head strong { text-transform: uppercase; letter-spacing: 0.05em; font-size: 12.5px; }
.crate-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.crate-count { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.crate-count .ve-icon { width: 18px; height: 18px; }
.crate-panel .ac-form { background: transparent; }
/* ---- Crate wizard modal (phase 58b) ---- */
.crate-card { max-width: 560px; }
.crate-card .ferry-plane .ve-icon { width: 30px; height: 30px; }
.crate-info { display: grid; gap: 8px; font-size: 13.5px; }
.crate-info p { margin: 0; }
.crate-info ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.crate-progress { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 10px; background: var(--panel-soft); }
.crate-progress .ve-icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.ac-loc { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--panel-soft); border: 1px solid var(--border); font-size: 14px; }
.ac-icao { font-weight: 800; font-size: 15px; }
.ac-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.spec { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-soft); min-width: 0; }
.spec span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.spec strong { font-size: 13.5px; overflow-wrap: anywhere; }
.spec-wide { grid-column: 1 / -1; }
.payload-box { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft); display: grid; gap: 8px; }
.ac-fuel { display: grid; gap: 6px; }
.ac-fuel-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fuel-mini { height: 8px; border-radius: 999px; background: rgba(128,128,128,0.3); overflow: hidden; border: 1px solid var(--border); }
.fuel-mini span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b); }
.ac-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.ac-check .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.check-ok .dot { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.7); }
.check-ok { color: #15803d; }
.check-overdue { color: #b91c1c; }
.check-overdue .dot { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.8); }
html[data-theme="dark"] .check-ok { color: #86efac; }
html[data-theme="dark"] .check-overdue { color: #fca5a5; }
.ac-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: auto; }
.ac-actions button { padding: 10px 12px; font-size: 14px; border-radius: 10px; }
.btn-primary { background: var(--primary); color: #fff; border: 0; font-weight: 700; cursor: pointer; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); cursor: pointer; }
.btn-ghost:hover { background: var(--panel-soft); }
.btn-small { padding: 8px 12px; font-size: 13px; border-radius: 9px; flex: none; }
.ac-tools { display: grid; gap: 8px; }
.ac-form { display: grid; gap: 6px; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft); }
.ac-form-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ac-form-row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 0; }
.ac-form-row label { display: grid; gap: 4px; font-size: 13px; min-width: 0; flex: 1 1 120px; margin: 0; }
.ac-form-row label.check { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-bottom: 10px; font-weight: 600; }
.ac-form-row input[type="number"], .ac-form-row input[type="text"], .ac-form-row select { width: 100%; max-width: 160px; padding: 8px 10px; font-size: 14px; }
.ac-form-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.ac-ferry input { text-transform: uppercase; }
.ac-ferry { border-style: dashed; }
.rental-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border); background: var(--panel-soft); font-size: 13px; color: var(--muted); }
.rentedout-row { padding: 6px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.empty-card { padding: 18px; border: 1px dashed var(--border); border-radius: 12px; }
@media (max-width: 480px) {
  .ac-grid { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .ac-actions { grid-template-columns: 1fr; }
}

/* ---- Hangar card (Airports page) ---- */
.hangar-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hangar-figure { flex: 0 1 300px; }
.hangar-figure img { width: 100%; max-width: 300px; height: auto; display: block; border-radius: 14px; }
.hangar-info { flex: 1 1 220px; min-width: 220px; }
.hangar-status { font-weight: 600; margin: 6px 0; }
.hangar-actions { margin-top: 8px; }

/* Catering hero: food cart illustration + pitch side by side. */
.catering-hero { display: flex; align-items: center; gap: 24px; text-align: left; padding: 28px; }
.catering-hero h1 { font-size: 26px; margin: 0 0 8px; }
.catering-svg { width: 200px; height: auto; flex: 0 0 auto; }
@media (max-width: 700px) {
  .catering-hero { flex-direction: column; text-align: center; }
  .catering-svg { width: 150px; }
}

/* Status banner: pilot/aircraft location + company + flight + maintenance. */
.fly-banner { border-left: 8px solid #9ca3af; border-radius: 14px; }
.fly-banner.loc-ok { border-left-color: #16a34a; background: linear-gradient(180deg, #f0fdf4, #fff); }
.fly-banner.loc-diff { border-left-color: #dc2626; background: linear-gradient(180deg, #fef2f2, #fff); }
.fly-banner.needs-mx { box-shadow: 0 0 0 2px rgba(220,38,38,.25); }
.fly-banner-main { font-size: 1.05em; margin-bottom: 8px; display: grid; gap: 8px; }
html[data-theme="dark"] .fly-banner.loc-ok { background: linear-gradient(180deg, rgba(22,163,74,.18), rgba(22,163,74,.05)); }
html[data-theme="dark"] .fly-banner.loc-diff { background: linear-gradient(180deg, rgba(220,38,38,.18), rgba(220,38,38,.05)); }
.fly-loc-lines { display: grid; gap: 4px; font-size: 15px; }
.fly-loc-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.fly-loc-line .ve-icon { flex: 0 0 auto; }
.fly-flies { font-size: 13px; }
.fly-warn { background: #fee2e2; border: 1px solid #f87171; color: #991b1b; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 700; animation: mx-blink 1.6s ease-in-out infinite; }
html[data-theme="dark"] .fly-warn { background: rgba(220,38,38,.18); color: #fecaca; }
.fly-bonus-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; align-items: center; }
.fly-bonus-label { font-size: 13px; color: var(--muted); }
.fly-bonus { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-soft); }
.fly-bonus.on { background: #fef9c3; border-color: #facc15; color: #854d0e; }
html[data-theme="dark"] .fly-bonus.on { background: rgba(234,179,8,.18); color: #fde68a; }
.fly-bonus.off { opacity: .55; }
.fly-company { font-size: 14.5px; }
.fly-company.solo { color: var(--muted); }
.fly-company.co { font-weight: 600; }
.fly-progress { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fef9c3; border: 1px solid #facc15; color: #854d0e; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.fly-progress .pulse-dot { background: #eab308; animation: mx-blink 1.2s ease-in-out infinite; }
html[data-theme="dark"] .fly-progress { background: rgba(234,179,8,.15); color: #fde68a; border-color: #a16207; }
.fly-maint { display: flex; align-items: center; gap: 8px; background: #fee2e2; border: 1px solid #f87171; color: #991b1b; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
html[data-theme="dark"] .fly-maint { background: rgba(220,38,38,.18); color: #fecaca; }
@keyframes mx-blink { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.home-loc-link { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; cursor: pointer; margin-left: 8px; }
.home-loc-link:hover { background: rgba(255,255,255,.3); }

/* ---- Phase 46: cinematic entry + modern home ---- */
#welcome-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #0b1026 0%, #1e1b4b 55%, #f97316 130%); overflow: hidden; opacity: 1; transition: opacity .6s ease; }
#welcome-overlay[hidden] { display: none; }
#welcome-overlay.wo-hide { opacity: 0; pointer-events: none; }
.wo-sky { position: absolute; inset: 0; }
.wo-inner { position: relative; text-align: center; color: #fff; padding: 24px; }
.wo-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.wo-logo { width: 76px; height: 76px; filter: drop-shadow(0 8px 24px rgba(37,99,235,.6)); }
.wo-brand h1 { margin: 0; font-size: clamp(26px, 5vw, 40px); letter-spacing: .01em; line-height: 1; }
.wo-inner h1 { margin: 10px 0 4px; font-size: clamp(26px, 5vw, 40px); letter-spacing: .01em; }
.wo-brand + p { margin-top: 10px; }
.wo-inner p { margin: 0 0 14px; color: #e0e7ff; }
.wo-bar { width: min(340px, 70vw); height: 10px; margin: 0 auto; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; border: 1px solid rgba(255,255,255,.25); }
.wo-bar span { display: block; height: 100%; width: 5%; border-radius: 999px; background: linear-gradient(90deg, #38bdf8, #fbbf24, #f97316); transition: width .3s ease; }
.wo-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; background: linear-gradient(180deg, #334155, #0f172a); }
.wo-ground::before { content: ""; position: absolute; left: 0; right: 0; top: 16px; height: 5px; background: repeating-linear-gradient(90deg, #fbbf24 0 34px, transparent 34px 68px); opacity: .9; }

/* Page transition: every dashboard page fades/slides in */
.page.active { animation: page-in .38s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Home hero */
.home-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 30px 28px; margin-bottom: 16px; color: #fff; background: linear-gradient(120deg, #1e1b4b 0%, #312e81 35%, #0ea5e9 75%, #f97316 130%); box-shadow: 0 14px 44px rgba(30,27,75,.45); display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.home-hero-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.home-hero-bg .runway { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: rgba(15,23,42,.55); }
.home-hero-bg .runway::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 4px; background: repeating-linear-gradient(90deg, #fde68a 0 26px, transparent 26px 52px); }
.home-hero-text { position: relative; flex: 2 1 340px; min-width: 260px; }
.home-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fef3c7; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.25); padding: 5px 12px; border-radius: 999px; margin: 0 0 10px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.home-hero h1 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 36px); color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
#home-greet { color: #fff; }
.home-sub { margin: 0 0 16px; color: #e0e7ff; font-size: 15px; max-width: 60ch; }
.home-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.home-cta button { padding: 11px 18px; font-weight: 700; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.home-cta .btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.home-cta .btn-ghost:hover { background: rgba(255,255,255,.24); }
.home-hero-side { position: relative; flex: 1 1 240px; min-width: 230px; }
.home-pilot-card { background: #0f172a; color: #f8fafc; border: 1px solid #0f172a; border-radius: 16px; padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.home-pilot-card strong { color: #fff; }
.home-pilot-card #home-pilot-sub, .home-pilot-card #home-xp-text { color: #f1f5f9; }
.home-xpbar { height: 8px; border-radius: 999px; background: #334155; overflow: hidden; margin-top: 10px; }
.home-xpbar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #fbbf24, #f97316); transition: width 1s ease; }

/* Stat counters: fichas flexibles, todas iguales, sin desbordes. */
.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; margin-bottom: 16px; align-items: stretch; }
.home-stats .card.stat { border: 0; border-top: 4px solid var(--primary); transform: translateY(0); transition: transform .18s ease, box-shadow .18s ease; min-width: 0; max-width: none; width: 100%; margin: 0; padding: 14px 12px; }
@media (max-width: 520px) { .home-stats { grid-template-columns: repeat(2, 1fr); } }
.home-stats .card.stat:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15,23,42,.22); }

/* News + admin */
.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }
.home-card { margin-bottom: 0 !important; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-card-sub { margin: 4px 0 12px; }
.news-list { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.news-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--panel-soft); animation: page-in .4s ease both; }
.news-item.pinned { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.18); }
.news-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.news-top strong { font-size: 15px; }
.news-date { margin-left: auto; font-size: 12px; color: var(--muted); }
.news-body { margin: 6px 0 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.news-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 9px; border-radius: 999px; background: #e0e7ff; color: #3730a3; }
.news-tag.evento, .news-tag.event { background: #fae8ff; color: #86198f; } .news-tag.aviso, .news-tag.notice { background: #fee2e2; color: #991b1b; }
.admin-card .admin-contact { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-soft); border: 1px dashed var(--border); font-size: 14px; }

/* ---- External guides banner ---- */
.guides-banner { position: relative; overflow: hidden; border: 0 !important; color: #fff; text-decoration: none;
  background: linear-gradient(120deg, #0f766e 0%, #0ea5a4 45%, #0284c7 80%, #4f46e5 100%);
  box-shadow: 0 14px 44px rgba(14,165,164,.45); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.guides-banner h2 { margin: 0 0 4px; font-size: clamp(20px, 3vw, 26px); color: #fff !important; }
.guides-banner .muted { color: rgba(255,255,255,.85) !important; }
.guides-glow { position: absolute; width: 420px; height: 420px; left: -140px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); pointer-events: none; }
.guides-main { position: relative; display: flex; gap: 16px; align-items: center; flex: 2 1 320px; min-width: 240px; }
.guides-logo { width: 62px; height: 62px; flex: none; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); border-radius: 18px; padding: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.guides-logo img, .guides-logo svg { width: 100%; height: 100%; }
.guides-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: #ccfbf1; }
.guides-dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; }
.guides-text p { margin: 0; }
.guides-actions { position: relative; display: flex; gap: 10px; flex: 1 1 auto; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.guides-cta { display: inline-block; padding: 12px 22px; border-radius: 12px; background: #fff; color: #0f766e !important;
  font-weight: 800; text-decoration: none; box-shadow: 0 8px 22px rgba(0,0,0,.3); transition: transform .15s ease; }
.guides-banner:hover .guides-cta { transform: translateY(-2px); }
.guides-banner.is-off { opacity: .75; }
.guides-hint { flex-basis: 100%; margin: 0; font-size: 13px; }

/* ---- Phase 47: Discord community block ---- */
.discord-card { position: relative; overflow: hidden; border: 0 !important; color: #fff;
  background: linear-gradient(120deg, #404eed 0%, #5865f2 45%, #7b5cf0 80%, #9b5cf0 100%);
  box-shadow: 0 14px 44px rgba(64,78,237,.45); display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px 20px; width: 100%; box-sizing: border-box; flex-wrap: wrap; }
.discord-card h2 { margin: 0 0 4px; font-size: clamp(20px, 3vw, 26px); color: #fff !important; }
.discord-card .muted { color: rgba(255,255,255,.85) !important; }
.discord-glow { position: absolute; width: 420px; height: 420px; right: -140px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); pointer-events: none; }
.discord-main { position: relative; display: flex; gap: 16px; align-items: center; flex: 1 1 0; min-width: 0; }
.discord-logo { width: 62px; height: 62px; flex: none; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); border-radius: 18px; padding: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.discord-logo svg { width: 100%; height: 100%; }
.discord-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: #d6dbff; }
.discord-dot { width: 8px; height: 8px; border-radius: 50%; background: #57f287; }
.discord-text p { margin: 0; }
.discord-text { flex: 1 1 auto; min-width: 0; }
.discord-actions { position: relative; display: flex; gap: 10px; flex: none; flex-direction: row; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }
.discord-join { display: inline-block; padding: 12px 22px; border-radius: 12px; background: #fff; color: #404eed !important;
  font-weight: 800; text-decoration: none; box-shadow: 0 8px 22px rgba(0,0,0,.3); transition: transform .15s ease; white-space: nowrap; }
.discord-join:hover { transform: translateY(-2px); }
.discord-join.is-off { opacity: .55; pointer-events: none; }
.discord-card .btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.45); white-space: nowrap; }
.discord-card .btn-ghost:hover { background: rgba(255,255,255,.26); }
.discord-hint { flex: 1 1 100%; margin: 0; font-size: 13px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.discord-hint[hidden] { display: none !important; }
@media (max-width: 640px) {
  .discord-actions { flex-basis: 100%; justify-content: stretch; }
  .discord-actions .discord-join, .discord-actions .btn-ghost { flex: 1 1 0; text-align: center; }
  .discord-hint { text-align: center; }
}

/* ---- Phase 80: official Discord login/link button (brand: blurple + white Clyde) ---- */
.discord-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; border: 0;
  border-radius: 10px; background: #5865f2; color: #fff !important; font-weight: 800; font-size: 15px;
  cursor: pointer; text-decoration: none; }
.discord-btn:hover { background: #4752c4; }
.discord-btn:disabled { opacity: .6; cursor: wait; }
.discord-btn svg { width: 22px; height: 22px; flex: none; }

/* ---- Legal footer + mandatory cookie banner (theme-agnostic: vars only) ---- */
.ve-legal-footer {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center;
  max-width: 1600px; margin: 0 auto; padding: 18px 20px 26px;
  font-size: 12.5px; color: var(--muted);
  border-top: 1px solid var(--border, #aeb4bd);
}
.ve-legal-footer nav { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; justify-content: center; }
.ve-legal-footer a { color: var(--link, var(--primary)); text-decoration: none; }
.ve-legal-footer a:hover { text-decoration: underline; }
.ve-legal-link {
  background: none; border: none; padding: 0; font-size: inherit; cursor: pointer;
  color: var(--link, var(--primary));
}
.ve-legal-link:hover { text-decoration: underline; }
.container + .ve-legal-footer { max-width: 420px; border-top: none; padding-top: 0; }
.container.wide + .ve-legal-footer { max-width: 900px; }
.ve-legal-page h2 { margin-top: 18px; font-size: 17px; }
.ve-legal-page ul { line-height: 1.6; }
.ve-beta-notice {
  margin: 12px 0; padding: 12px 14px; border-radius: 10px;
  background: var(--panel-soft, #d0d4d9); color: var(--text, #1e2732);
  border: 1px solid var(--primary, #2563eb); border-left-width: 5px;
  font-size: 14px; line-height: 1.55;
}
body.ve-cookie-lock { overflow: hidden; }
#ve-cookie-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, 0.65);
}
#ve-cookie-overlay[hidden] { display: none; }
.ve-cookie-card {
  width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto;
  background: var(--card, #dee1e6); color: var(--text, #1e2732);
  border: 1px solid var(--border, #aeb4bd); border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  padding: 24px;
}
.ve-cookie-kicker {
  margin: 0 0 4px; font-size: 12px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--primary);
}
.ve-cookie-card h2 { margin: 0 0 8px; }
.ve-cookie-links { font-size: 13.5px; }
.ve-cookie-custom { display: grid; gap: 10px; margin: 12px 0; }
.ve-cookie-custom[hidden] { display: none; }
.ve-cookie-custom label {
  display: grid; gap: 2px; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border, #aeb4bd); border-radius: 10px;
  background: var(--panel-soft, #d0d4d9);
}
.ve-cookie-custom small { color: var(--muted); font-size: 12.5px; }
.ve-cookie-custom input[type="checkbox"] { width: auto; margin-right: 8px; accent-color: var(--primary); }
.ve-cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ve-cookie-actions button { flex: 1 1 150px; }
.ve-cookie-ghost {
  background: transparent !important; color: var(--text, #0f172a) !important;
  border: 1px solid var(--border, #aeb4bd) !important;
}
.ve-legal-check { display: grid !important; gap: 6px; font-size: 13.5px; }
.ve-legal-check input { width: auto; margin-right: 8px; accent-color: var(--primary); }

/* ---- Hall of Fame (phase 83): pyramid Owners > Admins > Moderators > Helpers ---- */
.hof-hero { position: relative; overflow: hidden; border-radius: 16px; padding: 30px 28px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(120deg, #0f172a 0%, #312e81 45%, #0ea5e9 80%, #f97316 135%);
  box-shadow: 0 14px 40px rgba(15,23,42,.45); }
.hof-hero .hof-hero-glow { position: absolute; inset: auto -60px -90px auto; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(251,191,36,.45), transparent 70%); pointer-events: none; }
.hof-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: #fde68a; margin: 0 0 8px; }
.hof-hero h1 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 34px); color: #fff; }
.hof-hero p { margin: 0; color: #e0e7ff; max-width: 70ch; }
.hof-hero p.muted { color: #e0e7ff; }
#hof-pyramid { display: grid; gap: 26px; }
.hof-tier { display: block; width: 100%; }
.hof-tier-head { display: flex; align-items: center; gap: 14px; width: 100%; }
.hof-tier-title { text-align: center; flex: none; }
.hof-tier-title h2 { margin: 0; font-size: 20px; text-transform: uppercase; letter-spacing: .1em; }
.hof-tier-title p { margin: 2px 0 0; font-size: 13.5px; }
.hof-rule { flex: 1 1 auto; height: 3px; border-radius: 3px; background: var(--muted); opacity: .5; min-width: 24px; }
.hof-sec-owners .hof-rule { background: linear-gradient(90deg, transparent, #f59e0b); opacity: 1; }
.hof-sec-owners .hof-rule:last-child { background: linear-gradient(90deg, #f59e0b, transparent); }
.hof-sec-admins .hof-rule { background: linear-gradient(90deg, transparent, var(--primary)); opacity: 1; }
.hof-sec-admins .hof-rule:last-child { background: linear-gradient(90deg, var(--primary), transparent); }
.hof-sec-moderators .hof-rule { background: linear-gradient(90deg, transparent, #0ea5e9); opacity: 1; }
.hof-sec-moderators .hof-rule:last-child { background: linear-gradient(90deg, #0ea5e9, transparent); }
.hof-sec-helpers .hof-rule { background: linear-gradient(90deg, transparent, #16a34a); opacity: 1; }
.hof-sec-helpers .hof-rule:last-child { background: linear-gradient(90deg, #16a34a, transparent); }
.hof-sec-owners .hof-tier-head h2 { color: #b45309; }
.hof-sec-admins .hof-tier-head h2 { color: var(--primary); }
.hof-grid { display: grid; gap: 14px; justify-content: center; width: 100%; margin: 12px auto 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 230px)); max-width: 1100px; }
.hof-card { background: var(--card); border: 2px solid #f59e0b; border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 4px rgba(245,158,11,.25), 0 18px 44px rgba(0,0,0,.35); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; max-width: 100%; }
.hof-card:hover { transform: translateY(-4px); box-shadow: 0 0 0 4px rgba(245,158,11,.4), 0 22px 50px rgba(0,0,0,.4); }
.hof-banner { aspect-ratio: 16 / 9; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background-color: var(--page-bg, #c9cdd3);
  background-image:
    repeating-linear-gradient(135deg, rgba(100,116,139,.16) 0 2px, transparent 2px 12px); }
.hof-banner img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hof-banner-empty { font-size: 42px; opacity: .5; }
.hof-body { padding: 10px 12px 12px; text-align: center; }
.hof-badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; background: var(--panel-soft, #d0d4d9); color: var(--muted); }
.hof-sec-owners .hof-badge { background: #fef3c7; color: #92400e; }
.hof-sec-admins .hof-badge { background: #dbeafe; color: #1d4ed8; }
.hof-sec-moderators .hof-badge { background: #e0f2fe; color: #0369a1; }
.hof-sec-helpers .hof-badge { background: #dcfce7; color: #166534; }
.hof-body h3 { margin: 6px 0 2px; font-size: 16px; }
.hof-role { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.hof-thanks { background: var(--primary); color: #fff; border: none; font-weight: 800; padding: 7px 13px;
  border-radius: 9px; cursor: pointer; font-size: 13px; }
.hof-thanks:hover { filter: brightness(1.1); }
.hof-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15,23,42,.65); }
.hof-modal[hidden] { display: none; }
.hof-modal-card { width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; background: var(--card);
  color: var(--text); border: 2px solid #f59e0b; border-top: 8px solid #f59e0b; border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5); padding: 24px; text-align: center; }
.hof-modal-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #b45309; }
.hof-modal-card h2 { margin: 0 0 4px; font-size: 22px; }
.hof-modal-img img { max-width: 100%; max-height: 220px; border-radius: 10px; margin: 10px 0; object-fit: cover; }
#hof-modal-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6;
  background: var(--panel-soft, #d0d4d9); border-radius: 10px; padding: 14px 16px; text-align: left; }
#hof-modal-close { margin-top: 14px; background: #f59e0b; color: #1c1005; font-weight: 800; font-size: 15px;
  padding: 10px 26px; border: none; border-radius: 10px; cursor: pointer; }
#hof-modal-close:hover { filter: brightness(1.08); }
@media (max-width: 640px) {
  .hof-hero { padding: 22px 18px; }
  /* Keep 2+ cards per row even on phones — never a single vertical stack. */
  .hof-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); max-width: none; }
}

/* Support thread (phase 91): sectioned conversation with bordered labels. */
.sup-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.sup-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border: 1px solid var(--border, #aeb4bd); border-radius: 999px;
  background: var(--panel-soft, #d0d4d9); font-size: 12px; font-weight: 700; }
.sup-chip small { font-weight: 400; color: var(--muted, #64748b); }
.sup-banner { border: 1px solid var(--border, #aeb4bd); border-left-width: 5px; border-radius: 10px;
  padding: 10px 12px; margin: 10px 0; font-size: 13.5px; }
.sup-banner.ok { border-left-color: #16a34a; }
.sup-banner.wait { border-left-color: #f59e0b; }
.sup-banner.closed { border-left-color: #6b7280; }
.sup-banner strong { display: block; margin-bottom: 2px; }
.sup-day { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px;
  color: var(--muted, #64748b); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; }
.sup-day::before, .sup-day::after { content: ""; flex: 1; border-top: 1px solid var(--border, #aeb4bd); }
.sup-msg { border: 1px solid var(--border, #aeb4bd); border-left-width: 5px; border-radius: 10px;
  padding: 10px 12px; margin: 0 0 8px; }
.sup-msg-user { border-left-color: #2563eb; }
.sup-msg-admin { border-left-color: #16a34a; }
.sup-msg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap; }
.sup-msg-time { font-size: 12px; color: var(--muted, #64748b); font-variant-numeric: tabular-nums; }
.sup-msg-body { margin: 0; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Closed-ticket notice: big, red, impossible to miss. */
.sup-closed-note { border: 2px solid #dc2626; background: #fef2f2; color: #991b1b;
  border-radius: 12px; padding: 14px 16px; font-size: 16px; font-weight: 600; margin: 12px 0; }
.sup-closed-note strong { font-size: 17px; }
.sup-closed-note .ve-icon { width: 26px; height: 26px; vertical-align: -5px; margin-right: 2px; }

/* ---- Christmas theme (opt-in, dashboard only): dark festive night ----
   Not too bright: deep navy night, warm text, red/gold/green accents. */
html[data-theme="christmas"] {
  color-scheme: dark;
  --primary: #e02626;
  --card: #31151d;
  --text: #fff3ec;
  --muted: #d3a3a3;
  --page-bg: #210f16;
  --border: #63303b;
  --input-bg: #2a1219;
  --input-text: #fff3ec;
  --panel-soft: #2a1219;
  --link: #fcd34d;
  --error: #f87171;
}
html[data-theme="christmas"] body {
  background-color: #200d13;
  background-image:
    radial-gradient(120% 70% at 50% 0%, transparent 55%, rgba(20, 4, 8, 0.6)),
    radial-gradient(900px 460px at 50% -60px, rgba(220, 38, 38, 0.28), transparent 65%),
    radial-gradient(700px 500px at 88% 30%, rgba(251, 191, 36, 0.08), transparent 65%),
    radial-gradient(800px 600px at 8% 75%, rgba(22, 163, 74, 0.1), transparent 65%),
    repeating-linear-gradient(45deg, rgba(251, 191, 36, 0.03) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(220, 38, 38, 0.032) 0 2px, transparent 2px 14px),
    linear-gradient(180deg, #33111a, #200d13 40%, #160a0f);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat, no-repeat;
  color: var(--text);
}
html[data-theme="christmas"] .page h1 { color: var(--text); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65); }
/* Festive glowing underline for page titles. */
html[data-theme="christmas"] .page h1::after {
  content: "";
  display: block;
  width: 130px;
  height: 6px;
  margin-top: 7px;
  border-radius: 99px;
  background: linear-gradient(90deg, #dc2626 0%, #fbbf24 50%, #16a34a 100%);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.65), 0 1px 4px rgba(0, 0, 0, 0.4);
}
/* Get-the-client banner + in-content links go festive (no blues). */
html[data-theme="christmas"] .dl-banner {
  background: linear-gradient(120deg, #2b0a12 0%, #7f1d1d 55%, #b45309 100%);
  border: 1px solid rgba(251, 191, 36, 0.45);
}
html[data-theme="christmas"] .dl-banner h2 { color: #fde68a; }
html[data-theme="christmas"] .dl-banner p { color: #f3c9c9; }
html[data-theme="christmas"] .dl-banner .btn-dl { background: #fbbf24; color: #3a0d16; }
html[data-theme="christmas"] .dl-banner .btn-dl:hover { background: #fde68a; }
html[data-theme="christmas"] .dl-banner .dl-ver { background: rgba(251, 191, 36, 0.16); border-color: rgba(251, 191, 36, 0.5); color: #fde68a; }
html[data-theme="christmas"] .apt-link { color: #fbbf24; }
html[data-theme="christmas"] .apt-link:hover { color: #fde68a; }
html[data-theme="christmas"] .userbox .link { color: #fcd34d; }
html[data-theme="christmas"] .discord-join { color: #7f1d1d !important; }
html[data-theme="christmas"] .guides-cta { color: #7f1d1d !important; }
html[data-theme="christmas"] .sup-msg-user { border-left-color: #dc2626; }
html[data-theme="christmas"] .osm-btn { background: #b91c1c; }
html[data-theme="christmas"] .osm-btn:hover { background: #dc2626; }
/* Festive tri-color frame on data containers instead of a flat solid border. */
html[data-theme="christmas"] .page .card {
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, rgba(220, 38, 38, 0.55), rgba(251, 191, 36, 0.55) 50%, rgba(22, 163, 74, 0.55)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
/* Festive table headers: deep red-to-green wash, gold text, gold rule. */
html[data-theme="christmas"] .table th {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.42), rgba(22, 163, 74, 0.32));
  color: #fde68a;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(251, 191, 36, 0.55);
}
html[data-theme="christmas"] .table th, html[data-theme="christmas"] .table td { border-bottom-color: var(--border); }
html[data-theme="christmas"] .table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.05); }
html[data-theme="christmas"] .table tbody tr:hover { background: rgba(251, 191, 36, 0.08); }
html[data-theme="christmas"] input, html[data-theme="christmas"] select, html[data-theme="christmas"] textarea { background: var(--input-bg); color: var(--input-text); border-color: var(--border); }
html[data-theme="christmas"] .modal-card {
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, rgba(220, 38, 38, 0.6), rgba(251, 191, 36, 0.6) 50%, rgba(22, 163, 74, 0.6)) border-box;
  border: 1px solid transparent;
  color: var(--text);
}
html[data-theme="christmas"] input:focus-visible, html[data-theme="christmas"] select:focus-visible,
html[data-theme="christmas"] textarea:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.7);
  outline-offset: 1px;
  border-color: #fbbf24;
}
html[data-theme="christmas"] .flight-status { background: var(--panel-soft); border-color: var(--border); }
html[data-theme="christmas"] .badge { filter: brightness(1); }
html[data-theme="christmas"] #track-map { border-color: var(--border); }
html[data-theme="christmas"] #live-map { border-color: var(--border); }
html[data-theme="christmas"] .plane-icon { background: #2a1219; }
html[data-theme="christmas"] .detail dt { color: var(--muted); }
html[data-theme="christmas"] .board-cat { background: var(--panel-soft); color: var(--text); }
html[data-theme="christmas"] .board-cat-info { background: #2a1219; color: var(--muted); }
html[data-theme="christmas"] .apt-banner-ferry { background: rgba(245, 158, 11, 0.14); border-color: #f59e0b; color: #fde68a; }
html[data-theme="christmas"] .apt-banner-ticket { background: rgba(220, 38, 38, 0.18); border-color: #dc2626; color: #fecaca; }
html[data-theme="christmas"] .apt-banner-water { background: rgba(2, 132, 199, 0.16); border-color: #0284c7; color: #bae6fd; }
html[data-theme="christmas"] .claim-note.warn { background: rgba(245, 158, 11, 0.12); border-color: #f59e0b; color: var(--text); }
html[data-theme="christmas"] .claim-note.err { background: rgba(220, 38, 38, 0.16); border-color: var(--error); color: var(--text); }
html[data-theme="christmas"] .claim-note.ok { background: rgba(34, 197, 94, 0.14); border-color: #16a34a; color: var(--text); }
html[data-theme="christmas"] .ferry-note { background: rgba(245, 158, 11, 0.12); border-color: #f59e0b; color: var(--text); }
html[data-theme="christmas"] .ferry-err { background: rgba(220, 38, 38, 0.15); border-color: var(--error); color: var(--text); }
html[data-theme="christmas"] .badge.tx-pay { background: rgba(34, 197, 94, 0.18); color: #86efac; border-color: rgba(34, 197, 94, 0.5); }
html[data-theme="christmas"] .badge.tx-fuel { background: rgba(14, 165, 233, 0.2); color: #7dd3fc; border-color: rgba(125, 211, 252, 0.5); }
html[data-theme="christmas"] .badge.tx-food { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(252, 211, 77, 0.5); }
html[data-theme="christmas"] .badge.tx-travel { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; border-color: rgba(196, 181, 253, 0.5); }
html[data-theme="christmas"] .badge.tx-fleet { background: rgba(45, 212, 191, 0.16); color: #5eead4; border-color: rgba(94, 212, 191, 0.5); }
html[data-theme="christmas"] .badge.tx-base { background: rgba(249, 115, 22, 0.18); color: #fdba74; border-color: rgba(253, 186, 116, 0.5); }
html[data-theme="christmas"] .badge.tx-bank { background: rgba(34, 211, 238, 0.16); color: #67e8f9; border-color: rgba(103, 232, 249, 0.5); }
html[data-theme="christmas"] .badge.tx-admin { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; border-color: rgba(203, 213, 225, 0.4); }
html[data-theme="christmas"] .badge.tx-admin-danger { background: rgba(248, 113, 113, 0.18); color: #fca5a5; border-color: rgba(252, 165, 165, 0.5); }
html[data-theme="christmas"] .badge.tx-other { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.5); }
html[data-theme="christmas"] .hg-ok { color: #86efac; }
html[data-theme="christmas"] .hg-out { color: #fdba74; }
html[data-theme="christmas"] .fly-banner.loc-ok { background: linear-gradient(180deg, rgba(22, 163, 74, 0.2), rgba(22, 163, 74, 0.05)); }
html[data-theme="christmas"] .fly-banner.loc-diff { background: linear-gradient(180deg, rgba(220, 38, 38, 0.2), rgba(220, 38, 38, 0.05)); }
html[data-theme="christmas"] .fly-warn { background: rgba(220, 38, 38, 0.2); color: #fecaca; }
html[data-theme="christmas"] .fly-progress { background: rgba(234, 179, 8, 0.15); color: #fde68a; border-color: #a16207; }
html[data-theme="christmas"] .fly-maint { background: rgba(220, 38, 38, 0.2); color: #fecaca; }
html[data-theme="christmas"] .fly-bonus.on { background: rgba(234, 179, 8, 0.18); color: #fde68a; }
html[data-theme="christmas"] .pass-stamp-seal { border-color: #f87171; color: #fca5a5; }
html[data-theme="christmas"] .pass-stamp.is-claimed .pass-stamp-seal { border-color: #4ade80; color: #4ade80; }
html[data-theme="christmas"] .check-ok { color: #86efac; }
html[data-theme="christmas"] .check-overdue { color: #fca5a5; }
html[data-theme="christmas"] .gas-screen { background: #2a1219; }
html[data-theme="christmas"] .gas-row strong { color: #fef08a; }
html[data-theme="christmas"] .fuel-status.pumping { background: rgba(37, 99, 235, 0.25); color: #bfdbfe; }

/* Festive header accents: red/green/gold sheen + glowing gold-ringed active pill. */
html[data-theme="christmas"] .topbar::after {
  background: linear-gradient(90deg, transparent, #dc2626 25%, #fbbf24 50%, #16a34a 75%, transparent);
  background-size: 200% 100%;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.55);
}
html[data-theme="christmas"] .mainnav > button.active,
html[data-theme="christmas"] .nav-menu button.active,
html[data-theme="christmas"] .nav-drop.group-active .nav-main.active {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 20px -6px rgba(220, 38, 38, 0.8), 0 0 0 1px rgba(251, 191, 36, 0.45);
}
html[data-theme="christmas"] .brand strong {
  background: linear-gradient(90deg, #ffffff 15%, #fde68a 55%, #f87171);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="christmas"] button:not(.btn-ghost):not(.link):not(.nav-caret):not(.apt-link):hover {
  filter: brightness(1.08);
}

/* Christmas garland divider: lives in normal flow right below the header,
   so it never covers menu items. Slim pine band with gold trim and snow dust, bulbs hang below. */
#xmas-garland {
  position: relative;
  height: 56px;
  pointer-events: none;
  overflow: visible;
  background:
    radial-gradient(circle at 8px 10px, rgba(248, 250, 252, 0.8) 1.6px, transparent 2.3px),
    radial-gradient(circle at 30px 20px, rgba(248, 250, 252, 0.65) 1.3px, transparent 2px),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0 3px, transparent 3px 8px),
    linear-gradient(180deg, #fbbf24 0 2px, #166534 2px, #052e16 30px, rgba(5, 46, 22, 0) 30px);
  background-size: 44px 32px, 60px 32px, auto, auto;
  background-repeat: repeat-x, repeat-x, repeat, no-repeat;
}
#xmas-garland .xmas-drops {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  height: 30px;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
}
#xmas-garland::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  height: 2px;
  background: #052e16;
  opacity: 0.9;
}
.xmas-bulb {
  position: relative;
  flex: none;
  width: 2px;
  height: 12px;
  background: #052e16;
}
.xmas-bulb:nth-child(3n) { height: 16px; }
.xmas-bulb:nth-child(4n) { height: 9px; }
.xmas-bulb:nth-child(5n) { height: 19px; }
.xmas-bulb::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 7px;
  height: 9px;
  border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%;
  background: currentColor;
  animation: xmas-twinkle 2.4s ease-in-out infinite;
}
.xmas-bulb:nth-child(4n+1) { color: #ef4444; }
.xmas-bulb:nth-child(4n+1)::after { box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.75); }
.xmas-bulb:nth-child(4n+2) { color: #fbbf24; }
.xmas-bulb:nth-child(4n+2)::after { box-shadow: 0 0 8px 2px rgba(251, 191, 36, 0.75); animation-delay: 0.6s; }
.xmas-bulb:nth-child(4n+3) { color: #22c55e; }
.xmas-bulb:nth-child(4n+3)::after { box-shadow: 0 0 8px 2px rgba(34, 197, 94, 0.75); animation-delay: 1.2s; }
.xmas-bulb:nth-child(4n+4) { color: #60a5fa; }
.xmas-bulb:nth-child(4n+4)::after { box-shadow: 0 0 8px 2px rgba(96, 165, 250, 0.75); animation-delay: 1.8s; }
@keyframes xmas-twinkle {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.55; filter: brightness(0.75); }
}

/* Subtle snowfall: tiny slow flakes drifting down, never interactive. */
#xmas-snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  overflow: hidden;
}
.xmas-flake {
  position: absolute;
  top: -12px;
  border-radius: 50%;
  background: #fff;
  animation-name: xmas-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes xmas-fall {
  from { transform: translate3d(0, -3vh, 0); }
  to { transform: translate3d(3vw, 106vh, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .xmas-bulb::after { animation: none; }
  #xmas-snow { display: none; }
  .xmas-snowman { animation: none; }
  .xmas-globe .xmas-gsnow { animation: none; display: none; }
  .xmas-glowdot { animation: none; }
  html[data-theme="christmas"] .topbar::after { animation: none; }
}

/* ---- Christmas extras (dashboard only, all pointer-events: none) ---- */

/* Santa hat tipping over the header logo. */
.topbar .brand { position: relative; }
.xmas-hat {
  position: absolute;
  top: -13px;
  left: 12px;
  width: 34px;
  height: auto;
  transform: rotate(14deg);
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.xmas-hat svg { display: block; width: 100%; height: auto; }

/* Mini santa hats: one over the header avatar, one over the home pilot avatar. */
.top-actions { position: relative; }
.xmas-hat-top {
  position: absolute;
  top: -11px;
  left: 9px;
  width: 26px;
  transform: rotate(12deg);
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.xmas-hat-top svg { display: block; width: 100%; height: auto; }
.home-pilot-row { position: relative; }
.xmas-hat-home {
  position: absolute;
  top: -15px;
  left: 16px;
  width: 36px;
  transform: rotate(12deg);
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.xmas-hat-home svg { display: block; width: 100%; height: auto; }

/* UTC clock goes festive: gold rim, snow cap, mini gifts, gold digits. */
html[data-theme="christmas"] .utc-clock {
  border-color: rgba(251, 191, 36, 0.75);
  background: rgba(43, 14, 20, 0.94);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 14px -2px rgba(251, 191, 36, 0.5);
}
html[data-theme="christmas"] .utc-time { color: #fbbf24; }
.xmas-clockgift { display: inline-flex; flex: none; width: 17px; }
.xmas-clockgift svg { display: block; width: 100%; height: auto; }

/* Gifts corner in the home hero (replaces sleigh): shaded sticker-style art. */
.xmas-gifts {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 215px;
  pointer-events: none;
  z-index: 1;
}
.xmas-gifts svg { display: block; width: 100%; height: auto; overflow: visible; }
.xmas-glowdot { animation: xmas-twinkle 2.2s ease-in-out infinite; }
.home-hero-text, .home-hero-side { position: relative; z-index: 2; }

/* Snow globe with snowman: glass ball, animated snow inside, gold base. */
.xmas-snowman {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 92px;
  pointer-events: none;
  z-index: 34;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
  animation: xmas-sway 3.4s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.xmas-globe {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, #0b2447 0%, #274b73 58%, #dbe7f3 58%, #f8fafc 100%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset -6px -8px 14px rgba(2, 6, 23, 0.45), inset 4px 6px 10px rgba(255, 255, 255, 0.15);
}
.xmas-globe svg.xmas-man {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 52px;
  height: auto;
}
.xmas-globe .xmas-gsnow {
  position: absolute;
  top: -4px;
  border-radius: 50%;
  background: #fff;
  animation: xmas-globefall 3.6s linear infinite;
}
@keyframes xmas-globefall {
  from { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.95; }
  to { transform: translateY(80px); opacity: 0.2; }
}
.xmas-globe::after {
  content: "";
  position: absolute;
  top: 5%;
  left: 9%;
  width: 36%;
  height: 24%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
  transform: rotate(-18deg);
  pointer-events: none;
}
.xmas-globebase {
  width: 56px;
  height: 12px;
  margin: -2px auto 0;
  background: linear-gradient(180deg, #f59e0b, #92400e);
  border-radius: 4px 4px 8px 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}
@keyframes xmas-sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@media (max-width: 720px) {
  .xmas-snowman { width: 66px; right: 8px; bottom: 8px; }
  .xmas-globe { width: 62px; height: 62px; }
  .xmas-globe svg.xmas-man { width: 37px; bottom: 5px; }
  .xmas-globebase { width: 40px; height: 9px; }
  .xmas-gifts { width: 128px; opacity: 0.92; }
  .xmas-hat { width: 26px; top: -10px; left: 12px; }
}

/* Festive buttons: deep red gradient with a gold rim. */
html[data-theme="christmas"] .btn-primary,
html[data-theme="christmas"] .home-cta button,
html[data-theme="christmas"] #fuel-buy-btn {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  border: 1px solid rgba(251, 191, 36, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 14px -4px rgba(220, 38, 38, 0.7);
}

/* Warm red sections across the dashboard (no more navy blues here). */
html[data-theme="christmas"] .topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #3a1420, #240d15);
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
}
html[data-theme="christmas"] .nav-menu {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 35%),
    linear-gradient(180deg, #3a1420, #240d15);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
html[data-theme="christmas"] .home-hero {
  background: linear-gradient(120deg, #4c0519 0%, #7f1d1d 35%, #b45309 75%, #166534 130%);
}
html[data-theme="christmas"] .home-pilot-card {
  background: rgba(35, 10, 17, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fff3ec;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
html[data-theme="christmas"] .home-pilot-card strong { color: #fde68a; }
html[data-theme="christmas"] .fuel-bar { background: #2a0f16; border-color: #63303b; }
html[data-theme="christmas"] .modal { background: rgba(32, 8, 13, 0.68); }
html[data-theme="christmas"] .cl-body pre { background: #2a0f16; color: #ffe9d6; }
html[data-theme="christmas"] .utc-open { background: rgba(43, 14, 20, 0.94); border-color: rgba(251, 191, 36, 0.4); }

/* Phase 116: notifications bell + panel (theme-aware: driven by --card/--text/--muted/--border/--primary/--link). */
.notif-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.07);color:#f1f5f9;cursor:pointer;transition:transform .15s ease,background .2s,border-color .2s,box-shadow .2s}
.notif-bell:hover{background:rgba(255,255,255,.13);border-color:var(--primary,#2563eb);box-shadow:0 0 18px -6px var(--primary,#2563eb)}
.notif-bell.has-unread{border-color:var(--primary,#2563eb);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 0 18px -6px var(--primary,#2563eb)}
.notif-bell svg{width:20px;height:20px}
.notif-badge{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--error,#dc2626);color:#fff;font-size:11px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1}
#notif-panel{position:fixed;top:64px;right:16px;z-index:150;width:min(400px,calc(100vw - 32px));max-height:70vh;display:flex;flex-direction:column;background:var(--card,#dee1e6);color:var(--text,#1e2732);border:1px solid var(--border,#aeb4bd);border-radius:14px;box-shadow:0 24px 64px rgba(0,0,0,.35);overflow:hidden}
#notif-panel[hidden]{display:none}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--border,#aeb4bd)}
.notif-head strong{font-size:15px}
.notif-tabs{display:flex;gap:6px;padding:10px 12px 0}
.notif-tabs button{flex:1;padding:7px 4px;border-radius:8px;border:1px solid transparent;background:transparent;color:var(--muted,#525b68);font-size:12px;cursor:pointer}
.notif-tabs button.on{background:var(--panel-soft,#d0d4d9);border-color:var(--primary,#2563eb);color:var(--text,#1e2732)}
.notif-list{overflow-y:auto;padding:10px 12px 14px;display:flex;flex-direction:column;gap:8px}
.notif-item{background:var(--panel-soft,#d0d4d9);border:1px solid var(--border,#aeb4bd);border-radius:10px;padding:10px 12px}
.notif-item.unread{border-color:var(--primary,#2563eb)}
.notif-item .notif-title{font-weight:700;font-size:13.5px}
.notif-item .notif-body{font-size:13px;color:var(--muted,#525b68);margin-top:4px;line-height:1.45}
.notif-item .notif-meta{font-size:11.5px;color:var(--muted,#525b68);margin-top:6px}
.notif-item .notif-meta button{background:none;border:0;padding:0;color:var(--link,#1d4ed8);cursor:pointer;font-size:11.5px}
.notif-empty{color:var(--muted,#525b68);font-size:13px;text-align:center;padding:18px 0}
html[data-theme="christmas"] #notif-panel{background:linear-gradient(var(--card),var(--card)) padding-box,linear-gradient(135deg,rgba(220,38,38,.55),rgba(251,191,36,.55) 50%,rgba(22,163,74,.55)) border-box;border:1px solid transparent}
