@import url("https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg: #0b111b;
  --bg-alt: #0f1826;
  --ink: #e6edf3;
  --muted: #9aa4b2;
  --accent: #1f8c7b;
  --accent-2: #c9862b;
  --line: #1f2a3a;
  --card: #0f1724;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --display: "Rajdhani", "Space Grotesk", sans-serif;
}

body[data-theme="light"] {
  --bg: #f3efe9;
  --bg-alt: #fbf8f3;
  --ink: #1b1f24;
  --muted: #5e6673;
  --accent: #0f766e;
  --accent-2: #c9762e;
  --line: #e4dfd7;
  --card: #ffffff;
  --shadow: 0 14px 40px rgba(21, 24, 28, 0.12);
  background:
    radial-gradient(circle at 15% 10%, #f7f0e1 0, transparent 48%),
    radial-gradient(circle at 85% 15%, #e3f2ef 0, transparent 42%),
    linear-gradient(180deg, #f7f2ea 0%, #efe9e1 100%);
}

body[data-theme="dark"] {
  --bg: #050608;
  --bg-alt: #0b1118;
  --ink: #e5e7eb;
  --muted: #9aa3b2;
  --accent: #64748b;
  --accent-2: #94a3b8;
  --line: #1b2330;
  --card: #0a0f15;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
  background:
    radial-gradient(circle at 20% 20%, rgba(148, 163, 184, 0.08) 0, transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(30, 41, 59, 0.25) 0, transparent 45%),
    linear-gradient(180deg, #050608 0%, #0a0f15 100%);
}

body[data-theme="futuristic"] {
  --bg: #040913;
  --bg-alt: #0a1524;
  --ink: #eaf7ff;
  --muted: #92a6bd;
  --accent: #19e6d2;
  --accent-2: #66d9ff;
  --line: #1b2b43;
  --card: rgba(10, 18, 32, 0.88);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  background:
    radial-gradient(circle at 18% 10%, rgba(25, 230, 210, 0.25) 0, transparent 45%),
    radial-gradient(circle at 82% 18%, rgba(102, 217, 255, 0.2) 0, transparent 40%),
    linear-gradient(180deg, #040913 0%, #091221 100%);
}

body[data-theme="eden"] {
  --bg: #07090d;
  --bg-alt: #0f131a;
  --ink: #f5f1e8;
  --muted: #a3aab5;
  --accent: #d6a14a;
  --accent-2: #6aa5ff;
  --line: #242a33;
  --card: #0c1016;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  background:
    radial-gradient(circle at 15% 8%, rgba(214, 161, 74, 0.18) 0, transparent 46%),
    radial-gradient(circle at 80% 12%, rgba(106, 165, 255, 0.12) 0, transparent 42%),
    radial-gradient(circle at 30% 85%, rgba(11, 16, 23, 0.9) 0, transparent 55%),
    linear-gradient(180deg, #06080c 0%, #0b1017 100%);
}

body[data-theme="hangar"] {
  --bg: #0b0f13;
  --bg-alt: #121923;
  --ink: #f1f5f9;
  --muted: #97a3b5;
  --accent: #f1a23b;
  --accent-2: #57c9ff;
  --line: #1f2732;
  --card: rgba(12, 18, 28, 0.9);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  background:
    radial-gradient(circle at 18% 10%, rgba(241, 162, 59, 0.2) 0, transparent 40%),
    radial-gradient(circle at 75% 15%, rgba(87, 201, 255, 0.15) 0, transparent 38%),
    linear-gradient(180deg, rgba(6, 9, 13, 0.75) 0%, rgba(10, 15, 22, 0.85) 100%),
    url("/static/hangar.jpg") center 22%/cover no-repeat fixed;
}

body[data-theme="orbit"] {
  --bg: #070b14;
  --bg-alt: #0c1320;
  --ink: #f8f7f3;
  --muted: #b0b6c3;
  --accent: #f3c969;
  --accent-2: #6fa7ff;
  --line: #222a3b;
  --card: #0b101a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  --orbit-nav-height: 58px;
  --orbit-footer-height: 40px;
  background:
    radial-gradient(circle at 12% 10%, rgba(243, 201, 105, 0.2) 0, transparent 45%),
    radial-gradient(circle at 82% 12%, rgba(111, 167, 255, 0.18) 0, transparent 45%),
    linear-gradient(180deg, #070b14 0%, #0c1320 100%);
}

body[data-theme="matrix"],
body[data-theme="matrix-rain"] {
  --bg: #0a0c0f;
  --bg-alt: #0f1216;
  --ink: #e2f5e9;
  --muted: #98a7a0;
  --accent: #9fe870;
  --accent-2: #f59e0b;
  --line: #1f2a22;
  --card: #0c1115;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.6);
  --display: "IBM Plex Mono", "Courier New", monospace;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #0a0c0f 0%, #0d1117 100%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}

body[data-theme="matrix-rain"] {
  --accent: #b5ff7d;
}

body[data-theme="nebula"] {
  --bg: #120a1b;
  --bg-alt: #1b1026;
  --ink: #f6f1ff;
  --muted: #b8aacd;
  --accent: #a855f7;
  --accent-2: #f472b6;
  --line: rgba(168, 85, 247, 0.25);
  --card: rgba(20, 14, 30, 0.75);
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(circle at 18% 12%, rgba(168, 85, 247, 0.35) 0, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(244, 114, 182, 0.2) 0, transparent 48%),
    radial-gradient(circle at 30% 80%, rgba(94, 234, 212, 0.12) 0, transparent 45%),
    linear-gradient(180deg, #100818 0%, #1a0f26 100%);
}

body[data-theme="forge"] {
  --bg: #0d0b0a;
  --bg-alt: #16110e;
  --ink: #f8f1ea;
  --muted: #b5a59a;
  --accent: #f97316;
  --accent-2: #facc15;
  --line: #3b2e27;
  --card: #15100d;
  --shadow: none;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 4px, transparent 4px 12px),
    linear-gradient(180deg, #0d0b0a 0%, #13100d 100%);
}

body[data-theme="abyss"] {
  --bg: #05070e;
  --bg-alt: #0b1220;
  --ink: #e9f1ff;
  --muted: #8fa0ba;
  --accent: #4cc9ff;
  --accent-2: #f59e0b;
  --line: rgba(76, 201, 255, 0.2);
  --card: rgba(6, 10, 18, 0.75);
  --shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(circle at 18% 12%, rgba(76, 201, 255, 0.18) 0, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.12) 0, transparent 38%),
    linear-gradient(180deg, rgba(6, 9, 14, 0.88) 0%, rgba(7, 10, 16, 0.95) 100%),
    url("/static/abyss.jpg") center/cover no-repeat fixed;
}

body[data-theme="citadel"] {
  --bg: #0c0b0b;
  --bg-alt: #15110f;
  --ink: #f8f1ea;
  --muted: #a99a8e;
  --accent: #f97316;
  --accent-2: #38bdf8;
  --line: rgba(249, 115, 22, 0.25);
  --card: rgba(18, 14, 12, 0.92);
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
  background:
    linear-gradient(180deg, rgba(9, 7, 7, 0.92) 0%, rgba(13, 10, 9, 0.95) 100%),
    url("/static/citadel.jpg") center/cover no-repeat fixed;
}

body[data-theme="zenith"] {
  --bg: #060b16;
  --bg-alt: #0d1322;
  --ink: #f8fbff;
  --muted: #a5b1c6;
  --accent: #66d9ff;
  --accent-2: #f3c969;
  --line: rgba(102, 217, 255, 0.25);
  --card: rgba(9, 14, 24, 0.72);
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(circle at 20% 12%, rgba(102, 217, 255, 0.18) 0, transparent 45%),
    radial-gradient(circle at 78% 8%, rgba(243, 201, 105, 0.15) 0, transparent 45%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.8) 0%, rgba(10, 15, 26, 0.92) 100%),
    url("/static/zenith.jpg") center/cover no-repeat fixed;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--display);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(30, 110, 140, 0.25) 0, transparent 45%),
    radial-gradient(circle at 80% 5%, rgba(200, 134, 43, 0.25) 0, transparent 35%),
    radial-gradient(circle at 10% 90%, rgba(26, 33, 46, 0.8) 0, transparent 55%),
    linear-gradient(180deg, #070b12 0%, #0b111b 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 70px;
  overflow-x: hidden;
}

body > main {
  flex: 1 0 auto;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.45rem 1.2rem 0.6rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: start;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.35);
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.98rem;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.corp-title {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  justify-self: center;
}

.header-spacer {
  justify-self: end;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.nav-right {
  margin-left: auto;
  justify-content: flex-end;
}

.theme-switch {
  position: relative;
}

.theme-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 20;
}

.theme-switch.open .theme-menu {
  display: block;
}

.theme-option {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
}

.theme-option:hover {
  background: var(--bg-alt);
  border-color: var(--line);
}

.theme-option.active {
  border-color: var(--accent);
  color: var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #0b1224;
  color: #e5e7eb;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--display);
}

.pill:hover {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.pill.player {
  border-color: #3b82f6;
  color: #cfe3ff;
}

.pill.fc {
  border-color: #f59e0b;
  color: #fcd34d;
}

.pill.admin {
  border-color: #ef4444;
  color: #fecdd3;
}

.pill.meta {
  border-color: #334155;
  color: #9ca3af;
}

.main-wrapper {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

body.page-sim .main-wrapper {
  max-width: 100%;
  width: 100%;
  padding: 1rem;
}

body.page-sim .card {
  padding: 16px;
}

.profile-banner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.4);
  object-fit: cover;
}

.profile-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.profile-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-meta.small {
  font-size: 0.75rem;
}

.header-center {
  text-align: center;
}

.center-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.company-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.header-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.nav-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-right a,
.header-right .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.18s ease;
  cursor: pointer;
  font-family: var(--display);
}

.header-right a:hover,
.header-right .nav-link:hover {
  color: #ffffff;
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
}

.nav a {
  padding: 6px 8px;
  border-radius: 8px;
}

.nav a:hover {
  background: var(--bg-alt);
}

.subnav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 24px;
}

.subnav a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 0.85rem;
}

.subnav a:hover {
  background: var(--card);
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--ink);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
}

.avatar-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  padding: 6px 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.btn.secondary {
  background: var(--accent-2);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 20px;
  gap: 18px;
}

.page-filters {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 18px;
}

.filter-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-form input[type="text"] {
  min-width: 220px;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

p {
  margin: 0;
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 36px 0 40px;
}

.hero-card {
  padding: 32px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.panel-card {
  padding: 22px;
  border-radius: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

.panel-card.accent {
  background: rgba(201, 134, 43, 0.12);
  border-color: rgba(201, 134, 43, 0.4);
}

.panel-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid .span-all {
  grid-column: 1 / -1;
}

.fleet-grid {
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 22px;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  justify-content: start;
}

.admin-grid .admin-webhooks {
  grid-column: 1 / -1;
}

.admin-grid .admin-compact {
  padding: 18px;
}

.admin-grid .admin-compact .btn {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

details.fleet-group {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

details.fleet-group:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

details.fleet-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
}

details.fleet-group summary::-webkit-details-marker {
  display: none;
}

.card-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-head .card-title {
  margin-bottom: 0;
}

.card-title-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.card-title-row.spread {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
}

.section-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-section {
  display: grid;
  gap: 12px;
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 125%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  background: #1f2937;
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  line-height: 1.35;
  width: 260px;
  box-shadow: var(--shadow);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.small {
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 140, 123, 0.2);
  font-size: 0.8rem;
}

.badge.live {
  background: rgba(31, 140, 123, 0.35);
  color: var(--ink);
}

.chip {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(15, 24, 38, 0.8);
  font-size: 0.8rem;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.fit-tree {
  display: grid;
  gap: 16px;
}

.fit-group,
.fit-type {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(15, 23, 36, 0.65);
}

.fit-group summary,
.fit-type summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
}

.fit-type {
  margin-top: 10px;
  background: rgba(9, 16, 28, 0.7);
}

.fit-type .list {
  margin-top: 10px;
}

.fit-tree .list li {
  display: block;
}

.table-wrap {
  overflow-x: auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.page-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.page-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.table tr.row-link:hover td {
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .table tr.row-link:hover td {
  background: rgba(0, 0, 0, 0.04);
}

.member-table td,
.member-table th {
  vertical-align: top;
}

.member-detail td {
  background: rgba(9, 16, 28, 0.55);
}

.member-detail-box {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.member-fit-list {
  display: grid;
  gap: 8px;
}

.member-fit-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.member-fit-name {
  font-weight: 600;
}

.fit-status {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(148, 163, 184, 0.2);
  color: var(--ink);
}

.fit-status.ok {
  background: rgba(31, 140, 123, 0.3);
}

.fit-status.missing {
  background: rgba(200, 82, 67, 0.3);
}

.fit-status.pending {
  background: rgba(201, 134, 43, 0.3);
}

.fit-status.warn {
  background: rgba(96, 165, 250, 0.3);
}

.member-fit-detail {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--muted);
}

.btn-mini {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.table-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 24, 38, 0.65);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.table-link:hover {
  border-color: rgba(114, 179, 255, 0.7);
  background: rgba(114, 179, 255, 0.12);
}

body[data-theme="matrix"] .table-link,
body[data-theme="matrix-rain"] .table-link {
  border-color: rgba(159, 232, 112, 0.35);
  background: rgba(10, 15, 18, 0.7);
}

body[data-theme="matrix"] .table-link:hover,
body[data-theme="matrix-rain"] .table-link:hover {
  border-color: rgba(159, 232, 112, 0.7);
  background: rgba(159, 232, 112, 0.14);
}

.perm-table th,
.perm-table td {
  vertical-align: top;
}

.perm-group td {
  background: var(--bg-alt);
  font-weight: 600;
}

.perm-key {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.perm-cell {
  text-align: center;
}

.perm-check {
  display: flex;
  justify-content: center;
}

.form {
  display: grid;
  gap: 12px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

input, select, textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-family: var(--display);
  background: var(--bg-alt);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-field input {
  flex: 1;
  min-width: 0;
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.kv {
  display: grid;
  gap: 8px;
}

.kv div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.kv .kv-total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-weight: 600;
}

.code {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--bg-alt);
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  white-space: pre-wrap;
}

.debug-frame .code {
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
}

.motd-preview {
  max-height: 140px;
  overflow: auto;
  white-space: pre;
}

.motd-fit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.motd-preview-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 0.85rem;
  cursor: default;
  z-index: 40;
}

/* Preview popup now opens in a modal. */

.motd-render {
  background: var(--bg-alt);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.motd-render a {
  color: var(--accent);
  text-decoration: underline;
}

.fleet-description {
  white-space: pre-wrap;
}

.motd-table {
  table-layout: fixed;
  min-width: 1200px;
}

.motd-table-card {
  width: min(1650px, 99vw);
  margin-left: auto;
  margin-right: auto;
}

.motd-table-card .table-wrap {
  overflow-x: visible;
}

.page-wide .main-wrapper {
  max-width: 1750px;
}

.motd-modal {
  width: min(1200px, 96vw);
}

.motd-modal-body .motd-render {
  background: transparent;
  border: none;
  padding: 0;
}

.motd-table th,
.motd-table td {
  vertical-align: top;
}

.motd-col-name {
  width: 18%;
}

.motd-col-preview {
  width: 58%;
}

.motd-col-owner {
  width: 14%;
}

.motd-col-actions {
  width: 10%;
}

.motd-name,
.motd-owner,
.motd-actions {
  white-space: nowrap;
}

.sim-wrap {
  width: 100%;
  height: 90vh;
  min-height: 980px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b111b;
  overflow: hidden;
  --sim-scale: 1;
}

.sim-frame {
  width: calc(100% / var(--sim-scale));
  height: calc(100% / var(--sim-scale));
  border: 0;
  transform: scale(var(--sim-scale));
  transform-origin: top left;
}

.sim-wrap:fullscreen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  border: 0;
  --sim-scale: 1;
}

.mt {
  margin-top: 12px;
}

.mb {
  margin-bottom: 12px;
}

.alert {
  background: #fee2e2;
  border: 1px solid #f87171;
  color: #111827;
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #1f2937;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  max-width: 320px;
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: 14px;
  width: min(520px, 92vw);
  padding: 16px;
  box-shadow: var(--shadow);
}

.modal-fit {
  width: min(1120px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}

.modal-scroll {
  overflow: auto;
  max-height: 72vh;
  padding-right: 8px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-title {
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.modal-body {
  white-space: pre-wrap;
  background: var(--bg-alt);
  border-radius: 10px;
  padding: 10px;
  border: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.fit-summary {
  display: grid;
  gap: 6px;
}

.fit-select {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(9, 16, 28, 0.55);
}

.fit-select .card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.fit-select-row {
  align-items: flex-start;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}

.fit-select-row input {
  margin-top: 2px;
}

.fit-choice-list {
  display: grid;
  gap: 0.6rem;
}

.fit-choice-row {
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}

.fit-choice-row input {
  margin-top: 4px;
}

.builder-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.builder-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.builder-card .card-title {
  margin: 0;
  font-size: 0.95rem;
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.45rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #94a3b8;
  border-top: 1px solid #1f2937;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.footer-cell {
  white-space: nowrap;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-cell.center {
  justify-content: center;
}

.footer-cell.version {
  justify-content: flex-end;
  text-align: right;
  color: #cbd5e1;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
}

.footer-logo img {
  height: 22px;
  width: auto;
  display: block;
  margin: 0;
  vertical-align: middle;
}

.site-footer a {
  color: #8ab4ff;
}

.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 999;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  transition: width 0.3s ease;
}

body[data-theme="hangar"] .site-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 260px;
  padding: 1.2rem;
  border-right: 1px solid var(--line);
  border-bottom: none;
  overflow-y: auto;
}

body[data-theme="hangar"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(115deg, rgba(12, 19, 27, 0.9) 0%, rgba(8, 12, 18, 0.85) 50%, rgba(20, 26, 36, 0.9) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 80px);
  opacity: 0.32;
  mix-blend-mode: soft-light;
}

body[data-theme="hangar"] .site-header {
  z-index: 12;
}

body[data-theme="hangar"] .main-wrapper,
body[data-theme="hangar"] .site-footer {
  position: relative;
  z-index: 2;
}

body[data-theme="hangar"] .site-footer {
  position: fixed;
  left: 260px;
  right: 0;
  bottom: 0;
  z-index: 11;
  margin-left: 0;
}

body[data-theme="hangar"] .header-top {
  grid-template-columns: 1fr;
  justify-items: start;
  gap: 0.4rem;
}

body[data-theme="hangar"] .corp-title {
  text-align: left;
  justify-self: start;
}

body[data-theme="hangar"] .header-spacer {
  display: none;
}

body[data-theme="hangar"] .nav-links {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

body[data-theme="hangar"] .nav-group {
  flex-direction: column;
  align-items: stretch;
}

body[data-theme="hangar"] .nav-group .pill {
  width: 100%;
  justify-content: space-between;
}

body[data-theme="hangar"] .main-wrapper {
  margin-left: 260px;
}

body[data-theme="hangar"] .pill,
body[data-theme="hangar"] .btn,
body[data-theme="hangar"] .card,
body[data-theme="hangar"] input,
body[data-theme="hangar"] select,
body[data-theme="hangar"] textarea {
  border-radius: 4px;
}

body[data-theme="orbit"] .nav-links {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.35rem 0.9rem;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: none;
  box-shadow: var(--shadow);
  z-index: 20;
  min-height: var(--orbit-nav-height);
}

body[data-theme="orbit"] .main-wrapper {
  padding-bottom: calc(var(--orbit-nav-height) + var(--orbit-footer-height) + 24px);
}

body[data-theme="orbit"] .site-footer {
  bottom: var(--orbit-nav-height);
  min-height: var(--orbit-footer-height);
  align-items: center;
  padding: 0.25rem 0.9rem;
  font-size: 0.78rem;
}

body[data-theme="orbit"] .pill,
body[data-theme="orbit"] .btn,
body[data-theme="orbit"] .card,
body[data-theme="orbit"] input,
body[data-theme="orbit"] select,
body[data-theme="orbit"] textarea {
  border-radius: 14px;
  border: 1px solid var(--line);
}

body[data-theme="orbit"] .pill {
  background: transparent;
}

body[data-theme="orbit"] .pill:hover,
body[data-theme="orbit"] .btn:hover {
  background: var(--bg-alt);
}

body[data-theme="matrix"] .pill,
body[data-theme="matrix"] .btn,
body[data-theme="matrix"] .card,
body[data-theme="matrix"] input,
body[data-theme="matrix"] select,
body[data-theme="matrix"] textarea,
body[data-theme="matrix-rain"] .pill,
body[data-theme="matrix-rain"] .btn,
body[data-theme="matrix-rain"] .card,
body[data-theme="matrix-rain"] input,
body[data-theme="matrix-rain"] select,
body[data-theme="matrix-rain"] textarea {
  border-radius: 0;
  border: 1px solid var(--line);
}

body[data-theme="matrix"] .pill,
body[data-theme="matrix"] .btn,
body[data-theme="matrix-rain"] .pill,
body[data-theme="matrix-rain"] .btn {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

body[data-theme="matrix"] .nav-links,
body[data-theme="matrix-rain"] .nav-links {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

body[data-theme="matrix"] .brand-icon,
body[data-theme="matrix-rain"] .brand-icon {
  border-radius: 0;
}

.matrix-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}

body[data-theme="matrix-rain"]::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(transparent 0%, rgba(5, 8, 10, 0.35) 40%, transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: screen;
  animation: matrix-scan 18s linear infinite;
  opacity: 0.35;
}

body[data-theme="matrix-rain"] .site-header,
body[data-theme="matrix-rain"] .main-wrapper {
  position: relative;
  z-index: 2;
}

body[data-theme="matrix-rain"] .site-footer {
  z-index: 2;
}

body[data-theme="futuristic"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(120deg, rgba(25, 230, 210, 0.08) 0%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 140px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 90px);
  mix-blend-mode: screen;
  animation: futurist-drift 24s ease-in-out infinite;
  opacity: 0.4;
}

body[data-theme="futuristic"]::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 25% 25%, rgba(102, 217, 255, 0.2) 0, transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(25, 230, 210, 0.15) 0, transparent 40%);
  animation: futurist-pulse 12s ease-in-out infinite;
  opacity: 0.35;
}

body[data-theme="futuristic"] .site-header,
body[data-theme="futuristic"] .main-wrapper {
  position: relative;
  z-index: 2;
}

body[data-theme="futuristic"] .site-footer {
  z-index: 2;
}

body[data-theme="futuristic"] .site-header {
  background: rgba(10, 18, 32, 0.78);
  border-bottom: 1px solid rgba(25, 230, 210, 0.25);
  backdrop-filter: blur(12px);
}

body[data-theme="futuristic"] .brand-icon {
  border-radius: 6px;
  clip-path: polygon(8% 0%, 100% 0%, 100% 70%, 92% 100%, 0% 100%, 0% 30%);
  background: linear-gradient(135deg, rgba(25, 230, 210, 0.9), rgba(102, 217, 255, 0.6));
  color: #0a111f;
}

body[data-theme="futuristic"] .nav-links {
  gap: 0.5rem;
}

body[data-theme="futuristic"] .pill,
body[data-theme="futuristic"] .btn,
body[data-theme="futuristic"] .card,
body[data-theme="futuristic"] input,
body[data-theme="futuristic"] select,
body[data-theme="futuristic"] textarea {
  border-radius: 6px;
}

body[data-theme="futuristic"] .pill,
body[data-theme="futuristic"] .btn {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

body[data-theme="futuristic"] .pill {
  background: rgba(10, 18, 32, 0.72);
  border: 1px solid rgba(25, 230, 210, 0.25);
}

body[data-theme="futuristic"] .pill.player {
  border-color: rgba(102, 217, 255, 0.3);
}

body[data-theme="futuristic"] .pill.fc {
  border-color: rgba(25, 230, 210, 0.4);
}

body[data-theme="futuristic"] .pill.admin {
  border-color: rgba(245, 158, 11, 0.35);
}

body[data-theme="futuristic"] .btn {
  background: linear-gradient(135deg, rgba(25, 230, 210, 0.9), rgba(102, 217, 255, 0.7));
  border: 1px solid rgba(25, 230, 210, 0.35);
  color: #04101a;
}

body[data-theme="futuristic"] .btn.secondary {
  background: linear-gradient(135deg, rgba(102, 217, 255, 0.85), rgba(25, 230, 210, 0.55));
}

body[data-theme="futuristic"] .btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(102, 217, 255, 0.3);
}

body[data-theme="futuristic"] .card {
  background: linear-gradient(135deg, rgba(12, 20, 36, 0.92), rgba(8, 14, 26, 0.88));
  border: 1px solid rgba(25, 230, 210, 0.22);
  box-shadow: 0 16px 40px rgba(6, 10, 18, 0.6);
}

body[data-theme="futuristic"] .card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(102, 217, 255, 0.2);
  border-radius: 6px;
  opacity: 0.6;
}

body[data-theme="futuristic"] .card {
  position: relative;
}

body[data-theme="futuristic"] .pill:hover,
body[data-theme="futuristic"] .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(25, 230, 210, 0.2);
}

body[data-theme="futuristic"] .input,
body[data-theme="futuristic"] input,
body[data-theme="futuristic"] select,
body[data-theme="futuristic"] textarea {
  background: rgba(6, 12, 22, 0.9);
  border: 1px solid rgba(102, 217, 255, 0.2);
}

body[data-theme="nebula"] .site-header {
  background: rgba(16, 10, 27, 0.85);
  border-bottom: 1px solid rgba(168, 85, 247, 0.3);
  backdrop-filter: blur(14px);
}

body[data-theme="nebula"] .card {
  backdrop-filter: blur(18px);
  border-color: rgba(168, 85, 247, 0.25);
  border-radius: 22px;
}

body[data-theme="nebula"] .pill,
body[data-theme="nebula"] .btn,
body[data-theme="nebula"] input,
body[data-theme="nebula"] select,
body[data-theme="nebula"] textarea {
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body[data-theme="nebula"] .pill:hover,
body[data-theme="nebula"] .btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 36px rgba(168, 85, 247, 0.25);
}

body[data-theme="forge"] .site-header {
  border-bottom: 2px solid var(--line);
}

body[data-theme="forge"] .card {
  border-radius: 2px;
  box-shadow: none;
}

body[data-theme="forge"] .pill,
body[data-theme="forge"] .btn {
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.74rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body[data-theme="forge"] .pill:hover,
body[data-theme="forge"] .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

body[data-theme="abyss"]::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 20% 20%, rgba(76, 201, 255, 0.15) 0, transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(245, 158, 11, 0.1) 0, transparent 35%);
  mix-blend-mode: screen;
  animation: abyss-drift 26s ease-in-out infinite;
  opacity: 0.35;
}

body[data-theme="abyss"] .site-header,
body[data-theme="abyss"] .main-wrapper {
  position: relative;
  z-index: 2;
}

body[data-theme="abyss"] .site-footer {
  z-index: 2;
}

body[data-theme="abyss"] .site-header {
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(10px);
}

body[data-theme="abyss"] .pill {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding-bottom: 6px;
}

body[data-theme="abyss"] .pill:hover {
  border-bottom-color: var(--accent);
}

body[data-theme="abyss"] .btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(76, 201, 255, 0.25);
}

body[data-theme="abyss"] .btn:hover {
  background: rgba(76, 201, 255, 0.12);
  transform: translateY(-2px);
}

body[data-theme="abyss"] .card {
  backdrop-filter: blur(12px);
  border-color: rgba(76, 201, 255, 0.18);
}

body[data-theme="citadel"] .site-header {
  background: rgba(18, 14, 12, 0.92);
  border-bottom: 2px solid rgba(249, 115, 22, 0.3);
}

body[data-theme="citadel"] .nav-links {
  gap: 0.4rem;
}

body[data-theme="citadel"] .pill,
body[data-theme="citadel"] .btn,
body[data-theme="citadel"] .card,
body[data-theme="citadel"] input,
body[data-theme="citadel"] select,
body[data-theme="citadel"] textarea {
  border-radius: 6px;
}

body[data-theme="citadel"] .pill {
  background: rgba(18, 14, 12, 0.8);
  border: 1px solid rgba(249, 115, 22, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

body[data-theme="citadel"] .btn {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.9), rgba(249, 115, 22, 0.65));
}

body[data-theme="citadel"] .btn.ghost {
  background: transparent;
  border-color: rgba(249, 115, 22, 0.35);
}

body[data-theme="citadel"] .card {
  border-color: rgba(249, 115, 22, 0.2);
}

body[data-theme="zenith"]::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 18%, rgba(102, 217, 255, 0.18) 0, transparent 45%),
    radial-gradient(circle at 82% 14%, rgba(243, 201, 105, 0.18) 0, transparent 45%);
  animation: zenith-glow 22s ease-in-out infinite;
  opacity: 0.4;
}

body[data-theme="zenith"] .site-header,
body[data-theme="zenith"] .main-wrapper {
  position: relative;
  z-index: 2;
}

body[data-theme="zenith"] .site-footer {
  z-index: 2;
}

body[data-theme="zenith"] .site-header {
  background: rgba(9, 14, 24, 0.68);
  backdrop-filter: blur(12px);
}

body[data-theme="zenith"] .pill,
body[data-theme="zenith"] .btn,
body[data-theme="zenith"] input,
body[data-theme="zenith"] select,
body[data-theme="zenith"] textarea {
  border-radius: 999px;
}

body[data-theme="zenith"] .card {
  border-radius: 24px;
  backdrop-filter: blur(10px);
}

body[data-theme="zenith"] .pill:hover,
body[data-theme="zenith"] .btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 18px 40px rgba(102, 217, 255, 0.2);
}

body[data-theme="hangar"] .pill,
body[data-theme="hangar"] .btn {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
}

body[data-theme="hangar"] .pill:hover,
body[data-theme="hangar"] .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body[data-theme="orbit"] .pill,
body[data-theme="orbit"] .btn,
body[data-theme="orbit"] .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body[data-theme="orbit"] .pill:hover,
body[data-theme="orbit"] .btn:hover,
body[data-theme="orbit"] .card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

body[data-theme="matrix"] .pill,
body[data-theme="matrix"] .btn {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

body[data-theme="matrix-rain"] .pill,
body[data-theme="matrix-rain"] .btn {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

body[data-theme="matrix"] .pill:hover,
body[data-theme="matrix"] .btn:hover,
body[data-theme="matrix-rain"] .pill:hover,
body[data-theme="matrix-rain"] .btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(159, 232, 112, 0.45), 0 0 18px rgba(159, 232, 112, 0.25);
}

@keyframes matrix-scan {
  0% {
    transform: translateY(-40%);
  }
  100% {
    transform: translateY(40%);
  }
}

@keyframes futurist-drift {
  0% {
    transform: translateY(-2%);
  }
  50% {
    transform: translateY(2%);
  }
  100% {
    transform: translateY(-2%);
  }
}

@keyframes futurist-pulse {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.45;
  }
  100% {
    opacity: 0.2;
  }
}

@keyframes abyss-drift {
  0% {
    transform: translateY(-3%) translateX(0%);
  }
  50% {
    transform: translateY(2%) translateX(-2%);
  }
  100% {
    transform: translateY(-3%) translateX(0%);
  }
}

@keyframes zenith-glow {
  0% {
    transform: translateY(-2%);
  }
  50% {
    transform: translateY(2%);
  }
  100% {
    transform: translateY(-2%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="matrix-rain"]::after,
  body[data-theme="abyss"]::after,
  body[data-theme="zenith"]::after,
  body[data-theme="futuristic"]::before,
  body[data-theme="futuristic"]::after {
    animation: none;
  }
}

@media (max-width: 980px) {
  body[data-theme="hangar"] .site-header {
    position: sticky;
    width: auto;
    height: auto;
    border-right: none;
  }

  body[data-theme="hangar"] .main-wrapper {
    margin-left: 0;
  }

  body[data-theme="hangar"] .site-footer {
    left: 0;
    right: 0;
    position: fixed;
  }

  body[data-theme="hangar"] .nav-links,
  body[data-theme="hangar"] .nav-group {
    flex-direction: row;
    flex-wrap: wrap;
  }

  body[data-theme="orbit"] .nav-links {
    position: static;
    box-shadow: none;
    border-top: 1px solid var(--line);
    min-height: 0;
    padding: 0.4rem 0.6rem;
  }

  body[data-theme="orbit"] .main-wrapper {
    padding-bottom: 0;
  }

  body[data-theme="orbit"] .site-footer {
    bottom: 0;
    min-height: 0;
    padding: 0.35rem 0.7rem;
  }
}

main.main-wrapper {
  flex: 1;
}

.stack {
  display: grid;
  gap: 18px;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
  }

  .header-top {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .header-spacer {
    display: none;
  }

  .corp-title {
    text-align: left;
    justify-self: start;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow-x: visible;
  }

  .nav-group {
    flex-wrap: wrap;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
  }

  .footer-cell,
  .footer-cell.version {
    justify-content: flex-start;
    text-align: left;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
