/* Draw overlay for the body-shape stage. Uses the page design tokens.
   No Inter. Hover changes color only. */

.bd-panel {
  font-family: var(--font-ui);
  color: var(--text-primary);
  box-sizing: border-box;
  align-self: flex-start;
}

.bd-panel.is-open {
  width: 512px;
  max-width: 100%;
  background: var(--surface-panel);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bd-panel:not(.is-open) {
  width: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.bd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.bd-title {
  font-size: var(--text-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-400);
  font-weight: 700;
}

.bd-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bd-panel:not(.is-open) .bd-body {
  display: none;
}

.bd-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
}

.bd-label {
  font-size: var(--text-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-400);
  flex: none;
}

.bd-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-button);
  background: var(--surface-button);
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
}

.bd-btn:hover:not(:disabled) {
  background: var(--surface-button-hover);
  color: #ffffff;
}

.bd-btn[aria-pressed="true"] {
  background: var(--surface-button-pressed);
  color: #ffffff;
}

.bd-btn:disabled {
  color: var(--text-disabled);
  opacity: 0.6;
  cursor: not-allowed;
}

.bd-btn:focus-visible {
  outline: 2px solid var(--blue-300);
  outline-offset: 1px;
}

.bd-swatches {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-1);
  overflow-x: auto;
  max-width: 100%;
  flex: 1;
  min-width: 0;
  padding-bottom: 2px;
}

.bd-swatch {
  width: 18px;
  height: 18px;
  flex: none;
  padding: 0;
  border-radius: 4px;
  border: 2px solid #333;
  cursor: pointer;
  background: var(--swatch, #808080);
}

.bd-swatch:hover {
  border-color: var(--fog-100);
}

.bd-swatch.is-on {
  border-color: var(--blue-300);
}

.bd-swatch:focus-visible {
  outline: 2px solid var(--blue-300);
  outline-offset: 1px;
}

.bd-slider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--text-primary);
}

.bd-slider input[type="range"] {
  flex: 1;
  min-width: 80px;
  accent-color: var(--surface-button-hover);
}

.bd-readout {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
  min-width: 42px;
  text-align: right;
}

.bd-note {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

#body-draw-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

#body-draw-overlay[data-passthrough="1"],
#body-draw-overlay[data-passthrough="1"] * {
  pointer-events: none !important;
  touch-action: auto;
}

#body-draw-overlay[data-passthrough="0"] {
  pointer-events: auto;
  touch-action: none;
}

#body-draw-overlay[data-tool="brush"],
#body-draw-overlay[data-tool="line"],
#body-draw-overlay[data-tool="rect"],
#body-draw-overlay[data-tool="ellipse"],
#body-draw-overlay[data-tool="blob"] {
  cursor: crosshair;
}

#body-draw-overlay[data-tool="select"] {
  cursor: default;
}

.bd-handle {
  fill: var(--fog-100);
  stroke: var(--blue-700);
  stroke-width: 1.5;
  cursor: nwse-resize;
}

.bd-handle[data-corner="ne"],
.bd-handle[data-corner="sw"] {
  cursor: nesw-resize;
}

.bd-selbox {
  fill: none;
  stroke: var(--blue-300);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  pointer-events: none;
}
