* { box-sizing: border-box; }
:root { color-scheme: light; --ink:#244b49; --muted:#688784; --teal:#367d77; --teal-dark:#28655f; --panel:rgba(255,255,255,.86); }
body { margin:0; min-height:100vh; color:var(--ink); background:radial-gradient(circle at 8% 12%,rgba(255,255,255,.65),transparent 25rem),#e7f4f1; font-family:Arial,Helvetica,sans-serif; }
.topbar { width:min(1500px,calc(100% - 36px)); margin:0 auto; padding:28px 0 20px; display:flex; justify-content:space-between; align-items:center; gap:20px; }
.eyebrow { margin:0 0 7px; color:var(--teal); font-size:12px; font-weight:700; letter-spacing:.12em; }
h1 { margin:0; font-size:clamp(26px,3vw,38px); letter-spacing:-.03em; }
.subtitle { margin:9px 0 0; color:var(--muted); font-size:14px; }
.status { display:flex; align-items:center; gap:9px; white-space:nowrap; padding:10px 14px; border:1px solid #c8e4dc; border-radius:999px; background:rgba(255,255,255,.7); color:#477b72; font-size:12px; }
.status-dot { width:8px;height:8px;border-radius:50%;background:#57ad86; }
.layout { width:min(1500px,calc(100% - 36px)); margin:0 auto 32px; display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:18px; align-items:start; }
.scene-card,.control-card { border:1px solid rgba(174,211,202,.75); border-radius:18px; background:var(--panel); box-shadow:0 16px 40px rgba(57,105,98,.08); overflow:hidden; }
.scene-toolbar { display:flex; justify-content:space-between; gap:12px; padding:16px 20px; border-bottom:1px solid #e1efeb; font-size:13px; font-weight:700; }
.hint { color:#7a9994; font-weight:400; font-size:12px; }
.svg-wrap { overflow:auto; background:#eaf7f5; }
#hospital-scene { display:block; width:100%; height:auto; min-width:650px; }
.scene-footer { display:flex; gap:18px; flex-wrap:wrap; padding:13px 20px 16px; color:#688984; border-top:1px solid #e1efeb; font-size:11px; }
.scene-footer span { display:inline-flex; align-items:center; gap:7px; }
.dot { width:8px;height:8px;border-radius:50%;display:inline-block; }
.dot.mint { background:#8ebdb7; }.dot.blue { background:#6bb6b7; }.dot.green { background:#4c9a7c; }
.controls { display:grid; gap:14px; }
.control-card { padding:18px; }
.control-card h2 { margin:0 0 8px; font-size:16px; }
.muted { margin:0 0 15px; color:var(--muted); font-size:12px; line-height:1.8; }
button { width:100%; min-height:39px; padding:9px 11px; border:1px solid #cde3dd; border-radius:10px; background:#f8fcfa; color:#376b65; font:inherit; font-size:12px; cursor:pointer; transition:background .18s,border-color .18s,transform .18s; }
button:hover { background:#eaf7f3; border-color:#9dc9bd; } button:active { transform:translateY(1px); } button:focus-visible { outline:3px solid #91cfc0; outline-offset:2px; }
button.primary { background:var(--teal); border-color:var(--teal); color:white; font-weight:700; margin-bottom:7px; } button.primary:hover { background:var(--teal-dark); }
.button-grid,.object-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.button-grid button,.object-grid button { margin:0; }
.object-grid { margin-top:12px; }
.selection-info { margin-top:12px; min-height:50px; padding:10px; border-radius:9px; background:#edf7f4; color:#5a827b; font-size:11px; line-height:1.7; }
.notes ul { margin:10px 0 0; padding-left:19px; color:#66847f; font-size:12px; line-height:2; }
.page-footer { padding:0 18px 25px; text-align:center; color:#75938e; font-size:11px; }
.room-hit { cursor:pointer; }\n.room-dimmed{opacity:.16!important;filter:grayscale(.75);transition:opacity .22s,filter .22s}.room-active{opacity:1!important;filter:drop-shadow(0 0 7px rgba(32,142,127,.95))!important;transition:opacity .22s,filter .22s}.room-active>rect:first-child{stroke:#20a99c!important;stroke-width:5!important}
.room-hit:focus-visible { outline:none; filter:drop-shadow(0 0 5px #42a99a); }
.selected-object { filter:drop-shadow(0 0 7px rgba(32,142,127,.95)) !important; }
.floor-dim { opacity:.18; transition:opacity .25s; }
@media(max-width:1000px) { .layout { grid-template-columns:1fr; } .controls { grid-template-columns:repeat(2,minmax(0,1fr)); } .notes { grid-column:1/-1; } }
@media(max-width:600px) { .topbar { align-items:flex-start; flex-direction:column; } .status { white-space:normal; } .layout { width:calc(100% - 20px); } .scene-toolbar { padding:12px; align-items:flex-start; flex-direction:column; } .controls { grid-template-columns:1fr; } .notes { grid-column:auto; } .scene-footer { gap:10px; padding:12px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition-duration:.01ms !important; } }


/* Independent room boundaries and hover feedback */
.independent-room { transition: opacity .2s, filter .2s; }
.independent-room:hover { filter: drop-shadow(0 0 4px rgba(55, 137, 124, .35)); }
.pediatric-room > rect:first-child { fill: #f5e8dc; stroke: #d7a98d; }
.pediatric-room .selected-object { filter: drop-shadow(0 0 7px rgba(32,142,127,.95)); }


/* Specialty-room polish */
.independent-room { cursor: pointer; transition: opacity .18s ease, filter .18s ease; }
.independent-room:hover { filter: drop-shadow(0 2px 3px rgba(31,76,82,.22)); }
.independent-room.selected-object > rect:first-child { stroke-width: 5; }
.independent-room text { pointer-events: none; }
.room-object, .room-hit { outline: none; }
.room-object:focus, .independent-room:focus { filter: drop-shadow(0 0 4px rgba(39,127,160,.6)); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* In-page SVG visual editor */
.visual-editor { border: 1px solid #b7d8ef; }
.visual-editor h3 { margin: 14px 0 8px; font-size: 14px; color: #345d59; }
.editor-selection { padding: 9px 10px; border-radius: 8px; background: #edf6fc; color: #275b7c; font-size: 12px; overflow-wrap: anywhere; margin: 10px 0; }
.editor-label { display:block; font-size:12px; font-weight:700; margin: 8px 0 5px; }
.editor-color-row { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.editor-color-row input[type="color"] { width:48px; height:38px; padding:3px; border:1px solid #c7d9d7; border-radius:8px; background:#fff; cursor:pointer; }
.editor-color-row button { flex:1; }
.editor-note { font-size:11px; line-height:1.5; color:#6c8582; margin:10px 0 0; }
.visual-edit-mode #hospital-scene { cursor:crosshair; }
.visual-edit-mode #hospital-scene .independent-room:hover { filter: drop-shadow(0 0 3px rgba(22,119,210,.45)); }
#editor-overlay { overflow:visible; }
#editor-overlay [data-handle] { pointer-events:all; }
.visual-editor button { min-height:36px; }
@media (max-width: 760px) {
  .editor-color-row { flex-wrap:wrap; }
}

/* Equipment-focused view: keep character groups in the editable SVG source,
   but hide them from the rendered scene until replacement artwork is chosen. */
#rooms g[id^="patient-"],
#rooms g[id^="doctor-"] {
  display: none !important;
}

/* Narrow parcel conveyor connecting every room to the underground control suite. */
#parcel-delivery-line { pointer-events:none; }
#parcel-delivery-line .parcel-track { animation: parcel-dash-flow 1.1s linear infinite; }
#parcel-delivery-line .moving-parcel { filter: drop-shadow(0 1px 2px rgba(30,55,70,.28)); }
@keyframes parcel-dash-flow { to { stroke-dashoffset: -36; } }
@media (prefers-reduced-motion: reduce) { #parcel-delivery-line .parcel-track { animation:none; } }
