/* --- floor plan (mock: .plan) --------------------------------------------------------- */

/* On a phone the plan comes before the rooms; from 900px it stands in the right column and stays in
   view while the rooms scroll. */
.hw-plan-card {
  min-width: 0;
}

@media (min-width: 900px) {
  .hw-house > .hw-plan-card {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 96px;
  }

  .hw-house > .hw-house-rooms {
    grid-column: 1;
    grid-row: 1;
  }
}

.hw-plan-drawing {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.hw-plan-image {
  opacity: 0.9;
}

.hw-plan-outline {
  fill: none;
  stroke: var(--bsft-color-muted);
  stroke-dasharray: 4 4;
}

.hw-plan-room polygon {
  fill: var(--hw-surface-2);
  fill-opacity: 0.92;
  stroke: var(--bsft-color-text);
  stroke-width: 1.5;
  stroke-linejoin: round;
  cursor: pointer;
}

.hw-plan-room.done polygon {
  fill: var(--bsft-color-success-surface);
}

.hw-plan-room.open polygon {
  fill: var(--bsft-color-warning-surface);
}

.hw-plan-room.np polygon {
  fill: var(--bsft-color-danger-surface);
}

.hw-plan-room.is-selected polygon {
  stroke: var(--bsft-color-primary);
  stroke-width: 3.5;
}

.hw-plan-room polygon:focus {
  outline: none;
}

.hw-plan-room polygon:focus-visible {
  stroke: var(--bsft-color-primary);
  stroke-width: 3.5;
  stroke-dasharray: 6 3;
}

.hw-plan-room text {
  fill: var(--bsft-color-text);
  font-family: var(--hw-font-body);
  font-size: 11px;
  pointer-events: none;
  user-select: none;
}

.hw-plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hw-plan-legend .hw-chip.done {
  background: var(--bsft-color-success-surface);
  color: var(--bsft-color-success);
  border-color: transparent;
}

.hw-plan-legend .hw-chip.open {
  background: var(--bsft-color-warning-surface);
  color: var(--bsft-color-warning);
  border-color: transparent;
}

.hw-plan-legend .hw-chip.np {
  background: var(--bsft-color-danger-surface);
  color: var(--bsft-color-danger);
  border-color: transparent;
}

.hw-plan-card > .hw-hint {
  margin: 8px 0 0;
}

/* --- house page: floor tabs, room rows ---------------------------------------------------- */

/* Many floors wrap onto a second line instead of scrolling out of sight. */
.hw-floor-tabs {
  flex-wrap: wrap;
  border-radius: 18px;
}

.hw-floor-tabs > button {
  flex: 1 1 auto;
}

.hw-house-visit:empty {
  display: none;
}

.hw-room {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 10px;
}

.hw-room > .hw-room-pick,
.hw-room > .hw-room-head {
  flex: 1;
  min-width: 0;
}

.hw-room-text {
  flex: 1;
  min-width: 0;
}

.hw-room-status {
  flex: none;
}

/* The picked room follows the plan's selection with a bar in the same inset every row keeps, so nothing shifts. */
.hw-room.is-picked {
  box-shadow: inset 3px 0 0 var(--bsft-color-primary);
}

.hw-rooms-order-done {
  margin-left: auto;
}

/* --- editor ----------------------------------------------------------------------------- */

.hw-plan-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hw-plan-editor .hw-hint {
  margin: 0;
}

.hw-plan-drawing.is-editing {
  touch-action: none;
  user-select: none;
  background: var(--hw-surface-2);
  border: 1px solid var(--bsft-color-border);
}

.hw-plan-drawing.is-editing:focus-visible {
  outline: 2px solid var(--bsft-color-primary);
  outline-offset: 2px;
}

.hw-plan-drawing.is-editing .hw-plan-room polygon {
  cursor: move;
}

.hw-plan-grid {
  fill: url(#hw-plan-grid);
}

.hw-plan-grid-dot {
  fill: var(--bsft-color-border);
}

.hw-plan-handle {
  fill: var(--bsft-color-surface);
  stroke: var(--bsft-color-primary);
  stroke-width: 2;
  pointer-events: none;
}

.hw-plan-draft {
  fill: var(--hw-accent-soft);
  fill-opacity: 0.6;
  stroke: var(--bsft-color-primary);
  stroke-width: 2;
  stroke-dasharray: 5 3;
  pointer-events: none;
}

polyline.hw-plan-draft {
  fill: none;
}

.hw-plan-targets,
.hw-plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.hw-plan-targets .hw-chip {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 14px;
  cursor: pointer;
}

.hw-plan-targets .hw-chip[aria-pressed="true"] {
  background: var(--hw-house-soft);
  color: var(--hw-house);
  border-color: var(--hw-house);
  font-weight: 700;
}

.hw-plan-caption {
  font-size: 13px;
  font-weight: 700;
  color: var(--bsft-color-muted);
}

.hw-plan-actions select {
  min-height: 40px;
  max-width: 100%;
}

.hw-plan-actions label.bsft-button {
  cursor: pointer;
}

.hw-plan-tools {
  align-self: flex-start;
  max-width: 100%;
}
