.survey-sketch {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.survey-sketch-tools,
.survey-sketch-zoom,
.survey-sketch-edit {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}
#library-surveys-panel .survey-sketch-tools [aria-pressed=true] {
  color: white;
  background: var(--green);
  border-color: var(--green);
}
#library-surveys-panel .survey-sketch-undo-icon { display: none; }
.survey-sketch-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  min-height: 2.9em;
}
.survey-sketch-status.is-error { color: #963c2d; }
.survey-sketch-stage {
  position: relative;
  height: clamp(290px, 46svh, 520px);
  min-width: 0;
  border-radius: 8px;
  background: #f7f8f3;
  border: 1px solid var(--line);
}
#library-surveys-panel .survey-sketch-stage > svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  touch-action: pan-y pinch-zoom;
  cursor: crosshair;
}
.survey-sketch-stage > svg:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.survey-sketch-zoom {
  position: absolute;
  bottom: 10px;
  right: 10px;
}
.survey-sketch-zoom > button { min-width: 44px; }
.survey-sketch-grid { stroke: #e7eae0; }
.survey-sketch-grid.major { stroke: #d5dbce; }
.survey-sketch-room { fill: #72947a20; }
.survey-sketch-wall {
  stroke: #285744;
  stroke-width: 3px;
  stroke-linecap: round;
}
.survey-sketch-wall.partition { stroke: #666d60; stroke-dasharray: 6 4; }
.survey-sketch-wall.selected { stroke: #ab671b; stroke-width: 4px; }
.survey-sketch-point { fill: #285744; stroke: white; stroke-width: 1.5px; }
.survey-sketch-point.selected { fill: #ab671b; stroke-width: 2px; }
.survey-sketch-point.closing { stroke: #ab671b; stroke-width: 2px; }
.survey-sketch-cursor { fill: #fff8ec; stroke: #ab671b; stroke-width: 1.5px; }
.survey-sketch-guide { stroke: #a26019; stroke-dasharray: 5 4; stroke-width: 2px; }
.survey-sketch-scale { fill: none; stroke: #4c6556; }
.survey-sketch-size {
  font-size: 12px;
  font-weight: 600;
  fill: #294335;
  stroke: #f7f8f3;
  stroke-width: 3px;
  paint-order: stroke fill;
  stroke-linejoin: round;
  pointer-events: none;
}
.survey-sketch-selection:empty { display: none; }
.survey-sketch-edit {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.survey-sketch-edit-title { width: 100%; }
.survey-sketch-edit > .survey-field { flex: 0 1 125px; }
.survey-sketch-edit-hint {
  order: 1;
  width: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 500px) {
  .survey-sketch-tools { display: grid; grid-template-columns: 1fr 1fr 44px 1.12fr; gap: 6px; }
  #library-surveys-panel .survey-sketch-tools > .button { padding-inline: 4px; font-size: 12px; }
  .survey-sketch-undo-label { display: none; }
  #library-surveys-panel .survey-sketch-undo-icon {
    display: block;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
  }
  .survey-sketch-edit > .survey-field { flex: 1 1 105px; }
}
