/* ── Settings Slideover ────────────────────────────────────────── */
#settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: var(--trans);
}

#settings-overlay.active {
  opacity: 1;
  visibility: visible;
}

#settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 10001;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

#settings-panel.active {
  transform: translateX(0);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.settings-header h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.settings-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  transition: var(--trans);
  line-height: 1;
}

.settings-close-btn:hover {
  color: var(--text);
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Settings Sections (Accordion) ─────────────────────────────── */
.settings-section {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  overflow: hidden;
  flex-shrink: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--surface);
  transition: var(--trans);
}

.section-header:hover {
  background: var(--surface2);
}

.section-header h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: var(--muted);
}

.settings-section.open .accordion-arrow {
  transform: rotate(90deg);
}

.section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.settings-section.open .section-body {
  max-height: 800px;
}

.section-body-inner {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field label {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-dim);
}

.settings-field input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 12px;
  outline: none;
  transition: var(--trans);
}

.settings-field input:focus {
  border-color: var(--accent);
}

.settings-field input[readonly] {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
  border-color: transparent;
}

/* ── Telegram Status ───────────────────────────────────────────── */
.telegram-status-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.connected { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.status-dot.disconnected { background: var(--muted); }

.telegram-instructions {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  background: var(--bg);
  padding: 12px;
  border-radius: 4px;
}

.telegram-instructions code {
  font-family: var(--font-mono);
  color: var(--accent);
}

.telegram-instructions a {
  color: var(--accent2);
  text-decoration: none;
}

.telegram-instructions a:hover {
  text-decoration: underline;
}

/* ── Danger Zone ───────────────────────────────────────────────── */
.danger-accordion .section-header h3 {
  color: var(--danger);
}

.danger-accordion .accordion-arrow {
  color: var(--danger);
}

.danger-zone {
  border: 1px solid rgba(255, 79, 79, 0.3);
  background: rgba(255, 79, 79, 0.05);
  border-radius: var(--radius);
  padding: 16px;
}

.danger-text {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: var(--trans);
  width: 100%;
}

.btn-danger:hover {
  background: rgba(255, 79, 79, 0.1);
}