/* Immutable source appearance: no tinting, deleted glyphs or generated room names. */
#floor-image{opacity:1;pointer-events:none}
#map{background:#fff;overflow:hidden;isolation:isolate}
.map-transform{filter:none}
.map-stage{background:#fff}
#rooms .source-label{cursor:pointer}
#rooms .source-label>rect,#rooms .source-label>polygon{fill:transparent;stroke:transparent;stroke-width:1.5;vector-effect:non-scaling-stroke}
#rooms .source-label:hover>rect,#rooms .source-label:hover>polygon,#rooms .source-label:focus-visible>rect,#rooms .source-label:focus-visible>polygon{stroke:#967326;stroke-dasharray:4 3;fill:transparent}
#rooms .source-label.selected>rect,#rooms .source-label.selected>polygon{stroke:#216755;fill:transparent}
#rooms .source-label.selected.user-boundary>polygon{stroke-dasharray:5 3}
#rooms .source-override rect{fill:#fff;stroke:none}
#rooms .source-override text{text-anchor:start;fill:#152e27;stroke:none;font-family:Atlas,'Segoe UI',sans-serif;font-weight:400}
.source-excerpt{background:#fff;border:1px solid var(--line);padding:12px;margin:18px 0;flex-shrink:0}
.source-excerpt svg{display:block;width:100%;height:80px;overflow:hidden}
.source-excerpt small{display:block;font-size:10px;color:#626a60;margin-top:10px}
.list-label{white-space:pre-wrap;flex:1;overflow-wrap:anywhere}
.list-label small{display:block;font-size:.85em;color:#687263;margin-top:4px}
.detail h3{white-space:pre-wrap}
.source-note{font-size:12px;line-height:1.7;padding:12px 0;border-bottom:1px solid var(--line);color:#495849;flex-shrink:0}
.source-note strong{display:block;font-weight:600;margin-bottom:6px}
.assignment{padding:14px 0;border-bottom:1px solid var(--line);flex-shrink:0}
.assignment p{white-space:pre-wrap;overflow-wrap:anywhere;margin:10px 0;font-size:14px}
.assignment small{font-size:11px;color:#64745f;line-height:1.6}
.source-link{color:var(--ink);display:inline-block;padding:12px 0}
.legend label{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer}
.legend input{width:20px;height:20px;accent-color:var(--teal)}
.map-footer .legend{flex-wrap:wrap}
.map-heading .view-switch{flex-shrink:0}
.detail .provenance{font-size:11px;line-height:1.7}
.provenance button{min-height:44px;font-size:11px;text-decoration:underline}
#boundary-tools{position:absolute;top:8px;left:12px;right:12px;background:#f6f6eb;border:1px solid #bdc9b7;padding:14px;z-index:5;box-shadow:0 4px 18px #213e3815;font-size:12px}
#boundary-tools[hidden]{display:none}
#boundary-tools strong,#boundary-tools span{display:block;margin-bottom:8px}
#boundary-tools>div{display:flex;gap:8px;flex-wrap:wrap}
#boundary-tools button{min-height:44px;padding:10px;background:#e3e8da;border-radius:4px}
#boundary-tools #boundary-save{background:var(--ink);color:var(--paper)}
#boundary-tools button:disabled{opacity:.4;cursor:default}
#boundary-preview polyline{fill:none;stroke:#ae7620;stroke-width:2;vector-effect:non-scaling-stroke}
#boundary-preview circle{fill:#ae7620;stroke:#fff;stroke-width:1;vector-effect:non-scaling-stroke}
.drawing-boundary{cursor:crosshair}
.drawing-boundary .source-label{cursor:crosshair!important}
/* Whole-room hit areas are separate from the immutable source drawing. */
.room-zone{fill:#26836e;fill-opacity:.015;stroke:transparent;stroke-width:2;vector-effect:non-scaling-stroke;cursor:pointer;transition:fill-opacity .16s,stroke .16s}
.room-zone.selected{fill-opacity:.14;stroke:#267360;stroke-width:2}
.room-zone:hover,.room-zone.hovered{fill-opacity:.38;stroke:#105b48;stroke-width:3.5}
#rooms .source-label.user-boundary:hover>polygon,#rooms .source-label.user-boundary.hovered>polygon{fill:#26836e;fill-opacity:.38;stroke:#105b48;stroke-width:3.5;stroke-dasharray:none}
#rooms .source-label.user-boundary.selected>polygon{fill:#26836e;fill-opacity:.14;stroke-width:2}
#rooms .readable-label rect{fill:#fffef7;fill-opacity:.96;stroke:#d4d7ca;stroke-width:.7}
#rooms .readable-label .source-text-mask{fill:#fffef7;fill-opacity:1;stroke:none!important}
#rooms .readable-name{font-family:Atlas,'Segoe UI',sans-serif;font-size:15px;font-weight:650;text-anchor:middle;fill:#17372d;stroke:none}
#rooms .readable-area{font-family:Atlas,'Segoe UI',sans-serif;font-size:9px;font-weight:600;text-anchor:middle;fill:#3a4e42;stroke:none}
#rooms .readable-label .label-backing{fill-opacity:.83;stroke:none}
#stage{user-select:none;-webkit-user-select:none}
#rooms .source-label.selected .readable-label rect,#rooms .source-label.hovered .readable-label rect{stroke:#17634d;stroke-width:1.5;fill:#f4fbef}
#hover-caption{position:absolute;left:12px;top:12px;max-width:calc(100% - 24px);padding:12px 18px;background:#174c3d;color:#fffdf0;box-shadow:0 3px 15px #17372d22;border-radius:5px;z-index:3;font-size:14px;pointer-events:none}
#hover-caption[hidden]{display:none}
body.board #hover-caption{font-size:clamp(18px,1.2vw,38px)}
@media(min-width:1800px){.source-excerpt svg{height:6vw}.source-excerpt small,.assignment small{font-size:clamp(13px,.75vw,25px)}.source-note,.assignment p,.detail .provenance{font-size:clamp(16px,1vw,34px)}}
body.board .source-note,body.board .assignment p{font-size:clamp(18px,1.1vw,36px)}
body.board #boundary-tools{font-size:clamp(16px,1vw,30px)}
body.board #boundary-tools button{min-height:56px}
@media(max-width:1150px){.map-heading{flex-wrap:wrap}}
@media(max-width:600px){.source-excerpt svg{height:100px}.source-note{font-size:14px}.map-hint{max-width:calc(100% - 190px);font-size:9px}}

/* Reveal added labels only through room interaction; keep the original drawing visible. */
#rooms .readable-label,#rooms .source-override{visibility:hidden}
#rooms .source-label.hovered .readable-label,
#rooms .source-label.label-active .readable-label,
#rooms .source-label:focus-visible .readable-label,
#rooms .source-label.hovered .source-override,
#rooms .source-label.label-active .source-override,
#rooms .source-label:focus-visible .source-override{visibility:visible}
