/* The Whiteboards door (/whiteboards; R3, SC-20260927-29). Built on the HAZCHEM builder's classes
   in /styles.css (.hazchem-layout, .custom-form, .hz-orient-opt, .delivery-opt, .hz-add-btn,
   .hazchem-stage, .hazchem-hints-details) and the labels door's step pills, foot and price strip
   in /labels.css (.ll-steps, .ll-step-pill, .ll-foot, .ll-price-strip, .ll-nav), so the three
   doors read as one site, in the Sign Central greens. This file only adds the whiteboard tools:
   the layout gallery, the board stage with its click and drag targets, the box editor, swatches,
   the corner picker and the proof box. R5 (SC-20260927-32) adds the Undo and Redo bar over the
   board, the box editor pop-up (a bottom sheet on a phone), the planners' date and holiday panel
   and the logo's scale box. R6 (SC-20260928-33) adds the zoom on the same bar, the scrolling
   stage host with its grab cursor on the wall, and the logo's "Snap to lines" tick. */

.whiteboards-door .wb-head { align-items: center; }
.whiteboards-door .wb-head h2 { color: var(--brand); }
.wb-layout { grid-template-columns: 440px 1fr; }
@media (max-width: 900px) { .wb-layout { grid-template-columns: 1fr; } }
.wb-step { display: flex; flex-direction: column; gap: 8px; }
.whiteboards-door .hazchem-layout .custom-form .hint { margin-top: 2px; }

/* Step 1: the layout gallery (a small drawing of each layout). */
.wb-layouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wb-layout-tile { font: inherit; display: flex; flex-direction: column; gap: 4px; align-items: stretch; padding: 6px; border-radius: 10px; border: 2px solid var(--hz-field-border); background: #fff; color: var(--ink); cursor: pointer; text-align: left; }
.wb-layout-tile svg { width: 100%; height: auto; display: block; border-radius: 4px; background: #eef1f0; aspect-ratio: 3 / 2; }
.wb-layout-tile span { font-size: 11.5px; font-weight: 700; line-height: 1.2; min-height: 2.4em; }
.wb-layout-tile:hover { border-color: var(--hz-accent-dark); }
.wb-layout-tile.active { border-color: var(--hz-accent); box-shadow: 0 0 0 2px var(--hz-accent) inset; }
.wb-layout-tile:focus-visible { outline: 3px solid var(--sc-lime-bright); outline-offset: 2px; }

/* Step 2: boards and sizes. */
.wb-boards.delivery-opts { grid-template-columns: 1fr; }
.wb-board-opt input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.wb-board-opt small { display: block; font-size: 12px; }

/* Step 3: the box editor. */
.wb-sel { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid var(--hz-panel-border); }
.wb-sel-title { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--hz-accent); }
.wb-sel-empty { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px dashed var(--hz-field-border); font-size: 13px; color: var(--hz-text); }
.wb-sel textarea { min-height: 52px; resize: vertical; }
.wb-tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.wb-tool-label { flex: 0 0 64px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--hz-muted); }
.wb-mini-row { flex: 1 1 auto; gap: 4px; }
.wb-mini-row .hz-orient-opt, .wb-btn-grid .hz-orient-opt { padding: 5px 8px; font-size: 12px; min-width: 0; }
.wb-btn-grid { flex: 1 1 200px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.wb-btn-grid .hz-orient-opt:disabled { opacity: .45; cursor: not-allowed; }
.wb-swatches { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.wb-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); background: var(--sw); cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.3); padding: 0; }
.wb-swatch.active { box-shadow: 0 0 0 3px var(--hz-accent); border-color: #fff; }
.wb-swatch:focus-visible { outline: 3px solid var(--sc-lime-bright); outline-offset: 2px; }
.wb-undo-row { justify-content: space-between; }
.wb-undo-row .btn-link { color: var(--hz-muted); }
.wb-warnings { margin: 0; padding: 8px 10px 8px 26px; border-radius: 10px; background: #fff7ed; color: #92400e; font-size: 12.5px; font-weight: 600; }
.wb-warn { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: #fcd34d; }
.wb-logo-field .ll-dropzone input[type=file] { width: 100%; color: var(--hz-text); }

/* Step 4: the corner picker, a little board with a button in each corner. */
.wb-corners { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 42px 60px; padding: 10px; border-radius: 12px; border: 2px dashed var(--hz-field-border); background: rgba(255,255,255,.06); max-width: 320px; }
.wb-corner { font: inherit; font-size: 12px; font-weight: 700; padding: 8px; border-radius: 10px; border: 2px solid var(--hz-field-border); background: #fff; color: var(--ink); cursor: pointer; }
.wb-corner.active { background: var(--hz-accent); border-color: var(--hz-accent-dark); color: var(--hz-accent-text); }

/* Step 5: quantity, turnaround, price and proof. */
.wb-price-box { border-radius: 10px; padding: 10px 12px; background: rgba(255,255,255,.07); border: 1px solid var(--hz-panel-border); display: flex; flex-direction: column; gap: 4px; }
.wb-price-box .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--hz-text); }
.wb-price-box .row b { font-size: 16px; color: #fff; }
.wb-price-box .row small { color: var(--hz-muted); }
.wb-price-box .price-tag { align-self: flex-start; margin-left: 0; }
.wb-email-row { display: flex; gap: 8px; flex-wrap: wrap; }
.wb-email-row input { flex: 1 1 180px; min-width: 0; }
.wb-email-row .btn { flex: 0 0 auto; padding: 8px 14px; }
.wb-email-proof .btn-link { padding: 0 2px; color: var(--hz-accent); }
#wb-qty { max-width: 140px; }

/* The stage: the board on a soft wall, at true proportion, with the dimension labels. */
.hazchem-stage.wb-stage { padding: 12px; position: relative; min-height: 320px; background: #e7ebe9; }
/* R6: the host scrolls (both ways) inside the stage when the board is zoomed past fit; door.js
   sizes the drawing in px (--wb-svg-w, --wb-svg-h) and margin: auto centres it while it is smaller
   than the host. One finger scrolls natively (pan-x pan-y); two fingers are the door's pinch. */
.wb-svg-host { position: absolute; inset: 50px 12px 12px; display: flex; overflow: auto; overscroll-behavior: auto; touch-action: pan-x pan-y; -webkit-user-select: none; user-select: none; scrollbar-width: thin; scrollbar-color: #9aa3a0 transparent; border-radius: 6px; }
.wb-svg-host > svg { flex: none; margin: auto; width: var(--wb-svg-w, 100%); height: var(--wb-svg-h, 100%); display: block; }
/* The grey wall drags a zoomed board; the board itself keeps its own cursors (edit, move, resize). */
.wb-svg-host.wb-can-pan { cursor: grab; }
.wb-svg-host.wb-can-pan svg * { cursor: default; }
.wb-svg-host.wb-can-pan svg .wb-dim-text, .wb-svg-host.wb-can-pan svg .wb-dims path { cursor: grab; }
body.wb-panning, body.wb-panning * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
@media (max-width: 900px) {
  .hazchem-stage.wb-stage { height: 360px; min-height: 0; }
}
@media (min-width: 901px) {
  .wb-preview { display: flex; flex-direction: column; }
  .hazchem-stage.wb-stage { flex: 1 1 auto; min-height: 0; }
}
.wb-svg-host .wb-board { filter: drop-shadow(0 4px 10px rgba(30,38,33,.18)); }
.wb-editing .wb-hit { cursor: text; }
.wb-editing .wb-hit:hover { fill: rgba(112,188,31,.10); }
.wb-editing .wb-drag { touch-action: none; }
.wb-editing .wb-drag-x { cursor: col-resize; }
.wb-editing .wb-drag-y { cursor: row-resize; }
.wb-editing .wb-drag:hover { fill: rgba(112,188,31,.35); }
body.wb-dragging-x, body.wb-dragging-x * { cursor: col-resize !important; user-select: none; }
body.wb-dragging-y, body.wb-dragging-y * { cursor: row-resize !important; user-select: none; }
.wb-editing .wb-logo-hit { cursor: move; touch-action: none; }
.wb-editing .wb-logo-hit:hover { fill: rgba(112,188,31,.12); }
.wb-editing .wb-logo-handle { touch-action: none; }
.wb-editing .wb-logo-handle-tl, .wb-editing .wb-logo-handle-br { cursor: nwse-resize; }
.wb-editing .wb-logo-handle-tr, .wb-editing .wb-logo-handle-bl { cursor: nesw-resize; }
body.wb-dragging-move, body.wb-dragging-move * { cursor: move !important; user-select: none; }
body.wb-dragging-scale, body.wb-dragging-scale * { cursor: nwse-resize !important; user-select: none; }

/* R5: Undo and Redo, always on the board's corner. R6: the zoom (−, the readout, +, Fit) on the
   other end of the same bar. */
.wb-stage-tools { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3; display: flex; gap: 6px; justify-content: space-between; align-items: center; }
.wb-tool-group { display: flex; gap: 6px; align-items: center; }
.wb-zoom { gap: 4px; }
.wb-tool-btn.wb-zoom-btn { justify-content: center; min-width: 34px; padding: 6px 0; }
.wb-tool-btn.wb-zoom-fit { padding: 6px 11px; }
.wb-zoom-level { min-width: 48px; padding: 6px 2px; border-radius: 9px; background: rgba(255,255,255,.85); color: var(--brand); font-size: 12.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) {
  .wb-stage-tools { left: 6px; right: 6px; gap: 4px; }
  .wb-tool-group { gap: 4px; }
  .wb-tool-btn { padding: 6px 8px 6px 6px; }
  .wb-tool-btn.wb-zoom-btn { min-width: 32px; padding: 6px 0; }
  .wb-tool-btn.wb-zoom-fit { padding: 6px 9px; }
  .wb-zoom-level { min-width: 44px; }
}
@media (max-width: 360px) {
  .wb-tool-btn:not(.wb-zoom-btn):not(.wb-zoom-fit) span { display: none; }   /* Undo and Redo keep their icons (and names) */
}
.wb-tool-btn { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 11px 6px 8px; border-radius: 9px; border: 2px solid var(--hz-field-border); background: #fff; color: var(--brand); cursor: pointer; box-shadow: 0 2px 8px rgba(30,38,33,.14); }
.wb-tool-btn svg { width: 16px; height: 16px; flex: none; }
.wb-tool-btn:hover:not(:disabled) { border-color: var(--hz-accent-dark); background: #f4faee; }
.wb-tool-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.wb-tool-btn:focus-visible { outline: 3px solid var(--sc-lime-bright); outline-offset: 2px; }

/* R5: the box editor pop-up, beside the box it edits (a bottom sheet on a phone). */
.wb-pop { position: fixed; z-index: 70; left: 16px; top: 16px; width: 340px; max-height: calc(100vh - 16px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; border-radius: 14px; background: var(--hz-panel-bg); border: 1px solid var(--hz-panel-border); color: var(--hz-text); box-shadow: 0 18px 44px rgba(8,45,23,.38); }
.wb-pop[hidden] { display: none; }
.wb-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-pop-head b { font-size: 13.5px; color: var(--hz-accent); }
.wb-pop-close { padding: 6px 16px; font-size: 13px; }
.wb-pop-zoom { position: relative; height: 120px; border-radius: 9px; overflow: hidden; background: #e7ebe9; border: 1px solid rgba(255,255,255,.2); }
.wb-pop-zoom svg { width: 100%; height: 100%; display: block; }
.wb-cell-editor { width: 100%; font: 500 14px/1.35 var(--font); padding: 7px 9px; border: 2px solid var(--hz-field-border); border-radius: 9px; background: #fff; color: var(--ink); resize: vertical; min-height: 76px; }
.wb-cell-editor:focus { outline: none; border-color: var(--hz-accent); box-shadow: 0 0 0 4px rgba(112,188,31,.45); }
.wb-pop-keys { margin: -2px 0 0; font-size: 11.5px; color: var(--hz-muted); }
.wb-pop-tools { display: flex; flex-direction: column; gap: 9px; }
.wb-pop-row { display: flex; flex-direction: column; gap: 4px; }
.wb-pop-row-split { flex-direction: row; gap: 16px; align-items: flex-start; }
.wb-pop-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--hz-muted); display: block; margin-bottom: 2px; }
.wb-pop-sizes { display: flex; gap: 4px; }
.wb-pop-sizes .hz-orient-opt.ll-mini { flex: 1 1 0; min-width: 0; padding: 5px 0; font-size: 12px; }
.wb-anchors { display: grid; grid-template-columns: repeat(3, 32px); grid-template-rows: repeat(3, 26px); gap: 3px; padding: 4px; border-radius: 9px; background: #fff; width: max-content; }
.wb-anchor { border: 0; border-radius: 5px; background: #eef1f0; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.wb-anchor i { width: 8px; height: 8px; border-radius: 50%; background: #9aa3a0; }
.wb-anchor:hover { background: #dcefc9; }
.wb-anchor.active { background: var(--hz-accent); }
.wb-anchor.active i { background: var(--hz-accent-text); }
.wb-anchor:focus-visible { outline: 3px solid var(--sc-lime-bright); outline-offset: 1px; }
.wb-pop-style { display: flex; flex-direction: column; gap: 5px; flex: 1 1 auto; }
.wb-pop-style .hz-orient-opt.ll-mini { text-align: left; padding: 6px 10px; }
.wb-swatch-none { background: linear-gradient(135deg, #fff 44%, #c62828 44%, #c62828 56%, #fff 56%) !important; }
.wb-pop .wb-swatch { width: 24px; height: 24px; }
.wb-pop-tagrow { display: flex; gap: 6px; align-items: center; }
.wb-pop-tagrow input { flex: 1 1 auto; min-width: 0; padding: 6px 9px; font-size: 13px; border: 2px solid var(--hz-field-border); }
.wb-pop-tagrow .btn-link { color: var(--hz-muted); padding: 0 4px; }
@media (max-width: 900px) {
  .wb-pop.wb-pop-sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 66vh; border-radius: 16px 16px 0 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
}

/* R5: the planners' "Suggest the year" panel, and the logo panel. */
.wb-cal { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(112,188,31,.12); border: 1px solid var(--hz-accent-dark); }
.wb-cal-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--hz-accent); }
.wb-cal-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.wb-cal-field { display: flex; flex-direction: column; gap: 2px; flex: 1 1 120px; min-width: 0; }
.wb-cal > .wb-cal-field { flex: none; }
.whiteboards-door .hazchem-layout .custom-form .wb-cal-field label { font-size: 11.5px; margin: 0; color: var(--hz-muted); font-weight: 700; }
.wb-cal input[type=date] { width: 100%; font: inherit; font-size: 13px; padding: 5px 9px; border-radius: 9px; background: #fff; color: var(--ink); border: 2px solid var(--hz-field-border); }
.wb-cal input[type=date]:focus { outline: none; border-color: var(--hz-accent); box-shadow: 0 0 0 4px rgba(112,188,31,.45); }
.wb-cal-fill { padding: 8px 16px; font-size: 13.5px; }
.wb-cal-done { font-size: 13px; font-weight: 700; color: var(--hz-accent); padding: 4px 0; }
.wb-cal .btn-link { padding: 4px 2px; }
.wb-cal-hol span { font-weight: 600; }
.wb-open-pop { align-self: flex-start; }
.wb-logo-panel { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid var(--hz-panel-border); }
.wb-logo-panel-on { border-color: var(--hz-accent); box-shadow: 0 0 0 2px rgba(112,188,31,.35) inset; }
.wb-logo-panel .hint { margin: 0; }
.wb-snap-toggle span { font-weight: 600; }
/* R9 (SC-20260929-35): the Spacing panel, "Keep rows and columns evenly spaced" and the two buttons. */
.wb-even { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid var(--hz-panel-border); }
.wb-even-title { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--hz-accent); }
.wb-even .hint { margin: 0; }
.wb-even-toggle span { font-weight: 600; }
.wb-even > .wb-btn-grid { flex: none; }
.wb-logo-panel > .wb-btn-grid { flex: none; }
.wb-legend .wb-legend-hole { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #cfd6d3; border: 1.5px solid #37474f; }
.wb-legend .wb-legend-drag { display: inline-block; width: 16px; height: 0; border-top: 3px solid var(--accent); }

@media (max-width: 560px) {
  .wb-layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-tool-label { flex-basis: 100%; }
  .wb-corners { gap: 30px 30px; }
}
