:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9f9f9;
  --ink: #131313;
  --ink-2: #333333;
  --muted: #707070;
  --line: #e8e8e8;
  --line-strong: #d2d2d2;
  --accent: #131313;
  --brand-red: #e3312c;
  --ok: #2f7049;
  --ok-soft: #e3f0e7;
  --warn: #9a6514;
  --warn-soft: #fbf0d9;
  --err: #a8382a;
  --err-soft: #f8e3df;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(19, 19, 19, 0.04), 0 6px 20px rgba(19, 19, 19, 0.04);
  --sans: "Rubik", Arial, Helvetica, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
[hidden] { display: none !important; }

/* ---------- sign in ---------- */
.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background: var(--bg);
}
.auth-card {
  width: min(100%, 460px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-logo { display: block; width: 200px; max-width: 100%; height: auto; margin-bottom: 20px; }
.auth-eyebrow { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h1 { margin: 0; font: 600 27px/1.2 var(--sans); letter-spacing: -.02em; }
.auth-message { margin: 9px 0 22px; color: var(--ink-2); }
.auth-error { margin: 14px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--err-soft); color: var(--err); }
#sign-in { display: flex; justify-content: center; }
.account-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { display: block; width: 200px; height: 40px; object-fit: contain; }
.brand-sub { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab {
  border: 0; background: none; padding: 8px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-weight: 500;
}
.tab:hover { background: rgba(19, 19, 19, 0.05); }
.tab.is-active { background: var(--ink); color: #fff; }
.tab .count { opacity: 0.7; font-weight: 400; }
.key-status {
  margin-left: auto; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.key-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.key-status.is-live::before { background: var(--ok); }
.key-status.is-unavailable::before { background: var(--warn); }
.key-status:disabled { cursor: default; color: var(--ink); }

.allowance { display: grid; gap: 6px; font-size: 12.5px; }
.allowance-head { display: flex; justify-content: space-between; color: var(--ink-2); }
.allowance-head strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; transition: width 0.3s; }

/* ---------- layout ---------- */
.view { padding: 28px; max-width: 1440px; margin: 0 auto; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.sidebar { position: sticky; top: 84px; }
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.step-head p { color: var(--ink-2); margin-top: 2px; }
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; margin-top: 1px;
}
.subhead { font-weight: 600; margin: 22px 0 8px; font-size: 13px; letter-spacing: 0.02em; }

/* ---------- buttons & fields ---------- */
.btn {
  border: 1px solid var(--line-strong); background: var(--surface); padding: 8px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #333333; }
.btn-ghost { background: transparent; }
.btn-small { padding: 5px 10px; font-size: 12.5px; }
.btn-danger { color: var(--err); }
.btn-block { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; }

input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background-color: var(--surface);
  padding: 0 12px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"], input[type="number"], input[type="password"], select { height: 40px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23514b43' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
textarea { resize: vertical; min-height: 44px; padding: 9px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(19, 19, 19, 0.08); }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { margin-top: 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px 18px; }
.field-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-wide { grid-column: 1 / -1; }
.step { container-type: inline-size; }
@container (max-width: 600px) {
  .field-grid.cols-2, .field-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
}

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button {
  border: 0; background: none; padding: 6px 11px; cursor: pointer; font-size: 13px; border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button:hover:not(:disabled) { background: var(--surface-2); }
.seg button.is-on { background: var(--ink); color: #fff; }
.seg button:disabled { color: var(--line-strong); cursor: not-allowed; }
.seg button.is-on:disabled { background: var(--surface-2); color: var(--muted); }
/* Full-width segmented control: equal buttons on one line, same height as inputs */
.seg-fill { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; height: 40px; }
.seg-fill button { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.toggle input { width: 16px; height: 16px; accent-color: var(--ink); }

/* ---------- import ---------- */
.import { display: grid; gap: 10px; }
.import textarea { font-family: var(--mono); font-size: 12.5px; }
.import-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.import-status { color: var(--ink-2); font-size: 13px; }
.import-status.is-error { color: var(--err); }
.upload-btn { position: relative; }

.bulk {
  margin-top: 18px; padding: 12px 16px 14px; background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); display: grid; gap: 10px; font-size: 13px;
}
.bulk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bulk strong { font-weight: 600; }

/* ---------- product cards ---------- */
.product-list { display: grid; gap: 14px; margin-top: 18px; }
.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted);
}
.product {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; padding: 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2);
}
.product-thumb {
  width: 132px; height: 164px; border-radius: var(--radius-sm); background: var(--surface-2) center / contain no-repeat;
  border: 1px solid var(--line);
}
.product-main { display: grid; gap: 12px; min-width: 0; align-content: start; }
.product-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 2px; }
.product-name { display: grid; gap: 2px; min-width: 0; }
.product-name h3 { font-size: 18px; }
.product-name input { max-width: 360px; font-weight: 600; }
.product-meta { color: var(--muted); font-size: 12.5px; }
.product-meta a { color: var(--ink-2); }
.prow { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; align-items: center; }
.prow > .seg { justify-self: start; }
.icon-btn {
  border: 0; background: none; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1;
}
.icon-btn:hover { background: rgba(19, 19, 19, 0.06); color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.row-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.frames { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 999px; padding: 3px 10px 3px 4px; cursor: pointer; font-size: 12.5px; transition: border-color 0.15s, background 0.15s;
}
.chip-plain { padding: 4px 11px; }
.chip:hover { border-color: var(--ink-2); }
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .dot { width: 18px; height: 18px; border-radius: 50%; background: #ccc center / cover; border: 1px solid rgba(0, 0, 0, 0.12); }
.chip.is-loading .dot { animation: pulse 0.9s ease-in-out infinite alternate; }
.chip.is-error { border-color: var(--err); color: var(--err); }
@keyframes pulse { from { opacity: 0.35; } to { opacity: 1; } }
.framed-size { font-size: 12.5px; color: var(--ink-2); }
.framed-size strong { color: var(--ink); }
.note { font-size: 12px; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 4px; }
.text-field { display: flex; gap: 8px; align-items: center; }
.text-field input { max-width: 560px; }

/* ---------- style × room matrix ---------- */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.matrix th, .matrix td { padding: 0; text-align: center; border-bottom: 1px solid var(--line); }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.matrix thead th { vertical-align: bottom; padding: 8px 2px 6px; background: var(--surface-2); }
.matrix tbody th { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; border-right: 1px solid var(--line); }
.matrix thead th.mx-corner {
  position: sticky; left: 0; z-index: 2; text-align: left; padding: 8px 12px; border-right: 1px solid var(--line);
  color: var(--muted); font-weight: 500; font-size: 11px; line-height: 1.3;
}
.mx-corner span { display: block; white-space: nowrap; }
.matrix tbody tr:hover > * { background: var(--surface-2); }
.mx-col {
  border: 0; background: none; cursor: pointer; display: grid; gap: 5px; justify-items: center; font-weight: 600; font-size: 12px;
  padding: 4px 3px; border-radius: 6px; width: 100%; min-width: 66px; color: var(--ink-2); white-space: nowrap;
}
.mx-col:hover, .mx-row:hover { background: rgba(19, 19, 19, 0.06); color: var(--ink); }
.mx-col.is-full, .mx-row.is-full { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.mx-swatch { display: inline-flex; width: 34px; height: 10px; border-radius: 3px; overflow: hidden; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.mx-swatch span { flex: 1; }
.mx-row {
  border: 0; background: none; cursor: pointer; padding: 0 12px; height: 34px; font-weight: 600; width: 100%; text-align: left;
  white-space: nowrap; color: var(--ink-2); border-radius: 0;
}
.mx-cell { width: 100%; height: 34px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.mx-cell::before {
  content: ""; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); background: var(--surface);
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.mx-cell:hover::before { border-color: var(--ink-2); }
.mx-cell:active::before { transform: scale(0.9); }
.mx-cell.is-on::before {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
  border-color: var(--ink);
}
.mx-cell:focus-visible, .mx-col:focus-visible, .mx-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.combo-summary { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 12px 0 4px; font-size: 12.5px; }
.combo-chip {
  display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 4px 3px 9px; font-weight: 500;
}
.combo-chip .mx-swatch { width: 18px; height: 8px; }
.combo-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); width: 18px; height: 18px; border-radius: 50%; line-height: 1; padding: 0; }
.combo-chip button:hover { background: rgba(19, 19, 19, 0.08); color: var(--ink); }
#custom-scenes { display: grid; gap: 10px; margin: 12px 0 10px; }
.custom-scene { display: grid; grid-template-columns: 150px 150px 1fr auto; gap: 8px; align-items: start; }

/* ---------- size validation ---------- */
.msg { font-size: 12px; padding: 4px 8px; border-radius: 4px; margin-top: 4px; }
.msg-error { color: var(--err); background: var(--err-soft); }
.msg-warn { color: var(--warn); background: var(--warn-soft); }
.custom-size { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.custom-size input { width: 90px; }

/* ---------- estimate ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.estimate { padding: 20px; display: grid; gap: 14px; }
.est-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.est-total { font-family: var(--sans); font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.est-sub { color: var(--ink-2); font-size: 13px; }
.est-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.est-table td { padding: 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.est-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8px; }
.est-table tr:last-child td { border-bottom: 0; }
.est-table .tok { color: var(--muted); font-size: 11.5px; }
.rates { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; display: grid; gap: 6px; }
.rates-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rates-grid { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-variant-numeric: tabular-nums; }
.rates-grid span:nth-child(even) { text-align: right; }
.source { font-size: 11.5px; color: var(--muted); }
.source.is-live { color: var(--ok); }
.source.is-fallback { color: var(--warn); }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 12px; }
.est-notes { display: grid; gap: 6px; }
.est-notes .msg { margin: 0; }
.est-details { border-top: 1px solid var(--line); padding-top: 10px; }
.est-details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.est-details[open] summary { margin-bottom: 10px; }
.est-details .rates { margin-top: 10px; }

/* ---------- batches ---------- */
.batches-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.batch-card { padding: 0; overflow: hidden; cursor: pointer; text-align: left; border: 1px solid var(--line); }
.batch-card:hover { border-color: var(--line-strong); }
.batch-cover { aspect-ratio: 4 / 3; background: #f3f3f3 center / cover; }
.batch-info { padding: 12px 14px; display: grid; gap: 4px; }
.batch-name { font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.status-done { background: var(--ok-soft); color: var(--ok); }
.status-running, .status-queued, .status-cancelling { background: var(--warn-soft); color: var(--warn); }
.status-failed, .status-partial { background: var(--err-soft); color: var(--err); }
.status-running::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 0.8s infinite alternate; }

.batch-detail { display: grid; gap: 20px; }
.batch-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); transition: width 0.4s; }
.batch-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-2); font-size: 13px; }
.batch-stats strong { color: var(--ink); }
.job-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.job { padding: 14px 16px; display: grid; gap: 12px; }
.job-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.job-title { font-weight: 600; }
.job-sub { color: var(--muted); font-size: 12.5px; }
.job-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.job-images:empty { display: none; }
.job-img {
  border: 0; padding: 0; background: #f3f3f3; border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 5;
}
.job-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.placeholder {
  border-radius: var(--radius-sm); aspect-ratio: 4 / 5; background: linear-gradient(110deg, #eeeeee 30%, #f8f8f8 50%, #eeeeee 70%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.job-error { color: var(--err); font-size: 12.5px; background: var(--err-soft); padding: 6px 10px; border-radius: 4px; }

/* ---------- dialogs ---------- */
.dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); }
.dialog::backdrop, .lightbox::backdrop { background: rgba(19, 19, 19, 0.55); }
.dialog form { display: grid; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.lightbox {
  border: 0; padding: 0; background: var(--surface); border-radius: var(--radius); width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
.lightbox-inner { display: grid; grid-template-columns: minmax(0, 1fr) 340px; max-height: calc(100vh - 32px); }
.lightbox-img { background: #131313; display: grid; place-items: center; min-height: 0; }
.lightbox-img img { max-width: 100%; max-height: calc(100vh - 32px); display: block; }
.lightbox-side { padding: 20px; display: grid; gap: 12px; align-content: start; overflow: auto; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; transition: opacity 0.2s, transform 0.2s; z-index: 50;
  max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--err); }

.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .lightbox-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .view { padding: 16px; }
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .brand-logo { width: 160px; height: 32px; }
  .auth-card { padding: 26px 20px; }
  .account-email { display: none; }
  .tabs { margin-left: 0; }
  .step { padding: 18px 16px; }
  .product { grid-template-columns: 1fr; }
  .product-thumb { width: 100%; height: 200px; }
  .prow { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .text-field { flex-wrap: wrap; }
  .custom-scene { grid-template-columns: 1fr; }
}
