/* Forge & Form tool page ("the bench"): viewport, control panel, export bar. */
/* ---------- layout: viewport LEFT, control panel RIGHT ---------- */
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 440px; grid-template-rows: minmax(0, 1fr) auto; height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); }
.viewport { grid-row: 1; grid-column: 1; position: relative; min-height: 0; overflow: hidden; background-color: var(--bg-2);
  background-image:
    radial-gradient(90% 70% at 50% 38%, rgba(245,165,36,.08), transparent 70%),
    linear-gradient(rgba(120,150,190,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,150,190,.07) 1px, transparent 1px),
    linear-gradient(rgba(120,150,190,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,150,190,.12) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px, 120px 120px, 120px 120px; }
.viewport::after { /* film grain */ content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 1; }
.vp-corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--amber); opacity: .7; z-index: 2; pointer-events: none; }
.vp-corner.tl { left: 8px; top: 8px; border-left-width: 2px; border-top-width: 2px; }
.vp-corner.tr { right: 8px; top: 8px; border-right-width: 2px; border-top-width: 2px; }
.vp-corner.bl { left: 8px; bottom: 8px; border-left-width: 2px; border-bottom-width: 2px; }
.vp-corner.br { right: 8px; bottom: 8px; border-right-width: 2px; border-bottom-width: 2px; }

.vp-toolbar { position: absolute; z-index: 5; top: 20px; left: 22px; right: 76px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; pointer-events: none; }
.vp-toolbar > * { pointer-events: auto; }
.seg { display: inline-flex; background: rgba(22,23,26,.92); border: 1px solid var(--line); }
.seg button { padding: 8px 14px; border: 0; background: transparent; color: #b9b4a8; font-family: var(--font-head); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--amber); }
.seg button.active { background: var(--amber); color: var(--amber-ink); font-weight: 700; }
.sep-slider { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; background: rgba(22,23,26,.92); border: 1px solid var(--line); color: #c9c4b8; font-family: var(--font-head); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.sep-slider input { width: 120px; }
.sep-slider output { min-width: 46px; text-align: right; color: var(--amber); font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0; text-transform: none; }
.sep-slider.disabled { opacity: .4; pointer-events: none; }
.vp-hud { position: absolute; z-index: 5; top: 20px; right: 22px; display: flex; flex-direction: column; background: rgba(22,23,26,.92); border: 1px solid var(--line); }
.vp-hud button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: #c9c4b8; }
.vp-hud button + button { border-top: 1px solid var(--line); }
.vp-hud button:hover { background: var(--surface-2); color: var(--amber); }
.readout { min-width: 0; position: absolute; z-index: 5; left: 22px; bottom: 22px; max-width: calc(100% - 44px); padding: 8px 12px; background: rgba(22,23,26,.92); border: 1px solid var(--line); border-left: 3px solid var(--amber); font-family: var(--font-mono); font-size: 12px; color: #c9c4b8; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.readout:empty { display: none; }
.readout span { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.readout b { color: var(--text); font-weight: 500; font-size: 12.5px; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.hint-orbit { position: absolute; z-index: 5; right: 29px; top: 150px; writing-mode: vertical-rl; color: #8a867b; font-family: var(--font-mono); font-size: 11px; pointer-events: none; text-align: right; }

.empty { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.empty.hidden { display: none; }
.empty-card { --cut: 16px; position: relative; pointer-events: auto; max-width: 460px; padding: 30px 30px 22px; background: rgba(31,33,36,.96); clip-path: var(--chamfer); box-shadow: inset 0 0 0 1px var(--line); }
.empty-card::before { content: ""; position: absolute; left: 0; top: 0; width: 5px; height: 100%; background: linear-gradient(var(--amber), var(--copper)); }
.stamp { display: inline-block; margin: 0 0 12px; padding: 2px 8px; border: 1px solid var(--copper); color: var(--copper); font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.empty-card h2 { margin: 0 0 8px; font-family: var(--font-head); font-size: 30px; line-height: 1.05; letter-spacing: .03em; text-transform: uppercase; font-weight: 700; }
.empty-card p { margin: 0 0 18px; color: #b9b4a8; }
.empty-card .stamp { margin-bottom: 12px; color: var(--copper); }
.empty-card small { display: block; margin-top: 16px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.dropmask { position: absolute; z-index: 6; inset: 12px; display: none; place-items: center; border: 2px dashed var(--amber); background: rgba(22,23,26,.86); color: var(--amber); font-family: var(--font-head); font-size: 26px; letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.viewport.dragging .dropmask { display: grid; }
.busy { position: absolute; z-index: 7; left: 50%; top: 74px; transform: translateX(-50%); padding: 8px 16px; background: var(--surface); border: 1px solid var(--amber); font-family: var(--font-head); letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.busy[hidden] { display: none; }
.spinner { width: 14px; height: 14px; border: 2px solid #5a4a26; border-top-color: var(--amber); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- right-hand control panel ---------- */
.panel { grid-row: 1; grid-column: 2; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface); border-left: 1px solid var(--line); }
.panel-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.eyebrow { margin: 0 0 6px; color: var(--copper); font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-family: var(--font-head); font-size: 31px; line-height: 1.02; letter-spacing: .025em; text-transform: uppercase; font-weight: 700; }
.lede { margin: 6px 0 0; color: #b9b4a8; }
.privacy { display: inline-flex; align-items: center; gap: 7px; margin: 12px 0 0; padding: 3px 10px 3px 8px; border: 1px solid #3f5a41; color: var(--ok); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; }

.panel-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); }
.steps { display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--line-soft); }
.tab { position: relative; display: grid; gap: 1px; justify-items: start; text-align: left; padding: 14px 12px 14px 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; color: #9b968b; cursor: pointer; }
.tab b { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--copper); letter-spacing: .08em; }
.tab span { font-family: var(--font-head); font-size: 19px; line-height: 1.05; letter-spacing: .05em; text-transform: uppercase; color: #cbc6ba; }
.tab small { color: #716d64; font-size: 11px; }
.tab:hover span { color: var(--amber); }
.tab.active { background: var(--surface); box-shadow: inset 3px 0 0 var(--amber); }
.tab.active b { color: var(--amber); }
.tab.active span { color: var(--text); }
.tab.active::after { content: ""; position: absolute; right: -1px; top: 0; bottom: 0; width: 1px; background: var(--surface); }

.panes { min-height: 0; overflow-y: auto; padding: 4px 20px 14px; scrollbar-color: var(--surface-3) var(--surface); scrollbar-width: thin; }
.pane { display: none; }
.pane.active { display: block; }
.pane-title { margin: 16px 0 14px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.field { margin: 0 0 17px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; font-weight: 600; color: #d9d4c8; font-size: 13px; }
.field-label output { color: var(--amber); font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--amber) var(--fill, 50%), #44484e var(--fill, 50%)); }
input[type=range]::-moz-range-track { height: 4px; background: #44484e; }
input[type=range]::-moz-range-progress { height: 4px; background: var(--amber); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 18px; margin-top: -7px; background: var(--text); border: 0; clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); box-shadow: none; }
input[type=range]::-moz-range-thumb { width: 12px; height: 18px; background: var(--text); border: 0; border-radius: 0; }
input[type=range]:hover::-webkit-slider-thumb { background: var(--amber); }
select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-2); color: var(--text); }
.field input[type=text], .field textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
.field input[type=text]:focus, .field textarea:focus { outline: 2px solid var(--amber); outline-offset: -1px; }
select option { background: var(--surface-2); color: var(--text); }
.color-row { display: flex; align-items: center; gap: 10px; }
input[type=color] { width: 46px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-2); cursor: pointer; }
.color-row code { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; color: #d9d4c8; font-size: 13px; }
.check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--amber); flex: none; }
.thumb { position: relative; display: grid; place-items: center; border: 1px solid var(--line); aspect-ratio: 4/3; overflow: hidden; background: repeating-conic-gradient(#25282c 0 25%, #1c1e21 0 50%) 0 0 / 16px 16px; }
.thumb canvas { width: 100%; height: 100%; object-fit: contain; display: none; }
.thumb.has canvas { display: block; }
.thumb.has #thumb-empty { display: none; }
#thumb-empty { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; }
.disclaimer { margin: 0; padding: 12px 22px 15px; border-top: 1px solid var(--line); background: #2a2214; color: #e7c98f; font-size: 12px; line-height: 1.4; border-left: 3px solid var(--amber); }
.disclaimer b { font-family: var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); font-weight: 600; }

/* ---------- bottom status strip ---------- */
.strip { position: relative; grid-row: 2; grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 12px 20px 11px; background: var(--bg); border-top: 1px solid var(--line); }
.progress { position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: #2d2f33; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--copper), var(--amber)); transition: width .35s ease; }
.progress.busy i { width: 35%; animation: sweep 1.1s ease-in-out infinite; transition: none; }
@keyframes sweep { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.status { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; color: #c9c4b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status::before { content: "▸ "; color: var(--amber); }
.status.error { color: var(--danger); }
.status.error::before { content: "✕ "; color: var(--danger); }
.status.ok { color: var(--ok); }
.fmt { width: 310px; max-width: 40vw; }
.beta-download-note {
  margin: 0; max-width: 16rem; color: #9a9488;
  font-size: 11.5px; line-height: 1.35;
}
.beta-download-note[hidden] { display: none !important; }

/* ---------- narrow screens: viewport on top, panel collapses below ---------- */
@media (max-width: 960px) {
  .topnav { display: none; }
  .brand { flex: 1; }
  .topbar { gap: 12px; padding: 0 14px; }
  .bench { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56vh auto auto; height: auto; min-height: calc(100dvh - var(--nav-h)); }
  .viewport { grid-row: 1; grid-column: 1; }
  .panel { grid-row: 2; grid-column: 1; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .panel-body { grid-template-columns: minmax(0, 1fr); }
  .panel, .panes, .panel-head { min-width: 0; }
  .steps { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .tab { flex: 1; border-bottom: 0; border-right: 1px solid var(--line-soft); padding: 10px 8px; }
  .tab small { display: none; }
  .tab span { font-size: 16px; }
  .tab.active { box-shadow: inset 0 3px 0 var(--amber); }
  .tab.active::after { display: none; }
  .panes { overflow: visible; padding: 4px 16px 12px; }
  .strip { grid-row: 3; position: sticky; bottom: 0; flex-wrap: wrap; z-index: 20; }
  .status { flex-basis: 100%; }
  .fmt { flex: 1; max-width: none; width: auto; }
  .hint-orbit { display: none; }
  .vp-toolbar { left: 14px; right: 62px; top: 14px; }
  .vp-hud { right: 12px; top: 14px; }
  .readout { left: 14px; bottom: 14px; max-width: calc(100% - 28px); }
  .seg button { padding: 7px 9px; font-size: 13px; }
  .sep-slider { font-size: 13px; }
  .sep-slider input { width: 90px; }
  h1 { font-size: 27px; }
  .empty-card h2 { font-size: 25px; }
  .empty-card { padding: 22px 20px 18px; }
}
@media (max-width: 480px) {

  .brand-name { font-size: 19px; }
}

/* ---------- stability card ---------- */
.stab-card { margin: 4px 0 6px; padding: 12px; background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--amber); }
.chip { display: inline-block; padding: 4px 10px; margin-bottom: 8px; font-family: var(--font-head); font-size: 15px; letter-spacing: .07em; text-transform: uppercase; background: var(--surface-3); color: var(--text); }
.chip.ok { background: #243a28; color: var(--ok); }
.chip.amber { background: #3b2d0c; color: var(--amber); }
.chip.bad { background: #43211b; color: var(--danger); }
.stab-card dl { margin: 0; display: grid; gap: 4px; }
.stab-card dl div { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 11.5px; }
.stab-card dt { color: var(--muted); }
.stab-card dd { margin: 0; color: var(--text); text-align: right; }
.group-title { margin: 22px 0 12px; padding-bottom: 7px; border-bottom: 1px dashed var(--line); font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--copper); }
.stab-card dl div { display: grid; grid-template-columns: minmax(0, 46%) 1fr; align-items: baseline; }

/* ---------- custom base controls ---------- */
.field-label .unit { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; }
.numrow { display: grid; grid-template-columns: minmax(0, 1fr) 74px; gap: 12px; align-items: center; }
input.num { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-2); color: var(--amber); font-family: var(--font-mono); font-size: 12.5px; text-align: right; }
input.num:focus { outline: 1px solid var(--amber); }
.mini-btn { margin: 0 0 14px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-2); color: var(--text); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.mini-btn:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- print views ---------- */
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.print-hint { position: absolute; z-index: 5; left: 50%; top: 74px; transform: translateX(-50%); width: min(560px, calc(100% - 180px)); padding: 9px 13px; background: rgba(22,23,26,.94); border: 1px solid var(--line); border-left: 3px solid var(--copper); color: #c9c4b8; font-size: 12.5px; line-height: 1.45; }
.print-hint b { display: block; margin-bottom: 2px; font-family: var(--font-head); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); font-weight: 600; }

/* ---------- reset ---------- */
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head-row .eyebrow { margin-top: 6px; }
.btn-reset { --cut: 8px; padding: 7px 14px; font-size: 14px; background: transparent; color: var(--amber); box-shadow: inset 0 0 0 2px var(--amber); flex: none; }
.btn-reset:hover { background: var(--amber); color: var(--amber-ink); }
.btn-sm { padding: 6px 14px; font-size: 13px; --cut: 6px; }
.reset-confirm { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin: 4px 0 10px; padding: 10px 12px; background: #2a2214; border-left: 3px solid var(--amber); color: #f1dcae; font-size: 13px; }
.reset-confirm[hidden] { display: none; }
.reset-actions { display: inline-flex; gap: 8px; }

/* ---------- help drawer (slides over the panel) ---------- */
.drawer { position: fixed; z-index: 60; top: var(--nav-h); right: 0; bottom: 0; width: min(420px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(0,0,0,.45); animation: drawer-in .2s ease-out; }
.drawer[hidden] { display: none; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-family: var(--font-head); font-size: 22px; letter-spacing: .08em; text-transform: uppercase; }
.drawer-close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.drawer-close:hover { color: var(--amber); border-color: var(--amber); }
.drawer-tabs { display: flex; border-bottom: 1px solid var(--line-soft); }
.drawer-tabs button { flex: 1; padding: 10px 6px; border: 0; background: transparent; color: var(--muted); font-family: var(--font-head); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; border-bottom: 3px solid transparent; }
.drawer-tabs button[aria-selected="true"] { color: var(--amber); border-bottom-color: var(--amber); background: var(--bg-2); }
.drawer-tabs button:focus-visible, .drawer-close:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 18px 24px; }
.help-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.help-item h4 { margin: 0 0 4px; font-family: var(--font-head); font-size: 16px; letter-spacing: .07em; text-transform: uppercase; color: var(--amber); font-weight: 600; }
.help-item p { margin: 0; color: #c9c4b8; font-size: 13.5px; line-height: 1.5; }
.keys { margin: 12px 0 0; display: grid; gap: 10px; }
.keys div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: baseline; }
.keys dt { font-family: var(--font-mono); font-size: 12px; color: var(--copper); }
.keys dd { margin: 0; color: #c9c4b8; font-size: 13.5px; }
kbd { padding: 2px 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-family: var(--font-mono); font-size: 12px; }
@media (max-width: 960px) { .drawer { width: 100vw; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }

/* ---------- build-plate tip after an export ---------- */
.plate-promo { position: fixed; z-index: 70; right: calc(440px + 56px); bottom: 124px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; max-width: min(440px, calc(100vw - 32px)); padding: 10px 10px 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--copper); box-shadow: 0 10px 28px rgba(0,0,0,.5); color: var(--text); animation: drawer-in .2s ease-out; }
.plate-promo[hidden] { display: none; }
.plate-promo svg { color: #9db4d6; }
.plate-promo p { margin: 0; font-size: 13px; line-height: 1.4; color: #c9c4b8; }
.plate-promo p b { color: var(--text); }
.plate-promo-x { display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.plate-promo-x:hover { color: var(--amber); }
.plate-promo-x:focus-visible, .plate-promo a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.drawer-foot { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 13px; }
.drawer-foot a { color: var(--amber); }
@media (max-width: 960px) { .plate-promo { left: 12px; right: 12px; width: auto; bottom: 128px; max-width: none; grid-template-columns: auto minmax(0, 1fr) auto; } .plate-promo .btn { grid-column: 2; justify-self: start; } .plate-promo-x { grid-row: 1; grid-column: 3; } }
@media (prefers-reduced-motion: reduce) { .plate-promo { animation: none; } }

/* ---- mode switch (a tool with two ways to start, e.g. photo / your own STL) */
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.mode-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border: 0; border-right: 1px solid var(--line); background: transparent; color: #b9b4a8; text-align: left; cursor: pointer; }
.mode-btn:last-child { border-right: 0; }
.mode-btn b { font-family: var(--font-head); font-size: 15px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.mode-btn small { font-size: 11.5px; color: var(--muted); }
.mode-btn:hover b { color: var(--amber); }
.mode-btn.active { background: var(--surface-3); box-shadow: inset 0 -3px 0 var(--amber); color: var(--text); }
.mode-btn.active b { color: var(--amber); }
.mode-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }

/* ---- import mode: model info, cut list, cutter fields, cut report */
.imp-info { margin-top: 10px; }
.imp-info:empty { display: none; }
.imp-dl { margin: 0; padding: 10px 12px; display: grid; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--amber); font-size: 12.5px; }
.imp-dl div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
.imp-dl dt { color: var(--muted); }
.imp-dl dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.imp-info .warn { margin: 8px 0 0; padding: 8px 10px; background: #2e2610; border-left: 3px solid var(--warn); color: #f0dc9a; font-size: 12.5px; }
.cut-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cut-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cut-chip { padding: 5px 11px; border: 1px solid var(--line); background: var(--surface-2); color: #cfcabe; font-family: var(--font-head); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.cut-chip.active { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }
.cut-ops { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.cut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.cut-num { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px; padding: 4px 7px; background: var(--bg-2); border: 1px solid var(--line); }
.cut-num span { font-family: var(--font-mono); font-size: 12px; color: var(--amber); }
.cut-num i { display: none; } /* the unit is in the heading above; the box is too narrow for it and the number */
.cut-num input { min-width: 0; width: 100%; border: 0; background: transparent; color: var(--text); font-family: var(--font-mono); font-size: 13px; }
.cut-num input:focus { outline: none; }
.cut-num input { -moz-appearance: textfield; appearance: textfield; } /* no spinner arrows: they hid digits like 5.8 */
.cut-num input::-webkit-inner-spin-button, .cut-num input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cut-num:focus-within { border-color: var(--amber); }
.gizmo-seg { display: flex; width: 100%; }
.gizmo-seg button { flex: 1; padding: 7px 8px; font-size: 13px; }
.height-presets { display: flex; width: 100%; margin-top: 2px; }
.height-presets button { flex: 1; padding: 7px 8px; font-size: 13px; }
.height-box .hint { margin-top: 8px; }
.height-box .hint b, #cut-depth-note b { color: var(--amber); font-weight: 600; }
.btn-cut { width: 100%; justify-content: center; margin-top: 4px; }
.status.warn { color: var(--warn); }
.cut-ops .mini-btn, .cut-head .mini-btn { margin: 0; }
.mini-btn:disabled, .cut-chip:disabled { opacity: .45; cursor: not-allowed; border-color: var(--line); color: var(--muted); }

/* ---------- colour heights (js/bench/colour-heights.js) ---------- */
.heights { border: 1px solid var(--line); background: var(--surface-2); }
.heights > summary { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 10px; cursor: pointer; font-weight: 600; color: #d9d4c8; font-size: 13px; list-style: none; }
.heights > summary::-webkit-details-marker { display: none; }
.heights > summary::before { content: "▸"; margin-right: 8px; color: var(--amber); }
.heights[open] > summary::before { content: "▾"; }
.heights > summary span { flex: 1; }
.heights > summary output { color: var(--amber); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.heights-list { display: grid; gap: 6px; padding: 2px 10px 4px; }
.heights .hrow { display: grid; grid-template-columns: 20px 62px minmax(0, 1fr) 62px; align-items: center; gap: 8px; font-size: 12.5px; color: #cbc6ba; }
.heights .hrow .sw { width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid rgba(255, 255, 255, 0.18); }
.heights .hrow output { text-align: right; color: var(--amber); font-family: var(--font-mono); font-size: 12px; }
.heights-foot { padding: 4px 10px 0; }
.heights > .hint { padding: 0 10px 10px; }
