/* Board and artwork share the same controls and hierarchy. */
.size-tabs{display:flex;gap:4px;padding:3px;background:#ededea;border-radius:8px;margin-bottom:18px}.size-tabs button{flex:1;border:0;border-radius:5px;padding:9px;background:transparent;font-size:13px;min-height:38px}.size-tabs [aria-selected=true]{background:white;color:var(--blue);box-shadow:0 1px 3px #0000000a}.size-options button{min-height:44px;white-space:nowrap;font-size:11px}.size-slider{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px;font-size:12px;color:var(--muted);margin:16px 0 12px}.size-slider output{color:var(--ink);font-variant-numeric:tabular-nums}.size-slider input{width:100%;accent-color:var(--blue);height:28px;margin:0}.color-presets{display:flex;gap:6px;margin:12px 0}.color-presets button{flex:1;background:white;border:1px solid var(--line);border-radius:5px;min-height:36px;font-size:13px}.color-presets [aria-pressed=true]{border-color:var(--blue);color:var(--blue);background:#f3f5ff}
/* Dedicated, canvas-first editing workspace. */
#beadEditor{width:1200px;max-width:calc(100% - 24px);height:min(860px,96dvh);max-height:96dvh;padding:18px;border-radius:12px}#beadEditor[open]{display:flex;flex-direction:column;overflow:hidden;gap:10px}.editor-head{position:relative;flex:none;padding-right:148px}.editor-head .eyebrow{font-size:9px}.editor-head h2{font-size:34px;line-height:1;margin:7px 0}.editor-head .dialog-close{top:0;right:0}.editor-history{position:absolute;right:46px;top:0;display:flex;gap:5px}.editor-history button{border:1px solid var(--line);border-radius:5px;background:white;min-height:34px;padding:6px 8px;font-size:11px}.editor-tools{display:flex;align-items:center;gap:6px;flex:none;overflow-x:auto;padding-bottom:2px}.editor-tools button,.editor-options button,.move-tools button{flex:none;border:1px solid var(--line);border-radius:6px;background:white;padding:8px 12px;min-height:36px;font-size:12px;white-space:nowrap}.editor-tools [aria-pressed=true]{background:var(--blue);border-color:var(--blue);color:white}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 228px;gap:18px;min-height:0;flex:1}.editor-board-pane{display:flex;flex-direction:column;gap:8px;min-height:0;min-width:0}.editor-options{display:flex;align-items:center;gap:8px;flex:none}.editor-options input{width:140px;min-width:45px;accent-color:var(--blue);height:28px}.editor-options output{font-size:12px;min-width:38px;font-variant-numeric:tabular-nums}.editor-options #fitEditor{margin-left:auto}.editor-options #zoomIn,.editor-options #zoomOut{width:36px;font-size:18px;padding:4px}#editorScroll{display:flex;overflow:auto;flex:1;min-height:100px;background:#e9eae4;border:1px solid #d5d7cf;border-radius:7px;padding:8px;overscroll-behavior:contain}#editCanvas{display:block;flex:none;image-rendering:pixelated;margin:auto;touch-action:none;cursor:crosshair;box-shadow:0 2px 12px #232b1720}#editorHelp{margin:0;font-size:12px;line-height:1.4;flex:none;min-height:17px}.editor-palette-pane{display:flex;flex-direction:column;min-height:0;gap:10px;border-left:1px solid var(--line);padding-left:18px}.editor-palette-heading{display:flex;gap:7px;flex-wrap:wrap;align-items:center;font-size:12px}.editor-palette-heading strong{flex-basis:100%;font-size:15px;font-weight:500}#selectedColorChip{width:22px;height:22px;border:1px solid #0002;border-radius:4px}#selectedColorName{font-size:12px}.editor-palette-pane #editorPalette{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;overflow-y:auto;min-height:0;padding:3px;align-content:start}#editorPalette button{position:relative;min-width:0;aspect-ratio:1;border:1px solid #0002;border-radius:5px;font-size:10px;padding:3px;font-weight:600}#editorPalette button[aria-pressed=true]{outline:2px solid var(--blue);outline-offset:1px;box-shadow:inset 0 0 0 2px #fff}.palette-note{font-size:11px;color:var(--muted);margin:0}.editor-palette-pane #emptyBoard{font-size:11px;margin-left:auto;min-height:24px;padding:0;text-align:left;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}.move-tools{display:flex;gap:5px;flex-wrap:wrap;align-items:center;font-size:11px;flex:none}.move-tools button{min-height:32px;padding:5px 9px}.editor-footer{width:100%;margin:0;border-top:1px solid var(--line);padding:10px 0 0;display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}.editor-footer>span{display:block;font-size:12px;color:var(--muted)}.editor-footer .primary-button{width:auto;font-size:14px;min-height:44px;padding:10px 20px}
@media(min-width:761px) and (max-width:1100px){.controls{grid-template-columns:1fr 1fr;gap:26px}.controls>div:nth-child(odd){border-left:0;padding-left:0}.controls>div:nth-child(even){padding-right:0}}
@media(max-width:700px){#beadEditor{max-width:100%;width:100%;height:100dvh;max-height:100dvh;border-radius:0;padding:12px;gap:8px}.editor-head .eyebrow{display:none}.editor-head h2{font-size:28px;margin:5px 0}.editor-head .dialog-close{top:-3px}.editor-tools{gap:5px}.editor-tools button{padding:7px 10px;min-height:36px;font-size:12px}.editor-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(140px,1fr) 118px;gap:10px}.editor-palette-pane{border-left:0;border-top:1px solid var(--line);padding:6px 0 0;gap:5px;overflow:hidden}.editor-palette-heading{flex-wrap:nowrap;min-height:20px;gap:7px}.editor-palette-heading strong{flex-basis:auto;font-size:12px}#selectedColorChip{width:17px;height:17px}#selectedColorName{font-size:11px}.editor-palette-pane #editorPalette{display:grid;grid-template-rows:repeat(2,40px);grid-auto-flow:column;grid-auto-columns:40px;grid-template-columns:none;gap:5px;overflow-x:auto;overflow-y:hidden;flex:1;padding:2px 3px}.editor-palette-pane .palette-note{display:none}.editor-palette-pane #emptyBoard{position:static;font-size:10px;min-height:20px;padding:0}.editor-options{gap:6px}.editor-options input{flex:1;width:70px}.editor-options output{font-size:11px;min-width:34px}.editor-options button{font-size:11px;padding:6px 8px;min-height:32px}.editor-options #zoomIn,.editor-options #zoomOut{width:32px}.editor-options #fitEditor{margin-left:0}#editorHelp{font-size:11px;min-height:16px}.editor-footer{padding-top:8px}.editor-footer>span{font-size:10px}.editor-footer .primary-button{font-size:13px;min-height:42px;padding:10px 13px}.move-tools span{display:none}.move-tools button{font-size:11px}.size-slider{font-size:13px}.size-options button{font-size:12px;min-height:46px}}
/* Landscape is constrained by height, including wider phones and short desktop windows. */
@media(max-height:500px) and (min-aspect-ratio:1/1){
  #beadEditor{width:100%;max-width:100%;height:100dvh;max-height:100dvh;padding:10px;border-radius:0}
  #beadEditor[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:6px}
  .editor-head{min-height:34px;padding-right:148px}.editor-head .eyebrow{display:none}.editor-head h2{font-size:24px;line-height:1;margin:5px 0}.editor-head .dialog-close{top:-3px}
  .editor-tools{gap:5px;margin:0;padding-bottom:2px}.editor-tools button{min-height:36px;padding:7px 10px}
  .editor-layout{grid-template-columns:minmax(0,1fr) 168px;grid-template-rows:minmax(0,1fr);gap:10px;min-height:0;overflow:hidden}
  .editor-board-pane{min-height:0;gap:6px}.editor-options{gap:6px;min-width:0}.editor-options input{width:110px;min-width:45px;height:28px}.editor-options button{min-height:32px;padding:6px 8px;font-size:11px}.editor-options #zoomIn,.editor-options #zoomOut{width:32px}.editor-options #fitEditor{margin-left:auto}
  #editorScroll{min-height:0;padding:6px}#editorHelp{display:none}
  .editor-palette-pane{border-top:0;border-left:1px solid var(--line);padding:0 0 0 8px;overflow:hidden;gap:6px;min-height:0}
  .editor-palette-heading{flex:none;flex-wrap:wrap;gap:5px;min-height:0}.editor-palette-heading strong{display:none}#selectedColorChip{width:17px;height:17px}#selectedColorName{font-size:11px}.editor-palette-pane #emptyBoard{font-size:11px;min-height:24px}
  .editor-palette-pane #editorPalette{flex:1;min-height:0;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none;grid-auto-flow:row;grid-auto-columns:auto;grid-auto-rows:40px;gap:5px;overflow-y:auto;overflow-x:hidden;padding:3px;align-content:start}
  #editorPalette button{aspect-ratio:auto;min-height:40px}.editor-palette-pane .palette-note{display:none}
  .editor-footer{min-height:42px;margin:0;padding:6px 0 0;gap:10px;min-width:0}.editor-footer>span{font-size:11px}.editor-footer .primary-button{min-height:36px;font-size:13px;padding:8px 14px}
  .move-tools{gap:4px}.move-tools span{display:none}.move-tools button{min-height:30px;padding:5px 8px;font-size:11px}
}
@media(max-height:500px) and (min-aspect-ratio:1/1) and (max-width:620px){.editor-layout{grid-template-columns:minmax(0,1fr) 112px}.editor-palette-pane #editorPalette{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-options input{display:none}.editor-options output{min-width:32px}.editor-tools button{padding-inline:8px}}
