.studiohead,
.studiofoot,
.boardhead,
.workspace-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.studiohead {
  margin-bottom: 20px;
}
.studiohead p {
  color: var(--muted);
  margin: 7px 0 0;
}
.studiohead .button {
  min-height: 37px;
}
.workbench {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.tools {
  padding: 18px 19px;
}
.tools h2 {
  font: 720 1.03rem var(--body);
  margin: 7px 0 12px;
}
.tools label {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 650;
  margin: 7px 0;
}
.tools input,
.tools select,
.tools textarea {
  width: 100%;
  font-size: 0.85rem;
  padding: 5px 8px;
}
.tools input[type="color"] {
  height: 31px;
  padding: 2px;
}
.tools input[type="range"] {
  accent-color: var(--ink);
}
.tools .button,
.tools label.upload {
  display: inline-flex;
  font-size: 0.8rem;
  min-height: 32px;
  padding: 7px 11px;
  cursor: pointer;
  margin: 0;
}
.tools .pair {
  align-items: end;
}
.tools button:not(.button) {
  font-weight: 650;
  padding: 5px 0;
  font-size: 0.8rem;
  text-decoration: underline;
}
.workspace {
  background: #f3f3ee;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.boardhead,
.workspace-foot {
  padding: 13px 18px;
  background: #f9f9f5;
  border-left: 1px solid var(--line);
  font-size: 0.8rem;
}
.workspace-foot {
  font-size: 0.72rem;
  color: var(--muted);
}
.boardhead span {
  font-variant-numeric: tabular-nums;
}
.artboard {
  background-image: radial-gradient(#d3d3c9 1px, transparent 1px);
  background-size: 16px 16px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 24px;
}
.artboard canvas {
  display: block;
  max-width: 100%;
  max-height: 430px;
  width: auto;
  height: auto;
  filter: drop-shadow(0 4px 6px #0002);
  touch-action: none;
  cursor: move;
}
.studiofoot {
  margin-top: 15px;
}
.studiofoot span {
  color: var(--muted);
  font-size: 0.85rem;
}
@media (max-width: 760px) {
  .studiohead,
  .studiofoot {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .workbench {
    display: flex;
    flex-direction: column;
  }
  .workspace {
    order: -1;
  }
  .artboard {
    min-height: 200px;
    padding: 15px;
  }
  .artboard canvas {
    max-height: 270px;
  }
  .tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 7px 12px;
  }
  .tools h2,
  .tools #edit-layer {
    grid-column: 1/-1;
    margin-bottom: 0;
  }
  .tools .pair {
    gap: 7px;
  }
  .tools h2 {
    font-size: 0.94rem;
  }
  .studiohead .actions {
    gap: 6px;
  }
  .studiohead .button {
    font-size: 0.8rem;
  }
  .studiofoot .actions {
    width: 100%;
    justify-content: flex-end;
  }
}
.tool-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  background: #f0f0eb;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.tools .tool-tabs button {
  font-size: 0.84rem;
  text-decoration: none;
  border-radius: 5px;
  padding: 8px 2px;
}
.tool-tabs button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 3px #2223;
}
.workbench .tools {
  display: block;
  min-height: 22rem;
}
.tool-panel[hidden],
.tools [hidden] {
  display: none !important;
}
.tools .tool-panel label {
  margin: 11px 0;
}
.tools .studio-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: underline;
  font-size: 0.81rem;
}
.guide-options {
  padding: 10px 0 0;
  margin: 17px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.guide-options legend {
  font-weight: 700;
  font-size: 0.81rem;
  padding-right: 7px;
}
.tools .guide-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 7px 0;
}
.tools .guide-options input {
  width: 16px;
  height: 16px;
  accent-color: #242820;
}
.element-actions,
.layer-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tools .element-actions .button,
.tools .element-actions label.upload {
  min-height: 40px;
  margin: 0;
  align-items: center;
}
.layer-actions {
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}
.tools .layer-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  text-decoration: none;
  border-radius: 5px;
  padding: 4px 8px;
}
.tools .code-tool summary {
  margin: 1rem 0;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.tools .code-tool input,
.tools .code-tool select,
.tools select,
.tools textarea,
.tools input:not([type="checkbox"]):not([type="range"]) {
  min-height: 37px;
}
.studio-note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}
.studio .artboard {
  background-color: #ebece7;
}
.studio .workspace-foot {
  min-height: 36px;
}
.studio .tool-panel button:focus-visible,
.studio .tool-panel input:focus-visible {
  outline-offset: 2px;
}
.studio .guide-options legend {
  padding-top: 4px;
}
@media (max-width: 760px) {
  .workbench .tools {
    min-height: unset;
    padding: 12px;
  }
  .tool-tabs {
    margin-bottom: 0.55rem;
  }
  .tool-panel {
    display: block;
  }
  .tools .pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .studio .artboard {
    min-height: 200px;
  }
  .studio .workspace {
    min-height: 0;
  }
  .studio .boardhead,
  .studio .workspace-foot {
    border-left: 0;
    padding: 8px 13px;
  }
  .studio .workspace-foot {
    min-height: 28px;
  }
  .guide-options {
    margin-top: 10px;
  }
  .studio .studiohead h1 {
    font-size: clamp(1.8rem, 8vw, 2.65rem);
  }
}
