/* ============================================================
   DixX Save Web — Design System
   PornHub palette: #ff9000 accent on #0c0c0c black background
   Modern 2026 product dark aesthetic
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  color-scheme: dark;

  /* Palette — PornHub 1:1 */
  --bg:           #0c0c0c;
  --surface:      #1b1b1b;
  --surface-2:    #2b2b2b;
  --border:       #3a3a3a;
  --text:         #ffffff;
  --text-dim:     #b3b3b3;
  --accent:       #ff9000;
  --accent-hover: #e58200;
  --on-accent:    #000000;
  --danger:       #ff5252;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  /* Icon sizes */
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;

  /* Typography */
  font-family: -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 16px;        /* prevents iOS zoom */
  line-height: 1.5;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Never allow horizontal scroll / tap-past-edge on mobile (FIX: mobile overflow) */
html { overflow-x: hidden; }

/* ---- Base ---- */
body {
  background: var(--bg);
  color: var(--text);
  margin: 0 auto;
  max-width: 920px;
  padding: 0 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  background: var(--bg);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  letter-spacing: -0.01em;
}

/* Plain wordmark in the PornHub palette (FIX 3): "DixX" white, "Save" orange — no box */
.logo-word {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo-word__accent { color: var(--accent); }

.logo-img {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  object-fit: contain;
  /* Orange contour is baked into the PNG (crisp + symmetric across browsers). */
}

/* Premium pill */
.premium-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Header account menu (linked) — status chip + dropdown with Unlink */
.account-menu { position: relative; display: inline-flex; }
.account-chip { cursor: pointer; font-family: inherit; }
.account-chip:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.account-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
}
.account-dropdown[hidden] { display: none; }
.account-dropdown__tier {
  padding: 6px 10px 4px;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.account-dropdown__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.account-dropdown__item:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.account-dropdown__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Header right cluster */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav { display: flex; gap: 0.25rem; }
nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease-out, color 0.15s ease-out;
}
nav a:hover { background: var(--border); color: var(--text); }
nav a.active { color: var(--text); background: var(--border); }
nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   MAIN
   ============================================================ */
main { flex: 1; padding: 2.5rem 0 3rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 3rem 1rem 2rem;
  position: relative;
  border-radius: var(--r-lg);
  overflow: visible;
}

/* Radial orange glow behind hero */
.hero::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  max-width: 100%;
  background: radial-gradient(ellipse at center, rgba(255, 144, 0, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
#analysis-form { width: 100%; margin: 0 auto; }

/* Mode tabs: Video / Audio / Images (FIX 10) */
.mode-tabs {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}
.mode-tab:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.mode-tab.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.mode-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Search bar — full width to match the other cards (FIX 9) */
.search-bar {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.15s ease-out;
  max-width: none;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.search-bar:focus-within { border-color: var(--accent); }

/* Quality / bitrate selector under the input (FIX 9/10) */
.quality-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.875rem;
  flex-wrap: wrap;
}
.quality-row label {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}
.quality-row select {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ff9000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 0.75rem center;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.55rem 2.25rem 0.55rem 0.9rem;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
}
.quality-row select:hover { border-color: var(--accent); }
.quality-row select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 0.875rem 1.125rem;
  min-height: 52px;
  outline: none;
  min-width: 0;
  touch-action: manipulation;
}
.search-bar input::placeholder { color: var(--text-dim); }

.search-bar button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.875rem 1.625rem;
  min-height: 52px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease-out, transform 0.12s ease-out;
  white-space: nowrap;
}
.search-bar button:hover:not(:disabled) { background: var(--accent-hover); }
.search-bar button:active:not(:disabled) { transform: scale(.97); }
.search-bar button:disabled { opacity: 0.5; cursor: wait; }
.search-bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Spinner inside button */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.btn-spinner {
  width: var(--icon-md);
  height: var(--icon-md);
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ============================================================
   STATUS
   ============================================================ */
#status {
  margin-top: 0.875rem;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  min-height: 1.25em;
}

/* ============================================================
   SOURCES
   ============================================================ */
.sources { text-align: center; margin: 2rem 0 1.5rem; }
.sources-label { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.75rem; }
.sources-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.875rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: border-color 0.15s ease-out, color 0.15s ease-out;
}
.source-chip:hover { border-color: var(--accent); color: var(--text); }
.source-chip svg { opacity: 1; }

/* ============================================================
   DISCLAIMER
   ============================================================ */
.disclaimer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.55;
  margin-top: 0.75rem;
}

/* ============================================================
   RESULT CARD
   ============================================================ */
.result-card {
  position: relative;
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  transition: box-shadow 0.2s ease-out;
}

/* Close (×) for the preview/result card (FIX 5) */
.card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.card-close:hover { background: rgba(0, 0, 0, 0.8); color: var(--accent); }
.card-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.result-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.6); }

/* Thumbnail */
.thumb-wrap {
  position: relative;
  background: #000;
  line-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

/* Card body */
.result-info { padding: 1.25rem; }
.result-info h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

/* Actual-quality caption (FIX 3) */
.result-quality {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   FORMAT SECTIONS
   ============================================================ */
.format-section { margin-bottom: 1rem; }
.format-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Base format button — tonal/secondary */
.format-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-2);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.5rem 1rem;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, transform 0.12s ease-out;
}
.format-btn:hover:not(:disabled) {
  background: var(--border);
  border-color: var(--accent);
}
.format-btn:active:not(:disabled) { transform: scale(.97); }
.format-btn:disabled { opacity: 0.5; cursor: wait; transform: none; }
.format-btn.downloading { background: var(--border); color: var(--text-dim); }
.format-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Gated button */
.format-btn.gated-btn {
  color: var(--text-dim);
  border-style: dashed;
}
.format-btn.gated-btn:hover:not(:disabled) { border-color: var(--text-dim); color: var(--text); }

/* Icon alignment */
.format-btn svg {
  flex-shrink: 0;
  width: var(--icon-md);
  height: var(--icon-md);
}

/* ============================================================
   NOTICE BOX (paywall / 18+ / single-element replacement)
   ============================================================ */
.notice-box {
  margin-top: 1rem;
  padding: 1rem 1.125rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.notice-box p {
  font-size: 0.9rem;
  color: var(--text-dim);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}
.notice-box p svg { flex-shrink: 0; margin-top: 2px; }
.notice-box .notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================================
   CTA BUTTON — orange with black text
   ============================================================ */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: var(--r-sm);
  padding: 0.625rem 1.375rem;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  transition: transform 0.12s ease-out;
  width: fit-content;
}
.cta-btn:hover { background: var(--accent-hover); }
.cta-btn:active { transform: scale(.97); }
.cta-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Secondary CTA — outlined */
.cta-btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.cta-btn--outline:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Primary format button (the one-click chosen download) */
.format-btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 700;
}
.format-btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

/* ============================================================
   MODAL (FIX 6/7) — one centered dialog, X-close, symmetric
   ============================================================ */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.8);
  animation: modal-fade 0.12s ease-out;
}
.modal-overlay[hidden] { display: none; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: modal-rise 0.18s ease-out;
}
@keyframes modal-rise { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease-out, color 0.15s ease-out;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-content { text-align: center; }
.modal-notice { display: flex; flex-direction: column; align-items: center; gap: 0.875rem; }
.modal-notice__title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.modal-notice__title svg { color: var(--accent); flex-shrink: 0; }
.modal-notice__msg {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 32ch;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

/* ============================================================
   IMAGE GRID (FIX 10 — "Картинки")
   ============================================================ */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
}
.image-tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s ease-out, transform 0.12s ease-out;
}
.image-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.image-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-tile--noimg img { display: none; }
.image-tile--noimg::before {
  content: "🖼";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  opacity: 0.4;
}
.image-tile__dl {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.image-tile__dl svg { width: 16px; height: 16px; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.merge-progress {
  width: 100%;
  max-width: 420px;
  margin: 0.5rem 0;
  background: var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
  height: 36px;
}
.merge-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent));
  border-radius: var(--r-sm);
  transition: width 0.3s ease-out;
}
.merge-progress-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-shadow: none;
  white-space: nowrap;
}

/* ============================================================
   SKELETON / SHIMMER (loading state)
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  margin-top: 2rem;
}
.skeleton-thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.skeleton-thumb::after,
.skeleton-line::after,
.skeleton-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.055) 50%,
    transparent 100%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.skeleton-line {
  height: 1rem;
  border-radius: 4px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.skeleton-line.short { width: 55%; }
.skeleton-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
.skeleton-btn {
  height: 44px;
  width: 120px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}

/* ============================================================
   TELEGRAM CONNECT SECTION
   ============================================================ */
.connect {
  margin-top: 3rem;
  padding: 2rem 1.5rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  transition: border-color 0.2s ease-out;
}
.connect:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.connect__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.connect h2 {
  font-size: 1.25rem;
  font-weight: 700;
}
.connect p {
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 520px;
}
.connect-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: none;
}
.connect-hint.visible { display: block; }

/* Connected state block */
.connect-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.connect-status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}
.connect-tier {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ============================================================
   HOW-TO SECTION
   ============================================================ */
.how {
  margin-top: 3rem;
}
.how h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.steps li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.125rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease-out, transform 0.15s ease-out;
}
.steps li:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateX(2px);
}
.step-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  padding-top: 0.05rem;
}

/* FAQ heading */
.faq-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1.25rem;
}

/* FAQ details */
.faq {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease-out;
}
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.faq summary {
  padding: 0.875rem 1.125rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  touch-action: manipulation;
  transition: color 0.15s ease-out;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--text-dim);
  flex-shrink: 0;
  font-weight: 400;
}
.faq details[open] summary::after { content: "−"; color: var(--accent); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq details p {
  padding: 0 1.125rem 1rem;
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.65;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* ============================================================
   PROMO GRID
   ============================================================ */
.promo {
  margin-top: 3rem;
  margin-bottom: 2rem;
}
.promo h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}
.promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.promo-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease-out, border-color 0.2s ease-out, transform 0.15s ease-out, box-shadow 0.2s ease-out;
}
.promo-card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,144,0,0.12);
}
.promo-card:active { transform: scale(.97); }
.promo-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.promo-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.promo-card__title {
  font-weight: 700;
  font-size: 1rem;
}
.promo-card__desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.55;
}
.promo-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  min-height: 44px;
  padding: 0.2rem 0;
  touch-action: manipulation;
  transition: color 0.15s ease-out;
}
footer a:hover { color: var(--text); }
footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
footer a svg { opacity: 0.7; }

/* ============================================================
   GLOBAL FOCUS + INTERACTIONS
   ============================================================ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 620px) {
  .promo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .search-bar { flex-direction: column; }
  .search-bar button {
    border-radius: 0;
    justify-content: center;
  }
  body { max-width: 100%; }
  .hero { padding: 2rem 0 1.5rem; }
}

@media (max-width: 375px) {
  .hero h1 { font-size: 1.5rem; }
  .connect { padding: 1.25rem 1rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .skeleton-thumb::after,
  .skeleton-line::after,
  .skeleton-btn::after {
    animation: none;
  }
  .hero::before { display: none; }
}
