/* === Design System: StreamCUT === */
/* Colors: #0F0F23 primary, #7C3AED accent, #F8FAFC text */
/* Font: DM Sans (fallback: system) */
/* Style: Dark glassmorphism + ambient blobs */

:root {
  --bg: #0A0A14;
  --surface: rgba(255,255,255,0.04);
  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.08);
  --glass-hover: rgba(255,255,255,0.1);
  --accent: #7C3AED;
  --accent-glow: rgba(124,58,237,0.4);
  --accent-hover: #6D28D9;
  --text: #F8FAFC;
  --text-dim: #94A3B8;
  --text-muted: #64748B;
  --danger: #EF4444;
  --success: #22C55E;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === Ambient Background === */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: drift 20s ease-in-out infinite;
}

.blob-1 {
  width: 500px; height: 500px;
  background: #7C3AED;
  top: -10%; left: -5%;
}

.blob-2 {
  width: 400px; height: 400px;
  background: #2563EB;
  bottom: -10%; right: -5%;
  animation-delay: -7s;
}

.blob-3 {
  width: 300px; height: 300px;
  background: #EC4899;
  top: 40%; right: 20%;
  animation-delay: -14s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* === App Container === */
.app {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

/* === Navbar === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  margin-bottom: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #EC4899);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

.nav-logout {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-logout:hover { color: var(--text); }

/* === Hero === */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.gradient-text {
  background: linear-gradient(135deg, #7C3AED, #EC4899, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* === Input Card === */
.input-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 6px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.url-input-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 4px 4px 4px 16px;
  transition: border-color 0.2s;
}

.url-input-wrap.multi {
  border: 1px solid rgba(124,58,237,0.3);
}

.input-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  padding-top: 14px;
}

.url-input-wrap textarea {
  flex: 1;
  background: none;
  border: none;
  padding: 14px 12px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
  min-width: 0;
  resize: none;
  line-height: 1.6;
  overflow: hidden;
}

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

.url-input-wrap .btn-primary {
  align-self: flex-start;
  margin-top: 4px;
  flex-shrink: 0;
}

.url-count-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 2px;
  animation: slideDown 0.2s ease;
}

.url-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  min-width: 24px;
}

.url-count-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === Buttons === */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-full { width: 100%; justify-content: center; }

.btn-secondary {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover { background: var(--glass-hover); }

/* === Settings Toggle === */
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.settings-toggle:hover { color: var(--text-dim); }

.chevron { transition: transform 0.3s; }
.chevron.open { transform: rotate(180deg); }

.settings-panel {
  padding: 0 16px 16px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.setting-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.setting-item select {
  width: 100%;
  background: #1a1a2e;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.setting-item select option {
  background: #1a1a2e;
  color: var(--text);
}

.setting-item select:focus { border-color: var(--accent); }

.mode-selector { display: flex; gap: 12px; flex-wrap: wrap; }
.mode-option { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-dim); cursor: pointer; user-select: none; }
.mode-option input { cursor: pointer; }
.posts-mode .video-only { display: none !important; }

.settings-checks, .settings-publish {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 8px;
}

.settings-publish { padding-top: 12px; border-top: 1px solid var(--glass-border); margin-top: 8px; }

/* === Custom Checkbox === */
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.check-label input { display: none; }

.checkmark {
  width: 18px; height: 18px;
  border: 2px solid var(--glass-border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.check-label input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.check-label input:checked + .checkmark::after {
  content: '';
  width: 5px; height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.link-sm {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  margin-left: auto;
  cursor: pointer;
}

.link-sm:hover { text-decoration: underline; }

.supported-text {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* === Glass Card === */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-bottom: 1.5rem;
}

/* === Progress === */
.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.progress-pct {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.progress-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #EC4899);
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s ease;
}

/* === Steps === */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  opacity: 0.35;
  transition: opacity 0.4s;
}

.step-item + .step-item { border-top: 1px solid rgba(255,255,255,0.04); }
.step-item.active, .step-item.done { opacity: 1; }

.step-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.3s;
}

.step-item.pending .step-icon { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.step-item.active .step-icon { background: var(--accent); color: white; }
.step-item.done .step-icon { background: var(--success); color: white; }
.step-item.error .step-icon { background: var(--danger); color: white; }

.step-content { flex: 1; }

.step-label {
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 26px;
  color: var(--text-dim);
}

.step-item.active .step-label { color: var(--text); }
.step-item.done .step-label { color: var(--text-muted); }

.step-detail {
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 2px;
}

.step-item.done .step-detail { color: var(--success); }

/* Spinner */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@keyframes pulse-icon {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 8px rgba(124,58,237,0); }
}

.step-item.active .step-icon { animation: pulse-icon 1.5s ease-in-out infinite; }

/* === Results === */
.results-heading {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.short-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
  animation: cardIn 0.5s ease both;
  display: flex;
  flex-direction: column;
}

.short-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,0.3);
}

.short-card:nth-child(1) { animation-delay: 0s; }
.short-card:nth-child(2) { animation-delay: 0.07s; }
.short-card:nth-child(3) { animation-delay: 0.14s; }
.short-card:nth-child(4) { animation-delay: 0.21s; }
.short-card:nth-child(5) { animation-delay: 0.28s; }

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

.short-video-wrap { position: relative; }

.short-video {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  background: #000;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}

.short-info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.short-score {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.short-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.short-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.short-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.short-download {
  display: block;
  text-align: center;
  background: var(--accent);
  color: white;
  padding: 10px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
  cursor: pointer;
  margin-top: auto;
}

.short-download:hover { background: var(--accent-hover); }

/* === Result Tabs === */
.result-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.tab-btn.hidden {
  display: none;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--success);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9px;
}

.tab-btn.active .tab-badge {
  background: white;
  color: var(--accent);
}

/* === Posts Grid === */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.posts-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.posts-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.post-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.2s, border-color 0.2s;
  animation: cardIn 0.5s ease both;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124,58,237,0.3);
}

.post-type {
  display: inline-block;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-hook {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 8px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-body {
  font-weight: 400;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.post-platform {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  text-transform: capitalize;
}

.post-chars {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-actions .btn-sm {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Error === */
.error-card {
  text-align: center;
  border-color: rgba(239,68,68,0.3);
}

.error-icon {
  color: var(--danger);
  margin-bottom: 12px;
}

.error-card p {
  color: #FCA5A5;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* === Auth Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden { display: none; }

.modal-card {
  background: rgba(15,15,35,0.95);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), #EC4899);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 auto 4px;
}

.modal-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.modal-card input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

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

.auth-toggle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-toggle a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-toggle a:hover { text-decoration: underline; }

.auth-error {
  color: var(--danger);
  font-size: 0.82rem;
  min-height: 1.2em;
}

/* === Responsive === */
@media (max-width: 600px) {
  .app { padding: 0 1rem 2rem; }
  .hero { padding: 2rem 0 1.5rem; }
  .hero-title { font-size: 1.8rem; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .url-input-wrap { flex-wrap: wrap; padding: 8px; }
  .url-input-wrap textarea { width: 100%; }
  .btn-primary { width: 100%; justify-content: center; }
  .shorts-grid { grid-template-columns: 1fr; }
}

/* === Video Preview === */
.video-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  animation: slideDown 0.3s ease;
}

.video-preview img {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.preview-info { flex: 1; min-width: 0; }

.preview-title {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-download:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent);
}

.btn-download.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* === History === */
.history-section {
  margin-top: 2rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.history-header:hover { color: var(--text-dim); }

.history-list {
  animation: slideDown 0.3s ease;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--glass-border);
  font-size: 0.82rem;
}

.history-title {
  color: var(--text-dim);
}

/* === Results Actions === */
.results-actions a {
  font-family: inherit;
}

/* === Batch Jobs List === */
.batch-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.batch-job-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: 0.82rem;
  transition: all 0.3s;
}

.batch-job-item.done {
  border-left: 3px solid var(--success);
}

.batch-job-item.error {
  border-left: 3px solid var(--danger);
}

.batch-job-item.active {
  border-left: 3px solid var(--accent);
}

.batch-job-icon {
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  font-weight: 600;
}

.batch-job-item.done .batch-job-icon { color: var(--success); }
.batch-job-item.error .batch-job-icon { color: var(--danger); }
.batch-job-item.active .batch-job-icon { color: var(--accent); }

.batch-job-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.batch-job-pct {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

/* === Preset bar === */
.preset-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.preset-bar select {
  flex: 1;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.btn-sm {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-sm:hover {
  background: var(--accent);
  color: #fff;
}
.btn-danger {
  border-color: #e74c3c;
}
.btn-danger:hover {
  background: #e74c3c;
}

/* === Posts Sections === */
.posts-section {
  margin-bottom: 2rem;
}

.posts-section-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
}

.posts-section-bar input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px;
  font-size: 0.9rem;
  color: #0f0f23;
  outline: none;
  font-family: inherit;
}

.posts-section-bar input::placeholder {
  color: #64748b;
}

.posts-tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--card-bg);
}

.posts-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.posts-tab:hover {
  color: var(--text);
}

.posts-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.posts-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 11px;
  margin-left: 6px;
}

.posts-tab.active .posts-tab-count {
  background: var(--accent);
}

.posts-section {
  display: none;
}

.posts-section.active {
  display: block;
}

.posts-section-bar .btn-sm {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.posts-section-bar .btn-sm:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.section-feedback {
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

/* === History Tab === */
.history-search-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 1.25rem;
}

.history-search {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

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

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 2rem 0;
}

.collection-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  animation: cardIn 0.5s ease both;
}

.collection-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124,58,237,0.3);
}

.collection-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.collection-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.collection-count {
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.collection-platform {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: capitalize;
}

.collection-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.collection-actions .btn-sm {
  display: flex;
  align-items: center;
  gap: 6px;
}

.collection-detail {
  animation: slideDown 0.3s ease;
}

.collection-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 10px;
}

.collection-detail-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.collection-detail-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.collection-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* === Local folder mode === */
.input-mode-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
}
.input-mode-tab {
  flex: 1;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.input-mode-tab:hover { color: var(--text); }
.input-mode-tab.active {
  background: var(--accent);
  color: #fff;
}

.local-folder-wrap {
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
}
.local-path-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.local-path-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.local-path-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.local-path-input {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.local-path-input::placeholder { color: var(--text-muted); }
.local-path-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
}
.local-folder-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--glass-border);
  max-height: 140px;
  overflow-y: auto;
}
.local-folder-chip {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.local-folder-chip:hover {
  background: var(--accent);
  color: #fff;
}
.local-file-path {
  color: var(--text-muted);
  font-size: 0.85em;
}
.local-folder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.local-folder-info { display: flex; flex-direction: column; gap: 2px; }
.local-folder-title { font-weight: 600; font-size: 0.95rem; }
.local-folder-hint { font-size: 0.78rem; color: var(--text-muted); }
.local-folder-actions { display: flex; gap: 8px; flex-shrink: 0; }

.local-folder-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(0,0,0,0.15);
  margin-bottom: 12px;
}
.local-folder-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.local-folder-error { color: #ef4444; }

.local-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.local-file-row:last-child { border-bottom: none; }
.local-file-row:hover { background: rgba(255,255,255,0.04); }
.local-file-check { flex-shrink: 0; cursor: pointer; }
.local-file-name {
  flex: 1;
  font-size: 0.88rem;
  word-break: break-all;
}
.local-file-meta {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.local-folder-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.local-folder-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.local-folder-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.local-folder-note code {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  .short-card { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
