header {
  padding: 12px 2.3vw;
  gap: 12px;
}
header nav {
  gap: 1px;
}
header nav button {
  font-size: 0.87rem;
  min-height: 36px;
}
.wideEditor main {
  width: 96%;
  max-width: 1780px;
  margin: 1.6rem auto 3rem;
}
.deskTitle,
.editorTools,
.channelTools,
.planhead,
.canvasCaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.deskTitle h1 {
  font:
    500 clamp(30px, 3vw, 48px) / 1.15 Georgia,
    "Songti SC",
    serif;
  margin: 0.2rem 0 1rem;
}
.deskTitle select,
.editorTools select,
.channelTools label {
  width: auto;
}
.editorTools {
  border-block: 1px solid var(--line);
  padding: 0.5rem 0;
}
.editorTools .actions {
  margin: 0;
}
.editorTools label {
  margin: 0;
}
.editorTools button,
.editorTools select,
.editorGrid button,
.editorGrid input,
.editorGrid select {
  min-height: 31px;
  font-size: 0.85rem;
}
.editorGrid {
  display: grid;
  grid-template-columns: minmax(158px, 0.62fr) minmax(0, 2.65fr) minmax(
      204px,
      0.85fr
    );
  border-bottom: 1px solid var(--line);
  background: white;
  min-height: 520px;
}
.palette,
.inspector {
  padding: 16px 12px;
  min-width: 0;
  max-height: 78vh;
  overflow: auto;
}
.editorGrid h2,
.editorFooter summary {
  font: 600 1rem/1.4 system-ui;
  margin: 0 0 0.8rem;
}
.editorGrid h3 {
  font-size: 0.94rem;
}
.editorGrid label {
  font-size: 0.8rem;
  margin: 0.3rem 0 0.55rem;
}
.palette details,
.inspector details,
.editorFooter details {
  padding: 8px 0;
  border-block-start: 1px solid var(--line);
}
summary {
  cursor: pointer;
  font-weight: 600;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0.5rem 0;
}
.tiles button {
  padding: 4px;
  overflow-wrap: anywhere;
}
.palette h2:not(:first-child) {
  margin-top: 1.5rem;
}
.layer,
.sourceRow {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 4px;
}
.layer small,
.channelRow small {
  display: block;
  color: var(--muted);
}
.layer[aria-pressed="true"] {
  background: #222;
  color: white;
}
.layer[aria-pressed="true"] small {
  color: #ddd;
}
.layer {
  overflow-wrap: anywhere;
}
.workbench {
  background: #e7e7e3;
  border-inline: 1px solid var(--line);
  padding: clamp(10px, 1.65vw, 25px);
  min-width: 0;
}
.canvasScroll {
  margin-top: 36px;
  overflow: auto;
  width: 100%;
}
#stage {
  position: relative;
  width: 100%;
  aspect-ratio: 5/3;
  background: white;
  box-shadow: 0 2px 12px #0002;
}
#stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#overlay {
  touch-action: none;
  cursor: crosshair;
}
.canvasCaption {
  margin-top: 12px;
  font: 12px system-ui;
  color: #484844;
}
.workbench > p {
  font-size: 0.76rem;
  margin-top: 1rem;
}
.geom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
}
.editorFooter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 20px 0;
}
.inspector textarea,
textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  border: 1px solid var(--line);
  padding: 8px;
}
.editorGrid .fields {
  gap: 0 8px;
}
.fullProof,
dialog img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
dialog:has(.fullProof) {
  width: min(850px, 94vw);
  max-width: min(850px, 94vw);
}
.channelTools {
  padding: 1rem 0;
}
.channelTools label {
  min-width: 250px;
}
.planhead {
  justify-content: flex-start;
}
.planhead h2 {
  margin: 0;
}
.channelRow {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  gap: 15px;
}
.channelRow img {
  width: 100px;
  aspect-ratio: 5/3;
  object-fit: contain;
  background: white;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}
.channelRow .actions {
  margin-left: auto;
}
.channelRow .actions label {
  margin: 0;
}
.pageNo {
  font:
    500 23px Georgia,
    serif;
}
.channelRow[draggable="true"] {
  cursor: grab;
}
#plan {
  margin-bottom: 2.4rem;
}
#slots {
  margin: 1rem 0;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px 20px;
  margin-top: 2rem;
}
.templateCard img {
  width: 100%;
  aspect-ratio: 5/3;
  border: 1px solid var(--line);
  background: white;
}
.templateCard h2 {
  margin: 0.2rem 0 0.75rem;
}
.templateCard small {
  display: block;
  margin-top: 0.5rem;
}
.templateCard button {
  font-size: 0.9rem;
}
.sourceRow {
  padding: 10px;
}
#sourceJSON {
  font-family: monospace;
}
.inspector .actions button {
  font-size: 0.8rem;
}
@media (max-width: 970px) {
  .editorGrid {
    grid-template-columns: 145px minmax(0, 1fr) 185px;
  }
  .palette,
  .inspector {
    padding: 10px 8px;
  }
}
@media (max-width: 760px) {
  header nav {
    gap: 2px;
  }
  header nav button {
    font-size: 0.8rem;
  }
  .editorGrid {
    display: flex;
    flex-direction: column;
  }
  .workbench {
    order: -1;
    padding: 10px;
  }
  .canvasScroll {
    margin: 4px 0;
  }
  .palette,
  .inspector {
    max-height: none;
  }
  .palette .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #layers {
    display: flex;
    gap: 4px;
    overflow: auto;
  }
  .layer {
    width: auto;
    min-width: 82px;
  }
  .editorFooter {
    grid-template-columns: 1fr;
  }
  .channelRow {
    flex-wrap: wrap;
    gap: 8px;
  }
  .channelRow .actions {
    margin: 0;
  }
  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
  }
  .templateCard h2 {
    font-size: 1.15rem;
  }
  .deskTitle select {
    max-width: 100%;
  }
  .editorTools .actions {
    gap: 4px;
  }
}
