:root {
  --bg: var(--tg-theme-bg-color, #050810);
  --text: var(--tg-theme-text-color, #eef2ff);
  --hint: var(--tg-theme-hint-color, #94a3b8);
  --accent: var(--tg-theme-button-color, #3b82f6);
  --accent-2: #22d3ee;
  --gold: #d4a853;
  --accent-text: var(--tg-theme-button-text-color, #fff);
  --card: rgba(12, 20, 42, 0.88);
  --border: rgba(100, 140, 220, 0.16);
  --glow: rgba(59, 130, 246, 0.45);
  --success: #34d399;
  --danger: #f87171;
  --panel-glow: rgba(34, 211, 238, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background ── */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.38), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 35%, rgba(34, 211, 238, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(212, 168, 83, 0.1), transparent 45%);
  z-index: 0;
}

.bg-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 60% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 80% 10%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 40% 80%, #fff, transparent);
  background-size: 220px 220px;
  animation: starsDrift 80s linear infinite;
  z-index: 0;
}

@keyframes starsDrift {
  from { background-position: 0 0; }
  to { background-position: 220px 440px; }
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: orbFloat 18s ease-in-out infinite;
}

.orb-1 {
  width: 180px; height: 180px;
  background: #3b82f6;
  top: 10%; left: -5%;
  animation-delay: 0s;
}

.orb-2 {
  width: 140px; height: 140px;
  background: #22d3ee;
  top: 55%; right: -8%;
  animation-delay: -6s;
}

.orb-3 {
  width: 100px; height: 100px;
  background: #d4a853;
  bottom: 15%; left: 20%;
  animation-delay: -12s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.08); }
  66% { transform: translate(-15px, 20px) scale(0.95); }
}

/* ── Layout ── */
.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 16px 36px;
}

/* ── Hero ── */
.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 32px rgba(59, 130, 246, 0.55));
  animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 8px 32px rgba(59, 130, 246, 0.55)); }
  50% { filter: drop-shadow(0 12px 40px rgba(34, 211, 238, 0.65)); }
}

.hero-text { min-width: 0; }

.hero-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
}

.hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #60a5fa 40%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--hint);
  font-size: 0.92rem;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Panels (export-style) ── */
.panel {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: fadeUp 0.5s ease both;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4) { animation-delay: 0.15s; }
.panel:nth-child(5) { animation-delay: 0.2s; }

.panel:hover {
  border-color: rgba(100, 140, 220, 0.28);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--panel-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, #60a5fa, #22d3ee);
  border-radius: 2px;
  flex-shrink: 0;
}

.count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.12);
}

/* ── Inputs ── */
.drop-zone {
  position: relative;
  border-radius: 14px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.drop-zone.drag-over {
  border: 2px dashed var(--accent);
  box-shadow: 0 0 0 4px var(--glow), 0 0 40px rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.08);
}

textarea {
  width: 100%;
  min-height: 130px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  font-size: 0.85rem;
  font-family: ui-monospace, "Cascadia Code", monospace;
  resize: vertical;
  line-height: 1.55;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

/* ── Buttons base ── */
.btn-icon,
.btn-clear-cookies,
.btn-proxy-check,
.btn-export,
.btn-primary,
.btn-job-ctrl,
.link-btn,
.sort-btn,
.btn-copy-cookie,
.btn-copy-full {
  transition:
    transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.2s,
    background 0.2s,
    border-color 0.2s,
    filter 0.2s;
}

@media (hover: hover) {
  .sfx-btn:hover,
  .btn-icon:hover,
  .btn-clear-cookies:hover,
  .btn-proxy-check:hover,
  .btn-export:hover,
  .btn-primary:not(:disabled):hover,
  .btn-job-ctrl:hover:not(:disabled),
  .link-btn:hover,
  .sort-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
  }

  .check-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
  }

  .proxy-mode-opt:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.4);
  }

  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

.btn-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px var(--glow);
  flex-shrink: 0;
}

.btn-icon:active { transform: scale(0.92) translateY(0); }

.btn-clear-cookies {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 14px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-clear-cookies:active { transform: scale(0.94); }

.hint-drag { font-size: 0.82rem; color: var(--hint); }

/* ── Drop overlay ── */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 8, 16, 0.94);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--accent-2);
  margin: 12px;
  border-radius: 22px;
  animation: pulseBorder 1.5s ease infinite;
}

@keyframes pulseBorder {
  0%, 100% { border-color: rgba(34, 211, 238, 0.6); box-shadow: 0 0 30px rgba(34, 211, 238, 0.2); }
  50% { border-color: rgba(59, 130, 246, 0.9); box-shadow: 0 0 50px rgba(59, 130, 246, 0.35); }
}

.drop-overlay.hidden { display: none; }
.drop-overlay .drop-icon { font-size: 4rem; margin-bottom: 14px; animation: bounce 1s ease infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.drop-overlay p { font-size: 1.3rem; font-weight: 700; }
.drop-overlay span { color: var(--hint); font-size: 0.95rem; margin-top: 8px; }

/* ── Threads ── */
.threads-hint {
  font-size: 0.82rem;
  color: var(--hint);
  margin-bottom: 14px;
  line-height: 1.45;
}

.threads-row { display: flex; align-items: center; gap: 14px; }

#threadsSlider {
  flex: 1;
  height: 8px;
  accent-color: var(--accent-2);
  cursor: pointer;
}

.threads-input {
  width: 68px;
  padding: 11px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.threads-input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

/* ── Proxy ── */
.proxy-hint,
.proxy-system-info {
  font-size: 0.82rem;
  color: var(--hint);
  margin-bottom: 12px;
  line-height: 1.45;
}

.proxy-mode-row { display: flex; gap: 10px; margin-bottom: 14px; }

.proxy-mode-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.proxy-mode-opt:has(input:checked) {
  border-color: rgba(34, 211, 238, 0.55);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 211, 238, 0.12));
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.15);
  color: #fff;
}

.proxy-mode-opt input { accent-color: var(--accent-2); }

.proxy-custom textarea {
  width: 100%;
  min-height: 96px;
}

.proxy-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-proxy-check {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(59, 130, 246, 0.1));
  color: var(--accent-2);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.1);
}

.btn-proxy-check:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.proxy-check-summary { font-size: 0.85rem; color: var(--hint); font-weight: 600; }
.proxy-check-summary.ok { color: var(--success); }
.proxy-check-summary.partial { color: #fbbf24; }
.proxy-check-summary.bad { color: var(--danger); }

.proxy-check-results {
  margin-top: 12px;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proxy-check-item {
  font-size: 0.78rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  word-break: break-all;
  line-height: 1.4;
  transition: transform 0.15s;
}

.proxy-check-item.ok { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); }
.proxy-check-item.bad { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.3); }
.proxy-check-item code { font-size: 0.75rem; color: var(--text); }
.proxy-lat { color: var(--hint); margin-left: 6px; }
.proxy-err { display: block; color: var(--danger); margin-top: 4px; font-size: 0.72rem; }
.proxy-check-loading { font-size: 0.85rem; color: var(--hint); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.link-btn:hover { background: rgba(34, 211, 238, 0.1); }

/* ── Check toggles ── */
.checks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checks-grid-scroll {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 6px;
}

.checks-grid-scroll::-webkit-scrollbar { width: 5px; }
.checks-grid-scroll::-webkit-scrollbar-thumb {
  background: rgba(100, 140, 220, 0.35);
  border-radius: 4px;
}

.check-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  transition: all 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.check-toggle input {
  accent-color: var(--accent-2);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.check-toggle:has(input:checked) {
  border-color: rgba(34, 211, 238, 0.5);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(34, 211, 238, 0.1));
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.12);
  color: #fff;
}

.id-lists {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.id-list-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--hint);
  font-weight: 500;
}

.id-list-label textarea { min-height: 56px; }

/* ── Primary CTA ── */
.btn-primary {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 18px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, var(--accent) 40%, var(--accent-2) 100%);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 10px 36px var(--glow),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  animation: none;
}

.btn-primary:not(:disabled):active { transform: scale(0.97) translateY(0) !important; }

.btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
  animation: shine 2.8s ease infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Progress ── */
.progress { margin: 20px 0; animation: fadeUp 0.4s ease; }
.progress.hidden, .results.hidden { display: none; }

.bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

#barFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #60a5fa);
  background-size: 200% 100%;
  animation: barShimmer 2s linear infinite;
  border-radius: 6px;
  transition: width 0.35s ease;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

@keyframes barShimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

#statusText { font-size: 0.92rem; color: var(--hint); font-weight: 500; }

.job-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.job-controls.hidden { display: none; }

.btn-job-ctrl {
  flex: 1;
  min-width: 100px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-job-pause:hover { border-color: rgba(255, 193, 7, 0.5); background: rgba(255, 193, 7, 0.12); box-shadow: 0 4px 16px rgba(255, 193, 7, 0.15); }
.btn-job-resume:hover { border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.12); box-shadow: 0 4px 16px rgba(52, 211, 153, 0.15); }
.btn-job-cancel:hover { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.12); box-shadow: 0 4px 16px rgba(248, 113, 113, 0.15); }
.btn-job-ctrl:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.progress.paused #barFill { background: linear-gradient(90deg, #ffc107, #ff9800); animation: none; }
.progress.cancelled #barFill { background: linear-gradient(90deg, #ef5350, #e53935); animation: none; }

/* ── Results KPI ── */
.results h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  transition: transform 0.22s, box-shadow 0.22s;
}

.stat-card .stat-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-card.stat-valid .stat-val { color: var(--success); text-shadow: 0 0 20px rgba(52, 211, 153, 0.35); }
.stat-card.stat-invalid .stat-val { color: var(--danger); text-shadow: 0 0 20px rgba(248, 113, 113, 0.3); }

.stat-card .stat-lbl {
  font-size: 0.72rem;
  color: var(--hint);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.export-panel {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 211, 238, 0.1));
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.08);
}

.export-hint { font-size: 0.85rem; color: var(--hint); margin-bottom: 14px; }

.btn-export {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #059669, #10b981, var(--accent-2));
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.35);
}

.btn-export:active { transform: scale(0.97) translateY(0) !important; }

.sort-bar {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.sort-bar.hidden { display: none; }

.sort-bar-label {
  display: block;
  font-size: 0.75rem;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 10px;
}

.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 130px;
  overflow-y: auto;
}

.sort-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.sort-btn.active {
  border-color: rgba(34, 211, 238, 0.6);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(34, 211, 238, 0.2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.2);
}

/* ── Result items ── */
.item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.item-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-copy-cookie,
.btn-copy-full {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(59, 130, 246, 0.22);
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-copy-full {
  background: rgba(52, 211, 153, 0.18);
  font-size: 0.74rem;
  font-weight: 700;
}

.btn-copy-cookie:active,
.btn-copy-full:active { transform: scale(0.9); }

.list { max-height: 50vh; overflow-y: auto; padding-right: 4px; }
.list::-webkit-scrollbar { width: 5px; }
.list::-webkit-scrollbar-thumb { background: rgba(100, 140, 220, 0.35); border-radius: 4px; }

.item {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  line-height: 1.55;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  animation: fadeUp 0.35s ease both;
}

@media (hover: hover) {
  .item:hover {
    border-color: rgba(100, 140, 220, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
  }
}

.item .name {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item .name .tag {
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 8px;
  font-weight: 700;
}

.item .tag.premium { background: rgba(212, 168, 83, 0.25); color: var(--gold); }
.item .tag.expired { background: rgba(248, 113, 113, 0.22); color: var(--danger); }
.item .tag.pending { background: rgba(34, 211, 238, 0.2); color: var(--accent-2); }
.item.pending { opacity: 0.88; }

.empty-valid {
  text-align: center;
  color: var(--hint);
  padding: 28px 14px;
  font-size: 0.95rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  color: var(--hint);
  font-size: 0.84rem;
}

.metrics-grid b { color: var(--text); font-weight: 700; }

/* ── Telegram / misc ── */
body.tg-app .app { padding-bottom: 80px; }
.btn-primary.hidden { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(16px);
  z-index: 200;
  max-width: min(92vw, 380px);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(12, 20, 42, 0.96);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-error {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
  box-shadow: 0 8px 32px rgba(248, 113, 113, 0.15);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Subscription ── */
.subscription-panel {
  border-color: rgba(212, 168, 83, 0.35);
  box-shadow: 0 8px 32px rgba(212, 168, 83, 0.08);
}

.subscription-panel.sub-active {
  border-color: rgba(52, 211, 153, 0.35);
}

.sub-status-text {
  font-size: 0.92rem;
  color: var(--hint);
  line-height: 1.5;
  margin-bottom: 12px;
}

.sub-pay-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.sub-pay-buttons:not(.hidden) { display: grid; }

.btn-sub-plan {
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(34, 211, 238, 0.12));
  cursor: pointer;
}

.sub-hint {
  font-size: 0.78rem;
  color: var(--hint);
}

.app.locked .input-panel,
.app.locked .threads-panel,
.app.locked .settings-panel,
.app.locked .proxy-panel,
.app.locked #startBtn,
.app.locked #progress,
.app.locked #results {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.2);
}
