/* ========================================
   ChumChum Noti - Design System
   Premium Dark Glassmorphism UI
   ======================================== */

/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
  /* Colors */
  --bg-primary: #06060b;
  --bg-secondary: #0d0d14;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
  --accent-glow: rgba(139, 92, 246, 0.3);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.3);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);

  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: rgba(239, 68, 68, 0.3);

  --info: #6366f1;
  --info-bg: rgba(99, 102, 241, 0.1);
  --info-border: rgba(99, 102, 241, 0.3);

  --new-card: #6366f1;
  --completed: #10b981;
  --summary: #8b5cf6;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --fs-h1: 1.75rem;
  --fs-h2: 1.25rem;
  --fs-body: 0.9375rem;
  --fs-small: 0.8125rem;
  --fs-caption: 0.75rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* --- Typography --- */
h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.01em; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); font-size: var(--fs-small); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: #a78bfa; }

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes soundWave {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

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

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

/* --- Header --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-md) var(--space-lg);
  background: rgba(6, 6, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.logo-area h1 {
  font-size: 1.25rem;
  background: var(--accent-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

/* --- Connection Status --- */
.connection-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  transition: all var(--transition-normal);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse 2s ease-in-out infinite;
  transition: background var(--transition-normal), box-shadow var(--transition-normal);
}

.connection-status.connected .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.connection-status.disconnected .status-dot {
  background: var(--error);
  box-shadow: 0 0 8px var(--error);
  animation: none;
}

/* --- Main Content --- */
main {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* --- Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  animation: fadeInUp 0.5s ease forwards;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: 2rem;
  line-height: 1;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Glass Card --- */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeInUp 0.5s ease forwards;
}

.glass-card:nth-child(2) { animation-delay: 0.1s; }
.glass-card:nth-child(3) { animation-delay: 0.2s; }

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

.card-header h2 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1rem;
}

/* --- TTS Controls --- */
.tts-controls .controls-grid {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.control-item {
  display: grid;
  grid-template-columns: 70px 1fr 48px;
  align-items: center;
  gap: var(--space-sm);
}

.control-item label {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  font-weight: 500;
}

.control-value {
  text-align: right;
  font-size: var(--fs-caption);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.control-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

/* --- Range Slider --- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
}

/* --- Sound Wave Indicator --- */
.sound-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
  opacity: 0.3;
  transition: opacity var(--transition-normal);
}

.sound-wave.active {
  opacity: 1;
}

.sound-wave span {
  display: block;
  width: 3px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transform: scaleY(0.3);
  transform-origin: bottom;
}

.sound-wave.active span {
  animation: soundWave 0.6s ease-in-out infinite;
}

.sound-wave span:nth-child(1) { height: 12px; animation-delay: 0s; }
.sound-wave span:nth-child(2) { height: 20px; animation-delay: 0.15s; }
.sound-wave span:nth-child(3) { height: 16px; animation-delay: 0.3s; }
.sound-wave span:nth-child(4) { height: 10px; animation-delay: 0.45s; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 10px 18px;
  font-family: var(--font-family);
  font-size: var(--fs-small);
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition-fast);
}

.btn:hover::after { background: rgba(255, 255, 255, 0.05); }
.btn:active::after { background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-gradient);
  background-size: 200% auto;
  color: #fff;
  box-shadow: var(--shadow-sm), 0 0 15px var(--accent-glow);
}
.btn-primary:hover {
  background-position: right center;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--fs-caption);
  border-radius: var(--radius-sm);
}

.btn-block { width: 100%; }

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: var(--fs-caption);
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1;
}

/* --- Notification Feed --- */
.notification-section .notification-feed {
  max-height: 50vh;
  overflow-y: auto;
  padding: var(--space-sm);
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  background: var(--surface);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--border);
  animation: fadeInUp 0.4s ease forwards;
  transition: background var(--transition-fast);
}

.notification-item:hover {
  background: var(--surface-hover);
}

.notification-item.type-new_card { border-left-color: var(--new-card); }
.notification-item.type-card_completed { border-left-color: var(--completed); }
.notification-item.type-summary { border-left-color: var(--summary); }
.notification-item.type-test { border-left-color: var(--text-muted); }

.notif-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-message {
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}

.notif-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 4px;
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

.notif-board {
  padding: 2px 8px;
  background: var(--surface);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 0.6875rem;
}

.notif-time {
  flex-shrink: 0;
  font-size: var(--fs-caption);
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: var(--fs-small);
}

/* --- Footer --- */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) var(--space-lg);
  background: rgba(6, 6, 11, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

footer .btn { font-size: var(--fs-small); }

/* --- Activation Overlay --- */
.activation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  background: rgba(6, 6, 11, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  cursor: pointer;
  transition: opacity var(--transition-slow);
}

.activation-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.activation-icon {
  font-size: 4rem;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.activation-text {
  font-size: var(--fs-h2);
  font-weight: 600;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.activation-hint {
  color: var(--text-muted);
  font-size: var(--fs-small);
}

/* ============================================
   SETUP PAGE STYLES
   ============================================ */

.setup-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.setup-header .btn { flex-shrink: 0; }

.setup-header h1 {
  font-size: 1.25rem;
}

.setup-main {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  padding-bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* --- Setup Section --- */
.setup-section {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.5s ease forwards;
  overflow: hidden;
}

.setup-section:nth-child(2) { animation-delay: 0.1s; }
.setup-section:nth-child(3) { animation-delay: 0.2s; }
.setup-section:nth-child(4) { animation-delay: 0.3s; }

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: var(--fs-small);
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 1rem;
}

.section-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* --- Form Elements --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group label {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--fs-small);
  outline: none;
  transition: all var(--transition-normal);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.06);
}

.form-input::placeholder { color: var(--text-muted); }

.form-hint {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  line-height: 1.4;
}

.form-hint a { color: var(--accent); }

select.form-input {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* --- Status Indicator --- */
.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
}

.status-indicator.status-ok {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.status-indicator.status-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.status-indicator.status-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}

/* --- Board Card --- */
.board-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.board-card:hover {
  border-color: var(--border-hover);
}

.board-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  cursor: pointer;
  user-select: none;
}

.board-card-header:hover { background: var(--surface-hover); }

.board-name {
  font-weight: 600;
  font-size: var(--fs-small);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.board-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.board-card-body {
  padding: 0 var(--space-md) var(--space-md);
  display: none;
}

.board-card.expanded .board-card-body { display: block; }

.board-card .expand-icon {
  transition: transform var(--transition-normal);
  font-size: var(--fs-small);
}

.board-card.expanded .expand-icon { transform: rotate(180deg); }

/* --- List Config Row --- */
.list-config {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-caption);
}

.list-name {
  font-weight: 500;
  font-size: var(--fs-small);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row select {
  padding: 4px 24px 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--fs-caption);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  outline: none;
}

.list-row select:focus {
  border-color: var(--accent);
}

.list-row select option,
select.form-input option {
  background-color: #1a1a24; /* Muted dark color for dropdown background */
  color: #f8fafc; /* Light text */
}

/* --- Available Boards (add board) --- */
.available-boards {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.available-board-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
}

/* --- Webhook Status --- */
.webhook-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-caption);
}

.webhook-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.webhook-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.webhook-dot.inactive { background: var(--text-muted); }

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: calc(100% - 2 * var(--space-lg));
  max-width: 400px;
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--fs-small);
  font-weight: 500;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
}

.toast.toast-out { animation: toastOut 0.3s ease forwards; }

.toast-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.toast-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}

.toast-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info);
}

/* --- Loading Spinner --- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

.spinner-sm { width: 14px; height: 14px; border-width: 2px; }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

/* --- Toggle Switch --- */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition-normal);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #fff;
}

/* --- Responsive --- */
@media (max-width: 400px) {
  :root { font-size: 14px; }
  main, .setup-main { padding: var(--space-sm) var(--space-md); padding-bottom: 100px; }
  header { padding: var(--space-sm) var(--space-md); }
  .stats-row { gap: var(--space-sm); }
  .stat-card { padding: var(--space-sm); gap: var(--space-sm); }
  .stat-icon { font-size: 1.5rem; }
  .stat-value { font-size: 1.25rem; }
  .control-item { grid-template-columns: 60px 1fr 40px; }

  .list-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .list-row select { width: 100%; }
}

@media (min-width: 768px) {
  main, .setup-main { padding: var(--space-lg) var(--space-xl); }
}
