body { display: flex; flex-direction: column; height: 100vh; }
.layout { flex: 1; display: grid; grid-template-columns: 1fr 390px; min-height: 0; }
.layout .stage { height: 100%; }
.controls { overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px;
            border-left: 1px solid var(--line); }
.mode { margin-left: 8px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }

.summary { position: sticky; top: 0; z-index: 2; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sum-facts { text-align: right; font-size: 12px; color: var(--muted); line-height: 1.6; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.step summary { list-style: none; display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
.step summary::-webkit-details-marker { display: none; }
.step summary h2 { margin: 0; }
.step summary .pick { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.step > *:not(summary) { margin-top: 10px; }

.shapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.shape { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
         border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; font-size: 11px; }
.shape svg { width: 30px; height: 30px; }
.shape svg path { fill: var(--chip); stroke: var(--ink); stroke-width: 1.4; }
.shape[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field output { color: var(--ink); font-weight: 600; }
label.field { flex-direction: column; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.textin { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; color: var(--muted); }
.grid2 label { display: flex; flex-direction: column; gap: 3px; }
.grid2 input[type="number"] { padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.checks { margin: 0; padding-left: 18px; font-size: 12px; }
.checks .warning { color: #b06a00; }
.checks .error { color: #b3261e; }
#bom table { width: 100%; border-collapse: collapse; font-size: 12px; }
#bom td, #bom th { border-bottom: 1px solid var(--line); padding: 3px 4px; text-align: left; }
textarea { width: 100%; font: 11px/1.4 ui-monospace, monospace; border: 1px solid var(--line); border-radius: 8px;
           background: var(--panel); padding: 6px; }

body:not(.tech) .tech-only { display: none; }

@media (max-width: 860px) {
  body { height: auto; }
  .layout { grid-template-columns: 1fr; }
  .layout .stage { height: 58vh; position: sticky; top: 0; z-index: 3; }
  .controls { border-left: 0; overflow: visible; }
  .summary { position: static; }
  .shapes { grid-template-columns: repeat(5, 1fr); }
}
