/* ============================================================================
   TG Userbot — Premium Dark + Glass/Neon design system
   Hand-crafted CSS. Mobile-first. No build step.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* base surfaces */
  --bg-0: #07070b;
  --bg-1: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #16161f;

  /* glass */
  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-strong: rgba(255, 255, 255, 0.14);

  /* text */
  --text: #ECEDF2;
  --text-dim: #9A9CB0;
  --text-faint: #62647A;

  /* neon accents */
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --cyan: #22d3ee;

  --accent: var(--violet);
  --accent-2: var(--cyan);
  --accent-glow: rgba(139, 92, 246, 0.45);
  --cyan-glow: rgba(34, 211, 238, 0.4);

  /* semantic */
  --green: #34d399;
  --green-glow: rgba(52, 211, 153, 0.4);
  --amber: #fbbf24;
  --red: #fb7185;
  --red-glow: rgba(251, 113, 133, 0.4);

  /* radii + shadow */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset,
                 0 12px 40px -12px rgba(0,0,0,0.7);
  --shadow-pop: 0 24px 70px -20px rgba(0,0,0,0.85);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-1);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Atmospheric background — layered radial glows + faint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 15% -5%, rgba(99,102,241,0.18), transparent 60%),
    radial-gradient(800px 700px at 100% 0%, rgba(34,211,238,0.10), transparent 55%),
    radial-gradient(700px 700px at 50% 110%, rgba(139,92,246,0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.center { text-align: center; }

/* ============================================================================
   LOGIN
   ========================================================================== */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)), var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 36px 30px;
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.5s var(--ease) both;
}
.login-logo {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset,
              0 10px 30px -6px var(--accent-glow);
  position: relative;
}
.login-logo svg { width: 28px; height: 28px; }
.login-card h1 {
  font-size: 22px; font-weight: 700; text-align: center; margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.login-card .sub { text-align: center; color: var(--text-dim); font-size: 13px; margin: 0 0 26px; }

/* ---------- Form fields ---------- */
.field { margin-bottom: 14px; }
.field > label, .lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(139,92,246,0.6);
  background: rgba(0,0,0,0.36);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.18);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
select.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239A9CB0' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.select option { background: var(--bg-2); color: var(--text); }

.form-error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin: 12px 0 0;
  min-height: 1em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--r-sm);
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: var(--text);
  transition: transform 0.12s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: rgba(255,255,255,0.09); border-color: var(--glass-border-strong); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn.block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px -8px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.12) inset;
}
.btn-primary:hover {
  box-shadow: 0 10px 30px -6px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.18) inset;
  background: linear-gradient(135deg, #6f72f5, #9a6bff);
}
.btn-ghost { background: transparent; border-color: var(--glass-border); }
.btn-sm { padding: 8px 12px; font-size: 12.5px; }

.btn-icon {
  padding: 8px;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
}

/* link-like inline actions in tables/cards */
.act {
  font-size: 12.5px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.act:hover { background: var(--glass-strong); }
.act-accent { color: var(--accent-2); }
.act-green { color: var(--green); }
.act-amber { color: var(--amber); }
.act-danger { color: var(--red); }

/* ============================================================================
   APP SHELL
   ========================================================================== */
#app { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  background: linear-gradient(180deg, rgba(10,10,15,0.97), rgba(10,10,15,0.92));
  border-bottom: 1px solid var(--glass-border);
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -0.02em; font-size: 15px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset, 0 6px 18px -6px var(--accent-glow);
}
.brand-mark svg { width: 17px; height: 17px; }
.page-name { color: var(--text-dim); font-weight: 500; font-size: 13px; }
.topbar .user-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
}
.avatar {
  width: 30px; height: 30px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  font-weight: 700; font-size: 13px; color: var(--text);
  text-transform: uppercase;
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px calc(96px + var(--safe-bottom));
}
.page-head {
  margin: 4px 0 18px;
}
.page-head h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-head p { margin: 4px 0 0; color: var(--text-dim); font-size: 13.5px; }

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + var(--safe-bottom));
  z-index: 40;
  display: flex;
  gap: 2px;
  padding: 7px;
  border-radius: var(--r-pill);
  background: rgba(16,16,22,0.94);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--shadow-pop);
  max-width: calc(100vw - 24px);
}
.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 11px;
  border-radius: var(--r-pill);
  color: var(--text-faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.2s, background 0.2s;
  min-width: 50px;
}
.nav-item svg { width: 21px; height: 21px; transition: transform 0.25s var(--ease); }
.nav-item:hover { color: var(--text-dim); }
.nav-item.active { color: #fff; }
.nav-item.active svg { transform: translateY(-1px); }
.nav-item.active::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(99,102,241,0.35), rgba(139,92,246,0.3));
  box-shadow: 0 0 18px -2px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.1) inset;
  z-index: -1;
  animation: pop-in 0.3s var(--ease);
}

/* overflow popover */
.nav-overflow {
  position: fixed;
  bottom: calc(78px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 41;
  background: rgba(18,18,26,0.96);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 6px;
  box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease);
  min-width: 160px;
}
.nav-overflow.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-overflow a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: 11px;
  font-size: 14px; color: var(--text-dim); font-weight: 500;
}
.nav-overflow a svg { width: 18px; height: 18px; }
.nav-overflow a:hover { background: var(--glass-strong); color: var(--text); }
.nav-overflow a.active { color: #fff; background: rgba(139,92,246,0.18); }
.nav-overflow .sep { height: 1px; background: var(--glass-border); margin: 5px 6px; }
.nav-overflow a.danger { color: var(--red); }

/* ============================================================================
   CARDS / PANELS
   ========================================================================== */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.022)), var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.panel { padding: 18px; }
.panel-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.panel-title .hint { font-size: 12px; font-weight: 500; color: var(--text-faint); }

.section { margin-bottom: 18px; }

/* stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 560px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.stat {
  position: relative;
  padding: 16px;
  overflow: hidden;
}
.stat .stat-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 12px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
}
.stat .stat-ico svg { width: 18px; height: 18px; }
.stat .stat-label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.stat .stat-value {
  font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.stat.accent .stat-ico { color: var(--violet); box-shadow: 0 0 18px -4px var(--accent-glow); }
.stat.accent .stat-ico svg { filter: drop-shadow(0 0 6px var(--accent-glow)); }
.stat.cyan .stat-ico { color: var(--cyan); }
.stat.green .stat-ico { color: var(--green); }
.stat.green .stat-value { color: var(--green); }
.stat.red .stat-ico { color: var(--red); }
.stat.red .stat-value { color: var(--red); }
.stat::after {
  content: "";
  position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  opacity: 0.5; pointer-events: none;
}
.stat.green::after { background: radial-gradient(circle, var(--green-glow), transparent 70%); }
.stat.red::after { background: radial-gradient(circle, var(--red-glow), transparent 70%); }
.stat.cyan::after { background: radial-gradient(circle, var(--cyan-glow), transparent 70%); }

/* ---------- List cards (replacing tables on mobile) ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.row-title { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.row-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.row-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: var(--text-dim);
}
.row-meta .k { color: var(--text-faint); margin-right: 4px; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ---------- Badges / status dots ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid transparent; white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.badge.green { color: var(--green); background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.25); }
.badge.green .dot { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.badge.red   { color: var(--red);   background: rgba(251,113,133,0.12); border-color: rgba(251,113,133,0.25); }
.badge.red .dot { background: var(--red); }
.badge.amber { color: var(--amber); background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.25); }
.badge.amber .dot { background: var(--amber); }
.badge.indigo{ color: #a5b4fc; background: rgba(99,102,241,0.14); border-color: rgba(99,102,241,0.3); }
.badge.indigo .dot { background: var(--indigo); }
.badge.cyan  { color: var(--cyan); background: rgba(34,211,238,0.12); border-color: rgba(34,211,238,0.25); }
.badge.cyan .dot { background: var(--cyan); }
.badge.slate { color: var(--text-dim); background: rgba(255,255,255,0.05); border-color: var(--glass-border); }
.badge.slate .dot { background: var(--text-faint); }

/* pulsing live dot */
.badge.live .dot { animation: pulse-dot 1.8s ease-in-out infinite; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--green-glow); }
  50% { box-shadow: 0 0 0 5px rgba(52,211,153,0); }
}

/* ---------- Progress bars ---------- */
.progress-wrap { display: flex; flex-direction: column; gap: 5px; }
.progress {
  height: 7px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.06);
  overflow: hidden; display: flex;
}
.progress .seg { height: 100%; transition: width 0.9s var(--ease); }
.progress .seg.ok { background: linear-gradient(90deg, var(--green), #6ee7b7); box-shadow: 0 0 10px var(--green-glow); }
.progress .seg.err { background: linear-gradient(90deg, #f43f5e, var(--red)); }
.progress-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-dim); }
.progress-legend b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Forms layout ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.field-full { grid-column: 1 / -1; }

/* multi-select chip box */
.chip-box {
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  background: rgba(0,0,0,0.2);
  padding: 8px;
  max-height: 168px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.chip-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  font-size: 13.5px; cursor: pointer;
  transition: background 0.15s;
}
.chip-opt:hover { background: var(--glass-strong); }
.chip-opt input { display: none; }
.chip-opt .check {
  width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid var(--glass-border-strong);
  display: grid; place-items: center; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.chip-opt .check svg { width: 12px; height: 12px; opacity: 0; transition: opacity 0.15s; }
.chip-opt input:checked + .check {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border-color: transparent;
}
.chip-opt input:checked + .check svg { opacity: 1; }
.chip-opt .sub { color: var(--text-faint); font-size: 12px; }

/* ---------- Stepper (account auth) ---------- */
.stepper { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.step {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-faint);
}
.step .num {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px;
  border: 1.5px solid var(--glass-border); background: var(--glass);
  transition: all 0.3s var(--ease);
}
.step.active { color: var(--text); }
.step.active .num {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border-color: transparent; color: #fff;
  box-shadow: 0 0 14px -2px var(--accent-glow);
}
.step.done .num { background: rgba(52,211,153,0.2); border-color: rgba(52,211,153,0.5); color: var(--green); }
.step-line { flex: 1; height: 1.5px; background: var(--glass-border); border-radius: 2px; min-width: 16px; }
.step-line.done { background: rgba(52,211,153,0.5); }

.step-panel {
  margin-top: 14px; padding: 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  background: rgba(99,102,241,0.05);
  animation: slide-up 0.3s var(--ease);
}

/* ============================================================================
   LOGS
   ========================================================================== */
.log-feed { display: flex; flex-direction: column; gap: 2px; }
.log-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--r-sm);
  transition: background 0.15s;
}
.log-row:hover { background: var(--glass); }
.log-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; margin-top: 1px;
}
.log-ico svg { width: 14px; height: 14px; }
.log-ico.info { color: var(--text-dim); background: rgba(255,255,255,0.05); }
.log-ico.success { color: var(--green); background: rgba(52,211,153,0.12); }
.log-ico.warning { color: var(--amber); background: rgba(251,191,36,0.12); }
.log-ico.error { color: var(--red); background: rgba(251,113,133,0.12); }
.log-body { flex: 1; min-width: 0; }
.log-msg { font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.log-foot { font-size: 11px; color: var(--text-faint); margin-top: 3px; display: flex; gap: 10px; }

/* ============================================================================
   EMPTY / ERROR STATES
   ========================================================================== */
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-dim);
}
.empty .ico {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 18px; display: grid; place-items: center;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  color: var(--text-faint);
}
.empty .ico svg { width: 26px; height: 26px; }
.empty h3 { margin: 0 0 5px; font-size: 16px; color: var(--text); font-weight: 700; }
.empty p { margin: 0; font-size: 13px; }
.state-error { color: var(--red); }

/* ============================================================================
   SKELETON SHIMMER
   ========================================================================== */
.skel {
  border-radius: var(--r-sm);
  background: linear-gradient(100deg,
    rgba(255,255,255,0.04) 30%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-card { height: 96px; }
.skel-row { height: 78px; }
.skel-line { height: 12px; margin: 6px 0; }

/* ============================================================================
   TOAST
   ========================================================================== */
#toast-wrap {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100vw - 28px));
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: rgba(18,18,26,0.98);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--shadow-pop);
  font-size: 13.5px; font-weight: 500;
  animation: toast-in 0.35s var(--ease);
}
.toast.out { animation: toast-out 0.3s var(--ease) forwards; }
.toast .t-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
}
.toast .t-ico svg { width: 15px; height: 15px; }
.toast.ok .t-ico { color: var(--green); background: rgba(52,211,153,0.15); }
.toast.err .t-ico { color: var(--red); background: rgba(251,113,133,0.15); }
.toast .t-bar {
  position: absolute; left: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--indigo), var(--violet));
  border-radius: 2px;
}

/* ============================================================================
   MODAL (glass confirm)
   ========================================================================== */
#modal-root {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(4,4,8,0.74);
  animation: fade-in 0.2s var(--ease);
}
.modal {
  width: 100%; max-width: 360px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.3s var(--ease);
}
.modal .m-ico {
  width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 14px;
  display: grid; place-items: center;
  background: rgba(251,113,133,0.14); color: var(--red);
}
.modal .m-ico svg { width: 22px; height: 22px; }
.modal h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; text-align: center; }
.modal p { margin: 0 0 20px; font-size: 13.5px; color: var(--text-dim); text-align: center; line-height: 1.5; }
.modal .m-actions { display: flex; gap: 10px; }
.modal .m-actions .btn { flex: 1; }
.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 24px -8px var(--red-glow);
}

/* ============================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

/* page transition */
.page-enter { animation: page-in 0.28s var(--ease) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* staggered list entrance */
.stagger > * {
  opacity: 0;
  animation: slide-up 0.4s var(--ease) forwards;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .stagger > * { opacity: 1 !important; }
  .badge.live .dot { animation: none !important; }
}

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }
