:root {
  --bg: #0d1117;
  --card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #ff4d4d;
  --accent-hover: #ff6b6b;
  --success: #3fb950;
  --warn: #d29922;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, gap, flex-direction;
}

.header-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.header-logo:hover {
  transform: scale(1.08) rotate(3deg);
}

.header-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ff4d4d, #ff8a4d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--muted);
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

/* Admin Header Styling */
.admin-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.admin-header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, gap, flex-direction;
}

.admin-header-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.admin-header-logo:hover {
  transform: scale(1.08) rotate(-3deg);
}

.admin-header-text {
  text-align: left;
}

.admin-header-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ff4d4d, #ff8a4d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

code { font-family: ui-monospace, "Cascadia Code", monospace; color: var(--accent); }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#admin-screen {
  max-width: 1100px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.admin-view-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: stretch;
  justify-content: flex-start;
  overflow-x: auto;
}

.admin-view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0.55rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 52px;
  padding: 0.8rem 1rem;
  font-size: clamp(0.88rem, 1vw, 0.95rem);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.admin-view-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-view-tab.active {
  border-color: var(--accent);
  background: rgba(255, 77, 77, 0.12);
  color: #fff;
}

.admin-view-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .admin-view-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    overflow-x: visible;
  }

  .admin-view-tab {
    width: 100%;
    flex: 1 1 auto;
    min-height: 48px;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
  }
}

.admin-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.85rem;
  line-height: 1.4;
}

input[type="text"], input[type="password"], input[type="url"], input[type="number"], textarea, select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: border-color, box-shadow;
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.25rem !important;
  cursor: pointer;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.15);
}

select:hover:not(:disabled) {
  border-color: var(--accent-hover);
}

.row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.muted-inline { color: var(--muted); font-size: 0.85rem; }

.grid-2, .grid-3 {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.6rem;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.field span {
  font-size: 0.825rem;
  color: var(--muted);
}

.field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.preview-box {
  margin-top: 0.85rem;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: center;
}
.preview-box img, .preview-box video {
  max-width: 100%;
  max-height: 280px;
  border-radius: 6px;
}

.primary, .ghost {
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, opacity 0.15s;
  font-family: inherit;
}

.primary {
  width: 100%;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 1rem;
}
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:active:not(:disabled) { transform: scale(0.98); }
.primary:disabled { opacity: 0.5; cursor: not-allowed; }

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

.status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid var(--warn);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.status.error { background: rgba(255, 77, 77, 0.1); border-color: var(--accent); }
.status.done { background: rgba(63, 185, 80, 0.1); border-color: var(--success); }
.status.warn { background: rgba(210, 153, 34, 0.15); border-color: var(--warn); }

.result {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}
.result h3 { margin: 0; align-self: flex-start; }
.result-retention {
  align-self: flex-start;
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-variant-numeric: tabular-nums;
}

.result-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.08));
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.result-card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.result-card-title {
  font-size: 0.95rem;
  color: var(--text);
}

.result-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.result-card-retention {
  flex-shrink: 0;
  font-size: 0.76rem;
  color: var(--muted);
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-variant-numeric: tabular-nums;
}

.result-card-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
}

.result-card-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.download {
  background: var(--success);
  color: white;
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  align-self: flex-start;
}
.download:hover { opacity: 0.9; }

.result-remove-btn {
  width: auto;
}

.raw {
  width: 100%;
  margin-top: 0.5rem;
}
.raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}
.raw pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.75rem;
  overflow-x: auto;
  max-height: 300px;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 600px) {
  header h1 { font-size: 1.5rem; }
  .card { padding: 1rem; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}


/* ─── Dropzone & Advanced toggle ────────────────────────────────────────── */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: border-color, background-color;
  margin-bottom: 0.6rem;
}
.dropzone:hover, .dropzone.dragging {
  border-color: var(--accent);
  background: rgba(255, 77, 77, 0.05);
}
.dropzone.compact {
  min-height: 60px;
}
.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.dz-icon { font-size: 1.75rem; }

.preview-box {
  position: relative;
}
.remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.875rem;
  z-index: 2;
}
.remove-btn:hover { background: rgba(255, 77, 77, 0.9); }

.advanced {
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}
.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  user-select: none;
}
.advanced summary:hover { color: var(--accent); }


/* ─── Multi-account ─────────────────────────────────────────────────────── */

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.card-head h2 { margin: 0; }

.account-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.empty-accounts {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.account-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: border-color, background-color;
}
.account-row:hover { border-color: var(--accent); }
.account-row.active {
  border-color: var(--accent);
  background: rgba(255, 77, 77, 0.06);
}
.account-row.expired { opacity: 0.55; }

.acc-radio input { accent-color: var(--accent); cursor: pointer; }
.acc-info { min-width: 0; }
.acc-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.acc-meta .dot { color: var(--border); }
.acc-meta .exp-ok { color: var(--success); }
.acc-meta .exp-bad { color: var(--accent); font-weight: 600; }
.acc-meta code {
  background: var(--card);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.72rem;
  color: var(--muted);
}

.acc-actions { display: flex; gap: 0.3rem; }
.ghost.small { padding: 0.3rem 0.55rem; font-size: 0.8rem; }
.ghost.danger:hover { border-color: var(--accent); color: var(--accent); }
.primary.small { width: auto; padding: 0.55rem 1rem; font-size: 0.9rem; }


/* ─── Admin stats & banner ──────────────────────────────────────────────── */

.banner {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(210, 153, 34, 0.15);
  border: 1px solid var(--warn);
  font-size: 0.9rem;
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}
.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}
.stat-num.good { color: var(--success); }
.stat-num.bad { color: var(--accent); }
.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.2rem;
}

@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Old user-app account list reused by admin: tweak grid to be 3-column (Checkbox, Info, Actions) */
.account-list .account-row {
  grid-template-columns: auto 1fr auto;
}


/* ─── Auto Token Bot Panel ──────────────────────────────────────────────── */

.bot-card {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
}

/* Status Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-idle    { background: rgba(139,148,158,0.15); color: #8b949e; border: 1px solid #30363d; }
.badge-running { background: rgba(99,102,241,0.2);  color: #818cf8; border: 1px solid rgba(99,102,241,0.4); animation: pulse-badge 1.2s ease-in-out infinite; }
.badge-success { background: rgba(63,185,80,0.15);  color: #3fb950; border: 1px solid rgba(63,185,80,0.4); }
.badge-error   { background: rgba(255,77,77,0.15);  color: #ff4d4d; border: 1px solid rgba(255,77,77,0.4); }
.badge-vip     { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.5); }

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* Step Progress */
.bot-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.2rem 0;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.bot-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.step-info { min-width: 0; }
.step-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s;
}
.step-sub {
  font-size: 0.65rem;
  color: #444d56;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Step states */
.bot-step.step-active {
  border-color: #6366f1;
  background: rgba(99,102,241,0.08);
  animation: step-pulse 1.5s ease-in-out infinite;
}
.bot-step.step-active .step-dot {
  background: #6366f1;
  color: white;
  box-shadow: 0 0 8px rgba(99,102,241,0.6);
}
.bot-step.step-active .step-title { color: #818cf8; }

.bot-step.step-done {
  border-color: rgba(63,185,80,0.4);
  background: rgba(63,185,80,0.06);
}
.bot-step.step-done .step-dot {
  background: #3fb950;
  color: white;
}
.bot-step.step-done .step-title { color: #3fb950; }

@keyframes step-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(99,102,241,0); }
}

.step-arrow {
  color: var(--border);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Controls row */
.bot-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bot-control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

/* Toggle switch */
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #6366f1; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

.bot-interval-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.interval-select {
  width: auto;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.bot-btn-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bot-run-btn {
  width: auto;
  padding: 0.65rem 1.4rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  font-size: 0.875rem;
}
.bot-run-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
}
.bot-run-btn:disabled {
  background: var(--border);
  opacity: 0.7;
}

.bot-countdown {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 8px;
}
.countdown-label { font-size: 0.75rem; color: var(--muted); }
.countdown-timer {
  font-size: 0.875rem;
  font-weight: 700;
  color: #818cf8;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace;
}

.captcha-alarm-panel {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.captcha-alarm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.captcha-alarm-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.captcha-sound-field {
  flex: 1 1 320px;
  margin-bottom: 0;
}

.captcha-alarm-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Terminal Log */
.log-terminal {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.log-terminal-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: #1c2128;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.terminal-title {
  font-size: 0.7rem;
  color: var(--muted);
  flex: 1;
  text-align: center;
  font-family: ui-monospace, monospace;
}

.log-clear-btn {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.log-clear-btn:hover { color: var(--text); border-color: var(--muted); }

.log-body {
  background: #0d1117;
  padding: 0.6rem 0.75rem;
  height: 260px;
  overflow-y: auto;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.75rem;
  line-height: 1.7;
}

.log-line { display: block; padding: 0.05rem 0; word-break: break-all; }
.log-info    { color: #8b949e; }
.log-warn    { color: var(--warn); }
.log-error   { color: var(--accent); }
.log-success { color: var(--success); }
.log-start   { color: #818cf8; font-weight: 600; }

/* Scrollbar for terminal */
.log-body::-webkit-scrollbar { width: 4px; }
.log-body::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; }

.bot-last-run {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

@media (max-width: 600px) {
  .header-brand {
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
  }
  .header-logo { height: 52px; }
  .header-title { font-size: 1.7rem; text-align: center; }
  header { padding: 1.5rem 1rem 1rem; }
  .bot-steps { gap: 0.25rem; }
  .bot-step  { min-width: 90px; padding: 0.3rem 0.4rem; }
  .step-title { font-size: 0.65rem; }
  .bot-controls { flex-direction: column; align-items: flex-start; }
  .captcha-alarm-controls { align-items: stretch; }
  .stats { grid-template-columns: repeat(2, 1fr); }

  .admin-header-brand {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .admin-header-logo {
    height: 48px;
  }
  .admin-header-text {
    text-align: center;
  }
  .admin-header-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ─── Premium Progress Card ─────────────────────────────────────────────── */
.progress-card {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: fadeInProgress 0.3s ease-out;
}

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

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-progress-dot 1s infinite alternate;
}

@keyframes pulse-progress-dot {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 4px var(--accent); }
  100% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px var(--accent); }
}

.progress-percent {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  font-family: ui-monospace, monospace;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #ff8a4d 50%, #ffd04d 100%);
  background-size: 200% auto;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.3);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: shineProgress 2s linear infinite;
}

@keyframes shineProgress {
  to { background-position: 200% center; }
}

.progress-status-text {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Member VIP Login Modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeInModal 0.25s ease-out;
}

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

.modal-card {
  width: 90%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: slideInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInModal {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.modal-logo {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ff4d4d, #ff8a4d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-hint {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* ─── Premium Admin Login Screen ────────────────────────────────────────── */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 100px);
  padding: 1rem;
}

.login-glass-card {
  width: 100%;
  max-width: 420px;
  background: rgba(22, 27, 34, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(48, 54, 61, 0.8);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: loginFadeIn 0.4s ease-out;
}

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

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  font-size: 3rem;
  display: inline-block;
  margin-bottom: 0.5rem;
  animation: pulse-icon 2s infinite alternate;
}

@keyframes pulse-icon {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--accent)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 10px var(--accent)); }
}

.login-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ff4d4d, #ff8a4d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
}

/* ─── Premium Result Card Progress & Error ────────────────────────────────── */
.result-card-progress-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1.5rem 0.5rem;
  min-height: 120px;
  justify-content: center;
  align-items: stretch;
}

.result-card-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.result-card-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff8a4d);
  box-shadow: 0 0 10px var(--accent);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card-progress-status {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.result-card-error-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0.5rem 0;
}

.result-card-error-box {
  background: rgba(255, 77, 77, 0.08);
  border: 1px solid rgba(255, 77, 77, 0.25);
  border-radius: 8px;
  padding: 12px;
  color: #ff6b6b;
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}

.result-card-error-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #ff4d4d;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Micro pulse animation for status texts */
.result-card-progress-status.pulse-text {
  animation: statusPulse 1.8s infinite ease-in-out;
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ─── Custom Confirm Modal & Toast Notifications ─── */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.confirm-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal-card {
  width: 90%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: scale(0.9) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-modal-overlay.active .confirm-modal-card {
  transform: scale(1) translateY(0);
}

.confirm-modal-title {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirm-modal-msg {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.confirm-modal-actions button {
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.confirm-modal-actions button.confirm-btn {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.confirm-modal-actions button.confirm-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.confirm-modal-actions button.cancel-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.confirm-modal-actions button.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--muted);
}

/* Toast System */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10001;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 18px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  min-width: 250px;
  max-width: 380px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

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

.toast.toast-warn {
  border-left-color: var(--warn);
}

.toast.toast-error {
  border-left-color: var(--accent);
}
