.workshop-dialog {
  --ws-paper: #eeede7;
  --ws-ink: #242622;
  --ws-orange: #f45b32;
  --ws-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  position: fixed;
  width: min(1080px, calc(100vw - 64px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--ws-ink);
  color: var(--ws-ink);
  background: var(--ws-paper);
  overflow: auto;
  margin: auto;
  box-shadow: 10px 10px 0 rgb(36 38 34 / 15%);
}
.workshop-dialog::backdrop {
  background: rgb(22 23 20 / 68%);
  backdrop-filter: blur(6px);
}
.workshop-dialog[open] {
  animation: ws-enter 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.workshop-dialog.ws-fallback {
  inset: 0;
  z-index: 1000;
  box-shadow: 0 0 0 100vmax rgb(22 23 20 / 70%);
}
body.workshop-open {
  overflow: hidden;
}
.ws-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 21px 28px;
}
.ws-eyebrow {
  font: 11px/1.5 var(--ws-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 5px;
  color: #606455;
}
.ws-title {
  margin: 0;
  font-family: inherit;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-weight: 500;
}
.ws-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ws-ink);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.ws-close svg {
  width: 16px;
  height: 16px;
}
.ws-close:hover {
  background: var(--ws-ink);
  color: var(--ws-paper);
}
.workshop-dialog button:focus-visible,
.workshop-dialog input:focus-visible {
  outline: 3px solid #b83d1e;
  outline-offset: 3px;
}
.ws-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--ws-ink);
}
.ws-tabs button {
  min-height: 52px;
  border: 0;
  border-right: 1px solid #bfc2b4;
  padding: 12px 22px;
  background: transparent;
  color: #646959;
  font: 11px/1.5 var(--ws-mono);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ws-tabs button:last-child {
  border-right: 0;
}
.ws-tabs button span {
  color: var(--ws-ink);
  font-family: inherit;
  font-size: 14px;
}
.ws-tabs button[aria-selected="true"] {
  background: var(--ws-ink);
  color: #b7bdac;
}
.ws-tabs button[aria-selected="true"] span {
  color: var(--ws-paper);
}
.ws-tabs button:hover:not([aria-selected="true"]) {
  background: #dfdfd4;
}
.ws-panel[hidden] {
  display: none;
}
.ws-stage {
  position: relative;
  background: #dedfd3;
}
.ws-stage-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px 0;
  font: 11px/1.5 var(--ws-mono);
  color: #555c4b;
}
.ws-stage-meta span:last-child {
  white-space: nowrap;
}
.ws-stage > svg {
  display: block;
  width: 100%;
  height: 390px;
  max-height: 45dvh;
  min-height: 280px;
}
.ws-logic-stage {
  display: grid;
  grid-template-columns: 56% 44%;
  background: var(--ws-ink);
  color: var(--ws-paper);
  min-height: 414px;
}
.ws-logic-drawing {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ws-logic-drawing .ws-stage-meta {
  color: #b7beac;
}
.ws-logic-drawing svg {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 270px;
}
.ws-code-panel {
  padding: 25px 28px;
  border-left: 1px solid #525948;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ws-code-label {
  font: 11px/1.5 var(--ws-mono);
  color: #b7beac;
  margin: 0 0 17px;
}
.ws-code-panel pre {
  font: 14px/1.6 var(--ws-mono);
  margin: 0;
  color: #f0efdf;
  white-space: pre-wrap;
}
.ws-code-panel code {
  font: inherit;
}
.ws-coordinates {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #525948;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  font: 11px/1.5 var(--ws-mono);
  color: #c8cfbb;
}
.ws-check {
  font: 11px/1.5 var(--ws-mono);
  color: #c5d2b3;
  margin: 18px 0 0;
}
.ws-check-warning {
  color: #ffa386;
}
.ws-controls {
  display: flex;
  align-items: center;
  gap: 40px;
  border-top: 1px solid var(--ws-ink);
  padding: 20px 28px 15px;
}
.ws-control {
  flex: 1;
  display: block;
  min-width: 0;
  font: 12px/1.5 var(--ws-mono);
}
.ws-control-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.ws-control output {
  color: #5c6352;
  white-space: nowrap;
}
.ws-controls input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin: 4px 0 0;
  background: transparent;
  cursor: ew-resize;
  accent-color: var(--ws-orange);
}
.ws-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: #a5ab98;
}
.ws-controls input[type="range"]::-moz-range-track {
  height: 2px;
  background: #a5ab98;
}
.ws-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  height: 20px;
  width: 12px;
  margin-top: -9px;
  border: 0;
  border-radius: 0;
  background: var(--ws-ink);
}
.ws-controls input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 12px;
  border: 0;
  border-radius: 0;
  background: var(--ws-ink);
}
.ws-control-note {
  flex: 0 0 32%;
  margin: 0;
  color: #626958;
  font: 12px/1.5 var(--ws-mono);
}
.ws-matter-stage {
  background: #d6d8cb;
}
.ws-parts {
  display: flex;
  justify-content: center;
  gap: 27px;
  padding: 0 20px 16px;
  font: 11px/1.5 var(--ws-mono);
  color: #515a46;
}
.ws-parts span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.ws-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ws-ink);
}
.ws-orange {
  background: #c44421;
}
.ws-metal {
  background: #7b8670;
}
.ws-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-top: 1px solid #c6caba;
  color: #606853;
  font: 11px/1.5 var(--ws-mono);
}
@keyframes ws-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 760px) {
  .workshop-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    box-shadow: 5px 5px 0 rgb(36 38 34 / 15%);
  }
  .ws-head {
    padding: 18px 20px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--ws-paper);
  }
  .ws-title {
    font-size: 25px;
  }
  .ws-eyebrow {
    font-size: 11px;
  }
  .ws-tabs button {
    padding: 12px 16px;
    gap: 9px;
  }
  .ws-stage-meta {
    padding: 17px 20px 0;
  }
  .ws-stage > svg {
    height: 310px;
    min-height: 240px;
  }
  .ws-logic-stage {
    grid-template-columns: 1fr;
  }
  #ws-panel-logic {
    display: flex;
    flex-direction: column;
  }
  #ws-panel-logic[hidden] {
    display: none;
  }
  #ws-panel-logic .ws-controls {
    order: -1;
    border-top: 0;
    border-bottom: 1px solid var(--ws-ink);
  }
  .ws-logic-drawing svg {
    height: 290px;
    min-height: 250px;
  }
  .ws-code-panel {
    padding: 20px;
    border-left: 0;
    border-top: 1px solid #525948;
  }
  .ws-code-panel pre {
    font-size: 14px;
  }
  .ws-coordinates {
    font-size: 12px;
  }
  .ws-controls {
    padding: 18px 20px 14px;
    gap: 5px;
    flex-direction: column;
    align-items: stretch;
  }
  .ws-control-note {
    font-size: 11px;
    flex-basis: auto;
  }
  .ws-control-note br {
    display: inline;
  }
  .ws-foot {
    padding: 13px 20px;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
  }
  .ws-parts {
    gap: 17px;
    font-size: 11px;
  }
}
@media (max-width: 420px) {
  .ws-head {
    padding: 17px 16px;
  }
  .ws-title {
    font-size: 22px;
  }
  .ws-tabs button {
    padding: 12px 10px;
    gap: 7px;
  }
  .ws-tabs button span {
    font-size: 13px;
  }
  .ws-stage-meta {
    padding: 15px 16px 0;
    display: block;
  }
  .ws-stage-meta span {
    display: block;
  }
  .ws-stage-meta span + span {
    margin-top: 4px;
  }
  .ws-stage > svg {
    height: 265px;
    min-height: 220px;
  }
  .ws-parts {
    gap: 13px;
    padding-inline: 10px;
  }
  .ws-parts span {
    gap: 5px;
  }
  .ws-swatch {
    width: 6px;
    height: 6px;
  }
  .ws-controls {
    padding-inline: 16px;
  }
  .ws-control-head {
    gap: 10px;
  }
  .ws-foot {
    padding-inline: 16px;
  }
}
@media (max-height: 620px) and (min-width: 761px) {
  .workshop-dialog {
    max-height: calc(100dvh - 24px);
  }
  .ws-stage > svg {
    min-height: 200px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .workshop-dialog[open] {
    animation: none;
  }
}
.ws-foot {
  align-items: center;
}
.ws-reset {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid #858d78;
  background: transparent;
  color: var(--ws-ink);
  font: 12px/1.5 var(--ws-mono);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.ws-reset:hover {
  background: var(--ws-ink);
  color: var(--ws-paper);
}
@media (max-width: 760px) {
  .ws-foot {
    align-items: flex-start;
  }
  .ws-reset {
    margin-top: 10px;
  }
}
/* Cabinet studies retain quiet diagrams and touchable native controls. */
.ws-matter-stage > svg {
  height: 415px;
}
.ws-parts {
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .ws-cabinet-labels {
    display: none;
  }
  .ws-matter-stage > svg {
    height: 315px;
  }
}
@media (max-width: 420px) {
  .ws-matter-stage > svg {
    height: 285px;
  }
  .ws-coordinates {
    font-size: 11px;
  }
  .ws-parts {
    gap: 12px;
  }
}
