/* ==========================================================
   THE WORKBENCH
   The public tool floor for the shared generator registry.
   Blueprint paper and measured readouts stay neutral; each model’s
   authored color is carried in --wb-model-color so Workbench,
   Generator Studio, and both 3D benches remain synchronized.
   ========================================================== */
:root {
  --wb-ink: #7dd3fc;
  --wb-warm: #fbbf24;
  --wb-line: rgba(125,211,252,0.16);
  --wb-panel: rgba(6,14,22,0.82);
  --wb-paper: #050b12;
  --wb-text: #dceefc;
  --wb-mute: #7f93a6;
}
.wb {
  position: relative;
  isolation: isolate;
  padding: clamp(90px, 11vw, 150px) clamp(16px, 5vw, 64px) clamp(96px, 12vw, 160px);
  background: #050b12;
  border-top: 1px solid rgba(125,211,252,0.22);
  border-bottom: 1px solid rgba(125,211,252,0.22);
  overflow: hidden;
}
.wb-blueprint {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(125,211,252,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,211,252,0.055) 1px, transparent 1px),
    linear-gradient(rgba(125,211,252,0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,211,252,0.11) 1px, transparent 1px);
  background-size: 12px 12px, 12px 12px, 96px 96px, 96px 96px;
  mask-image: radial-gradient(ellipse 92% 78% at 50% 38%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 92% 78% at 50% 38%, #000 35%, transparent 100%);
}
.wb-blueprint::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 45% at 50% 0%, rgba(125,211,252,0.12), transparent 65%);
}
.wb-inner { max-width: 1280px; margin: 0 auto; }

.wb-head { max-width: 760px; margin-bottom: clamp(34px, 5vw, 56px); }
.wb-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--wb-ink);
  padding: 7px 12px;
  border: 1px solid var(--wb-line);
  background: rgba(125,211,252,0.05);
}
.wb-kicker::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--wb-warm); box-shadow: 0 0 10px var(--wb-warm);
}
.wb-title {
  font-family: var(--font-product-serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 6.4vw, 4.8rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 20px 0 16px;
  color: #eaf4ff;
}
.wb-lead { color: #93a7ba; font-size: 1.02rem; line-height: 1.7; max-width: 62ch; }
.wb-lead em { color: var(--wb-ink); font-style: normal; }

/* ---- CAD window ---- */
.wb-cad {
  --wb-model-color: var(--wb-ink);
  border: 1px solid var(--wb-line);
  background: var(--wb-panel);
  backdrop-filter: blur(8px);
  box-shadow: 0 40px 90px -50px rgba(0,0,0,0.9);
}
.wb-cad__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--wb-line);
}
.wb-tabs {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-flow: row;
  width: 100%;
  min-width: 0;
}
.wb-tabs button {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #7f93a6; background: transparent; border: 0;
  border-right: 1px solid var(--wb-line);
  border-bottom: 1px solid var(--wb-line);
  padding: 13px 12px; cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.wb-tabs button:hover { color: #dceefc; background: rgba(125,211,252,0.06); }
.wb-tabs button[aria-selected="true"] {
  color: #04121c; background: var(--tool-color, var(--wb-model-color)); font-weight: 600;
}
.wb-status {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 10px 18px;
  font-family: var(--font-mono); font-size: 0.6rem;
  line-height: 1.45;
  letter-spacing: 0.16em; text-transform: uppercase; color: #7f93a6;
  overflow-wrap: anywhere;
}
.wb-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--wb-warm); box-shadow: 0 0 8px var(--wb-warm);
}
.wb-cad.is-busy .wb-dot { animation: wb-pulse .7s ease-in-out infinite; }
@keyframes wb-pulse { 50% { opacity: .25; } }

.wb-cad__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  min-height: 460px;
}
.wb-viewport {
  position: relative;
  border-right: 1px solid var(--wb-line);
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(125,211,252,0.07), transparent 70%),
    #060d15;
  min-height: 420px;
}
#wb-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#wb-canvas:active { cursor: grabbing; }
.wb-tick { position: absolute; width: 14px; height: 14px; pointer-events: none; opacity: .8; }
.wb-tick--tl { top: 12px; left: 12px; border-top: 1px solid var(--wb-ink); border-left: 1px solid var(--wb-ink); }
.wb-tick--tr { top: 12px; right: 12px; border-top: 1px solid var(--wb-ink); border-right: 1px solid var(--wb-ink); }
.wb-tick--bl { bottom: 12px; left: 12px; border-bottom: 1px solid var(--wb-ink); border-left: 1px solid var(--wb-ink); }
.wb-tick--br { bottom: 12px; right: 12px; border-bottom: 1px solid var(--wb-ink); border-right: 1px solid var(--wb-ink); }
.wb-hud {
  position: absolute; top: 20px; left: 20px;
  display: grid; gap: 4px;
  font-family: var(--font-mono); font-size: 0.62rem;
  pointer-events: none;
}
.wb-hud__row { display: flex; gap: 10px; align-items: baseline; }
.wb-hud__row span { color: rgba(125,211,252,0.55); letter-spacing: 0.14em; text-transform: uppercase; min-width: 66px; }
.wb-hud__row b { color: #dceefc; font-weight: 500; letter-spacing: 0.04em; }
.wb-drag {
  position: absolute; bottom: 18px; right: 20px;
  font-family: var(--font-mono); font-size: 0.55rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(147,167,186,0.5); pointer-events: none;
}

.wb-params { padding: 20px 20px 24px; display: grid; gap: 15px; align-content: start; overflow-y: auto; max-height: 620px; }
.wb-tool-summary {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--wb-line);
  padding-bottom: 15px;
}
.wb-tool-summary > span {
  color: var(--wb-model-color);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.wb-tool-summary h3 {
  margin: 0;
  color: var(--wb-text);
  font-family: var(--font-product-serif);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}
.wb-tool-source {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--wb-mute);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wb-tool-source i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wb-model-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--wb-model-color) 65%, transparent);
}
.wb-tool-source.is-custom i { background: var(--wb-warm); }
.wb-tool-summary > a {
  width: fit-content;
  margin-top: 4px;
  color: var(--wb-model-color);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  line-height: 1.45;
  text-decoration: none;
}
.wb-tool-summary > a:hover { text-decoration: underline; }

.wb-appearance {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--wb-line);
  padding-bottom: 15px;
}
.wb-appearance__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.wb-appearance__heading span,
.wb-appearance__heading strong { display: block; }
.wb-appearance__heading span {
  margin-bottom: 3px;
  color: var(--wb-mute);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wb-appearance__heading strong {
  color: var(--wb-text);
  font-size: 0.72rem;
  font-weight: 500;
}
.wb-appearance__heading output {
  color: var(--wb-model-color);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}
.wb-color-palette {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}
.wb-color-swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--swatch-color) 45%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--swatch-color) 16%, transparent);
  cursor: pointer;
}
.wb-color-swatch::after {
  position: absolute;
  inset: 5px;
  border-radius: 2px;
  background: var(--swatch-color);
  content: '';
}
.wb-color-swatch[aria-checked='true'] {
  outline: 1px solid var(--swatch-color);
  outline-offset: 2px;
}
.wb-color-swatch:focus-visible,
.wb-color-custom:focus-within,
#wb-color-default:focus-visible {
  outline: 2px solid var(--wb-text);
  outline-offset: 2px;
}
.wb-color-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wb-color-custom {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--wb-mute);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.55rem;
}
.wb-color-custom input {
  width: 30px;
  height: 24px;
  border: 1px solid var(--wb-line);
  border-radius: 4px;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}
#wb-color-default {
  border: 0;
  background: transparent;
  padding: 3px 0;
  color: var(--wb-model-color);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.52rem;
}
.wb-appearance > p {
  margin: 0;
  color: var(--wb-mute);
  font-size: 0.66rem;
  line-height: 1.45;
}
.wb-params #wb-params {
  display: grid;
  border-top: 1px solid rgba(125,211,252,0.12);
}
.wb-field {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(125,211,252,0.12);
}
.wb-field__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.wb-field__top label {
  min-width: 0;
  color: #8fa3b6;
  line-height: 1.35;
}
.wb-field__val { color: var(--wb-ink); font-variant-numeric: tabular-nums; }
.wb-field select {
  width: 142px;
  min-width: 0;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid rgba(125,211,252,0.16);
  border-radius: 6px;
  background: rgba(125,211,252,0.035);
  color: #dceefc;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  cursor: pointer;
}
.wb-toggle {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
  cursor: pointer;
  border: 0;
  border-bottom: 1px solid rgba(125,211,252,0.12);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8fa3b6;
  transition: color .18s ease;
}
.wb-toggle:hover { color: #dceefc; }
.wb-toggle input {
  width: 17px;
  height: 17px;
  margin: 0 8px 0 0;
  accent-color: var(--wb-model-color);
  cursor: pointer;
}

.wb-cad__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-top: 1px solid var(--wb-line);
}
.wb-blurb { color: #7f93a6; font-size: 0.86rem; max-width: 52ch; margin: 0; }
.wb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wb-btn {
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 12px 18px; cursor: pointer; text-decoration: none;
  color: #04121c; background: var(--wb-ink); border: 1px solid var(--wb-ink);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.wb-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -12px var(--wb-ink); }
.wb-btn--ghost { background: transparent; color: var(--wb-ink); }
.wb-btn--ghost:hover { background: rgba(125,211,252,0.1); }

/* ---- index of everything else ---- */
.wb-index {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(28px, 4vw, 56px);
  margin-top: clamp(40px, 5vw, 64px);
}
.wb-col h3 {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--wb-warm);
  padding-bottom: 10px; margin-bottom: 4px;
  border-bottom: 1px solid rgba(251,191,36,0.25);
}
.wb-line {
  display: flex; align-items: baseline; gap: 10px;
  padding: 13px 2px; text-decoration: none;
  border-bottom: 1px solid rgba(125,211,252,0.08);
  transition: padding-left .22s cubic-bezier(.2,.7,.3,1), background .2s ease;
}
.wb-line:hover { padding-left: 9px; background: linear-gradient(90deg, rgba(125,211,252,0.07), transparent 75%); }
.wb-line span { color: #dceefc; font-size: 0.98rem; white-space: nowrap; }
.wb-line i {
  flex: 1; height: 1px; align-self: center;
  background-image: linear-gradient(90deg, rgba(125,211,252,0.4) 40%, transparent 0);
  background-size: 6px 1px; background-repeat: repeat-x;
}
.wb-line em {
  font-style: normal; text-align: right;
  font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.1em; color: #6f8598; white-space: nowrap;
}
.wb-line:hover em { color: var(--wb-ink); }

@media (max-width: 1000px) {
  .wb-cad__body { grid-template-columns: 1fr; }
  .wb-viewport { border-right: 0; border-bottom: 1px solid var(--wb-line); }
  .wb-params { max-height: none; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .wb-params > #wb-params {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    column-gap: 24px;
  }
  .wb-params > #wb-extra { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .wb-viewport { min-height: 320px; }
  .wb-params { grid-template-columns: 1fr; }
  .wb-params > #wb-params { grid-template-columns: 1fr; }
  .wb-line { flex-wrap: wrap; gap: 4px 10px; }
  .wb-line i { display: none; }
  .wb-line em { text-align: left; flex-basis: 100%; }
  .wb-hud__row span { min-width: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .wb-line, .wb-btn { transition: none; }
  .wb-cad.is-busy .wb-dot { animation: none; }
}
/* ==========================================================
   WORKBENCH PAGE (workbench.html)
   The homepage section is a teaser; this is the shop floor.
   Shares every .wb-* component above — only the page shell,
   the cutout editor and the calculators live down here.
   ========================================================== */
.wbp {
  --font-product-serif: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 0;
  background: var(--wb-paper);
  color: var(--wb-text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wbp * { box-sizing: border-box; }
.wbp .wb { border-top: 0; }

/* --- page chrome --- */
.wbp-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 5vw, 64px);
  background: rgba(5,11,18,0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--wb-line);
}
.wbp-nav a {
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--wb-mute); text-decoration: none;
  transition: color .18s ease;
}
.wbp-nav a:hover { color: var(--wb-ink); }
.wbp-nav strong {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--wb-text);
}
.wbp-nav ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }

@media (max-width: 620px) {
  .wbp-nav { padding-block: 12px; }
  .wbp-nav strong { display: none; }
  .wbp-nav ul { gap: 12px; }
}

.wbp-main { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 64px) 120px; }
.wbp-hero { padding: clamp(56px, 8vw, 104px) 0 clamp(30px, 4vw, 48px); max-width: 780px; }
.wbp-sec { padding-top: clamp(56px, 7vw, 96px); scroll-margin-top: 70px; }
.wbp-sec > h2 {
  font-family: var(--font-product-serif); font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.9rem); letter-spacing: -0.035em;
  margin: 0 0 10px;
}
.wbp-sec > p.wbp-sub { color: var(--wb-mute); max-width: 62ch; line-height: 1.65; margin: 0 0 28px; }
.wbp-note {
  border-left: 2px solid var(--wb-warm);
  background: rgba(251,191,36,0.05);
  padding: 12px 16px; margin: 22px 0 0;
  font-size: 0.85rem; line-height: 1.6; color: #b9c7d4;
}
.wbp-note strong { color: var(--wb-warm); }

/* the full page gets a taller viewport and a wider parameter rail */
.wbp .wb-cad__body { grid-template-columns: minmax(0, 1fr) 330px; min-height: 560px; }
.wbp .wb-viewport { min-height: 560px; }
.wbp .wb-params { max-height: 720px; }

/* --- panel cutout editor --- */
.wb-cuts { display: grid; gap: 8px; margin-top: 4px; }
.wb-cuts__head {
  padding-top: 16px;
  border-top: 1px solid var(--wb-line);
  color: var(--wb-model-color);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wb-cut {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(125,211,252,0.12);
  background: transparent;
}
.wb-cut__name {
  font-family: var(--font-mono); font-size: 0.62rem;
  color: var(--wb-text); letter-spacing: 0.06em;
}
.wb-cut__fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wb-cut__fields label {
  display: grid; gap: 3px;
  font-family: var(--font-mono); font-size: 0.52rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--wb-mute);
}
.wb-num, .wb-cut__fields input {
  width: 100%; padding: 6px 7px;
  background: rgba(5,11,18,0.7); border: 1px solid var(--wb-line);
  color: var(--wb-text); font-family: var(--font-mono); font-size: 0.68rem;
}
.wb-num:focus, .wb-cut__fields input:focus, .wb-field select:focus {
  outline: none; border-color: var(--wb-ink);
}
.wb-x {
  background: transparent; border: 1px solid var(--wb-line); color: var(--wb-mute);
  font-family: var(--font-mono); font-size: 0.68rem; line-height: 1;
  padding: 5px 8px; cursor: pointer;
}
.wb-x:hover { color: #fca5a5; border-color: rgba(252,165,165,0.5); }
.wb-add { display: flex; gap: 6px; }
.wb-add select { flex: 1; }
.wb-add button {
  padding: 0 14px; cursor: pointer;
  background: rgba(125,211,252,0.1); border: 1px solid var(--wb-line);
  color: var(--wb-ink); font-family: var(--font-mono); font-size: 0.68rem;
}
.wb-add button:hover { background: rgba(125,211,252,0.2); }

/* --- cable cubby row / column labels --- */
.wb-labels__note {
  margin: 7px 0 10px;
  color: var(--wb-mute);
  font-size: 0.62rem;
  line-height: 1.45;
}
.wb-labels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.wb-labels > strong {
  grid-column: 1 / -1;
  color: var(--wb-text);
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wb-labels label {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--wb-mute);
  font-family: var(--font-mono);
  font-size: 0.52rem;
}
.wb-labels input {
  min-width: 0;
  height: 32px;
  border: 1px solid var(--wb-line);
  border-radius: 6px;
  background: rgba(5,11,18,0.7);
  padding: 0 9px;
  color: var(--wb-text);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}
.wb-labels input:focus {
  outline: none;
  border-color: var(--wb-model-color);
}

/* --- calculators --- */
.wbp-calcs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}
.wb-calc {
  border: 1px solid var(--wb-line);
  background: var(--wb-panel);
  padding: 20px;
  scroll-margin-top: 84px;
  display: grid; gap: 14px; align-content: start;
}
.wb-calc > header h3 {
  font-family: var(--font-product-serif); font-weight: 650;
  font-size: 1.2rem; letter-spacing: -0.02em; margin: 0 0 5px;
}
.wb-calc > header p {
  margin: 0; color: var(--wb-mute); font-size: 0.82rem; line-height: 1.55;
}
.wb-calc__grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.wb-calc__grid label, .wb-calc__row label {
  display: grid; gap: 5px;
  font-family: var(--font-mono); font-size: 0.55rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--wb-mute);
}
.wb-calc select {
  padding: 7px 8px; background: rgba(5,11,18,0.7);
  border: 1px solid var(--wb-line); color: var(--wb-text);
  font-family: var(--font-mono); font-size: 0.68rem;
}
.wb-out {
  border-top: 1px solid var(--wb-line); padding-top: 12px;
  display: grid; gap: 7px;
}
.wb-out__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: 0.7rem;
}
.wb-out__row span { color: var(--wb-mute); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.55rem; }
.wb-out__row b { color: var(--wb-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.wb-out__row.is-hero b { font-size: 1.05rem; color: var(--wb-warm); }
.wb-out__warn { color: #fca5a5; font-size: 0.72rem; font-family: var(--font-mono); line-height: 1.5; }
.wb-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-mono); font-size: 0.66rem;
}
.wb-table th {
  text-align: left; color: var(--wb-mute); font-weight: 500;
  font-size: 0.53rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 8px 6px 0; border-bottom: 1px solid var(--wb-line);
}
.wb-table td {
  padding: 6px 8px 6px 0; border-bottom: 1px solid rgba(125,211,252,0.06);
  color: var(--wb-text); font-variant-numeric: tabular-nums;
}
.wb-table td:first-child { color: var(--wb-mute); }

.wbp-foot {
  border-top: 1px solid var(--wb-line);
  padding: 28px clamp(16px, 5vw, 64px);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--wb-mute);
}
.wbp-foot a { color: var(--wb-ink); text-decoration: none; }

@media (max-width: 1000px) {
  .wbp .wb-cad__body { grid-template-columns: 1fr; }
  .wbp .wb-viewport { min-height: 400px; }
}

/* --- invalid configuration --- */
.wb-issues {
  flex-basis: 100%;
  margin: 0;
  color: #fca5a5;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.55;
}
.wb-cad.is-invalid { border-color: rgba(252,165,165,0.45); }
.wb-cad.is-invalid .wb-dot { background: #fca5a5; box-shadow: 0 0 8px #fca5a5; }
.wb-cad.is-invalid .wb-status { color: #fca5a5; }
.wb-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== Icon tabs =====
   Tabs carry the same fine-line glyphs as the 3D tool picker. Labels
   remain visible on wide screens and collapse only when space is tight. */
.wb-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    line-height: 1.2;
}
.wb-tabs button > span {
    display: grid;
    gap: 2px;
    min-width: 0;
    text-align: left;
    overflow-wrap: anywhere;
}
.wb-tabs button strong {
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
}
.wb-tabs button small {
    color: currentColor;
    font-size: 0.45rem;
    line-height: 1.3;
    letter-spacing: 0.1em;
    opacity: 0.62;
}
.wb-tabs button svg {
    width: 16px; height: 16px;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}
.wb-tabs button[aria-selected="true"] svg { opacity: 1; }
@media (max-width: 1100px) {
    .wb-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .wb-tabs {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(132px, 44vw);
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        scroll-snap-type: inline proximity;
    }
    .wb-tabs button {
        justify-content: flex-start;
        padding: 10px 9px;
        scroll-snap-align: start;
    }
    .wb-tabs button > span { display: grid; }
    .wb-status {
        justify-content: flex-start;
        min-height: 34px;
        padding: 8px 10px;
        font-size: 0.52rem;
        letter-spacing: 0.11em;
    }
}

/* ===== Piece strip =====
   Shown only when a planner reports that an insert has to print in
   multiple parts. It stays dormant for generators without a plan(). */
.wb-tiles {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 0;
}
.wb-tiles[hidden] { display: none; }
.wb-tiles__label {
    font: 600 0.66rem/1 var(--wb-font-mono, ui-monospace, monospace);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #7dd3fc;
}
.wb-tiles__row { display: flex; gap: 6px; flex-wrap: wrap; }
.wb-tile {
    min-width: 30px;
    padding: 6px 9px;
    font: 500 0.76rem/1 var(--wb-font-mono, ui-monospace, monospace);
    color: #9fb0c4;
    background: rgba(10, 16, 24, 0.6);
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 7px;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.wb-tile:hover { color: #dbe4f0; border-color: rgba(125, 211, 252, 0.55); }
.wb-tile.is-on {
    color: #04121a;
    background: #7dd3fc;
    border-color: #7dd3fc;
}
.wb-tile:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }

/* A note (for example, an insert split into pieces) is not a failure. */
.wb-issues.is-note {
    color: #9fb0c4;
    border-color: rgba(125, 211, 252, 0.3);
}

/* ===== Compact parameter stepper =====
   A parameter gets one control: type an exact value or use ± for one
   declared step. This stays compact enough for both public and Studio rails. */
.wb-stepper {
    display: inline-flex;
    align-items: center;
    width: 142px;
    height: 34px;
    box-sizing: border-box;
    overflow: hidden;
    background: rgba(125, 211, 252, 0.035);
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 6px;
}
.wb-stepper:focus-within {
    border-color: var(--wb-model-color);
    background: rgba(125, 211, 252, 0.06);
}
.wb-stepper__input {
    width: 52px;
    min-width: 0;
    flex: 1 1 52px;
    padding: 0 3px;
    text-align: right;
    font: 500 0.76rem/1 var(--wb-font-mono, ui-monospace, monospace);
    color: #eaf2fb;
    background: transparent;
    border: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}
.wb-stepper__input::-webkit-outer-spin-button,
.wb-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wb-stepper__input:focus { outline: none; }
.wb-stepper__unit {
    flex: none;
    padding: 0 6px 0 2px;
    font: 500 0.58rem/1 var(--wb-font-mono, ui-monospace, monospace);
    color: #7f8ea1;
    text-transform: none;
}
.wb-stepper__unit:empty { display: none; }
.wb-stepper__button {
    width: 31px;
    height: 32px;
    flex: 0 0 31px;
    display: grid; place-items: center;
    font: 600 14px/1 var(--wb-font-mono, ui-monospace, monospace);
    color: #9fb0c4;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.wb-stepper__button:first-child { border-right: 1px solid rgba(125,211,252,0.1); }
.wb-stepper__button:last-child { border-left: 1px solid rgba(125,211,252,0.1); }
.wb-stepper__button:hover { background: rgba(125, 211, 252, 0.1); color: #eaf2fb; }
.wb-stepper__button:active { background: rgba(125, 211, 252, 0.18); }

@media (max-width: 420px) {
    .wb-stepper,
    .wb-field select { width: 132px; }
}

/* ===== 3D bench picker =====
   The tool menu is the bench itself; the tab strip below it stays as the
   keyboard path and the fallback when WebGL is missing. */
.wb-bench {
    position: relative;
    width: 100%;
    height: 240px;
    margin: 0 0 2px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.14);
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(125, 211, 252, 0.06), transparent 70%),
        rgba(6, 11, 18, 0.5);
    overflow: hidden;
}
.wb-bench canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.wb-bench canvas:active { cursor: grabbing; }
.wb-bench__hint {
    position: absolute;
    left: 14px; bottom: 10px;
    font: 500 0.62rem/1 var(--wb-font-mono, ui-monospace, monospace);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #62748c;
    pointer-events: none;
}
@media (max-width: 700px) { .wb-bench { height: 180px; } }
@media (prefers-reduced-motion: reduce) { .wb-bench { display: none; } }

/* ===== Compact, readable Workbench pass =====
   Interface copy uses Inter; mono is reserved for measured values. The
   homepage preview is intentionally compact while the dedicated app keeps
   its full-canvas layout. */
.wb {
  --wb-font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wb-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: var(--wb-font-ui);
}
.wb-title,
.wb-tool-summary h3 {
  font-family: var(--wb-font-ui);
}
.wb-title { letter-spacing: -0.03em; }
.wb-tool-summary h3 { font-weight: 600; letter-spacing: -0.01em; }
.wb-kicker {
  font: 600 0.72rem/1.3 var(--wb-font-ui);
  letter-spacing: 0.06em;
}
.wb-tabs button {
  gap: 8px;
  padding: 11px 10px;
  font: 600 0.74rem/1.3 var(--wb-font-ui);
  letter-spacing: 0;
  text-transform: none;
}
.wb-tabs button svg { width: 19px; height: 19px; }
#workbench .wb-tabs button small { display: none; }
.wb-status {
  font: 600 0.7rem/1.35 var(--wb-font-ui);
  letter-spacing: 0.02em;
  text-transform: none;
}
.wb-hud { font-family: var(--wb-font-mono); font-size: 0.7rem; }
.wb-hud__row span {
  color: #8295aa;
  font: 500 0.68rem/1.4 var(--wb-font-ui);
  letter-spacing: 0;
  text-transform: none;
}
.wb-hud__row b {
  font-family: var(--wb-font-mono);
  font-size: 0.7rem;
}
.wb-drag,
.wb-bench__hint {
  font: 500 0.7rem/1.3 var(--wb-font-ui);
  letter-spacing: 0;
  text-transform: none;
}
.wb-tool-summary > span,
.wb-appearance__heading span,
.wb-col h3 {
  font-family: var(--wb-font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.055em;
}
.wb-tool-source,
.wb-tool-summary > a,
.wb-color-custom,
#wb-color-default,
.wb-line em {
  font-family: var(--wb-font-ui);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}
.wb-field__top,
.wb-toggle {
  font-family: var(--wb-font-ui);
  font-size: 0.77rem;
  letter-spacing: 0;
  text-transform: none;
}
.wb-field select {
  font-family: var(--wb-font-ui);
  font-size: 0.74rem;
}
.wb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  font: 600 0.76rem/1 var(--wb-font-ui);
  letter-spacing: 0;
  text-transform: none;
}
.wb-btn svg,
#wb-color-default svg,
.wb-tool-summary > a svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#wb-color-default,
.wb-tool-summary > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.wb-bench__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wb-bench__hint svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wb-stepper__unit { font-size: 0.68rem; }
.wb-cuts__head,
.wb-cut__name,
.wb-cut__fields label,
.wb-add button,
.wb-labels > strong,
.wb-labels label {
  font-family: var(--wb-font-ui);
  letter-spacing: 0;
  text-transform: none;
}
.wb-cuts__head,
.wb-labels > strong { font-size: 0.7rem; }
.wb-cut__name,
.wb-add button { font-size: 0.75rem; }
.wb-cut__fields label,
.wb-labels label { font-size: 0.7rem; }
.wb-calc__grid label,
.wb-calc__row label {
  font: 500 0.75rem/1.3 var(--wb-font-ui);
  letter-spacing: 0;
  text-transform: none;
}

/* Homepage sizing: roughly one-third shorter overall, with the parameter
   rail scrolling inside the compact model row instead of stretching it. */
#workbench {
  padding-top: clamp(72px, 8vw, 110px);
  padding-bottom: clamp(80px, 9vw, 120px);
}
#workbench .wb-head { margin-bottom: clamp(26px, 3vw, 38px); }
#workbench .wb-title { font-size: clamp(2.4rem, 5.4vw, 4.2rem); }
#workbench .wb-cad__bar {
  grid-template-columns: minmax(0, 1fr) auto;
}
#workbench .wb-bench {
  grid-column: 1 / -1;
  height: 160px;
}
#workbench .wb-tabs {
  grid-column: 1;
}
#workbench .wb-status {
  grid-column: 2;
  width: auto;
  min-width: 124px;
  justify-content: center;
  border-left: 1px solid var(--wb-line);
  border-bottom: 1px solid var(--wb-line);
}
#workbench .wb-cad__body {
  grid-template-columns: minmax(0, 1fr) 320px;
  height: clamp(320px, 30vw, 380px);
  min-height: 0;
}
#workbench .wb-viewport { min-height: 0; }
#workbench .wb-params {
  height: 100%;
  max-height: none;
  padding: 17px 18px 20px;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
}
#workbench .wb-cad__foot {
  gap: 14px;
  padding: 14px 18px;
}
#workbench .wb-actions { gap: 8px; }
#workbench .wb-blurb { font-size: 0.82rem; line-height: 1.5; }

@media (max-width: 1000px) {
  #workbench .wb-cad__body {
    grid-template-columns: 1fr;
    height: auto;
  }
  #workbench .wb-viewport {
    height: clamp(260px, 48vw, 340px);
    min-height: 260px;
  }
  #workbench .wb-params {
    height: auto;
    max-height: 520px;
  }
}
@media (max-width: 700px) {
  #workbench .wb-cad__bar { grid-template-columns: 1fr; }
  #workbench .wb-bench { height: 140px; }
  #workbench .wb-tabs,
  #workbench .wb-status { grid-column: 1; }
  #workbench .wb-status {
    min-width: 0;
    justify-content: flex-start;
    border-left: 0;
  }
  #workbench .wb-viewport { height: 280px; min-height: 280px; }
}
