/* LEZAKOQ デザインエディタ /design/ — tokens.css → common.css の後に読む。
   白い紙の上で「光で彫る」。ツールは控えめ、キャンバスが主役。mm は IBM Plex Mono。 */

:root {
  --ed-top-h: 56px;
  --ed-foot-h: 64px;
  --ed-mb-h: 60px;
  --ed-line-strong: #CFCFC9;
  --ed-warn: #D23A1A;
  --ed-warn-bg: #FFF1EC;
  --ed-ok: #1E7F4F;
}

/* ---------- 基本 ---------- */
.ed-body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow-x: hidden;
}
.ed-body * { box-sizing: border-box; }
.ed-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.ed-skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--radius);
}
.ed-skip:focus { left: 8px; }

/* フォーカス可視（キーボード）。フォーム部品の font/color の継承は common.css（button, input… { font: inherit; color: inherit }）に任せる */
.ed-body :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- 上部バー＋プログレス ---------- */
.ed-top {
  position: sticky; top: 0; z-index: 40;
  height: var(--ed-top-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 0 var(--gutter);
  background: rgba(251, 251, 249, .9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
/* ワードマークは common.css の .wordmark と同じ構造（エディタでは少し小さく） */
.ed-top .wordmark.ed-brand { font-size: 15px; white-space: nowrap; }
.ed-top .wordmark__kana { font-size: 10px; }
.ed-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center; gap: 0;
  min-width: 0;
}
.ed-step-node { display: flex; align-items: center; min-width: 0; }
.ed-step-node + .ed-step-node::before {
  content: ""; display: block; width: clamp(12px, 4vw, 40px); height: 1px; background: var(--line); margin: 0 4px;
}
.ed-step-node.is-done + .ed-step-node::before,
.ed-step-node.is-current + .ed-step-node::before { background: var(--line); }
.ed-step-node.is-done + .ed-step-node.is-done::before,
.ed-step-node.is-done + .ed-step-node.is-current::before { background: var(--ink); }
.ed-step-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 6px 4px; cursor: pointer; color: var(--ink-3);
  border-radius: var(--radius);
}
.ed-step-btn:disabled { cursor: default; }
.ed-step-num {
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  width: 20px; height: 20px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 2px; color: var(--ink-3); background: #fff;
}
.ed-step-label { font-size: 12px; font-weight: 500; white-space: nowrap; }
.ed-step-node.is-done .ed-step-num { background: var(--ink); color: #fff; border-color: var(--ink); }
.ed-step-node.is-done .ed-step-btn { color: var(--ink-2); }
.ed-step-node.is-current .ed-step-num {
  background: var(--ink); color: #fff; border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--laser), 0 0 10px var(--laser-glow);
}
.ed-step-node.is-current .ed-step-btn { color: var(--ink); }
.ed-top-right { display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.ed-top-total { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; }

@media (max-width: 640px) {
  .ed-top { grid-template-columns: auto 1fr; padding: 0 12px; }
  .ed-top-right { display: none; }
  .ed-top .wordmark__kana { display: none; }
  .ed-step-label { display: none; }
  .ed-step-node.is-current .ed-step-label { display: inline; }
  .ed-step-node + .ed-step-node::before { width: 10px; margin: 0 2px; }
}

/* ---------- メイン・パネル ---------- */
.ed-main { flex: 1; display: flex; flex-direction: column; }
.ed-panel { flex: 1; }
.ed-panel[hidden] { display: none !important; }
.ed-panel-in {
  max-width: 880px; margin: 0 auto; padding: 40px var(--gutter) 64px;
  animation: ed-fade .45s var(--ease-out) both;
}
@keyframes ed-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ed-eyebrow { margin: 0 0 6px; font-size: 12px; color: var(--ink-3); letter-spacing: .08em; }
.ed-h1 { margin: 0 0 10px; font-size: clamp(22px, 3.4vw, 30px); font-weight: 700; line-height: 1.3; letter-spacing: .01em; }
.ed-lead { margin: 0 0 28px; color: var(--ink-2); font-size: 14.5px; max-width: 60ch; }
.ed-note { margin: 18px 0 0; font-size: 12.5px; color: var(--ink-3); }
.ed-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- ボタン ---------- */
.ed-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: #fff; font-weight: 500; font-size: 14px; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: box-shadow .25s var(--ease-out), transform .25s var(--ease-out), background .2s, color .2s, border-color .2s, opacity .2s;
}
.ed-btn small { font-size: 11px; font-weight: 400; opacity: .8; }
.ed-btn-primary:hover:not(:disabled) { box-shadow: 0 0 0 1px var(--laser), 0 0 16px var(--laser-glow); }
.ed-btn-primary:active:not(:disabled) { transform: translateY(1px); }
.ed-btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.ed-btn-ghost::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out);
}
.ed-btn-ghost:hover:not(:disabled)::after { transform: scaleX(1); }
.ed-btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.ed-btn:disabled { opacity: .4; cursor: not-allowed; }
.ed-btn-block { width: 100%; }
.ed-btn-lg { min-height: 52px; padding: 0 28px; font-size: 15px; }

/* ---------- カード（機種・色・面） ---------- */
.ed-cards { display: grid; gap: 14px; }
.ed-cards-device { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ed-cards-color { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ed-cards-face { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.ed-card {
  position: relative; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 18px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  cursor: pointer; color: var(--ink);
  transition: border-color .2s, box-shadow .3s var(--ease-out), transform .3s var(--ease-out);
}
.ed-card:hover { border-color: var(--ed-line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.ed-card[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.ed-card[aria-checked="true"]::after {
  content: ""; position: absolute; top: 14px; right: 14px; width: 8px; height: 8px;
  background: var(--laser); box-shadow: 0 0 8px var(--laser-glow);
}
.ed-card-fig { display: grid; place-items: center; height: 120px; background: var(--paper-2); border-radius: var(--radius); overflow: hidden;
  background-image: radial-gradient(var(--line) .8px, transparent .8px); background-size: 12px 12px; }
.ed-card-fig svg { height: 100px; width: auto; display: block; }
.ed-card-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.ed-card-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.ed-card-price { font-family: var(--font-mono); font-size: 15px; margin-top: 2px; }
.ed-card-price small { font-family: var(--font-body); font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.ed-card-badge {
  position: absolute; top: 12px; left: 12px; font-size: 10.5px; letter-spacing: .06em;
  padding: 2px 7px; border: 1px solid var(--ink); border-radius: 2px; background: #fff;
}

.ed-card-color { align-items: center; text-align: center; padding: 20px 12px 14px; }
.ed-swatch {
  width: 56px; height: 56px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(14,14,16,.12), inset 0 -8px 14px rgba(0,0,0,.18), inset 0 8px 14px rgba(255,255,255,.25);
  position: relative;
}
.ed-swatch::after {
  content: "Aa"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .02em;
}
.ed-swatch[data-tone="light"]::after { color: var(--mark-light); }
.ed-swatch[data-tone="dark"]::after { color: var(--mark-dark); }
.ed-card-color .ed-card-title { font-size: 14px; }
.ed-card-color .ed-card-sub { font-size: 11.5px; }

.ed-card-face .ed-card-fig { height: 140px; }
.ed-card-face .ed-card-fig svg { height: 120px; }
.ed-card-face-both .ed-card-fig svg { height: 110px; }

/* ---------- 前回の続き ---------- */
.ed-draft { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.ed-draft[hidden] { display: none; }
.ed-draft-in {
  max-width: 880px; margin: 0 auto; padding: 12px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.ed-draft-text { display: flex; flex-direction: column; font-size: 13.5px; }
.ed-draft-meta { font-size: 12px; color: var(--ink-2); font-family: var(--font-mono); }
.ed-draft-actions { display: flex; gap: 8px; }
.ed-draft .ed-btn { min-height: 38px; padding: 0 14px; font-size: 13px; }

/* ---------- ワークスペース（STEP 4） ---------- */
/* 高さは「ビューポート − 上部バー」で確定させる（auto だとツール列の中身の高さにつられてページが伸びる） */
.ed-panel-work { display: flex; flex-direction: column; height: calc(100dvh - var(--ed-top-h)); min-height: 420px; }
.ws {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, .85fr) minmax(0, 1.6fr) 320px;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}
.ws-3d, .ws-2d { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ws-3d { border-right: 1px solid var(--line); background: #fff; }
.ws-2d { background: var(--paper); }
.ws-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  height: 36px; padding: 0 14px; flex: none;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2);
}
.ws-head-label { font-weight: 500; letter-spacing: .04em; }
.ws-head-meta { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ws-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; cursor: grab;
  background: radial-gradient(ellipse at 50% 60%, #fff 0%, var(--paper-2) 75%); }
.ws-stage:active { cursor: grabbing; }
.ws-stage canvas { display: block; width: 100%; height: 100%; outline: none; }
.ws-stage-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center;
  font-size: 13px; color: var(--ink-2);
}
.ws-stage-fallback[hidden] { display: none; }
.ws-face-switch { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); flex: none; min-height: 52px; }
.ws-face-switch:empty { display: none; }
.ws-face-btn {
  flex: 1; min-height: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  font-size: 12.5px; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.ws-face-btn[aria-selected="true"] { border-color: var(--ink); color: var(--ink); font-weight: 500; }
.ws-face-btn .ws-face-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.ws-face-btn.has-items .ws-face-dot { background: var(--ink); }
.ws-face-btn.has-warn .ws-face-dot { background: var(--ed-warn); }

.ws-canvas-wrap {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: var(--paper-2);
}
.ws-canvas-wrap::before, .ws-canvas-wrap::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; z-index: 2;
  border-color: var(--ink-3); border-style: solid;
}
.ws-canvas-wrap::before { left: 8px; bottom: 8px; border-width: 0 0 1px 1px; }
.ws-canvas-wrap::after { right: 8px; bottom: 8px; border-width: 0 1px 1px 0; }
#cv2d { display: block; width: 100%; height: 100%; touch-action: none; cursor: default; outline: none; }
#cv2d:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }

.ws-hud { position: absolute; top: 8px; display: flex; gap: 4px; z-index: 3; }
.ws-hud-tl { left: 8px; }
.ws-hud-tr { right: 8px; }
.ws-hud-btn {
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.92);
  font-size: 15px; line-height: 1; cursor: pointer; color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 1px 2px rgba(14,14,16,.05);
}
.ws-hud-btn:hover:not(:disabled) { border-color: var(--ink); }
.ws-hud-btn:disabled { opacity: .35; cursor: default; }
.ws-hud-btn[hidden] { display: none; }
.ws-hud-fit { width: auto; padding: 0 8px; font-family: var(--font-mono); font-size: 11px; }
.ws-warn {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3;
  max-width: calc(100% - 32px);
  padding: 7px 12px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.4;
  background: var(--ed-warn-bg); color: var(--ed-warn); border: 1px solid rgba(210,58,26,.35);
}
.ws-warn[hidden] { display: none; }
/* 注意ゾーン（凹凸・質感）：注文は止めない。色は控えめに */
.ws-warn.is-soft { background: #fff; color: var(--ink-2); border-color: var(--ed-line-strong); }

/* ---------- ツールパネル ---------- */
.ws-tools {
  display: flex; flex-direction: column; min-height: 0;
  background: #fff; border-left: 1px solid var(--line);
  overflow: hidden;
}
.ws-tools-grip { display: none; }
.ws-tabs {
  display: flex; flex: none; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line); padding: 0 6px;
}
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab {
  flex: none; padding: 12px 7px 10px; border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--ink-3); position: relative; white-space: nowrap;
}
.ws-tab::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transition: transform .25s var(--ease-out); }
.ws-tab.is-active { color: var(--ink); font-weight: 500; }
.ws-tab.is-active::after { transform: scaleX(1); }
.ws-tab-count { font-size: 10px; color: var(--ink-3); margin-left: 2px; }
.ws-tabpanels { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ws-tabpanel { display: none; padding: 16px 16px 24px; }
.ws-tabpanel.is-active { display: block; }

.ws-field { display: block; margin-bottom: 12px; }
.ws-field-label { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 5px; letter-spacing: .02em; }
.ws-field input[type="text"], .ws-field input[type="number"], .ws-field select, .ws-field textarea {
  width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  font-size: 14px; line-height: 1.4; resize: vertical;
}
.ws-field input:focus, .ws-field select:focus, .ws-field textarea:focus { border-color: var(--ink); outline: none; }
.ws-field input[type="number"] { font-family: var(--font-mono); font-size: 13.5px; }
.ws-field-range input[type="range"] { width: 100%; accent-color: var(--ink); margin: 6px 0 0; }
.ws-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.ws-row > * { flex: 1; }
.ws-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; margin: 12px 0 0; }
.ws-error { font-size: 12.5px; color: var(--ed-warn); background: var(--ed-warn-bg); border-radius: var(--radius); padding: 8px 10px; margin: 10px 0 0; line-height: 1.5; }
.ws-error[hidden] { display: none; }
.ws-font-preview {
  height: 56px; display: grid; place-items: center; margin: -4px 0 12px;
  border: 1px dashed var(--line); border-radius: var(--radius); font-size: 26px; color: var(--ink);
  overflow: hidden; white-space: nowrap; padding: 0 10px;
}

.ws-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 12px; border: 1px dashed var(--ed-line-strong); border-radius: var(--radius-lg);
  background: var(--paper); cursor: pointer; text-align: center; transition: border-color .2s, background .2s;
}
.ws-drop:hover, .ws-drop.is-over { border-color: var(--ink); background: #fff; }
.ws-drop.is-busy { opacity: .6; pointer-events: none; }
.ws-drop.is-busy .ws-drop-icon { animation: ws-spin 1s linear infinite; }
@keyframes ws-spin { to { transform: rotate(360deg); } }
.ws-drop:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.ws-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.ws-drop-icon { width: 36px; height: 36px; border: 1px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.ws-drop-text { font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.ws-drop-text small { font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.ws-image-tools[hidden] { display: none; }
.ws-image-tools { margin-top: 14px; }
.ws-image-preview-wrap {
  display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  background-image: repeating-conic-gradient(var(--paper-2) 0% 25%, #fff 0% 50%); background-size: 16px 16px;
  margin-bottom: 10px;
}
.ws-image-preview { max-width: 100%; height: auto; display: block; image-rendering: pixelated; }
.ws-seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.ws-seg-btn { flex: 1; min-height: 36px; border: 0; background: #fff; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.ws-seg-btn + .ws-seg-btn { border-left: 1px solid var(--line); }
.ws-seg-btn.is-active { background: var(--ink); color: #fff; }

.ws-mono-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.ws-mono-grid:empty { display: none; }
.ws-mono-item {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; cursor: pointer; text-align: center; color: var(--ink);
}
.ws-mono-item:hover { border-color: var(--ink); }
.ws-mono-item img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: var(--paper); border-radius: 2px; }
.ws-mono-item span { font-size: 11.5px; color: var(--ink-2); }

.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.ws-chip { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.ws-chip.is-active { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }
.ws-ai-result { margin-top: 12px; }
.ws-ai-result[hidden] { display: none; }
.ws-ai-img-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.ws-ai-img-wrap img { display: block; width: 100%; height: auto; }
.ws-ai-busy { position: relative; overflow: hidden; }
.ws-ai-busy::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--laser); box-shadow: 0 0 10px var(--laser-glow);
  animation: ws-scan 1.4s linear infinite;
}
@keyframes ws-scan { from { left: -2px; } to { left: 100%; } }

.ws-shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ws-shape-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; color: var(--ink-2); font-size: 11px;
}
.ws-shape-btn:hover { border-color: var(--ink); color: var(--ink); }
.ws-shape-btn svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.ws-layers { list-style: none; margin: 0; padding: 0; }
.ws-layer {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer;
}
.ws-layer.is-selected { background: var(--paper-2); }
.ws-layer.is-hidden .ws-layer-name { color: var(--ink-3); text-decoration: line-through; }
.ws-layer-type { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); width: 28px; text-align: center; border: 1px solid var(--line); border-radius: 2px; padding: 2px 0; }
.ws-layer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-layer-name .ws-layer-warn { color: var(--ed-warn); font-size: 11px; margin-left: 4px; }
.ws-layer-name .ws-layer-warn.is-soft { color: var(--ink-3); }
.ws-layer-actions { display: flex; gap: 2px; }
.ws-icon-btn {
  width: 28px; height: 28px; border: 0; background: none; border-radius: var(--radius); cursor: pointer; color: var(--ink-2);
  display: grid; place-items: center; font-size: 14px; line-height: 1;
}
.ws-icon-btn:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.ws-icon-btn:disabled { opacity: .3; cursor: default; }
#layerEmpty[hidden] { display: none; }

/* 選択中の要素 */
.ws-props { flex: none; border-bottom: 1px solid var(--line); background: var(--paper); max-height: 52%; overflow-y: auto; }
.ws-props[hidden] { display: none; }
.ws-props-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 4px 16px; position: sticky; top: 0; background: var(--paper); z-index: 1; }
.ws-props-title { font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.ws-props-actions { display: flex; gap: 2px; }
.ws-props-body { padding: 6px 16px 14px; }
.ws-props-body .ws-field { margin-bottom: 10px; }
.ws-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ws-grid2 .ws-field, .ws-grid3 .ws-field { margin-bottom: 8px; }
.ws-field-unit { position: relative; }
.ws-field-unit input { padding-right: 32px !important; }
.ws-field-unit::after { content: attr(data-unit); position: absolute; right: 10px; bottom: 11px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); pointer-events: none; }
.ws-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.ws-check input { accent-color: var(--ink); width: 16px; height: 16px; margin: 0; }

/* フッター（合計・確認へ） */
.ws-foot {
  flex: none; height: var(--ed-foot-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter); background: #fff; border-top: 1px solid var(--line);
}
.ws-foot-right { display: flex; align-items: center; gap: 18px; }
.ws-foot-total { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.ws-foot-total strong { font-size: 20px; color: var(--ink); font-weight: 500; }
.ws-foot-total small { font-size: 11px; color: var(--ink-3); }

/* スマホ用バー・シート（PC では非表示） */
.ws-mobilebar, .ws-sheet-backdrop { display: none; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 1239px) and (min-width: 1024px) {
  .ws { grid-template-columns: minmax(220px, .7fr) minmax(0, 1.5fr) 292px; }
}

@media (max-width: 1023px) {
  .ed-panel-work { min-height: 0; height: calc(100dvh - var(--ed-top-h)); }
  .ws {
    display: flex; flex-direction: column; height: auto; flex: 1 1 auto; min-height: 0;
  }
  .ws-3d { flex: none; height: 38vh; height: 38dvh; border-right: 0; border-bottom: 1px solid var(--line); }
  .ws-3d .ws-head { height: 30px; }
  .ws-face-switch { padding: 6px 10px; min-height: 42px; }
  .ws-face-btn { min-height: 28px; font-size: 12px; }
  .ws-2d { flex: 1; min-height: 0; }
  .ws-2d .ws-head { height: 30px; }

  .ws-tools {
    position: fixed; left: 0; right: 0; bottom: var(--ed-mb-h); z-index: 45;
    max-height: 64dvh; border-left: 0; border-top: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(calc(100% + var(--ed-mb-h)));
    transition: transform .35s var(--ease-out);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ws-tools.is-open { transform: translateY(0); }
  .ws-tools-grip { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; flex: none; }
  .ws-props { max-height: 46dvh; }
  .ws-tabs { display: none; }
  .ws-tabpanels { padding-bottom: 8px; }

  .ws-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(14,14,16,.18); }
  .ws-sheet-backdrop[hidden] { display: none; }

  .ws-mobilebar {
    display: grid; grid-template-columns: repeat(6, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
    height: calc(var(--ed-mb-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--line);
  }
  .ws-mb-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: none; font-size: 10.5px; color: var(--ink-2); cursor: pointer; padding: 0;
  }
  .ws-mb-btn.is-active { color: var(--ink); }
  .ws-mb-btn.is-active .ws-mb-ic { border-color: var(--ink); background: var(--ink); color: #fff; }
  .ws-mb-ic { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; font-size: 13px; font-family: var(--font-display); font-weight: 700; }

  .ws-foot {
    position: sticky; bottom: calc(var(--ed-mb-h) + env(safe-area-inset-bottom)); height: 54px; padding: 0 12px; z-index: 43;
  }
  .ws-foot > .ed-btn-ghost { display: none; }
  .ws-foot-right { flex: 1; justify-content: space-between; }
  .ws-foot-total strong { font-size: 17px; }
  .ws-foot .ed-btn { min-height: 38px; padding: 0 14px; }
  .ed-panel-work { padding-bottom: calc(var(--ed-mb-h) + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  .ed-panel-in { padding: 28px var(--gutter) 48px; }
  .ed-cards-color { grid-template-columns: repeat(2, 1fr); }
  .ws-hud-btn { width: 30px; height: 30px; }
  .ws-foot-total small { display: none; }
}

/* ---------- 確認（STEP 5） ---------- */
.cf-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 32px; align-items: start; }
.cf-previews { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cf-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; }
.cf-preview-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.cf-preview-fig { display: grid; place-items: center; background: var(--paper-2); border-radius: var(--radius); padding: 10px; }
.cf-preview-fig img { max-height: 360px; max-width: 100%; width: auto; display: block; }
.cf-preview-fig.is-dark { background: #2a2a2e; }
.cf-preview-toggle { display: flex; gap: 4px; margin-top: 10px; }
.cf-preview-toggle button { flex: 1; min-height: 30px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); font-size: 11.5px; cursor: pointer; color: var(--ink-2); }
.cf-preview-toggle button.is-active { border-color: var(--ink); color: var(--ink); }
.cf-summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.cf-dl { margin: 0; }
.cf-dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.cf-dl dt { color: var(--ink-2); font-weight: 400; }
.cf-dl dd { margin: 0; text-align: right; }
.cf-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 6px; font-size: 13px; color: var(--ink-2); }
.cf-total strong { font-size: 28px; color: var(--ink); font-weight: 500; }
.cf-notes { margin: 10px 0 0; padding-left: 18px; list-style: disc; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.cf-notes li { margin-bottom: 4px; }
.cf-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.cf-actions .ed-btn-ghost { order: 2; }
@media (max-width: 760px) { .cf-grid { grid-template-columns: 1fr; } }

/* ---------- フッター（common.css の .site-footer をそのまま使う。ワークスペース中は隠す） ---------- */
.ed-body .site-footer { padding: 36px 0 24px; }
.ed-body[data-step="4"] .site-footer { display: none; }

/* ---------- トースト・読み込み ---------- */
.ed-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 13px;
  box-shadow: var(--shadow-lg); max-width: calc(100% - 32px);
  animation: ed-fade .3s var(--ease-out) both;
}
.ed-toast[hidden] { display: none; }
.ed-body[data-step="4"] .ed-toast { bottom: calc(var(--ed-foot-h) + 16px); }
@media (max-width: 1023px) { .ed-body[data-step="4"] .ed-toast { bottom: calc(var(--ed-mb-h) + 70px); } }

.ed-loading {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: var(--paper);
  font-size: 13px; color: var(--ink-2); letter-spacing: .06em;
  transition: opacity .4s var(--ease-out), visibility .4s;
}
.ed-loading.is-done { opacity: 0; visibility: hidden; }
.ed-loading-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--laser); box-shadow: 0 0 12px var(--laser-glow); animation: ws-scan 1.2s linear infinite; }

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