/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #191a1e;
  --bg-secondary: #191a1e;
  --bg-card: #2c2f33;
  --bg-input: #23252a;
  --border: #545861;
  --border-focus: #ca4b44;
  --text-primary: #e5e7eb;
  --text-secondary: #a6a9ad;
  --text-muted: #a6a9ad;
  --accent: #ca4b44;
  --accent-hover: #d45b55;
  --accent-glow: rgba(202, 75, 68, 0.15);
  --danger: #ff4a6e;
  --success: #2ecc71;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2c2f33;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav-inner {
  max-width: 1050px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 17px;
}
.nav-brand img { height: 32px; width: 32px; border-radius: 6px; }
.nav-tag {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-tag:hover { color: var(--accent-hover); }

/* ── HERO ── */
.hero {
  padding: 60px 24px 40px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--text-primary);
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto 10px;
}

/* ── TOOL WRAPPER ── */
.tool-wrap { max-width: 860px; margin: 0 auto; padding: 0 24px 80px; }

/* ── DROP ZONE (16:9) ── */
.drop-zone {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card);
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.drop-inner { padding: 24px; }
.drop-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: transform 0.15s;
}
.drop-zone:hover .drop-icon { transform: translateY(-2px); }
.drop-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.drop-sub { font-size: 14px; color: var(--text-secondary); }
.drop-sub span { color: var(--accent); font-weight: 600; }
#file-input, #comp-input { display: none; }
.drop-zone.hidden { display: none; }

/* ── ERROR MESSAGE ── */
.error-msg { display: none; margin-top: 12px; padding: 11px 14px; background: rgba(255,74,110,0.08); border: 1px solid rgba(255,74,110,0.2); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--danger); }
.error-msg.visible { display: block; }

/* ── RESULTS ── */
.results { display: none; }
.results.visible { display: block; }

/* Shared block headings */
.block-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.block-eyebrow.center { text-align: center; }
.block-title {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.block-title.center { text-align: center; }

/* ── SIZE EXPLORER ── */
.explorer {
  margin-top: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.explorer-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
/* Dark/light preview background toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--accent); }
.theme-toggle svg { flex-shrink: 0; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle.is-light .icon-moon { display: none; }
.theme-toggle.is-light .icon-sun { display: block; }

/* Stage keeps a stable 16:9 area; the frame shrinks inside it, centered */
.explorer-stage {
  aspect-ratio: 16 / 9;
  background: #0f0f0f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
  transition: background 0.2s;
}
.explorer-stage.is-light { background: #ffffff; }
.explorer-frame {
  position: relative;
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: width 0.05s linear;
}
.explorer-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* YouTube UI overlay (duration badge, progress bar, safe zone) — scales with the frame */
.yt-overlay { position: absolute; inset: 0; pointer-events: none; }
.yt-overlay[hidden] { display: none; }
.yt-safezone {
  position: absolute;
  inset: 5%;
  border: 0.4cqw dashed rgba(255, 255, 255, 0.45);
  border-radius: 1cqw;
}
.yt-duration {
  position: absolute;
  right: 2.4cqw;
  bottom: 4cqw;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 3.4cqw;
  font-weight: 700;
  line-height: 1;
  padding: 0.8cqw 1.3cqw;
  border-radius: 1cqw;
}
.yt-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.4cqw;
  background: rgba(255, 255, 255, 0.28);
}
.yt-progress::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 38%;
  background: #ff0000;
}

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
/* Before a thumbnail is uploaded the tabs are shown for context but can't be
   used yet (the checks need an image). */
.tabs.is-locked { opacity: 0.5; }
.tabs.is-locked .tab { cursor: not-allowed; pointer-events: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tab:hover { color: var(--text-primary); border-color: var(--accent); }
.tab.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 800;
}
.tab.is-active .tab-num { background: rgba(255, 255, 255, 0.22); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* Controls cluster in the explorer header */
.explorer-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-toggle.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ── BLEND-IN TEST ── */
/* Break the blend-in panel out of the 860px tool column so the feed has room. */
#panel-competitor.is-active {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1240px, calc(100vw - 32px));
}
.sizes-sub.comp-intro { text-align: left; max-width: 760px; margin: 0 0 20px; }
.drop-zone.comp-drop {
  aspect-ratio: auto;
  padding: 28px 24px;
  margin-bottom: 24px;
}
.drop-zone.comp-drop .drop-inner {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.drop-zone.comp-drop .drop-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
}
.drop-zone.comp-drop .drop-title { font-size: 15px; }

/* Tool area — sits between the drop zone and the feed grid */
.feed-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.feed-tools-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Feed background stage — toggles between YouTube dark and light */
.feed-stage {
  background: #0f0f0f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  transition: background 0.2s;
}
.feed-stage.is-light { background: #ffffff; }
.feed-stage.is-light .feed-title { color: #0f0f0f; }
.feed-stage.is-light .feed-channel { color: #606060; }

.feed-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 20px;
}
.feed-card { min-width: 0; }
.feed-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.feed-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feed-dur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
}
.feed-meta { display: flex; gap: 11px; margin-top: 11px; }
.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-input) url('images/profile.jpg') center / cover no-repeat;
}
.feed-text { min-width: 0; }
.feed-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-channel { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.feed-card.is-mine.reveal .feed-thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.feed-card.is-mine.reveal .feed-thumb::after {
  content: 'Yours';
  position: absolute;
  left: 6px;
  top: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
}

/* ── SPECS CHECK ── */
.spec-preview {
  width: 100%;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f0f0f;
}
.spec-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

/* Scanning progress bar */
.spec-scan { margin: 4px 0 20px; }
.spec-scan[hidden] { display: none; }
.spec-scan-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.spec-scan-track {
  height: 6px;
  background: var(--bg-input);
  border-radius: 100px;
  overflow: hidden;
}
.spec-scan-fill {
  width: 0;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

/* Reveal animation — cards rise/fade in, badges pop, staggered */
.spec-card {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.spec-badge {
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.spec-grid.is-revealed .spec-card { opacity: 1; transform: none; }
.spec-grid.is-revealed .spec-badge { transform: scale(1); }
.spec-grid.is-revealed .spec-card:nth-child(1) { transition-delay: 0s; }
.spec-grid.is-revealed .spec-card:nth-child(2) { transition-delay: 0.12s; }
.spec-grid.is-revealed .spec-card:nth-child(3) { transition-delay: 0.24s; }
.spec-grid.is-revealed .spec-card:nth-child(1) .spec-badge { transition-delay: 0.18s; }
.spec-grid.is-revealed .spec-card:nth-child(2) .spec-badge { transition-delay: 0.30s; }
.spec-grid.is-revealed .spec-card:nth-child(3) .spec-badge { transition-delay: 0.42s; }

@media (prefers-reduced-motion: reduce) {
  .spec-card, .spec-badge { transition: none; opacity: 1; transform: none; }
}
.spec-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.spec-card.is-pass { border-color: rgba(46, 204, 113, 0.45); }
.spec-card.is-warn { border-color: rgba(240, 180, 41, 0.6); }
.spec-card.is-fail { border-color: rgba(229, 72, 77, 0.6); }
.spec-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.spec-badge.is-pass { background: var(--success); }
.spec-badge.is-warn { background: #f0b429; }
.spec-badge.is-fail { background: #e5484d; }
.spec-body { min-width: 0; }
.spec-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.spec-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.spec-note { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* ── OPTIMIZATION TEST ── */
/* Progress bar (mirrors the specs "scan" bar for visual consistency) */
.opt-progress { margin: 4px 0 22px; }
.opt-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.opt-progress-type {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.opt-progress-count { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.opt-progress-track {
  height: 6px;
  background: var(--bg-input);
  border-radius: 100px;
  overflow: hidden;
}
.opt-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Answered rows (a running checklist that fills in as they go) */
.opt-rows { display: flex; flex-direction: column; gap: 10px; }
.opt-type-divider {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 16px 0 4px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}
.opt-type-divider:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.opt-row {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 46px 14px 16px;
  animation: optFade 0.35s ease;
}
.opt-row-redo {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.opt-row-redo:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-input);
}
.opt-row.is-pass { border-color: rgba(46, 204, 113, 0.4); }
.opt-row.is-miss { border-color: rgba(229, 72, 77, 0.55); }
.opt-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.opt-badge.is-pass { background: var(--success); }
.opt-badge.is-miss { background: #e5484d; }
.opt-badge.is-gate { background: var(--bg-card); border: 1px solid var(--border); }
.opt-badge.pop { animation: optPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.opt-row-body { min-width: 0; flex: 1; }
.opt-row-q { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.opt-row-a { font-size: 12px; font-weight: 600; margin-top: 3px; }
.opt-row.is-pass .opt-row-a { color: var(--success); }
.opt-row.is-miss .opt-row-a { color: var(--danger); }
.opt-row.is-gate .opt-row-a { color: var(--text-muted); }

/* Suggestion tooltip / callout shown on a "no" (miss) */
.opt-tip {
  position: relative;
  margin-top: 11px;
  background: var(--bg-card);
  border: 1px solid rgba(229, 72, 77, 0.45);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  animation: optFade 0.35s ease;
}
.opt-tip::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 18px;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-left: 1px solid rgba(229, 72, 77, 0.45);
  border-top: 1px solid rgba(229, 72, 77, 0.45);
  transform: rotate(45deg);
}
.opt-tip strong { color: var(--text-primary); }
.opt-tip a {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.opt-tip a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Active question card */
.opt-active { margin-top: 16px; }
.opt-active[hidden] { display: none; }
.opt-q-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  animation: optFade 0.35s ease;
}
.opt-q-text {
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.opt-q-buttons { display: flex; gap: 12px; margin-top: 20px; }
.opt-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s;
}
.opt-btn:hover { transform: translateY(-1px); }
.opt-btn-yes:hover { border-color: var(--success); background: rgba(46, 204, 113, 0.1); color: #fff; }
.opt-btn-no:hover { border-color: var(--danger); background: rgba(255, 74, 110, 0.08); color: #fff; }

/* Continue prompt — shown after a type's questions are all answered */
.opt-continue {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  animation: optFade 0.35s ease;
}
.opt-continue-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.opt-btn-continue {
  flex: none;
  align-self: stretch;
}
.opt-btn-continue:hover { border-color: var(--accent); background: rgba(202, 75, 68, 0.1); color: #fff; }

/* Result — success note + fix report */
.opt-result { margin-top: 4px; }
.opt-result[hidden] { display: none; }
.opt-success {
  text-align: center;
  padding: 36px 24px;
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.13), rgba(46, 204, 113, 0.03));
  border: 1px solid rgba(46, 204, 113, 0.42);
  border-radius: var(--radius);
  animation: optFade 0.4s ease;
}
.opt-success-badge {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: optPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.opt-success-title { font-size: clamp(22px, 3vw, 28px); font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.opt-success-sub { font-size: 14px; color: var(--text-secondary); margin-top: 10px; }

.opt-report { animation: optFade 0.4s ease; }
.opt-report-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.opt-report-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0b429;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.opt-report-title { font-size: 20px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.2; }
.opt-report-sub { font-size: 13px; color: var(--text-secondary); margin-top: 5px; line-height: 1.55; }
.opt-report-textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.65;
}
.opt-report-textarea:focus { outline: none; border-color: var(--accent); }
.opt-report-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.opt-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.opt-copy-btn:hover { background: var(--accent-hover); }
.opt-copy-btn.copied { background: var(--success); }

@keyframes optPop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes optFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .opt-progress-fill { transition: none; }
  .opt-row, .opt-tip, .opt-q-card, .opt-continue, .opt-success, .opt-report,
  .opt-badge.pop, .opt-success-badge { animation: none; }
}

/* Full-screen confetti overlay */
#confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; }
#confetti-canvas[hidden] { display: none; }

/* ── SLIDER ── */
.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}
.slider-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.size-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: var(--bg-input);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}
.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent);
}
.size-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent);
}
.slider-hint { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 12px; line-height: 1.55; }

/* ── ALL SIZES ── */
.sizes { margin-top: 44px; }
.sizes-sub {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 540px;
  margin: 10px auto 0;
  line-height: 1.6;
}

.size-group { margin-top: 30px; }
.size-group-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* Cards flow left-to-right, wrapping. Each card is only as wide as its image. */
.size-list {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: flex-start;
}
.size-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.size-thumb {
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
.size-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.size-meta { margin-top: 10px; max-width: 220px; }
.size-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.size-dims {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.size-note { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }

/* ── RESET BUTTON ── */
.btn-reset {
  display: block;
  margin: 40px auto 0;
  padding: 11px 22px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-reset:hover { color: var(--text-primary); border-color: var(--accent); }

/* Row holding "Start over" + any secondary action (e.g. Upscale to 4K) */
.reset-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
}
.reset-row .btn-reset { margin: 0; }
.btn-upscale {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-upscale:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-upscale[hidden] { display: none; }

/* Advance to the next step/tab (e.g. bottom of the Size Preview page) */
.btn-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 36px auto 0;
  padding: 15px 24px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-next:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }

/* ── SECTIONS ── */
.section { max-width: 860px; margin: 0 auto; padding: 0 24px 80px; }
.section-title {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  text-align: center;
}
.steps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.step-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.step-title { font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.step-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ── PROMO CARD ── */
.promo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 48px;
  text-align: center;
}
.promo-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.promo-title span { color: var(--accent); }
.promo-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.65; max-width: 480px; margin: 0 auto 28px; }
.promo-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1050px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}
.footer a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--text-primary); }

/* ── MOBILE ── */
@media (max-width: 640px) {
  .nav { padding: 0 16px; }
  .footer { padding: 22px 16px; }
  .hero, .tool-wrap, .section { padding-left: 16px; padding-right: 16px; }
  .steps-grid { grid-template-columns: 1fr; }
  .promo-card { padding: 32px 20px; }
  .size-list { gap: 16px; justify-content: flex-start; }
  .tab { flex: 1; justify-content: center; padding: 10px 12px; font-size: 13px; }
  .explorer-head { align-items: stretch; }
  .explorer-controls { width: 100%; }
  .feed-grid { grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
}

/* Feed column steps for mid-size screens */
@media (max-width: 1000px) and (min-width: 641px) {
  .feed-grid { grid-template-columns: repeat(3, 1fr); }
}
