@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;600;700;800&display=swap");
:root {
  --ink: #20211e;
  --muted: #77796e;
  --paper: #f2ead8;
  --panel: #efeee8;
  --edge: #c9c8bd;
  --orange: #f05a3c;
  --yellow: #f3cb4c;
  --dark: #1c1d1a;
}
.recovery { height:36px; background:#f3cb4c; color:#352f18; display:flex; align-items:center; justify-content:center; gap:14px; font-size:11px; font-weight:800 }
.recovery button { padding:4px 8px; background:#fff8 }
.recovery:not(.hidden) + main { height:calc(100% - 162px) }
.dimension-row,.export-dimensions { display:grid; grid-template-columns:1fr auto 1fr auto; align-items:center; gap:5px; margin-top:9px }
.dimension-row input,.export-dimensions input { width:100%; min-width:0; padding:7px 5px; border:1px solid #aaa; border-radius:5px; font:11px DM Mono }
.dimension-row span,.export-dimensions span { font:10px DM Mono; color:#777 }
.preset-row { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; margin-top:6px }
.preset-row button { padding:5px 2px; font-size:9px }
.mini { padding:4px 6px; font-size:8px }
.layer { grid-template-columns:24px 1fr 22px }
.layer.selected { border-color:var(--orange); box-shadow:0 0 0 2px #f05a3c33 }
.layer > div { min-width:0 }
.layer .swatch { float:left; margin-right:6px }
.layer-tools { display:flex; gap:2px; margin-top:4px }
.layer-tools button { background:#e8e6de; border:1px solid #cbc9c0; padding:1px 5px }
.export-dimensions { grid-template-columns:1fr auto 1fr; margin:12px 0 }
.export-dimensions input:disabled { background:#deddd5; color:#666 }
dialog small { display:block; max-width:320px; color:#777; font-size:10px; line-height:1.4 }
.project-actions button:focus-visible,.panel button:focus-visible,footer button:focus-visible,input:focus-visible,select:focus-visible,.layer:focus-visible { outline:3px solid #f3cb4c; outline-offset:2px }
@media(max-width:1050px) { header{padding:0 10px}.brand p{display:none}main{grid-template-columns:196px minmax(390px,1fr) 220px}.panel{padding:10px}.piece-grid{grid-template-columns:repeat(3,1fr)}footer{grid-template-columns:1fr auto}.speed{display:none}.status{min-width:120px} }
@media(max-height:760px) { header{height:54px}main{height:calc(100% - 110px)}footer{height:56px}.panel section{padding:8px 0}.wheel-grid{max-height:110px}.brand-mark{width:30px;height:30px}.recovery:not(.hidden)+main{height:calc(100% - 146px)} }
* {
  box-sizing: border-box;
}
html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  font-family: Manrope, Arial, sans-serif;
  color: var(--ink);
  background: #d6d4cc;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 1px solid #aaa99f;
  background: #f8f7f1;
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: 0.15s;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 0 #aaa99f;
}
button:active {
  transform: none;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.hidden {
  display: none !important;
}
header {
  height: 64px;
  background: var(--dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 3px solid var(--orange);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border: 2px dotted var(--yellow);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--orange);
  font-size: 25px;
}
.brand h1 {
  font-size: 17px;
  letter-spacing: 0.19em;
  margin: 0;
  font-weight: 800;
}
.brand p {
  font:
    9px DM Mono,
    monospace;
  letter-spacing: 0.26em;
  color: #aaa;
  margin: 2px 0 0;
}
.project-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}
.project-actions button {
  background: #30312d;
  color: #eee;
  border-color: #55564f;
}
.project-actions .quiet {
  background: transparent;
}
.divider {
  height: 20px;
  border-left: 1px solid #555;
}
main {
  height: calc(100% - 126px);
  display: grid;
  grid-template-columns: 250px minmax(520px, 1fr) 286px;
}
.panel {
  background: var(--panel);
  padding: 15px;
  overflow-y: auto;
}
.lab-abuse{border-top:1px solid #c8c6bc;padding:10px 0}.lab-abuse summary{cursor:pointer;font:700 10px DM Mono;letter-spacing:.08em}.lab-abuse label{display:grid;gap:3px;margin-top:8px}.lab-abuse input[type=range]{width:100%}.lab-abuse button{margin-top:10px;width:100%}
.left {
  border-right: 1px solid var(--edge);
}
.right {
  border-left: 1px solid var(--edge);
}
section {
  border-bottom: 1px solid var(--edge);
  padding: 13px 0;
}
.panel section:last-child {
  border-bottom: 0;
}
.panel label,
.speed label {
  display: block;
  font:
    500 10px DM Mono,
    monospace;
  letter-spacing: 0.13em;
  color: #66685f;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.section-head strong {
  font:
    500 26px DM Mono,
    monospace;
  color: var(--orange);
}
.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #d7d6ce;
  border-radius: 7px;
  padding: 3px;
  gap: 3px;
}
.segment button {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.segment button.active {
  background: #fff;
  color: var(--orange);
  box-shadow: 0 1px 3px #aaa;
}
.piece-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.piece-grid button {
  font:
    500 12px DM Mono,
    monospace;
  padding: 7px 2px;
}
.piece-grid button.active,
.holes button.active {
  background: var(--yellow);
  border-color: #8c7624;
  box-shadow: inset 0 -2px #c69c20;
}
.wheel-grid {
  max-height: 163px;
  overflow: auto;
  padding-right: 3px;
}
.mode {
  margin-top: 8px;
}
.lab-input {
  display: flex;
  align-items: center;
  gap: 7px;
}
.lab-input input {
  width: 100%;
  font: 500 24px DM Mono;
  padding: 8px;
  border: 1px solid #aaa;
  border-radius: 6px;
}
.lab-input span {
  font: 10px DM Mono;
  color: #777;
}
.hole-nav {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  gap: 5px;
}
.hole-nav > button {
  padding: 4px;
}
.holes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.holes button {
  border-radius: 50%;
  padding: 4px 0;
  font: 500 11px DM Mono;
}
.validation {
  font-size: 11px;
  color: #b02c22;
  line-height: 1.4;
  margin: 8px 0 0;
}
.stage {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 0;
  padding: 0;
}
.stage:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#312f2912 1px, transparent 1px);
  background-size: 12px 12px;
  mix-blend-mode: multiply;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}
.canvas-top {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.canvas-top > * {
  pointer-events: auto;
}
.switch {
  display: flex;
  align-items: center !important;
  gap: 8px;
  background: #ffffffd9;
  padding: 8px 10px;
  border: 1px solid #aaa;
  border-radius: 20px;
  color: #333 !important;
}
.switch input {
  display: none;
}
.switch span {
  width: 27px;
  height: 15px;
  border-radius: 10px;
  background: #aaa;
  position: relative;
}
.switch span:after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: white;
  transition: 0.2s;
}
.switch input:checked + span {
  background: var(--orange);
}
.switch input:checked + span:after {
  left: 14px;
}
.canvas-button {
  background: #ffffffc9;
}
.empty-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #615f56;
  pointer-events: none;
}
.empty-hint b {
  display: block;
  font-size: 20px;
}
.empty-hint span {
  display: block;
  font-size: 12px;
  margin-top: 5px;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}
.color-row input,
.field input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 2px;
  border: 1px solid #aaa;
  border-radius: 5px;
}
.color-row span {
  font: 13px DM Mono;
}
.field {
  margin-top: 13px;
}
.field > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.field output {
  font: 11px DM Mono;
}
.field input[type="range"],
.speed input {
  width: 100%;
  accent-color: var(--orange);
}
.pattern-info dl {
  margin: 8px 0 0;
}
.pattern-info dl div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font: 11px DM Mono;
}
.pattern-info dt {
  color: #777;
}
.pattern-info dd {
  margin: 0;
}
.closed {
  color: #44874a;
}
.layers-section {
  min-height: 150px;
}
.layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.no-layers {
  font-size: 11px;
  color: #888;
  text-align: center;
  padding: 14px;
}
.layer {
  display: grid;
  grid-template-columns: 28px 1fr 25px;
  align-items: center;
  gap: 7px;
  background: #faf9f4;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 7px;
}
.layer .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid;
}
.layer b {
  display: block;
  font: 500 11px DM Mono;
}
.layer small {
  font-size: 9px;
  color: #777;
}
.layer button {
  padding: 2px;
  border: 0;
  background: none;
  font-size: 14px;
  box-shadow: none;
}
.layer.hidden-layer {
  opacity: 0.45;
}
footer {
  height: 62px;
  background: var(--dark);
  color: #fff;
  display: grid;
  grid-template-columns: auto minmax(250px, 430px) 180px;
  gap: 26px;
  align-items: center;
  padding: 0 16px;
}
.transport {
  display: flex;
  gap: 6px;
}
.transport button {
  background: #30312d;
  color: #eee;
  border-color: #555;
}
.transport .primary {
  background: var(--orange);
  border-color: #ff8068;
}
.transport .danger {
  color: #ff9383;
}
.speed {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 9px;
}
.speed span {
  font-size: 9px;
  color: #999;
}
.status {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 7px;
  font: 10px DM Mono;
  color: #aaa;
}
.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5b9e62;
}
.status i.drawing {
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}
dialog {
  border: 0;
  border-radius: 10px;
  box-shadow: 0 15px 60px #0008;
  padding: 0;
  background: #f4f2ea;
}
dialog::backdrop {
  background: #111a;
}
dialog form {
  padding: 22px;
  min-width: 340px;
}
dialog h2 {
  margin: 0 0 18px;
}
dialog form > label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 11px DM Mono;
  margin: 13px 0;
}
dialog select {
  padding: 7px;
}
dialog form > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
@media (max-width: 1200px) {
  main {
    grid-template-columns: 220px minmax(430px, 1fr) 240px;
  }
  .right {
    padding: 11px;
  }
  .project-actions .quiet,
  .divider {
    display: none;
  }
  footer {
    grid-template-columns: auto 1fr 130px;
    gap: 12px;
  }
  .transport button {
    padding: 7px;
  }
}
.layer { grid-template-columns:24px 1fr 22px }
.layer.selected { border-color:var(--orange); box-shadow:0 0 0 2px #f05a3c33 }
.layer > div { min-width:0 }
.layer .swatch { float:left; margin-right:6px }
