/* dzhura.app/build: prompt builder. Self-contained, relative paths only. */
:root,
[data-theme="dark"] {
  --ground: #07080A;
  --surface: #101319;
  --elev: #161A22;
  --line: #1C212A;
  --edge: #272D38;
  --text: #EEF2F6;
  --dim: #8C949F;
  --faint: #5A626D;
  --mark: #F5C542;
  --mark-ink: #F5C542;
  --glyph: #4A9EFF;
  --on-mark: #0B0C0E;
  --ph: #F5C542;
  --ph-bg: rgba(245, 197, 66, .14);
  --warn-bg: rgba(245, 197, 66, .08);
  --shadow: 0 18px 60px rgba(0, 0, 0, .55);
  --f-head: "Unbounded", "Manrope", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --ground: #F4F5F7;
  --surface: #FFFFFF;
  --elev: #F1F3F6;
  --line: #E3E6EB;
  --edge: #D2D7DF;
  --text: #0E1116;
  --dim: #545D6B;
  --faint: #7E8794;
  --mark: #F5C542;
  --mark-ink: #8A5F00;
  --glyph: #1F6FEB;
  --on-mark: #0E1116;
  --ph: #7A4F00;
  --ph-bg: rgba(245, 197, 66, .32);
  --warn-bg: rgba(245, 197, 66, .16);
  --shadow: 0 18px 60px rgba(15, 20, 30, .18);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lock { overflow: hidden; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 15px/1.5 var(--f-body);
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--glyph); outline-offset: 2px; }
[hidden] { display: none !important; }
code { font-family: var(--f-mono); font-size: .92em; background: var(--elev); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }

/* ---------- header ---------- */
.top {
  max-width: 1240px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font: 600 17px/1 var(--f-head); letter-spacing: -.01em; }
.brand svg { width: 28px; height: 28px; flex: none; }
.top-r { display: flex; align-items: center; gap: 12px; }
.lnk { color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14px; }
.lnk:hover { color: var(--text); }

/* ---------- segmented controls ---------- */
.seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--ground); border: 1px solid var(--edge); border-radius: 10px; }
.seg button { border: 0; background: transparent; color: var(--dim); font: 700 13px/1 var(--f-body); padding: 7px 12px; min-height: 32px; border-radius: 7px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--elev); color: var(--text); box-shadow: 0 0 0 1px var(--edge); }

/* ---------- layout ---------- */
.app { max-width: 1240px; margin: 0 auto; padding: 0 16px 40px; }
.intro { padding: 18px 0 6px; }
.intro h1 { font: 600 clamp(26px, 6.6vw, 46px)/1.08 var(--f-head); letter-spacing: -.02em; margin: 0 0 12px; max-width: 20ch; }
.lead { color: var(--dim); font-size: 16px; margin: 0; max-width: 62ch; }

.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 16px; }
.kind {
  text-align: left; padding: 12px; min-height: 64px;
  border: 1px solid var(--edge); border-radius: 14px; background: var(--surface); color: var(--text);
  transition: border-color .15s, background .15s;
}
.kind:hover { border-color: var(--faint); }
.kind b { display: block; font: 600 14px/1.2 var(--f-head); overflow-wrap: anywhere; }
.kind small { display: block; margin-top: 4px; color: var(--dim); font-size: 12px; line-height: 1.3; }
.kind[aria-pressed="true"] { border-color: var(--mark); background: color-mix(in srgb, var(--mark) 9%, var(--surface)); box-shadow: inset 0 0 0 1px var(--mark); }

.cols { display: grid; gap: 16px; }
.flow { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#steps-rest { display: flex; flex-direction: column; gap: 14px; }

/* ---------- steps ---------- */
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-width: 0; }
.step-h { display: flex; align-items: center; gap: 10px; }
.num { flex: none; font: 600 12px/1 var(--f-mono); color: var(--mark-ink); border: 1px solid color-mix(in srgb, var(--mark-ink) 45%, transparent); border-radius: 7px; padding: 5px 6px; }
.step h2 { font: 600 16px/1.25 var(--f-head); margin: 0; }
.hint { color: var(--dim); font-size: 13.5px; margin: 8px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 13px;
  border: 1px solid var(--edge); border-radius: 999px; background: var(--elev); color: var(--text);
  font: 600 14px/1.2 var(--f-body); text-align: left;
}
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--mark); border-color: var(--mark); color: var(--on-mark); }
.multi .chip[aria-pressed="true"]::before { content: "\2713"; font-weight: 800; }
.chip small { font-weight: 600; opacity: .6; font-size: 12px; }
.sw2 { width: 16px; height: 16px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(127, 127, 127, .35); }

.field { display: block; margin-top: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea, .gal-q {
  width: 100%; background: var(--ground); color: var(--text);
  border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; font-size: 16px; line-height: 1.4;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input::placeholder, .field textarea::placeholder, .gal-q::placeholder { color: var(--faint); }
.field input:focus-visible, .field textarea:focus-visible, .gal-q:focus-visible { outline-offset: 0; border-color: var(--glyph); }

/* ---------- gallery ---------- */
.gal-bar { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.gal-q { flex: 1; min-width: 0; min-height: 42px; }
.gal-bar .chip { flex: none; min-height: 42px; }
.cats {
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
  margin: 10px -16px 0; padding: 2px 16px 8px; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats .chip { flex: none; white-space: nowrap; }
.gal-count { color: var(--dim); font-size: 13px; margin: 2px 0 10px; }
.tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tcard {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 6px 6px 10px; text-align: left;
  background: var(--elev); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s, transform .15s;
}
.tcard:hover { border-color: var(--edge); transform: translateY(-1px); }
.tcard.on { border-color: var(--mark); box-shadow: 0 0 0 1px var(--mark); }
.badge {
  display: none; position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--mark); color: var(--on-mark); font: 800 11px/1 var(--f-body); padding: 5px 8px; border-radius: 999px;
}
.tcard.on .badge { display: block; }
.tn { display: block; padding: 0 4px; font-weight: 700; font-size: 14px; line-height: 1.25; }
.tc { display: block; padding: 0 4px; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--dim); padding: 28px 0; margin: 0; }
.more { width: 100%; margin-top: 12px; }

/* ---------- mini mocks (built from spans inside buttons) ---------- */
.mk-wrap {
  display: block; width: 100%; aspect-ratio: 4 / 3; container-type: inline-size;
  border-radius: 9px; overflow: hidden; background: var(--line);
}
.mk * { display: block; }
.mk {
  position: relative; display: flex; flex-direction: column; gap: 3.2cqw;
  width: 100%; height: 100%; padding: 4.5cqw 5.5cqw; overflow: hidden;
  background: var(--bg); color: var(--tx); font-family: var(--bf); text-align: left;
}
.mk-nav { position: relative; z-index: 1; flex: none; display: flex; align-items: center; justify-content: space-between; height: 5cqw; }
.mk-logo { width: 13cqw; height: 3.2cqw; border-radius: 1cqw; background: var(--tx); }
.mk-nl { display: flex; gap: 2.4cqw; }
.mk-nl i { width: 6.5cqw; height: 1.3cqw; border-radius: 1cqw; background: color-mix(in srgb, var(--tx) 42%, transparent); }
.mk-hero { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; gap: 4cqw; }
.mk-tx { display: flex; flex-direction: column; justify-content: center; gap: 2.2cqw; min-width: 0; }
.mk-h {
  font-family: var(--hf); font-weight: var(--hw); font-size: 6.2cqw; line-height: 1.06; letter-spacing: -.01em;
  color: var(--tx); overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.mk-h.giant { display: block; white-space: nowrap; line-height: .92; letter-spacing: -.02em; overflow: visible; -webkit-line-clamp: none; }
.mk-h.sm { display: block; font-size: 5.2cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-p { height: 1.5cqw; width: 72%; border-radius: 1cqw; background: color-mix(in srgb, var(--mu) 60%, transparent); flex: none; }
.mk-p.s { width: 50%; }
.mk-b {
  flex: none; align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 700 2.9cqw/1 var(--bf); padding: 1.8cqw 3.4cqw; margin-top: .6cqw;
  background: var(--ac); color: var(--on); border-radius: calc(var(--rr) * .3cqw);
}
.mk-b.bt-pill { border-radius: 99cqw; }
.mk-b.bt-square { border-radius: 0; }
.mk-b.bt-outline { background: transparent; color: var(--tx); box-shadow: inset 0 0 0 .4cqw var(--ac); }
.mk-b.bt-underline { background: transparent; color: var(--tx); padding: 1.2cqw 0; border-radius: 0; box-shadow: inset 0 -.5cqw 0 var(--ac); }
.mk-art { flex: 1; min-width: 0; min-height: 0; border-radius: calc(var(--rr) * .3cqw); }

/* split */
.l-split .mk-tx { flex: 1.15; }
/* centered */
.l-centered .mk-hero { flex-direction: column; align-items: center; gap: 3cqw; }
.l-centered .mk-tx { flex: 1; align-items: center; text-align: center; }
.l-centered .mk-h { font-size: 6.6cqw; }
.l-centered .mk-b { align-self: center; }
.l-centered .mk-art.band { flex: none; width: 100%; height: 13cqw; }
/* fullbleed */
.mk-art.bleed { position: absolute; inset: 0; border-radius: 0; }
.mk-scrim { position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--bg) 94%, transparent) 22%, color-mix(in srgb, var(--bg) 30%, transparent) 70%, transparent); }
.l-fullbleed .mk-hero { flex-direction: column; justify-content: flex-end; gap: 2.2cqw; }
.l-fullbleed .mk-h { font-size: 7cqw; -webkit-line-clamp: 2; max-width: 86%; }
/* editorial */
.l-editorial .mk-hero { flex-direction: column; justify-content: flex-end; gap: 2.6cqw; }
.mk-rule { flex: none; height: .45cqw; width: 100%; background: var(--tx); }
.mk-cols { display: grid; grid-template-columns: 1fr 1fr auto; gap: 3.5cqw; align-items: end; }
.mk-cols > span { display: flex; flex-direction: column; gap: 1.5cqw; min-width: 0; }
.mk-cols .mk-p { width: 100%; }
.mk-cols .mk-p.s { width: 70%; }
/* bento */
.l-bento .mk-hero { display: grid; grid-template-columns: 1.45fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2.2cqw; }
.mk-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 2cqw; min-height: 0; min-width: 0; overflow: hidden;
  padding: 3.2cqw; background: var(--sf); border-radius: calc(var(--rr) * .3cqw);
}
.mk-tile.big { grid-row: 1 / span 2; }
.l-bento .mk-art.t2 { grid-column: 2 / span 2; }
.mk-tile.t3 { justify-content: center; align-items: center; background: color-mix(in srgb, var(--ac2) 22%, var(--sf)); }
.mk-tile.t4 { justify-content: center; }
.mk-tile.t4 .mk-p { width: 100%; }
.l-bento .mk-h { font-size: 5.6cqw; -webkit-line-clamp: 4; }
.mk-num { font-family: var(--hf); font-weight: var(--hw); font-size: 7.4cqw; line-height: 1; color: var(--ac); }
/* magazine */
.mk-mast { flex: none; display: flex; justify-content: center; align-items: center; padding-bottom: 1.8cqw; border-bottom: .4cqw solid var(--tx); }
.l-magazine .mk-art { flex: 1; }
.l-magazine .mk-tx { flex: 1.1; justify-content: flex-end; }
.l-magazine .mk-tx .mk-h { font-size: 5cqw; -webkit-line-clamp: 4; }
.mk-kick { width: 14cqw; height: 1.8cqw; border-radius: .4cqw; background: var(--ac); flex: none; }
/* minimal */
.l-minimal .mk-hero { flex-direction: column; justify-content: center; gap: 2.8cqw; padding: 0 3cqw; }
.l-minimal .mk-h { font-size: 6.8cqw; max-width: 80%; }
.mk-line { flex: none; width: 11cqw; height: .55cqw; background: var(--ac); }
/* poster */
.l-poster { padding-bottom: 0; }
.l-poster .mk-hero { flex-direction: column; justify-content: center; gap: 3.4cqw; }
.mk-row { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; }
.mk-row .mk-p { flex: 1; width: auto; }
.mk-art.strip { flex: none; height: 12cqw; margin: 0 -5.5cqw; border-radius: 0; }
/* sidebar */
.l-sidebar { flex-direction: row; padding: 0; gap: 0; }
.mk-side { flex: none; width: 23cqw; display: flex; flex-direction: column; gap: 2.6cqw; padding: 4.5cqw 3.2cqw; background: var(--sf); }
.mk-side .mk-logo { width: 100%; margin-bottom: 2cqw; }
.mk-side i { height: 1.5cqw; border-radius: 1cqw; background: color-mix(in srgb, var(--tx) 32%, transparent); }
.mk-side i.on { background: var(--ac); width: 80%; }
.mk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2.2cqw; padding: 5cqw; }
.l-sidebar .mk-h { font-size: 5.8cqw; }
.mk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.2cqw; margin-top: 2cqw; }
.mk-cards span { aspect-ratio: 1 / 1; background: var(--sf); border-radius: calc(var(--rr) * .25cqw); border-top: .7cqw solid var(--ac); }
/* collage */
.l-collage .mk-art.c1 { position: absolute; left: 0; top: 0; width: 60%; height: 80%; }
.l-collage .mk-art.c2 { position: absolute; right: 0; bottom: 0; width: 46%; height: 60%; }
.mk-card.c3 {
  position: absolute; left: 7%; bottom: 3%; width: 58%; z-index: 1;
  display: flex; flex-direction: column; gap: 2cqw; padding: 3.2cqw;
  background: var(--bg); border-radius: calc(var(--rr) * .3cqw); box-shadow: 0 1.2cqw 4cqw rgba(0, 0, 0, .28);
}
.l-collage .mk-h { font-size: 4.8cqw; }

/* ---------- picked template ---------- */
.pick { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 12px; }
.pick-mk { border-radius: 10px; box-shadow: 0 0 0 1px var(--edge); }
.pick-tx { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pick-tx b { font-size: 15px; line-height: 1.25; }
.pick-sub { color: var(--dim); font-size: 13px; }
.pick-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.toks { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.sw { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(127, 127, 127, .4); }
.tok-f { font: 12px/1.3 var(--f-mono); color: var(--dim); margin-left: 2px; }

/* ---------- output ---------- */
.out { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-width: 0; scroll-margin-top: 12px; }
.out h2 { font: 600 16px/1.25 var(--f-head); margin: 0 0 4px; }
.ph-note { color: var(--dim); font-size: 12.5px; margin: 0 0 12px; }
.agents { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.agents-l { font-size: 13px; font-weight: 700; color: var(--dim); }
.prompt {
  margin: 0; padding: 12px; max-height: 52vh; overflow: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.6 var(--f-mono);
  background: var(--ground); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
}
.ph { background: var(--ph-bg); color: var(--ph); border-radius: 4px; padding: 0 2px; font-weight: 600; }
.warn { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; border: 1px solid color-mix(in srgb, var(--mark) 45%, transparent); background: var(--warn-bg); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions #build, .actions #copy { flex: 1 1 160px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font: 800 14px/1.1 var(--f-body); text-align: center;
}
.btn.primary { background: var(--mark); color: var(--on-mark); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--edge); }
.btn.ghost:hover { border-color: var(--faint); background: var(--elev); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.next { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.next h3 { font: 600 14px/1.3 var(--f-head); margin: 0 0 8px; }
.next ol { margin: 0; padding-left: 20px; color: var(--dim); font-size: 14px; }
.next li { margin: 0 0 6px; }
.next li::marker { color: var(--mark-ink); font-weight: 700; }

.foot { max-width: 1240px; margin: 0 auto; padding: 8px 16px 110px; color: var(--faint); font-size: 13px; }
.foot p { margin: 0; }

.fab {
  position: fixed; z-index: 30; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  display: none; min-height: 50px; border: 0; border-radius: 14px;
  background: var(--mark); color: var(--on-mark); font: 800 15px/1 var(--f-body); box-shadow: var(--shadow);
}
.fab.show { display: block; }
.toast {
  position: fixed; z-index: 70; left: 16px; right: 16px; bottom: 84px; margin: 0 auto; width: fit-content; max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--ground); font-weight: 700; font-size: 14px;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- preview modal ---------- */
.pv { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.pv-back { position: absolute; inset: 0; background: rgba(3, 4, 6, .72); backdrop-filter: blur(4px); }
.pv-dlg {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  width: 100vw; height: 100vh; height: 100dvh;
  background: var(--surface); box-shadow: var(--shadow);
}
.pv-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pv-ttl { flex: 1; min-width: 0; }
.pv-title { margin: 0; font: 600 15px/1.25 var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-cat { display: block; color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-x { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--edge); background: transparent; color: var(--text); font-size: 22px; line-height: 1; }
.pv-x:hover { background: var(--elev); }
.pv-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--ground); }
#pv-frame { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #fff; }
.pv-stage[data-dev="phone"] #pv-frame { box-shadow: 0 0 0 1px var(--edge), var(--shadow); }
.pv-foot { flex: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.pv-foot #pv-use { flex: 1 1 200px; max-width: 100%; }
@media (max-width: 479px) {
  .pv-dev button { padding: 7px 9px; }
  .pv-foot #pv-tokens { width: 100%; }
}
@media (min-width: 700px) {
  .pv-dlg { width: min(1200px, calc(100vw - 48px)); height: min(880px, calc(100vh - 48px)); border-radius: 18px; border: 1px solid var(--edge); }
  .pv-head, .pv-foot { padding: 12px 16px; }
  .pv-foot #pv-use { flex: 0 0 auto; }
}

/* ---------- breakpoints ---------- */
@media (max-width: 599px) {
  .kinds { grid-template-columns: 1fr; gap: 6px; }
  .kind { display: flex; align-items: baseline; gap: 10px; min-height: 48px; padding: 12px 14px; }
  .kind b { flex: none; overflow-wrap: normal; }
  .kind small { margin-top: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pick { grid-template-columns: 112px minmax(0, 1fr); gap: 4px 12px; }
  .pick-tx { display: contents; }
  .pick-mk { grid-row: 1 / span 3; }
  .pick-act { grid-column: 1 / -1; margin-top: 8px; }
  .pick-act .btn { flex: 1 1 auto; }
}
@media (min-width: 700px) {
  .tgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .step { padding: 20px; }
  .cats { margin: 10px -20px 0; padding: 2px 20px 8px; }
  .kind { padding: 14px 16px; }
  .kind b { font-size: 15px; }
  .kind small { font-size: 13px; }
  .pick { grid-template-columns: 180px minmax(0, 1fr); gap: 18px; }
}
@media (min-width: 1024px) {
  .app { padding: 0 24px 48px; }
  .top { padding: 18px 24px; }
  .foot { padding: 8px 24px 48px; }
  .intro { padding: 32px 0 6px; }
  .cols { grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
  .out { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
  .prompt { max-height: none; }
  .fab, .fab.show { display: none; }
}

/* ---------- embed (inside SHIPIT) ---------- */
html.embed .top, html.embed .intro, html.embed .foot, html.embed .toolstep, html.embed .next { display: none !important; }
html.embed body { font-size: 14px; }
html.embed .app { padding: 12px 12px 80px; }
html.embed .kinds { margin: 0 0 12px; }
html.embed .step, html.embed .out { padding: 14px; border-radius: 14px; }
html.embed .cats { margin: 10px -14px 0; padding: 2px 14px 8px; }
@media (min-width: 1024px) {
  html.embed .app { padding: 16px 16px 24px; }
  html.embed .out { top: 12px; max-height: calc(100vh - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
