/* ============================================================
   Brand tokens
   ============================================================ */
:root {
  /* Brand palette */
  --pb-pink:        #f7a096;
  --pb-blue:        #95c7c8;
  --pb-light-pink:  #ffe9e6;
  --pb-light-blue:  #e6fafa;
  --pb-dark-pink:   #804d4d;
  --pb-dark-blue:   #526666;
  --pb-paper:       #fafafa;

  /* Material-specific canvas tokens — all colours used by studio/canvas.js
     are defined here so palette tweaks are a one-file change in app.css. */

  /* Sheet fill (the visible kiss-cut rectangle) */
  --pb-sheet-pink:         var(--pb-pink);
  --pb-sheet-blue:         var(--pb-blue);
  --pb-sheet-white:        var(--pb-paper);

  /* Canvas backdrop (behind the sheet) */
  --pb-canvas-pink:        var(--pb-dark-pink);
  --pb-canvas-blue:        var(--pb-dark-blue);
  --pb-canvas-white:       #707070;

  /* Design-object text fill — "dark = vinyl absent" */
  --pb-text-pink:          var(--pb-dark-pink);
  --pb-text-blue:          var(--pb-dark-blue);
  --pb-text-white:         #707070;

  /* Safe-zone dashed stroke */
  --pb-safezone-on-color:  rgba(255, 255, 255, 0.85);  /* on pink/blue sheets */
  --pb-safezone-on-white:  rgba(82, 102, 102, 0.75);   /* on white sheet */

  --top-bar-h:      52px;
  --status-bar-h:   44px;
  --tool-rail-w:    70px;
  --inspector-w:    300px;

  --font-display: 'Mouse Memoirs', sans-serif;
  --font-ui:      'Noto Sans Display', sans-serif;
}

/* ============================================================
   Self-hosted fonts
   ============================================================ */
@font-face {
  font-family: 'Alberto Stencil';
  src: url('fonts/alberto-stencil.ttf') format('truetype');
  font-display: swap;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--pb-dark-blue);
  background: #fff;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; }
input  { font-family: var(--font-ui); color: var(--pb-dark-blue); }

/* ============================================================
   Narrow-screen guard  (<1024 px)
   ============================================================ */
#narrow-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--pb-light-pink);
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 9999;
}

.narrow-inner h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--pb-dark-pink);
  margin-bottom: 1rem;
}
.narrow-inner p    { font-size: 1.1rem; color: var(--pb-dark-blue); }
.narrow-inner .narrow-sub { margin-top: 0.5rem; font-size: 0.85rem; opacity: 0.6; }

@media (max-width: 1023px) {
  #narrow-screen { display: flex; }
  #launcher-overlay,
  #app-shell,
  #material-modal { display: none !important; }
}

/* ============================================================
   Utilities
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   App shell
   ============================================================ */
#app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ============================================================
   Top bar
   ============================================================ */
#top-bar {
  height: var(--top-bar-h);
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 10;
}

#brand-block {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
#brand-logo {
  height: 30px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
#brand-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--pb-dark-pink);
  white-space: nowrap;
  line-height: 1;
  margin: 3px 0 0 0;
}

#project-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

#project-name {
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  outline: none;
  background: transparent;
  border-bottom: 1px dashed transparent;
  padding: 2px 4px;
  max-width: 240px;
  transition: border-color 0.15s;
}
#project-name:hover { border-bottom-color: rgba(82,102,102,0.3); }
#project-name:focus { border-bottom-color: var(--pb-pink); }

#drafts-notice {
  font-size: 0.68rem;
  color: var(--pb-dark-blue);
  opacity: 0.45;
  padding-left: 4px;
}

/* Launcher — continue draft */
.lnch-draft-banner {
  background: var(--pb-light-blue, #e6fafa);
  border: 1.5px solid #b0cece;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  text-align: left;
}
.lnch-draft-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pb-dark-blue);
  margin-bottom: 4px;
}
.lnch-draft-meta {
  font-size: 0.78rem;
  color: var(--pb-dark-blue);
  opacity: 0.75;
  margin-bottom: 12px;
}
.lnch-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.lnch-draft-actions .lnch-ok-btn {
  width: auto;
  flex: 1 1 auto;
  min-width: 140px;
  margin: 0;
}
.lnch-secondary-btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pb-dark-blue);
  background: #fff;
  border: 1.5px solid #b0cece;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lnch-secondary-btn:hover {
  background: #e8f4f4;
  border-color: var(--pb-blue);
}

#top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Cart/checkout error — floats under top bar; never expands status bar layout */
.cart-toast {
  position: fixed;
  top: calc(var(--top-bar-h, 56px) + 10px);
  right: 16px;
  z-index: 3000;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  background: #fff5f5;
  border: 1.5px solid #e8a0a0;
  color: #8b2e2e;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 6px 20px rgba(82, 102, 102, 0.18);
  pointer-events: none;
}
.cart-toast.hidden {
  display: none;
}

#nudge-control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#nudge-control .nudge-label,
#nudge-control .nudge-unit {
  color: var(--pb-dark-blue);
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.75;
  white-space: nowrap;
  transition: opacity 0.15s;
}
#nudge-control:hover .nudge-label,
#nudge-control:hover .nudge-unit { opacity: 1; }
/* Joined 4-button pill — same language as undo/zoom */
.nudge-btn-group {
  display: flex;
  align-items: center;
  gap: 0;
}
.nudge-btn {
  height: 30px;
  min-width: 34px;
  padding: 0 8px;
  box-sizing: border-box;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-ui);
  border: 1.5px solid #b0cece;
  border-radius: 0;
  border-right: none;
  background: #fff;
  color: var(--pb-dark-blue);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nudge-btn:first-child { border-radius: 6px 0 0 6px; }
.nudge-btn:last-child  { border-radius: 0 6px 6px 0; border-right: 1.5px solid #b0cece; }
.nudge-btn:hover:not(.active) {
  background: #e8f4f4;
  border-color: var(--pb-blue);
}
.nudge-btn.active {
  background: var(--pb-light-blue);
  border-color: var(--pb-blue);
  color: var(--pb-dark-blue);
  z-index: 1;
}
/* Active button needs right border so the join still looks closed */
.nudge-btn.active + .nudge-btn { border-left-color: var(--pb-blue); }

.icon-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 10px;
  height: 34px;
  box-sizing: border-box;
  font-size: 0.85rem;
  color: var(--pb-dark-pink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: background 0.15s;
}
.icon-btn:hover:not(:disabled) {
  background: var(--pb-light-pink);
}
.icon-btn:disabled {
  color: #cbbdbd;
  cursor: not-allowed;
}

#add-to-cart-btn {
  background: var(--pb-pink);
  color: #fff;
  border-radius: 8px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: not-allowed;
  opacity: 0.45;
  transition: opacity 0.15s;
}
#add-to-cart-btn:not([disabled]) {
  cursor: pointer;
  opacity: 1;
}
#add-to-cart-btn:not([disabled]):hover { opacity: 0.85; }

#export-svg-btn {
  background: none;
  color: var(--pb-dark-blue);
  border: 1.5px solid var(--pb-dark-blue);
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s;
}
#export-svg-btn:hover { opacity: 1; }

/* ============================================================
   Workspace (tool rail + canvas + inspector)
   ============================================================ */
#workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* --- Tool rail --- */
#tool-rail {
  width: var(--tool-rail-w);
  background: var(--pb-light-pink);
  border-right: 1px solid #e0c8c4;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 14px;
  gap: 6px;
  flex-shrink: 0;
}

.tool-rail-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--pb-dark-pink);
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  user-select: none;
}

.tool-btn {
  width: 50px;
  height: 36px;
  border-radius: 8px;
  color: var(--pb-dark-pink);
  opacity: 0.35;
  cursor: not-allowed;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  position: relative;
}
/* Fixed-width icon zone so all icons line up vertically */
.tool-btn > svg,
.tool-btn > span:not(.tool-key) {
  flex: 0 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-key {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.7;
  line-height: 1;
}
.tool-expand {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 7px;
  opacity: 0.55;
  line-height: 1;
  pointer-events: none;
}
.tool-btn:not([disabled]) {
  opacity: 0.65;
  cursor: pointer;
}
.tool-btn:not([disabled]):hover { background: rgba(247,160,150,0.15); opacity: 0.85; }
.tool-btn.active { background: rgba(247,160,150,0.28); opacity: 1; }

/* --- Canvas column (status bar + canvas stacked vertically) --- */
#canvas-column {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* --- Canvas area --- */
#canvas-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  background-color: var(--pb-canvas-pink);  /* default; overridden by material class */
  transition: background-color 0.2s ease;
}
#canvas-area.canvas-bg-pink  { background-color: var(--pb-canvas-pink); }
#canvas-area.canvas-bg-blue  { background-color: var(--pb-canvas-blue); }
#canvas-area.canvas-bg-white { background-color: var(--pb-canvas-white); }

#stencil-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#canvas-area.text-mode  #stencil-canvas { cursor: text; }
#canvas-area.shape-mode #stencil-canvas { cursor: crosshair; }

#heatmap-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#heatmap-canvas.visible {
  opacity: 1;
}

/* Close Cuts + Islands share this layer — CSS pulse only (no JS redraw).
   No opacity transition here: it fights the keyframe animation. */
#alert-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
}
#alert-overlay-canvas.visible {
  animation: alert-overlay-pulse 1.35s ease-in-out infinite;
}
@keyframes alert-overlay-pulse {
  0%, 100% { opacity: 0.52; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #alert-overlay-canvas.visible {
    animation: none;
    opacity: 1;
  }
}

/* Check mode (Floppiness / Close Cuts / Islands) — disable editing interactions */
#canvas-area.heatmap-mode #stencil-canvas {
  pointer-events: none;
  cursor: default !important;
}
#canvas-area.heatmap-mode.text-mode  #stencil-canvas,
#canvas-area.heatmap-mode.shape-mode #stencil-canvas { cursor: default !important; }
#canvas-area.heatmap-mode #paint-overlay {
  pointer-events: none !important;
  cursor: default !important;
}

/* ── Paint / Cleanup overlay ─────────────────────────────────────────────── */
#paint-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;  /* enabled by cleanup-mode class below */
}
/* In cleanup mode: overlay captures all mouse events; hide system cursor
   (cursor ring is drawn on the overlay canvas by JS) */
#canvas-area.cleanup-mode #paint-overlay {
  pointer-events: all;
  cursor: none;
}
/* Stop the stencil canvas receiving events while painting */
#canvas-area.cleanup-mode #stencil-canvas {
  pointer-events: none;
}

/* ── Cleanup tool inspector section ─────────────────────────────────────── */
.cleanup-mode-row {
  display: flex;
  gap: 6px;
  margin: 6px 0 10px;
}
.cleanup-mode-btn {
  flex: 1;
  padding: 5px 0;
  border: 1.5px solid #b0cece;
  border-radius: 8px;
  background: #fff;
  color: var(--pb-dark-blue);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cleanup-mode-btn.active {
  background: var(--pb-blue);
  border-color: var(--pb-blue);
  color: #fff;
}
.cleanup-mode-btn:hover:not(.active) {
  background: #e8f4f4;
  border-color: var(--pb-blue);
}
.cleanup-hint {
  font-size: 0.72rem;
  color: var(--pb-dark-blue);
  opacity: 0.6;
  margin: 6px 0 10px;
  line-height: 1.4;
}
.cleanup-committing {
  font-size: 0.72rem;
  color: var(--pb-dark-pink);
  opacity: 0.8;
  margin: 4px 0 8px;
  font-style: italic;
}

/* --- Inspector panel --- */
#inspector-panel {
  width: var(--inspector-w);
  background: var(--pb-light-blue);
  border-left: 1px solid #c0dcdc;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 18px 16px;
}

/* ============================================================
   Inspector contents
   ============================================================ */
.insp-section { margin-bottom: 24px; }

.insp-section h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--pb-dark-blue);
  margin-bottom: 0;       /* subhead margin-top handles the gap below h3 */
  letter-spacing: 0.01em;
}

.insp-subhead {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-top: 14px;       /* consistent breathing room above every subsection */
  margin-bottom: 7px;
}
/* Secondary label — same style as subhead but tighter vertical rhythm,
   used for "All corners" / "Each corner" sub-labels */
.insp-sublabel {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.45;
  margin: 0;
}
/* Corner radius unified grid — 2 cols: label | content
   "mm" travels inline with the spin-group so it doesn't create a 3rd column
   wider than the panel. Col 2 = max(spin-group+mm, cr-main-grid) ≈ 148px, total ≈ 236px */
.cr-grid {
  display: grid;
  grid-template-columns: 82px auto;
  justify-content: start;
  column-gap: 6px;
  row-gap: 10px;
  align-items: center;
}
/* Flex row so spin-group and "mm" share the single content column */
.cr-all-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dim-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.dim-row label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  min-width: 18px;
}
.dim-row input[type="number"] {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1.5px solid #b0cece;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  color: var(--pb-dark-blue);
  outline: none;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}
.dim-row input[type="number"]::-webkit-outer-spin-button,
.dim-row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.dim-row input[type="number"]:focus { border-color: var(--pb-blue); }
/* Unified spinner group — three elements joined into one pill, matching the
   Order quantity stepper style. Wrap any (step-btn + input + step-btn) trio
   in <div class="spin-group"> and the CSS does the rest. */
.spin-group {
  display: flex;
  align-items: center;
  gap: 0;
}
.spin-group .step-btn {
  flex: none;
  width: 28px;
  height: 30px;
  border: 1px solid #ddd;
  border-radius: 0;
  background: #fff;
  color: var(--pb-dark-blue);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.spin-group .step-btn:first-child { border-radius: 6px 0 0 6px; }
.spin-group .step-btn:last-child  { border-radius: 0 6px 6px 0; }
.spin-group .step-btn:hover  { background: var(--pb-light-pink); border-color: var(--pb-dark-pink); }
.spin-group .step-btn:active { background: var(--pb-light-pink); filter: brightness(0.94); }
.spin-group input[type="number"] {
  height: 30px;
  width: 46px;
  flex: none;
  border: 1px solid #ddd;
  border-left: none;
  border-right: none;
  border-radius: 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pb-dark-blue);
  background: #fff;
  outline: none;
  min-width: 0;
  padding: 0 2px;
  -moz-appearance: textfield;
}
.spin-group input[type="number"]::-webkit-outer-spin-button,
.spin-group input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.spin-group input[type="number"]:focus { background: var(--pb-light-blue); }

/* Standalone .step-btn (not inside a spin-group) — kept for any future use */
.step-btn {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1.5px solid #b0cece;
  border-radius: 5px;
  background: transparent;
  color: var(--pb-dark-blue);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.step-btn:hover { background: #e8f4f4; border-color: var(--pb-blue); }
.step-btn:active { background: #d0eaea; }
.unit {
  font-size: 0.72rem;
  opacity: 0.55;
}

/* Material picker — segmented control */
.mat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-top: 14px;       /* same rhythm as .insp-subhead */
  margin-bottom: 7px;
}
.mat-picker {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.mat-swatch-btn {
  flex: 1;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: none;
  border-right: 1px solid #b0cece;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.64rem;
  color: var(--pb-dark-blue);
  line-height: 1.2;
}
.mat-swatch-btn:last-child { border-right: none; }
.mat-swatch-btn.active { background: var(--pb-dark-blue); color: #fff; }
.mat-swatch-btn:hover:not(.active) { background: var(--pb-light-pink); }

.swatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.mat-swatch-btn.active .swatch-dot {
  border-color: rgba(255,255,255,0.6);
  border-width: 2px;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.6);
}

.insp-info-link {
  font-size: 0.72rem;
  color: var(--pb-dark-blue);
  opacity: 0.6;
  cursor: pointer;
  border: none;
  background: none;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-bottom: 12px;
  display: block;
}
.insp-info-link:hover { opacity: 1; }

.insp-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 14px 0;
}

.insp-action-btn {
  flex: 1;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pb-dark-blue);
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
}
.insp-action-btn:hover:not([disabled]) { background: var(--pb-light-pink); border-color: var(--pb-dark-pink); }
.insp-action-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

.fit-btn {
  width: 100%;
  padding: 9px;
  background: #fff;
  border: 1px solid #ddd;
  color: var(--pb-dark-blue);
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 400;
  margin-bottom: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fit-btn:hover:not([disabled]) { background: var(--pb-light-pink); border-color: var(--pb-dark-pink); }
.fit-btn[disabled],
.fit-btn[disabled]:hover { opacity: 0.35; cursor: not-allowed; }

.pricing-placeholder {
  background: rgba(255,255,255,0.45);
  border: 1.5px dashed #b0cece;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--pb-dark-blue);
  opacity: 0.55;
}

/* ============================================================
   Status bar
   ============================================================ */
#status-bar {
  height: var(--status-bar-h);
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 0.78rem;
  color: var(--pb-dark-blue);
  flex-shrink: 0;
  gap: 8px;
}

/* Cut-readiness status — far left of status bar.
   Colour is secondary: word + icon encode state for colour-blind users
   (Ready / Issues + circle-with-check vs rounded-square with !). */
.rule-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  max-width: min(520px, 48vw);
  margin-right: 12px;
}
.rule-status-label {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pb-dark-blue);
  opacity: 0.75;
}
/* Icon badge: circle = Ready/idle; square = Issues (shape cue, not colour alone) */
.rule-status-light {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d0d8d8;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: background 0.2s, box-shadow 0.2s, border-radius 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.rule-status-light::after {
  content: '';
}
.rule-status-word {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--pb-dark-blue);
  opacity: 0.55;
  min-width: 2.6em;
}
.rule-status[data-state="ok"] .rule-status-light {
  /* Teal-green (still "go", a bit closer to brand blue) */
  background: #2a9d6e;
  box-shadow: 0 0 0 3px rgba(42, 157, 110, 0.22);
}
.rule-status[data-state="ok"] .rule-status-light::after {
  content: '\2713'; /* checkmark */
}
.rule-status[data-state="ok"] .rule-status-word {
  color: #1f7a55;
  opacity: 1;
}
.rule-status[data-state="block"] .rule-status-light {
  /* Warm coral + square shape so protanopia/deuteranopia still see a difference */
  background: #d94848;
  border-radius: 3px;
  box-shadow: 0 0 0 3px rgba(217, 72, 72, 0.22);
}
.rule-status[data-state="block"] .rule-status-light::after {
  content: '!';
}
.rule-status[data-state="block"] .rule-status-word {
  color: #a83232;
  opacity: 1;
}
/* Clickable when Issues — text/icon only (no chip background) */
.rule-status[data-state="block"] {
  cursor: pointer;
}
.rule-status[data-state="block"]:focus-visible {
  outline: 2px solid rgba(217, 72, 72, 0.45);
  outline-offset: 3px;
  border-radius: 4px;
}
.rule-status[data-state="block"] .rule-status-msg:empty::after {
  content: 'Details';
  font-weight: 600;
  opacity: 0.85;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rule-status[data-state="block"]:hover .rule-status-msg:empty::after {
  opacity: 1;
}
.rule-status[data-state="checking"] .rule-status-light {
  background: #c8d4d4;
  animation: rule-pulse 0.9s ease-in-out infinite;
}
.rule-status[data-state="checking"] .rule-status-word {
  opacity: 0.55;
  font-weight: 600;
}
@keyframes rule-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}
.rule-status-msg {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--pb-dark-blue);
}
.rule-status[data-state="block"] .rule-status-msg {
  color: #a83232;
}
.rule-status[data-state="ok"] .rule-status-msg,
.rule-status[data-state="idle"] .rule-status-msg,
.rule-status[data-state="checking"] .rule-status-msg {
  color: var(--pb-dark-blue);
  opacity: 0.65;
}
/* Temporary note (e.g. design area auto-grew) — more prominent than empty ok */
.rule-status-msg.rule-status-note {
  opacity: 1 !important;
  color: var(--pb-dark-blue);
  font-weight: 600;
}

/* Rule issues modal (blocked status details) */
#rule-issues-modal {
  position: fixed;
  inset: 0;
  background: rgba(82, 102, 102, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#rule-issues-modal.hidden {
  display: none;
}
#rule-issues-modal-inner {
  background: #fff;
  border-radius: 16px;
  padding: 28px 32px 24px;
  width: 420px;
  max-width: 95vw;
  max-height: min(80vh, 560px);
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
}
#rule-issues-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--pb-dark-pink);
  margin-bottom: 8px;
}
.rule-issues-intro {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--pb-dark-blue);
  opacity: 0.8;
  margin-bottom: 16px;
}
.rule-issues-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rule-issues-item {
  border: 1.5px solid #d5e4e4;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafcfc;
}
.rule-issues-item h4 {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--pb-dark-blue);
  margin-bottom: 4px;
}
.rule-issues-item p {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--pb-dark-blue);
  opacity: 0.8;
  margin: 0;
}
.rule-issues-action {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pb-dark-blue);
  background: #fff;
  border: 1.5px solid #b0cece;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rule-issues-action:hover {
  background: #e8f4f4;
  border-color: var(--pb-blue);
}
.rule-issues-close {
  width: 100%;
  padding: 10px;
  background: var(--pb-blue);
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.rule-issues-close:hover {
  opacity: 0.88;
}

.undo-redo-group {
  display: flex;
  gap: 0;
  margin-left: auto;
  margin-right: 8px;
}
/* Undo / Redo — joined pill matching inspector spinner style */
.undo-redo-group .icon-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  font-size: 1rem;
  border: 1.5px solid #b0cece;
  border-radius: 0;
  background: #fff;
  color: var(--pb-dark-blue);
}
#undo-btn { border-radius: 6px 0 0 6px; border-right: none; }
#redo-btn { border-radius: 0 6px 6px 0; }
.undo-redo-group .icon-btn:hover:not(:disabled) { background: #e8f4f4; border-color: var(--pb-blue); }
.undo-redo-group .icon-btn:disabled { color: #c8d8d8; background: #fff; }

.zoom-group {
  display: flex;
  align-items: center;
  gap: 0;
  margin-right: 8px;
}
/* Zoom — [−][level][+] joined pill + separate reset button */
.zoom-group .icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 1rem;
  border: 1.5px solid #b0cece;
  border-radius: 0;
  background: #fff;
  color: var(--pb-dark-blue);
}
#zoom-out-btn { border-radius: 6px 0 0 6px; border-right: none; }
#zoom-in-btn  { border-radius: 0 6px 6px 0; border-left: none; }
.zoom-group .icon-btn:hover:not(:disabled) { background: #e8f4f4; border-color: var(--pb-blue); }
#zoom-level {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 40px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 4px;
  background: #fff;
  border: 1.5px solid #b0cece;
  border-left: none;
  border-right: none;
  color: inherit;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}
#zoom-level:hover { background: #e8f4f4; }
.zoom-reset-btn {
  margin-left: 6px;
  border-radius: 6px !important;
  opacity: 1;
}
.zoom-reset-btn:hover { background: #e8f4f4; border-color: var(--pb-blue); }

.bool-btn-group {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.bool-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: var(--pb-dark-blue);
  cursor: pointer;
  transition: background 0.15s;
}

.bool-btn:hover:not(:disabled) {
  background: var(--pb-light-pink);
}

/* ---- Inspector section divider ---- */
.insp-divider {
  border: none;
  border-top: 1px solid #ebebeb;
  margin: 0;
}

/* ---- Anchor / origin picker ---- */
.anchor-pos-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.anchor-xy-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Tighter label + narrower input inside the anchor position row */
.anchor-xy-fields .dim-row {
  gap: 4px;
}
.anchor-xy-fields .dim-row label {
  min-width: 12px;
}
.anchor-xy-fields .spin-group input[type="number"] {
  width: 56px;
}
.anchor-picker {
  display: grid;
  grid-template-columns: repeat(3, 13px);
  grid-template-rows: repeat(3, 13px);
  gap: 4px;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  flex-shrink: 0;
}
.anchor-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid #bbb;
  background: #fff;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}
.anchor-dot:hover {
  border-color: var(--pb-dark-blue);
}
.anchor-dot.active {
  background: var(--pb-dark-blue);
  border-color: var(--pb-dark-blue);
}

.bool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.insp-hint {
  font-size: 11px;
  color: #888;
  margin: 4px 0 0;
}
.insp-subhead .insp-hint {
  text-transform: none;
  font-weight: normal;
  letter-spacing: 0;
}

.bool-hint {
  margin-top: 6px;
}

/* ---- Corner radius grid ---- */
/* cr-label: identical style to .dim-row label so All/Each corner match Width/Height */
.cr-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
}
/* cr-main-grid: 3 cols — icon(28px) | input-pair | icon(28px)
   Icon width matches step-btn so the input pair left-aligns with All corners input */
.cr-main-grid {
  display: grid;
  grid-template-columns: 28px auto 28px;
  column-gap: 0;
  row-gap: 4px;
  align-items: center;
}
.cr-pair {
  display: flex;
  gap: 4px;
}
.cr-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pb-dark-blue);
  opacity: 0.5;
  width: 28px;
}
.cr-input {
  width: 44px;
  padding: 7px 4px;
  font-size: 0.85rem;
  border: 1.5px solid #b0cece;
  border-radius: 6px;
  color: var(--pb-dark-blue);
  background: #fff;
  box-sizing: border-box;
  text-align: center;
  -moz-appearance: textfield;
}
.cr-input::-webkit-outer-spin-button,
.cr-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cr-input:focus {
  outline: none;
  border-color: var(--pb-pink);
  background: var(--pb-light-blue);
}
.cr-lock-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: var(--pb-dark-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.cr-lock-btn:hover { background: var(--pb-light-pink); }
.cr-lock-btn.active {
  background: var(--pb-dark-blue);
  border-color: var(--pb-dark-blue);
  color: #fff;
}
/* W/H inputs + aspect lock — label | input | mm  +  lock button to right */
.wh-lock-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
/* Grid dissolves the two dim-rows so label/spin-group/mm land in columns,
   guaranteeing both spinners share the same left edge. */
.wh-lock-inputs {
  display: grid;
  grid-template-columns: 82px auto auto;
  justify-content: start;
  gap: 3px 6px;
  align-items: center;
}
.wh-lock-inputs .dim-row {
  display: contents; /* children (label, spin-group, unit) flow into parent grid */
}
.wh-lock-inputs .dim-row label {
  min-width: unset; /* grid column handles width */
}
.wh-lock-inputs .spin-group {
  justify-self: start; /* prevent grid from stretching the pill */
}
/* Read-only auto value aligned with spin-group width (28+52+28) */
.wh-lock-inputs input.insp-auto-field {
  width: 108px;
  height: 30px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  font-size: 0.85rem;
  background: #f4f6f6;
  color: var(--pb-dark-blue);
  opacity: 0.7;
  justify-self: start;
  cursor: default;
}
.wh-lock-inputs input.insp-auto-field:focus {
  outline: none;
}

/* ---- Align section ---- */
.align-ref-group {
  display: flex;
  margin-bottom: 8px;
}
.align-ref-btn {
  flex: 1;
  padding: 5px 4px;
  font-size: 11px;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--pb-dark-blue);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.align-ref-btn:first-child {
  border-radius: 6px 0 0 6px;
  border-right: none;
}
.align-ref-btn:last-child {
  border-radius: 0 6px 6px 0;
}
.align-ref-btn.active {
  background: var(--pb-dark-blue);
  color: #fff;
  border-color: var(--pb-dark-blue);
}
.align-ref-btn:not(.active):hover {
  background: var(--pb-light-pink);
}
.rot-reflect-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.rot-reflect-col {
  flex: 1;
  min-width: 0;
}
.rot-reflect-col .dim-row {
  margin-bottom: 0;
}
/* Rotation input — spin-group handles sizing, just widen slightly for ±3 digits */
.rot-input-row .spin-group input[type="number"] {
  width: 52px;
}
/* Shape/compound W+H and design-area W+H — 3-digit mm values */
.wh-lock-inputs .spin-group input[type="number"] { width: 52px; }
/* Corner radius master spinner — keeps same 46px default */
.spin-group #insp-cr-all { width: 46px; }
.align-btn-row {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}
.align-btn {
  flex: 1;
  padding: 7px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: var(--pb-dark-blue);
  cursor: pointer;
  transition: background 0.15s;
  line-height: 0;
}
.align-btn:hover:not(:disabled) {
  background: var(--pb-light-pink);
}
.align-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Floppiness Factor Android-style toggle ---- */
.floppiness-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pb-dark-blue);
  white-space: nowrap;
}
.floppiness-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-track {
  position: relative;
  width: 38px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.floppiness-toggle input:checked + .toggle-track {
  background: var(--pb-dark-pink);
}
.floppiness-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
}
.toggle-label {
  opacity: 0.75;
  transition: opacity 0.15s;
}
.floppiness-toggle:hover .toggle-label {
  opacity: 1;
}

/* ============================================================
   Launcher overlay
   ============================================================ */
#launcher-overlay {
  position: fixed;
  inset: 0;
  background: rgba(82,102,102,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#launcher-modal {
  background: #fff;
  border-radius: 18px;
  padding: 40px 40px 36px;
  width: 440px;
  max-width: 95vw;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
}

#launcher-modal .lnch-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
#launcher-modal .lnch-brand-logo {
  height: 50px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
#launcher-modal .lnch-brand-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--pb-dark-pink);
  margin: 12px 0 0 0;
  line-height: 1;
  align-self: center;
}

#launcher-modal .lnch-tagline {
  font-size: 1.1rem;
  color: var(--pb-dark-blue);
  opacity: 0.65;
  margin-bottom: 28px;
}

.lnch-field {
  margin-bottom: 20px;
}
.lnch-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pb-dark-blue);
  margin-bottom: 7px;
}
.lnch-field input[type="email"],
.lnch-field input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--pb-dark-blue);
  outline: none;
  transition: border-color 0.15s;
}
.lnch-field input:focus { border-color: var(--pb-pink); }
.field-err {
  font-size: 0.72rem;
  color: var(--pb-dark-pink);
  margin-top: 4px;
  min-height: 1em;
}

.dim-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dim-inputs input[type="number"] {
  width: 90px;
  flex: none;
}
.dim-sep { font-size: 1.1rem; opacity: 0.4; }
.dim-unit { font-size: 0.78rem; opacity: 0.55; }

/* Launcher dimension spinners — reuse inspector wh-lock-inputs layout */
.lnch-wh { margin-top: 2px; }
/* Cancel lnch-field label margin inside the spinner grid so rows stay centred */
.lnch-field .wh-lock-inputs label { margin-bottom: 0; }
/* Cancel the lnch-field border-radius / padding / width overrides inside spin-groups */
.lnch-field .spin-group input[type="number"] {
  width: 56px;
  padding: 7px 9px;
  border-radius: 0;
  border-left: none;
  border-right: none;
}
.lnch-dim-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted, #999);
  margin-left: 4px;
}

/* Launcher material swatches */
.lnch-mat-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.lnch-swatches {
  display: flex;
  gap: 8px;
  flex: 1;
}
.lnch-swatch-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #f6f6f6;
  cursor: pointer;
  font-size: 0.68rem;
  color: var(--pb-dark-blue);
  line-height: 1.3;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.lnch-swatch-btn.active {
  border-color: var(--pb-dark-pink);
  background: var(--pb-light-pink);
}
.lnch-swatch-btn:hover:not(.active) { border-color: #e0c8c8; background: #fafafa; }

.lnch-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
}

.lnch-info-btn {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 4px;
  padding: 7px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--pb-dark-blue);
  cursor: pointer;
  background: none;
  transition: border-color 0.15s;
}
.lnch-info-btn:hover { border-color: var(--pb-blue); }

.lnch-ok-btn {
  width: 100%;
  padding: 13px;
  background: var(--pb-pink);
  color: #fff;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-top: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
  border: none;
}
.lnch-ok-btn:hover { opacity: 0.9; }

/* ============================================================
   Material comparison modal
   ============================================================ */
#material-modal {
  position: fixed;
  inset: 0;
  background: rgba(82,102,102,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#material-modal-inner {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 380px;
  max-width: 95vw;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
}

#material-modal-inner h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--pb-dark-pink);
  margin-bottom: 20px;
}

.mat-compare-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.mat-compare-item:last-of-type { margin-bottom: 24px; }

.mat-compare-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
  margin-top: 1px;
}

.mat-compare-text h4 {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--pb-dark-blue);
  margin-bottom: 3px;
}
.mat-compare-text p {
  font-size: 0.78rem;
  color: var(--pb-dark-blue);
  line-height: 1.55;
  opacity: 0.78;
}

.mat-modal-close {
  width: 100%;
  padding: 10px;
  background: var(--pb-blue);
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.mat-modal-close:hover { opacity: 0.88; }

/* ============================================================
   Order section — quantity stepper, shipping, price breakdown
   ============================================================ */

/* Quantity stepper — uses .spin-group / .step-btn, just needs a larger size */
#insp-qty          { width: 56px; height: 36px; font-size: 0.9rem; }
#qty-minus,
#qty-plus          { width: 36px; height: 36px; font-size: 1.1rem; }

/* Shipping select */
#insp-shipping {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #b0cece;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--pb-dark-blue);
  background: #fff;
  outline: none;
  cursor: pointer;
  margin-bottom: 14px;
  appearance: auto;
}
#insp-shipping:focus { border-color: var(--pb-blue); }

/* Large Letter warning */
.ll-warn {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--pb-dark-pink);
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Price breakdown table */
.pb-table {
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--pb-dark-blue);
}
.pb-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  line-height: 1.4;
}
.pb-row span:first-child { flex: 1; }
.pb-row span:last-child  { white-space: nowrap; font-variant-numeric: tabular-nums; }

.pb-sep {
  border-top: 1px solid rgba(82,102,102,0.15);
  margin: 5px 0;
}

.pb-total {
  padding-top: 5px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--pb-dark-pink);
}

.pb-floor {
  font-size: 0.67rem;
  opacity: 0.65;
  font-style: italic;
}

/* ============================================================
   Text section — content input, font picker, delete button
   ============================================================ */
.insp-text-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #b0cece;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--pb-dark-blue);
  background: #fff;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.insp-text-input:focus { border-color: var(--pb-blue); }

.font-picker {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
  max-height: 220px;
  overflow-y: auto;
}

.font-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: rgba(255,255,255,0.5);
  transition: background 0.12s, border-color 0.12s;
  user-select: none;
}
.font-row:hover { background: rgba(255,255,255,0.85); }
.font-row.active {
  background: #fff;
  border-color: var(--pb-blue);
}
.font-row:focus { outline: 2px solid var(--pb-blue); outline-offset: 1px; }

.font-preview {
  font-size: 1.15rem;
  line-height: 1;
  flex: 1;
  color: var(--pb-dark-blue);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.font-name {
  font-size: 0.62rem;
  font-family: var(--font-ui);
  color: var(--pb-dark-blue);
  opacity: 0.5;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Simplify + Delete side-by-side row at top of inspector section */
.insp-top-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 2px;
}
.insp-top-actions .secondary-btn,
.insp-top-actions .delete-btn {
  flex: 1;
  width: auto;
  margin-top: 0;
}

.secondary-btn {
  padding: 8px;
  background: #fff;
  border: 1.5px solid #b0cece;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--pb-dark-blue);
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.secondary-btn:hover {
  background: #e8f4f4;
  border-color: var(--pb-blue);
}

.delete-btn {
  width: 100%;
  padding: 8px;
  background: #fff;
  border: 1px solid #ddd;
  margin-top: 8px;
  border-radius: 6px;
  color: var(--pb-dark-blue);
  font-size: 0.82rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.delete-btn:hover {
  background: var(--pb-light-pink);
  border-color: var(--pb-dark-pink);
}

/* ============================================================
   Context menu
   ============================================================ */
#context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 160px;
  background: #fff;
  border: 1px solid rgba(82,102,102,0.14);
  border-radius: 9px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.13), 0 1px 5px rgba(0,0,0,0.07);
  padding: 5px 0;
  font-family: var(--font-ui);
  font-size: 0.83rem;
  user-select: none;
  outline: none;
}

#context-menu button[role="menuitem"] {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 18px;
  background: none;
  border: none;
  color: var(--pb-dark-blue);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  border-radius: 0;
  transition: background 0.1s;
}

#context-menu button[role="menuitem"]:hover:not(:disabled) {
  background: var(--pb-light-pink);
}

#context-menu button[role="menuitem"]:disabled {
  opacity: 0.35;
  cursor: default;
}

#context-menu .cm-danger {
  color: #c0392b;
}

#context-menu .cm-danger:hover:not(:disabled) {
  background: rgba(192,57,43,0.08);
  color: #c0392b;
}

#context-menu .cm-sep {
  height: 1px;
  background: rgba(82,102,102,0.11);
  margin: 4px 0;
}

/* ============================================================
   Shapes picker panel
   ============================================================ */

#shapes-picker {
  position: absolute;
  left: calc(var(--tool-rail-w) + 6px);
  top: 0;
  bottom: 0;
  width: 238px;
  background: var(--pb-paper);
  border-right: 1px solid rgba(82,102,102,0.14);
  box-shadow: 2px 0 8px rgba(0,0,0,0.10);
  overflow-y: auto;
  z-index: 120;
  display: flex;
  flex-direction: column;
}

#shapes-picker.hidden { display: none; }

#shapes-picker-inner {
  padding: 10px 8px 16px;
}

.shapes-cat-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pb-dark-blue);
  opacity: 0.65;
  margin: 10px 4px 6px;
}

.shapes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}

.shape-thumb {
  display: grid;
  grid-template-rows: 48px auto;
  align-items: start;
  justify-items: center;
  gap: 4px;
  padding: 6px 4px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  color: var(--pb-dark-blue);
}

.shape-thumb:hover {
  background: rgba(149,199,200,0.18);
  border-color: rgba(82,102,102,0.20);
}

.shape-thumb.active,
.shape-thumb[aria-pressed="true"] {
  background: rgba(149,199,200,0.32);
  border-color: var(--pb-blue);
}

.shape-thumb svg {
  max-width: 48px;
  max-height: 48px;
  align-self: center;
}

.shape-thumb span {
  font-family: var(--font-ui);
  font-size: 0.60rem;
  text-align: center;
  line-height: 1.3;
  color: var(--pb-dark-blue);
  opacity: 0.80;
  max-width: 64px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

