:root {
  --bg: #fff8ef;
  --ink: #221d2b;
  --muted: #6d6578;
  --card: #ffffff;
  --line: #eadfd2;
  --pink: #ff4fa3;
  --orange: #ff9f1c;
  --violet: #7d3cf0;
  --ok: #19a974;
  --warn: #c2410c;
  --radius: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button { font: inherit; color: inherit; cursor: pointer; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; position: sticky; top: 0; z-index: 5;
  background: rgba(255, 248, 239, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.brand small { font-weight: 600; font-size: 11px; background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 99px; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: conic-gradient(var(--pink), var(--orange), #ffe14d, #b6e33a, #1fc3d8, var(--violet), var(--pink)); }
.nav { display: flex; gap: 10px; align-items: center; }
.lang button { padding: 5px 10px; font-size: 13px; }
.step h2 i { font-style: normal; }
.cart-btn { border: 2px solid var(--ink); background: #fff; border-radius: 99px; padding: 6px 14px; font-weight: 700; }
.cart-btn span { background: var(--pink); color: #fff; border-radius: 99px; padding: 0 7px; margin-left: 4px; }

.hero { padding: 28px 24px 8px; max-width: 1280px; margin: 0 auto; }
.hero h1 { font-size: clamp(28px, 4.5vw, 46px); margin: 0 0 6px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--pink), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--muted); max-width: 640px; }

.layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 24px; padding: 20px 24px 40px; max-width: 1280px; margin: 0 auto; }
.stage { position: sticky; top: 76px; align-self: start; height: calc(100vh - 100px); min-height: 420px; border-radius: 24px; overflow: hidden; background: #efe8de; border: 1px solid var(--line); }
#viewer { position: absolute; inset: 0; }
#viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage-tools { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.stage-tools button, .chk { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.chk { display: inline-flex; gap: 6px; align-items: center; }
.stage-info { position: absolute; left: 12px; bottom: 12px; background: rgba(255,255,255,.92); border-radius: 12px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.stage-hint { position: absolute; right: 12px; bottom: 12px; font-size: 12px; color: var(--muted); }

.panel { display: flex; flex-direction: column; gap: 14px; }
.step, .summary, .safety { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.step h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.step h2 span { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: #fff; font-size: 13px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.card small { color: var(--muted); font-size: 12px; }
.card[aria-pressed="true"] { border-color: var(--pink); background: #fff0f7; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.field b { font-weight: 500; color: var(--muted); }
.field output { font-weight: 500; color: var(--muted); }
select, input[type=number] { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; width: 100%; }
input[type=range] { width: 100%; accent-color: var(--pink); }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 6px 14px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.types label { font-size: 12px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font-weight: 600; font-size: 13px; }
.chips button:disabled { opacity: .4; cursor: not-allowed; }
.chips button.dim { opacity: .55; }
.chips .lim { font-size: 10px; font-weight: 600; opacity: .7; }
.chips button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); padding: 0; }
.swatches button[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.swatches .none { background: repeating-linear-gradient(45deg, #fff 0 4px, #eee 4px 8px); font-size: 0; }
.patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-bottom: 10px; }
.patterns button { border: 2px solid var(--line); border-radius: 12px; padding: 4px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.patterns canvas { width: 100%; aspect-ratio: 1; border-radius: 8px; display: block; }
.patterns button[aria-pressed="true"] { border-color: var(--pink); }
.ghost { border: 2px solid var(--ink); background: #fff; border-radius: 99px; padding: 7px 14px; font-weight: 700; }
.ghost.small { padding: 4px 10px; font-size: 13px; }
.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.primary { border: 0; border-radius: 99px; padding: 11px 20px; font-weight: 800; color: #fff; background: linear-gradient(90deg, var(--pink), var(--orange)); box-shadow: 0 6px 18px rgba(255, 79, 163, .3); }
.note { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.warn { font-size: 13px; color: var(--warn); background: #fff4ec; border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.summary { position: sticky; bottom: 12px; box-shadow: 0 10px 30px rgba(34, 29, 43, .08); }
.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price span { font-size: 28px; font-weight: 800; }
.price small { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.workshop { margin-top: 10px; font-size: 13px; }
.workshop summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.workshop ul { margin: 6px 0; padding-left: 18px; }
.safety h3 { margin: 0 0 6px; font-size: 15px; }
.safety ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.safety li { margin-bottom: 4px; }

.drawer { position: fixed; inset: 0; background: rgba(34, 29, 43, .35); display: flex; justify-content: flex-end; z-index: 20; }
.drawer[hidden] { display: none; }
.drawer-box { width: min(420px, 100%); background: #fff; height: 100%; padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; }
.cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cart-list li { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px; font-size: 13px; }
.cart-list img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #efe8de; }
.cart-list .rm { border: 0; background: none; color: var(--muted); font-size: 18px; }
.cart-total { font-weight: 700; }
.order { display: flex; flex-direction: column; gap: 4px; }
.primary.wa { background: #1fa855; box-shadow: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; z-index: 30; font-weight: 600; }
.foot { text-align: center; padding: 24px; font-size: 13px; color: var(--muted); }
.foot a { color: inherit; }
.muted { color: var(--muted); }

.badges { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-weight: 600; }
.badges li { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }
.incl { margin-top: 10px; font-size: 13px; }
.incl summary { cursor: pointer; font-weight: 700; }
.incl ul { margin: 6px 0; padding-left: 18px; color: var(--muted); }
.ok { color: var(--ok); }
.faq { max-width: 1280px; margin: 0 auto; padding: 0 24px 24px; }
.faq h2 { font-size: 22px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 2px; color: var(--muted); }

.helper { border: 2px dashed var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; }
.helper[open] { border-color: var(--pink); background: #fffafc; }
.helper summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.h-step { border-top: 1px solid var(--line); padding: 10px 0 4px; margin-top: 8px; }
.h-step > b { display: block; margin-bottom: 4px; }
.h-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.h-cards button { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 6px; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.h-cards button b { font-size: 12px; }
.h-cards button[aria-pressed="true"] { border-color: var(--pink); }
.h-cards svg { width: 64px; height: 64px; }
.chk2 { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 6px; }
#hPreview { max-width: 160px; border-radius: 10px; margin-top: 6px; display: block; }
.suggest { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); }
.suggest button { margin-top: 6px; }

@media (max-width: 900px) {
  .faq { padding: 0 16px 24px; }
  .top, .hero, .layout { padding-left: 16px; padding-right: 16px; }
  .layout { grid-template-columns: 1fr; }
  .stage { position: relative; top: 0; height: 60vh; min-height: 340px; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .summary { position: static; }
  .stage-hint { display: none; }
  .cart-btn { white-space: nowrap; padding: 5px 10px; }
  .brand { font-size: 17px; }
}
