.pn-maker .pm-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 310px); }
.pn-maker .pm-workspace { min-width: 0; padding: 16px 20px 12px; }
.pn-maker .pm-history { display: flex; gap: 6px; }
.pn-maker .pm-history button, .pn-maker .pm-clear, .pn-maker .pm-modes button {
  border-radius: 5px; padding: 8px 12px; min-height: 36px; font-size: 13px; font-weight: 600;
  color: var(--ink); background: var(--surface); touch-action: manipulation;
}
.pn-maker .pm-history button, .pn-maker .pm-clear { border: 1px solid var(--line); }
.pn-maker button:disabled { cursor: default; }
.pn-maker .pm-history button:not(:disabled):hover, .pn-maker .pm-clear:not(:disabled):hover,
.pn-maker .pm-modes button:not([aria-pressed="true"]):hover { background: var(--soft); }
.pn-maker .pm-toolbar, .pn-maker .pm-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pn-maker .pm-toolbar { flex-wrap: wrap; padding-bottom: 12px; }
.pn-maker .pm-modes { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 7px; padding: 2px; }
.pn-maker .pm-modes button[aria-pressed="true"] { background: var(--ink); color: white; }
.pn-maker .pm-grid-switch { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 13px; cursor: pointer; }
.pn-maker .pm-grid-switch input { width: 16px; height: 16px; accent-color: var(--green-dark); margin: 0; }
.pn-maker .pm-stage { display: grid; justify-items: center; padding: clamp(13px, 2vw, 30px); border: 1px solid var(--line); border-radius: 7px; background: var(--soft); }
.pn-maker .pm-surface {
  position: relative; width: min(100%, 400px); aspect-ratio: 1; box-shadow: 0 0 0 1px #9da99b;
  background-color: #fff; background-image: conic-gradient(#eef1ec 25%, transparent 0 50%, #eef1ec 0 75%, transparent 0); background-size: 16px 16px;
}
.pn-maker .pm-surface canvas { display: block; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; image-rendering: pixelated; touch-action: none; cursor: crosshair; }
.pn-maker .pm-surface:not(.pm-hide-grid)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, rgba(52, 77, 59, .26) 1px, transparent 1px), linear-gradient(to bottom, rgba(52, 77, 59, .26) 1px, transparent 1px);
  background-size: calc(100% / var(--pm-size, 16)) calc(100% / var(--pm-size, 16));
}
.pn-maker .pm-caption { margin-top: 10px; font-size: 12px; color: var(--muted); }
.pn-maker .pm-mono, .pn-maker [data-board-size] { font: 12px/1.5 'Space Mono', monospace; color: var(--muted); }
.pn-maker .pm-panel { display: flex; flex-direction: column; gap: 20px; padding: 22px; min-width: 0; border-left: 1px solid var(--line); }
.pn-maker .pm-palette legend, .pn-maker .pm-field { font-size: 13px; font-weight: 600; }
.pn-maker .pm-palette legend { margin-bottom: 12px; }
.pn-maker .pm-swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pn-maker .pm-swatches button {
  position: relative; height: 34px; border-radius: 5px; border: 1px solid rgba(36, 60, 48, .2); padding: 0;
  background: var(--pm-swatch); touch-action: manipulation;
}
.pn-maker .pm-swatches button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px white, 0 0 0 2px var(--ink); }
.pn-maker .pm-swatches button:focus-visible { outline-style: dashed; }
.pn-maker .pm-custom { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-top: 14px; font-size: 13px; cursor: pointer; }
.pn-maker .pm-custom input { width: 34px; height: 32px; padding: 2px; border: 1px solid var(--line); background: white; border-radius: 4px; cursor: pointer; }
.pn-maker .pm-custom .pm-mono { margin-left: auto; }
.pn-maker .pm-settings, .pn-maker .pm-output { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.pn-maker .pm-field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pn-maker .pm-field select { color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; min-height: 38px; font-size: 13px; }
.pn-maker .pm-clear { justify-self: start; }
.pn-maker .pm-output { margin-top: auto; }
.pn-maker .pm-export-info { text-align: center; }
.pn-maker .pm-message { font-size: 12px; line-height: 1.5; }
.pn-maker .pm-message:empty { margin-top: -20px; }
.pn-maker .pm-confirm { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--warm-paper); font-size: 13px; }
.pn-maker .pm-confirm p { flex: 1 1 140px; }
.pn-maker .pm-confirm .button { min-height: 37px; padding: 8px 12px; }
@media (max-width: 700px) {
  .pn-maker .pm-layout { grid-template-columns: minmax(0, 1fr); }
  .pn-maker .pm-workspace { padding: 12px; }
  .pn-maker .pm-panel { border-left: 0; border-top: 1px solid var(--line); padding: 18px; }
  .pn-maker .pm-stage { padding: 10px; }
  .pn-maker .pm-swatches { gap: 8px; }
  .pn-maker .pm-swatches button { height: 40px; }
  .pn-maker .pm-modes button, .pn-maker .pm-history button, .pn-maker .pm-grid-switch { min-height: 40px; }
  .pn-maker .pm-confirm { flex-wrap: wrap; padding: 12px; }
}
@media (max-width: 390px) {
  .pn-maker .pm-modes button { padding: 8px; }
  .pn-maker .pm-workspace { padding: 10px; }
  .pn-maker .pm-panel { padding: 15px; }
}
