/* =============================================
   TikTok Check Live - Dark Premium UI
   ============================================= */

:root {
  --bg-base: #0a0a0f;
  --bg-surface: #13131e;
  --bg-panel: #1a1a2e;
  --bg-card: #1e1e32;
  --bg-hover: #252540;
  --border: rgba(255,255,255,0.07);
  --border-active: rgba(99,102,241,0.5);

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99,102,241,0.3);

  --green: #10b981;
  --green-glow: rgba(16,185,129,0.2);
  --red: #ef4444;
  --red-glow: rgba(239,68,68,0.2);
  --orange: #f59e0b;
  --orange-glow: rgba(245,158,11,0.2);
  --yellow: #eab308;
  --gray: #6b7280;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --font: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --bg-glass: rgba(255,255,255,0.05);
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── Animated Background ── */
.bg-particles {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-particles::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  top: -200px; left: -200px;
  animation: float1 12s ease-in-out infinite;
}

.bg-particles::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation: float2 15s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-40px, -60px) scale(1.15); }
}

/* ── App Layout ── */
.app-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 0;
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(26,26,46,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

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

.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.logo-icon svg { width: 24px; height: 24px; }

.logo-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-text h1 span {
  background: linear-gradient(90deg, var(--accent-light), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-stats {
  display: flex;
  gap: 10px;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  min-width: 65px;
  transition: all 0.3s;
}

.stat-badge.live { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.05); }
.stat-badge.die { border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.05); }
.stat-badge.error { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.05); }
.stat-badge.saved { border-color: rgba(100,116,139,0.3); background: rgba(100,116,139,0.04); cursor: default; transition: all 0.3s; }

.stat-num {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--text-primary);
}

.stat-badge.live .stat-num { color: var(--green); }
.stat-badge.die .stat-num { color: var(--red); }
.stat-badge.error .stat-num { color: var(--orange); }

.stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── Main Layout ── */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* ── Panels ── */
.panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
}

.panel-input {
  width: 320px;
  min-width: 300px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
  gap: 12px;
}

.panel-results {
  flex: 1;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.panel-header svg { width: 14px; height: 14px; }

/* ── Input Section ── */
.input-section { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-optional {
  font-size: 10px;
  background: rgba(99,102,241,0.15);
  color: var(--accent-light);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
}

.input-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 140px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.6;
}

.input-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.input-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-light);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  transition: color 0.2s;
}
.btn-link:hover { color: var(--accent); }

/* ── Upload Zone ── */
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 12px;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
  color: var(--text-secondary);
}

.upload-zone svg { width: 22px; height: 22px; }

.file-label {
  color: var(--accent-light);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Settings ── */
.settings-group { display: flex; flex-direction: column; gap: 10px; }

.field-group { display: flex; flex-direction: column; gap: 5px; }

.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-item {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.range-lbl { font-size: 11px; color: var(--text-muted); width: 24px; }
.range-unit { font-size: 11px; color: var(--text-muted); }
.range-sep { color: var(--text-muted); font-size: 14px; }

.input-num {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s;
  width: 70px;
}

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

.input-text {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}

.input-text:focus { border-color: var(--accent); }
.input-text::placeholder { color: var(--text-muted); }

/* ── Buttons ── */
.action-buttons {
  display: flex;
  gap: 8px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 16px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; }

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.25);
}

.export-buttons {
  display: flex;
  gap: 6px;
}

.btn-export {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.btn-export:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(99,102,241,0.08);
}

.btn-clear-results {
  color: var(--red) !important;
}

.btn-clear-results:hover {
  border-color: var(--red) !important;
  background: rgba(239,68,68,0.1) !important;
}

/* ── Progress ── */
.progress-section {
  padding: 12px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-bar-wrap {
  height: 5px;
  background: var(--bg-card);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--accent-glow);
}

.progress-current {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 5px;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
}

.filter-tab {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.filter-tab:hover { color: var(--text-secondary); border-color: var(--border); }

.filter-tab.active {
  background: rgba(99,102,241,0.15);
  color: var(--accent-light);
  border-color: rgba(99,102,241,0.35);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  transition: border-color 0.2s;
}

.search-box:focus-within { border-color: var(--accent); }
.search-box svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font);
  width: 180px;
}

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

/* ── Results Table ── */
.table-wrap {
  flex: 1;
  overflow: auto;
  position: relative;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.results-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.results-table th {
  background: var(--bg-panel);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.results-table th:first-child { width: 46px; text-align: center; }

.results-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.results-table td:first-child { text-align: center; color: var(--text-muted); font-size: 12px; }

.results-table tbody tr {
  transition: background 0.15s;
}

.results-table tbody tr:hover {
  background: var(--bg-hover);
}

.results-table tbody tr.row-new {
  animation: rowAppear 0.4s ease;
}

@keyframes rowAppear {
  from { opacity: 0; transform: translateX(-10px); background: rgba(99,102,241,0.1); }
  to { opacity: 1; transform: translateX(0); }
}

/* Username column */
.col-username {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-light);
  cursor: pointer;
}

.col-username a { color: inherit; text-decoration: none; }
.col-username a:hover { text-decoration: underline; }

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.status-badge.live {
  background: var(--green-glow);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.3);
}

.status-badge.die {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}

.status-badge.blocked, .status-badge.banned {
  background: var(--orange-glow);
  color: var(--orange);
  border: 1px solid rgba(245,158,11,0.3);
}

.status-badge.restricted {
  background: rgba(234,179,8,0.1);
  color: var(--yellow);
  border: 1px solid rgba(234,179,8,0.3);
}

.status-badge.error, .status-badge.timeout {
  background: rgba(107,114,128,0.1);
  color: var(--gray);
  border: 1px solid rgba(107,114,128,0.3);
}

.status-badge.checking {
  background: rgba(99,102,241,0.1);
  color: var(--accent-light);
  border: 1px solid rgba(99,102,241,0.3);
  animation: pulse 1s ease-in-out infinite;
}

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

/* Number columns */
.col-number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.col-number.followers { color: #a78bfa; }
.col-number.following { color: #67e8f9; }

/* Avatar cell */
.results-table td:nth-child(2) {
  padding: 4px 8px;
  text-align: center;
}
.results-table td:nth-child(2) img,
.results-table td:nth-child(2) div {
  margin: 0 auto;
}

/* Bio cell clamp */
.results-table td .bio-text {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.col-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Error tooltip */
.error-hint {
  display: inline-block;
  margin-left: 4px;
  cursor: help;
  color: var(--orange);
  font-size: 12px;
}

/* ── Empty State ── */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.empty-state.hidden { display: none; }

.empty-icon svg {
  width: 52px; height: 52px;
  color: var(--text-muted);
  opacity: 0.4;
}

.empty-state p { font-size: 15px; }
.empty-state small { font-size: 12px; }
.empty-state strong { color: var(--text-secondary); }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 40px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(99,102,241,0.4); }

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

/* ── Status Bar ── */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.status-indicator { display: flex; align-items: center; gap: 7px; }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gray);
  transition: background 0.3s;
}

.status-dot.running { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1s ease-in-out infinite; }
.status-dot.done { background: var(--green); }
.status-dot.error { background: var(--red); }

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Format numbers ── */
.big-num { font-weight: 700; }

.spin-anim { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ── Paste Button & Input Meta Actions ── */
.input-meta-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-paste {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99,102,241,0.1) !important;
  border: 1px solid rgba(99,102,241,0.25) !important;
  border-radius: 5px !important;
  padding: 3px 10px !important;
  color: var(--accent-light) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-paste:hover {
  background: rgba(99,102,241,0.2) !important;
  border-color: rgba(99,102,241,0.5) !important;
}

.btn-paste svg {
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════════ */

/* Tablet: < 1024px */
@media (max-width: 1024px) {
  .panel-input {
    width: 280px;
    min-width: 260px;
  }

  .stat-badge {
    padding: 5px 10px;
    min-width: 55px;
  }

  .stat-num {
    font-size: 16px;
  }

  .filter-tabs {
    flex-wrap: wrap;
  }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  html, body {
    overflow: auto;
  }

  .app-wrapper {
    height: auto;
    min-height: 100vh;
  }

  /* ── Header ── */
  .app-header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .logo-group {
    width: 100%;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
  }

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

  .logo-text h1 {
    font-size: 17px;
  }

  .logo-text p {
    font-size: 10px;
  }

  .header-stats {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .stat-badge {
    flex: 1;
    min-width: 0;
    padding: 5px 6px;
  }

  .stat-num {
    font-size: 16px;
  }

  .stat-lbl {
    font-size: 9px;
  }

  /* ── Main Layout: stack vertically ── */
  .main-layout {
    flex-direction: column;
    overflow: visible;
  }

  /* ── Input Panel ── */
  .panel-input {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px;
    max-height: none;
    overflow-y: visible;
  }

  .input-textarea {
    min-height: 120px;
    font-size: 13px;
  }

  .upload-zone {
    padding: 10px;
  }

  /* ── Action buttons ── */
  .action-buttons {
    flex-direction: row;
  }

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

  .export-buttons {
    flex-wrap: wrap;
  }

  .export-buttons .btn-export {
    flex: 1;
    min-width: calc(50% - 4px);
  }

  /* ── Results Panel ── */
  .panel-results {
    overflow: visible;
    min-height: 400px;
  }

  /* ── Filter Bar ── */
  .filter-bar {
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }

  .filter-tabs {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px;
  }

  .filter-tab {
    font-size: 11px;
    padding: 5px 8px;
    flex: 1;
    text-align: center;
    min-width: 0;
  }

  .search-box {
    width: 100% !important;
  }

  .search-box div {
    flex: 1 !important;
  }

  .search-box input {
    width: 100% !important;
  }

  /* ── Table: horizontal scroll ── */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .results-table {
    min-width: 900px;
    font-size: 12px;
  }

  .results-table th {
    padding: 8px 10px;
    font-size: 10px;
  }

  .results-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* ── Progress ── */
  .progress-section {
    padding: 10px 14px;
  }

  /* ── Status Bar ── */
  .status-bar {
    padding: 6px 14px;
    flex-wrap: wrap;
    gap: 4px;
  }

  .status-right {
    font-size: 10px;
  }

  /* ── Toast ── */
  .toast-container {
    bottom: 50px;
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: 100%;
    font-size: 12px;
    padding: 10px 14px;
  }

  /* ── History Modal ── */
  .modal-content {
    max-width: 95% !important;
    max-height: 85vh !important;
    border-radius: 10px !important;
  }

  .modal-content table {
    font-size: 12px;
  }

  /* ── Settings: range row compact ── */
  .range-row {
    flex-wrap: nowrap;
  }

  .range-item {
    gap: 3px;
  }

  .input-num {
    width: 55px;
    padding: 6px 8px;
  }

  /* ── Paste button bigger on mobile for touch ── */
  .btn-paste {
    padding: 6px 14px !important;
    font-size: 12px !important;
  }
}

/* Small phones: < 480px */
@media (max-width: 480px) {
  .app-header {
    padding: 10px 12px;
  }

  .header-stats {
    gap: 4px;
  }

  .stat-badge {
    padding: 4px 4px;
  }

  .stat-num {
    font-size: 14px;
  }

  .stat-lbl {
    font-size: 8px;
    letter-spacing: 0;
  }

  .panel-input {
    padding: 12px;
  }

  .input-textarea {
    min-height: 100px;
    font-size: 12px;
  }

  .filter-tab {
    font-size: 10px;
    padding: 4px 6px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  .results-table {
    min-width: 800px;
  }
}

/* ── Navigation and Spin Animation Shared Styles ── */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
  background: var(--bg-card);
  align-self: center;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--accent-light);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.06);
}

.spin-anim {
  animation: spin 1s linear infinite;
}

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