:root {
  --bg: #070708;
  --bg-elevated: #0c0c0f;
  --surface-1: #121216;
  --surface-2: #18181e;
  --surface-3: #1f1f27;
  --surface-solid: #141418;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.11);
  --border-highlight: rgba(255, 255, 255, 0.14);
  --text: #eef0f4;
  --text-secondary: #9ca3af;
  --text-muted: #636875;
  --accent: #d1d5de;
  --accent-soft: rgba(255, 255, 255, 0.06);
  --accent-glow: rgba(255, 255, 255, 0.04);
  --success: #86efac;
  --success-soft: rgba(134, 239, 172, 0.1);
  --danger: #fca5a5;
  --danger-soft: rgba(252, 165, 165, 0.1);
  --warn: #fcd34d;
  --warn-soft: rgba(252, 211, 77, 0.1);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

.mesh-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255,255,255,0.04), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(255,255,255,0.02), transparent 50%),
    var(--bg);
}

.bg-glow { display: none; }

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + var(--safe-bottom));
}

/* ── Header ── */

.top-bar {
  margin-bottom: 24px;
  padding-top: 4px;
}

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

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(165deg, var(--surface-3) 0%, var(--surface-1) 100%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.brand-icon svg, .brand-icon .ico { width: 22px; height: 22px; }

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── States ── */

.state-screen {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.state-screen p { font-size: 14px; margin-top: 14px; }

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-screen .error-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden { display: none !important; }

/* ── Sections ── */

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

.section-head h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ── Cards ── */

.card {
  background: linear-gradient(165deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.card-elevated {
  background: linear-gradient(165deg, var(--surface-3) 0%, var(--surface-2) 45%, var(--surface-1) 100%);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.card-accent {
  background: linear-gradient(165deg, var(--surface-3) 0%, var(--surface-2) 45%, var(--surface-1) 100%);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-inset), var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 12px;
}

.card-icon .ico { width: 18px; height: 18px; }

.card-dim {
  background: rgba(255,255,255,0.02);
  box-shadow: none;
}

.card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.card-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card-icon-wrap svg { width: 20px; height: 20px; }

.desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}

.desc.no-mb { margin-bottom: 0; }

.desc code {
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text);
}

.footnote {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
  text-align: center;
}

/* ── Group list ── */

.groups-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.group-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.group-card:active {
  transform: scale(0.985);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.group-avatar {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.group-card-body { flex: 1; min-width: 0; }

.group-card-title {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-card-mode {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-card-mode .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.group-card-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.group-card-chevron svg { width: 18px; height: 18px; }

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* ── Panel top ── */

.panel-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

.panel-title-wrap { flex: 1; min-width: 0; }

.panel-title-wrap h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.25;
  word-break: break-word;
}

.group-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.icon-btn svg { width: 20px; height: 20px; }

/* ── Status list ── */

.status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  font-size: 14px;
}

.status-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-icon svg { width: 14px; height: 14px; }

.status-item.ok .status-icon {
  background: var(--success-soft);
  color: var(--success);
}

.status-item.bad .status-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-item span { flex: 1; font-weight: 500; }

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn:active { transform: scale(0.98); opacity: 0.9; }

.btn-primary {
  background: linear-gradient(180deg, #2a2a32 0%, #1a1a20 100%);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-inset), var(--shadow-sm);
}

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

.btn-sm {
  padding: 12px 16px;
  font-size: 13px;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Mode switch ── */

.mode-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.mode-card:active { transform: scale(0.99); }

.mode-card.active {
  border-color: rgba(91, 140, 255, 0.5);
  background: var(--accent-soft);
}

.mode-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-icon svg { width: 20px; height: 20px; }

.mode-icon.kick {
  background: var(--danger-soft);
  color: var(--danger);
}

.mode-icon.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.mode-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-info strong {
  font-size: 14px;
  font-weight: 700;
}

.mode-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.mode-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
}

.mode-card.active .mode-check {
  border-color: var(--accent);
  background: var(--accent);
}

.mode-card.active .mode-check::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Form ── */

.form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form textarea,
.form input[type="number"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.form textarea:focus,
.form input:focus {
  border-color: rgba(91, 140, 255, 0.45);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.interval-input input {
  width: 72px;
  margin-bottom: 0;
  text-align: center;
}

.interval-input span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Scheduled ── */

.scheduled-list { margin: 14px 0 0; }

.scheduled-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
}

.scheduled-item-text {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: 10px;
}

.scheduled-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge.on {
  background: var(--success-soft);
  color: var(--success);
}

.badge.off {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.scheduled-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.scheduled-actions button {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.scheduled-actions .btn-del {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
  background: var(--danger-soft);
}

/* ── Commands ── */

.cmd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cmd {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

.cmd code {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.cmd span {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Legacy create-bot (keep compat) ── */

.create-bot-modal { position: relative; text-align: center; padding: 8px 0 24px; }
.create-bot-close { position: absolute; top: 0; left: 0; width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--surface-solid); color: var(--text-muted); font-size: 22px; cursor: pointer; }
.create-bot-logo { width: 72px; height: 72px; margin: 12px auto 16px; border-radius: 50%; background: linear-gradient(135deg, #141722, #1c2030); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; border: 1px solid var(--border); }
.create-bot-title { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.create-bot-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 20px; }
.create-bot-desc .accent { color: var(--accent); font-weight: 600; }
.field-row.legacy { background: rgba(255,255,255,0.04); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.field-input { width: 100%; padding: 14px 16px; border: none; background: transparent; color: var(--text); font-size: 16px; font-family: inherit; outline: none; }
.create-bot-actions { display: flex; gap: 10px; margin-top: 8px; }
.create-bot-actions .btn { flex: 1; }
.success-icon { width: 64px; height: 64px; margin: 20px auto; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 32px; display: flex; align-items: center; justify-content: center; }

/* ── Dashboard ── */

#dashboard { padding-bottom: 72px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + var(--safe-bottom));
  width: min(448px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-1) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  z-index: 50;
  box-shadow: var(--shadow-lg), var(--shadow-inset);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 14px;
  transition: background 0.2s, color 0.2s;
}

.nav-ico {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-ico .ico { width: 17px; height: 17px; }

.nav-item.active { color: var(--text); }
.nav-item.active .nav-ico {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  box-shadow: var(--shadow-inset), 0 2px 8px rgba(0,0,0,0.35);
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(165deg, var(--surface-3) 0%, var(--surface-1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-md);
}

.ico-wrap.stat {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-inset), var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.ico-wrap.stat .ico { width: 20px; height: 20px; }

.stat-body { min-width: 0; }
.stat-val { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.ico, .ico-wrap .ico { width: 20px; height: 20px; display: block; }
.ico-inline { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.chevron-sm { width: 16px; height: 16px; color: var(--text-muted); }

.ico-wrap.sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-inset);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.ico-wrap.sm .ico { width: 16px; height: 16px; }

.quick-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  box-shadow: var(--shadow-inset), var(--shadow-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.act-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  box-shadow: var(--shadow-inset), var(--shadow-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.act-btn span { line-height: 1.2; }
.act-btn.danger { color: var(--danger); border-color: rgba(252,165,165,0.15); background: linear-gradient(180deg, rgba(252,165,165,0.08), var(--surface-1)); }

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.member-row, .group-card {
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
}

.sheet-panel {
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-1) 100%);
  box-shadow: 0 -12px 40px rgba(0,0,0,0.6);
}

.info-rows { display: flex; flex-direction: column; gap: 10px; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--text-muted); }
.info-row strong { font-weight: 700; font-size: 13px; }

.quick-btns { display: flex; flex-direction: column; gap: 8px; }
.quick-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  box-shadow: var(--shadow-inset), var(--shadow-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.icon-del {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(252,165,165,0.15);
  background: var(--danger-soft);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-del .ico { width: 15px; height: 15px; }

.search-box { margin-bottom: 10px; }
.search-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.list-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

.member-list { display: flex; flex-direction: column; gap: 6px; }
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.member-row:active { opacity: 0.85; }

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.member-avatar.lg { width: 56px; height: 56px; font-size: 22px; margin: 0 auto 10px; }

.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px; }
.member-chevron { color: var(--text-muted); font-size: 20px; }

.badge.role-moderator { background: var(--accent-soft); color: var(--accent); }
.badge.role-immune { background: var(--warn-soft); color: var(--warn); }
.badge.warn-badge { background: rgba(251,191,36,0.15); color: var(--warn); }

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 14px;
  font-size: 14px;
  font-weight: 600;
}
.toggle-row input { width: 44px; height: 26px; accent-color: var(--accent); }

.select, .input-sm {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 12px;
}
.input-sm { width: 80px; margin-bottom: 0; }

.inline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.inline-form input { padding: 11px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); font-family: inherit; }

.word-item, .role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 13px;
}
.word-text { flex: 1; font-weight: 600; }
.icon-del {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.log-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  display: grid;
  gap: 2px;
}
.log-item strong { color: var(--accent); }
.muted { color: var(--text-muted); font-size: 11px; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface-solid);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px calc(24px + var(--safe-bottom));
  border: 1px solid var(--border);
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 99px;
  margin: 0 auto 16px;
}
.sheet-header { text-align: center; margin-bottom: 16px; }
.sheet-header h3 { font-size: 18px; font-weight: 800; margin-top: 8px; }

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.act-btn:active { opacity: 0.85; }

.warn-list { margin-top: 12px; }
.warn-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-pane { animation: fadeIn 0.2s ease; pointer-events: auto; position: relative; z-index: 1; }

.hint-block {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.save-all-btn { margin: 4px 0 16px; }

.mode-card {
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.role-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.role-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.role-pick {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.role-pick.active {
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-inset);
}

.role-pick.danger { color: var(--danger); border-color: rgba(252,165,165,0.2); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
