.custom-map-dashboard { grid-template-columns: minmax(0, 1fr); }
.floor-controls > [aria-pressed=true] { border-color: #8aa893; background: var(--pine-light); color: var(--pine); }
.map-view { min-width: 0; padding: 5px; border: 1px solid #dfe8dc; border-radius: 13px; background: #edf2e9; }
.floor-map {
  --map-pin-width: 94px;
  --map-pin-height: 66px;
  position: relative;
  isolation: isolate;
  width: min(100%, calc(500px * var(--map-factor, 1.333)));
  min-width: min(100%, 120px);
  min-height: 120px;
  aspect-ratio: var(--map-ratio, 4/3);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 9px;
  background: #f4f6ee;
  background-image: linear-gradient(90deg, #dce7db 1px, transparent 1px), linear-gradient(#dce7db 1px, transparent 1px);
  background-size: 20px 20px;
}
.floor-map.is-editable {
  --map-pin-height: 42px;
  width: min(100%, calc(560px * var(--map-factor, 1.333)));
  touch-action: none;
  cursor: crosshair;
  user-select: none;
}
.map-background, .map-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-background { display: block; object-fit: fill; }
.map-photo-error { position: absolute; z-index: 2; top: 7px; right: 7px; padding: 4px 7px; border-radius: 6px; background: #fff; color: var(--red); font-size: 12px; }
.map-line, .map-preview { stroke-width: 4px; stroke-linecap: round; }
.map-wall { stroke: #294c41; }
.map-door { stroke: #ae691b; stroke-dasharray: 4 5; }
.map-selected-line, .map-preview { stroke: #2a7f55; stroke-width: 4px; }
.map-preview { stroke-dasharray: 5 4; }
.map-pin, .map-anchor, .map-endpoint {
  position: absolute;
  left: var(--map-x);
  top: var(--map-y);
  transform: translate(-50%, -50%);
}
.map-pin {
  --half-width: calc(var(--map-pin-width) / 2);
  --half-height: calc(var(--map-pin-height) / 2);
  left: clamp(var(--half-width), var(--map-x), calc(100% - var(--half-width)));
  top: clamp(var(--half-height), var(--map-y), calc(100% - var(--half-height)));
  width: var(--map-pin-width);
  height: var(--map-pin-height);
  z-index: 1;
}
.map-pin:focus-within, .map-pin:has([aria-pressed=true]) { z-index: 2; }
.map-pin .map-table {
  width: 100%;
  height: 100%;
  gap: 2px;
  padding: 5px 6px;
  border-color: #aebfb2;
  background: #fffffff5;
  box-shadow: 0 2px 5px #14352b18;
}
.map-pin .map-table.has-outstanding { border-color: #ad8a49; }
.map-pin .map-table[aria-pressed=true] { border-color: #376454; background: #e6f3e1; box-shadow: inset 0 0 0 1px #376454; }
.is-editable .map-pin .map-table { justify-content: center; text-align: center; cursor: grab; }
.is-editable .map-pin .map-table:active { cursor: grabbing; }
.map-table .table-name, .map-table .table-state, .map-table-sales { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-table .table-name { font-size: 12px; }
.map-table .table-state { font-size: 10px; }
.map-table-sales { display: flex; align-items: baseline; gap: 3px; margin-top: auto; color: var(--quiet); font-size: 9px; }
.map-table-sales strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--pine); font-size: 11px; font-weight: 780; font-variant-numeric: tabular-nums; }
.map-endpoint, .map-anchor {
  width: 22px;
  height: 22px;
  z-index: 3;
  border-radius: 50%;
  border: 2px solid #215d43;
  background: #fff;
  box-shadow: 0 0 0 3px #c7ecda90;
}
.map-endpoint { left: clamp(12px, var(--map-x), calc(100% - 12px)); top: clamp(12px, var(--map-y), calc(100% - 12px)); cursor: move; }
.map-anchor { width: 12px; height: 12px; pointer-events: none; }
.map-toolbar, .map-fields { display: grid; gap: 9px; }
.map-toolbar { margin: 0 0 9px; }
.map-fields { margin: 11px 0 0; }
.map-photo-controls, .map-tool-buttons { display: flex; align-items: end; flex-wrap: wrap; gap: 6px; min-width: 0; }
.map-photo-field { min-width: 0; flex: 0 1 330px; }
.map-photo-field input { height: auto; min-height: 38px; padding: 6px 7px; font-size: 13px; }
.map-tool-buttons .button[aria-pressed=true] { background: var(--pine-light); border-color: #8aa893; color: var(--pine); }
.map-message { color: var(--quiet); font-size: 13px; line-height: 1.45; }
.map-position-form { padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.map-point-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.map-position-form > .button { justify-self: start; }
.map-shape-list h3 { margin-bottom: 6px; font-size: 14px; }
@media (max-width: 710px) {
  .floor-map { --map-pin-width: 62px; --map-pin-height: 57px; }
  .floor-map.is-editable { --map-pin-height: 42px; }
  .map-pin .map-table { padding-inline: 3px; }
  .map-table .table-name { font-size: 11px; }
  .map-table-sales > span { display: none; }
}
