﻿:root {
  --bg: #f3f3f2;
  --panel: #ffffff;
  --ink: #1d1e20;
  --muted: #6b6d70;
  --line: #e3e3e0;
  --accent: #3a3f43;
  --go: #2e7d32;
  --chip: #f1f1ef;
  --r: 4px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel); border-bottom: 3px solid var(--accent); }
.top h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.top p { margin: 0; color: var(--muted); font-size: 12.5px; }
.ttl { flex: 1; min-width: 0; }
.badge { font-size: 11px; letter-spacing: .14em; border: 1px solid var(--accent); color: var(--accent); padding: 2px 8px; border-radius: 2px; }

.layout { flex: 1; display: grid; grid-template-columns: 340px 1fr 330px; min-height: 0; }
.panel { background: var(--panel); overflow: auto; padding: 4px 18px 24px; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); }
.panel section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.panel section:last-child { border-bottom: 0; }
.panel h2 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.row { margin: 10px 0; }
.lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.lbl b { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
input[type=checkbox] { accent-color: var(--ink); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin: 8px 0; cursor: pointer; }
.check input { margin: 3px 0 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.seg button { border: 1px solid var(--line); background: var(--chip); padding: 7px 4px; border-radius: var(--r); cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }

.models { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.models button { text-align: left; border: 1px solid var(--line); background: var(--chip); border-radius: var(--r); padding: 8px 10px; cursor: pointer; }
.models button b { display: block; font-size: 13px; letter-spacing: .04em; }
.models button span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.models button i { display: block; font-style: normal; font-size: 12px; margin-top: 4px; }
.models button.on { background: #fff; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.swatches button { width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }

.frrow { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.frrow select { width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px; background: #fff; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
details.auto { margin-top: 10px; border: 1px dashed var(--line); border-radius: var(--r); padding: 8px 10px; }
details.auto summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.wz { display: grid; grid-template-columns: 1fr 96px; align-items: center; gap: 6px; margin: 4px 0; font-size: 13px; }
.wz .seg button { padding: 4px; font-size: 12px; }

.stage { position: relative; min-width: 0; min-height: 0; }
#viewport { position: absolute; inset: 0; }
#viewport canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.viewbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 6px; padding: 5px; box-shadow: 0 4px 16px rgba(0,0,0,.08); white-space: nowrap; }
.viewbar button { border: 0; background: transparent; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.viewbar button:hover { background: var(--chip); }
.viewbar button.on { background: var(--ink); color: #fff; }
.viewbar label { font-size: 13px; padding: 0 6px; display: flex; gap: 4px; align-items: center; cursor: pointer; }
.viewbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); background: rgba(255,255,255,.85); padding: 3px 10px; border-radius: 12px; pointer-events: none; }

.pricecard .pricehead { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.pricecard .pricehead small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.pricebig { font-size: 32px; font-weight: 700; margin: 2px 0 8px; }
.lines { font-size: 12.5px; margin-bottom: 12px; }
.lines div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.lines div span:last-child { white-space: nowrap; }
button.primary { background: var(--go); color: #fff; border: 0; border-radius: var(--r); cursor: pointer; padding: 10px; }
button.big { width: 100%; font-size: 15px; font-weight: 600; padding: 13px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.actions button, button.strong { border: 1px solid var(--line); background: var(--chip); border-radius: var(--r); padding: 8px 4px; cursor: pointer; font-size: 13px; }
button.strong { font-weight: 600; }
#wizGo { width: 100%; margin-top: 8px; }
#spec table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#spec td { padding: 4px 0; border-bottom: 1px dotted var(--line); vertical-align: top; }
#spec td:first-child { color: var(--muted); padding-right: 10px; }
#spec .est { color: #9a5b00; font-size: 11.5px; }
.madeby { font-size: 11.5px; text-align: center; margin: 14px 0 0; }
.madeby a { color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: 8px; width: min(560px, 94vw); padding: 18px 20px; }
dialog h2 { margin: 0 0 6px; font-size: 16px; }
dialog textarea { width: 100%; font: 12.5px/1.45 Consolas, monospace; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
#toast { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; font-size: 13px; }
#toast.on { opacity: 1; }

@media (max-width: 1100px) {
  body { overflow: auto; height: auto; }
  .layout { grid-template-columns: 1fr; }
  .stage { order: -1; height: 62vh; }
  .panel { overflow: visible; border: 0 !important; }
  .viewbar { flex-wrap: wrap; justify-content: center; white-space: normal; width: calc(100% - 24px); }
  .hint { display: none; }
}

.ptabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.ptabs button { border: 1px solid var(--line); background: var(--chip); border-radius: var(--r); padding: 8px 6px; cursor: pointer; font-size: 12.5px; }
.ptabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.models.three { grid-template-columns: 1fr 1fr 1fr; }
.models.three button { padding: 7px 8px; }
