:root {
  --bg: #0b0d12;
  --surface: #131722;
  --surface-2: #191f2e;
  --border: #252d40;
  --text: #f3f5fa;
  --text-muted: #98a2b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --ig-grad: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  --fb-blue: #1877f2;
  --danger: #f43f5e;
  --success: #10b981;
  --radius: 14px;
}

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

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

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
}

.beta-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

.main-content {
  flex: 1;
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.platform-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.badge-ig {
  background: rgba(221, 42, 123, 0.16);
  color: #f9a8d4;
  border: 1px solid rgba(221, 42, 123, 0.35);
}

.badge-fb {
  background: rgba(24, 119, 242, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(24, 119, 242, 0.35);
}

.badge-soon {
  background: rgba(152, 162, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3.6vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tool-card-live:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tool-card-soon {
  opacity: 0.72;
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tool-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.tool-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.tool-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
}

.tool-cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: #a5b4fc;
}

.extractor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px 6px 12px;
  transition: border-color 0.15s ease;
}

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

.detected-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.detected-badge.ig {
  background: var(--ig-grad);
  color: #fff;
}

.detected-badge.fb {
  background: var(--fb-blue);
  color: #fff;
}

#url-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 0.95rem;
  padding: 8px 4px;
}

#url-input::placeholder {
  color: #6b758d;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 126px;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.btn-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);
  }
}

.format-hints {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.format-hints code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
}

.status-banner {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.status-banner.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.status-banner.info {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.results-section,
.history-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.results-header,
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.results-header h2,
.section-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.results-meta {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.platform-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: capitalize;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.covers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.cover-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cover-preview-wrap {
  position: relative;
  background: #07090d;
  aspect-ratio: 9 / 14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cover-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-label-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: blur(6px);
  color: #f8fafc;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.cover-actions {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cover-meta-line {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.action-row {
  display: flex;
  gap: 8px;
}

.download-btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

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

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.text-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

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

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

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.history-item-url {
  color: var(--text);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.info-card h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.info-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .input-row {
    flex-direction: column;
  }

  .primary-btn {
    padding: 13px 18px;
  }
}

.editorial-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.editorial-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.editorial-block h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
}

.steps-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.faq-item p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
