/* PhotoAnim — photoanim.net shared stylesheet
   Mobile-first, zero horizontal overflow at 375px+. */
:root {
  --bg: #ffffff;
  --soft: #f8fafc;
  --soft-2: #f1f5f9;
  --fg: #0f172a;
  --fg-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --ok-border: #a7f3d0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --err-border: #fecaca;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --max: 1080px;
  --prose: 780px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  overflow-x: clip;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.wrap-prose { max-width: var(--prose); margin: 0 auto; padding: 0 20px; }

/* Header */
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}
.header-in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
nav.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  font-size: 14px;
  font-weight: 500;
}
nav.main-nav a { color: var(--fg-2); padding: 4px 0; }
nav.main-nav a:hover, nav.main-nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }
nav.main-nav a[aria-current="page"] { font-weight: 700; }

/* Trust bar */
.trustbar {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--fg-2);
  padding: 8px 20px;
  text-align: center;
}
.trustbar strong { color: var(--fg); font-weight: 600; }

/* Typography */
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.18; letter-spacing: -0.025em; margin: 0 0 12px; color: var(--fg); }
h2 { font-size: clamp(21px, 2.8vw, 27px); line-height: 1.25; letter-spacing: -0.015em; margin: 36px 0 12px; color: var(--fg); }
h3 { font-size: 18px; line-height: 1.35; margin: 22px 0 8px; color: var(--fg); }
p { margin: 0 0 14px; color: var(--fg-2); }
.lead { font-size: 17px; color: var(--fg-2); max-width: 68ch; }
.small { font-size: 13px; color: var(--muted); }
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--soft); border-color: var(--muted); color: var(--fg); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent-border);
}
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-full { width: 100%; }

/* Hero + Tool Shell */
.hero-tool {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  padding: 28px 0 36px;
}
.hero-head { margin-bottom: 20px; }
.hero-head h1 { margin-bottom: 8px; }
.hero-head .lead { margin-bottom: 0; }

/* Quota & Credit Bar */
.quota-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}
.quota-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--soft-2);
  color: var(--fg-2);
  border: 1px solid var(--line);
}
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.quota-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.restore-panel {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.restore-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.restore-row input[type="text"],
.restore-row input[type="email"] {
  flex: 1 1 200px;
  min-width: 0;
}

/* Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: start;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.panel-title { font-size: 15px; font-weight: 700; color: var(--fg); margin: 0; }

/* Mode Switch (Single vs Batch 10) */
.mode-switch {
  display: inline-flex;
  background: var(--soft-2);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  gap: 2px;
}
.mode-btn {
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.mode-btn.active { background: #fff; color: var(--fg); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.dropzone-title { font-weight: 700; color: var(--fg); margin-bottom: 4px; font-size: 15px; }
.dropzone-sub { font-size: 13px; color: var(--muted); margin: 0; }

.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.preview-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--soft);
  aspect-ratio: 1 / 1;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.preview-single {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--soft);
  position: relative;
  max-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-single img { max-height: 260px; width: auto; object-fit: contain; display: block; }

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

/* Format Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.tab {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--fg-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tab:hover { border-color: var(--line-strong); color: var(--fg); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab .lock-tag {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}
.tab.active .lock-tag { background: rgba(255, 255, 255, 0.22); }

/* Output Box */
.output-box {
  position: relative;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  min-height: 185px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
}
.output-placeholder {
  font-family: inherit;
  color: var(--muted);
  font-size: 14px;
}
.output-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.output-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Paywall Banner */
.paywall-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-border);
  background: linear-gradient(180deg, var(--accent-soft) 0%, #ffffff 100%);
}
.paywall-box h3 { margin: 0 0 6px; font-size: 16px; }
.paywall-box p { font-size: 14px; margin: 0 0 12px; }
.paywall-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.paywall-plan {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-width: 0;
}
.paywall-plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.paywall-price { font-size: 20px; font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums; }
.paywall-price span { font-size: 13px; font-weight: 500; color: var(--muted); }

/* Form inputs */
label.field { display: block; font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 12px; }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
label.field input, label.field select, label.field textarea { margin-top: 5px; font-weight: 400; }

/* Status & Alerts */
.msg {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--fg-2);
}
.msg-ok { background: var(--ok-soft); border-color: var(--ok-border); color: #065f46; }
.msg-warn { background: var(--warn-soft); border-color: var(--warn-border); color: #92400e; }
.msg-err { background: var(--err-soft); border-color: var(--err-border); color: #991b1b; }

/* History Drawer */
.history-section { margin-top: 18px; }
.history-list { display: grid; gap: 10px; margin-top: 10px; }
.history-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.history-prompt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--fg);
  margin: 0;
  word-break: break-word;
}

/* Sections & Cards */
.sec { padding: 40px 0; border-bottom: 1px solid var(--line); }
.sec-soft { background: var(--soft); }
.sec h2:first-child { margin-top: 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
.card h3 { margin-top: 0; }
.card-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
  position: relative;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.code-sample {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--fg);
  word-break: break-word;
  margin: 8px 0 0;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 16px 0;
  background: #fff;
}
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: var(--soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }

/* Pricing */
.price-amount { font-size: 32px; font-weight: 800; color: var(--fg); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 8px 0 4px; }
.price-unit { font-size: 14px; font-weight: 500; color: var(--muted); }
.feat-list { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; font-size: 14px; color: var(--fg-2); }
.feat-list li { padding-left: 20px; position: relative; }
.feat-list li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.feat-list li.no { color: var(--muted); }
.feat-list li.no::before { content: "—"; color: var(--muted); }

/* FAQ */
.faq { display: grid; gap: 10px; margin: 16px 0; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 16px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--fg);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 18px; color: var(--muted); flex-shrink: 0; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 2px; font-size: 14.5px; }

/* Legal & Prose */
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; color: var(--fg-2); }
.prose li { margin-bottom: 8px; }
.notice-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--soft);
  margin: 16px 0;
  font-size: 14px;
}

/* Credit Code Box (Payment Success) */
.code-reveal {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  background: var(--soft);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-sm);
  text-align: center;
  word-break: break-all;
  margin: 14px 0;
  color: var(--fg);
}

/* Footer */
footer.site {
  background: var(--soft);
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
  font-size: 14px;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.footer-links { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.footer-links a { color: var(--fg-2); font-size: 14px; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 13px;
}

/* Branded 404 */
.not-found {
  text-align: center;
  padding: 64px 20px;
  max-width: 580px;
  margin: 0 auto;
}
.not-found-code {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 860px) {
  .tool-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .wrap, .wrap-prose, .header-in { padding-left: 14px; padding-right: 14px; }
  .grid-2, .grid-4, .paywall-plans, .footer-grid { grid-template-columns: 1fr; }
  .hero-tool { padding: 20px 0 28px; }
  .panel { padding: 14px; }
  .btn { white-space: normal; text-align: center; }
  .quota-bar { flex-direction: column; align-items: stretch; }
  .quota-actions { justify-content: flex-start; }
  nav.main-nav { gap: 6px 12px; font-size: 13.5px; }
}
