:root {
  color-scheme: dark;
  --bg0: #030005;
  --bg1: #0a0118;
  --bg2: #12022a;
  --bg3: #1a0835;
  --line: rgba(191, 0, 255, 0.18);
  --line-bright: rgba(217, 70, 239, 0.45);
  --text: #f5f0ff;
  --muted: #b8a8d8;
  --muted2: #7c6a9e;
  --neon: #bf00ff;
  --neon2: #d946ef;
  --neon3: #a855f7;
  --neon-soft: rgba(191, 0, 255, 0.14);
  --neon-glow: rgba(191, 0, 255, 0.35);
  --neon-glow-strong: rgba(217, 70, 239, 0.55);
  --silver: #e8e0ff;
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  --shadow-neon: 0 0 24px rgba(191, 0, 255, 0.22), 0 0 48px rgba(168, 85, 247, 0.12);
  --radius: 18px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font);
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 100% -5%, rgba(191, 0, 255, 0.16), transparent 58%),
    radial-gradient(700px 480px at -5% 10%, rgba(168, 85, 247, 0.14), transparent 55%),
    radial-gradient(500px 300px at 50% 100%, rgba(217, 70, 239, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, #070010);
}

.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(191, 0, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191, 0, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, black, transparent);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.ambient-orb-1 {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: rgba(191, 0, 255, 0.22);
}

.ambient-orb-2 {
  width: 220px;
  height: 220px;
  bottom: 10%;
  left: -70px;
  background: rgba(168, 85, 247, 0.18);
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding:
    calc(12px + var(--safe-top))
    16px
    calc(20px + var(--safe-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.topbar-profile-hit {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 6px 6px 6px 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 16px;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar-profile-hit:active {
  transform: scale(0.99);
  background: rgba(191, 0, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(191, 0, 255, 0.06);
}

.topbar-back {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: rgba(191, 0, 255, 0.06);
  color: var(--neon2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(191, 0, 255, 0.12);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.topbar-back:active {
  transform: scale(0.96);
  background: rgba(191, 0, 255, 0.14);
  box-shadow: 0 0 20px rgba(191, 0, 255, 0.28);
}

.topbar-back.hidden { visibility: hidden; pointer-events: none; }

.topbar-title-wrap { min-width: 0; }

.topbar-kicker {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neon2);
  margin-bottom: 2px;
  text-shadow: 0 0 12px rgba(217, 70, 239, 0.45);
}

.topbar-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--silver);
}

.topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--neon), var(--neon2));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 0 18px rgba(191, 0, 255, 0.45),
    0 0 36px rgba(168, 85, 247, 0.2),
    inset 0 0 12px rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.view {
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes neonPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(191, 0, 255, 0.25), inset 0 0 16px rgba(191, 0, 255, 0.06); }
  50% { box-shadow: 0 0 28px rgba(217, 70, 239, 0.38), inset 0 0 20px rgba(191, 0, 255, 0.1); }
}

/* ---------- Neon brand mark ---------- */

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.brand-hex-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
}

.brand-hex-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  background: linear-gradient(135deg, rgba(191, 0, 255, 0.25), rgba(168, 85, 247, 0.08));
  border: none;
  box-shadow:
    0 0 24px rgba(191, 0, 255, 0.35),
    inset 0 0 20px rgba(191, 0, 255, 0.12);
}

.brand-hex-wrap::after {
  content: "";
  position: absolute;
  inset: 4px;
  clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  border: 1px solid rgba(217, 70, 239, 0.55);
  box-shadow: 0 0 16px rgba(191, 0, 255, 0.3);
}

.brand-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(191, 0, 255, 0.35);
  box-shadow: 0 0 20px rgba(191, 0, 255, 0.2);
}

.brand-icon {
  position: relative;
  z-index: 1;
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(217, 70, 239, 0.8));
}

.brand-ai {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--neon);
  text-shadow:
    0 0 10px rgba(191, 0, 255, 0.9),
    0 0 24px rgba(191, 0, 255, 0.5);
}

.brand-max {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  color: var(--silver);
  text-shadow: 0 0 10px rgba(232, 224, 255, 0.35);
}

.hero {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line-bright);
  background:
    linear-gradient(180deg, rgba(191, 0, 255, 0.08), rgba(10, 1, 24, 0.6));
  box-shadow: var(--shadow-neon);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 70, 239, 0.7), transparent);
}

.hero-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--silver);
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(191, 0, 255, 0.04);
  box-shadow: inset 0 0 20px rgba(191, 0, 255, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--neon2);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--silver);
  text-shadow: 0 0 12px rgba(191, 0, 255, 0.2);
}

.section-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon);
  margin: 0 0 10px 4px;
  text-shadow: 0 0 14px rgba(191, 0, 255, 0.4);
}

.menu-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.menu-grid.cols-1 { grid-template-columns: 1fr; }
.menu-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.menu-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.menu-btn {
  appearance: none;
  border: 1px solid var(--line-bright);
  background:
    linear-gradient(160deg, rgba(191, 0, 255, 0.1), rgba(10, 1, 24, 0.85));
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  min-height: 72px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    inset 0 0 24px rgba(191, 0, 255, 0.04);
}

.menu-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.14s ease;
}

.menu-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  opacity: 0.5;
}

.menu-btn:active {
  transform: scale(0.985);
  border-color: rgba(217, 70, 239, 0.75);
  box-shadow:
    0 0 22px rgba(191, 0, 255, 0.35),
    inset 0 0 28px rgba(191, 0, 255, 0.1);
}

.menu-btn:active::before { opacity: 1; }

.menu-btn.wide {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.menu-btn.compact {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.menu-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  border: 1px solid rgba(191, 0, 255, 0.25);
  box-shadow: 0 0 14px rgba(191, 0, 255, 0.15);
}

.menu-icon.blue,
.menu-icon.violet,
.menu-icon.green,
.menu-icon.amber,
.menu-icon.rose,
.menu-icon.slate {
  background: linear-gradient(135deg, rgba(191, 0, 255, 0.22), rgba(168, 85, 247, 0.1));
  box-shadow: 0 0 16px rgba(191, 0, 255, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.menu-text { position: relative; z-index: 1; }

.menu-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--silver);
}

.menu-desc {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

.panel-card {
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(191, 0, 255, 0.06), rgba(10, 1, 24, 0.7));
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-neon);
}

.panel-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.panel-card p + p { margin-top: 10px; }

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

.list-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(191, 0, 255, 0.05);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 14px;
  text-align: left;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.list-btn:active {
  transform: scale(0.99);
  background: rgba(191, 0, 255, 0.12);
  box-shadow: 0 0 18px rgba(191, 0, 255, 0.22);
}

.list-btn.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-note {
  text-align: center;
  color: var(--muted2);
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 8px 4px 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(18, 2, 42, 0.96);
  border: 1px solid var(--line-bright);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.35;
  box-shadow: var(--shadow-neon);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 380px) {
  .menu-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .menu-grid.cols-3 .menu-btn:last-child { grid-column: 1 / -1; }
}

/* ---------- Profile sheet ---------- */

.profile-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  visibility: hidden;
}

.profile-sheet.open {
  pointer-events: auto;
  visibility: visible;
}

.profile-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 0, 8, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.profile-sheet.open .profile-backdrop { opacity: 1; }

.profile-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(92vh, 760px);
  overflow: auto;
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--line-bright);
  border-bottom: 0;
  background:
    linear-gradient(180deg, #16032e 0%, #0a0118 55%, #030005 100%);
  box-shadow:
    0 -20px 60px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(191, 0, 255, 0.12);
  padding: 10px 16px calc(24px + var(--safe-bottom));
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-sheet.open .profile-panel { transform: translateY(0); }

.profile-grabber {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(191, 0, 255, 0.45);
  box-shadow: 0 0 10px rgba(191, 0, 255, 0.4);
  margin: 2px auto 12px;
}

.profile-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(191, 0, 255, 0.08);
  color: var(--neon2);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(191, 0, 255, 0.15);
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--neon), var(--neon2));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 24px rgba(191, 0, 255, 0.45),
    0 0 48px rgba(168, 85, 247, 0.2);
  flex-shrink: 0;
}

.profile-hero-meta { min-width: 0; }

.profile-name {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.2;
  color: var(--silver);
}

.profile-id {
  margin: 0;
  color: var(--muted2);
  font-size: 0.78rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.profile-badge.ok {
  color: #e9d5ff;
  background: rgba(191, 0, 255, 0.14);
  border-color: rgba(217, 70, 239, 0.35);
  box-shadow: 0 0 12px rgba(191, 0, 255, 0.2);
}

.profile-badge.warn {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.25);
}

.profile-badge.muted {
  color: var(--muted);
  background: rgba(191, 0, 255, 0.06);
  border-color: var(--line);
}

.profile-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(191, 0, 255, 0.04);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 24px rgba(191, 0, 255, 0.04);
}

.profile-card-title {
  margin: 0 0 10px;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--neon2);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(217, 70, 239, 0.35);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(191, 0, 255, 0.1);
  font-size: 0.92rem;
}

.profile-row:last-child { border-bottom: 0; padding-bottom: 0; }
.profile-row span:first-child { color: var(--muted); }
.profile-row strong { font-weight: 650; text-align: right; color: var(--silver); }

.profile-progress { margin-top: 12px; }

.profile-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(191, 0, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
}

.profile-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  box-shadow: 0 0 12px rgba(191, 0, 255, 0.6);
  transition: width 0.3s ease;
}

.profile-progress-caption {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.profile-metric {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(191, 0, 255, 0.04);
}

.profile-metric .label {
  font-size: 0.74rem;
  color: var(--neon2);
  margin-bottom: 6px;
  opacity: 0.85;
}

.profile-metric .value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--silver);
}

.profile-action {
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(217, 70, 239, 0.55);
  background: linear-gradient(135deg, rgba(191, 0, 255, 0.22), rgba(168, 85, 247, 0.12));
  color: var(--silver);
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow:
    0 0 20px rgba(191, 0, 255, 0.2),
    inset 0 0 16px rgba(191, 0, 255, 0.06);
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}

.profile-action:active {
  transform: scale(0.99);
  box-shadow: 0 0 28px rgba(191, 0, 255, 0.38);
}

.profile-loading {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
}

.profile-hint {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 12px;
}

.profile-hint.ok-hint {
  color: #e9d5ff;
  text-shadow: 0 0 10px rgba(191, 0, 255, 0.25);
}

.profile-card.compact {
  padding: 12px 14px;
}

.hint-block {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.hint-block b,
.panel-card b {
  color: var(--neon2);
}

.bind-label {
  display: block;
  font-size: 0.78rem;
  color: var(--neon2);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.bind-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-bright);
  background: rgba(0, 0, 0, 0.35);
  color: var(--silver);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  box-shadow: inset 0 0 16px rgba(191, 0, 255, 0.06);
}

.bind-input:focus {
  outline: none;
  border-color: rgba(217, 70, 239, 0.75);
  box-shadow:
    0 0 18px rgba(191, 0, 255, 0.25),
    inset 0 0 16px rgba(191, 0, 255, 0.08);
}

.profile-action.secondary {
  border-color: rgba(191, 0, 255, 0.28);
  background: rgba(191, 0, 255, 0.06);
  box-shadow: none;
}

.bind-code-display {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(217, 70, 239, 0.45);
  background: rgba(191, 0, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(191, 0, 255, 0.06);
}

.bind-code-label {
  display: block;
  font-size: 0.76rem;
  color: var(--neon2);
  margin-bottom: 6px;
}

.bind-code-value {
  display: block;
  font-size: 0.88rem;
  word-break: break-all;
  color: #e9d5ff;
  text-shadow: 0 0 10px rgba(191, 0, 255, 0.35);
  margin-bottom: 8px;
}

.list-btn.accent {
  border-color: rgba(217, 70, 239, 0.5);
  background: rgba(191, 0, 255, 0.1);
  box-shadow: 0 0 16px rgba(191, 0, 255, 0.15);
}

.list-btn.danger {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.18);
}

.list-btn.danger-outline {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.06);
  color: #fda4af;
}

.bind-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-bright);
  background: rgba(0, 0, 0, 0.35);
  color: var(--silver);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 10px;
  resize: vertical;
  min-height: 96px;
  font-family: var(--font);
}

.bind-textarea:focus {
  outline: none;
  border-color: rgba(217, 70, 239, 0.75);
  box-shadow: 0 0 18px rgba(191, 0, 255, 0.2);
}

.editor-block {
  margin-top: 10px;
}

.editor-block.compact {
  margin-top: 8px;
}

.section-sub {
  margin: 12px 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--neon2);
  letter-spacing: 0.04em;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.inline-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.image-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(191, 0, 255, 0.12);
}

.image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 28px;
}

.image-viewer.hidden {
  display: none;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 0, 5, 0.94);
  cursor: pointer;
}

.image-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(217, 70, 239, 0.45);
  background: rgba(10, 1, 24, 0.88);
  color: var(--silver);
  font-size: 1.1rem;
  cursor: pointer;
}

.image-viewer-img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(217, 70, 239, 0.35);
  box-shadow: 0 0 40px rgba(191, 0, 255, 0.25);
}

.chat-preview-img {
  display: block;
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  margin: 8px 0;
  border: 1px solid rgba(217, 70, 239, 0.35);
}

.file-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(217, 70, 239, 0.45);
  background: rgba(191, 0, 255, 0.08);
  color: var(--silver);
  font-size: 0.84rem;
  cursor: pointer;
  margin-right: 8px;
}

.file-upload-btn:active {
  background: rgba(191, 0, 255, 0.16);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tz-chip {
  appearance: none;
  border: 1px solid rgba(191, 0, 255, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

.tz-chip.selected {
  border-color: rgba(217, 70, 239, 0.75);
  color: var(--silver);
  background: rgba(191, 0, 255, 0.16);
  box-shadow: 0 0 16px rgba(191, 0, 255, 0.22);
}

.tz-chip:active {
  transform: scale(0.98);
}

.section-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(191, 0, 255, 0.06), rgba(10, 1, 24, 0.82));
  box-shadow: inset 0 0 24px rgba(191, 0, 255, 0.04);
}

.section-card.danger-card {
  border-color: rgba(251, 113, 133, 0.35);
  background: linear-gradient(160deg, rgba(251, 113, 133, 0.08), rgba(10, 1, 24, 0.85));
}

.section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--silver);
  margin-bottom: 10px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(191, 0, 255, 0.1);
  font-size: 0.84rem;
}

.kv-row:last-child { border-bottom: none; }

.kv-row span { color: var(--muted); }

.kv-row strong {
  color: var(--silver);
  text-align: right;
  font-weight: 600;
}

.text-preview {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(191, 0, 255, 0.25);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.confirm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-list-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.chat-bind-top {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.chat-search-input {
  margin-bottom: 0;
}

.chat-card {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr 18px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-bright);
  background: linear-gradient(160deg, rgba(191, 0, 255, 0.1), rgba(10, 1, 24, 0.88));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    inset 0 0 20px rgba(191, 0, 255, 0.04);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.chat-card:active {
  transform: scale(0.985);
  box-shadow: 0 0 22px rgba(191, 0, 255, 0.28);
}

.chat-list-icon,
.chat-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(217, 70, 239, 0.45);
  box-shadow: 0 0 16px rgba(191, 0, 255, 0.2);
}

.chat-list-icon.placeholder,
.chat-hero-icon.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(191, 0, 255, 0.18);
  color: var(--silver);
  font-weight: 700;
  font-size: 1.1rem;
}

.chat-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--silver);
}

.chat-card-meta {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted2);
}

.chat-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(191, 0, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
}

.mini-badge.ok {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.1);
}

.mini-badge.off {
  border-color: rgba(124, 106, 158, 0.35);
  color: var(--muted2);
}

.chat-card-chevron {
  color: var(--neon2);
  font-size: 1.4rem;
  line-height: 1;
  opacity: 0.8;
}

.chat-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-bright);
  background:
    linear-gradient(135deg, rgba(191, 0, 255, 0.12), rgba(10, 1, 24, 0.9));
  box-shadow: var(--shadow-neon);
}

.chat-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
}

.chat-hero-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--silver);
}

.chat-hero-sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted2);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(10, 1, 24, 0.75);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.toggle-row:active {
  border-color: rgba(217, 70, 239, 0.55);
  box-shadow: 0 0 16px rgba(191, 0, 255, 0.15);
}

.toggle-row.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.toggle-row.on {
  border-color: rgba(52, 211, 153, 0.35);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.08), rgba(10, 1, 24, 0.8));
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--silver);
}

.toggle-desc {
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--muted2);
}

.neon-switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(124, 106, 158, 0.45);
  background: rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.toggle-row.on .neon-switch {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(52, 211, 153, 0.22);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

.neon-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c4b5fd;
  box-shadow: 0 0 10px rgba(191, 0, 255, 0.35);
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle-row.on .neon-switch-knob {
  transform: translateX(20px);
  background: #6ee7b7;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.55);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(191, 0, 255, 0.15);
  background: rgba(0, 0, 0, 0.22);
}

.admin-name {
  font-size: 0.84rem;
  color: var(--silver);
}

.admin-id {
  font-size: 0.76rem;
  color: var(--muted2);
}

.hidden { display: none !important; }
