:root {
  --bg: #f4f1ec;
  --bg-2: #ebe6df;
  --panel: #ffffff;
  --line: #d4cdc3;
  --line-strong: #b8aea2;
  --text: #1c1916;
  --muted: #5c554e;
  --accent: #c81e4a;
  --accent-2: #9a3412;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --radius: 12px;
  --motion: 180ms ease;
  --shadow: 0 1px 2px rgba(28, 25, 22, 0.06), 0 8px 24px rgba(28, 25, 22, 0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.4;
}
.hidden { display: none !important; }
a { color: var(--accent); }
.noise { display: none; }

/* Age gate — light */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.age-gate.hidden {
  display: none !important;
  pointer-events: none !important;
}
.age-card {
  width: min(420px, 100%);
  padding: 28px 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.brand-mark {
  margin: 0 0 6px;
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.9rem;
}
.age-card h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.03em;
  line-height: 0.95;
  color: var(--text);
}
.lede { color: var(--muted); margin: 0 0 18px; }
.age-actions { display: grid; gap: 8px; }
.fine { margin: 14px 0 0; font-size: 0.8rem; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--motion), border-color var(--motion);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover:not(:disabled) { background: #a8183d; }
.btn.ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--text); }
.btn.big { width: 100%; min-height: 48px; }

/* One-screen app shell */
.app.screen {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 14px 12px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  font-size: 1.25rem;
  color: var(--text);
}
.brand-tag {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.top-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.top-meta a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.top-meta a:hover { color: var(--accent); }
.badge, .quota {
  font-size: 0.72rem;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
}
.badge.on { color: var(--ok); border-color: #86efac; background: #f0fdf4; }
.badge.off { color: var(--warn); border-color: #fcd34d; background: #fffbeb; }

.consent-line {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #f0c4ce;
  background: #fff5f7;
  color: #6b3040;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.studio-intro {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: end;
  flex-shrink: 0;
  margin-bottom: 4px;
}
.studio-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.studio-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--text);
}
.studio-lede {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.studio-steps {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 10px;
}
.studio-steps li {
  display: grid;
  gap: 2px;
}
.studio-steps strong {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  color: var(--text);
}
.studio-steps span {
  color: var(--muted);
  font-size: 0.78rem;
}
.panel-hint {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
@media (max-width: 900px) {
  .studio-intro { grid-template-columns: 1fr; }
}

/* Seed → body → result strip */
.demo-strip {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-shrink: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.demo-strip figure {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.demo-strip img {
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 160px;
  object-fit: contain;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f0ebe4;
  cursor: zoom-in;
}
.demo-strip figcaption {
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.demo-strip .arrow {
  align-self: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
}
.demo-strip {
  position: relative;
  flex-wrap: wrap;
  justify-content: center;
}
.demo-nav {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink, #1c1916);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  align-self: center;
  flex-shrink: 0;
}
.demo-dots {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}
.demo-dots button {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: var(--line-strong);
  cursor: pointer;
}
.demo-dots button.active { background: var(--accent); }

.studio-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}
.panel h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  font-size: 1.45rem;
  color: var(--text);
}
.panel h2 .soft {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 6px;
}

.drop {
  position: relative;
  display: block;
  border: 2px dashed var(--line-strong);
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  background: #faf8f5;
  margin-bottom: 8px;
  transition: border-color var(--motion), background var(--motion);
  overflow: hidden;
}
.drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
  z-index: 2;
}
.drop:hover, .drop.drag {
  border-color: var(--accent);
  background: #fff5f7;
}
.drop strong { display: block; font-size: 0.9rem; position: relative; z-index: 1; }
.drop span { color: var(--muted); font-size: 0.78rem; position: relative; z-index: 1; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
  max-height: 110px;
  overflow: auto;
}
.thumb-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.tpl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.tpl-toolbar select {
  flex: 1;
  min-width: 120px;
  min-height: 36px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}
.btn.ghost.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.8rem;
}
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}
.tpl-card {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
}
.tpl-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
}
.tpl-card .tpl-meta {
  display: block;
  padding: 4px 6px 6px;
  font-size: 0.65rem;
  line-height: 1.25;
  color: var(--muted);
  background: #fff;
}
.tpl-card.selected {
  border-color: var(--accent, #c45c26);
  box-shadow: 0 0 0 1px var(--accent, #c45c26);
}
.tpl-card.selected::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent, #c45c26);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.status.soft-status { font-size: 0.8rem; color: var(--muted); }

.inline-input, .controls select, .field input, .field select {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  margin-bottom: 8px;
}
.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.controls select { margin: 0; flex: 1; }
.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.check.tight { margin: 0; align-items: center; white-space: nowrap; }
.check.consent { color: var(--text); font-weight: 500; }
.check input { margin-top: 2px; }

.profile-card {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #86efac;
  background: #f0fdf4;
}
.profile-card img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.profile-card strong { display: block; font-size: 0.85rem; }
.profile-card span { color: var(--muted); font-size: 0.75rem; }

.status { min-height: 1.1em; font-size: 0.78rem; color: var(--muted); margin: 6px 0 0; }
.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.meta { color: var(--muted); font-size: 0.75rem; }
.progress {
  height: 5px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
  margin: 8px 0;
}
.progress .bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  flex: 1;
  min-height: 180px;
  align-content: start;
  overflow: auto;
}
.results-grid a {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  aspect-ratio: 3/4;
  background: #f0ebe4;
}
.results-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  display: block;
}
.results-grid img.broken {
  opacity: 0.35;
  filter: grayscale(0.4);
}
.empty { color: var(--muted); font-size: 0.85rem; margin: 0; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 25, 22, 0.85);
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox img {
  max-width: min(960px, 100%);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}
.lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Legacy / landing pages sharing this sheet */
.hero, .examples, .how, .policy-strip, .foot { display: none; }
.pack-section, .land-hero, .pay-card { color: var(--text); }
.land-hero h1, .pack-section h2, .pay-card h1 {
  font-family: var(--font-display);
  color: var(--text);
}

@media (max-height: 820px) {
  .demo-strip img { max-height: 120px; }
  .drop { padding: 12px 10px; }
  .panel h2 { font-size: 1.25rem; }
}

@media (max-width: 900px) {
  .app.screen { min-height: auto; height: auto; }
  .studio-grid { grid-template-columns: 1fr; }
  .demo-strip img { max-height: 100px; }
}
