:root {
  --bg:        #f5f6fa;
  --surface:   #ffffff;
  --sidebar:   #ffffff;
  --ink:       #181c2a;
  --ink-2:     #41475a;
  --ink-soft:  #8b91a4;
  --line:      #e7e9f1;
  --line-2:    #eef0f6;
  --primary:   #4f46e5;
  --primary-2: #4338ca;
  --primary-soft:#eef0fe;
  --green:     #15a05a;
  --green-soft:#e4f6ec;
  --blue:      #2f76d6;
  --blue-soft: #e7f0fd;
  --amber-soft:#fbf0d3;
  --amber-ink: #97700a;
  --red-soft:  #fbe2de;
  --red-ink:   #c0392b;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(20,25,50,.04), 0 6px 20px rgba(20,25,50,.06);
  --shadow-lg: 0 16px 50px rgba(20,25,50,.18);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h3 { margin: 0; letter-spacing: -.02em; }

.app { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: 252px; flex-shrink: 0; background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 22px; }
.logo-mark { flex-shrink: 0; border-radius: 9px; }
.wordmark { font-weight: 900; font-size: 19px; letter-spacing: -.03em; color: var(--ink); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-toggle { display: none; }  /* desktop: no hamburger */
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  background: transparent; border: none; padding: 11px 12px; border-radius: 10px; cursor: pointer;
  transition: .12s;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-2); font-weight: 700; }
.ni-ico { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; opacity: .8; }
.ni-ico svg { width: 18px; height: 18px; }
.nav-item.active .ni-ico { opacity: 1; }

.side-foot { margin-top: auto; }
.credit-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; }
.credit-row { display: flex; align-items: baseline; gap: 6px; justify-content: center; }
.credit-num { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.credit-cap { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.btn-soft { margin-top: 10px; width: 100%; font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--primary-2); background: var(--primary-soft); border: none; padding: 9px;
  border-radius: 9px; cursor: pointer; }
.btn-soft:hover { background: #e3e6fd; }

/* ===== Login overlay ===== */
.login-overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 22px; }
.login-overlay.hidden { display: none; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 34px; width: 100%; max-width: 400px; text-align: center; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; }
.login-brand .wordmark { font-size: 24px; }
.login-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.login-sub { color: var(--ink-soft); font-size: 14px; font-weight: 500; margin-bottom: 22px; }
.login-card input[type=email] { width: 100%; padding: 11px 13px; font-family: inherit;
  font-size: 14.5px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-align: center; margin-bottom: 14px; outline: none; }
.login-card input[type=email]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
#turnstile-box { display: flex; justify-content: center; margin-bottom: 14px; }
.login-msg { font-size: 14px; font-weight: 600; color: var(--green); margin-top: 16px; min-height: 18px; }
.login-msg.err { color: var(--red-ink); }
#login-step.hidden, #login-sent.hidden { display: none; }
.login-sent .sent-icon { font-size: 46px; margin-bottom: 6px; }
.login-sent .muted { margin-top: 18px; }
.login-sent a { color: var(--primary); font-weight: 700; }

/* sidebar sign-out (below the credit box) */
.logout-full { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: .12s; }
.logout-full svg { flex-shrink: 0; }
.logout-full:hover { background: var(--red-soft); color: var(--red-ink); border-color: var(--red-soft); }

/* ===== Main ===== */
.main { flex: 1; min-width: 0; }
.main-top { display: flex; justify-content: flex-end; align-items: center; gap: 16px;
  padding: 12px 36px; border-bottom: 1px solid var(--line); background: var(--surface); }
.status { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* announcement / promo bar - hidden by default; shown only for non-annual users
   (html.promo-show), decided pre-paint so annual users never see a flash. */
.promo-bar { display: none; }
html.promo-show .promo-bar { display: inline-flex; }
.promo-bar { margin-right: auto; align-items: center; gap: 12px; text-decoration: none;
  color: #fff; font-size: 13.5px; font-weight: 600; padding: 9px 18px; border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
  box-shadow: 0 4px 16px rgba(239,68,68,.28); position: relative; overflow: hidden; }
.promo-bar::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg); animation: promo-shine 3.2s ease-in-out infinite; }
@keyframes promo-shine { 0%,60% { left: -60%; } 100% { left: 130%; } }
.promo-flame { font-size: 16px; }
.promo-text b { font-weight: 800; }
.promo-cta { font-weight: 800; background: rgba(255,255,255,.22); padding: 4px 12px; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0; }
.promo-bar:hover { box-shadow: 0 6px 20px rgba(239,68,68,.4); }
.promo-bar:hover .promo-cta { background: rgba(255,255,255,.32); }
.activity { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line); }
.activity.idle    { color: var(--ink-soft); background: var(--surface); }
.activity.working { color: var(--primary-2); background: var(--primary-soft); border-color: #dcdcfb; }
.activity.failed  { color: var(--red-ink); background: var(--red-soft); border-color: #f1c9c3; cursor: default; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.spinner { width: 13px; height: 13px; border: 2px solid #cdd0f7; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.main-body { padding: 34px 36px 64px; }
/* design/mockup: form left, live results right */
#panel-design, #panel-mockup { max-width: 1180px; }
#panel-pricing { max-width: 1180px; }
#panel-pricing .bill-toggle { margin: 0 auto 24px; }
#panel-account { max-width: 820px; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.acct-card { padding: 22px 24px; }
.acct-h { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ink-soft); margin-bottom: 14px; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.acct-row:last-of-type { border-bottom: none; }
.acct-row span { color: var(--ink-soft); font-weight: 600; }
.acct-row b { font-weight: 700; text-align: right; word-break: break-word; }
.plan-pill { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  padding: 4px 11px; border-radius: 20px; background: var(--bg); color: var(--ink-2); }
.plan-pill.paid { background: var(--primary-soft); color: var(--primary-2); }
.plan-cycle { margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.acct-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.acct-actions .btn-primary, .acct-actions .btn-ghost { flex: 1; text-align: center; min-width: 130px; }
.btn-ghost.danger { color: var(--red-ink); }
.btn-ghost.danger:hover { border-color: #f1c9c3; background: var(--red-soft); }
.load-more-wrap { display: flex; justify-content: center; margin-top: 22px; }
@media (max-width: 720px) { .account-grid { grid-template-columns: 1fr; } }
.work { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 26px; align-items: start; }
.results-panel { position: sticky; top: 24px; }
.results-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 16px;
  padding: 48px 20px; text-align: center; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.panel { display: none; animation: fade .2s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px);} to { opacity:1; transform:none; } }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 25px; font-weight: 800; }
.page-head p { margin: 7px 0 0; color: var(--ink-soft); font-size: 14.5px; font-weight: 500; }

/* ===== Card / fields ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; }
.field { margin-bottom: 20px; }
.lbl { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.help { color: var(--ink-soft); font-size: 12.5px; font-weight: 500; margin: 7px 0 0; }
.help-inline { color: var(--ink-soft); font-weight: 500; }
.btn-enhance { font-family: inherit; font-size: 13.5px; font-weight: 700;
  color: #fff; background: var(--primary); border: none; padding: 11px 20px; border-radius: 10px;
  cursor: pointer; transition: .12s; display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 4px 12px rgba(79,70,229,.28); }
.btn-enhance:hover { background: var(--primary-2); }
.btn-enhance:disabled { opacity: .8; cursor: default; }

/* Row under the prompt box: enhance button (left), transparent toggle (right) */
.prompt-actions { margin-top: 10px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bg-toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--muted, #64748b); user-select: none; }
.bg-toggle .bg-switch { position: relative; width: 40px; height: 22px; flex: none;
  background: #cbd5e1; border-radius: 999px; transition: background .15s; }
.bg-toggle .bg-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.bg-toggle input:checked ~ .bg-switch { background: var(--primary); }
.bg-toggle input:checked ~ .bg-switch .bg-knob { transform: translateX(18px); }
.bg-toggle input:checked { color: var(--text, #0f172a); }
.bg-toggle:has(input:checked) { color: var(--text, #0f172a); }
.enhance-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer; transition: .15s; }
.enhance-toggle:hover { border-color: #cfd3e6; }
.enhance-toggle:has(input:checked) { background: var(--primary-soft); border-color: #d7d8fb; }
.enhance-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.et-text { min-width: 0; }
.et-title { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.et-sub { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; }
.switch { flex-shrink: 0; width: 42px; height: 24px; border-radius: 999px; background: #cdd2e2;
  position: relative; transition: .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20,25,50,.25); transition: .18s; }
.enhance-toggle input:checked ~ .switch { background: var(--primary); }
.enhance-toggle input:checked ~ .switch::after { transform: translateX(18px); }

textarea, input[type=number], input[type=file], input[type=text], select {
  width: 100%; padding: 11px 13px; font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  outline: none; transition: .12s;
}
textarea { resize: vertical; line-height: 1.55; }
textarea::placeholder { color: #aeb3c4; }
select { cursor: pointer; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%238b91a4' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
textarea:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=file] { padding: 9px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
input[type=file]::file-selector-button { font-family: inherit; font-weight: 600; border: 1px solid var(--line);
  cursor: pointer; background: var(--bg); color: var(--ink); padding: 7px 13px; border-radius: 8px; margin-right: 11px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid3.g2 { grid-template-columns: repeat(2, 1fr); }

/* ===== Model cards ===== */
/* Engine dropdown (Choose your engine) */
.engine-dd { position: relative; }
.engine-trigger {
  width: 100%; display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: var(--surface); font-family: inherit; text-align: left; transition: .12s;
}
.engine-trigger:hover { border-color: #cfd3e6; }
.engine-trigger:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.engine-dd.open .engine-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.engine-trigger-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.engine-name { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.engine-desc { font-size: 12px; font-weight: 500; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engine-badge { flex: none; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--primary);
  padding: 4px 10px; border-radius: 20px; }
.engine-caret { flex: none; color: var(--ink-soft); transition: transform .15s; }
.engine-dd.open .engine-caret { transform: rotate(180deg); }
.engine-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.16); padding: 6px; display: none;
  max-height: 340px; overflow-y: auto;
}
.engine-dd.open .engine-panel { display: block; }
.engine-opt { display: flex; align-items: center; gap: 12px; padding: 10px 11px; border-radius: 9px; cursor: pointer; transition: .1s; }
.engine-opt:hover { background: var(--primary-soft); }
.engine-opt.on { background: var(--primary-soft); }
.engine-opt-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.engine-opt-name { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.engine-opt-name .tick { color: var(--primary); font-weight: 800; visibility: hidden; }
.engine-opt.on .engine-opt-name .tick { visibility: visible; }
.engine-opt-desc { font-size: 12px; font-weight: 500; color: var(--ink-soft); line-height: 1.35; }
.engine-opt-badge { flex: none; font-size: 11px; font-weight: 700; color: var(--primary-2); background: #fff;
  border: 1px solid var(--line); padding: 3px 9px; border-radius: 20px; }

.ref-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 6px; }
.ref-row label { font-size: 12px; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: 5px; }

/* ===== Pickers / chips ===== */
.picker { display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.pick-col { padding: 14px 16px; }
.pick-col + .pick-col { border-top: 1px solid var(--line); }
.pick-h { display: block; font-size: 11px; font-weight: 800; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

/* Full-screen pricing takeover (the upgrade / Choose-your-plan popup) */
.pricing-modal { position: fixed; inset: 0; z-index: 200; background: var(--bg); overflow-y: auto; }
.pricing-modal.hidden { display: none; }
.pricing-modal-card { min-height: 100vh; max-width: 1180px; margin: 0 auto;
  padding: 64px 32px 56px; position: relative; }
.pricing-modal .page-head { text-align: center; }
.pricing-modal .bill-toggle { justify-content: center; }
.pricing-modal .trust-bar, .pricing-modal .trust-note { text-align: center; }
.pricing-modal .pricing-foot { justify-content: center; gap: 24px; }
.pm-close { position: fixed; top: 18px; right: 22px; z-index: 210; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1;
  cursor: pointer; color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; }
.pm-close:hover { color: var(--ink); border-color: #cfd3e6; }
.chip { font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: .12s; }
.chip:hover { border-color: #cfd3e6; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Actions ===== */
.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 4px; }
.pill-cost { font-size: 13px; font-weight: 700; color: var(--primary-2);
  background: var(--primary-soft); padding: 9px 15px; border-radius: 20px; }
.btn-primary { font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; color: #fff;
  background: var(--primary); border: none; padding: 12px 26px; border-radius: 10px;
  box-shadow: 0 4px 12px rgba(79,70,229,.28); transition: .12s; text-decoration: none; display: inline-block; }
.btn-primary:hover { background: var(--primary-2); }
.btn-ghost { font-family: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); padding: 9px 15px; border-radius: 10px; }
.btn-ghost:hover { border-color: #cfd3e6; }
.flash { font-size: 13.5px; font-weight: 600; color: var(--green); margin: 14px 0 0; min-height: 18px; }
.flash.err { color: var(--red-ink); }

/* generate button loading + inline results */
.hidden { display: none; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 13px 20px;
  border-radius: 12px; box-shadow: var(--shadow-lg); max-width: 92vw; text-align: center; }
.btn-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 7px; }
.btn-primary:disabled { opacity: .9; cursor: default; }
.results-head { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 14px; }
/* single result fills the column (big); multiple → 2-up */
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow); }
.result-card.done { cursor: zoom-in; transition: .15s; }
.result-card.done:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
/* checkerboard shows transparency (and frames opaque art cleanly) */
.rc-img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative;
  background-color: #fff;
  background-image: linear-gradient(45deg, #eef0f6 25%, transparent 25%), linear-gradient(-45deg, #eef0f6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eef0f6 75%), linear-gradient(-45deg, transparent 75%, #eef0f6 75%);
  background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.rc-img img { width: 100%; height: 100%; object-fit: contain; }
.result-card.done .rc-img::after { content: "⤢ View"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px;
  background: rgba(24,28,42,.42); opacity: 0; transition: .15s; }
.result-card.done:hover .rc-img::after { opacity: 1; }
/* picker mode: the card adds the design to the product, so cue "add" not "view" */
.result-card.pickable.done { cursor: pointer; }
.result-card.pickable.done .rc-img::after { content: "✓ Use this design"; }
.rc-use { padding: 12px; text-align: center; font-size: 13px; font-weight: 800; color: var(--primary-2);
  background: var(--primary-soft); border-top: 1px solid var(--primary-soft); }
.rc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-top: 1px solid var(--line-2); }
.rc-info { min-width: 0; }
.rc-title { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.rc-sub { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-dl { flex-shrink: 0; text-decoration: none; font-size: 13px; font-weight: 700;
  color: var(--primary-2); background: var(--primary-soft); padding: 8px 14px; border-radius: 9px; }
.rc-dl:hover { background: var(--primary); color: #fff; }
.result-card .r-msg { aspect-ratio: 1; font-size: 12px; font-weight: 600; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; }
.result-card.fail .r-msg { color: var(--red-ink); }

/* ===== Gallery ===== */
.gallery-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-btn { font-family: inherit; font-weight: 600; font-size: 13px; color: var(--ink-soft);
  border: none; background: transparent; padding: 7px 15px; border-radius: 7px; cursor: pointer; }
.seg-btn.active { background: var(--primary-soft); color: var(--primary-2); }
#refresh { margin-left: auto; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 18px; }
.card-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: .15s; }
.card-tile:hover { border-color: #cfd3e6; box-shadow: var(--shadow); transform: translateY(-2px); }
.thumb { width: 100%; aspect-ratio: 1; background: var(--line-2); display: flex; align-items: center;
  justify-content: center; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-foot { padding: 11px 13px; }
.card-title { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; justify-content: space-between; }
.badge { font-size: 10px; padding: 3px 9px; border-radius: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.b-queued { background: var(--amber-soft); color: var(--amber-ink); }
.b-running { background: var(--blue-soft); color: var(--blue); }
.b-done   { background: var(--green-soft); color: var(--green); }
.b-failed { background: var(--red-soft); color: var(--red-ink); }
.b-recovered { background: var(--bg); color: var(--ink-soft); }
.cost { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; background: rgba(24,28,42,.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 300; padding: 24px; }
.modal.hidden { display: none; }
.modal-body { background: var(--surface); border-radius: 18px; max-width: 880px; width: 100%;
  max-height: 88vh; overflow: auto; padding: 22px; position: relative;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; box-shadow: var(--shadow-lg); }
/* while the Make-Video sheet is open, give the modal extra height so its motion
   dropdown can expand fully instead of being clipped by the modal's scroll box. */
.modal-body:has(#video-sheet:not(.hidden)) { min-height: min(620px, 90vh); }
.modal-img-wrap { background: var(--line-2); border-radius: 12px; overflow: hidden; align-self: start; }
.modal-body img { width: 100%; display: block; }
.modal-meta { padding-top: 18px; }   /* clear the close button so "Prompt" isn't crowded */
.modal-meta h3 { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.modal-meta pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line);
  padding: 12px; border-radius: 10px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; margin: 0 0 16px; line-height: 1.5; }
#modal-close { position: absolute; top: 16px; right: 16px; border: 1px solid var(--line); cursor: pointer;
  background: var(--surface); color: var(--ink-2); border-radius: 9px; width: 34px; height: 34px;
  font-weight: 700; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s; z-index: 2; }
#modal-close:hover { background: var(--bg); color: var(--ink); }
#modal-download { margin-top: 2px; }

/* confirm-before-generate */
.confirm-body { background: var(--surface); border-radius: 18px; max-width: 440px; width: 100%;
  padding: 26px; position: relative; box-shadow: var(--shadow-lg); }
.confirm-body h3 { font-size: 19px; font-weight: 800; margin-bottom: 16px; }
#confirm-close, #agent-modal-close, #pay-close, #order-close { position: absolute; top: 16px; right: 18px; border: none; cursor: pointer;
  background: var(--bg); color: var(--ink-soft); border-radius: 8px; width: 30px; height: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px; transition: .12s; }
#confirm-close:hover, #agent-modal-close:hover, #pay-close:hover, #order-close:hover { background: var(--line); color: var(--ink); }
.confirm-rows { display: flex; flex-direction: column; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.confirm-row { display: flex; gap: 14px; justify-content: space-between; padding: 11px 14px; background: var(--surface); }
.cr-k { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); flex-shrink: 0; }
.cr-v { font-size: 13px; font-weight: 600; color: var(--ink); text-align: right; word-break: break-word; }
.confirm-cost { margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--primary-soft);
  text-align: center; font-size: 15px; font-weight: 600; color: var(--ink); }
.confirm-cost b { font-size: 22px; font-weight: 900; color: var(--primary-2); }
.confirm-after { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm-actions .btn-ghost { flex: 0 0 auto; }
.confirm-actions .btn-primary { flex: 1; text-align: center; }
.pay-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.refund-link { display: block; width: 100%; text-align: left; margin-top: 10px; padding: 0 4px;
  font-family: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink-soft);
  background: none; border: none; cursor: pointer; }
.refund-link:hover { color: var(--ink-2); text-decoration: underline; }
.refund-status { font-size: 14px; font-weight: 700; padding: 13px 15px; border-radius: 12px;
  background: var(--bg); color: var(--ink-2); margin-bottom: 14px; line-height: 1.4; }
.refund-status.ok { background: var(--green-soft); color: var(--green); }
.refund-status.no { background: var(--amber-soft); color: var(--amber-ink); }
.refund-policy { font-size: 12px; font-weight: 500; color: var(--ink-soft); line-height: 1.55; margin: 0 0 4px; }

/* ===== Tablet ===== */
/* ===== Pricing modal ===== */
.pricing-body { background: var(--surface); border-radius: 20px; max-width: 920px; width: 100%;
  max-height: 92vh; overflow: auto; padding: 30px; position: relative; box-shadow: var(--shadow-lg); }
.pricing-body h3 { font-size: 23px; font-weight: 800; text-align: center; }
.pricing-sub { text-align: center; color: var(--ink-soft); font-size: 14px; font-weight: 500; margin: 6px 0 18px; }
#pricing-close { position: absolute; top: 16px; right: 18px; border: none; cursor: pointer;
  background: var(--bg); color: var(--ink); border-radius: 8px; width: 32px; height: 32px; font-weight: 700; }
.bill-toggle { display: flex; gap: 6px; justify-content: center; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; width: fit-content; margin: 0 auto 22px; }
.bt-opt { font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
  background: transparent; border: none; padding: 9px 16px; border-radius: 9px; display: flex; align-items: center; gap: 8px; }
.bt-opt.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.bt-badge { font-size: 10px; font-weight: 800; color: #fff; background: var(--green); padding: 2px 8px; border-radius: 20px; }
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; padding-top: 8px; }
.plan-grid.solo { grid-template-columns: minmax(0, 380px); justify-content: center; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 20px;
  display: flex; flex-direction: column; position: relative; transition: box-shadow .15s, transform .15s; }
.plan:hover { box-shadow: var(--shadow); }
.plan.popular { border: 2px solid var(--primary); box-shadow: 0 16px 44px rgba(79,70,229,.16); transform: translateY(-8px); }
.plan.popular:hover { box-shadow: 0 18px 48px rgba(79,70,229,.22); }
.plan.best-value { border-color: #bfe6cf; }
.plan-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px; color: #fff; background: var(--primary); padding: 5px 15px;
  border-radius: 20px; white-space: nowrap; box-shadow: 0 4px 12px rgba(79,70,229,.4); }
.plan-tag.tag-value { background: var(--green); box-shadow: 0 4px 12px rgba(21,160,90,.32); }
.plan-name { font-size: 17px; font-weight: 800; color: var(--ink); }
.plan-blurb { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; margin: 4px 0 18px; min-height: 34px; line-height: 1.4; }
.plan-price { font-size: 36px; font-weight: 900; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.plan-price small { font-size: 14px; font-weight: 700; color: var(--ink-soft); letter-spacing: 0; }
.plan-note { font-size: 11.5px; font-weight: 700; color: var(--green); margin-top: 7px; min-height: 16px; }
.plan-credits { font-size: 13.5px; font-weight: 800; color: var(--primary-2); background: var(--primary-soft);
  padding: 10px 12px; border-radius: 10px; text-align: center; margin: 18px 0 5px; }
.plan-percredit { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); text-align: center; margin-bottom: 6px; }
.plan-est { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); text-align: center; margin: 0 0 16px; line-height: 1.45; }
.plan-est span { display: block; opacity: .85; }
.trust-bar { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--green);
  background: var(--green-soft); border-radius: 10px; padding: 10px 12px; margin: 28px 0 8px; }
.trust-note { text-align: center; font-size: 11.5px; font-weight: 500; color: var(--ink-soft);
  line-height: 1.5; margin: 0 auto 20px; max-width: 620px; }
.trust-note a { color: var(--primary-2); font-weight: 700; text-decoration: none; }
.trust-note a:hover { text-decoration: underline; }
.plan-feats { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 9px; }
.plan-feats li { font-size: 12.5px; font-weight: 500; color: var(--ink-2); padding-left: 24px; position: relative; line-height: 1.4; }
.plan-feats li::before { content: "✓"; position: absolute; left: 0; top: -1px; color: var(--green); font-weight: 800; font-size: 13px; }
.plan .btn-primary, .plan .btn-ghost, .plan .plan-cta { width: 100%; text-align: center; margin-top: auto; padding: 12px; font-size: 14px; }
.plan .btn-ghost { color: var(--primary-2); border-color: #d4d7ef; background: var(--surface); font-weight: 700; }
.plan .btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.plan.current .plan-cta { font-weight: 800; color: var(--green); background: var(--green-soft); border: none; border-radius: 10px; }
.pricing-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 24px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.pricing-foot a, .pack-note a { color: var(--primary-2); font-weight: 700; text-decoration: none; }
.pricing-foot a:hover, .pack-note a:hover { text-decoration: underline; }

/* ===== Credits page ===== */
#panel-credits { max-width: none; }
.credits-balance { text-align: center; margin-bottom: 26px; }
.cb-num { font-size: 42px; font-weight: 900; color: var(--primary-2); letter-spacing: -.03em; line-height: 1; }
.cb-cap { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-top: 4px; }
.pack-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-top: 8px; }
.pack-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 22px;
  text-align: center; display: flex; flex-direction: column; align-items: center; position: relative; transition: .15s; }
.pack-card:hover { box-shadow: var(--shadow); }
.pack-card.best { border: 2px solid var(--primary); box-shadow: 0 16px 44px rgba(79,70,229,.14); transform: translateY(-8px); }
.pack-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px; color: #fff; background: var(--primary); padding: 5px 15px;
  border-radius: 20px; box-shadow: 0 4px 12px rgba(79,70,229,.4); }
.pack-credits { font-size: 44px; font-weight: 900; color: var(--ink); letter-spacing: -.04em; line-height: 1; }
.pack-unit { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 16px; }
.pack-price { font-size: 28px; font-weight: 900; color: var(--primary-2); letter-spacing: -.02em; }
.pack-per { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 5px 0 6px; }
.pack-eq { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin: 0 0 18px; line-height: 1.4; }
.pack-card .btn-primary { width: 100%; text-align: center; padding: 12px; }
.pack-note { text-align: center; font-size: 12.5px; color: var(--ink-soft); font-weight: 500; margin-top: 24px; line-height: 1.5; }

@media (max-width: 1080px) {
  .plan-grid, .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan.popular, .pack-card.best { transform: none; }
}
@media (max-width: 720px) {
  .pricing-body { padding: 22px 16px; }
  .plan-grid, .pack-grid { grid-template-columns: 1fr; }
  .plan.popular, .pack-card.best { transform: none; }
  .bt-badge { display: none; }
}

@media (max-width: 920px) {
  .work { grid-template-columns: 1fr; }
  .results-panel { position: static; }
  .picker { grid-template-columns: 1fr; }
  .main-body { padding: 26px 22px 56px; }
  .modal-body { grid-template-columns: 1fr; }
}

/* ===== Phone ===== */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  /* block layout (not flex) so nothing stretches the page wider than the viewport */
  .app { display: block; }
  .main { display: block; width: 100%; }
  .main, .main-body, .sidebar, .card, .work, .panel, .page-head { min-width: 0; max-width: 100%; }
  .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* sidebar → single-row sticky top bar with a hamburger that opens a dropdown */
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 30;
    flex-flow: row nowrap; align-items: center; gap: 10px;
    padding: 9px 12px; border-right: none; border-bottom: 1px solid var(--line);
  }
  .nav-toggle { order: 1; display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--line); background: var(--surface);
    border-radius: 10px; color: var(--ink); cursor: pointer; }
  .sidebar.nav-open .nav-toggle { background: var(--primary-soft); border-color: #dcdcfb; color: var(--primary-2); }
  .brand { padding: 0; order: 2; }
  .wordmark { font-size: 17px; }
  .side-foot { order: 3; margin: 0 0 0 auto; display: flex; align-items: center; gap: 8px; }
  .logout-full { width: auto; margin-top: 0; padding: 8px; }
  .logout-full span { display: none; }
  .credit-card { padding: 5px 11px; display: flex; align-items: center; gap: 6px;
    background: var(--primary-soft); border-color: #dcdcfb; }
  .credit-num { font-size: 16px; color: var(--primary-2); }
  .credit-cap { font-size: 10.5px; }
  .btn-soft { display: none; }
  /* nav → dropdown panel revealed by the hamburger */
  .side-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 3px;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 10px; display: none;
  }
  .sidebar.nav-open .side-nav { display: flex; }
  .nav-item { width: 100%; justify-content: flex-start; font-size: 15px; font-weight: 600;
    padding: 13px 14px; border-radius: 11px; }
  .nav-item.active { background: var(--primary-soft); color: var(--primary-2); }
  .ni-ico { font-size: 16px; width: 22px; }
  /* main */
  .main-top { padding: 8px 12px; flex-direction: column; gap: 8px; }
  .promo-bar { width: 100%; justify-content: center; font-size: 12.5px; padding: 9px 12px; gap: 8px; }
  .promo-text b { white-space: nowrap; }
  .main-top .status { align-self: center; }
  .main-body { padding: 18px 16px 44px; }
  .page-head h1 { font-size: 21px; }
  .page-head p { font-size: 13.5px; }
  .card { padding: 18px; }
  .grid3 { gap: 10px; }
  .model-cards { grid-template-columns: 1fr; }
  .ref-row { grid-template-columns: 1fr; }
  .actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .actions .btn-primary { width: 100%; padding: 13px; }
  .pill-cost { text-align: center; }
  .results-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .gallery-bar { flex-wrap: wrap; }
  /* modal as a bottom sheet */
  .modal { padding: 0; align-items: flex-end; }
  .modal-body { grid-template-columns: 1fr; border-radius: 18px 18px 0 0; max-height: 92vh; padding: 18px; }
  .confirm-body { border-radius: 16px; }
}

/* ---- AI design agent ("Fill my shop") ---- */
.lbl-opt { font-weight: 500; color: var(--ink-2); }
.agent-hint { font-size: 12.5px; color: var(--ink-2); margin-top: 12px; text-align: center; }
#agent-step2 { margin-top: 20px; }
.concept-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.concept { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.concept:hover { border-color: #cfd3e6; }
.concept:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.concept input { margin-top: 3px; width: 18px; height: 18px; flex: none; cursor: pointer; accent-color: var(--primary); }
.concept-body { display: flex; flex-direction: column; gap: 3px; }
.concept-title { font-weight: 800; font-size: 15px; color: var(--ink); }
.concept-text { font-weight: 700; color: var(--primary); font-size: 13.5px; }
.concept-idea { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.agent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.agent-selbar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 16px; margin-top: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 -6px 20px rgba(20,25,50,.06); }
#agent-sel-count { font-weight: 700; color: var(--ink); }
#agent-modal .field { margin-bottom: 16px; }

/* Recent-niche chips (Bulk Designs) */
.agent-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 9px; }
.recent-lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.niche-chip { font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  cursor: pointer; transition: .12s; }
.niche-chip:hover { background: var(--primary-soft); border-color: #dcdcfb; color: var(--primary-2); }

.toast-warn { background: #c0392b; }

/* Gallery: delete image */
.card-tile .thumb { position: relative; }
.ct-del { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(20,25,50,.55); color: #fff; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: .12s; z-index: 2; }
.card-tile:hover .ct-del { opacity: 1; }
.ct-del:hover { background: var(--red-ink); }
.modal-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.modal-actions > .btn-primary, .modal-actions > .btn-ghost {
  padding: 10px 12px; font-size: 13px; white-space: nowrap; flex: 0 1 auto; min-width: 0; }

/* Reusable confirmation dialog */
.dialog-body { max-width: 380px; }
.dialog-body h3 { font-size: 18px; font-weight: 800; }
.dialog-msg { color: var(--ink-2); font-size: 14px; margin: 8px 0 20px; }
.btn-primary.danger { background: var(--red-ink); }
.btn-primary.danger:hover { background: #a5342a; }

/* Upload dropzones (mockup): click / drag-drop / paste */
.dropzone { display:block; position:relative; border:1.5px dashed var(--line); border-radius:var(--radius-sm);
  padding:28px 20px; text-align:center; cursor:pointer; transition:border-color .15s, background .15s; background:var(--surface); }
.dropzone:hover { border-color:#c7cbe0; background:#fbfbfe; }
.dropzone.dragging { border-color:var(--primary); background:var(--primary-soft); }
.dz-body { display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none; }
.dz-ico { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:50%;
  background:var(--primary-soft); color:var(--primary); margin-bottom:2px; transition:.15s; }
.dropzone:hover .dz-ico { background:#e5e7fd; }
.dropzone.dragging .dz-ico { background:#fff; transform:translateY(-2px); }
.dz-text { font-size:14px; font-weight:600; color:var(--ink); }
.dz-text b { color:var(--primary); font-weight:700; }
.dz-hint { font-size:12.5px; color:var(--ink-soft); }
.dz-preview { max-height:200px; max-width:100%; border-radius:10px; box-shadow:var(--shadow); }
.dz-preview[hidden] { display:none; }
.dropzone.has-file { padding:14px; border-style:solid; border-color:var(--line-2); background:var(--surface); }
.dz-clear { position:absolute; top:10px; right:10px; width:28px; height:28px; border:1px solid var(--line);
  border-radius:50%; background:var(--surface); color:var(--ink-2); cursor:pointer; align-items:center;
  justify-content:center; z-index:2; display:none; box-shadow:var(--shadow); transition:.12s; }
.dropzone.has-file .dz-clear { display:flex; }
.dz-clear:hover { border-color:var(--red-ink); color:var(--red-ink); }

/* ===================== POD: Stores / Suppliers / Products ===================== */
.nav-sep { height:1px; background:var(--line); margin:10px 12px; }
.pod-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
.pod-h1 { font-size:26px; font-weight:900; letter-spacing:-.5px; }
.pod-sub { color:var(--ink-soft); font-size:14.5px; margin-top:4px; }
.pod-lbl { display:block; font-size:12.5px; font-weight:700; color:var(--ink-2); margin:14px 0 6px; }
.pod-input { width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:10px; font:inherit; font-size:14px; background:var(--surface); }
.pod-input.price { max-width:160px; }
.pod-row2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.pod-check { display:flex; align-items:center; gap:8px; font-size:14px; margin:14px 0 4px; }
.pod-hint { font-size:12.5px; color:var(--ink-soft); margin-top:10px; }
.pod-inline-msg { font-size:13px; }
.pod-inline-msg.ok, .conn-badge.ok { color:var(--green); }
.pod-inline-msg.ok { background:var(--green-soft); padding:8px 12px; border-radius:8px; display:block; }
.pod-inline-msg.err { color:var(--red-ink); }
.pod-inline-msg.warn { color:var(--amber-ink); background:var(--amber-soft); padding:8px 12px; border-radius:8px; display:block; }
.pod-empty { text-align:center; padding:60px 20px; color:var(--ink-soft); }
.pod-empty p { margin-bottom:16px; font-size:15px; }

/* connections (Stores / Suppliers) */
.conn-list { display:flex; flex-direction:column; gap:16px; max-width:640px; }
.conn-card { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:22px; box-shadow:var(--shadow); }
.conn-name { font-size:17px; font-weight:800; display:flex; align-items:center; gap:10px; }
.conn-badge { font-size:11.5px; font-weight:700; padding:3px 9px; border-radius:999px; background:var(--line-2); color:var(--ink-soft); }
.conn-badge.ok { background:var(--green-soft); }
.conn-badge.warn { background:var(--amber-soft); color:var(--amber-ink); }
.conn-desc { color:var(--ink-2); font-size:14px; margin:10px 0 6px; }
.conn-actions { display:flex; gap:10px; align-items:center; margin-top:16px; flex-wrap:wrap; }
.conn-settings { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.conn-legal { font-size:11.5px; color:var(--ink-soft); max-width:640px; margin-top:18px; }

/* stores: connection card + setup guide side-by-side */
.stores-layout { display:grid; grid-template-columns:1fr 1fr; gap:24px; align-items:start; }
.stores-main { min-width:0; }
.stores-main .conn-list, .stores-main .conn-legal { max-width:none; }
.stores-help { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:20px; box-shadow:var(--shadow); position:sticky; top:20px; }
.sh-title { font-size:15px; font-weight:800; margin:0 0 6px; }
.sh-lead { font-size:13px; color:var(--ink-2); margin:0 0 16px; line-height:1.5; }
.sh-step { display:flex; gap:12px; margin-bottom:16px; }
.sh-num { flex:0 0 auto; width:24px; height:24px; border-radius:50%; background:var(--primary-soft); color:var(--primary-2); font-weight:800; font-size:13px; display:flex; align-items:center; justify-content:center; }
.sh-body h3 { font-size:14px; font-weight:700; margin:2px 0 6px; }
.sh-body p { font-size:12.5px; color:var(--ink-2); line-height:1.55; margin:0 0 8px; }
.sh-body ul { margin:0 0 8px; padding-left:16px; }
.sh-body li { font-size:12.5px; color:var(--ink-2); line-height:1.5; margin-bottom:4px; }
.sh-link { font-size:12.5px; font-weight:700; color:var(--primary-2); text-decoration:none; }
.sh-link:hover { text-decoration:underline; }
.sh-foot { font-size:12.5px; color:var(--ink-soft); line-height:1.5; margin:14px 0 0; padding-top:14px; border-top:1px solid var(--line); }

@media (max-width:860px){
  .stores-layout { grid-template-columns:1fr; }
  .stores-help { position:static; }
}

/* products grid */
.prod-filter { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.prod-filter:empty { display:none; }
.pfilter-chip { border:1.5px solid var(--line); background:var(--surface); color:var(--ink-2); font-size:13px; font-weight:600; padding:7px 14px; border-radius:999px; cursor:pointer; transition:.12s; }
.pfilter-chip:hover { border-color:#c7cbe0; }
.pfilter-chip.on { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-2); }
/* minimal product list: one product per row, full width */
.products-list { display:flex; flex-direction:column; gap:10px; width:100%; }
.prod-card.skel { padding:24px; color:var(--ink-soft); }
.prod-row { display:flex; align-items:center; gap:14px; padding:12px 14px; background:var(--surface); border:1px solid var(--line); border-radius:14px; transition:.14s; }
.prod-row:hover { border-color:#d4d8e6; box-shadow:0 6px 20px rgba(20,25,50,.06); }
.prow-thumb { position:relative; width:56px; height:56px; flex:0 0 auto; border-radius:11px; overflow:hidden; background:var(--bg2); display:flex; align-items:center; justify-content:center; border:1px solid var(--line-2); }
.prow-thumb img { width:100%; height:100%; object-fit:cover; }
.prow-thumb.zoom { cursor:zoom-in; }
.prow-zoom { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(20,25,50,.45); color:#fff; font-size:15px; opacity:0; transition:.12s; }
.prow-thumb.zoom:hover .prow-zoom { opacity:1; }
.prow-noimg { color:var(--ink-soft); font-size:18px; }
.prow-main { flex:1; min-width:0; }
.prow-title { display:block; width:100%; text-align:left; border:none; background:none; padding:0; font-family:inherit; font-weight:700; font-size:14px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.prow-title:hover { color:var(--primary); text-decoration:underline; }
.prow-sub { display:flex; align-items:center; gap:8px; margin-top:5px; font-size:12px; color:var(--ink-soft); min-width:0; }
.prow-type { font-weight:600; color:var(--ink-2); flex:0 0 auto; }
.prow-dot { color:var(--line-2); }
.prow-err { color:#d84a4a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.prod-status { font-size:10.5px; font-weight:700; letter-spacing:.02em; padding:3px 9px; border-radius:999px; background:var(--line-2); color:var(--ink-2); flex:0 0 auto; }
.prod-status.s-active { background:var(--green-soft); color:var(--green); }
.prod-status.s-pushed { background:var(--blue-soft, #e6effd); color:var(--blue, #2f6bff); }
.prod-status.s-error { background:#fdecec; color:#d84a4a; }
.prow-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.prow-btn { height:36px; padding:0 15px; border-radius:9px; font-size:13px; font-weight:600; white-space:nowrap; display:inline-flex; align-items:center; }
.prow-icon { width:36px; height:36px; flex:0 0 auto; border:1px solid var(--line); background:var(--surface); border-radius:9px; cursor:pointer; font-size:14px; line-height:1; transition:.12s; }
.prow-icon.danger:hover { background:#fdecec; border-color:#f3caca; }
@media (max-width:640px){
  .prod-row { flex-wrap:wrap; }
  .prow-actions { width:100%; }
  .prow-actions .prow-btn:not(.btn-primary) { flex:1; justify-content:center; }
}
.btn-ghost.sm { padding:6px 12px; font-size:12.5px; }
.btn-ghost.danger { color:var(--red-ink); }

/* builder wizard */
.builder-wrap { max-width:1080px; margin:0 auto; min-height:100vh; padding:28px 28px 100px; display:flex; flex-direction:column; }
.builder-cols { display:flex; gap:32px; align-items:flex-start; }
.builder-body { flex:1; min-width:0; }
.builder-rail { width:264px; flex-shrink:0; position:sticky; top:28px; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:16px; box-shadow:var(--shadow); }
.builder-stepbar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:26px; }
.bstep { display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:700; color:var(--ink-soft); padding:7px 14px 7px 8px; border-radius:999px; background:var(--line-2); font-family:inherit; border:none; }
.bstep-n { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:#fff; color:var(--ink-soft); font-size:11.5px; box-shadow:inset 0 0 0 1px var(--line); }
.bstep.on { background:var(--primary); color:#fff; }
.bstep.on .bstep-n { background:#fff; color:var(--primary); box-shadow:none; }
.bstep.done { background:var(--primary-soft); color:var(--primary-2); }
.bstep.done .bstep-n { background:var(--primary); color:#fff; box-shadow:none; }
.builder-stepbar .bstep.clk { cursor:pointer; }
.builder-stepbar .bstep.clk:hover:not(.on) { background:var(--line); color:var(--ink-2); }
.builder-stepbar .bstep:disabled { cursor:default; opacity:.65; }
.bstep-h { font-size:22px; font-weight:900; margin-bottom:6px; }
.bstep-sub { color:var(--ink-soft); font-size:14px; margin-bottom:18px; }
.builder-foot { position:fixed; bottom:0; left:0; right:0; background:var(--surface); border-top:1px solid var(--line); padding:14px 24px; display:flex; justify-content:space-between; align-items:center; gap:14px; z-index:5; }
.builder-foot .builder-msg { flex:1; text-align:center; font-size:13px; }
.builder-msg.err { color:var(--red-ink); }

/* rail */
.rail-hd { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-soft); margin-bottom:12px; }
.rail-preview { aspect-ratio:1; border-radius:12px; background:var(--line-2); display:flex; align-items:center; justify-content:center; overflow:hidden; margin-bottom:14px; }
.rail-preview img { width:100%; height:100%; object-fit:contain; }
.rail-ph { color:var(--ink-soft); font-size:12px; text-align:center; line-height:1.5; }
.rail-row { display:flex; justify-content:space-between; gap:10px; font-size:13px; padding:6px 0; border-bottom:1px solid var(--line-2); }
.rail-row span { color:var(--ink-soft); }
.rail-row b { color:var(--ink); font-weight:700; text-align:right; }
.rail-row.muted b { color:var(--ink-soft); font-weight:600; }
.rail-margin { margin-top:10px; font-size:12.5px; font-weight:700; color:var(--green); background:var(--green-soft); border-radius:9px; padding:8px 11px; }
.rail-margin span { font-weight:500; opacity:.85; }
.rail-margin.bad { color:var(--red-ink); background:var(--red-soft); }
.rail-ready { margin-top:14px; display:flex; flex-direction:column; gap:6px; }
.rd { font-size:12px; font-weight:600; }
.rd.ok { color:var(--green); }
.rd.off { color:var(--ink-soft); }

/* step 1: design */
.design-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:12px; margin-bottom:16px; }
.design-cell { aspect-ratio:1; border:2px solid var(--line); border-radius:12px; overflow:hidden; cursor:pointer; background:var(--line-2); transition:.12s; }
.design-cell:hover { border-color:#c7cbe0; }
.design-cell.on { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.design-cell img { width:100%; height:100%; object-fit:contain; }
.dropzone { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:26px; border:2px dashed var(--line); border-radius:14px; cursor:pointer; text-align:center; transition:.12s; }
.dropzone:hover, .dropzone.over { border-color:var(--primary); background:var(--primary-soft); }
.dz-ico { font-size:22px; color:var(--primary); }
.dz-txt { font-size:14px; font-weight:600; color:var(--ink-2); }
.dz-txt u { color:var(--primary); }
.dz-sub { font-size:12px; color:var(--ink-soft); }
.dpi-note { font-size:12.5px; font-weight:600; margin-top:12px; }
.dpi-note.ok { color:var(--green); }
.dpi-note.warn { color:var(--amber-ink); }

/* step 2: product cards + groups */
.prod-group { margin-bottom:24px; }
.prod-group-hd { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-soft); margin-bottom:12px; padding-bottom:8px; border-bottom:1px solid var(--line-2); }
.prodpick-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(168px,1fr)); gap:14px; }
.prodpick { border:1.5px solid var(--line); border-radius:14px; overflow:hidden; cursor:pointer; transition:.12s; background:var(--surface); display:flex; flex-direction:column; }
.prodpick:hover { border-color:#c7cbe0; box-shadow:var(--shadow); }
.prodpick.on { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.prodpick-img { position:relative; aspect-ratio:1; background:#fff; border-bottom:1px solid var(--line-2); display:flex; align-items:center; justify-content:center; padding:10px; }
.prodpick-img img { width:100%; height:100%; object-fit:contain; }
.prodpick-tick { position:absolute; top:8px; right:8px; width:22px; height:22px; border-radius:50%; background:var(--primary); color:#fff; font-size:12px; font-weight:900; display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow); }
.prodpick-body { padding:12px 14px 14px; display:flex; flex-direction:column; flex:1; }
.prodpick-name { font-weight:800; font-size:14.5px; }
.prodpick-blurb { font-size:12px; color:var(--ink-soft); margin-top:2px; }
.prodpick.locked { opacity:.4; cursor:not-allowed; }
.prodpick.locked:hover { border-color:var(--line); box-shadow:none; }
/* multi-style selection bar */
.ms-bar:empty { display:none; }
.ms-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:18px; padding:12px 14px; background:var(--primary-soft); border-radius:12px; }
.ms-count { font-size:12.5px; font-weight:800; color:var(--primary-2); }
.ms-chip { display:inline-flex; align-items:center; gap:5px; font-size:12.5px; font-weight:600; color:var(--ink); background:var(--surface); border-radius:999px; padding:5px 6px 5px 11px; box-shadow:var(--shadow); }
.ms-chip button { border:none; background:none; color:var(--ink-soft); cursor:pointer; font-size:14px; line-height:1; }
.ms-chip button:hover { color:var(--red-ink); }
.ms-hint { font-size:11.5px; color:var(--ink-soft); margin-left:2px; }
/* multi-style price ladder */
.ladder { display:flex; flex-direction:column; gap:10px; }
.ladder-row { border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.ladder-top { display:flex; align-items:center; gap:10px; }
.ladder-rank { width:24px; height:24px; border-radius:50%; background:var(--line-2); color:var(--ink-2); font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ladder-row:first-child .ladder-rank { background:var(--primary); color:#fff; }
.ladder-label { flex:1; font-weight:700; max-width:280px; }
.ladder-cost { font-size:12px; color:var(--ink-soft); white-space:nowrap; }
.ladder-collapse { border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); width:28px; height:28px; border-radius:8px; cursor:pointer; font-size:12px; flex-shrink:0; }
.ladder-collapse:hover { border-color:var(--primary); color:var(--primary); }
.ladder-mini { font-size:12.5px; color:var(--ink-soft); font-weight:600; margin-top:8px; }
.ladder-subhd { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:11.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); margin:14px 0 8px; }
.ladder-subtools { display:flex; gap:12px; }
.ladder-subhd .var-count { text-transform:none; letter-spacing:0; }
.ladder-colors { margin:0 0 4px; }
.ladder-colors .colorpick { padding:6px 10px; font-size:12px; }
.ladder-colors .cp-dot { width:15px; height:15px; }
.ladder-sizes { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 4px; }
.size-chip.sm { min-width:38px; padding:6px 10px; font-size:12.5px; }
.ladder-price { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ladder-price .price-input { max-width:120px; }
.ladder-price .price-input input { font-size:14px; padding:9px 11px 9px 4px; }
.ladder-profit { font-size:12.5px; font-weight:700; color:var(--green); }
.ladder-profit.bad { color:var(--red-ink); }
.ladder-szt { display:inline-block; margin-top:10px; }
.ladder-szwrap { margin-top:10px; padding-top:10px; border-top:1px dashed var(--line); }
.ladder-szwrap[hidden] { display:none; }
/* placement style-preview carousel (one model at a time, arrows) */
.place-preview-wrap { flex:1; min-width:260px; }
.place-carousel { display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:12px; }
.pcar-arrow { width:34px; height:34px; border-radius:50%; border:1.5px solid var(--line); background:var(--surface); color:var(--ink-2); font-size:18px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.pcar-arrow:hover { border-color:var(--primary); color:var(--primary); background:var(--primary-soft); }
.pcar-name { font-size:15px; font-weight:800; min-width:150px; text-align:center; }
.pcar-count { font-size:12.5px; color:var(--ink-soft); font-weight:700; text-align:center; margin-top:8px; }
.ms-anchor { display:block; font-size:12px; color:var(--primary-2); font-weight:600; margin-top:4px; }
.ms-combo { display:block; font-size:11.5px; color:var(--ink-soft); margin-top:2px; }
.ms-combo.bad { color:var(--red-ink); font-weight:700; }
.prodpick-cost { font-size:12px; font-weight:700; color:var(--ink-2); margin-top:6px; }
.prodpick-cost .pr-est { font-weight:500; color:var(--ink-soft); font-style:italic; }
.prodpick-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:auto; padding-top:12px; }
.prodpick-dots { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.pd-dot { width:13px; height:13px; border-radius:50%; border:1px solid rgba(0,0,0,.14); }
.pd-more { font-size:10.5px; color:var(--ink-soft); font-weight:600; }
.prodpick-meta { font-size:11.5px; color:var(--ink-soft); font-weight:600; white-space:nowrap; }

/* step 2: Design & Print (merged) */
.dp-layout { display:flex; gap:30px; align-items:flex-start; flex-wrap:wrap; }
.dp-left { flex:1; min-width:300px; }
.dp-right { flex:1; min-width:300px; position:sticky; top:8px; }
.dp-hd { font-size:13px; font-weight:800; color:var(--ink); margin:0 0 10px; text-transform:uppercase; letter-spacing:.03em; }
.dp-hd-mt { margin-top:22px; }
.dp-left .place-chips { margin-bottom:0; }
.dp-noimg { color:var(--ink-soft); font-size:13px; text-align:center; padding:48px 20px; border:1px dashed var(--line); border-radius:14px; }
/* design picker: selected card + two choose tiles (library / upload) */
.dp-selected { display:flex; align-items:center; gap:14px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.dp-sel-thumb { width:72px; height:72px; flex:0 0 auto; border-radius:10px; overflow:hidden; border:1px solid var(--line-2); background:#fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23cbd0e0' stroke-width='2'><rect x='4' y='4' width='16' height='16' rx='3'/><circle cx='9' cy='9' r='1.5'/><path d='M5 17l4-4 3 3 3-4 4 5'/></svg>") center/28px no-repeat; }
.dp-sel-thumb img { width:100%; height:100%; object-fit:contain; }
.dp-sel-thumb.broken img { display:none; }
.dp-sel-title { font-size:14px; font-weight:700; color:var(--ink); }
.dp-sel-actions { display:flex; align-items:center; gap:8px; margin-top:4px; }
.dp-sep { color:var(--line-2); }
.linkbtn.danger { color:#d84a4a; }
/* empty state: two stacked branded buttons + drag/drop hint */
.dp-actions { display:flex; flex-direction:column; gap:10px; }
.dp-btn { display:flex; align-items:center; justify-content:center; gap:9px; width:100%; height:48px; border-radius:12px; font:inherit; font-size:14.5px; font-weight:700; cursor:pointer; transition:.12s; border:1.5px solid transparent; }
.dp-btn-ic { font-size:17px; }
.dp-btn.primary { background:var(--primary); color:#fff; border-color:var(--primary); }
.dp-btn.primary:hover { background:var(--primary-600, #4338ca); box-shadow:0 6px 18px rgba(79,70,229,.28); }
.dp-btn.outline { background:var(--surface); color:var(--primary); border-color:var(--primary); }
.dp-btn.outline:hover, .dp-btn.outline.over { background:var(--primary-soft); }
.dp-btn.gen { background:linear-gradient(100deg,var(--primary),#7c6cf5); color:#fff; border-color:transparent; }
.dp-btn.gen:hover { box-shadow:0 8px 22px rgba(79,70,229,.32); transform:translateY(-1px); }
/* generate-a-design modal (hosts the shared DesignStudio) */
.dgen-card { background:var(--surface); border-radius:18px; width:min(980px,94vw); max-height:90vh; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 24px 70px rgba(20,25,50,.28); }
.dgen-head { display:flex; align-items:center; justify-content:space-between; padding:16px 22px; border-bottom:1px solid var(--line); }
.dgen-head h3 { margin:0; font-size:17px; }
.dgen-body { padding:20px 22px; overflow-y:auto; }
/* DesignStudio in picker mode: stack the form above the results (fits a modal) */
.ds-work.ds-picker { grid-template-columns:1fr; display:grid; gap:18px; }
.ds-work.ds-picker .results-panel { min-height:120px; }
.dp-drophint { text-align:center; font-size:12px; color:var(--ink-soft); margin-top:2px; }
#builder-next.disabled, #builder-next:disabled { opacity:.45; cursor:not-allowed; }
/* locked (unreachable) step tabs */
.bstep.locked { opacity:.5; cursor:not-allowed; }
.bstep.locked:hover { background:none; }
/* summary rail: hide a broken design thumbnail (self-heals once the empty state clears it) */
.rail-preview.broken img { display:none; }
.rail-preview.broken::after { content:"Your design appears here"; color:var(--ink-soft); font-size:12px; text-align:center; padding:0 12px; }
.rail-preview.broken { display:flex; align-items:center; justify-content:center; }
.print-tabs { display:inline-flex; gap:4px; padding:4px; background:var(--line-2); border-radius:12px; margin-bottom:18px; }
.print-tab { border:none; background:none; font:inherit; font-size:13.5px; font-weight:700; color:var(--ink-soft); padding:8px 18px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.print-tab.on { background:var(--surface); color:var(--ink); box-shadow:var(--shadow); }
.pt-dot { color:var(--green); font-size:10px; }
.back-empty { border:1px dashed var(--line); border-radius:14px; padding:26px; text-align:center; }
.back-empty .bstep-sub { margin-bottom:14px; }
.back-remove { display:inline-block; margin-top:12px; color:var(--red-ink); }
/* step 3: placement */
.place-chips, .pick-chips { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.pick-chip { padding:9px 15px; border:1.5px solid var(--line); border-radius:999px; background:var(--surface); cursor:pointer; font-size:13.5px; font-weight:600; }
.pick-chip.on { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-2); }
.place-layout { display:flex; gap:26px; align-items:flex-start; flex-wrap:wrap; }
.place-chips.vertical { display:flex; flex-direction:column; gap:10px; flex-shrink:0; width:170px; margin:0; }
.place-chip { display:flex; align-items:center; gap:10px; padding:8px 12px; border:1.5px solid var(--line); border-radius:12px; background:var(--surface); cursor:pointer; font-size:13.5px; font-weight:600; text-align:left; transition:.12s; }
.place-chip:hover { border-color:#c7cbe0; }
.place-chip.on { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-2); }
.pc-thumb { width:34px; height:34px; object-fit:contain; background:#fff; border-radius:7px; flex-shrink:0; border:1px solid var(--line-2); }
.place-preview { flex:1; min-width:260px; text-align:center; }
.place-preview img { max-width:100%; max-height:400px; border-radius:12px; }
.place-note { font-size:12px; color:var(--ink-soft); margin-top:8px; }
.place-card { display:inline-block; background:#fff; border:1px solid var(--line); border-radius:16px; padding:22px; box-shadow:var(--shadow); }
.place-card img { max-width:100%; max-height:360px; display:block; }
.place-preview.solo { text-align:center; }
.place-preview.solo .place-card img { max-height:320px; }

/* step 4: variants - clean sectioned layout */
.vsec { padding:16px 0; border-top:1px solid var(--line-2); }
.vsec:first-child { border-top:none; padding-top:4px; }
.vsec-hd { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.vsec-title { font-size:14px; font-weight:800; color:var(--ink); }
.vsec-tools { display:flex; align-items:center; gap:14px; }
.var-count { font-size:12px; color:var(--ink-soft); font-weight:600; margin-left:6px; }
.linkbtn { border:none; background:none; color:var(--primary); font-size:12.5px; font-weight:700; cursor:pointer; padding:0; }
.linkbtn:hover { text-decoration:underline; }
/* labeled color chips (dot + name + selected state) */
.colorpick-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(128px,1fr)); gap:8px; }
.colorpick { display:flex; align-items:center; gap:9px; padding:8px 12px; border:1.5px solid var(--line); border-radius:10px; background:var(--surface); cursor:pointer; font-size:13px; font-weight:600; color:var(--ink-2); transition:.12s; text-align:left; }
.colorpick:hover { border-color:#c7cbe0; }
.colorpick.on { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-2); }
.cp-dot { width:18px; height:18px; border-radius:50%; flex-shrink:0; border:1px solid rgba(0,0,0,.16); position:relative; }
.colorpick.on .cp-dot::after { content:"✓"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:11px; font-weight:900; text-shadow:0 0 3px rgba(0,0,0,.8); }
.cp-name { flex:1; }
.size-grid { display:flex; flex-wrap:wrap; gap:8px; }
.size-chip { min-width:48px; padding:9px 15px; border:1.5px solid var(--line); border-radius:9px; background:var(--surface); cursor:pointer; font-size:13.5px; font-weight:700; color:var(--ink-2); text-align:center; transition:.12s; }
.size-chip:hover { border-color:#c7cbe0; }
.size-chip.on { border-color:var(--primary); background:var(--primary); color:#fff; }
/* price input with $ affix + prominent profit readout */
.price-row { display:flex; align-items:center; gap:10px; }
.price-input { display:flex; align-items:center; border:1.5px solid var(--line); border-radius:10px; background:var(--surface); overflow:hidden; max-width:150px; }
.price-input:focus-within { border-color:var(--primary); }
.price-cur { padding:0 4px 0 13px; color:var(--ink-soft); font-weight:700; }
.price-input input { border:none; outline:none; padding:11px 13px 11px 4px; font:inherit; font-size:16px; font-weight:700; width:100%; background:transparent; }
.profit-readout { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; margin-top:14px; padding:12px 15px; border-radius:12px; background:var(--line-2); }
.profit-readout .pr-lead { font-size:12.5px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.03em; }
.profit-readout b { font-size:20px; font-weight:900; color:var(--ink); }
.profit-readout .pr-sub { font-size:12.5px; color:var(--ink-soft); }
.profit-readout.good { background:var(--green-soft); }
.profit-readout.good b { color:var(--green); }
.profit-readout.bad { background:var(--red-soft); }
.profit-readout.bad b { color:var(--red-ink); }
.pr-est { font-style:italic; }
.cost-note { font-size:12px; color:var(--ink-soft); margin-top:8px; }
.cost-note b { color:var(--ink-2); }
.cost-note .pr-est { color:var(--ink-soft); }
.sizeprice-toggle { display:inline-block; margin-top:12px; }
.sizeprice-wrap { margin-top:12px; border:1px solid var(--line); border-radius:12px; padding:14px 16px; background:var(--surface); }
.sizeprice-note { font-size:12.5px; color:var(--ink-soft); margin:0 0 12px; }
.sizeprice-tools { display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.sp-row { display:flex; align-items:center; gap:12px; padding:6px 0; }
.sp-size { width:52px; font-weight:700; font-size:13.5px; color:var(--ink-2); }
.sp-price { max-width:120px; color:var(--ink-soft); }
.sp-price.custom { color:var(--ink); font-weight:700; border-color:var(--primary); }
.sp-cost { font-size:12px; color:var(--ink-soft); }
.sp-clear { font-size:12px; }
.sp-inherit { font-size:11.5px; color:var(--ink-soft); font-style:italic; }
/* professional per-size price table (always visible) */
.sptable-wrap { margin-top:16px; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.sptable-hd { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; background:var(--line-2); }
.sptable-title { font-size:13px; font-weight:800; color:var(--ink); }
.sptable-tools { display:flex; gap:14px; }
.sptable-note { font-size:12px; color:var(--ink-soft); margin:0; padding:10px 14px 4px; }
.sptable { width:100%; border-collapse:collapse; font-size:13.5px; }
.sptable thead th { text-align:left; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); padding:8px 14px; border-bottom:1px solid var(--line); }
.sptable tbody td { padding:8px 14px; border-bottom:1px solid var(--line-2); vertical-align:middle; }
.sptable tbody tr:last-child td { border-bottom:none; }
.sptable tbody tr.over { background:var(--primary-soft); }
.spt-size { font-weight:700; color:var(--ink-2); white-space:nowrap; }
.spt-tag { font-size:10px; font-weight:700; color:var(--primary-2); background:var(--surface); border-radius:5px; padding:1px 6px; margin-left:4px; }
.spt-price { display:flex; align-items:center; gap:2px; }
.spt-cur { color:var(--ink-soft); font-weight:700; }
.spt-price .sp-price { max-width:96px; padding:7px 9px; border:1.5px solid var(--line); border-radius:8px; font:inherit; font-size:13.5px; background:var(--surface); }
.spt-cost { color:var(--ink-soft); white-space:nowrap; }
.spt-profit { font-weight:700; color:var(--green); white-space:nowrap; }
.spt-profit.bad { color:var(--red-ink); }
.spt-act { text-align:right; }
.spt-empty { padding:14px; color:var(--ink-soft); font-size:13px; }
/* placement preview: dim while the next image preloads (kills the text/blank flash) */
.place-preview.loading { opacity:.45; transition:opacity .15s; }
.var-summary { margin-top:14px; font-size:14px; color:var(--ink-2); background:var(--line-2); border-radius:10px; padding:11px 14px; }
.var-summary b { color:var(--ink); }
.var-summary .err { color:var(--red-ink); }

/* step 5: listing */
.tagbox { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.tag-chip { display:inline-flex; align-items:center; gap:5px; font-size:12.5px; font-weight:600; color:var(--primary-2); background:var(--primary-soft); border-radius:7px; padding:5px 6px 5px 10px; }
.tag-chip.bad { color:var(--red-ink); background:var(--red-soft); }
.tag-chip button { border:none; background:none; color:inherit; cursor:pointer; font-size:14px; line-height:1; opacity:.6; }
.tag-chip button:hover { opacity:1; }
.bl-actions { margin:10px 0 18px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.bl-hint { flex:1; min-width:220px; max-width:420px; font-size:13px; }
.photo-empty { border:1.5px dashed var(--line); border-radius:14px; padding:22px; text-align:center; }
.photo-empty .bstep-sub { margin-bottom:14px; }
.photo-hint { margin-bottom:12px; }
.photo-hint.ok { color:var(--green); font-weight:600; }
.lp-grid { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-start; }
/* listing photo lightbox */
/* the credit-confirm dialog is a modal-over-modal, so it must sit above every other modal */
#confirm-modal { z-index:600; }
.lightbox { position:fixed; inset:0; z-index:400; background:rgba(15,18,32,.82); display:flex; align-items:center; justify-content:center; padding:40px; }
.lightbox.hidden { display:none; }
.lightbox img { max-width:92vw; max-height:88vh; border-radius:10px; box-shadow:var(--shadow-lg); background:#fff; }
.lightbox-x { position:absolute; top:20px; right:24px; width:40px; height:40px; border-radius:50%; border:none; background:rgba(255,255,255,.9); color:var(--ink); font-size:18px; font-weight:700; cursor:pointer; }
/* dashed "add photo" tiles that match the photo cells */
.lp-add { width:128px; height:128px; border:1.5px dashed var(--line); border-radius:10px; background:var(--surface);
  cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px;
  color:var(--ink-soft); font-size:12.5px; font-weight:700; transition:.12s; font-family:inherit; }
.lp-add:hover { border-color:var(--primary); color:var(--primary-2); background:var(--primary-soft); }
.lp-add-ico { font-size:22px; line-height:1; }
/* library picker modal */
.lib-card { background:var(--surface); border-radius:18px; width:min(680px,92vw); max-height:82vh; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 24px 70px rgba(20,25,50,.28); }
.lib-head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); }
.lib-head h3 { margin:0; font-size:17px; }
.lib-x { border:none; background:var(--line-2); color:var(--ink-2); width:30px; height:30px; border-radius:50%; font-size:14px; cursor:pointer; transition:.12s; }
.lib-x:hover { background:#e6435a; color:#fff; }
.lib-scroll { padding:18px 22px; overflow-y:auto; }
.lib-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(116px,1fr)); gap:12px; }
.lib-cell { position:relative; aspect-ratio:1; border:2px solid var(--line); border-radius:12px; overflow:hidden; cursor:pointer; padding:0; background:#fff; transition:.12s; }
.lib-cell:hover { border-color:#c7cbe0; transform:translateY(-1px); }
.lib-cell img { width:100%; height:100%; object-fit:cover; }
.lib-cell.broken { background:#f6f7fb url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' fill='none' stroke='%23c2c8da' stroke-width='2'><rect x='4' y='4' width='22' height='22' rx='4'/><circle cx='11' cy='11' r='2'/><path d='M6 22l6-6 4 4 4-5 4 6'/></svg>") center/34px no-repeat; }
.lib-cell.on { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.lib-check { position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%; background:var(--primary); color:#fff; font-size:12px; font-weight:900; display:none; align-items:center; justify-content:center; }
.lib-cell.on .lib-check { display:flex; }
.lib-empty { text-align:center; padding:40px 20px; }
.lib-empty-ico { font-size:40px; margin-bottom:10px; }
.lib-empty p { margin:4px 0; }
/* mockup library picker (confirm-body variant): scroll the grid, pin header + actions */
.lib-body { max-width:min(720px,92vw); max-height:85vh; display:flex; flex-direction:column; }
.lib-body > h3 { flex:0 0 auto; margin:0 0 14px; }
.lib-body > .lib-grid { flex:1 1 auto; min-height:0; overflow-y:auto; margin:0 -4px; padding:2px 4px; }
.lib-body > .bstep-sub { flex:0 0 auto; }
.lib-body > .confirm-actions { flex:0 0 auto; margin-top:16px; }
/* masonry: each mockup keeps its own aspect ratio, reserved up-front (no reflow) */
.lib-body > .lib-grid { display:block; column-width:150px; column-gap:12px; }
.lib-body > .lib-grid .lib-cell { width:100%; margin:0 0 12px; break-inside:avoid; }
.lib-body > .lib-grid .lib-cell img { width:100%; height:100%; object-fit:cover; display:block; }
.lbl-count { font-weight:400; color:var(--ink-soft); font-size:12px; }
.listing-photos { display:flex; gap:12px; flex-wrap:wrap; }
.lp-cell { position:relative; width:128px; }
.lp-cell img { width:128px; height:128px; object-fit:cover; border-radius:10px; border:1px solid var(--line); }
.lp-cell.lp-drag { cursor:grab; }
.lp-cell.lp-drag:active { cursor:grabbing; }
.lp-cell.dragging { opacity:.4; }
.lp-cell.drop-over img { outline:2px dashed var(--primary); outline-offset:2px; }
.lp-rank { position:absolute; top:6px; left:6px; background:rgba(20,25,50,.75); color:#fff; font-size:10px; font-weight:700; padding:2px 7px; border-radius:6px; }
/* pending (generating) placeholder tile */
.lp-pending { width:128px; height:128px; border-radius:10px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  border:1px solid var(--line); background:linear-gradient(100deg,#eef0f6 30%,#f7f8fc 50%,#eef0f6 70%); background-size:220% 100%; animation:ll-sh 1.2s ease-in-out infinite; }
.lp-spin { width:26px; height:26px; border-radius:50%; border:3px solid var(--primary-soft); border-top-color:var(--primary); animation:ll-rot .8s linear infinite; }
.lp-pend-txt { font-size:11px; font-weight:600; color:var(--ink-soft); }
.sc-cell { border:1px dashed var(--line); }
.sc-cell img { object-fit:contain; background:#fff; }
.sc-rank { background:var(--primary); }
.sc-toggle { display:flex; align-items:center; gap:8px; margin:12px 0 4px; font-size:13px; color:var(--ink-2); cursor:pointer; }
.sc-toggle input { width:16px; height:16px; }
.lp-ctrls { position:absolute; bottom:6px; left:6px; right:6px; display:flex; gap:5px; justify-content:center; opacity:0; transition:.12s; }
.lp-cell:hover .lp-ctrls { opacity:1; }
.lp-ctrls button { border:none; background:var(--surface); box-shadow:var(--shadow); width:28px; height:28px; border-radius:7px; cursor:pointer; font-size:13px; }
.lp-ctrls button:hover { background:var(--primary-soft); }
.recap { margin-top:22px; border:1px solid var(--line); border-radius:14px; padding:16px 18px; background:var(--surface); }
.recap-hd { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-soft); margin-bottom:12px; }
.recap-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.recap-grid > div { font-size:14px; font-weight:700; color:var(--ink); }
.recap-grid span { display:block; font-size:11px; font-weight:600; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.04em; margin-bottom:2px; }
.recap-issues { margin:14px 0 0; padding:0 0 0 2px; list-style:none; display:flex; flex-direction:column; gap:5px; }
.recap-issues li { font-size:12.5px; color:var(--amber-ink); }
.recap-ok { margin-top:14px; font-size:13px; font-weight:600; color:var(--green); }

/* post-save success */
.save-done { text-align:center; max-width:520px; margin:40px auto; padding:0 16px; }
.sd-badge { width:64px; height:64px; border-radius:50%; background:var(--green-soft); color:var(--green); display:flex; align-items:center; justify-content:center; margin:0 auto 18px; animation:sd-pop .35s cubic-bezier(.2,.8,.3,1.2); }
@keyframes sd-pop { from { transform:scale(.4); opacity:0; } to { transform:scale(1); opacity:1; } }
.sd-title { font-size:24px; font-weight:800; letter-spacing:-.01em; margin:0 0 6px; }
.sd-sub { font-size:14px; color:var(--ink-soft); margin:0 0 24px; }
/* product card */
.sd-card { display:flex; align-items:center; gap:18px; text-align:left; padding:16px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:0 8px 30px rgba(20,25,50,.06); }
.sd-cover { width:112px; height:112px; flex:0 0 auto; border-radius:12px; overflow:hidden; border:1px solid var(--line-2); background:#fff; }
.sd-cover img { width:100%; height:100%; object-fit:cover; }
.sd-info { min-width:0; flex:1; }
.sd-name { font-size:14.5px; font-weight:700; color:var(--ink); line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sd-meta { display:flex; flex-wrap:wrap; gap:6px 8px; margin-top:8px; }
.sd-meta span { font-size:12px; font-weight:600; color:var(--ink-2); background:var(--bg); border:1px solid var(--line); padding:3px 9px; border-radius:20px; }
.sd-conns { display:flex; flex-wrap:wrap; gap:14px; margin-top:12px; }
.sd-conn { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; color:var(--ink-soft); }
.sd-dot { width:8px; height:8px; border-radius:50%; background:#c4c8d6; flex:0 0 auto; }
.sd-dot.ok { background:var(--green); }
/* actions */
.sd-actions { display:flex; flex-direction:column; gap:12px; margin:24px auto 0; max-width:360px; }
.sd-primary { width:100%; height:48px; font-size:15px; }
.sd-sec { display:flex; gap:10px; }
.sd-sec .btn-ghost { flex:1; height:42px; }
.sd-hint { font-size:12px; color:var(--ink-soft); margin:18px auto 0; max-width:400px; }
@media (max-width:520px){ .sd-card { flex-direction:column; text-align:center; } .sd-meta, .sd-conns { justify-content:center; } }

/* skeletons */
.sk { background:linear-gradient(90deg,var(--line-2) 25%,var(--line) 37%,var(--line-2) 63%); background-size:400% 100%; animation:skl 1.3s ease infinite; border-radius:8px; }
@keyframes skl { 0%{background-position:100% 0} 100%{background-position:-100% 0} }
.sk-cell { aspect-ratio:1; border-radius:12px; }
.design-grid .sk-cell { display:block; }
.sk-card { width:320px; height:320px; margin:0 auto; border-radius:16px; }
.sk-line { height:14px; margin-bottom:10px; }
.sk-line.w60 { width:60%; } .sk-line.w80 { width:80%; }
#pod-toast.toast { opacity:0; transition:opacity .2s; pointer-events:none; }
#pod-toast.toast.show { opacity:1; }
#pod-toast.toast-err { background:var(--red-ink); }
.disabled, .btn-primary.disabled { opacity:.5; pointer-events:none; }
.life-body { max-width: 540px; position: relative; }
.life-src { text-align:center; margin:6px 0 14px; }
.life-src img { max-height:150px; border-radius:10px; border:1px solid var(--line); }
.life-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
#life-colors, #life-types { margin:6px 0 14px; }
/* product-type chips (multi-style listings) */
.life-src { display:flex; align-items:center; justify-content:center; width:100%; height:200px; margin-bottom:16px;
  background:var(--bg2); border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.life-src img { max-width:100%; max-height:100%; object-fit:contain; }
.life-src.loading { opacity:.55; }
.life-src-ph { font-size:13px; color:var(--ink-soft); }
.ptype-grid { display:flex; flex-wrap:wrap; gap:8px; }
.ptype-chip { position:relative; display:flex; align-items:center; gap:8px; padding:7px 12px 7px 8px; border:1.5px solid var(--line); border-radius:11px; background:var(--surface); cursor:pointer; font:inherit; font-size:13px; font-weight:600; color:var(--ink-2); transition:.12s; }
.ptype-chip img { width:26px; height:26px; object-fit:contain; border-radius:6px; background:#fff; border:1px solid var(--line-2); }
.ptype-chip:hover { border-color:#c7cbe0; }
.ptype-chip.on { border-color:var(--primary); background:var(--primary-soft); color:var(--ink); }
.ptype-check { display:none; color:var(--primary); font-weight:900; font-size:12px; }
.ptype-chip.on .ptype-check { display:inline; }
/* color swatches: real color dot + name + check state */
.csw-grid { display:flex; flex-wrap:wrap; gap:8px; }
.csw { position:relative; display:flex; align-items:center; gap:8px; padding:6px 11px 6px 8px; border:1.5px solid var(--line); border-radius:20px; background:var(--surface); cursor:pointer; font:inherit; font-size:12.5px; font-weight:600; color:var(--ink-2); transition:.12s; }
.csw:hover { border-color:#c7cbe0; }
.csw-dot { width:18px; height:18px; border-radius:50%; background:var(--sw); border:1px solid rgba(0,0,0,.15); flex:0 0 auto; }
.csw-name { line-height:1; }
.csw-check { display:none; color:var(--primary); font-weight:900; font-size:11px; }
.csw.on { border-color:var(--primary); background:var(--primary-soft); color:var(--ink); }
.csw.on .csw-check { display:inline; }
.life-confirm { margin-top:14px; padding:14px 16px; border:1px solid var(--primary-soft); background:var(--primary-soft); border-radius:12px; }
.life-confirm.hidden { display:none; }
.life-confirm-txt { font-size:13.5px; color:var(--ink); margin:0 0 12px; }
#life-actbar.hidden { display:none; }
#life-setup.hidden { display:none; }
/* builder close guard */
.bclose-card { max-width:420px; text-align:left; }
.bclose-card h3 { margin:0 0 6px; }
.bclose-acts { display:flex; align-items:center; gap:10px; margin-top:18px; }
.bclose-acts .btn-primary { margin-left:auto; }
.bclose-acts .linkbtn.danger { color:#d84a4a; }
/* lifestyle generation: professional loading state */
.life-loading { display:flex; flex-direction:column; align-items:center; text-align:center; padding:24px 8px 10px; }
.life-loading.hidden { display:none; }
.ll-spin { width:46px; height:46px; border-radius:50%; border:4px solid var(--primary-soft); border-top-color:var(--primary); animation:ll-rot .8s linear infinite; margin-bottom:16px; }
@keyframes ll-rot { to { transform:rotate(360deg); } }
.ll-title { font-size:17px; font-weight:800; color:var(--ink); }
.ll-sub { font-size:13px; color:var(--ink-soft); margin-top:5px; min-height:18px; }
.ll-bar { width:100%; max-width:320px; height:7px; border-radius:99px; background:var(--line-2); overflow:hidden; margin:16px 0 4px; }
.ll-bar-fill { height:100%; width:0; border-radius:99px; background:linear-gradient(90deg,var(--primary),#7c6cf5); transition:width .4s ease; }
.ll-tiles { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin:18px 0 8px; }
.ll-tile { width:64px; height:64px; border-radius:12px; background:var(--line-2); overflow:hidden; position:relative; }
.ll-tile.shimmer { background:linear-gradient(100deg,#eef0f6 30%,#f7f8fc 50%,#eef0f6 70%); background-size:220% 100%; animation:ll-sh 1.2s ease-in-out infinite; }
@keyframes ll-sh { to { background-position:-220% 0; } }
.ll-tile.done img { width:100%; height:100%; object-fit:cover; animation:ll-fade .35s ease; }
@keyframes ll-fade { from { opacity:0; transform:scale(.96); } to { opacity:1; transform:none; } }
.ll-tile.failed { background:#fbe9e9; }
.ll-tile.failed::after { content:"✕"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#d84a4a; font-weight:800; }
.ll-note { font-size:12px; color:var(--ink-soft); margin-top:10px; max-width:340px; }
.pay-x { position:absolute; top:16px; right:18px; border:none; background:var(--bg); color:var(--ink-soft); width:30px; height:30px; border-radius:8px; cursor:pointer; font-weight:700; }
.pay-x:hover { background:var(--line); color:var(--ink); }
.prod-err { font-size:11.5px; color:var(--red-ink); padding:6px 14px 12px; }
/* orders: minimal table-like rows */
.orders-list { display:flex; flex-direction:column; gap:8px; width:100%; }
.orders-head, .order-row { display:grid; grid-template-columns:94px 84px 1.3fr 1.4fr 1.05fr 82px 104px 14px; align-items:center; gap:12px; }
.orders-head { padding:2px 16px 10px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); }
.orders-head.hidden { display:none; }
.order-row { width:100%; text-align:left; padding:14px 16px; background:var(--surface); border:1px solid var(--line); border-radius:12px; cursor:pointer; font:inherit; transition:.14s; }
.order-row:hover { border-color:#d4d8e6; box-shadow:0 6px 20px rgba(20,25,50,.06); }
.order-row.skel { display:block; color:var(--ink-soft); cursor:default; }
.oc { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13.5px; color:var(--ink-2); }
.oc-id { font-weight:700; font-size:13px; color:var(--ink); }
.oc-date { color:var(--ink-soft); font-size:13px; }
.oc-name { font-weight:600; color:var(--ink); }
.oc-sku { color:var(--ink-soft); font-family:ui-monospace,SFMono-Regular,monospace; font-size:12px; }
.oc-total { font-weight:700; color:var(--ink); text-align:right; }
.orders-head .oc-total { font-weight:700; color:var(--ink-soft); }
.oc-status { overflow:visible; }
.orow-chev { color:var(--ink-soft); font-size:20px; line-height:1; text-align:center; }
@media (max-width:760px){
  .orders-head { display:none; }
  .order-row { grid-template-columns:1fr auto; gap:4px 12px; }
  .oc-id { grid-column:1; }
  .oc-status { grid-column:2; grid-row:1 / span 2; align-self:center; }
  .oc-name { grid-column:1; }
  .oc-prod { grid-column:1; }
  .oc-total { grid-column:1; text-align:left; font-size:13px; }
  .oc-date, .oc-sku, .orow-chev { display:none; }
}

.order-status { font-size:11.5px; font-weight:700; padding:3px 10px; border-radius:999px; background:var(--line-2); color:var(--ink-soft); white-space:nowrap; }
.order-status.os-held { background:var(--amber-soft); color:var(--amber-ink); }
.order-status.os-submitted { background:var(--blue-soft); color:var(--blue); }
.order-status.os-shipped { background:var(--green-soft); color:var(--green); }
.order-status.os-error { background:var(--red-soft); color:var(--red-ink); }

/* order detail modal */
.order-detail { max-width:520px; width:100%; text-align:left; }
.od-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin:0 0 4px; padding-right:38px; }
.od-head h3 { margin:0; font-size:18px; }
.od-date { font-size:12.5px; color:var(--ink-soft); }
.od-sec { padding:14px 0; border-top:1px solid var(--line); }
.od-lbl { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); margin-bottom:8px; }
.od-name { font-weight:700; font-size:14px; }
.od-addr { font-size:13.5px; color:var(--ink-2); line-height:1.55; margin-top:2px; }
.od-muted { color:var(--ink-soft); }
.od-item { display:flex; align-items:center; gap:12px; padding:7px 0; }
.od-thumb { flex:0 0 auto; width:44px; height:44px; border-radius:9px; object-fit:cover; background:var(--bg2); border:1px solid var(--line-2); display:flex; align-items:center; justify-content:center; font-size:16px; }
.od-thumb.ph.no { color:var(--red-ink); }
.od-it-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.od-it-main b { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.od-it-sub { font-size:12.5px; color:var(--ink-soft); }
.od-item.no .od-it-main b { color:var(--ink-2); font-weight:600; }
.od-it-qty { font-size:13px; color:var(--ink-2); font-weight:600; }
.od-it-sku { font-size:11.5px; color:var(--ink-soft); font-family:ui-monospace,SFMono-Regular,monospace; }
.od-it-price { font-size:13px; font-weight:600; color:var(--ink); text-align:right; white-space:nowrap; }
.od-totals { margin-top:8px; padding-top:12px; border-top:1px dashed var(--line); }
.od-row2 { display:flex; justify-content:space-between; gap:12px; font-size:13.5px; padding:3px 0; }
.od-row2 span { color:var(--ink-soft); }
.od-rev b { color:var(--green); }
.od-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }

/* styled confirm modal (replaces native confirm) */
#pod-confirm { z-index:700; }
.pod-confirm-card { max-width:400px; }
.pod-confirm-card h3 { margin:0 0 8px; font-size:17px; }
.pc-msg { font-size:14px; color:var(--ink-2); line-height:1.55; margin:0 0 20px; }
.btn-primary.danger { background:var(--red-ink); }
.btn-primary.danger:hover { background:#c5364a; }
.prow-pushed { font-size:13px; font-weight:700; color:var(--green); white-space:nowrap; padding:0 4px; }

/* builder: responsive — stack layouts on narrow screens */
@media (max-width:860px) {
  .builder-wrap { padding:22px 18px 96px; }
  .builder-cols { flex-direction:column; gap:22px; }
  .builder-rail { width:100%; position:static; }          /* summary stacks below the step */
  .dp-layout { flex-direction:column; gap:22px; }
  .dp-left, .dp-right { width:100%; min-width:0; }
  .dp-right { position:static; order:2; }
  .place-layout { flex-direction:column; }
  .place-preview-wrap { min-width:0; }
  .place-chips.vertical { width:100%; flex-direction:row; flex-wrap:wrap; }
  .recap-grid { grid-template-columns:repeat(2,1fr); }
  .life-grid { grid-template-columns:1fr; }
}
@media (max-width:600px) {
  .builder-wrap { padding:16px 14px 92px; }
  .pm-close { top:12px; right:12px; }
  .builder-stepbar { gap:6px; margin-bottom:16px; }
  .bstep { font-size:12px; padding:6px 11px 6px 7px; }
  .bstep-n { width:18px; height:18px; font-size:11px; }
  .bstep-h { font-size:19px; }
  .bstep-sub { font-size:13px; }
  .builder-foot { padding:11px 14px; gap:8px; }
  .builder-foot .builder-msg { display:none; }             /* free up room for Back/Next */
  .prodpick-grid { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
  .recap-grid { grid-template-columns:1fr; }
  .modal { padding:14px; align-items:flex-end; }            /* sheet-style on phones */
  .life-body, .lib-card, .bclose-card, .confirm-body { width:100%; max-width:100%; }
  .print-tabs { width:100%; }
  .print-tab { flex:1; text-align:center; }
  /* keep the price-per-size table INSIDE the column (never widen the whole step) */
  .builder-body, .builder-cols, #bvm-body, .vsec, #ms-ladder, .ladder-row, .sptable-wrap { min-width:0; max-width:100%; }
  .sptable-wrap { overflow-x:auto; }
  .sptable { font-size:11.5px; }
  .sptable th, .sptable td { padding:7px 5px; }
  .sptable .sp-price { width:64px; }
  .colorpick-grid { grid-template-columns:repeat(auto-fill,minmax(108px,1fr)); }
  .save-done { margin:24px auto; }
  .sd-sec { flex-direction:column; }
}

/* ---- Image to Video --------------------------------------------------------- */
#modal-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
#modal-video.hidden { display: none; }   /* beat the id selector's display:block */
.tile-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 42px; height: 42px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; pointer-events: none; }
.tile-vid { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: var(--line-2); }
.video-sheet.hidden { display: none; }
/* header with a back (✕) that restores the prompt/details view */
.vs-head { margin-bottom: 16px; }
.vs-title { font-weight: 800; font-size: 15.5px; color: var(--ink); }
.vs-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }
/* options reuse the site-standard styled dropdown (engine picker); only tighter
   field spacing is overridden here. */
.video-sheet .field { margin-bottom: 14px; }
/* cta + states */
.vs-cta { width: 100%; margin-top: 6px; }
.vs-foot { font-size: 11.5px; color: var(--ink-soft); text-align: center; margin-top: 9px; }
.vs-msg { font-size: 13px; margin-top: 8px; }
.vs-msg.err, .vs-msg .err { color: var(--red-ink); }
.vs-render { display: flex; align-items: flex-start; gap: 11px; padding: 6px 2px; }
.vs-render-t { font-weight: 700; font-size: 14px; color: var(--ink); }
.vs-render-s { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.45; }
.vs-done { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.vs-done-h { font-weight: 800; font-size: 16px; color: var(--green); }
.vs-video { display: block; max-width: 100%; max-height: 56vh; margin: 0 auto; border-radius: 12px; background: #000; }
.vs-done-actions { width: 100%; max-width: 340px; }
.vs-done-actions .btn-primary { width: 100%; }
.vs-tip { font-size: 12px; color: var(--ink-soft); line-height: 1.5; max-width: 420px; }
/* focused result layout: hide the source image, center the video in one column */
.modal-body.video-result { grid-template-columns: 1fr; max-width: 600px; min-height: auto; }
.modal-body.video-result .modal-img-wrap { display: none; }
.modal-body.video-result .modal-meta { padding-top: 6px; }
.vs-render { align-items: center; text-align: left; padding: 28px 6px; }
.vs-lock { display: flex; gap: 11px; align-items: center; }
.vs-lock-ico { font-size: 20px; }
.vs-lock-t { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.vs-lock a { color: var(--primary); font-weight: 700; font-size: 13px; }

/* ---- Product Video page ----------------------------------------------------- */
.vst-tabs { margin-bottom: 12px; }
.vst-source { min-height: 40px; }
.vst-picked { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.vst-picked img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: var(--line-2); }
.vst-picked .vst-change { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  padding: 7px 14px; font-size: 13px; box-shadow: var(--shadow); }
.vst-pick { width: 100%; }
.vst-results .vs-render, .vst-results .vs-done { padding: 8px; }
.vst-results .vs-video { max-height: 60vh; }
/* gallery picker overlay */
.vst-picker-ov { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.vst-picker { background: var(--surface); border-radius: 16px; width: 100%; max-width: 720px;
  max-height: 82vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.vst-picker-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px;
  border-bottom: 1px solid var(--line); font-weight: 800; font-size: 15px; }
.vst-picker-x { border: 1px solid var(--line); background: var(--surface); cursor: pointer; width: 30px;
  height: 30px; border-radius: 8px; font-size: 14px; }
.vst-picker-x:hover { background: var(--bg); }
/* fixed-height square-ish cells: grid-auto-rows guarantees uniform tiles even when
   aspect-ratio is unreliable inside the overlay's scroll container. */
.vst-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  grid-auto-rows: 128px; gap: 10px; padding: 16px; overflow-y: auto; flex: 1; min-height: 0; }
.vst-pk { padding: 0; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--line-2); height: 100%; transition: border-color .12s; }
.vst-pk:hover { border-color: var(--primary); }
.vst-pk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vst-picker-grid .results-empty { grid-column: 1 / -1; }
.vst-picker-foot { padding: 0 16px 16px; text-align: center; }
.vst-picker-foot .vst-more { min-width: 160px; }
