.home-plan,.home-scene,.home-memory{overflow-wrap:anywhere}
.plan-title,.plan-toolbar,.sheet-title,.inspector-caption,.plan-tabs{display:flex;align-items:center;gap:.7rem}
.plan-title,.plan-toolbar,.sheet-title{justify-content:space-between}
.plan-title{align-items:flex-start;flex-wrap:wrap;margin:1rem 0 1.1rem}
.plan-title h1,.plan-inspector h2,.home-scene h2{margin:0 0 .4rem}
.plan-subtitle{margin:0;color:var(--muted);font-family:var(--font-display,Georgia),serif}
.plan-subtitle span{padding-inline:.25em}
.plan-toolbar{border-block:1px solid var(--line);padding:.3rem 0;flex-wrap:wrap;margin:0 0 1rem}
.plan-tabs{gap:.15rem;flex-wrap:wrap}
.home-plan .plan-tabs button,.home-plan .plan-zoom{color:var(--muted);background:transparent;border:0;border-radius:0;min-height:44px;padding:.4rem .7rem;box-shadow:none}
.home-plan .plan-tabs button[aria-pressed=true]{color:var(--ink);box-shadow:inset 0 -3px var(--accent);font-weight:700}
.home-plan .plan-zoom{font-size:.9rem;text-decoration:underline;text-underline-offset:.25em}
.home-plan .plan-layout{display:grid;grid-template-columns:minmax(0,2.7fr) minmax(12rem,1fr);gap:clamp(1rem,2vw,1.65rem);align-items:start}
.plan-atlas,.plan-inspector{min-width:0}
.plan-sheet,.wing-directory{--survey-paper:#f1e7cf;--survey-floor:#f7efd9;--survey-ink:#514332;--survey-wire:#877657;--survey-site:#ddcfaf;--survey-selected:#e5c8a5;--survey-accent:#733b40;--survey-pale:#fff7e1;--survey-green:#677253;--survey-land:#a69b79;--survey-pattern:#b8a98a;--survey-water:#829c95}
[data-skin=living] :is(.plan-sheet,.wing-directory){--survey-paper:#243630;--survey-floor:#33443b;--survey-site:#2b3b32;--survey-ink:#ece1c7;--survey-wire:#acb59a;--survey-selected:#5a5239;--survey-accent:#e8c891;--survey-pale:#25312a;--survey-green:#abb995;--survey-land:#677d68;--survey-pattern:#526657;--survey-water:#647f79}
/* Map medium stays architectural; interaction colours follow the selected theme. */
:is([data-skin=obsidian],[data-skin=crimson]) :is(.plan-sheet,.wing-directory){--survey-paper:var(--surface);--survey-floor:var(--paper);--survey-ink:var(--ink);--survey-wire:var(--field-line);--survey-site:var(--soft);--survey-selected:var(--soft);--survey-accent:var(--accent);--survey-pale:var(--primary-ink);--survey-land:var(--line);--survey-pattern:var(--field-line)}
.plan-sheet{background:var(--survey-paper);color:var(--survey-ink);border:1px solid var(--survey-wire);padding:clamp(.45rem,1.3vw,1rem)}
.sheet-title{border-bottom:1px solid var(--survey-land);padding:.1rem .25rem .4rem}
.sheet-title h2{font:400 clamp(1.15rem,2vw,1.6rem)/1.2 var(--font-display,Georgia),serif;color:inherit;margin:0}
.sheet-title span,.inspector-caption,.plan-caption{font:600 .8rem/1.4 var(--font-body,system-ui);letter-spacing:.05em}
.map-viewport{overflow:auto;overscroll-behavior:contain;scrollbar-color:var(--survey-wire) var(--survey-paper)}
.wing-survey{width:100%;height:auto;display:block;color:var(--survey-ink)}
.map-viewport.is-zoomed{max-height:65svh}
.map-viewport.is-zoomed .wing-survey{width:165%;min-width:640px;max-width:none}
.survey-land,.survey-water{fill:none;stroke:var(--survey-land);stroke-width:1.1}
.survey-water{stroke:var(--survey-water);opacity:.8}
.site-shell,.inset-shell{fill:var(--survey-site);stroke:var(--survey-ink);stroke-width:4;stroke-linejoin:round}
.masonry{fill:var(--survey-floor);stroke:var(--survey-ink);stroke-width:1.7}
.map-detail,.survey-compass{fill:var(--survey-site);stroke:var(--survey-wire);stroke-width:1.5;stroke-linejoin:round}
.survey-compass text,.map-place{fill:var(--survey-ink);stroke:none;font:600 13px var(--font-body,system-ui);letter-spacing:1.6px}
.map-place{font-size:10px;letter-spacing:1.1px}
.survey-pattern,.survey-hatch{fill:none;stroke:var(--survey-pattern);stroke-width:.8}
.survey-hatch{stroke:var(--survey-paper);stroke-width:1.1}
.map-room{cursor:pointer;outline:none}
.chamber-floor{fill:var(--survey-floor)}
.chamber-wall{fill:none;stroke:var(--survey-ink);stroke-width:6;stroke-linejoin:round}
.chamber-cut{fill:none;stroke-width:3.5;stroke-linejoin:round}
.chamber-fittings{fill:var(--survey-site);stroke:var(--survey-wire);stroke-width:1.6;stroke-linejoin:round}
.door-gap,.map-window{stroke:var(--survey-floor);stroke-width:7}
.door-swing,.window-glass{fill:none;stroke:var(--survey-ink);stroke-width:1.2}
.room-marker circle{fill:var(--survey-floor);stroke:var(--survey-ink);stroke-width:1.5}
.room-marker text{fill:var(--survey-ink);font:700 16px var(--font-body,system-ui);font-variant-numeric:tabular-nums}
.map-room.is-active .chamber-floor,.map-room:hover .chamber-floor{fill:var(--survey-selected)}
.map-room.is-active .chamber-wall,.map-room:focus-visible .chamber-wall{stroke:var(--survey-accent);stroke-width:9}
.map-room.is-active .room-marker circle,.map-room:focus-visible .room-marker circle{fill:var(--survey-accent);stroke:var(--survey-accent)}
.map-room.is-active .room-marker text,.map-room:focus-visible .room-marker text{fill:var(--survey-pale)}
.room-key{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 1rem;margin:.6rem 0 0;padding:0;list-style:none}
.room-key li{margin:0;padding:0;min-width:0;border-bottom:1px solid var(--line)}
.home-plan .plan-room{display:flex;align-items:center;justify-content:flex-start;gap:.6rem;width:100%;text-align:left;min-height:46px;line-height:1.2;padding:.45rem .2rem;border:0;border-radius:0;background:transparent;color:var(--ink);box-shadow:none;font:500 1rem/1.25 var(--font-body,system-ui);overflow-wrap:anywhere}
.key-number{font:600 .84rem/1 var(--font-body,system-ui);font-variant-numeric:tabular-nums;display:inline-grid;place-items:center;min-width:1.65rem;height:1.65rem;border:1px solid var(--line);border-radius:50%;flex:none}
.plan-room[aria-pressed=true] .key-number,.inspector-caption .key-number{background:var(--accent);border-color:var(--accent);color:var(--primary-ink,#fff)}
.home-plan .plan-room:hover,.home-plan .register-heading:hover{text-decoration:underline;text-underline-offset:.2em}
.plan-inspector{border-top:3px double var(--line);padding-top:.65rem}
.room-portrait{position:relative;margin:0 0 .85rem;aspect-ratio:1.85;overflow:hidden;border:1px solid var(--line);background:var(--soft)}
.room-portrait img{width:100%;height:100%;object-fit:cover;display:block}
.room-portrait .art-living,[data-skin=living] .room-portrait .art-ledger{display:none}
[data-skin=living] .room-portrait .art-living{display:block}
.inspector-caption{color:var(--muted);margin:.3rem 0 .65rem}.plan-inspector h2{font:400 clamp(1.35rem,2vw,1.9rem)/1.22 var(--font-display,Georgia),serif}
.plan-inspector p{margin:.5rem 0}.plan-inspector>button{margin:.5rem 0}
.home-plan summary{min-height:44px;align-content:center;cursor:pointer}
.plan-inspector details,.plan-settings,.room-review{border-top:1px solid var(--line);padding:.35rem 0}
.home-plan form,.home-scene form{display:grid;gap:.7rem;margin:.5rem 0}
.home-plan form button,.home-scene form button{justify-self:start}
.home-plan :is(select,input,textarea),.home-scene select{max-width:100%;min-width:0}
.plan-proposals{margin-bottom:1rem}.home-scene,.home-memory{border-block:1px solid var(--line);padding:1rem 0;margin:1rem 0}.home-scene p,.home-memory p{max-width:65ch}
.wing-directory{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(15rem,100%),1fr));gap:1.4rem}.wing-register{min-width:0}
.home-plan .register-heading{display:flex;align-items:center;justify-content:flex-start;gap:1rem;width:100%;background:var(--survey-paper);color:var(--survey-ink);border:1px solid var(--survey-wire);border-radius:0;text-align:left;font:400 1.35rem var(--font-display,Georgia),serif}
.wing-inset{width:34%;height:52px}.wing-inset rect{fill:var(--survey-green);stroke:var(--survey-ink);stroke-width:2}
.wing-register .room-key{grid-template-columns:1fr}
@media(max-width:880px){.home-plan .plan-layout{grid-template-columns:1fr}.room-portrait{max-width:19rem}.plan-inspector{margin-top:.5rem}.plan-toolbar{gap:.25rem}.plan-inspector h2{scroll-margin-top:5rem}}
@media(max-width:480px){.plan-title{margin-top:.5rem}.home-plan .plan-tabs button,.home-plan .plan-zoom{padding:.35rem .45rem}.room-key{gap:0 .55rem}.home-plan .plan-room{gap:.35rem;font-size:.9rem}.key-number{min-width:1.45rem;height:1.45rem}.room-portrait{width:42%;float:right;margin:0 0 .4rem .7rem}.plan-inspector details{clear:both}.plan-sheet{padding:.4rem}.room-marker text{font-size:21px}.room-marker circle{r:17px}}
.chamber-fittings path,.map-detail>path:not(.entry-gap){fill:none}
.entry-gap{stroke:var(--survey-paper);stroke-width:7}
.stone-fracture{fill:none;stroke:var(--survey-accent);stroke-width:2}
.map-room.is-planned :is(.chamber-wall,.chamber-cut){stroke-dasharray:8 5}
[data-skin=living] .home-plan{--ink:#f2e9d6;--muted:#c8cfbe;--line:#66786a;--accent:#d5bd87;--primary-ink:#20352c}
[data-skin=living] .home-plan :is(.plan-tabs button,.plan-zoom,.room-key button){color:var(--ink)}
