:root {
  --bg: #050b14;
  --panel: rgba(12, 24, 42, .92);
  --panel-2: rgba(17, 34, 59, .88);
  --line: rgba(137, 181, 255, .18);
  --line-strong: rgba(137, 181, 255, .34);
  --text: #edf5ff;
  --muted: #94a9c7;
  --blue: #4ca3ff;
  --blue-2: #76c8ff;
  --green: #42d392;
  --yellow: #f1c75b;
  --red: #ff6d7b;
  --shadow: 0 28px 90px rgba(0, 0, 0, .48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: radial-gradient(circle at 18% 10%, #102743 0, transparent 34%), linear-gradient(145deg, #040910, #08111e 58%, #050b14); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue-2); }
.ambient { position: fixed; border-radius: 999px; filter: blur(90px); pointer-events: none; opacity: .18; }
.ambient-one { width: 420px; height: 420px; background: #1478ff; top: -180px; right: 5vw; }
.ambient-two { width: 360px; height: 360px; background: #00d09c; bottom: -210px; left: 4vw; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr); align-items: stretch; }
.auth-hero { padding: clamp(48px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; max-width: 900px; }
.logo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 42px; }
.logo-row img { width: 68px; height: 68px; filter: drop-shadow(0 12px 32px rgba(76, 163, 255, .28)); }
.brand-title { font-size: 30px; font-weight: 800; letter-spacing: .04em; }
.brand-kicker { color: var(--blue-2); text-transform: uppercase; letter-spacing: .2em; font-size: 12px; font-weight: 800; }
.auth-hero h1 { margin: 0; font-size: clamp(44px, 6vw, 78px); line-height: .98; max-width: 760px; }
.auth-hero p { color: var(--muted); font-size: 18px; line-height: 1.7; max-width: 650px; }
.feature-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pill { border: 1px solid var(--line); background: rgba(13, 32, 55, .65); border-radius: 999px; padding: 9px 13px; color: #bad2f2; font-size: 13px; }
.auth-panel-wrap { padding: 32px; display: grid; place-items: center; background: rgba(2, 7, 13, .28); border-left: 1px solid var(--line); }
.card { width: min(100%, 520px); border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); border-radius: 26px; padding: 30px; backdrop-filter: blur(18px); }
.card h2 { margin: 0 0 8px; font-size: 29px; }
.card .intro { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #07111f; border: 1px solid var(--line); border-radius: 14px; padding: 5px; margin-bottom: 22px; }
.tab { border: 0; border-radius: 10px; background: transparent; color: var(--muted); padding: 10px; font-weight: 700; }
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.field { display: grid; gap: 8px; margin: 15px 0; }
.field label { color: #c8d8ee; font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; color: var(--text); background: #07111f; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; transition: .15s ease; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(76, 163, 255, .12); }
.field small { color: var(--muted); line-height: 1.4; }
.btn { border: 1px solid transparent; border-radius: 12px; padding: 12px 16px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { color: #03101e; background: linear-gradient(135deg, #79c7ff, #4c9dff); box-shadow: 0 14px 32px rgba(58, 147, 255, .22); }
.btn-secondary { color: var(--text); background: #12243d; border-color: var(--line); }
.btn-danger { color: #ffdce0; background: rgba(139, 29, 46, .38); border-color: rgba(255, 109, 123, .35); }
.btn-ghost { color: var(--blue-2); background: transparent; padding-inline: 4px; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.auth-links button { border: 0; background: none; color: var(--blue-2); padding: 0; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--blue); background: rgba(19, 44, 74, .6); border-radius: 12px; padding: 14px; color: #cfe2fb; line-height: 1.5; margin: 16px 0; }
.notice.success { border-left-color: var(--green); }
.notice.warn { border-left-color: var(--yellow); }
.notice.danger { border-left-color: var(--red); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { border-right: 1px solid var(--line); background: rgba(5, 13, 24, .91); padding: 24px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.sidebar-brand img { width: 46px; height: 46px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-btn { border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 12px; padding: 12px 13px; text-align: left; font-weight: 700; }
.nav-btn:hover, .nav-btn.active { color: var(--text); background: #102038; border-color: var(--line); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 18px 8px 4px; }
.sidebar-footer strong, .sidebar-footer span { display: block; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.content { padding: 34px clamp(24px, 4vw, 58px) 70px; max-width: 1700px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: 36px; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.panel h3 { margin: 0 0 8px; }
.panel p { color: var(--muted); line-height: 1.5; }
.stat { font-size: 34px; font-weight: 850; margin-top: 8px; }
.stat-label { color: var(--muted); font-size: 13px; }
.community-card { display: flex; flex-direction: column; min-height: 220px; }
.community-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(145deg, #173967, #0d2340); border: 1px solid var(--line-strong); font-size: 21px; font-weight: 900; }
.community-card .actions { margin-top: auto; }
.badge { display: inline-flex; align-items: center; width: fit-content; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #bcd2ef; }
.badge.green { color: #9bf0c8; border-color: rgba(66, 211, 146, .3); background: rgba(25, 101, 72, .23); }
.badge.yellow { color: #ffe4a0; border-color: rgba(241, 199, 91, .3); background: rgba(114, 81, 13, .2); }
.badge.red { color: #ffb0b9; border-color: rgba(255, 109, 123, .3); background: rgba(139, 29, 46, .2); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input { flex: 1; min-width: 220px; color: var(--text); background: #07111f; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #bdd0ea; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; background: #0b192b; }
td { color: #dfeafa; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.empty { border: 1px dashed var(--line-strong); border-radius: 18px; padding: 36px; text-align: center; color: var(--muted); }
.code-box { background: #030a12; border: 1px solid var(--line); border-radius: 12px; padding: 13px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; color: #b9dcff; }
.recovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recovery-code { background: #07111f; border: 1px solid var(--line); border-radius: 9px; padding: 9px; text-align: center; font-family: ui-monospace, monospace; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: grid; place-items: center; padding: 24px; z-index: 20; }
.modal { width: min(100%, 520px); background: #0b1728; border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 420px; background: #11243d; border: 1px solid var(--line-strong); box-shadow: var(--shadow); padding: 13px 16px; border-radius: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255, 109, 123, .5); }
.mobile-menu { display: none; }
@media (max-width: 1000px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel-wrap { min-height: 100vh; border-left: 0; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar-footer { display: none; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .auth-panel-wrap { padding: 14px; }
  .card { padding: 22px; border-radius: 20px; }
  .content { padding: 24px 16px 54px; }
  .page-head { flex-direction: column; }
  .page-head h1 { font-size: 30px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .sidebar nav { grid-template-columns: 1fr 1fr; }
  .recovery-grid { grid-template-columns: 1fr; }
}
.terminal { min-height: 170px; max-height: 520px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: #020810; border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: #c7dcf5; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.panel textarea { width: 100%; color: var(--text); background: #07111f; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; resize: vertical; }
.suspension-modal { text-align: center; }
.suspension-icon { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; font-weight: 900; color: #ffd9de; background: rgba(139,29,46,.55); border: 1px solid rgba(255,109,123,.55); }
.suspension-modal p { color: var(--muted); line-height: 1.6; }
@media (min-width: 900px) { .modal:has(#join-code-form), .modal:has(#community-form) { width: min(100%, 680px); } }

/* A12E operations command center */
.operations-command-bar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  backdrop-filter: blur(12px);
}
.operations-command-bar p { margin: 6px 0 0; color: var(--muted); }
.operations-command-bar .actions { margin-top: 0; justify-content: flex-end; }
.btn-prominent { min-height: 44px; padding-inline: 20px; font-weight: 800; }
.check-field { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.check-field input { width: auto; }
@media (max-width: 900px) {
  .operations-command-bar { position: static; flex-direction: column; align-items: stretch; }
  .operations-command-bar .actions { justify-content: flex-start; }
}


/* A12E3 Hotfix 9: Platform Operations scroll performance mode.
   Firefox was spending too much time repainting sticky/backdrop/blur/shadow layers while scrolling. */
body.operations-fast {
  background: #050b14;
}
body.operations-fast .ambient {
  display: none !important;
}
body.operations-fast .content {
  max-width: 1600px;
  padding-top: 24px;
}
body.operations-fast .operations-command-bar {
  position: static;
  top: auto;
  z-index: auto;
  background: #0c182a;
  border-color: var(--line);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.operations-fast .panel,
body.operations-fast .card,
body.operations-fast .modal,
body.operations-fast .toast,
body.operations-fast .btn-primary {
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.operations-fast .panel,
body.operations-fast .community-card,
body.operations-fast .table-wrap,
body.operations-fast .terminal {
  contain: layout paint style;
}
body.operations-fast .community-card {
  min-height: 190px;
}
@supports (content-visibility: auto) {
  body.operations-fast .panel,
  body.operations-fast .community-card {
    content-visibility: auto;
    contain-intrinsic-size: 260px;
  }
}
body.operations-fast .btn,
body.operations-fast .field input,
body.operations-fast .field select,
body.operations-fast .field textarea,
body.operations-fast .toast {
  transition: none !important;
}
body.operations-fast .table-wrap,
body.operations-fast .terminal {
  scrollbar-gutter: stable both-edges;
}
