/* Image to Image — frontend styles (public/styles.css)
   Dark theme, blue→violet gradient accent, inset darker result canvas. */
:root {
  --bg: #16141f;
  --panel: #211d2e;
  --panel-2: #262233;
  --ink: #ece9f6;
  --muted: #a39cbf;
  --line: #332e47;
  --accent-1: #4a8dff;
  --accent-2: #8b5cf6;
  --accent-text: #9db4ff;
  --accent-grad: linear-gradient(135deg, #4a8dff 0%, #6f7bf8 45%, #8b5cf6 100%);
  --accent-soft: rgba(96, 116, 250, .13);
  --accent-line: rgba(120, 128, 250, .32);
  --ring: rgba(124, 128, 250, .45);
  --danger: #f2a49e;
  --danger-soft: rgba(180, 35, 24, .18);
  --ok: #5ad6a0;
  --ok-soft: rgba(6, 118, 71, .22);
  --info-soft: rgba(23, 92, 211, .18);
  --info-ink: #93b8ff;
  --stage: #171422;
  --stage-line: #322e46;
  --stage-ink: #ece9f6;
  --stage-muted: #9d95bc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-height, 64px) + 10px); }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.hint { color: var(--muted); font-size: .85rem; margin: .35rem 0; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--accent-2); color: #fff; padding: 8px 14px; border-radius: 8px;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 12px;
  font: inherit; font-weight: 600; padding: 9px 16px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  transition: filter .15s ease, background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--ring); outline-offset: 2px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 2px 12px rgba(90, 110, 248, .32); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 4px 18px rgba(90, 110, 248, .42); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: #575084; }
.btn-lg { width: 100%; justify-content: center; padding: 13px 18px; font-size: 1.02rem; }

/* Header */
.site-header {
  background: rgba(22, 20, 31, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.site-nav { margin-left: 8px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: var(--ink); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.credits-badge {
  background: var(--ok-soft); color: var(--ok); border-radius: 999px;
  padding: 4px 12px; font-size: .85rem; white-space: nowrap;
}
.user-name { font-size: .9rem; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hero */
.hero { padding: 40px 20px 10px; position: relative; }
.grad-text {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin: 0 0 10px; }

/* Banners */
.banner { border-radius: var(--radius); padding: 12px 16px; margin: 14px auto; }
.banner-info { background: var(--info-soft); color: var(--info-ink); }
.banner-error { background: var(--danger-soft); color: var(--danger); }

/* Workspace */
.workspace {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 20px; margin-top: 10px; align-items: start;
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.panel-title { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 10px; }
.panel-title:first-child { margin-top: 0; }

/* Dropzone */
.dropzone {
  border: 2px dashed #494268; border-radius: var(--radius);
  padding: 22px; text-align: center; background: var(--panel-2);
  transition: border-color .15s ease, background .15s ease;
}
.dropzone.dragover { border-color: var(--accent-1); background: var(--accent-soft); }
.dropzone-empty svg { color: #6f6790; }
.dropzone-preview img { max-height: 260px; width: auto; height: auto; margin: 0 auto; border-radius: 10px; }
.upload-meta { font-size: .82rem; color: var(--muted); margin-top: 8px; }
.field-row { margin: 12px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent-2); flex: none; }
.inline-status { font-size: .88rem; color: var(--muted); }
.inline-status.error { color: var(--danger); }
.inline-status.ok { color: var(--ok); }

/* Indeterminate upload progress */
.progress {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line); margin: 10px 0 2px;
}
.progress-bar {
  height: 100%; width: 38%; border-radius: 999px; background: var(--accent-grad);
  animation: progress-slide 1.15s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}

/* Result entrance */
.compare, .single-result, .pair { animation: result-in .45s cubic-bezier(.22, .9, .3, 1) both; }
@keyframes result-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* History skeleton */
.history-item.skel { pointer-events: none; }
.skel-block {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--panel-2) 25%, #322d45 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel-thumb { width: 64px; height: 64px; border-radius: 10px; }
.skel-line { height: 12px; }
.skel-line.w-60 { width: 60%; }
.skel-line.w-35 { width: 35%; margin-top: 10px; }
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-bar { animation-duration: 2.6s; }
  .compare, .single-result, .pair { animation: none; }
  .skel-block { animation-duration: 2.8s; }
}

/* Prompt */
.req-details { display: inline; }
.req-details summary { display: inline; cursor: pointer; color: var(--accent-text); }
.req-details summary::-webkit-details-marker { display: none; }
.req-details[open] { display: block; margin-top: 4px; }
.req-details[open] summary { display: block; margin-bottom: 2px; }
textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  font: inherit; resize: vertical; min-height: 96px; background: var(--panel-2); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea::placeholder { color: #6f6790; }
textarea:focus { border-color: var(--accent-1); outline: none; box-shadow: 0 0 0 3px rgba(96, 116, 250, .22); }
.char-count { text-align: right; }

/* Ratio */
.ratio-group { border: none; margin: 6px 0 14px; padding: 0; }
.ratio-group legend { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0; margin-bottom: 8px; }
.ratio-options { display: flex; gap: 8px; flex-wrap: wrap; }
.ratio { position: relative; }
.ratio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ratio span {
  display: inline-block; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 14px; font-size: .9rem; background: var(--panel-2); color: var(--ink); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ratio input:checked + span { background: var(--accent-grad); border-color: transparent; color: #fff; }
.ratio input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 2px; }

.consent-note {
  background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .28); color: #f2c268;
  border-radius: 12px; padding: 10px 14px; font-size: .88rem; margin: 4px 0 12px;
}

/* Result panel: card with an inset darker canvas */
.result-panel { min-height: 320px; }
.result-stage {
  background: var(--stage); border: 1px solid var(--stage-line);
  border-radius: 12px; padding: 16px; min-height: 280px;
  display: flex; flex-direction: column; color: var(--stage-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.result-stage .hint { color: var(--stage-muted); }
.result-state {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  text-align: center; color: var(--stage-muted); padding: 32px 16px;
}
.result-state strong { color: var(--stage-ink); }
.result-state svg { color: #655c8c; margin: 0 auto 10px; }
.spinner {
  width: 40px; height: 40px; margin: 0 auto 14px; border-radius: 50%;
  border: 4px solid rgba(140, 150, 250, .2); border-top-color: #93a4ff;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Generation stage bar — real job states only, no fabricated percentages or ETA */
.stage-bar {
  list-style: none; display: flex; align-items: flex-start;
  margin: 20px auto 4px; padding: 0; max-width: 400px; width: 100%;
}
.stage-step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: .75rem; color: var(--stage-muted); position: relative; text-align: center;
}
.stage-step::before, .stage-step::after {
  content: ''; position: absolute; top: 5px; height: 2px; width: 50%;
  background: var(--stage-line);
}
.stage-step::before { left: 0; }
.stage-step::after { right: 0; }
.stage-step:first-child::before, .stage-step:last-child::after { display: none; }
.stage-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--panel-2);
  border: 2px solid var(--stage-line); position: relative; z-index: 1;
  transition: background .2s ease, border-color .2s ease;
}
.stage-step.done { color: var(--stage-ink); }
.stage-step.done .stage-dot { background: var(--accent-grad); border-color: transparent; }
.stage-step.done::before, .stage-step.done::after { background: #5a6be0; }
.stage-step.active { color: var(--stage-ink); }
.stage-step.active .stage-dot {
  background: var(--accent-grad); border-color: transparent;
  animation: stage-pulse 1.6s ease-in-out infinite;
}
@keyframes stage-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(120, 134, 246, .45); }
  50% { box-shadow: 0 0 0 7px rgba(120, 134, 246, 0); }
}
.stage-note { margin: 8px 0 0; }
#stage-network { color: #f2c268; }
@media (prefers-reduced-motion: reduce) {
  .stage-step.active .stage-dot { animation-duration: 3.2s; }
}

/* Compare */
.compare { margin: 0; }
.compare-frame {
  position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--stage-line);
  background: repeating-conic-gradient(#221e31 0% 25%, #171422 0% 50%) 0 0 / 20px 20px;
}
.compare-frame img { width: 100%; height: auto; }
.compare-after { display: block; }
.compare-before-wrap {
  position: absolute; inset: 0; overflow: hidden; width: 50%;
  border-right: 2px solid #fff; box-shadow: 4px 0 12px rgba(0, 0, 0, .5);
  background: #121020;
}
.compare-before { position: absolute; inset: 0; height: 100%; width: auto; max-width: none; object-fit: cover; }
.compare-handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .5); pointer-events: none;
}
.compare-handle::before, .compare-handle::after {
  content: ""; position: absolute; top: 50%; border: 5px solid transparent;
}
.compare-handle::before { left: 5px; border-right-color: var(--accent-1); transform: translateY(-50%); }
.compare-handle::after { right: 5px; border-left-color: var(--accent-2); transform: translateY(-50%); }
.compare-slider-label { display: block; font-size: .85rem; color: var(--stage-muted); margin-top: 10px; }
.compare-slider-label input { width: 100%; accent-color: #6f7bf8; }
.result-meta { font-size: .82rem; color: var(--stage-muted); margin-top: 8px; }
.single-result { margin: 0; }
.single-result img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--stage-line); }

/* Side-by-side pair for differing aspect ratios */
.pair { margin: 0; }
.pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair-cell img {
  width: 100%; height: auto; object-fit: contain;
  border-radius: 10px; border: 1px solid var(--stage-line);
  background: repeating-conic-gradient(#221e31 0% 25%, #171422 0% 50%) 0 0 / 16px 16px;
}
.pair-cell span {
  display: block; text-align: center; font-size: .78rem; color: var(--stage-muted); margin-top: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
/* Before/after pairs stay side-by-side on phones too — the first-screen
   acceptance is a swipeable couple-anime card, not stacked images. */
@media (max-width: 560px) { .pair-row { gap: 8px; } .pair-cell span { font-size: .68rem; } }

.result-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* History */
.history { margin-top: 34px; }
.history-head { display: flex; align-items: center; justify-content: space-between; }
.history-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.history-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
}
.history-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); }
.history-thumb.placeholder { display: flex; align-items: center; justify-content: center; color: #6f6790; }
.history-prompt { font-size: .9rem; margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.history-meta { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.history-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.history-actions .btn { padding: 6px 12px; font-size: .85rem; }
.status-chip {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 600;
}
.status-succeeded { background: var(--ok-soft); color: var(--ok); }
.status-failed { background: var(--danger-soft); color: var(--danger); }
.status-active { background: var(--info-soft); color: var(--info-ink); }
.status-review { background: rgba(245, 158, 11, .14); color: #f2c268; }

/* Use-case cards */
.use-cases { margin-top: 40px; }
.use-case-grid {
  margin-top: 14px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.use-case-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.use-case-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.use-case-card:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.use-case-card[aria-pressed="true"] {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px var(--accent-line), var(--shadow);
}
.use-case-card svg { color: var(--accent-text); }
.use-case-card h3 { margin: 2px 0 0; font-size: 1.02rem; }
.uc-desc { margin: 0; font-size: .9rem; color: var(--ink); }
.uc-input { margin: 0 0 8px; font-size: .8rem; color: var(--muted); }
.uc-use { align-self: flex-start; margin-top: auto; }

/* Examples — compact horizontal gallery (desktop arrows, mobile swipe, keyboard).
   Sits between hero and workspace so it is reachable on the first screen. */
.examples { margin-top: 22px; }
.examples h2 { margin: 0 0 6px; }
.examples-panel p { margin: 0; }
.gallery { position: relative; margin-top: 10px; }
.gallery-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 12px; scrollbar-width: thin;
}
.gallery-track .example-card { flex: 0 0 min(340px, 82vw); scroll-snap-align: start; }
/* Compact first screen on phones: the couple-anime card must be visible and
   swipeable without a long scroll at 390x844, 360x800 and 360x740. */
@media (max-width: 560px) {
  .hero { padding: 14px 14px 0; }
  .hero h1 { font-size: 1.35rem; margin-bottom: .35rem; }
  .lede { font-size: .9rem; line-height: 1.45; margin-bottom: 6px; }
  .hero-ctas { margin-top: 8px; gap: 8px; }
  .hero-ctas .btn-lg { padding: 9px 16px; font-size: .95rem; }
  .examples { margin-top: 10px; }
  .examples h2 { font-size: 1.15rem; }
  .gallery { margin-top: 6px; }
  .gallery-track .example-card { flex-basis: min(320px, 86vw); }
  .example-card h3 { margin-bottom: 6px; font-size: .95rem; }
}
.gallery-arrow {
  position: absolute; top: 38%; z-index: 2; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow);
}
.gallery-arrow:hover { border-color: var(--accent-2); }
.gallery-arrow:disabled { opacity: .35; cursor: default; }
.gallery-prev { left: -8px; }
.gallery-next { right: -8px; }
@media (max-width: 700px) { .gallery-arrow { display: none; } }
.example-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.example-card img { border-radius: 10px; border: 1px solid var(--line); }
.example-prompt {
  margin: 0 0 12px; padding: 10px 14px; font-size: .85rem; color: var(--ink);
  background: var(--panel-2); border-left: 3px solid var(--accent-2); border-radius: 8px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* Hero CTAs */
.hero-ctas { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* Sign-in panel */
.header-inner { position: relative; }
.signin-panel {
  position: absolute; right: 20px; top: 58px; z-index: 30; width: min(320px, calc(100vw - 40px));
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px;
}
.signin-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.signin-email input {
  width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 9px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
}
.signin-email input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.otp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.otp-back { padding: 4px 0; font-size: .82rem; }
#otp-status { margin: 4px 0 0; font-size: .82rem; }

/* How it works — three steps */
.how { margin-top: 40px; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow);
}
.steps strong { display: block; margin-bottom: 2px; }
.steps .hint { margin: 0; }
.step-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-grad); color: #fff; font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}

/* Capability / limits */
.limits { margin-top: 40px; }
.limits-grid { margin-top: 14px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.limit-card h3 { margin: 0 0 8px; font-size: 1rem; }
.limit-card ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: .92rem; }
.limit-card li { margin: 5px 0; }

/* FAQ */
.faq { margin: 40px auto 52px; }
.faq-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-top: 10px;
}
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item summary:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.faq-item p { margin: 8px 0 2px; color: var(--muted); font-size: .92rem; }
/* Expandable billing details on /pricing/ */
.billing-details { margin-top: 14px; }
.billing-details summary { cursor: pointer; font-weight: 600; }
.billing-details summary:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.billing-details ul { margin: 10px 0 4px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #1b1826; padding: 26px 0; }
.footer-inner nav { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-inner a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.footer-inner a:hover { color: var(--accent-text); }

/* Static pages */
.page-body { max-width: 760px; margin: 0 auto; padding: 36px 20px 56px; }
.page-body h1 { margin-bottom: 14px; }
.page-body h2 { margin-top: 26px; font-size: 1.1rem; }
.page-body p, .page-body li { color: #c2bcd9; }
.page-body ul { padding-left: 22px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--accent-text); text-decoration: none; font-size: .9rem; }
.back-link:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .history-item { grid-template-columns: 56px 1fr; }
  .history-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .header-inner { flex-wrap: wrap; padding: 8px 20px; }
  .header-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 420px) {
  .wrap { padding: 0 14px; }
  .panel { padding: 16px; }
  .hero { padding: 12px 14px 0; }
  .result-stage { min-height: 200px; padding: 12px; }
  .result-actions .btn { flex: 1; justify-content: center; }
}

/* Pricing */
.price-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 20px 0 10px; }
.price-card h2 { margin: 0; font-size: 1.05rem; }
.price { font-size: 2rem; font-weight: 800; margin: 8px 0 0; }
.price-sub { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.price-card ul { margin: 0 0 16px; padding-left: 20px; color: var(--muted); font-size: .92rem; }
.price-card li { margin: 5px 0; }
.price-card .btn { width: 100%; justify-content: center; }
.free-note { padding: 16px 18px; margin: 18px 0 6px; }
.free-note h2 { margin-top: 0; }
.free-note .btn { margin-top: 6px; }
.tier-options { border: 0; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.tier-options legend { font-size: .78rem; color: var(--muted); padding: 0; margin-bottom: 4px; }
.tier { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: #c2bcd9; cursor: pointer; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.tier:has(input:checked) { border-color: var(--accent-2); color: var(--ink); background: var(--panel-2); }
.tier input { accent-color: var(--accent-2); }

/* Quick-facts block: a short standalone summary panel (also quotable by AI answers). */
.facts { padding: 14px 18px; margin: 14px 0; }
.facts h2 { font-size: .95rem; margin: 0 0 8px; }
.facts ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: .92rem; }
.facts li { margin: 4px 0; }
.facts li strong { color: var(--ink); font-weight: 600; }

/* Pricing page: four cards in one row on wide screens for side-by-side
   comparison, two columns on medium, one on small. Free note stays single. */
.pricing-body { max-width: 1240px; }
.pricing-body .price-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .pricing-body .price-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .pricing-body .price-grid { grid-template-columns: 1fr; } }

/* Example card */
.example-prompt-label { font-size: .82rem; color: var(--muted); margin: 12px 0 4px; }
.example-prompt {
  margin: 0 0 12px; padding: 10px 14px; font-size: .85rem; color: var(--ink);
  background: var(--panel-2); border-left: 3px solid var(--accent-2); border-radius: 8px;
}
/* Collapsed by default; full prompt stays in the DOM for crawl and refill. */
.example-details { margin-top: 10px; }
.example-details summary {
  cursor: pointer; font-size: .85rem; color: var(--accent-text);
  list-style: none; user-select: none;
}
.example-details summary::before { content: '▸ '; }
.example-details[open] summary::before { content: '▾ '; }
.example-details summary:hover { text-decoration: underline; }
.example-link { margin: 8px 0 0; font-size: .85rem; }
.example-link a { color: var(--accent-text); text-decoration: none; }
.example-link a:hover { text-decoration: underline; }
.example-card .example-use-btn { margin-top: 12px; width: 100%; justify-content: center; }

/* Landing page: /couple-photo-to-anime/ */
.landing-body .lede { max-width: 640px; }
.landing-pair { max-width: 640px; margin-top: 14px; }
.landing-cta-row { margin: 16px 0 6px; }
.landing-details { max-width: 640px; }
.lp-pick-panel { margin-top: 18px; max-width: 640px; }
.lp-preview { margin: 0 0 8px; }
.lp-preview img { width: auto; height: auto; object-fit: contain; max-width: 100%; max-height: 320px; border-radius: 10px; border: 1px solid var(--line); }
.lp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 560px) {
  .landing-body h1 { font-size: 1.45rem; }
  .landing-cta-row .btn-lg { width: 100%; justify-content: center; padding: 10px 16px; font-size: .95rem; }
}
.example-card h3 { margin: 0 0 10px; font-size: 1.02rem; }
.example-original { margin: 0 0 12px; font-size: .78rem; }
.examples-stats { margin-top: 6px; }

/* Quick styles — one-click generation when the editor is ready */
.style-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.style-quick-label { font-size: .82rem; color: var(--muted); }
.style-btn { font-size: .85rem; }
.style-btn-armed {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
}

/* Credits CTA + popover — visible next step when the balance is exhausted */
.credits-cta-row { margin: 8px 0 0; }
.credits-popover {
  margin-top: 10px; max-width: 420px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.credits-popover p { margin: 0 0 4px; font-size: .92rem; }
@media (max-width: 560px) {
  .credits-popover { max-width: 100%; }
  .credits-cta-row .btn { width: 100%; justify-content: center; }
}

/* Prompt library — categorized editable starting templates */
.tpl-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 6px; padding: 0; list-style: none; }
.tpl-nav a {
  display: inline-block; padding: 10px 16px; border: 1px solid var(--accent-line);
  border-radius: 999px; background: var(--accent-soft); font-size: .88rem;
  color: var(--accent-text); text-decoration: none;
}
.tpl-nav a:visited { color: var(--accent-text); }
.tpl-nav a:hover { color: var(--ink); border-color: var(--accent-2); }
.tpl-nav a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Prompt assist — optional one-click optimizer */
.assist-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 2px; }
.assist-panel { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--radius); padding: 14px; margin-top: 10px; }
.assist-panel .panel-title { margin-top: 0; }
.assist-panel textarea { margin-top: 4px; }
.assist-panel .lp-actions { margin-top: 10px; }
#assist-draft-note:empty { display: none; }
.tpl-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 14px; }
.tpl-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tpl-card h3 { margin: 0 0 6px; font-size: 1rem; }
.tpl-photo { margin: 0 0 8px; font-size: .85rem; color: var(--muted); }
.tpl-category { margin-top: 34px; }
@media (max-width: 560px) {
  .tpl-grid { grid-template-columns: 1fr; }
}

/* Prompt library card meta + deep links */
.tpl-meta { margin: 0 0 6px; font-size: .82rem; color: var(--muted); }
.tpl-anchor { color: var(--muted); text-decoration: none; font-weight: 400; padding: 0 2px; }
.tpl-anchor:hover { color: var(--accent-2); }
.tpl-anchor:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.tpl-card { scroll-margin-top: 16px; }
.tpl-flash { animation: tpl-flash 1.6s ease-out; }
@keyframes tpl-flash {
  0% { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
  100% { border-color: var(--line); box-shadow: var(--shadow); }
}
@media (prefers-reduced-motion: reduce) { .tpl-flash { animation: none; border-color: var(--accent-2); } }

/* In-page section navigation on landing pages */
.page-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 6px; }
.page-nav a {
  display: inline-block; padding: 10px 16px; border: 1px solid var(--accent-line);
  border-radius: 999px; background: var(--accent-soft); font-size: .88rem;
  color: var(--accent-text); text-decoration: none;
}
.page-nav a:visited { color: var(--accent-text); }
.page-nav a:hover { color: var(--ink); border-color: var(--accent-2); }
.page-nav a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.approach-list li { margin-bottom: 10px; }

/* Per-card feedback + link fallback field */
.tpl-card-status { display: block; margin-top: 8px; }
.tpl-card-status:empty { display: none; }
.tpl-link-field {
  width: 100%; margin-top: 8px; padding: 8px 10px; font-size: .82rem;
  border: 1px solid var(--accent-line); border-radius: 8px;
  background: var(--panel); color: var(--ink);
}

/* Directory badge in the homepage footer */
.footer-badge { margin: 12px 0 0; }
.footer-badge img { display: inline-block; width: 200px; height: 54px; max-width: 100%; }

/* Related-tools nav: compact cross-links between the topic pages. */
.related-tools { padding: 14px 18px; margin: 18px 0 0; }
.related-tools h2 { font-size: .95rem; margin: 0 0 8px; }
.related-tools ul { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .92rem; }
.related-tools li { margin: 4px 0; }
