/* FlyerFlash — the app around the ads stays quiet and neutral; the ads carry the color. */
:root {
  --paper: #F4F4F1;
  --card: #FFFFFF;
  --ink: #18181B;
  --muted: #5F5F68;
  --line: #E2E2DC;
  --line-strong: #CFCFC7;
  --flash: #FFD43B;
  --flash-ink: #3D2E00;
  --done: #15803D;
  --error: #B42318;
  --focus: #2563EB;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--body); }
img, canvas { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .08s, box-shadow .15s;
  width: auto; max-width: 100%;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #000; box-shadow: 0 0 0 4px rgba(24,24,27,.08); }
.btn-flash { background: var(--flash); color: var(--flash-ink); }
.btn-flash:hover:not(:disabled) { background: #FFC81A; }
.btn-ghost { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-text { background: none; padding: 0 8px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--ink); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn.busy { pointer-events: none; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.center { text-align: center; margin-top: 28px; }

/* ---------- homepage ---------- */
.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 max(16px, calc((100vw - 1180px) / 2)); background: rgba(244,244,241,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.dl-page { max-width: 1100px; margin: 0 auto; padding: 28px 16px 64px; }
.dl-page h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.dl-page .lead { margin-top: 10px; max-width: 60ch; }
.dl-empty { margin-top: 28px; color: var(--muted); }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 28px; }
.dl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dl-card img { width: 100%; height: 240px; object-fit: contain; background: #ECECE8; border-radius: 10px; }
.dl-meta { display: flex; flex-direction: column; min-width: 0; }
.dl-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-meta span { color: var(--muted); font-size: 14px; }
@media (max-width: 420px) { .nav .brand span { display: none; } .hide-sm { display: none; } }
@media (max-width: 480px) { .nav-actions .btn-ghost { padding-inline: 12px; } .dl-grid { grid-template-columns: 1fr 1fr; gap: 12px; } .dl-card img { height: 150px; } }

/* The homepage is one screen: no scrolling. */
body.is-home { overflow: hidden; }
#home { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.nav { position: static; flex: none; justify-content: space-between; height: 60px; }
.hero { flex: 1; min-height: 0; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px 28px; display: grid; grid-template-columns: 1.05fr 1fr; grid-template-rows: minmax(0, 1fr); gap: 40px; align-items: stretch; }
.hero-copy { align-self: center; }
.hero h1 { font-size: clamp(38px, min(5.6vw, 8.5vh), 72px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 12ch; }
.lead { font-size: clamp(16px, 2.4vh, 19px); color: var(--muted); margin-top: 20px; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--muted); }
.hero-stage { container-type: size; width: 100%; height: 100%; min-height: 0; display: grid; place-items: center; }
.hero-art { position: relative; width: min(100cqw, 100cqh, 640px); aspect-ratio: 1 / 1; }
.fan { position: absolute; width: 64%; height: auto; border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(24,24,27,.35), 0 2px 6px rgba(24,24,27,.08); transform-origin: 50% 90%; opacity: 0; }
.fan-1 { left: 0; top: 8%; transform: rotate(-9deg); }
.fan-2 { right: 0; top: 2%; transform: rotate(8deg); }
.fan-3 { left: 18%; top: 22%; transform: rotate(-1deg); z-index: 2; }
.hero-art.ready .fan { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art.ready .fan { animation: dealIn .8s cubic-bezier(.2,.8,.2,1) both; }
  .hero-art.ready .fan-1 { animation-delay: .05s; } .hero-art.ready .fan-2 { animation-delay: .15s; } .hero-art.ready .fan-3 { animation-delay: .3s; }
  @keyframes dealIn { from { opacity: 0; transform: translateY(40px) rotate(0); } }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 18px; text-align: center; align-content: center; padding-bottom: 20px; }
  .hero h1 { font-size: clamp(32px, min(9.4vw, 5.6vh), 54px); max-width: 14ch; margin: 0 auto; }
  .lead { margin: 14px auto 0; font-size: clamp(15px, 2.1vh, 18px); max-width: 34ch; }
  .hero-actions { justify-content: center; margin-top: 18px; }
  .hero-actions .btn { width: 100%; max-width: 360px; }
  .hero-note { margin-top: 10px; }
}
@media (max-width: 860px) and (max-height: 700px) { .hero-note { display: none; } .lead { margin-top: 10px; } .hero-actions { margin-top: 14px; } }
@media (max-height: 480px) and (orientation: landscape) {
  .hero { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); text-align: left; gap: 24px; padding-bottom: 12px; }
  .hero h1 { margin: 0; font-size: clamp(26px, 8vh, 40px); }
  .lead, .hero-note { display: none; }
  .hero-actions { justify-content: flex-start; margin-top: 16px; }
  .hero-actions .btn { width: auto; }
}

/* ---------- studio ---------- */
.studio-bar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; height: 64px; padding: 0 16px; background: rgba(244,244,241,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.step-count { font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.stepper { list-style: none; margin: 0 auto; padding: 0; display: flex; align-items: center; gap: 8px; max-width: 560px; width: 100%; justify-content: center; }
.stepper li { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; color: var(--muted); font-weight: 600; font-size: 14px; }
.stepper li + li::before { content: ""; width: 36px; height: 2px; background: var(--line-strong); border-radius: 2px; transition: background .3s; }
.stepper li[data-state="done"] + li::before { background: var(--done); }
.dot { position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line-strong); flex: none; transition: background .25s, border-color .25s; }
.dot b { font-size: 13px; }
.dot svg { position: absolute; width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }
.stepper li[data-state="current"] { color: var(--ink); }
.stepper li[data-state="current"] .dot { border-color: var(--ink); background: var(--ink); color: #fff; }
.stepper li[data-state="done"] { color: var(--ink); }
.stepper li[data-state="done"] .dot { background: var(--done); border-color: var(--done); }
.stepper li[data-state="done"] .dot b { visibility: hidden; }
.stepper li[data-state="done"] .dot svg { stroke-dashoffset: 0; transition: stroke-dashoffset .35s .1s ease-out; }
@media (prefers-reduced-motion: no-preference) { .stepper li[data-state="done"] .dot { animation: pop .35s ease-out; } @keyframes pop { 50% { transform: scale(1.15); } } }

.studio { display: grid; grid-template-columns: 1fr; gap: 0; max-width: 1280px; margin: 0 auto; }
.preview { padding: 16px; }
.preview-frame { position: relative; margin: 0 auto; width: 100%; max-width: 520px; }
.preview-frame canvas { width: 100%; height: auto; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 24px 48px -28px rgba(0,0,0,.45); }
.preview-meta { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }
.panel { display: flex; flex-direction: column; padding: 8px 16px 0; min-width: 0; }
.step-head { margin: 8px 0 20px; }
.step-head h1 { font-size: 30px; font-weight: 800; }
.step-head p { color: var(--muted); margin-top: 6px; }
.status { min-height: 0; margin: 8px 0 0; font-size: 15px; }
.status:not(:empty) { padding: 10px 14px; border-radius: var(--r-sm); background: #FFF8DB; border: 1px solid #F2DE8C; }
.status.error { background: #FEF0EE; border-color: #F5C2BC; color: var(--error); }
.navbar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); margin-top: 16px; background: linear-gradient(to bottom, rgba(244,244,241,0), var(--paper) 30%); }
.navbar .btn { min-width: 112px; }
.studio[data-step="6"] .navbar { position: static; background: none; border-top: 1px solid var(--line); margin-top: 20px; }

/* step 1 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tcard { appearance: none; position: relative; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; border-radius: var(--r); }
.tcard canvas { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--r); background: #e9e9e4; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .15s; }
.tcard:hover canvas { box-shadow: 0 0 0 2px var(--line-strong); }
.tcard[aria-selected="true"] canvas { box-shadow: 0 0 0 3px var(--ink); }
.tcard .tname { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-weight: 650; font-size: 14px; }
.tcard .tcat { color: var(--muted); font-weight: 500; }
.tcard .tick { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); display: none; place-items: center; }
.tcard .tick svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tcard[aria-selected="true"] .tick { display: grid; }
.tcard .rec { position: absolute; left: 8px; top: 8px; background: var(--flash); color: var(--flash-ink); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tgrid.mini { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tgrid.mini .tname { font-size: 12px; }
.tgrid.mini .tcat { display: none; }

/* forms */
.group { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.group legend { font-family: var(--display); font-weight: 800; font-size: 20px; padding: 0; margin-bottom: 14px; }
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-weight: 650; font-size: 14px; margin-bottom: 6px; }
.req { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 4px; }
input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--card);
  font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 72px; }
input:hover, select:hover, textarea:hover { border-color: #A9A9A0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(180,35,24,.15); }
.err { color: var(--error); font-size: 14px; margin-top: 6px; font-weight: 600; }
.err::before { content: "! "; font-weight: 800; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.note { color: var(--muted); font-size: 14px; margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: #EDEDE8; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.with-btn { display: flex; gap: 8px; align-items: stretch; }
.with-btn input { flex: 1; min-width: 0; }
.with-btn .btn { flex: none; min-height: 46px; }
.more { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.more summary, .edit summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.more summary::-webkit-details-marker, .edit summary::-webkit-details-marker { display: none; }
.more summary::after, .edit summary::after { content: "+"; font-size: 20px; color: var(--muted); }
.more[open] summary::after, .edit[open] summary::after { content: "–"; }
.more[open] > summary { margin-bottom: 10px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 46px; height: 46px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); cursor: pointer; flex: none; }
.color-row input:not([type=color]) { max-width: 140px; }

.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.suggest .chip { background: #FFF8DB; border-color: #F2DE8C; }
.suggest .chip:hover { border-color: var(--flash-ink); }
.suggest .lbl { width: 100%; font-size: 13px; color: var(--muted); }

.logo-box { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 14px; margin: 4px 0 16px; background: rgba(255,255,255,.5); }
.logo-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.logo-title { font-weight: 700; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-result { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.logo-thumb { width: 120px; height: 84px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--line); display: grid; place-items: center; padding: 8px;
  background: #fff conic-gradient(#EEE 25%, #fff 0 50%, #EEE 0 75%, #fff 0) 0 0 / 14px 14px; }
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-info { min-width: 0; }
.logo-info p { font-size: 14px; margin-bottom: 8px; }
.logo-btns { display: flex; flex-wrap: wrap; gap: 6px; }


.stock { margin-top: 14px; }
.stock-search { display: flex; gap: 8px; }
.stock-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.stock-grid button { appearance: none; padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden; cursor: pointer; aspect-ratio: 1; background: #ddd; }
.stock-grid button[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.stock-grid img { width: 100%; height: 100%; object-fit: cover; }
.stock-credit { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* step 3 */
.download-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; background: #E7E7E2; border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { appearance: none; border: 0; background: none; border-radius: 9px; padding: 6px 12px; font-weight: 650; font-size: 14px; cursor: pointer; line-height: 1.2; text-align: center; }
.seg button small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.seg button[aria-checked="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.notices { display: grid; gap: 8px; margin-bottom: 8px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: var(--r-sm); background: #FFF8DB; border: 1px solid #F2DE8C; font-size: 14px; }
.notice.bad { background: #FEF0EE; border-color: #F5C2BC; }
.notice.good { background: #ECF7EF; border-color: #BFE3C8; }
.notice p { flex: 1 1 220px; }
.edit { border-top: 1px solid var(--line); padding: 6px 0; }
.edit[open] { padding-bottom: 16px; }
.edit[open] > summary { margin-bottom: 8px; }
.photo-now { display: flex; gap: 14px; align-items: flex-start; }
.photo-now img { width: 92px; height: 92px; object-fit: cover; border-radius: var(--r-sm); flex: none; background: #eee; }
.photo-now .hint { margin: 0 0 8px; }
.sliders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.sliders label { font-size: 13px; font-weight: 600; color: var(--muted); }
.sliders input { width: 100%; accent-color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { appearance: none; border: 1px solid var(--line-strong); background: var(--card); border-radius: var(--r); padding: 8px 10px 8px 8px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.swatch i { width: 30px; height: 30px; border-radius: 8px; display: block; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.swatch[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.logo-mode { margin: 10px 0; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }

/* progress */
.progress { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(244,244,241,.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.progress-card { width: 100%; max-width: 360px; background: var(--card); border-radius: var(--r-lg); padding: 22px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.35); }
.progress-card h2 { font-size: 21px; margin-bottom: 14px; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stages li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.stages li .ic { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.stages li[data-s="active"] { color: var(--ink); font-weight: 600; }
.stages li[data-s="active"] .ic { border-color: var(--ink); border-right-color: transparent; animation: spin .8s linear infinite; }
.stages li[data-s="done"] { color: var(--ink); }
.stages li[data-s="done"] .ic { background: var(--done); border-color: var(--done); }
.stages li[data-s="done"] .ic::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.stages li[data-s="warn"] .ic { background: #F59E0B; border-color: #F59E0B; }
.stages li[data-s="warn"] .ic::after { content: "!"; color: #fff; font-weight: 800; font-size: 13px; }
.stages li small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.slow { font-size: 14px; color: var(--muted); margin-top: 14px; }
.progress-actions { margin-top: 16px; display: flex; justify-content: flex-end; }

dialog { border: 0; border-radius: var(--r-lg); padding: 24px; max-width: 380px; width: calc(100% - 32px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(24,24,27,.4); }
.pass-form h2 { font-size: 22px; margin-bottom: 8px; }
.pass-form p { color: var(--muted); margin-bottom: 14px; }
.pass-form label { font-weight: 650; font-size: 14px; display: block; margin-bottom: 6px; }
.pass-form .btn-row { justify-content: flex-end; margin-top: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 999px) {
  .studio[data-step="1"] .preview, .studio[data-step="2"] .preview, .studio[data-step="3"] .preview, .studio[data-step="4"] .preview { display: none; }
  .preview { padding-bottom: 0; }
  .preview-frame { max-width: 440px; }
}
@media (min-width: 1000px) {
  .studio { grid-template-columns: minmax(0, 1fr) minmax(400px, 500px); gap: 40px; padding: 0 24px; align-items: start; }
  .preview { position: sticky; top: 64px; padding: 28px 0; }
  .preview-frame { max-width: min(600px, calc((100vh - 150px) * var(--ratio, 1))); }
  .panel { padding: 20px 0 0; }
  .tgrid { grid-template-columns: repeat(3, 1fr); }
  .tgrid.mini { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 600px) and (max-width: 999px) { .tgrid { grid-template-columns: repeat(3, 1fr); } .tgrid.mini { grid-template-columns: repeat(4, 1fr); } }
.stepper .lbl { white-space: nowrap; }
@media (max-width: 900px) {
  .stepper .lbl { display: none; }
  .stepper li[data-state="current"] .lbl { display: inline; }
  .stepper li + li::before { width: 18px; }
  .studio-bar .brand span { display: none; }
}
@media (max-width: 560px) {
  .row2 { gap: 10px; }
  .sliders { grid-template-columns: 1fr; }
  .stock-grid { grid-template-columns: repeat(3, 1fr); }
  .tgrid.mini { grid-template-columns: repeat(3, 1fr); }
  .step-count { display: none; }
  .studio-bar { grid-template-columns: auto 1fr; }
  .with-btn .btn { padding: 0 12px; }
  .download-row .btn-lg { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- photo: take / choose, background removal ---------- */
.group-hint { margin: -6px 0 12px; font-size: 14px; }
.snap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.snap-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 108px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: var(--card); cursor: pointer; text-align: center; transition: border-color .15s, background-color .15s; }
.snap-btn:hover { border-color: var(--ink); }
.snap-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.snap-btn svg { width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.snap-btn b { font-size: 15px; }
.snap-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.snap.invalid .snap-btn { border-color: var(--error); }
.checker { background: #fff conic-gradient(#ECECE8 25%, #fff 0 50%, #ECECE8 0 75%, #fff 0) 0 0 / 16px 16px; }
.cut-card { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.cut-thumb { width: 104px; height: 104px; flex: none; border-radius: var(--r-sm); overflow: hidden; display: grid; place-items: center; }
.cut-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cut-info { min-width: 0; flex: 1; display: grid; gap: 8px; }
.cut-info p { font-size: 14px; }
.bar { height: 6px; border-radius: 3px; background: #E7E7E2; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.bar.indeterminate i { width: 35%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.alt-src { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.ai-card { margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: #FFF8DB; border: 1px solid #F2DE8C; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.photo-now img.checker { object-fit: contain; }
.photo-now .bar { margin-top: 10px; }
@media (max-width: 380px) { .snap-btn { min-height: 96px; } .snap-btn b { font-size: 14px; } }

/* ---------- simpler layout ---------- */
.step-head { margin: 4px 0 18px; }
.step-head h1 { font-size: 28px; }
.photo-block { margin-bottom: 22px; }
.field label { font-weight: 600; }
.more { margin-top: 6px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.tabs button { appearance: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-weight: 650; font-size: 14px; cursor: pointer; }
.tabs button:hover { border-color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabpanel { padding: 4px 0 8px; }
.tools { border-top: 0; padding-top: 8px; gap: 4px; }
.download-row .seg button { padding: 10px 14px; }
@media (max-width: 340px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

/* ---------- six-step flow ---------- */
.opt { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 4px; }
.sub { font-size: 19px; margin: 22px 0 12px; }
#findBtn { margin-top: 2px; }
.found { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.found.searching { justify-content: flex-start; }
.found-name { font-weight: 700; font-size: 17px; }
.found .hint { margin-top: 2px; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.logo-tile { position: relative; appearance: none; aspect-ratio: 1.3; border-radius: var(--r); border: 1px solid var(--line-strong); padding: 18px; display: grid; place-items: center; cursor: pointer; font-weight: 650; font-size: 13px; text-align: center; color: var(--ink); overflow: hidden; }
.logo-tile img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.logo-tile.upload { background: var(--card); border-style: dashed; }
.logo-tile.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.logo-tile.none { background: var(--card); color: var(--muted); }
.logo-wrap .zoom { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; display: grid; place-items: center; font-size: 16px; line-height: 1; padding: 0; min-height: 0; color: var(--ink); cursor: zoom-in; }
.logo-count { color: var(--muted); font-size: 14px; margin: -6px 0 12px; }
.logo-big { position: fixed; inset: 0; z-index: 60; background: rgba(20,20,20,.72); display: grid; place-items: center; padding: 20px; }
.logo-big > div { background: #fff; border-radius: 16px; padding: 16px; width: min(92vw, 720px); display: grid; gap: 12px; }
.logo-big .checker { border-radius: 10px; height: min(60vh, 480px); display: grid; place-items: center; padding: 20px; }
.logo-big img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-big .acts { display: flex; gap: 10px; justify-content: flex-end; }
#logoEdit .seg { margin-bottom: 12px; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--ink); }
.seg.small button { padding: 6px 12px; font-size: 13px; }
.chips.ideas { margin-top: -4px; }
.drag-tip { color: var(--muted); margin-top: 6px; }
.seg.sizes { margin-bottom: 14px; }
.brand-color { margin-top: 14px; }
.preview-frame canvas.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: 14px; background: transparent; box-shadow: none; }
.studio[data-step="5"] .overlay { pointer-events: auto; touch-action: none; }
@media (max-width: 999px) { .studio[data-step="5"] .preview { position: sticky; top: 64px; z-index: 4; background: var(--paper); padding-bottom: 8px; } .studio[data-step="5"] .preview-frame { max-width: min(440px, 46vh); } }
@media (max-width: 560px) {
  .stepper { gap: 4px; justify-content: flex-start; }
  .stepper li { gap: 4px; }
  .stepper li + li::before { width: 8px; }
  .dot { width: 24px; height: 24px; }
  .dot b { font-size: 12px; }
}
