/* Late Nook Studio — PetalHush Studio design system (tokens, components) 1:1, colours swapped to Late Nook
   (brand/design-system/tokens.json: linen light + night dark; claret is the one accent; lamp only for the focus ring). */
:root {
  --bg: #f6f2ec;          /* surface-000 linen */
  --surface: #fffdfb;     /* surface-100 */
  --surface-2: #efe6df;   /* surface-200 */
  --border: #e3d7d3;      /* line */
  --line: #e3d7d3;
  --text: #241a1d;        /* ink */
  --muted: #6f5f63;       /* ink-muted */
  --accent: #6e1f2e;      /* claret */
  --accent-hover: #4e1521;/* claret-deep */
  --accent-ink: #f6f2ec;  /* on-claret */
  --accent-soft: #f3e6e8;
  --lamp: #e6c186;        /* focus ring only */
  --danger: #a1262b;
  --danger-soft: #f8e5e5;
  --ok: #2f6b4a;
  --ok-soft: #e4efe8;
  --info: #3c5a7d;
  --info-soft: #e7edf4;
  --warn: #9a5b00;
  --warn-soft: #f8ecd9;
  --shadow: 0 1px 2px rgba(36, 26, 29, 0.05), 0 4px 16px rgba(36, 26, 29, 0.05);
  --radius: 12px;
  --display: 'Fraunces', 'Bodoni 72', Didot, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171114;
    --surface: #211a1d;
    --surface-2: #2b2226;
    --border: #3c2e31;
    --line: #3c2e31;
    --text: #f2e9ea;
    --muted: #ad9a9e;
    --accent: #e58f9c;
    --accent-hover: #f2b3bc;
    --accent-ink: #171114;
    --accent-soft: #3a2328;
    --danger: #f08a8d;
    --danger-soft: #3b1f21;
    --ok: #7fcf9f;
    --ok-soft: #1b3326;
    --info: #9db8dc;
    --info-soft: #1d2735;
    --warn: #e9b55c;
    --warn-soft: #3a2c15;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-family: var(--display); font-size: 26px; font-weight: 500; letter-spacing: -0.005em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
img { display: block; max-width: 100%; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px var(--lamp); } /* ring ≥ 3:1 on linen (claret), lamp only as halo */

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; font-weight: 600; }
.brand:hover { text-decoration: none; }
.wordmark { display: inline-block; width: 104px; height: 27px; background: var(--accent); -webkit-mask: url(/brand/ln-wordmark.svg) center / contain no-repeat; mask: url(/brand/ln-wordmark.svg) center / contain no-repeat; }
.brand .studio { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; color: var(--muted); }
main { max-width: 1440px; margin: 0 auto; padding: 24px; }
.mode-banner { text-align: center; font-size: 12px; font-weight: 600; padding: 5px 12px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--border); }
.mode-banner.live { background: var(--danger-soft); color: var(--danger); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; font-weight: 600; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; }
.btn .cost { font-weight: 400; opacity: 0.9; }
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13px; }
label.field > .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'], input[type='url'], select, textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--lamp); }
input[type='checkbox'], input[type='radio'] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-sub { margin: 4px 0 0; color: var(--muted); }
.error-box { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 9px; }
.info-box { background: var(--info-soft); color: var(--info); padding: 10px 14px; border-radius: 9px; font-size: 13px; }
.warn-box { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 9px; font-size: 13px; }
.ok-box { background: var(--ok-soft); color: var(--ok); padding: 10px 14px; border-radius: 9px; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.gray { background: var(--surface-2); color: var(--muted); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.claret { background: var(--accent-soft); color: var(--accent); }
.eyebrow { font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- product cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.idea-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: inherit; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform 0.12s; }
.idea-card:hover { transform: translateY(-2px); text-decoration: none; }
.idea-card .thumb { aspect-ratio: 4 / 5; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); position: relative; }
.idea-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.idea-card .thumb .badge { position: absolute; top: 10px; left: 10px; }
.idea-card .thumb .pending { position: absolute; bottom: 10px; right: 10px; background: rgba(23, 17, 20, 0.7); color: #f6f2ec; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.idea-card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.idea-card .title { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- B1 intake ---------- */
.intake { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px 18px; text-align: center; color: var(--muted); cursor: pointer; transition: 0.15s; background: var(--surface); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone strong { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumbs figure { margin: 0; position: relative; aspect-ratio: 4 / 5; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(23, 17, 20, 0.7); color: #f6f2ec; cursor: pointer; font-size: 13px; line-height: 24px; padding: 0; }
.thumbs .tag { position: absolute; left: 4px; bottom: 4px; }
.back-slot { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px dashed var(--border); border-radius: 10px; }
.back-slot figure { margin: 0; width: 64px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--surface-2); flex: none; }
.back-slot img { width: 100%; height: 100%; object-fit: cover; }

/* model photo cards (radiogroup) */
.mcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mcards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 480px; }
.mcard { position: relative; display: flex; flex-direction: column; gap: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; overflow: hidden; text-align: left; font: inherit; }
.mcard:hover { border-color: var(--accent); }
.mcard[aria-checked='true'] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mcard:disabled { opacity: 0.5; cursor: not-allowed; }
.mcard .ph { aspect-ratio: 4 / 5; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.mcard .ph img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mcard .ph .auto { font-family: var(--display); font-style: italic; font-size: 26px; color: var(--accent); }
.mcard .t { padding: 7px 10px; display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.mcard .check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.costline { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.costline .big { font-size: 22px; font-weight: 600; }

/* ---------- project page ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.steps li { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface); font-size: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.steps li b { font-size: 13px; font-weight: 600; }
.steps li.done { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.steps li.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.steps li.err { border-color: var(--danger); }
.preview { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.pv-img { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; cursor: zoom-in; }
.pv-img img { width: 100%; height: 100%; object-fit: cover; }
.pv-img .croquis { position: absolute; left: 8px; bottom: 8px; width: 64px; aspect-ratio: 3 / 4; border-radius: 8px; background: #fffdfb; border: 1px solid var(--border); padding: 2px; }
.pv-img .croquis img { object-fit: contain; }
.pv-img .mockbadge { position: absolute; right: 8px; top: 8px; }
.waiting { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
.gallery6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.tile .img { aspect-ratio: 4 / 5; background: var(--surface-2); position: relative; cursor: zoom-in; display: grid; place-items: center; }
.tile .img img { width: 100%; height: 100%; object-fit: cover; }
.tile .img .badge { position: absolute; top: 6px; left: 6px; }
.tile .img .order { position: absolute; top: 6px; right: 6px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 11px; font-weight: 700; padding: 0 6px; }
.tile .bar { display: flex; align-items: center; gap: 4px; padding: 6px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.tile .bar .btn { height: 26px; padding: 0 8px; font-size: 12px; }
.tile .note { padding: 6px 8px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }
.tile .fail { padding: 8px; font-size: 11px; color: var(--danger); text-align: center; }
.seeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.seed { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.seed.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.seed img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; cursor: zoom-in; }
.seed .meta { padding: 6px 8px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 500; }
.chip.locked { background: var(--surface-2); color: var(--muted); }
.preview-html { border: 1px solid var(--border); border-radius: 9px; padding: 4px 14px; background: var(--bg); max-height: 380px; overflow: auto; font-size: 13px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; font-size: 13px; }
.checklist li.ok::before { content: '✓ '; color: var(--ok); font-weight: 700; }
.checklist li.no::before { content: '○ '; color: var(--muted); }
.checklist li.no.create { color: var(--danger); }
.linkrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 9px; font-size: 13px; }
.linkrow a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.split > .panel, .intake > .panel, .split > * + .panel { margin-top: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
details.adv > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.adv[open] > summary { margin-bottom: 10px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
td .thumb-sm { width: 48px; height: 60px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.quota-line { display: flex; align-items: center; gap: 6px; }
.quota-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; min-width: 60px; }
.quota-bar > span { display: block; height: 100%; border-radius: 4px; }
.progress { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--line); }
.progress .seg.ok { background: var(--ok); }
.progress .seg.run { background: var(--accent); opacity: 0.6; }

/* batch builder rows */
.brow { display: grid; grid-template-columns: 32px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.brow .num { font-weight: 700; color: var(--muted); padding-top: 8px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { justify-content: center; margin-bottom: 18px; flex-direction: column; gap: 6px; }
.auth-card .wordmark { width: 168px; height: 43px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(23, 17, 20, 0.55); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.modal.wide { max-width: 860px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.lightbox img { max-height: calc(100vh - 220px); margin: 0 auto; border-radius: 8px; }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-size: 13px; animation: pop 0.18s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .toast.err, .toast.ok { color: #171114; } }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
pre.brief { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 9px; font-size: 12px; max-height: 50vh; overflow: auto; }
.new-version { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 200; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); display: flex; gap: 10px; align-items: center; }
.lang-btn { font-weight: 700; letter-spacing: 0.5px; }

/* grouped navigation (PetalHush) */
.nav-group { position: relative; display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.nav-group.active, .nav-group:hover, .nav-group.open { color: var(--accent); background: var(--accent-soft); }
.nav-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); z-index: 50; }
@media (hover: hover) { .nav-group:hover .nav-menu { display: flex; flex-direction: column; } }
.nav-group.open .nav-menu { display: flex; flex-direction: column; }
.nav-group .nav-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-menu a { padding: 8px 10px; border-radius: 6px; color: var(--text); }
.nav-menu a.active, .nav-menu a:hover { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 1100px) { .gallery6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .intake, .split { grid-template-columns: 1fr; }
  .preview { grid-template-columns: minmax(0, 1fr); }
  .preview .pv-img { max-width: 360px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brow { grid-template-columns: 28px 1fr 1fr; }
  .brow > .wide { grid-column: 2 / -1; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  main { padding: 16px; }
  h1 { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .userbox .who { display: none; }
  .mcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview .pv-img { max-width: none; }
  .brow { grid-template-columns: 24px 1fr; }
  .brow > * { grid-column: 2; }
  .brow .num { grid-column: 1; grid-row: 1; }
  .modal-foot .btn { flex: 1; }
  .preview .btn { white-space: normal; height: auto; min-height: 36px; text-align: center; padding-top: 6px; padding-bottom: 6px; }
  #toasts { left: 16px; right: 16px; }
}
/* ---------- Creative Hub (LN-S19) ---------- */
.push-panel h2 { font-size: 16px; }
.push-panel + .tabs, .push-panel + div { margin-top: 16px; }
.cr-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.cand { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.cand img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--surface-2); }
.cand.front { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.cand.back { border-color: var(--info); box-shadow: 0 0 0 2px var(--info); }
.cand-bar { display: flex; gap: 4px; padding: 6px; flex-wrap: wrap; }
.cand-bar .btn { flex: 1; padding: 0 6px; }
.btn[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.pose-grid.lib { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.pose-card { position: relative; display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; overflow: hidden; text-align: left; font: inherit; min-width: 0; }
.pose-card.static { cursor: default; }
.pose-card:not(.static):hover { border-color: var(--accent); }
.pose-card[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.pose-card.off { opacity: 0.6; }
.pose-card .ph { aspect-ratio: 3 / 4; background: #fffdfb; display: grid; place-items: center; overflow: hidden; }
.pose-card .ph img { width: 100%; height: 100%; object-fit: contain; }
.pose-card .t { padding: 7px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.pose-card .lbl { font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.pose-card .check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.pose-card .acts { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 8px 8px; }
.cr-prod { margin: 0; display: flex; flex-direction: column; gap: 4px; width: 96px; }
.cr-prod img { width: 96px; height: 120px; object-fit: cover; border-radius: 8px; }
.cr-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cr-results .tile .img { overflow: hidden; }
.cr-results .pose-ghost { width: 100%; height: 100%; object-fit: contain; opacity: 0.35; background: #fffdfb; }
.cr-results .overlay-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 10px; }
@media (max-width: 640px) {
  .cr-cands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pose-grid, .pose-grid.lib { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pose-card .t { padding: 6px; font-size: 12px; }
  .cr-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .push-panel .btn.lg { width: 100%; }
  .push-panel > .row > .stack { align-items: stretch !important; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .idea-card:hover { transform: none; }
}
.stack > .panel + .panel { margin-top: 0; }
::placeholder { color: var(--muted); opacity: 0.8; }
.imgbtn { display: block; border: 0; padding: 0; margin: 0; width: 100%; background: var(--surface-2); color: inherit; font: inherit; cursor: zoom-in; text-align: inherit; }
.seed .imgbtn img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.pv-img.imgbtn, .tile .img.imgbtn { display: grid; place-items: center; }
