/* ============================================================
   JustinMC panel - theme (saturnspoofer.com restyle)
   Pure black, white glow accents, Jura type, grid backdrop.
   ============================================================ */

:root {
  --bg: #000000;
  --bg-glow-purple: rgba(255, 255, 255, 0.06);
  --bg-glow-blue: rgba(255, 255, 255, 0.035);

  --surface: #0a0a0b;
  --surface-2: #0f0f10;
  --surface-3: #151516;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.72);
  --text-mute: #9ca3af;
  --text-faint: #6b7280;

  --purple: #ffffff;
  --purple-grad: linear-gradient(180deg, #ffffff, #dcdcdc);
  --blue: #4a9eff;

  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;

  --radius: 9px;
  --radius-sm: 6px;
  --sidebar-w: 184px;
  --font: "Jura", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t: 150ms ease;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background:
    radial-gradient(700px 430px at 78% 16%, rgba(255, 255, 255, 0.05), transparent 65%),
    radial-gradient(820px 520px at 10% 74%, rgba(255, 255, 255, 0.035), transparent 68%),
    radial-gradient(430px 300px at 55% 40%, rgba(255, 255, 255, 0.028), transparent 70%),
    radial-gradient(140% 46% at 50% 122%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03) 45%, transparent 70%),
    radial-gradient(900px 500px at 18% -8%, var(--bg-glow-purple), transparent 62%),
    radial-gradient(900px 550px at 92% 108%, var(--bg-glow-blue), transparent 62%),
    var(--bg);
  background-size: auto, auto, auto, auto, auto, auto, auto;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

a.logout-chip { text-decoration: none; display: inline-flex; align-items: center; margin-right: 8px; }

.mono { font-family: var(--mono); }

/* ---------------- scrollbars ---------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.35); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 31px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  background: var(--surface-3);
  cursor: pointer;
  white-space: nowrap;
  transition: filter var(--t), background var(--t), border-color var(--t), opacity var(--t), transform var(--t), box-shadow var(--t);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn .ico { width: 13px; height: 13px; }
/* keyboard focus: crisp white ring (matches the pin-bar's focus language) */
.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset,
    0 0 18px -6px rgba(255, 255, 255, 0.5);
}

.btn-purple {
  background: var(--purple-grad);
  color: #000;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.28), 0 4px 0 rgba(160, 160, 160, 0.9);
}
.btn-purple:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 0 32px rgba(255, 255, 255, 0.4), 0 4px 0 rgba(170, 170, 170, 0.9); }
.btn-purple:active:not(:disabled) { transform: translateY(3px) scale(0.97); box-shadow: 0 0 16px rgba(255, 255, 255, 0.25); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.12);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: var(--text); border-color: rgba(255, 255, 255, 0.6); box-shadow: 0 0 25px rgba(255, 255, 255, 0.22); }

.btn-start {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
  color: #3ddc84;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}
.btn-start:hover:not(:disabled) { background: rgba(34, 197, 94, 0.2); box-shadow: 0 0 18px rgba(34, 197, 94, 0.3); }

.btn-stop {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
  color: #f87171;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}
.btn-stop:hover:not(:disabled) { background: rgba(239, 68, 68, 0.2); box-shadow: 0 0 18px rgba(239, 68, 68, 0.3); }

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}
.btn-danger-soft:hover:not(:disabled) { background: rgba(239, 68, 68, 0.2); }

.btn-xs { height: 25px; padding: 0 10px; font-size: 11px; }
.acc-toggle { min-width: 62px; }

/* ---------------- inputs ---------------- */
.input, .line-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  background: #0f0f10;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.input::placeholder, .line-input::placeholder { color: var(--text-faint); }
.input:focus, .line-input:focus {
  border-color: rgba(255,255,255, 0.55);
  box-shadow: 0 0 0 3px rgba(255,255,255, 0.14);
}
.input:disabled, .line-input:disabled { opacity: 0.45; cursor: not-allowed; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23807a95' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 26px;
}
.input[type="number"] { font-family: var(--mono); }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.field-port { flex: 0 0 96px; }
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-mute);
}
.field-hint {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-mute);
}

.ico {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  /* short viewports (landscape phones): scroll instead of clipping the card */
  overflow-y: auto;
  padding: 24px 16px;
  opacity: 1;
}

.login-card {
  position: relative;
  width: 344px;
  max-width: calc(100vw - 32px); /* never exceed the viewport on small phones */
  margin: auto; /* centers without top-clipping when the card is taller than the view */
  padding: 36px 30px 34px;
  background: rgba(11, 10, 17, 0.78); /* near-black translucent glass */
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 0 44px -22px rgba(255,255,255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06); /* faint inner top edge = glass depth */
  text-align: center;
  overflow: hidden;
}
/* initial page load: 14px low, 0.98 scale, 5px blur -> crisp (once per link) */
.login-card.is-entering { animation: cardIn 560ms cubic-bezier(0.16, 1, 0.3, 1) both; }
/* contents rise in a stagger behind the card itself - every child finishes
   by 540ms so the is-entering removal at 560ms never cuts one short */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-card.is-entering .login-logo { animation: riseIn 430ms cubic-bezier(0.16, 1, 0.3, 1) 0ms both; }
.login-card.is-entering .login-title { animation: riseIn 420ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both; }
.login-card.is-entering .login-sub { animation: riseIn 400ms cubic-bezier(0.16, 1, 0.3, 1) 115ms both; }
.login-card.is-entering .login-form-row { animation: riseIn 380ms cubic-bezier(0.16, 1, 0.3, 1) 160ms both; }
.login-card.is-entering .login-error { animation: riseIn 330ms cubic-bezier(0.16, 1, 0.3, 1) 210ms both; }
/* login -> dashboard: shrink + rise + blur out while the background holds */
.login-card.is-transitioning {
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  filter: blur(4px);
  transition:
    opacity 520ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 520ms cubic-bezier(0.4, 0, 0.2, 1),
    filter 520ms cubic-bezier(0.4, 0, 0.2, 1);
}
.login-glow {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 150px;
  background: radial-gradient(closest-side, rgba(255,255,255, 0.4), transparent);
  filter: blur(8px);
  pointer-events: none;
  animation: glowBreath 6.5s ease-in-out infinite; /* slow ambient breathing */
}
@keyframes glowBreath {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.07); }
}
/* barely-there radial highlight that follows the pointer inside the card */
.login-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 30%),
    rgba(255,255,255,0.07),
    transparent 35%
  );
}
.login-card:hover .login-sheen { opacity: 1; }
/* crystal: shrink-to-fit so the glow + success ring hug the diamond */
.login-logo {
  position: relative;
  display: inline-block;
  line-height: 0;
  margin-bottom: 16px;
  animation: crystalIdle 4s ease-in-out infinite;
}
.login-logo::before { /* soft purple glow behind the crystal, gentle pulse */
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255, 0.5), transparent 72%);
  filter: blur(6px);
  z-index: 0;
  animation: glowPulse 3.5s ease-in-out infinite;
}
.login-logo svg {
  position: relative;
  z-index: 1;
  display: block;
  background: transparent;
}
.login-logo::after { /* expanding light ring on the success pulse */
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255, 0.9);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}
.login-logo.is-hit svg { animation: crystalHit 420ms cubic-bezier(0.22, 1, 0.36, 1); }
.login-logo.is-hit::after { animation: ringOut 620ms ease-out both; }
.login-title {
  position: relative;
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ececef; /* fallback where background-clip:text is unsupported */
  background: linear-gradient(105deg, #ececef 38%, #ffffff 46%, #ffffff 50%, #ffffff 54%, #ececef 62%);
  background-size: 300% 100%;
  background-position: 135% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShine 6s ease-in-out 1.4s infinite; /* one slow glint, then a pause */
}
@keyframes titleShine {
  0% { background-position: 135% 0; }
  35% { background-position: -75% 0; }
  100% { background-position: -75% 0; }
}
/* success state (step 6): green check + "Access granted" over the form.
   The form pieces only hide (visibility), so the card never reflows. */
.login-success {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 54%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms;
  pointer-events: none;
}
.success-check { display: block; }
.success-text {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #4ade80;
  text-shadow: 0 0 14px rgba(74, 222, 128, 0.35);
}
.login-card.is-granted .login-success { opacity: 1; visibility: visible; }
.login-title,
.login-sub,
.login-form-row,
.login-error { transition: opacity 200ms ease, visibility 200ms; }
.login-card.is-granted .login-title,
.login-card.is-granted .login-sub,
.login-card.is-granted .login-form-row,
.login-card.is-granted .login-error {
  opacity: 0;
  visibility: hidden;
}
.login-sub {
  position: relative;
  margin: 0 0 22px;
  font-size: 11.5px;
  color: var(--text-mute);
}
.login-form-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
/* small uppercase field label above the bar (mockup: ACCESS CODE) */
.login-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8b8b90;
  margin-bottom: -4px; /* tighten label->field: 12px row gap reads as 8px */
}
/* ONE continuous PIN bar: single border, single background, six evenly
   spaced character positions inside - never six separate boxes. */
.pin-bar {
  position: relative;
  flex: none; /* full-width column child - never stretch vertically */
  width: 100%;
  min-width: 0;
  height: 40px;
  background: rgba(17, 16, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.pin-bar:focus-within {
  border-color: rgba(255,255,255, 0.72);
  box-shadow: 0 0 0 3px rgba(255,255,255, 0.15), 0 0 16px -6px rgba(255,255,255, 0.55);
  transform: translateY(-1px); /* focused bar lifts ~1px */
}
/* one soft light pass when the bar gains focus - its own keyframe name so
   Verify's scanAcross (defined later, same specificity) restarts cleanly */
.pin-bar:focus-within .pin-scan { animation: scanFocus 460ms ease-out both; }
@keyframes scanFocus {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(317%); opacity: 1; }
}
.pin-bar.filled { border-color: rgba(255,255,255, 0.55); }
.pin-bar.invalid {
  border-color: rgba(239, 68, 68, 0.8);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}
.pin-cells {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  /* right side reserved for the in-bar eye strip (46px + breathing room) */
  padding: 0 54px 0 8px;
  font-family: var(--mono);
  font-size: 16px;
  pointer-events: none;
}
.pin-cell {
  color: #55555a; /* muted gray/purple placeholders: 0 0 0 0 0 0 */
  transition: color 140ms ease;
}
.pin-cell.filled {
  color: var(--text);
  text-shadow: 0 0 10px rgba(255,255,255, 0.6);
  animation: cellPop 140ms ease-out;
}
.pin-cell.active { animation: caretBlink 1.1s ease-in-out infinite; }
.pin-scan { /* luminous sweep across the bar when Verify runs */
  position: absolute;
  top: 0;
  bottom: 0;
  left: -46%;
  z-index: 2;
  width: 46%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255, 0.16), rgba(255,255,255, 0.5), transparent);
}
/* the real input sits invisibly over the six positions (keys + paste) */
.pin-input {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  opacity: 0;
  font-size: 16px; /* stops iOS zoom-on-focus */
  cursor: text;
}
.pin-input:disabled { cursor: default; }
/* PIN visual states live on .pin-bar (focus/filled/invalid) and .pin-cells
   (per-digit pop + caret) - the raw input stays invisible above them. */

/* show/hide toggle INSIDE the pin bar: right-edge strip with a hairline
   divider; swaps eye <-> eye-off once the typed code shows */
.pin-eye {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 4; /* above the transparent input so the click lands on it */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  padding: 0;
  background: transparent; /* rides the bar's own surface */
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0;
  color: #8b8b90;
  cursor: pointer;
  transition: color var(--t), background-color var(--t);
}
.pin-eye:hover {
  color: #ffffff;
  background: rgba(255,255,255, 0.08);
}
.pin-eye:active svg { transform: scale(0.9); }
.pin-eye:focus-visible {
  outline: none;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255, 0.6);
}
.pin-eye svg { display: block; transition: transform var(--t); }
.pin-eye .eye-hide { display: none; }
.pin-eye.shown .eye-show { display: none; }
.pin-eye.shown .eye-hide { display: block; }

/* ---- login motion: one-shot entrances, idle crystal, verify states ---- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes cardShake { /* invalid PIN: tiny horizontal shake, 4-5px */
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-5px); }
  48% { transform: translateX(4px); }
  74% { transform: translateX(-3px); }
}
@keyframes cellPop { /* each typed digit: opacity 0->1, scale .9->1, 140ms */
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes caretBlink { /* very subtle glow on the next position */
  0%, 100% { color: #55555a; text-shadow: none; }
  50% { color: rgba(255,255,255, 0.85); text-shadow: 0 0 8px rgba(255,255,255, 0.5); }
}
@keyframes scanAcross { /* purple light travelling the PIN bar once */
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(317%); opacity: 1; }
}
@keyframes barGlow { /* border brightens while the scan passes */
  0% { border-color: rgba(255,255,255, 0.72); box-shadow: 0 0 0 3px rgba(255,255,255, 0.15); }
  35% { border-color: rgba(255,255,255, 0.98); box-shadow: 0 0 0 3px rgba(255,255,255, 0.3), 0 0 22px -4px rgba(255,255,255, 0.65); }
  100% { border-color: rgba(255,255,255, 0.85); box-shadow: 0 0 0 3px rgba(255,255,255, 0.2); }
}
@keyframes crystalIdle { /* -4px float + 3deg rock, 4s, forever */
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
@keyframes crystalHit { /* success pulse: scale ~1.16 + one flash */
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.16); filter: brightness(1.9); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes ringOut { /* thin ring expands from the crystal and fades */
  0% { opacity: 0.9; transform: scale(0.55); }
  100% { opacity: 0; transform: scale(2.1); }
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ---- verify state: one scan across the bar + button loading ring ---- */
.login-card.is-verifying .pin-scan { animation: scanAcross 420ms ease-out 50ms both; }
.login-card.is-verifying .pin-bar { animation: barGlow 460ms ease-out; }
.verify-label { position: relative; z-index: 1; transition: opacity 240ms ease; }
.verify-ring {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: btnSpin 700ms linear infinite;
  animation-play-state: paused;
}
.login-card.is-verifying .verify-label { opacity: 0; }
.login-card.is-verifying .verify-ring { opacity: 1; animation-play-state: running; }

/* ---- invalid PIN: tiny card shake (the bar turns muted red) ---- */
.login-card.is-error { animation: cardShake 300ms ease; }
/* the digits that were entered flash red with the shake */
.login-card.is-error .pin-cell.filled { animation: cellErr 320ms ease; }
@keyframes cellErr {
  0%, 100% { color: var(--text); text-shadow: 0 0 10px rgba(255,255,255, 0.6); }
  40% { color: #f87171; text-shadow: 0 0 12px rgba(239, 68, 68, 0.8); }
}

/* ---- energy trail: thin purple path + travelling light, PIN -> crystal ---- */
.login-energy {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.energy-line {
  fill: none;
  stroke: rgba(255,255,255, 0.9);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(255,255,255, 0.9));
  opacity: 0;
}
.energy-dot { fill: #f5f5f5; filter: drop-shadow(0 0 6px rgba(255,255,255, 0.95)); }
.energy-spark { fill: rgba(255,255,255, 0.8); }

/* ---- verify button: purple gradient, 1px hover lift, 0.98 press ---- */
.login-verify {
  position: relative;
  width: 100%; /* full-width column child under the PIN bar */
  height: 40px;
  padding: 0 22px;
  border-radius: 10px;
  overflow: hidden;
}
/* light sweep crossing the button once per hover */
.login-verify::before {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -70%;
  width: 46%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-16deg);
  transition: left 620ms ease;
  pointer-events: none;
}
.login-verify:hover:not(:disabled)::before { left: 125%; }
.login-verify:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.login-verify:active:not(:disabled) { transform: scale(0.98); }
.login-error {
  position: relative;
  margin: 12px 0 0;
  font-size: 11.5px;
  color: #f87171; /* muted red */
}

/* ---- post-login welcome: the faded-out card hands the starfield to this.
   Lines rise + unblur in; a beat later the second line follows. ---- */
.welcome-msg {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  opacity: 1;
  transition: opacity 260ms ease;
}
.welcome-msg.is-out { opacity: 0; } /* brief fade before the dashboard reveals */
.welcome-line {
  margin: 0;
  animation: welcomeRise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.welcome-line1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.welcome-name {
  color: #ffffff;
  text-shadow: 0 0 22px rgba(255,255,255, 0.45);
}
.welcome-line2 {
  font-size: 14.5px;
  color: var(--text-mute);
  animation-delay: 130ms; /* the second line lands a beat behind */
}
@keyframes welcomeRise {
  from { opacity: 0; transform: translateY(16px); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* the row is a full-width column at every size (bar -> eye -> Verify) -
   the old <=430px flip is now the base layout */

/* motion is optional - honor the OS setting */
@media (prefers-reduced-motion: reduce) {
  .login-card.is-entering,
  .login-card.is-entering .login-logo,
  .login-card.is-entering .login-title,
  .login-card.is-entering .login-sub,
  .login-card.is-entering .login-form-row,
  .login-card.is-entering .login-error,
  .login-title,
  .login-glow,
  .login-logo,
  .login-logo::before,
  .login-logo.is-hit svg,
  .login-logo.is-hit::after,
  .login-card.is-error,
  .login-card.is-error .pin-cell.filled,
  .login-card.is-verifying .pin-scan,
  .login-card.is-verifying .pin-bar,
  .pin-bar:focus-within .pin-scan,
  .pin-cell.filled,
  .pin-cell.active,
  .welcome-line {
    animation: none !important;
  }
  .login-verify::before { display: none; } /* hover sweep is motion too */
  .login-card.is-transitioning {
    transition: opacity 200ms ease;
    transform: none;
    filter: none;
  }
  .login-sheen { display: none; }
}
.login-toast {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  padding: 9px 15px;
  background: #0e0e10;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 8px;
  font-size: 12px;
  color: #d8d8db;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  position: relative;
  z-index: 10;
  display: flex;
  height: 100%;
  animation: appIn 420ms ease-out; /* reveal after the card fades (visibility only) */
}
@keyframes appIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- sidebar ---------------- */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 14px;
  background: rgba(10, 9, 18, 0.94);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(6px);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 4px 0;
  margin-bottom: 20px;
}
.brand-logo { display: flex; }
.brand-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(90deg, #ffffff, #ffffff 65%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: #5f7cf9;
  margin-top: 2px;
}
.sidebar-close {
  display: none;
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  font-size: 18px;
  cursor: pointer;
}

.side-label {
  padding: 0 6px;
  margin-bottom: 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}
.side-block { margin-bottom: 18px; }

.bot-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: default;
  transition: background var(--t), border-color var(--t);
}
.bot-entry:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--border); }
.bot-avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}
.bot-avatar svg { display: block; width: 100%; height: 100%; }
.bot-meta { min-width: 0; flex: 1; }
.bot-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-sub {
  font-size: 9.5px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* sidebar list - one entry per account */
.bots-list { display: flex; flex-direction: column; gap: 1px; }
.bots-empty { padding: 4px 9px; font-size: 10px; color: var(--text-faint); }

.status-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5e5e63;
  transition: background var(--t), box-shadow var(--t);
}
.status-dot[data-state="online"] { background: var(--green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.75); }
.status-dot[data-state="connecting"] { background: var(--yellow); box-shadow: 0 0 8px rgba(234, 179, 8, 0.7); animation: pulse 1.1s ease infinite; }
.status-dot[data-state="offline"] { background: var(--red); box-shadow: 0 0 8px rgba(239, 68, 68, 0.7); }
.status-dot[data-state="stopped"] { background: #5e5e63; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* nav */
.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 33px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #8a8a8f;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.nav-item:hover { background: rgba(255, 255, 255, 0.035); color: #cfcfd1; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255,255,255,0.09), rgba(255,255,255,0.05));
  border-color: rgba(255,255,255, 0.32);
  color: #ffffff;
  box-shadow: inset 2px 0 0 var(--purple);
}

.side-actions {
  display: flex;
  gap: 7px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}
.btn-afk {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 29px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t), opacity var(--t);
}
.btn-afk .afk-ico { font-size: 8px; }
.btn-afk:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-start {
  background: rgba(34, 197, 94, 0.13);
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: #3ddc84;
}
.btn-start:hover:not(:disabled) { background: rgba(34, 197, 94, 0.22); }
.btn-stop {
  background: rgba(239, 68, 68, 0.13);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #f87171;
}
.btn-stop:hover:not(:disabled) { background: rgba(239, 68, 68, 0.22); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(3, 2, 8, 0.6);
  backdrop-filter: blur(2px);
}

/* ---------------- main / topbar ---------------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  flex: none;
  padding: 0 26px;
}
.topbar-spacer { flex: 1; }
.hamburger {
  display: none;
  width: 30px;
  height: 30px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
}
.hamburger svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.logout-chip {
  height: 26px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  color: var(--text-mute);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.logout-chip:hover {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

/* ---------------- pages ---------------- */
.pages {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.page {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 6px 26px 30px;
}
.page.active { display: block; animation: pageIn 165ms ease; }
.page-fill.active { display: flex; flex-direction: column; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head > div:first-child { flex: 1; min-width: 0; }
.page-title { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -0.015em; }
.page-sub { margin: 5px 0 0; font-size: 11.5px; color: var(--text-mute); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.view-sel { width: auto; min-width: 132px; height: 31px; font-size: 12px; }

/* ---------------- cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 11px;
  margin-bottom: 14px;
}
.stat-card { padding: 12px 14px 13px; }
.stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 7px;
}
.stat-value {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-value.online { color: #3ddc84; }
.stat-value.connecting { color: #fbbf24; }
.stat-value.offline { color: #f87171; }
.stat-value.stopped { color: var(--text-dim); }

.panel { padding: 13px 15px 15px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.panel-title {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}
.activity {
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--text-dim);
  max-height: 176px;
  overflow-y: auto;
}
.activity .empty, .chat-empty {
  color: var(--text-faint);
  font-family: var(--font);
  font-size: 12px;
}

/* ---------------- blocks (Accounts page) ---------------- */
.block { margin-top: 26px; }
.block-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.block-sub { margin: 4px 0 13px; font-size: 11px; color: var(--text-mute); }

/* collapsible block head (Proxies) */
.block-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.block-head:focus-visible { outline: 2px solid var(--accent, #ffffff); outline-offset: 3px; border-radius: 6px; }
.block-summary { font-size: 11px; font-weight: 500; color: var(--text-mute); }
.chev {
  align-self: center;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-mute);
  border-bottom: 2px solid var(--text-mute);
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.block.collapsed .chev { transform: rotate(-135deg); }
.block.collapsed .block-sub,
.block.collapsed .row-list { display: none; }

/* proxy import modal */
.modal-hint { margin: 0 0 8px; font-size: 11.5px; line-height: 1.75; color: var(--text-mute); }
.modal-hint code {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
}
.import-text {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.import-file { display: inline-flex; align-items: center; margin-top: 10px; cursor: pointer; }
.import-ok { margin-top: 8px; font-size: 12px; color: #7ee787; }

/* combined Add Proxies modal: single entry vs bulk list */
.modal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.modal-divider::before,
.modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .08);
}
.import-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.import-row .import-file { margin-top: 0; }

/* account card: ban-history chip + history modal list */
.hist-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-mute);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
  cursor: pointer;
}
.hist-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, .22); }
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
}
.hist-item.hist-active { border-color: rgba(255, 107, 107, .55); }
.hist-when { font-size: 11px; color: var(--text-mute); }
.hist-until { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.hist-chip {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(255, 107, 107, .18);
  color: #ff8f8f;
  vertical-align: 1px;
}
/* live remaining-time next to the active entry - same clock as the card badge */
.hist-left {
  margin-left: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}
.hist-reason { margin-top: 4px; font-size: 11.5px; color: var(--text-mute); line-height: 1.5; word-break: break-word; }
.row-list { display: flex; flex-direction: column; gap: 9px; }

.account-grid {
  display: grid;
  /* wide enough for IGN + ban countdown badge on one line (measured) */
  grid-template-columns: repeat(auto-fill, minmax(385px, 1fr));
  gap: 12px;
}
.account-card { padding: 13px 14px; }
.account-top { display: flex; align-items: center; gap: 10px; }
.account-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}
.account-avatar svg { display: block; width: 100%; height: 100%; }
.bot-avatar .avatar-img,
.account-avatar .avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.account-id { flex: 1; min-width: 0; }
.account-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
}
/* IGN truncates with an ellipsis, but the ban badge beside it never gets clipped */
.account-ign {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-meta {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-card .status-dot { width: 8px; height: 8px; }
.account-server {
  margin: 9px 0 10px;
  font-size: 10.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.account-server .ico { width: 11px; height: 11px; color: var(--text-faint); }
.account-server .srv-pick {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-dim);
  font: inherit;
  padding: 2px 4px;
  border-radius: 4px;
}
.account-server .srv-pick:hover { background: rgba(255, 255, 255, 0.05); }
.account-server .srv-pick:focus { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }
.account-server .srv-pick::placeholder { color: var(--text-faint); opacity: 0.7; }
.account-foot { display: flex; gap: 8px; }
.account-foot .input { flex: 1; height: 28px; font-size: 11.5px; }
.account-foot .btn { height: 28px; padding: 0 11px; font-size: 11px; }

/* proxy + assignment rows */
.row-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t), background var(--t);
}
.row-card:hover { border-color: rgba(255,255,255, 0.25); }
.proxy-badge {
  flex: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255, 0.14);
  border: 1px solid rgba(255,255,255, 0.4);
  border-radius: 7px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 12.5px; font-weight: 650; }
.row-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-card .input { height: 27px; width: 170px; font-size: 11px; }
.row-card .btn { height: 27px; font-size: 11px; padding: 0 11px; }

.assign-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 27px;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
}
.assign-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--purple); }
.assign-arrow { color: var(--text-faint); font-size: 12px; }

.empty-note {
  padding: 14px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 11.5px;
  color: var(--text-mute);
  text-align: center;
}

/* ============================================================
   CONSOLE
   ============================================================ */
.page-fill { overflow: hidden; }
#page-console .page-head, #page-chat .page-head { flex: none; }

.terminal {
  flex: 1;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  position: relative; /* anchors the jump-to-latest button */
  background: #070707;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.terminal-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.022);
  border-bottom: 1px solid var(--border);
}
.t-dot { width: 10px; height: 10px; border-radius: 50%; }
.t-dot.red { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green { background: #28c840; }
.terminal-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
}
.terminal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 13px 16px 15px;
  font-size: 12px;
  line-height: 1.75;
}
.log-line { display: flex; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.log-time { flex: none; color: #57575c; }
.log-tag {
  flex: none;
  font-size: 9.5px;
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255, 0.14);
  border: 1px solid rgba(255,255,255, 0.3);
  color: #ffffff;
}
.log-msg { min-width: 0; }
.lvl-info .log-msg { color: #9a9a9f; }
.lvl-success .log-msg { color: #3ddc84; }
.lvl-warn .log-msg { color: #fbbf24; }
.lvl-error .log-msg { color: #f87171; }
.lvl-chat .log-msg { color: #ffffff; }
.lvl-out .log-msg { color: #60a5fa; }
.log-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; transition: color 120ms ease, text-shadow 120ms ease; }
.log-link:hover { color: #ffffff; text-shadow: 0 0 8px rgba(255,255,255, 0.55); }

.input-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}
.input-prefix {
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
}
.input-bar .line-input { height: 37px; }
.btn-send { height: 37px; padding: 0 16px; }

/* ============================================================
   CHAT
   ============================================================ */
.chat-panel {
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.chat-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.55;
}
.chat-time { flex: none; font-family: var(--mono); font-size: 10.5px; color: #57575c; }
.chat-user {
  flex: none;
  font-weight: 650;
  color: #ffffff;
}
.chat-user.self { color: #60a5fa; }
.chat-msg { color: var(--text-dim); word-break: break-word; }
.chat-empty { margin: auto; }

/* ============================================================
   SETTINGS (single card, rows with divider — matches reference)
   ============================================================ */
.settings-list {
  overflow: hidden;
  padding: 0;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row-text { min-width: 0; }
.settings-row-title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.settings-row-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-mute);
}
.settings-row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.num-input {
  width: 66px;
  height: 34px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 0 2px;
  -moz-appearance: textfield;
  appearance: auto;
}
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button {
  -webkit-appearance: auto;
  margin: 0 1px;
}
.num-dash { color: var(--text-faint); font-size: 13px; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.toggle-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-mute);
}
.toggle-hint { margin-top: 4px; font-size: 10.5px; color: var(--text-faint); }

.switch { position: relative; flex: none; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: #212123;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8b8b90;
  transition: transform var(--t), background var(--t);
}
.switch input:checked + .slider {
  background: rgba(255,255,255, 0.35);
  border-color: rgba(255,255,255, 0.65);
}
.switch input:checked + .slider::before {
  transform: translateX(16px);
  background: #ffffff;
}
.settings-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}
.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}
.btn-logout:hover:not(:disabled) { background: rgba(239, 68, 68, 0.22); }

/* ============================================================
   MODALS / TOAST
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 2, 8, 0.72);
  backdrop-filter: blur(4px);
  animation: fadeIn 140ms ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  width: 368px;
  max-width: calc(100vw - 32px);
  background: #0c0c0e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 160ms ease;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px 0;
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-x {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-mute);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.modal-x:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.modal-body { padding: 14px 17px 4px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 17px 16px;
}
.modal-foot .btn { height: 29px; font-size: 12px; }
/* proxy modal: the actions live INSIDE the body, above the import divider,
   so they align with the fields instead of the modal's padded edge */
.modal-body .modal-foot { padding: 6px 0 0; }
.modal-error {
  margin: 2px 0 8px;
  font-size: 11.5px;
  color: #f87171;
}

.toast {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 70;
  max-width: 320px;
  padding: 10px 15px;
  background: #0f0f10;
  border: 1px solid rgba(255,255,255, 0.45);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  animation: toastIn 180ms ease;
}
.toast.err { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: none; }
  .sidebar-overlay.show { display: block; }
  .sidebar-close { display: block; }
  .hamburger { display: block; }
  .topbar { padding: 0 16px; }
  .page { padding: 4px 16px 26px; }
  .page-head { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}

@media (max-width: 560px) {
  .field-row { flex-direction: column; gap: 0; }
  .field-port { flex: 1; }
  .row-card { flex-wrap: wrap; }
  .row-card .input { width: 100%; }
  .login-card { width: calc(100vw - 32px); }
}


/* ---- proxy dead badge (rotation feature) ---- */
.dead-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px 2px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .3px;
  color: #ff5c5c;
  background: rgba(255, 70, 70, .10);
  border: 1px solid rgba(255, 92, 92, .55);
  border-radius: 5px;
  vertical-align: middle;
  text-transform: lowercase;
}

/* proxy answers game traffic but Mojang's login check blocks its IP */
.blocked-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px 2px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .3px;
  color: #f0b429;
  background: rgba(240, 180, 41, .10);
  border: 1px solid rgba(240, 180, 41, .55);
  border-radius: 5px;
  vertical-align: middle;
  text-transform: lowercase;
}

/* ---- webhook page ---- */
.hook-field { margin-top: 4px; }
.hook-field .input { width: 100%; }
.hook-row { padding-bottom: 0; }
.hook-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.hook-status { margin-top: 12px; font-size: 13px; color: #7ee787; }
.hook-status.err { color: #ff6b6b; }
.hook-pill {
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: #cfcfd2;
  cursor: pointer;
  transition: opacity var(--t), filter var(--t), transform 120ms ease;
}
.hook-pill.red { color: #ff7b7b; border-color: rgba(255,92,92,.4); background: rgba(255,70,70,.08); }
.hook-pill.orange { color: #ffb35c; border-color: rgba(255,165,0,.4); background: rgba(255,165,0,.08); }
.hook-pill.green { color: #7ee787; border-color: rgba(63,187,93,.4); background: rgba(63,187,93,.08); }
.hook-pill.purple { color: #ffffff; border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.10); }

/* ---- proxy latency badge + sparkline (health checker) ---- */
.lat-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px 2px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .3px;
  border-radius: 5px;
  vertical-align: middle;
}
.lat-badge.lat-ok { color: #7ee787; background: rgba(63,187,93,.10); border: 1px solid rgba(63,187,93,.5); }
.lat-badge.lat-warn { color: #ffb35c; background: rgba(255,165,0,.10); border: 1px solid rgba(255,165,0,.5); }
.lat-badge.lat-bad { color: #ff5c5c; background: rgba(255,70,70,.10); border: 1px solid rgba(255,92,92,.55); }
.spark { vertical-align: middle; margin-left: 6px; opacity: .9; }

/* ---- account ban badge + per-account ban mode ---- */
.ban-badge {
  display: inline-block;
  padding: 1px 6px 2px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .3px;
  color: #ff8f8f;
  background: rgba(255, 70, 70, .12);
  border: 1px solid rgba(255, 92, 92, .55);
  border-radius: 5px;
  vertical-align: middle;
  white-space: nowrap;
}
.account-foot { flex-wrap: wrap; }
.account-foot .ban-pick { flex: 0 1 auto; max-width: 128px; }

/* ---- rotation assignment chip + backup buttons ---- */
.assign-chip.rot { color: #ffffff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.1); }
.assign-chip.rot .dot { background: #ffffff; }
.backup-label { cursor: pointer; }
.settings-row-controls.hook-actions { margin-top: 0; flex-wrap: wrap; }

/* ============================================================
   Saturn restyle (saturnspoofer.com): animations, click press,
   uptime stats bars
   ============================================================ */

/* --- saturnspoofer keyframes (verbatim) --- */
@keyframes pulse-slow { 0%, to { opacity: 0.95; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.98); } }
@keyframes shine { 0% { background-position: -200% 0; } to { background-position: 200% 0; } }
.saturn-pulse { animation: 3s ease-in-out infinite pulse-slow; }
.saturn-shine {
  background: linear-gradient(to right, #222 20%, #fff 40%, #fff 60%, #222 80%);
  background-size: 400% 100%;
  background-repeat: repeat;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: 12s linear infinite shine;
}

/* --- saturn click press (their :active scale/translate effect) --- */
.btn:active:not(:disabled) { transform: translateY(2px) scale(0.96); }
.nav-item, .op-card, .logout-chip, .hist-btn, .fchip, .tab {
  transition: transform 120ms ease, background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.nav-item:active, .op-card:active, .logout-chip:active, .hist-btn:active, .fchip:active, .tab:active {
  transform: scale(0.95) translateY(1px);
}
.pin-cell { transition: transform 100ms ease, border-color var(--t), box-shadow var(--t); }
.pin-cell:active { transform: scale(0.94); }

/* ---------------- Discord login (second method) ---------------- */
.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0 11px;
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}
.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
  transition: background var(--t), border-color var(--t), box-shadow var(--t), transform 120ms ease;
}
.btn-discord:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.2);
}
.btn-discord:active { transform: translateY(2px) scale(0.97); }
.btn-discord:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.22),
    0 0 22px rgba(255, 255, 255, 0.2);
}
/* text links inside the login card get the same visible focus state */
.license-toggle:focus-visible,
.owner-login-link:focus-visible,
.customer-login-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
  border-radius: 4px;
  color: var(--text);
}
.discord-hint {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
}
.discord-hint b { color: var(--text); }

/* access-code lockout (15 failed tries): bar + verify go dead, Discord stays */
.pin-locked .pin-bar,
.pin-locked .login-verify,
.pin-locked .pin-eye { opacity: 0.45; pointer-events: none; }

/* --- animated saturn logo --- */
.logo-saturn { border-radius: 50%; display: block; object-fit: cover; }

/* --- uptime stats bars (Stats page) --- */
/* full-width rows: one card per account, taller charts for readability */
.up-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.up-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.up-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}
.up-card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; }
.up-totals { display: flex; gap: 14px; margin-bottom: 12px; font-size: 12px; color: var(--text-mute); }
.up-totals b { color: var(--text); font-variant-numeric: tabular-nums; }
.up-bars { display: flex; align-items: flex-end; gap: 8px; height: 168px; }
.up-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  height: 100%; justify-content: flex-end; cursor: default; position: relative;
}
.up-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.35));
  box-shadow: 0 0 10px rgba(255,255,255,0.25);
  transition: height 400ms ease, filter 140ms ease;
}
.up-col:hover .up-bar { filter: brightness(1.35); box-shadow: 0 0 16px rgba(255,255,255,0.45); }
.up-bar.empty { background: rgba(255,255,255,0.08); box-shadow: none; }
.up-col span { font-size: 9.5px; color: var(--text-faint); letter-spacing: 0.05em; }
.up-col.today span { color: var(--text); font-weight: 700; }
.up-sec { font-size: 11px; color: var(--text-mute); align-self: flex-end; }
/* hover tooltip for a bar (JS fills #upTip) */
.up-tip {
  position: fixed; z-index: 520; pointer-events: none;
  padding: 7px 11px; border-radius: 9px;
  background: rgba(14, 13, 24, 0.97); border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  font-size: 11.5px; color: var(--text); white-space: nowrap;
  opacity: 0; transform: translateY(4px); transition: opacity 130ms ease, transform 130ms ease;
}
.up-tip.show { opacity: 1; transform: none; }
.up-tip b { color: #4ade80; }

/* ---------------- saturn scene: intro -> welcome -> dashboard bg ----------------
   One body-level layer driven by #saturnScene state classes:
   A (default)  visit: zoomed INTO the planet (intro)
   B .s-welcome after PIN: slow zoom-out + orbit ring sweep, planet settles
     small above the "Welcome back." line
   C .s-app     dashboard: zoom back in - the WHOLE planet fitted to the
     page (object-fit: contain) as the permanent background                    */
#saturnScene {
  position: fixed;
  inset: 0;
  z-index: -1; /* above the root background, behind every piece of UI */
  overflow: hidden;
  pointer-events: none;
}
/* intro staging: the card is laid out (so the saturn can target its logo)
   but invisible from the very first paint - JS removes this in ONE smooth
   reveal after the planet has landed. No JS = no class = card shows. */
html.js-intro #loginForm { opacity: 0; visibility: hidden; }

/* logout pop: opacity only (never translates) so the landing measurement
   of the logo stays pixel-accurate while the card appears */
@keyframes cardFade { from { opacity: 0; } }
.login-card.is-fading { animation: cardFade 450ms ease; }

/* the generated cinematic saturn - screen-blended so its near-black space
   background disappears and the panel's animated star canvas shines
   through; --fs/--fx/--fy drive the intro landing and the background zoom */
#saturnScene .saturn-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
  transform: translate(var(--fx, 0px), var(--fy, 0px)) scale(var(--fs, 2.6));
  transition: transform 2100ms cubic-bezier(0.5, 0, 0.15, 1);
  animation: saturnGlow 7s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
}
@keyframes saturnGlow {
  0%, 100% { opacity: 0.97; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.05); }
}
/* after login: zoom back in - the whole saturn becomes the page background */
#saturnScene.s-app .saturn-photo {
  --fx: 0px;
  --fy: 0px;
  --fs: 1;
  transition-duration: 1700ms;
}
  /* ---------------- background transparency (Settings -> General) ----------------
     body[data-bg] flips the surface vars: opaque = solid cards (default),
     translucent = frosted glass, transparent = nearly clear so the space
     scene reads through every panel. */
  body[data-bg="translucent"] {
    --surface: rgba(8, 8, 10, 0.74);
    --surface-2: rgba(13, 13, 15, 0.78);
    --surface-3: rgba(19, 19, 21, 0.84);
  }
  body[data-bg="transparent"] {
    --surface: rgba(8, 8, 10, 0.42);
    --surface-2: rgba(13, 13, 15, 0.5);
    --surface-3: rgba(19, 19, 21, 0.6);
  }
  body[data-bg="translucent"] .card,
  body[data-bg="translucent"] .settings-list,
  body[data-bg="translucent"] .up-card,
  body[data-bg="translucent"] .modal,
  body[data-bg="transparent"] .card,
  body[data-bg="transparent"] .settings-list,
  body[data-bg="transparent"] .up-card,
  body[data-bg="transparent"] .modal {
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
  }

/* smooth exit transition when leaving the panel for the jsecure site */
#navFade {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}
#navFade.on { opacity: 1; }

/* ---------------- top-tier 3D layer (js/tilt3d.js) ----------------
   Perspective card tilt under the cursor + an accent cursor-glow.
   Purely additive: tilt3d.js writes inline transforms only while the
   pointer is on a card and clears them on leave, so every existing
   hover/active/intact state keeps working. */
.card,
.up-card {
  position: relative;
}
.card {
  transition: transform 0.18s ease, border-color var(--t), box-shadow var(--t);
  will-change: transform;
}
.up-card {
  will-change: transform;
}
.card::before,
.up-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    340px circle at var(--tx, 50%) var(--ty, 50%),
    rgba(74, 158, 255, 0.12),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover::before,
.up-card:hover::before {
  opacity: 1;
}

  /* ---------------- hover-only grid reveal ----------------
     The signature 64px grid stays hidden; moving the mouse opens a soft
     circular window around the cursor that fades out when the pointer
     rests. Sits under the saturn scene, over the nebula background. */
  .grid-reveal {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0;
    transition: opacity 450ms ease;
    -webkit-mask-image: radial-gradient(circle 240px at var(--mx, 50%) var(--my, 50%), #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 72%);
    mask-image: radial-gradient(circle 240px at var(--mx, 50%) var(--my, 50%), #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 72%);
  }
  .grid-reveal.on { opacity: 1; }
  @media (prefers-reduced-motion: reduce) {
    .grid-reveal { transition-duration: 1ms; }
    #saturnScene .saturn-photo { transition-duration: 1ms !important; animation: none !important; }
  }

/* ================= multi-tenancy: roles, gates, licenses =================
 * Hiding is COSMETIC only - the backend independently403s every owner-only
 * route. html[data-role] is set from /api/auth/session before the app shows. */

html[data-role="customer"] .owner-only { display: none !important; }
html[data-role="owner"] .customer-only { display: none !important; }
/* owner viewing a customer panel: look exactly like THEIR panel */
html[data-viewing] .owner-only { display: none !important; }

/* ---- license key entry on the login card ---- */
.login-license { margin-top: 13px; text-align: center; }
.license-toggle {
  background: none; border: none; color: var(--text-faint);
  font-size: 11.5px; letter-spacing: 0.05em; cursor: pointer;
  font-family: var(--font); text-decoration: underline dotted;
  text-underline-offset: 3px; padding: 4px 8px; transition: color var(--t);
}
.license-toggle:hover { color: var(--text); }
.license-row { display: flex; gap: 8px; margin-top: 9px; }
.license-input {
  flex: 1; min-width: 0; text-align: center; font-family: ui-monospace, monospace;
  letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px;
}
.license-row .btn { flex-shrink: 0; padding: 0 16px; height: 38px; }
.license-err { margin-top: 8px; font-size: 11.5px; color: #f87171; }

/* ---- gate screens (PIN creation / license lock): fixed over everything ---- */
.gate-screen {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 4, 10, 0.86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.gate-card { width: min(430px, calc(100vw - 36px)); }
.gate-card .pin-bar { margin-top: 4px; }
.gate-card .pin-bar + .pin-bar { margin-top: 10px; }
/* the gate bars have no in-bar eye strip - the default padding reserves
   54px on the right for it, which pushed the digits left with a gap */
.gate-card .pin-cells { padding: 0 14px; }
.gate-card .login-verify { width: 100%; margin-top: 14px; }
#pcError { margin-top: 10px; }

/* ---- expired license lock: NO close, NO escape ---- */
.lock-screen { z-index: 500; cursor: default; }
.lock-card {
  text-align: center; padding: 40px 34px; max-width: 430px;
  background: rgba(12, 12, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.lock-icon { color: #fbbf24; margin-bottom: 14px; }
.lock-copy { color: var(--text-dim); font-size: 14.5px; line-height: 1.65; margin-top: 10px; }
.lock-copy b { color: #93c5fd; }
.lock-sub { color: var(--text-faint); font-size: 12.5px; margin-top: 8px; }
.lock-discord { margin-top: 20px; width: 100%; }

/* ---- owner viewing a customer panel ---- */
.viewas-banner {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 14px; font-size: 13px; color: #fde68a;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.09));
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
}
.viewas-dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.viewas-exit {
  background: rgba(251, 191, 36, 0.18); border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a; border-radius: 999px; padding: 3px 13px; font-size: 12px;
  font-family: var(--font); font-weight: 700; cursor: pointer; transition: background var(--t);
}
.viewas-exit:hover { background: rgba(251, 191, 36, 0.34); }

/* ---- Licenses page (owner) ---- */
.license-gen { margin-bottom: 18px; }
.license-gen-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.license-gen-row .num-input { width: 92px; }
.license-new {
  display: flex; gap: 10px; align-items: center; margin-top: 14px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(74, 222, 128, 0.08); border: 1px solid rgba(74, 222, 128, 0.35);
}
.license-key-lg {
  font-family: ui-monospace, monospace; font-size: 15px; letter-spacing: 0.12em;
  color: var(--text); background: rgba(0, 0, 0, 0.3);
  padding: 7px 13px; border-radius: 9px; user-select: all;
}
/* ---- Licenses page: generator extras ---- */
.license-gen { padding: 16px 18px; }
.lic-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.lic-chips .fchip {
  height: 25px; padding: 0 12px; font-size: 11.5px; font-weight: 600;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04); color: var(--text-dim); cursor: pointer;
}
.lic-chips .fchip:hover { border-color: rgba(255, 255, 255, 0.3); color: var(--text); }
.lic-type { width: 128px; flex: none; }

/* ---- stats row ---- */
.lic-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* ---- search / filter / sort toolbar ---- */
.lic-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
}
.lic-search { flex: 1; min-width: 190px; }
.lic-filters { display: flex; gap: 7px; flex-wrap: wrap; }
.lic-filters .fchip {
  height: 28px; padding: 0 14px; font-size: 11.5px; font-weight: 650;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04); color: var(--text-dim); cursor: pointer;
}
.lic-filters .fchip:hover { border-color: rgba(255, 255, 255, 0.3); color: var(--text); }
.lic-filters .fchip.active {
  background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.45); color: var(--text);
}
.lic-sort { width: 156px; flex: none; }

/* ---- licenses table ---- */
.lic-pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.lic-pill.active { color: #4ade80; background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.4); }
.lic-pill.expired { color: #fbbf24; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.4); }
.lic-pill.revoked { color: #f87171; background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); }
.lic-table-wrap { overflow-x: auto; }
.lic-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lic-table th {
  text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 13px 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.lic-table td {
  padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  vertical-align: middle; white-space: nowrap;
}
.lic-table tbody tr:last-child td { border-bottom: 0; }
.lic-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
.lic-table .lt-key { min-width: 210px; white-space: normal; }
.lic-table .lt-acts { text-align: right; }
.lic-table .lt-acts .lic-actions { justify-content: flex-end; }
.lic-table .empty-note { margin: 6px 0; }
.lt-sub { font-size: 10.5px; color: var(--text-faint); margin-top: 3px; }
.lt-sub.lt-ip { font-family: ui-monospace, monospace; }
.lt-mute { color: var(--text-faint); }
.lt-dur { color: var(--text-dim); font-weight: 600; }
.lt-dur.lt-life { color: #4ade80; }
.lic-key {
  font-family: ui-monospace, monospace; font-size: 12.5px; letter-spacing: 0.08em;
  color: var(--text); user-select: all; cursor: pointer;
}
.lic-key:hover { color: #93c5fd; }
.lic-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.lic-actions .btn { height: 27px; padding: 0 12px; font-size: 11.5px; border-radius: 999px; }
.btn-danger-ghost { color: #f87171; border-color: rgba(248, 113, 113, 0.4) !important; }
.btn-danger-ghost:hover { background: rgba(248, 113, 113, 0.14) !important; }

/* ⋯ overflow menu (Copy / Show PIN / Revoke / Delete) */
.lic-more {
  width: 28px; height: 27px; padding: 0; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim); font-size: 15px; line-height: 1; cursor: pointer;
}
.lic-more:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.lic-menu {
  position: fixed; z-index: 500; min-width: 156px; padding: 6px;
  background: rgba(16, 15, 24, 0.98); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column; gap: 2px;
}
.lic-menu button {
  appearance: none; border: 0; background: transparent; color: var(--text-dim);
  text-align: left; padding: 8px 11px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.lic-menu button:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.lic-menu button.danger { color: #f87171; }
.lic-menu button.danger:hover { background: rgba(248, 113, 113, 0.14); }

/* ---- My License page (customer) ---- */
.mylic-row {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.mylic-row:last-of-type { border-bottom: none; }
.mylic-k { color: var(--text-faint); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; width: 92px; flex-shrink: 0; }
.mylic-renew {
  margin-top: 14px; padding: 12px 15px; border-radius: 12px; font-size: 13.5px;
  background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.4); color: #fde68a;
}
.mylic-renew b { color: #93c5fd; }

/* days input dims while Lifetime is selected */
#licDays:disabled { opacity: .4; }

/* ================= split login surfaces (owner vs customer) =================
 * data-login is set from the pathname before first paint. Cosmetic only -
 * the server is what actually separates the two worlds.
 *
 * owner card:   access code + Continue with Discord
 * customer card: Continue with Discord + license key (their code is entered
 *                on the per-customer gate screen AFTER identity is proven) */
html[data-login="owner"] .login-license { display: none; }
html[data-login="owner"] .owner-login-link { display: none; }
/* Discord-first owner card: the access-code field stays hidden until the
 * Discord identity gate stages (.code-ready) or Discord-first isn't
 * configured (fresh install / Discord down) - toggled by showLogin() */
html[data-login="owner"] #loginForm:not(.code-ready) .login-form-row,
html[data-login="owner"] #loginForm:not(.code-ready) .login-or { display: none; }
html[data-login="owner"] #loginForm.code-ready .login-form-row { animation: riseIn 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ---- customer access-code gate + owner approval wait: same space scene
   as the owner card (transparent overlay - the Saturn + stars show
   through). Only the two login-flow screens get this; the lock/revoked
   verdict screens keep their dark veil. ---- */
#pinCreateView, #approvalWait {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* fresh intro keeps the gate card hidden until the planet lands on it */
html.js-intro #pinCreateForm,
html.js-intro #approvalWait .login-card { opacity: 0; visibility: hidden; }

/* approval wait screen (DM code entry) */
#apError { margin-top: 10px; }
.approval-status { margin-top: 14px; color: var(--text-faint); }
.approval-status::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
  border-radius: 50%; background: #fbbf24; vertical-align: middle;
  animation: dirtyPulse 1.4s ease-in-out infinite;
}
.approval-cancel { margin-top: 16px; }

/* first-time customer name prompt (sits where the welcome message does) */
.name-ask-form {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  animation: welcomeRise 520ms cubic-bezier(0.16, 1, 0.3, 1) 130ms both;
}
.name-ask-input { width: 230px; text-align: center; }

/* ---- active sessions (owner panel only - hidden by .owner-only for
   customers and while view-as is active) ---- */
.sessions-card { margin-top: 16px; }
.sessions-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sessions-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-mute);
}
.sessions-scope {
  width: auto; min-width: 190px; max-width: 270px;
  height: 32px; font-size: 12.5px; padding: 0 10px;
}
.sessions-sub {
  margin: 8px 0 14px; font-size: 12.5px;
  color: var(--text-faint); line-height: 1.55;
}
.sessions-list { display: flex; flex-direction: column; gap: 10px; }
.sessions-empty { font-size: 12.5px; color: var(--text-faint); padding: 4px 2px; }
.session-row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(8, 8, 10, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 14px 16px;
}
.session-icon {
  flex-shrink: 0; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
}
.session-icon svg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.session-info { flex: 1; min-width: 0; }
.session-ua {
  font-size: 13.5px; font-weight: 700; color: #fff;
  line-height: 1.6; overflow-wrap: anywhere;
}
.session-badge {
  display: inline-block; margin-left: 10px; padding: 3px 9px;
  vertical-align: middle; font-size: 10.5px; font-weight: 700;
  line-height: 1.1; letter-spacing: 0.04em; color: var(--text-mute);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px;
}
.session-meta {
  margin-top: 7px; font-family: ui-monospace, monospace;
  font-size: 12px; color: var(--text-faint); overflow-wrap: anywhere;
}
.session-revoke { flex-shrink: 0; }

/* owner's merged proxy list: tag showing WHICH customer owns a proxy */
.proxy-owner-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  vertical-align: middle; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(147, 197, 253, 0.35); border-radius: 999px;
}
/* Discord already proved who you are (.code-confirmed, set from ownerGate):
   only the access code remains - drop the OR divider, the Discord button
   AND the customer switch link (this is the owner's panel now, the customer
   card is irrelevant). The401 "Continue with Discord first" (expired gate)
   removes the class in JS and everything comes back. */
html[data-login="owner"] #loginForm.code-confirmed .login-or,
html[data-login="owner"] #loginForm.code-confirmed .btn-discord,
html[data-login="owner"] #loginForm.code-confirmed .customer-login-link { display: none; }
/* scoped to the MAIN login card: the gate screen (pinCreateView) reuses
 * .login-form-row and must stay visible on the customer surface */
html[data-login="customer"] #loginForm .login-form-row,
html[data-login="customer"] #loginForm .login-or,
html[data-login="customer"] #loginForm .login-error { display: none !important; }
html[data-login="customer"] .discord-hint,
html[data-login="customer"] .customer-login-link { display: none !important; }
html[data-login="customer"] .login-license {
  margin-top: 4px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.owner-login-link,
.customer-login-link {
  display: inline-block; margin-top: 14px; font-size: 11.5px;
  color: var(--text-faint); text-decoration: underline dotted;
  text-underline-offset: 3px; transition: color var(--t);
}
.owner-login-link:hover, .customer-login-link:hover { color: var(--text); }

/* ================= revoked screen (no login card behind it) ================= */
.revoked-screen .lock-icon { color: #f87171; }
.revoked-screen .lock-card { border-color: rgba(248,113,113,.35); }
.revoked-screen .lock-discord {
  background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.45); color: #fca5a5;
}
.revoked-screen .lock-discord:hover { background: rgba(248,113,113,.26); }

/* ================= interactive tutorial (spotlight tour) ================= */
.tour-veil { position: fixed; inset: 0; z-index: 700; }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(3, 3, 10, 0.78), 0 0 0 2px rgba(167, 139, 250, 0.9), 0 0 26px rgba(167, 139, 250, 0.45);
  transition: top 380ms cubic-bezier(.4,0,.2,1), left 380ms cubic-bezier(.4,0,.2,1),
              width 380ms cubic-bezier(.4,0,.2,1), height 380ms cubic-bezier(.4,0,.2,1);
}
.tour-spot.hidden { opacity: 0; }
.tour-card {
  position: fixed; width: min(340px, calc(100vw - 32px));
  background: rgba(14, 13, 24, 0.97);
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 16px; padding: 18px 18px 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6), 0 0 40px rgba(124,58,237,.18);
  transition: top 380ms cubic-bezier(.4,0,.2,1), left 380ms cubic-bezier(.4,0,.2,1);
  z-index: 701;
}
.tour-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tour-count {
  font-size: 11px; letter-spacing: .14em; color: #a78bfa;
  font-weight: 700; background: rgba(139,92,246,.16);
  border: 1px solid rgba(139,92,246,.4); border-radius: 999px; padding: 2px 10px;
}
.tour-x {
  background: none; border: none; color: var(--text-faint); font-size: 22px;
  line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 8px;
  transition: color var(--t), background var(--t);
}
.tour-x:hover { color: #f87171; background: rgba(248,113,113,.12); }
.tour-art { font-size: 34px; line-height: 1; margin: 2px 0 8px; }
.tour-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.tour-text { font-size: 13.2px; line-height: 1.6; color: var(--text-dim); margin: 0 0 14px; }
.tour-actions { display: flex; gap: 9px; justify-content: flex-end; }
.tour-actions .btn { height: 34px; padding: 0 16px; font-size: 12.5px; border-radius: 999px; }

/* customer PIN lock message sizing (shared card) */

/* tour spot is the interactive "click to continue" target */
.tour-spot { pointer-events: auto; cursor: pointer; }
.tour-spot.behind-card { cursor: default; }
/* revealed PIN in the owner license list */
.lic-pinval { font-weight: 700; letter-spacing: .08em; }
.lic-pinval.revealed { color: #4ade80; }

/* ============================================================
   UI POLISH PASS - health colors, console tools, chat highlights,
   masked secrets, interactive alert tags, sticky save
   ============================================================ */

/* --- Dashboard health: red / amber / green out of 20 --- */
.stat-value.hp-bad { color: #f87171; }
.stat-value.hp-warn { color: #fbbf24; }
.stat-value.hp-good { color: #4ade80; }

/* --- Console toolbar: auto-scroll + copy --- */
.console-tools { display: flex; gap: 7px; align-items: center; }
.console-tools .btn { height: 29px; padding: 0 12px; font-size: 11.5px; }
.btn-toggle.on {
  background: rgba(74, 222, 128, 0.14); border-color: rgba(74, 222, 128, 0.45); color: #4ade80;
}
.console-jump {
  position: absolute; right: 16px; bottom: 14px; z-index: 5;
  height: 28px; padding: 0 12px; font-size: 11.5px; border-radius: 999px;
  background: rgba(20, 19, 30, 0.95); border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text); cursor: pointer; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.console-jump:hover { background: rgba(35, 33, 52, 0.98); }

/* --- Chat: shard / reward lines glow --- */
.chat-line.hi { position: relative; }
.chat-line.hi .chat-msg {
  color: #fde68a; font-weight: 600;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}
.chat-line.hi .chat-user { color: #fbbf24; }
.chat-line.hi::before {
  content: "\2726"; /* sparkle marker */
  position: absolute; left: -14px; top: 0;
  color: #fbbf24; font-size: 11px; opacity: 0.85;
}
.chat-hi-tag {
  flex: none; font-size: 9px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; padding: 1px 6px; border-radius: 5px;
  color: #fbbf24; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4);
}

/* --- masked secrets: webhook URL + license keys --- */
.secret-wrap { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.secret-wrap .input { flex: 1; min-width: 0; letter-spacing: 0.02em; }
.secret-wrap input.masked { font-family: var(--mono); letter-spacing: 0.14em; }
.secret-btns { display: flex; gap: 6px; flex: none; }
.secret-btns .btn { height: 34px; padding: 0 11px; font-size: 11.5px; }
.lic-key-masked { letter-spacing: 0.12em; color: var(--text-faint); }
.key-cell { display: flex; align-items: center; gap: 8px; }
.key-cell .lic-key { min-width: 0; }
.key-reveal {
  flex: none; width: 26px; height: 24px; padding: 0; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.05);
  color: var(--text-mute); font-size: 12px; cursor: pointer; line-height: 1;
}
.key-reveal:hover { background: rgba(255, 255, 255, 0.13); color: var(--text); }
.license-new .secret-wrap { flex: 1; }
.license-new .license-key-lg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* --- Webhook alert tags: interactive on/off toggles --- */
.hook-pill {
  cursor: pointer; user-select: none;
  transition: opacity var(--t), filter var(--t), transform 120ms ease;
}
.hook-pill:hover { transform: translateY(-1px); filter: brightness(1.25); }
.hook-pill:active { transform: scale(0.95); }
.hook-pill.off {
  opacity: 0.38; filter: grayscale(0.85);
  text-decoration: line-through; text-decoration-thickness: 1px;
}
.hook-pill .hp-state {
  display: none; font-size: 9px; font-weight: 800; margin-left: 5px; opacity: 0.9;
}
.hook-pill:not(.off) .hp-state { display: inline; }
.hook-hint { margin-top: 8px; font-size: 11px; color: var(--text-faint); }

/* --- Settings: sticky save bar only while dirty --- */
.settings-actions {
  position: relative; z-index: 4;
  transition: background var(--t), box-shadow var(--t), border-color var(--t);
  border: 1px solid transparent; border-radius: 14px; padding: 8px 10px; margin: 16px -10px 0;
}
.settings-actions.dirty {
  position: sticky; bottom: 12px;
  background: rgba(14, 13, 24, 0.96);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.settings-dirty-dot {
  display: none; align-items: center; gap: 7px;
  font-size: 11.5px; color: #fbbf24; font-weight: 600; margin-right: auto;
}
.settings-actions.dirty .settings-dirty-dot { display: inline-flex; }
.settings-dirty-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #fbbf24; box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
  animation: dirtyPulse 1.4s ease-in-out infinite;
}
@keyframes dirtyPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* --- toast: slightly larger + stacked-friendly --- */
.toast { max-width: 360px; font-size: 12.5px; padding: 11px 16px; }
