:root {
  --paper: #f8f7f2;
  --panel: #fffef9;
  --canvas: #e5e4de;
  --ink: #181a16;
  --muted: #656862;
  --line: #d6d5ce;
  --line-strong: #9c9e97;
  --accent: #315e4c;
  --accent-soft: #e6eee7;
  --warning: #fff2a8;
  --focus: #1769aa;
  --shadow: 0 24px 70px rgba(28, 31, 26, .14);
  --header-height: 70px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea { font: inherit; }

button,
summary,
label { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: #fff;
  color: #111;
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 24px;
  align-items: center;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 249, .94);
  backdrop-filter: blur(18px);
}

.app-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.app-brand span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
}

.app-brand small,
.app-header__status {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
}

.app-header__status,
.app-header__actions,
.preview-toolbar__tools,
.assist-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.demo-badge {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid #adb0a9;
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
}

.button,
.text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.button {
  padding: 0 15px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.button--dark {
  background: var(--ink);
  color: #fff;
}

.button--quiet { background: var(--panel); }

.text-button {
  padding: 0 8px;
  color: #343732;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.button:hover,
.text-button:hover { opacity: .72; }

.workspace {
  min-height: calc(100svh - var(--header-height));
  display: grid;
  grid-template-columns: minmax(430px, 500px) minmax(0, 1fr);
}

.builder {
  min-width: 0;
  height: calc(100svh - var(--header-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  background: var(--panel);
  scrollbar-width: thin;
}

.builder-progress {
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, #fbfaf5 0%, #eef1e9 100%);
}

.builder-progress__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.builder-progress h1 {
  max-width: 16em;
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.progress-number {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.progress-track {
  height: 3px;
  margin-top: 22px;
  overflow: hidden;
  background: #d2d5ce;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 220ms ease-out;
}

.progress-copy {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.builder-form { padding-bottom: 80px; }

.builder-section {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.builder-section > summary {
  min-height: 82px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 21px 28px;
  cursor: pointer;
  list-style: none;
}

.builder-section > summary::-webkit-details-marker { display: none; }

.builder-section > summary::after {
  content: "+";
  position: absolute;
  right: 27px;
  margin-top: 2px;
  font-size: 19px;
  font-weight: 300;
}

.builder-section[open] > summary::after { content: "−"; }

.builder-section > summary b,
.builder-section > summary small { display: block; }

.builder-section > summary b { padding-right: 35px; font-size: 14px; }

.builder-section > summary small {
  margin-top: 3px;
  padding-right: 35px;
  color: var(--muted);
  font-size: 10px;
}

.step-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
}

.section-body {
  display: grid;
  gap: 18px;
  padding: 2px 28px 32px 78px;
}

.builder-section--tuning { background: #f0f3ec; }

.builder-section--tuning .section-body { padding-bottom: 36px; }

.field-grid {
  display: grid;
  gap: 13px;
}

.field-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.field > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 10px;
  font-weight: 700;
}

.field > span b { color: #a44034; }

.field > span small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid #c6c5bd;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.field input,
.field select { min-height: 43px; padding: 8px 10px; }

.field textarea {
  padding: 10px;
  line-height: 1.75;
  resize: vertical;
}

.field input:user-invalid,
.field textarea:user-invalid { border-color: #a44034; }

.field-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-fieldset legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 10px;
  font-weight: 700;
}

.visual-choices {
  display: grid;
  gap: 8px;
}

.visual-choices--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.visual-choice {
  position: relative;
  min-width: 0;
  padding: 8px;
  border: 1px solid #c8c7bf;
  background: #fff;
  cursor: pointer;
}

.visual-choice:has(input:checked) {
  border: 2px solid var(--ink);
  padding: 7px;
  background: var(--accent-soft);
}

.visual-choice input,
.segmented input,
.palette-choices input,
.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.visual-choice b,
.visual-choice small { display: block; }

.visual-choice b { margin-top: 7px; font-size: 11px; }

.visual-choice small { color: var(--muted); font-size: 9px; }

.choice-thumb {
  height: 54px;
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(30, 32, 28, .12);
  background: #f4f1ea;
}

.choice-thumb i { display: block; }

.choice-thumb--gallery { grid-template-columns: 42% 58%; }
.choice-thumb--gallery i:first-child { background: #e6eadf; }
.choice-thumb--gallery i:last-child { margin: 9px; background: #787d73; }
.choice-thumb--editorial { grid-template-columns: 1fr 1fr; gap: 5px; padding: 8px; background: #eaded3; }
.choice-thumb--editorial i { border-top: 3px solid #282a26; border-bottom: 1px solid #9c8d81; }
.choice-thumb--cinema { padding: 7px 13px; background: #1c211f; }
.choice-thumb--cinema i { background: linear-gradient(135deg, #a08f7b, #5d716c); }
.choice-thumb--poster { grid-template-columns: 1.2fr .8fr; padding: 8px; background: #eadb75; }
.choice-thumb--poster i:first-child { border: solid #21231e; border-width: 6px 0; }
.choice-thumb--poster i:last-child { margin-left: 6px; background: #e25e4c; }
.choice-thumb--image-split { grid-template-columns: 44% 56%; }
.choice-thumb--image-split i:first-child { margin: 11px 8px; border-block: 3px solid #252721; }
.choice-thumb--image-split i:last-child { background: #aebeb8; }
.choice-thumb--image-full { position: relative; background: #7f918b; }
.choice-thumb--image-full i:first-child { position: absolute; inset: 8px 48% 8px 8px; background: #f5f0e7; }
.choice-thumb--image-full i:last-child { position: absolute; inset: 0; border: 1px solid rgba(255, 255, 255, .5); }
.choice-thumb--image-frame { grid-template-columns: 1fr 1fr; gap: 14px; padding: 9px; }
.choice-thumb--image-frame i:first-child { border-block: 3px solid #252721; }
.choice-thumb--image-frame i:last-child { border: 6px solid #fff; background: #a9b8b2; box-shadow: 0 0 0 1px #777; }
.choice-thumb--image-portrait { grid-template-columns: 1fr 35%; gap: 9px; padding: 8px; background: #e9dca8; }
.choice-thumb--image-portrait i:first-child { border-block: 3px solid #252721; }
.choice-thumb--image-portrait i:last-child { background: #73837d; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.font-sample--mincho { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; }
.font-sample--gothic { font-family: "Hiragino Sans", "Yu Gothic UI", sans-serif; font-weight: 700; }
.font-sample--classic { font-family: Georgia, "Times New Roman", serif; }
.font-sample--modern { font-family: Arial, Helvetica, sans-serif; font-weight: 700; letter-spacing: -.02em; }

.segmented label { position: relative; cursor: pointer; }

.segmented span {
  min-height: 43px;
  display: grid;
  place-items: center;
  margin-left: -1px;
  padding: 7px 8px;
  border: 1px solid #bdbdb5;
  background: #fff;
  font-size: 10px;
  text-align: center;
}

.segmented label:first-child span { margin-left: 0; }

.segmented input:checked + span {
  position: relative;
  z-index: 1;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.palette-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.palette-choices--four { grid-template-columns: repeat(2, 1fr); }

.palette-choices label {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 45px;
  padding: 5px;
  border: 1px solid #c8c7bf;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
}

.palette-choices label:has(input:checked) { border: 2px solid var(--ink); padding: 4px; }

.palette { width: 34px; height: 32px; display: block; }
.palette--paper { background: linear-gradient(135deg, #f7f5ef 50%, #dfe7dc 50%); }
.palette--dusk { background: linear-gradient(135deg, #161b1a 50%, #9c705e 50%); }
.palette--pastel { background: linear-gradient(135deg, #f2d8d1 0 50%, #a9c9d1 50%); }
.palette--custom { background: conic-gradient(from 45deg, #f7f5ef 0 25%, #315e4c 0 50%, #dbe7e8 0 75%, #191b17 0); }

.color-studio {
  padding: 16px;
  border: 1px solid #c8c7bf;
  background: rgba(255, 255, 255, .58);
}

.color-studio legend { margin: 0 0 12px; font-size: 10px; font-weight: 700; }
.color-studio legend small { margin-left: 5px; color: var(--muted); font-size: 8px; font-weight: 400; }

.color-controls { display: grid; gap: 8px; }

.color-controls label {
  display: grid;
  grid-template-columns: 52px 44px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.color-controls label > span { font-size: 9px; font-weight: 700; }

.color-controls input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 1px solid #aaa;
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}

.color-controls input:not([type="color"]) {
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid #c6c5bd;
  background: #fff;
  font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.color-status { margin: 11px 0 0; color: var(--muted); font-size: 9px; }
.color-status.is-warning { color: #8c3d31; font-weight: 700; }

.inline-jump {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.inline-jump span { font-size: 18px; }

.range-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
}

.range-row label { font-size: 10px; font-weight: 700; }
.range-row input { width: 100%; accent-color: var(--ink); }
.range-row output { font: 12px Georgia, serif; text-align: right; }

.quick-values { display: flex; gap: 6px; margin: -9px 0 5px 102px; }

.quick-values button {
  min-height: 44px;
  flex: 1;
  padding: 5px 7px;
  border: 1px solid #bfc1ba;
  background: #fff;
  font-size: 9px;
  cursor: pointer;
}

.quick-values button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.upload-zone {
  min-height: 145px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 18px;
  border: 1px dashed #8f928b;
  background: #f7f8f3;
  text-align: center;
  cursor: pointer;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 19px;
}

.upload-zone b { font-size: 11px; }
.upload-zone small { color: var(--muted); font-size: 9px; }

.upload-zone--compact {
  min-height: 112px;
  grid-template-columns: 34px 1fr;
  column-gap: 12px;
  justify-items: start;
  text-align: left;
}

.upload-zone--compact .upload-zone__mark { grid-row: 1 / span 2; }

.photo-strip {
  min-height: 72px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.photo-strip p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 10px; }

.photo-strip figure {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e5e5e0;
}

.photo-strip img { width: 100%; height: 100%; display: block; object-fit: cover; }

.photo-strip figcaption {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 18px;
  padding: 2px 4px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font: 8px Georgia, serif;
  text-align: center;
}

.consent-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
  font-size: 10px;
}

.consent-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }

.toggle-list { border-top: 1px solid var(--line); }

.toggle-row {
  position: relative;
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.toggle-row b,
.toggle-row small { display: block; }
.toggle-row b { font: 11px Georgia, serif; letter-spacing: .08em; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.toggle-row i {
  position: relative;
  width: 40px;
  height: 22px;
  display: block;
  border: 1px solid #a6a8a1;
  border-radius: 999px;
  background: #dedfd9;
}

.toggle-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  content: "";
  transition: transform 150ms ease;
}

.toggle-row:has(input:checked) i { background: var(--accent); }
.toggle-row:has(input:checked) i::after { transform: translateX(18px); }

.builder-section--commerce { background: #f5f0e8; }

.commerce-intro {
  padding: 18px 0 4px;
  border-top: 1px solid var(--ink);
}

.commerce-intro h2 {
  max-width: 14em;
  margin: 0;
  font: 500 22px/1.45 "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  letter-spacing: -.025em;
}

.commerce-intro > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.field--url-import textarea {
  min-height: 118px;
  border: 2px solid var(--ink);
  background: #fffefa;
  font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.url-import-button {
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 0 18px;
  border: 0;
  background: var(--ink);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.url-import-button span { font-size: 12px; font-weight: 700; }
.url-import-button small { font-size: 8px; opacity: .7; }

.url-import-note { margin: -7px 0 0; color: var(--muted); font-size: 9px; }

.local-product-editor {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid #a9a196;
  background: #fffefa;
}

.local-product-editor header h3 {
  margin: 4px 0 0;
  font: 500 19px/1.4 "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
}

.local-product-editor header > p:last-child,
.local-product-privacy { margin: 8px 0 0; color: var(--muted); font-size: 9px; }

.local-product-form {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.local-product-image { display: grid; gap: 8px; cursor: pointer; }
.local-product-image input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.local-product-image > span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px dashed #8d8b83;
  background: #edf0eb;
}

.local-product-image > span i { font: normal 24px Georgia, serif; }
.local-product-image > span b { font-size: 10px; }
.local-product-image > span img { width: 100%; height: 100%; display: block; object-fit: contain; background: #eee; }
.local-product-image > small { overflow-wrap: anywhere; color: var(--muted); font-size: 8px; line-height: 1.5; }
.local-product-image:focus-within > span { outline: 2px solid var(--ink); outline-offset: 3px; }

.local-product-fields { display: grid; gap: 13px; }
.local-product-fields .field em { color: #8c3d31; font-size: 8px; font-style: normal; }
.local-product-add { justify-self: start; }

.advanced-import {
  border-block: 1px solid #c4bbae;
  background: rgba(255, 255, 255, .34);
}

.advanced-import > summary {
  min-height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.advanced-import > summary small { color: var(--muted); font-size: 8px; font-weight: 400; }
.advanced-import__body { display: grid; gap: 17px; padding: 4px 12px 18px; }

.assist-actions--wrap { flex-wrap: wrap; }

.product-import-status {
  padding: 9px 11px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, .65);
  font-size: 10px;
  font-weight: 700;
}

.product-import-list {
  display: grid;
  border-top: 1px solid var(--line-strong);
}

.product-import-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.product-import-list span,
.product-import-list small { display: block; color: var(--muted); font-size: 8px; }

.product-import-list__visual {
  width: 44px;
  height: 44px;
  display: grid !important;
  place-items: center;
  overflow: hidden;
  background: #e3e5df;
  font-size: 6px !important;
  text-align: center;
}

.product-import-list__visual img { width: 100%; height: 100%; display: block; object-fit: cover; }

.product-import-list b {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-import-list article > div { min-width: 0; }
.product-import-list article > div small { margin-top: 3px; }

.product-import-list button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #7e352c;
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.product-import-list p { margin: 10px 0; color: var(--muted); font-size: 9px; }

.api-boundary {
  padding: 16px;
  border: 1px solid #c2b7a8;
  background: rgba(255, 255, 255, .5);
}

.api-boundary b { font-size: 10px; }

.api-boundary p { margin: 6px 0 0; color: var(--muted); font-size: 9px; }

.local-assist {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid #c6c8c0;
  background: #edf1e8;
}

.local-assist h2 { margin: 0; font: 18px "Yu Mincho", Georgia, serif; }

.local-assist ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.local-assist li {
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 9px;
  font-size: 10px;
}

.local-assist li::before {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.local-assist li.is-warning::before { background: #b0672d; }

.field--output textarea { background: rgba(255, 255, 255, .72); }

.preview-area {
  min-width: 0;
  min-height: calc(100svh - var(--header-height));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--canvas);
}

.preview-toolbar {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid #cac9c2;
}

.preview-toolbar h2 { margin: 0; font-size: 13px; }

.device-switch { display: flex; }

.device-switch button {
  min-width: 55px;
  min-height: 44px;
  margin-left: -1px;
  padding: 6px 9px;
  border: 1px solid #aeb0a9;
  background: #f0efea;
  font-size: 10px;
  cursor: pointer;
}

.device-switch button:first-child { margin-left: 0; }
.device-switch button[aria-pressed="true"] { position: relative; z-index: 1; background: var(--ink); color: #fff; }

.preview-stage {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 24px;
}

.preview-device {
  width: min(100%, 1180px);
  min-width: 320px;
  overflow: hidden;
  border: 1px solid #c2c1ba;
  background: #fff;
  box-shadow: var(--shadow);
  transition: width 220ms ease;
}

.preview-stage[data-device="tablet"] .preview-device { width: min(100%, 820px); }
.preview-stage[data-device="mobile"] .preview-device { width: min(100%, 390px); }

.preview-device__bar {
  height: 31px;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid #deddd8;
  background: #f2f1ed;
}

.preview-device__bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c6c5bf;
}

.preview-device__bar span {
  margin-left: 8px;
  color: #80817c;
  font-size: 8px;
}

.preview-device iframe {
  width: 100%;
  height: calc(100svh - 228px);
  min-height: 600px;
  display: block;
  border: 0;
  background: #fff;
}

.preview-foot {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 9px 24px;
  border-top: 1px solid #cac9c2;
  color: var(--muted);
  font-size: 9px;
}

.preview-foot p { margin: 0; }
.preview-foot a { color: var(--ink); text-underline-offset: 3px; }

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 16px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .app-header { grid-template-columns: 1fr auto; }
  .app-header__status { display: none; }
  .workspace { grid-template-columns: 430px minmax(0, 1fr); }
  .builder-progress,
  .builder-section > summary { padding-left: 22px; padding-right: 22px; }
  .section-body { padding-left: 66px; padding-right: 22px; }
}

@media (max-width: 900px) {
  :root { --header-height: 64px; }
  .app-header { position: relative; min-height: 64px; grid-template-columns: 1fr; gap: 9px; padding: 12px 16px; }
  .app-brand { justify-content: space-between; }
  .app-header__actions { overflow-x: auto; padding-bottom: 2px; }
  .app-header__actions .button,
  .app-header__actions .text-button { flex: 0 0 auto; }
  .workspace { display: block; }
  .builder { height: auto; overflow: visible; border-right: 0; }
  .preview-area { min-height: 860px; border-top: 8px solid var(--ink); }
  .preview-device iframe { height: 720px; }
  .preview-stage { padding: 18px; }
  .preview-toolbar { position: sticky; z-index: 20; top: 0; background: rgba(229, 228, 222, .94); backdrop-filter: blur(14px); }
}

@media (max-width: 560px) {
  .app-brand small { display: none; }
  .app-header__actions { gap: 4px; }
  .app-header__actions .button { min-height: 44px; padding: 0 10px; font-size: 10px; }
  .app-header__actions .text-button { display: none; }
  .builder-progress { padding: 25px 18px 22px; }
  .builder-progress__head { gap: 10px; }
  .builder-progress h1 { font-size: 1.35rem; }
  .progress-number { font-size: 23px; }
  .builder-section > summary { padding: 18px; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .builder-section > summary::after { right: 17px; }
  .section-body { padding: 2px 18px 30px; }
  .field-grid--two { grid-template-columns: 1fr; }
  .visual-choices--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-row { grid-template-columns: 82px minmax(0, 1fr) 48px; }
  .quick-values { margin-left: 0; }
  .photo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .url-import-button { grid-template-columns: 1fr; gap: 0; align-content: center; }
  .local-product-editor { padding: 17px; }
  .local-product-form { grid-template-columns: 1fr; }
  .local-product-image { grid-template-columns: 104px minmax(0, 1fr); align-items: center; }
  .local-product-image > span { width: 104px; }
  .color-controls label { grid-template-columns: 44px 44px minmax(0, 1fr); }
  .product-import-list article { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .preview-toolbar { align-items: flex-start; padding: 14px 12px; }
  .preview-toolbar__tools { flex-wrap: wrap; justify-content: flex-end; }
  .preview-toolbar__tools > .text-button { min-height: 44px; }
  .device-switch button { min-width: 48px; }
  .preview-stage { padding: 12px 0 18px; }
  .preview-device { width: 100%; min-width: 0; border-left: 0; border-right: 0; }
  .preview-stage[data-device="tablet"] .preview-device,
  .preview-stage[data-device="mobile"] .preview-device { width: min(100%, 390px); }
  .preview-device iframe { min-height: 650px; }
  .preview-foot { align-items: flex-start; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (forced-colors: active) {
  .choice-thumb,
  .palette { border: 1px solid CanvasText; }
  .progress-track i,
  .local-assist li::before { background: CanvasText; }
}
