/* ============================================================
   ReelFlow — Modern Social Video & Reels Downloader Stylesheet
   ============================================================ */

:root {
  --bg: #050807;
  --bg-elevated: #0b110f;
  --bg-card: rgba(11, 18, 15, 0.9);
  --bg-input: #070d0b;
  --border: rgba(34, 197, 94, 0.16);
  --border-strong: rgba(34, 197, 94, 0.34);
  --text: #ffffff;
  --text-muted: #86efac;
  --accent-1: #00e676;
  --accent-2: #10b981;
  --accent-3: #059669;
  --gradient: linear-gradient(135deg, #00e676 0%, #10b981 55%, #059669 100%);
  --success: #00e676;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  --radius-lg: 20px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #090f0d;
  --bg-elevated: #101916;
  --bg-card: rgba(16, 25, 22, 0.92);
  --bg-input: #0c1411;
  --border: rgba(52, 211, 153, 0.2);
  --border-strong: rgba(52, 211, 153, 0.38);
  --text: #ffffff;
  --text-muted: #a7f3d0;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  scroll-behavior: smooth;
}

button, a, input, select, textarea, summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid #00e676;
  outline-offset: 2px;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.small { font-size: 0.84rem; }
.hidden { display: none !important; }

/* Ambient Background */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
}
[data-theme="light"] .glow { opacity: 0.14; }
.glow-1 { width: 520px; height: 520px; background: #00e676; top: -180px; left: -100px; }
.glow-2 { width: 560px; height: 560px; background: #10b981; top: -120px; right: -120px; }
.glow-3 { width: 460px; height: 460px; background: #059669; bottom: -220px; left: 38%; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  position: relative;
  z-index: 1;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(5, 8, 7, 0.84);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .navbar {
  background: rgba(9, 15, 13, 0.86);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-icon svg { width: 32px; height: 32px; display: block; }
.brand-text { font-size: 1.25rem; letter-spacing: -0.03em; font-weight: 500; color: #ffffff; }
.brand-text strong { font-weight: 800; color: #00e676; }
.brand-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--gradient);
  color: #04120a;
  letter-spacing: 0.06em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 10px currentColor;
}
.status-dot.ok { background: var(--success); }
.status-dot.err { background: var(--danger); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.16s ease;
}
.icon-btn svg { flex-shrink: 0; }
.icon-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.count-badge {
  background: var(--gradient);
  color: #04120a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}

/* Hero */
.main-content { padding-top: 38px; padding-bottom: 64px; }

.hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 28px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.34);
  color: #4ade80;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 18px;
}
[data-theme="light"] .hero-badge { color: #4ade80; background: rgba(0, 230, 118, 0.1); }
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.25);
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.09;
  letter-spacing: -0.035em;
  color: #ffffff;
}
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #4ade80 45%, #00e676 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin: 0 auto 28px;
  max-width: 680px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* Front Tool Search Option */
.tool-search-wrap {
  position: relative;
  max-width: 580px;
  margin: 0 auto 18px;
  z-index: 30;
}
.tool-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 46px;
  border-radius: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.tool-search-box:focus-within {
  border-color: #00e676;
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.16);
}
.tool-search-icon {
  color: #00e676;
  flex-shrink: 0;
}
.tool-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
}
.tool-search-input::placeholder {
  color: #86efac;
  opacity: 0.65;
}
.tool-search-input::-webkit-search-cancel-button { display: none; }
.tool-search-clear {
  background: none;
  border: none;
  color: #86efac;
  cursor: pointer;
  font-size: 0.92rem;
  padding: 4px 6px;
  border-radius: 6px;
}
.tool-search-clear:hover {
  color: #ffffff;
  background: rgba(0, 230, 118, 0.14);
}
.tool-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0a120f;
  border: 1px solid rgba(0, 230, 118, 0.34);
  border-radius: 14px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.72);
  padding: 6px;
  max-height: 310px;
  overflow-y: auto;
  text-align: left;
}
.tool-search-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}
.tool-search-item:hover,
.tool-search-item.active {
  background: rgba(0, 230, 118, 0.14);
}
.tool-search-item-main {
  min-width: 0;
}
.tool-search-item-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}
.tool-search-item-sub {
  display: block;
  font-size: 0.77rem;
  color: #86efac;
  opacity: 0.85;
  margin-top: 2px;
}
.tool-search-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(0, 230, 118, 0.14);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: #4ade80;
}
.tool-search-empty {
  padding: 14px 12px;
  text-align: center;
  font-size: 0.85rem;
  color: #86efac;
}

/* Tool Tabs */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.tool-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: #d1fae5;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
}
.tool-tab:hover {
  color: #ffffff;
  border-color: var(--border-strong);
}
.tool-tab.active {
  background: var(--gradient);
  border-color: transparent;
  color: #03150b;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.28);
}

/* URL Bar */
.url-bar-wrap { margin-bottom: 14px; }
.url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.url-bar:focus-within {
  border-color: #00e676;
  box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.16), var(--shadow);
}

.detected-badge {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-2);
}

.url-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.98rem;
  padding: 10px 4px;
}
.url-input::placeholder { color: #86efac; opacity: 0.6; }

.url-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.url-hints {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.link-btn {
  background: none;
  border: none;
  color: #00e676;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }
[data-theme="light"] .link-btn { color: #00e676; }

/* Hero Quick Platform Logos Strip */
.hero-logos-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.mini-logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.mini-logo-btn svg {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
}
.mini-logo-btn:hover {
  transform: translateY(-2px);
  border-color: #00e676;
  background: rgba(0, 230, 118, 0.1);
}

/* Buttons */
.primary-btn, .secondary-btn, .ghost-btn, .danger-ghost-btn, .chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-weight: 700;
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.primary-btn {
  padding: 11px 20px;
  border: none;
  background: var(--gradient);
  color: #03150b;
  font-size: 0.92rem;
  box-shadow: 0 8px 22px rgba(0, 230, 118, 0.26);
}
.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.secondary-btn {
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 230, 118, 0.12);
  color: #ffffff;
  font-size: 0.88rem;
}
.secondary-btn:hover {
  background: rgba(0, 230, 118, 0.22);
  border-color: #00e676;
}

.ghost-btn {
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: #a7f3d0;
  font-size: 0.84rem;
}
.ghost-btn:hover {
  color: #ffffff;
  background: rgba(0, 230, 118, 0.08);
  border-color: var(--border-strong);
}

.danger-ghost-btn {
  padding: 9px 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-size: 0.84rem;
}
.danger-ghost-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
}

.sm { padding: 7px 13px; font-size: 0.82rem; border-radius: 9px; }

.chip-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: #a7f3d0;
  font-size: 0.8rem;
}
.chip-btn:hover, .chip-btn.active {
  color: #03150b;
  background: #00e676;
  border-color: #00e676;
}

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

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error Banner */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 13px;
  background: rgba(239, 68, 68, 0.11);
  border: 1px solid rgba(239, 68, 68, 0.38);
  color: #fca5a5;
  margin-top: 14px;
}
[data-theme="light"] .alert-banner { color: #991b1b; }
.alert-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.alert-body { flex: 1; }
.alert-body p { margin: 4px 0 0; font-size: 0.88rem; opacity: 0.92; }
.alert-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.75;
}

/* Active Job Card */
.active-job-card, .workspace-card, .standalone-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.active-job-card {
  border-color: rgba(0, 230, 118, 0.42);
}
.job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.job-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.job-title-wrap h3 {
  margin: 0;
  font-size: 1rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: rgba(0, 230, 118, 0.16);
  color: #4ade80;
  flex-shrink: 0;
}
.job-status-pill.done { background: rgba(0, 230, 118, 0.24); color: #00e676; }
.job-status-pill.err { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 0.25s ease;
}
.job-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-muted);
  gap: 12px;
  flex-wrap: wrap;
}
.job-stats-right { display: flex; gap: 14px; }
.job-complete-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.file-size-note { font-size: 0.82rem; color: var(--text-muted); margin-left: auto; }

/* Media Summary */
.media-summary {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.media-thumb-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-input);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
}
.media-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.duration-chip {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
}
.platform-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}

.media-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.media-info h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  line-height: 1.35;
}
.media-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.media-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* Tool Panels */
.panel-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.panel-toolbar h2, .panel-toolbar h3 { margin: 0 0 4px; }
.panel-toolbar p { margin: 0; font-size: 0.88rem; }

.container-picker, .field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.select-input, .text-input {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}
.select-input:focus, .text-input:focus { border-color: #00e676; }

/* Format Rows */
.format-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.format-row:hover {
  border-color: rgba(0, 230, 118, 0.55);
  transform: translateY(-1px);
}
.format-row.recommended {
  border-color: rgba(0, 230, 118, 0.52);
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.12), rgba(16, 185, 129, 0.04));
}
.format-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.quality-pill {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(0, 230, 118, 0.16);
  color: #4ade80;
  min-width: 66px;
  text-align: center;
}
[data-theme="light"] .quality-pill { color: #4ade80; }
.quality-pill.hot { background: var(--gradient); color: #03150b; }
.format-label { font-weight: 600; font-size: 0.94rem; color: #ffffff; }
.format-sub { font-size: 0.8rem; color: var(--text-muted); }
.format-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.est-size { font-size: 0.82rem; color: var(--text-muted); }

/* Thumbnails Grid */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.thumb-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.thumb-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
  display: block;
}
.thumb-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thumb-res {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
}
.thumb-dl-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* Clip Trimmer */
.clip-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.clip-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

.clip-timeline-wrap { margin-bottom: 16px; }
.clip-timeline-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}
[data-theme="light"] .clip-timeline-bar { background: rgba(15, 23, 42, 0.1); }
.clip-timeline-range {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 30%;
  background: var(--gradient);
  border-radius: 999px;
  transition: left 0.2s ease, width 0.2s ease;
}
.clip-timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.clip-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 0.82rem;
}

/* Metadata Panel */
.meta-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.meta-stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}
.meta-stat span { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.meta-stat strong { font-size: 1rem; }

.meta-block { margin-bottom: 18px; }
.meta-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.meta-block-head h4 { margin: 0; font-size: 0.94rem; }

.hashtag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.hashtag-chip {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.34);
  color: #4ade80;
  font-size: 0.8rem;
  cursor: pointer;
}
[data-theme="light"] .hashtag-chip { color: #4ade80; }
.hashtag-chip:hover { background: rgba(0, 230, 118, 0.24); color: #ffffff; }

.desc-box {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}

/* Batch Downloader */
.batch-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  color: var(--text);
  padding: 14px;
  font-size: 0.86rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  margin-bottom: 14px;
}
.batch-textarea:focus { border-color: #00e676; }
.batch-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.batch-queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.batch-item {
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}
.batch-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.batch-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Library Grid */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}
.library-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 42px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}
.lib-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lib-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.lib-type-badge {
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(0, 230, 118, 0.18);
  color: #4ade80;
}
.lib-type-badge.audio { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.lib-title {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lib-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.lib-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

/* Live Tools Usage Graph & Live Conversions Feed */
.live-dashboard-section {
  margin-top: 30px;
  margin-bottom: 12px;
}
.live-dashboard-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  align-items: stretch;
}
.live-card {
  background: linear-gradient(180deg, rgba(12, 20, 17, 0.96) 0%, rgba(8, 14, 12, 0.98) 100%);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 20px;
  padding: 20px 22px 18px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.live-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.live-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: #86efac;
  text-transform: uppercase;
}
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #00e676;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 10px #00e676, 0 0 0 3px rgba(0, 230, 118, 0.22);
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.88); }
}

/* KPI Strip inside Usage Graph Card */
.live-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.live-kpi {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(34, 197, 94, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
}
.live-kpi strong {
  display: block;
  font-size: 1.05rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-kpi strong.accent-green { color: #00e676; }
.live-kpi span {
  display: block;
  font-size: 0.72rem;
  color: #86efac;
  margin-top: 2px;
}

/* SVG Usage Area Graph */
.live-chart-wrap {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(34, 197, 94, 0.14);
  border-radius: 14px;
  padding: 12px 10px 8px;
  margin-bottom: 14px;
}
.live-usage-svg {
  width: 100%;
  height: 155px;
  display: block;
  overflow: visible;
}

/* Tool Breakdown Bars */
.tool-usage-bars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
  margin-bottom: 14px;
}
.usage-bar-item {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 9px;
  transition: background 0.15s ease;
}
.usage-bar-item:hover {
  background: rgba(0, 230, 118, 0.08);
}
.usage-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.77rem;
  margin-bottom: 5px;
}
.usage-bar-name { color: #ffffff; font-weight: 600; }
.usage-bar-count { color: #4ade80; font-weight: 700; }
.usage-bar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #059669, #00e676);
  transition: width 0.45s ease;
}

/* Right Card: Live Feed List (matching uploaded screenshot) */
.live-feed-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}
.live-feed-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.045);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  animation: feedFadeIn 0.3s ease;
}
.live-feed-row:hover {
  border-color: rgba(0, 230, 118, 0.34);
  background: rgba(0, 230, 118, 0.05);
}
@keyframes feedFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.live-feed-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(0, 230, 118, 0.13);
  border: 1px solid rgba(0, 230, 118, 0.24);
  color: #00e676;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.live-feed-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}
.live-feed-info {
  flex: 1;
  min-width: 0;
}
.live-feed-file {
  font-weight: 700;
  font-size: 0.93rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-feed-tool {
  font-size: 0.81rem;
  color: #86efac;
  opacity: 0.82;
  margin-top: 2px;
}
.live-feed-time {
  font-size: 0.8rem;
  color: #86efac;
  opacity: 0.72;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Bottom Animated Green Bar (like screenshot) */
.live-card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.live-scan-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.live-scan-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 36%;
  border-radius: 999px;
  background: linear-gradient(90deg, #059669, #00e676);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.65);
  animation: liveScanSlide 3.6s ease-in-out infinite;
}
.live-scan-bar-alt {
  animation-delay: -1.4s;
}
@keyframes liveScanSlide {
  0% { left: -36%; }
  50% { left: 64%; }
  100% { left: 100%; }
}

/* Supported Platforms */
.platforms-section { margin-top: 46px; }
.section-head { text-align: center; margin-bottom: 22px; }
.section-head h2 { margin: 0 0 6px; font-size: 1.55rem; letter-spacing: -0.02em; }
.section-head p { margin: 0; font-size: 0.92rem; }

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr));
  gap: 12px;
}
.platform-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}
.platform-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.platform-card strong { display: block; font-size: 0.92rem; }
.platform-card span { display: block; font-size: 0.77rem; color: var(--text-muted); }
.p-dot, .p-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c) 14%, rgba(255, 255, 255, 0.03));
  border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
  color: var(--c);
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.p-logo svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Features */
.features-section {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

/* SEO Tools Directory, How-To, FAQ & Popular Searches */
.seo-tools-section, .howto-section, .faq-section, .keywords-section {
  margin-top: 48px;
}
.seo-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}
.seo-tool-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.seo-tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 230, 118, 0.55);
  box-shadow: 0 14px 36px rgba(0, 230, 118, 0.08);
}
.seo-tool-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.seo-tool-tag {
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(0, 230, 118, 0.14);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: #4ade80;
}
.seo-tool-arrow {
  font-size: 0.78rem;
  font-weight: 600;
  color: #00e676;
}
.seo-tool-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: #ffffff;
}
.seo-tool-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.howto-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient);
  color: #03150b;
  font-weight: 800;
  font-size: 0.84rem;
  margin-bottom: 12px;
}
.howto-card h4 { margin: 0 0 6px; font-size: 0.98rem; color: #ffffff; }
.howto-card p { margin: 0; font-size: 0.84rem; color: var(--text-muted); line-height: 1.55; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 880px;
  margin: 0 auto;
}
.faq-item {
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 15px 18px;
  transition: border-color 0.16s ease;
}
.faq-item[open] {
  border-color: rgba(0, 230, 118, 0.45);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  color: #00e676;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  margin: 12px 0 2px;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.faq-item strong { color: #ffffff; }
.faq-item code {
  font-family: var(--font-mono);
  background: rgba(0, 230, 118, 0.12);
  color: #4ade80;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.82rem;
}

.keywords-section .section-head h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  color: #ffffff;
}
.keyword-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.kw-pill {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: #a7f3d0;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.kw-pill:hover {
  background: rgba(0, 230, 118, 0.16);
  border-color: #00e676;
  color: #ffffff;
  transform: translateY(-1px);
}
.feature-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.feature-icon { font-size: 1.5rem; margin-bottom: 10px; }
.feature-card h4 { margin: 0 0 6px; font-size: 0.98rem; }
.feature-card p { margin: 0; font-size: 0.84rem; color: var(--text-muted); line-height: 1.55; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  font-size: 0.84rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.player-modal-card { max-width: 780px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  margin: 0;
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.player-body {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 70vh;
}
.player-body video { width: 100%; max-height: 68vh; display: block; }
.player-body audio { width: 92%; margin: 40px 0; }

.settings-section { margin-bottom: 22px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section h4 { margin: 0 0 10px; font-size: 0.94rem; }
.engine-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.engine-stat {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.engine-stat span { display: block; font-size: 0.74rem; color: var(--text-muted); }
.engine-stat strong { font-size: 0.84rem; }
.engine-update-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.status-tag.loaded {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 11px 16px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
}
.toast.ok { border-left: 3px solid var(--success); }
.toast.err { border-left: 3px solid var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Desktop Wide, Tablet & Mobile Responsive Optimization
   ============================================================ */

/* Wide Desktop Monitors (1440px+) */
@media (min-width: 1440px) {
  .container { max-width: 1260px; }
  .platforms-grid { grid-template-columns: repeat(4, 1fr); }
  .seo-tools-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Standard Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .platforms-grid { grid-template-columns: repeat(3, 1fr); }
  .seo-tools-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Medium Desktop & Small Laptop (<= 1240px): prevent navbar overflow */
@media (max-width: 1240px) {
  .engine-pill { display: none; }
  .nav-actions { gap: 6px; }
  .icon-btn { padding: 0 9px; font-size: 0.81rem; }
}

/* Tablet & Small Laptop (<= 960px) */
@media (max-width: 960px) {
  .live-dashboard-grid { grid-template-columns: 1fr; }
  .media-summary { grid-template-columns: 220px 1fr; gap: 16px; }
  .platforms-grid { grid-template-columns: repeat(2, 1fr); }
  .seo-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; row-gap: 8px; }
  .nav-actions {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav-actions::-webkit-scrollbar { display: none; }
}

/* Mobile & Phablet (<= 768px) */
@media (max-width: 768px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .nav-inner { height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  .brand-text { font-size: 1.12rem; }
  .brand-tag { display: none; }

  .main-content { padding-top: 22px; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .hero { margin-bottom: 20px; }
  .hero-badge { font-size: 0.72rem; padding: 5px 11px; line-height: 1.4; }
  .hero h1 { font-size: clamp(1.65rem, 7vw, 2.25rem); margin-bottom: 10px; }
  .hero-sub { font-size: 0.9rem; margin-bottom: 18px; line-height: 1.55; }

  /* Horizontal swipeable tool tabs on mobile */
  .tool-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 2px 2px 6px;
    margin-bottom: 14px;
    gap: 7px;
  }
  .tool-tabs::-webkit-scrollbar { display: none; }
  .tool-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 40px;
    padding: 8px 13px;
    font-size: 0.82rem;
  }

  /* Prevent iOS auto-zoom on input focus (>= 16px) */
  .url-input, .text-input, .select-input, .batch-textarea, .tool-search-input {
    font-size: 16px;
  }

  /* Clean stacked mobile URL bar with thumb-friendly CTA */
  .url-bar {
    flex-wrap: wrap;
    padding: 10px;
    gap: 8px;
    border-radius: 14px;
  }
  .url-input {
    width: 100%;
    flex: 1 1 100%;
    padding: 8px 4px;
  }
  .url-bar-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .url-bar-actions .primary-btn {
    flex: 1;
    min-height: 44px;
  }
  .url-bar-actions .ghost-btn {
    min-height: 44px;
  }
  .url-hints {
    font-size: 0.78rem;
    padding-top: 8px;
    justify-content: center;
    text-align: center;
  }

  /* Horizontal swipeable quick platform logos strip on mobile */
  .hero-logos-strip {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 6px;
    margin-top: 12px;
  }
  .hero-logos-strip::-webkit-scrollbar { display: none; }
  .mini-logo-btn {
    flex: 0 0 auto;
    min-height: 36px;
  }

  /* Live Dashboard Mobile Layout */
  .live-dashboard-section { margin-top: 22px; }
  .live-card { padding: 16px 14px 14px; border-radius: 16px; }
  .live-card-head { padding-bottom: 11px; margin-bottom: 12px; }
  .live-card-label { font-size: 0.72rem; letter-spacing: 0.08em; }
  .live-kpi-row { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .live-kpi { padding: 8px 9px; }
  .live-kpi strong { font-size: 0.88rem; }
  .live-kpi span { font-size: 0.66rem; }
  .live-usage-svg { height: 135px; }
  .tool-usage-bars { grid-template-columns: repeat(2, 1fr); gap: 6px 10px; }
  .live-feed-row { padding: 10px 11px; gap: 10px; }
  .live-feed-icon { width: 36px; height: 36px; border-radius: 9px; }
  .live-feed-file { font-size: 0.86rem; }
  .live-feed-tool { font-size: 0.75rem; }
  .live-feed-time { font-size: 0.73rem; }

  /* Workspace & Tool Panels on Mobile */
  .active-job-card, .workspace-card, .standalone-card {
    padding: 16px 14px;
    border-radius: 16px;
  }
  .media-summary { grid-template-columns: 1fr; gap: 14px; padding-bottom: 16px; margin-bottom: 16px; }
  .media-info h2 { font-size: 1.08rem; }
  .clip-inputs-grid { grid-template-columns: 1fr; gap: 10px; }
  .format-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .format-right { width: 100%; justify-content: space-between; }
  .format-right .primary-btn { min-height: 40px; }
  .batch-controls { flex-direction: column; align-items: stretch; }
  .batch-controls .field-inline { justify-content: space-between; }
  .batch-controls .btn-row { justify-content: stretch; }
  .batch-controls .btn-row .primary-btn { flex: 1; min-height: 44px; }
  .engine-info-grid { grid-template-columns: 1fr; }

  /* Grids & Sections on Mobile */
  .platforms-section, .seo-tools-section, .howto-section, .faq-section, .keywords-section {
    margin-top: 32px;
  }
  .section-head h2 { font-size: 1.28rem; }
  .seo-tools-grid { grid-template-columns: 1fr; }
  .howto-grid { grid-template-columns: 1fr; }
  .features-section { grid-template-columns: 1fr; margin-top: 28px; }
  .faq-item { padding: 13px 14px; }
  .faq-item summary { font-size: 0.9rem; min-height: 36px; }
  .keyword-pills { justify-content: flex-start; gap: 6px; }
  .kw-pill { font-size: 0.75rem; padding: 6px 11px; }

  /* Mobile Bottom-Sheet Modals */
  .modal-backdrop { align-items: flex-end; padding: 10px; }
  .modal-card {
    max-height: 90dvh;
    overflow-y: auto;
    border-radius: 18px;
  }

  /* Centered Mobile Toasts */
  .toast-container {
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .toast { width: 100%; text-align: center; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
}

/* Compact Phones (<= 500px) */
@media (max-width: 500px) {
  .library-nav-btn span:not(.count-badge) { display: none; }
  .platforms-grid { grid-template-columns: 1fr; gap: 9px; }
  .platform-card { padding: 11px 12px; }
  .tool-usage-bars { grid-template-columns: 1fr; }
  .live-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .live-kpi strong { font-size: 0.82rem; }
  .job-complete-actions { flex-direction: column; align-items: stretch; }
  .job-complete-actions .primary-btn, .job-complete-actions .secondary-btn { width: 100%; min-height: 44px; }
  .file-size-note { margin-left: 0; text-align: center; }
}

/* Reduced Motion Accessibility & Battery Saver */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
