/* 병동 구성 편집기(#/layout) · 환자 입원·등록(#/patients) — docs/M3-UI.md §6·§7. 색은 tokens.css 변수만 쓴다.
   차례: 편집기 틀 · 병동 목록 · 도구 막대 · 캔버스(SVG) · 속성 패널 · 대화상자 · 폰 · 환자 목록 · 입원 마법사 · 상세 서랍 */

/* ═════════ 편집기 틀 ═════════ */
.le-page { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); height: calc(100dvh - var(--strip-h) - var(--topbar-h) - var(--alarm-h, 0px)); min-height: 30rem; overflow: hidden; animation: page-in var(--d-slow) var(--ease); }
.le-center { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.le-work { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.le-banner { padding: var(--s-3) var(--s-4) 0; }
.le-blank { padding: var(--s-7); }
.le-loading { padding: var(--s-5); flex: 1; display: grid; }
.le-sk { height: 100%; min-height: 20rem; }
.le-phonehead { display: none; }
.le-editor { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; }
.le-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; container-type: inline-size; container-name: lemain; }

/* ═════════ 병동 목록 ═════════ */
.le-wards { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--border); }
.le-wards-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); padding: var(--s-5) var(--s-3) var(--s-3) var(--s-5); }
.le-wards-head h1 { font-size: var(--fs-16); letter-spacing: var(--tracking-title); }
.le-wards-head p { font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }
.le-wardlist { flex: 1; overflow-y: auto; padding: var(--s-1) var(--s-2) var(--s-3); display: grid; gap: 2px; align-content: start; }
.le-ward { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .625rem; padding: .5625rem .5rem .5625rem .625rem; border-radius: .625rem; cursor: pointer; transition: background-color var(--d-fast) var(--ease); }
.le-ward:hover { background: var(--hover); }
.le-ward[aria-selected="true"] { background: var(--brand-soft); }
.le-ward-mark { width: 2rem; height: 2rem; border-radius: .5rem; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-12); font-weight: 750; font-variant-numeric: tabular-nums; transition: background-color var(--d-base) var(--ease), color var(--d-base); }
.le-ward[aria-selected="true"] .le-ward-mark { background: var(--brand); color: var(--brand-fg); }
.le-ward-txt { min-width: 0; display: grid; gap: 1px; }
.le-ward-name { display: flex; align-items: center; gap: .375rem; font-size: var(--fs-14); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le-ward[aria-selected="true"] .le-ward-name { color: var(--brand-soft-fg); }
.le-ward-meta { font-size: var(--fs-12); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.le-dot { display: inline-block; width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--st-delay-line); flex: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--st-delay-line) 22%, transparent); }
.le-ward-more { opacity: 0; transition: opacity var(--d-fast); }
.le-ward:hover .le-ward-more, .le-ward:focus-within .le-ward-more, .le-ward[aria-selected="true"] .le-ward-more, .le-ward-more[aria-expanded="true"] { opacity: 1; }
.le-wards-foot { display: flex; align-items: center; gap: .5rem; padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border); font-size: var(--fs-12); color: var(--text-3); }
.le-wards-foot .icon { width: .875rem; height: .875rem; }

/* ═════════ 도구 막대 ═════════ */
.le-toolbar { display: flex; align-items: center; gap: var(--s-2); min-height: 3.25rem; padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.le-toolbar > * { flex: none; }
.le-toolbar > .grow { flex: 1 1 0; }
.le-tb-sep { width: 1px; height: 1.25rem; background: var(--border); margin: 0 var(--s-1); flex: none; }
.le-tools button .icon { width: .9375rem; height: .9375rem; }
.le-zoombox { position: absolute; right: var(--s-3); bottom: var(--s-3); display: inline-flex; align-items: center; gap: 1px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface-raised); box-shadow: var(--shadow-2); z-index: 2; }
.le-zoombox .btn { height: 1.75rem; width: 1.75rem; }
.le-zoom { min-width: 3.25rem; height: 1.75rem; border: 0; background: none; border-radius: .4375rem; color: var(--text-2); font-size: var(--fs-12); font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; }
.le-zoom:hover { background: var(--hover); color: var(--text); }
.le-dirty { display: inline-flex; align-items: center; gap: .4375rem; font-size: var(--fs-12); font-weight: 650; color: var(--st-delay-fg); white-space: nowrap; animation: nudge-in var(--d-base) var(--ease); }
.le-dirty i { width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--st-delay-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-delay-line) 20%, transparent); }
.le-flip, .le-rot-l .icon { transform: scaleX(-1); }
.le-rot-l { display: inline-grid; }
@container lemain (max-width: 1040px) { .tb-hide-sm { display: none; } .le-toolbar .badge.le-ver { display: none; } }
@container lemain (max-width: 900px) { .le-dirty .le-dirty-t { display: none; } }

/* ═════════ 캔버스 ═════════ */
.le-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--surface-2); }
.le-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.le-stage[data-tool="hand"] .le-svg, .le-stage.is-space .le-svg { cursor: grab; }
.le-stage.is-panning .le-svg { cursor: grabbing; }
.le-paper { fill: var(--bg); stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.le-grid-minor { stroke: var(--plan-grid); opacity: .55; }
.le-grid-major { stroke: var(--plan-grid); }
.le-svg.is-coarse .le-grid-minor { opacity: 0; }
.le-hatch-line { fill: var(--border-strong); opacity: .55; }

.le-room { cursor: move; }
.le-stage[data-tool="hand"] .le-room, .le-stage.is-space .le-room, .le-stage[data-tool="hand"] .le-bed { cursor: inherit; }
.le-room-body { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: stroke var(--d-fast), fill var(--d-base); }
.le-room:hover .le-room-body { stroke: var(--text-3); }
.le-room.is-sel .le-room-body { stroke: var(--brand); }
.le-room.is-new .le-room-body { stroke-dasharray: 6 4; }
.le-room.is-off .le-room-body { fill: var(--surface-2); }
.le-room.is-err .le-room-body { stroke: var(--danger); stroke-width: 2; }
.le-room.is-drop .le-room-body { stroke: var(--brand); stroke-width: 2; fill: color-mix(in srgb, var(--brand) 7%, var(--surface)); stroke-dasharray: 7 5; }
.le-room-label { font-size: 14px; }
.le-room-no { fill: var(--text); font-weight: 700; }
.le-room-cap { fill: var(--text-3); font-weight: 550; font-size: 12px; }
.le-room.is-sel .le-room-no { fill: var(--brand); }

.le-bed { cursor: grab; }
.le-bed-body { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.25; vector-effect: non-scaling-stroke; transition: fill var(--d-base), stroke var(--d-fast); }
.le-bed:hover .le-bed-body { stroke: var(--text-2); }
.le-bed-pillow { fill: var(--surface); stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.le-bed-head { fill: none; stroke: var(--text-3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.le-bed-label { font-size: 15px; font-weight: 750; fill: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; pointer-events: none; }
.le-bed.is-admitted .le-bed-body { fill: var(--brand-soft); stroke: color-mix(in srgb, var(--brand) 45%, transparent); }
.le-bed.is-admitted .le-bed-head { stroke: var(--brand); }
.le-bed-pt circle { fill: var(--brand); }
.le-bed-pt path { fill: none; stroke: var(--brand-fg); stroke-width: 1.5; stroke-linecap: round; }
.le-bed-node { fill: var(--st-line, var(--text-3)); stroke: var(--surface); stroke-width: 1.5; }
.le-bed-fall { fill: var(--st-delay-line); }
.le-bed-hatch, .le-room-hatch { pointer-events: none; }
.le-bed.is-off .le-bed-body { fill: var(--surface-2); stroke: var(--border); stroke-dasharray: 4 3; }
.le-bed.is-off .le-bed-label { fill: var(--text-3); }
.le-bed.is-off .le-bed-pillow { fill: var(--surface-2); }
.le-bed.is-new .le-bed-body { stroke-dasharray: 5 3; }
.le-bed.is-sel .le-bed-body { stroke: var(--brand); stroke-width: 2; }
.le-bed.is-err .le-bed-body { stroke: var(--danger); stroke-width: 2; }
.le-bed.is-ghost { opacity: .92; filter: drop-shadow(0 6px 14px var(--overlay)); cursor: grabbing; }

.le-decor { cursor: move; }
.le-decor-body { fill: color-mix(in srgb, var(--st-due-line) 9%, transparent); stroke: var(--st-due-line); stroke-width: 1.25; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.le-decor-corridor .le-decor-body { fill: var(--surface-2); stroke: var(--border-strong); }
.le-decor.is-sel .le-decor-body { stroke: var(--brand); stroke-dasharray: none; }
.le-decor-label { font-size: 14px; font-weight: 650; fill: var(--text-2); pointer-events: none; }

.le-selbox-line { fill: none; stroke: var(--brand); stroke-width: 1.5; pointer-events: none; }
.le-handle { fill: var(--surface); stroke: var(--brand); stroke-width: 1.5; }
.le-handle.h-n, .le-handle.h-s { cursor: ns-resize; } .le-handle.h-e, .le-handle.h-w { cursor: ew-resize; }
.le-handle.h-nw, .le-handle.h-se { cursor: nwse-resize; } .le-handle.h-ne, .le-handle.h-sw { cursor: nesw-resize; }
.le-knob { fill: var(--surface); stroke: var(--brand); stroke-width: 1.5; cursor: grab; }
.le-knob:hover { fill: var(--brand); }
.le-knob-line { stroke: var(--brand); stroke-width: 1; pointer-events: none; }
.le-marquee { fill: color-mix(in srgb, var(--brand) 8%, transparent); stroke: var(--brand); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }

.le-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; padding: var(--s-4); }
.le-empty[hidden] { display: none; }
.le-empty-card { pointer-events: auto; display: grid; justify-items: center; gap: var(--s-2); max-width: 24rem; padding: var(--s-7) var(--s-6); text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-2); animation: pop-in var(--d-slow) var(--ease); }
.le-empty-card b { font-size: var(--fs-16); }
.le-empty-card p { font-size: var(--fs-13); color: var(--text-2); line-height: 1.55; margin-bottom: var(--s-2); }
.le-empty-ico { width: 2.75rem; height: 2.75rem; border-radius: var(--r-card); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: var(--s-1); }
.le-empty-ico .icon { width: 1.25rem; height: 1.25rem; }
.le-flash { position: absolute; left: 50%; bottom: var(--s-4); translate: -50% 0; display: inline-flex; align-items: center; gap: var(--s-2); max-width: calc(100% - 2rem); padding: .5625rem var(--s-4) .5625rem .75rem; border-radius: var(--r-full); background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--shadow-2); font-size: var(--fs-13); font-weight: 550; color: var(--text); animation: toast-in var(--d-base) var(--ease); pointer-events: none; }
.le-flash[hidden] { display: none; }
.le-flash .icon { color: var(--st-line, var(--brand)); width: 1rem; height: 1rem; }
.le-status { display: flex; align-items: center; gap: var(--s-4); height: 1.875rem; padding: 0 var(--s-4); border-top: 1px solid var(--border); background: var(--surface); color: var(--text-3); font-size: var(--fs-12); white-space: nowrap; overflow: hidden; }
.le-status > span { display: inline-flex; align-items: center; gap: .375rem; }
.le-status .icon { width: .8125rem; height: .8125rem; }
.le-status-hint { overflow: hidden; text-overflow: ellipsis; }

/* ═════════ 속성 패널 ═════════ */
.le-inspector { min-height: 0; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.le-ins-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-3); }
.le-ins-head .tags { justify-content: flex-end; }
.le-ins-ico { width: 2.125rem; height: 2.125rem; border-radius: .625rem; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.le-ins-ico .icon { width: 1.0625rem; height: 1.0625rem; }
.le-ins-title { font-size: var(--fs-16); font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.le-ins-sub { font-size: var(--fs-12); color: var(--text-2); }
.le-inspector > .notice { margin: 0 var(--s-4) var(--s-3); }
.le-sec { padding: var(--s-4); border-top: 1px solid var(--border); display: grid; gap: var(--s-2); }
.le-sec-t { font-size: var(--fs-12); font-weight: 650; color: var(--text-3); letter-spacing: .01em; }
.le-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.le-grid2 .field > label { font-size: var(--fs-12); font-weight: 600; color: var(--text-2); }
.le-num { position: relative; display: block; min-width: 0; }
.le-num > span { position: absolute; left: .625rem; top: 50%; translate: 0 -50%; font-size: var(--fs-12); font-weight: 600; color: var(--text-3); pointer-events: none; }
.le-num > em { position: absolute; right: .625rem; top: 50%; translate: 0 -50%; font-style: normal; font-size: var(--fs-12); color: var(--text-3); pointer-events: none; }
.le-num .input { padding-left: 2.375rem; text-align: right; padding-right: .75rem; }
.le-num:has(em) .input { padding-right: 1.5rem; }
.le-num .input::-webkit-inner-spin-button { opacity: 0; }
.le-rotrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-2); align-items: center; }
.le-stepper { display: flex; align-items: center; gap: var(--s-3); }
.le-step-v { font-size: var(--fs-24); font-weight: 750; min-width: 2ch; text-align: center; letter-spacing: -.02em; }
.le-help { font-size: var(--fs-12); color: var(--text-2); line-height: 1.55; }
.le-switchrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-1) 0; }
.le-switchrow b { display: block; font-size: var(--fs-13); font-weight: 600; }
.le-switchrow span { display: block; font-size: var(--fs-12); color: var(--text-2); line-height: 1.45; }
.le-roomlist, .le-bedlist { display: grid; gap: 4px; }
.le-roomrow, .le-bedrow { display: flex; align-items: center; gap: var(--s-2); min-height: 2.25rem; padding: 0 .625rem; border: 1px solid var(--border); border-radius: .5rem; background: var(--surface); color: var(--text); font-size: var(--fs-13); cursor: pointer; text-align: left; transition: background-color var(--d-fast), border-color var(--d-fast); }
.le-roomrow:hover, .le-bedrow:hover { background: var(--hover); border-color: var(--border-strong); }
.le-roomrow b, .le-bedrow b { margin-right: auto; font-weight: 650; }
.le-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0 var(--s-4) var(--s-4); border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: hidden; background: var(--border); }
.le-stats > div { display: grid; gap: 1px; padding: .625rem .75rem; background: var(--surface); }
.le-stats b { font-size: var(--fs-20); font-weight: 700; letter-spacing: -.02em; }
.le-stats span { font-size: var(--fs-12); color: var(--text-2); }
.le-keys { display: grid; gap: .375rem; }
.le-keys > div { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-12); }
.le-keys dd { margin: 0; color: var(--text-2); text-align: right; }
.le-kbd { display: inline-flex; gap: 3px; }
.le-kbd kbd { display: inline-grid; place-items: center; min-width: 1.375rem; height: 1.375rem; padding: 0 .3125rem; border-radius: .3125rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2); color: var(--text-2); font: 600 11px/1 var(--font); }
.le-ins-foot { margin-top: auto; padding: var(--s-3) var(--s-4) var(--s-4); border-top: 1px solid var(--border); }
.btn.le-danger { --_fg: var(--st-critical-fg); }
.btn.le-danger:hover { --_bg: var(--st-critical-bg); --_fg: var(--st-critical-fg); }
.le-node { display: flex; align-items: center; gap: var(--s-2); padding: .5rem .625rem; border-radius: .5rem; background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-12); }
.le-node .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-12); }
.le-node .icon { color: var(--text-2); }
.le-nodepick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); }
.le-linkbtn { display: block; border: 0; background: none; padding: 1px 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.le-linkbtn:hover { text-decoration: underline; }

/* ═════════ 대화상자 ═════════ */
.le-tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.le-tpl { display: grid; justify-items: center; gap: 2px; padding: var(--s-2) var(--s-2) .625rem; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color var(--d-fast), background-color var(--d-fast), box-shadow var(--d-fast); }
.le-tpl:hover { border-color: var(--border-strong); }
.le-tpl[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.le-thumb { width: 100%; height: 4.25rem; margin-bottom: var(--s-1); }
.le-thumb-room { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 2; }
.le-thumb-bed { fill: var(--surface); stroke: var(--text-3); stroke-width: 2.5; }
.le-thumb-pillow { fill: var(--surface-3); }
.le-tpl[aria-checked="true"] .le-thumb-bed { fill: var(--brand-soft); stroke: var(--brand); }
.le-tpl[aria-checked="true"] .le-thumb-room { fill: var(--surface); }
.le-tpl-n { font-size: var(--fs-14); font-weight: 700; }
.le-tpl-name { font-size: 11px; color: var(--text-2); }
.le-blockers { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: var(--s-2); }
.le-del-list { display: grid; gap: 2px; padding-left: 1.1rem; list-style: disc; color: var(--text); font-size: var(--fs-13); }
.le-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.le-cmp-col { padding: var(--s-3) var(--s-4); border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.le-cmp-h { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-12); font-weight: 650; color: var(--text-2); margin-bottom: var(--s-2); }
.le-cmp ul { display: grid; gap: 3px; padding-left: 1rem; list-style: disc; font-size: var(--fs-13); }

/* ═════════ 넓은 · 중간 · 폰 ═════════ */
@media (min-width: 1800px) { .le-page { grid-template-columns: 17rem minmax(0, 1fr); } .le-editor { grid-template-columns: minmax(0, 1fr) 21.5rem; } }
@media (max-width: 1100px) and (min-width: 769px) {
  .le-page { grid-template-columns: minmax(0, 1fr); }
  .le-wards { display: none; }
  .le-phonehead { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border); background: var(--surface); }
  .le-phonehead > .row-between { gap: var(--s-3); }
  .le-phonehead h1 { font-size: var(--fs-16); white-space: nowrap; }
  .le-phonehead .le-wardsel { max-width: 18rem; }
  .le-phonehead .notice { display: none; }
  .le-editor { grid-template-columns: minmax(0, 1fr) 17rem; }
  .le-status-hint { display: none; }
}
@media (max-width: 768px) {
  .le-page { display: block; height: auto; min-height: 0; overflow: visible; }
  .le-wards { display: none; }
  .le-phonehead { display: grid; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-3); }
  .le-phonehead h1 { font-size: var(--fs-20); }
  .le-phonehead .le-wardsel { height: var(--h-md); font-size: var(--fs-14); }
  .le-work { display: flex; flex-direction: column; }
  .le-editor { display: contents; }
  .le-main { order: 1; margin: 0 var(--s-4); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
  .le-phone-rooms { order: 2; }
  .le-inspector { order: 3; margin: 0 var(--s-4) var(--s-6); border: 1px solid var(--border); border-radius: var(--r-card); overflow: visible; }
  .le-stage { height: 46dvh; min-height: 17rem; flex: none; }
  .le-toolbar { min-height: 2.75rem; padding: var(--s-1) var(--s-2) var(--s-1) var(--s-3); }
  .le-status { display: none; }
  .le-banner { padding: 0 var(--s-4) var(--s-3); }
  .le-phone-rooms { display: grid; gap: var(--s-2); padding: var(--s-4); }
  .le-phone-room { display: flex; align-items: center; gap: var(--s-2); min-height: 3rem; padding: 0 var(--s-3) 0 var(--s-4); border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); font-size: var(--fs-14); text-align: left; cursor: pointer; }
  .le-phone-room b { font-weight: 650; }
  .le-phone-room .icon { margin-left: auto; color: var(--text-3); }
  .le-phone-room[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
  .le-tpl-grid { gap: 6px; }
  .le-thumb { height: 3rem; }
  .le-cmp { grid-template-columns: 1fr; }
}

/* ═════════ 환자 입원·등록 ═════════ */
.pt-page { gap: var(--s-5); }
.pt-toolbar { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.pt-toolbar .search-wrap { flex: 1 1 16rem; max-width: 22rem; }
.pt-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
.pt-table td { font-variant-numeric: tabular-nums; }
.pt-table tbody tr { cursor: pointer; }
.pt-table tbody tr:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.pt-bed { font-size: var(--fs-16); font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pt-name { display: grid; gap: 1px; }
.pt-name b { font-weight: 650; }
.pt-name span { font-size: var(--fs-12); color: var(--text-2); }
.pt-braden { display: inline-flex; align-items: center; gap: .5rem; }
.pt-braden b { font-size: var(--fs-16); font-weight: 700; min-width: 1.5rem; }
.pt-mcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-1) var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); text-align: left; color: var(--text); cursor: pointer; width: 100%; }
.pt-mcard .pt-bed { grid-row: span 2; min-width: 3rem; }
.pt-mcard .tags { grid-column: 2 / -1; }
.pt-mlist { display: none; }

/* 입원 마법사 */
.pt-wizard { display: grid; grid-template-columns: 14rem minmax(0, 1fr) 18rem; gap: var(--s-6); align-items: start; }
.pt-steps { position: sticky; top: calc(var(--strip-h) + var(--topbar-h) + var(--alarm-h, 0px) + var(--s-5)); display: grid; gap: 2px; }
.pt-step { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .75rem; padding: .5rem .625rem; border: 0; border-radius: .625rem; background: none; text-align: left; cursor: pointer; color: var(--text-2); font-size: var(--fs-14); font-weight: 550; }
.pt-step:hover:not([disabled]) { background: var(--hover); color: var(--text); }
.pt-step[disabled] { cursor: default; opacity: .55; }
.pt-step .n { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-12); font-weight: 700; background: var(--surface-3); color: var(--text-2); transition: background-color var(--d-base), color var(--d-base); }
.pt-step .n .icon { width: .8125rem; height: .8125rem; stroke-width: 2.6; }
.pt-step.is-done .n { background: var(--st-done-bg); color: var(--st-done-fg); }
.pt-step.is-err .n { background: var(--st-critical-bg); color: var(--st-critical-fg); }
.pt-step[aria-current="step"] { background: var(--brand-soft); color: var(--brand-soft-fg); font-weight: 650; }
.pt-step[aria-current="step"] .n { background: var(--brand); color: var(--brand-fg); }
.pt-step small { display: block; font-size: var(--fs-12); font-weight: 500; color: var(--text-3); }
.pt-panel { display: grid; gap: var(--s-3); min-width: 0; }
.pt-panel-card { padding: var(--s-6); display: grid; gap: var(--s-5); animation: page-in var(--d-base) var(--ease); }
.pt-panel-head { display: grid; gap: var(--s-1); }
.pt-panel-head .eyebrow { color: var(--brand); }
.pt-panel-head h2 { font-size: var(--fs-20); letter-spacing: var(--tracking-title); }
.pt-panel-head p { color: var(--text-2); font-size: var(--fs-13); }
.pt-actions { position: sticky; bottom: 0; display: flex; gap: var(--s-2); align-items: center; padding: var(--s-3) 0 var(--s-4); background: linear-gradient(to top, var(--bg) 72%, transparent); z-index: 2; }
.pt-actions .grow { flex: 1; }
.pt-aside { position: sticky; top: calc(var(--strip-h) + var(--topbar-h) + var(--alarm-h, 0px) + var(--s-5)); display: grid; gap: var(--s-3); }
.pt-live { padding: var(--s-5); display: grid; gap: var(--s-2); }
.pt-live h3 { font-size: var(--fs-12); color: var(--text-3); font-weight: 650; margin-bottom: var(--s-1); }
.pt-live-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); font-size: var(--fs-13); min-height: 1.75rem; }
.pt-live-row > span:first-child { color: var(--text-2); }
.pt-live-row b { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.pt-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.pt-err { font-size: var(--fs-12); color: var(--st-critical-fg); font-weight: 600; }
.pt-err:empty { display: none; }
.pt-fake { display: flex; gap: var(--s-2); align-items: center; font-size: var(--fs-12); color: var(--text-2); }
.pt-fake .icon { color: var(--st-caution-line); }

.pt-bedpick { display: grid; gap: var(--s-3); }
.pt-bedroom { display: grid; gap: var(--s-2); }
.pt-bedroom-h { font-size: var(--fs-12); font-weight: 650; color: var(--text-3); }
.pt-bedgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: var(--s-2); }
.pt-bedbtn { position: relative; display: grid; justify-items: center; gap: 2px; padding: .625rem .5rem; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color var(--d-fast), background-color var(--d-fast), box-shadow var(--d-fast), transform var(--d-fast) var(--ease); }
.pt-bedbtn:hover { border-color: var(--border-strong); }
.pt-bedbtn:active { transform: scale(.98); }
.pt-bedbtn b { font-size: var(--fs-16); font-weight: 750; font-variant-numeric: tabular-nums; }
.pt-bedbtn span { font-size: 11px; color: var(--text-3); }
.pt-bedbtn[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.pt-bedbtn[aria-checked="true"] b { color: var(--brand-soft-fg); }
.pt-bedbtn i { position: absolute; top: 5px; right: 6px; width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--st-delay-line); }

.pt-braden-list { display: grid; gap: var(--s-4); }
.pt-bi { display: grid; gap: var(--s-2); }
.pt-bi-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.pt-bi-h b { font-size: var(--fs-14); font-weight: 650; }
.pt-bi-h span { font-size: var(--fs-12); color: var(--text-3); }
.pt-scores { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.pt-score { display: grid; gap: 3px; justify-items: start; align-content: start; padding: .5rem .625rem; border: 1px solid var(--border); border-radius: .625rem; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; min-height: 3.25rem; transition: border-color var(--d-fast), background-color var(--d-fast), box-shadow var(--d-fast); }
.pt-score:hover { border-color: var(--border-strong); }
.pt-score b { font-size: var(--fs-16); font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1; }
.pt-score span { font-size: var(--fs-12); color: var(--text-2); line-height: 1.3; }
.pt-score[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.pt-score[aria-checked="true"] b, .pt-score[aria-checked="true"] span { color: var(--brand-soft-fg); }
.pt-meter { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-4) var(--s-5); border-radius: var(--r-card); background: var(--surface-2); border: 1px solid var(--border); }
.pt-meter-n { font-size: var(--fs-32); font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; min-width: 3ch; }
.pt-meter-n small { font-size: var(--fs-14); color: var(--text-3); font-weight: 600; margin-left: 2px; letter-spacing: 0; }
.pt-meter-meta { display: grid; gap: .375rem; flex: 1; min-width: 0; }
.pt-meter-meta > span { font-size: var(--fs-12); color: var(--text-2); }
.pt-scale { position: relative; height: .5rem; border-radius: var(--r-full); }
.pt-scale-braden { background: linear-gradient(90deg, var(--st-critical-line) 0 23.5%, var(--st-delay-line) 23.5% 41%, var(--st-caution-line) 41% 53%, var(--st-due-line) 53% 76.5%, var(--st-done-line) 76.5%); }
.pt-scale-bmi { background: linear-gradient(90deg, var(--st-due-line) 0 29%, var(--st-done-line) 29% 70%, var(--st-delay-line) 70%); }
.pt-scale i { position: absolute; top: 50%; width: .875rem; height: .875rem; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--text); translate: -50% -50%; left: var(--at, 0%); transition: left var(--d-slow) var(--ease); box-shadow: var(--shadow-1); }
.pt-scale[data-empty] i { display: none; }
.pt-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pt-switches { display: grid; gap: var(--s-2); }
.pt-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); }
.pt-switch b { display: block; font-size: var(--fs-14); font-weight: 600; }
.pt-switch span { font-size: var(--fs-12); color: var(--text-2); }

.pt-wounds { display: grid; gap: var(--s-3); }
.pt-wound { display: grid; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); animation: slide-down var(--d-base) var(--ease); }
.pt-wound-h { display: flex; align-items: center; gap: var(--s-2); }
.pt-wound-h .n { width: 1.5rem; height: 1.5rem; border-radius: .4375rem; display: grid; place-items: center; background: var(--st-delay-bg); color: var(--st-delay-fg); font-size: var(--fs-12); font-weight: 750; }
.pt-wound-h b { flex: 1; font-size: var(--fs-14); }
.pt-wound-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s-3); align-items: end; }
.pt-wound-opts { display: flex; gap: var(--s-5); flex-wrap: wrap; align-items: center; }
.pt-touch { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-13); color: var(--text-2); }
.pt-touch .input { width: 5.5rem; }
.pt-add { justify-self: start; }

.pt-times { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.pt-time { display: inline-flex; align-items: center; gap: .25rem; height: 2rem; padding: 0 .25rem 0 .75rem; border-radius: var(--r-full); background: var(--brand-soft); color: var(--brand-soft-fg); font-weight: 650; font-variant-numeric: tabular-nums; font-size: var(--fs-13); }
.pt-time button { width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; display: grid; place-items: center; background: none; color: inherit; cursor: pointer; }
.pt-time button:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.pt-time button .icon { width: .75rem; height: .75rem; }
.pt-time-add { display: inline-flex; gap: var(--s-2); }
.pt-time-add .input { width: 7.5rem; }
.pt-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.pt-choices.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pt-choices.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pt-choice { display: grid; gap: 4px; align-content: start; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); text-align: left; cursor: pointer; color: var(--text); transition: border-color var(--d-fast), background-color var(--d-fast), box-shadow var(--d-fast); }
.pt-choice:hover { border-color: var(--border-strong); }
.pt-choice > .icon { color: var(--text-2); width: 1.25rem; height: 1.25rem; margin-bottom: var(--s-1); }
.pt-choice b { font-size: var(--fs-14); font-weight: 650; }
.pt-choice .big { font-size: var(--fs-24); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.pt-choice span { font-size: var(--fs-12); color: var(--text-2); line-height: 1.45; }
.pt-choice[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.pt-choice[aria-checked="true"] > .icon, .pt-choice[aria-checked="true"] b { color: var(--brand-soft-fg); }
.pt-timeline { display: flex; gap: 4px; flex-wrap: wrap; }
.pt-timeline span { display: inline-grid; place-items: center; height: 1.75rem; padding: 0 .5rem; border-radius: .4375rem; background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-12); font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-2); }
.pt-postures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.pt-posture { display: grid; justify-items: center; gap: var(--s-1); padding: var(--s-3) var(--s-2); border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); cursor: pointer; color: var(--text); font-size: var(--fs-13); font-weight: 600; transition: border-color var(--d-fast), background-color var(--d-fast), box-shadow var(--d-fast); }
.pt-posture:hover { border-color: var(--border-strong); }
.pt-posture .pt-pfig { width: 2.25rem; height: 3.5rem; }
.pt-posture .mini-fallback { width: 100%; height: 100%; }
.pt-posture[aria-checked="true"] { border-color: var(--st-critical-line); background: var(--st-critical-bg); box-shadow: 0 0 0 1px var(--st-critical-line); color: var(--st-critical-fg); }
.pt-posture small { font-size: 11px; font-weight: 600; color: var(--st-critical-fg); visibility: hidden; }
.pt-posture[aria-checked="true"] small { visibility: visible; }

.pt-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.pt-sum { display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); align-content: start; }
.pt-sum-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pt-sum-h b { font-size: var(--fs-12); color: var(--text-3); font-weight: 650; }
.pt-sum-v { font-size: var(--fs-14); line-height: 1.55; display: grid; gap: var(--s-1); }
.pt-sum.is-err { border-color: var(--st-critical-line); }

/* 상세 서랍 */
.pt-dhead { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: center; }
.pt-dbed { min-width: 4rem; height: 4rem; padding: 0 var(--s-2); border-radius: var(--r-card); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-fg); font-size: var(--fs-20); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pt-dbed.is-none { background: var(--surface-2); color: var(--text-3); font-size: var(--fs-14); }
.pt-dname { font-size: var(--fs-20); font-weight: 700; letter-spacing: -.01em; }
.pt-dhead .tags { margin-top: var(--s-1); }
.pt-dsec { display: grid; gap: var(--s-3); padding: var(--s-4) var(--s-5); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); transition: border-color var(--d-base), box-shadow var(--d-base); }
.pt-dsec-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pt-dsec-h h3 { font-size: var(--fs-14); font-weight: 650; }
.pt-dsec.is-editing { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pt-dsec-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.pt-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .375rem var(--s-4); font-size: var(--fs-13); }
.pt-kv dt { color: var(--text-2); }
.pt-kv dd { margin: 0; font-weight: 550; font-variant-numeric: tabular-nums; }

@media (max-width: 1360px) { .pt-wizard { grid-template-columns: 12.5rem minmax(0, 1fr); } .pt-aside { display: none; } }
@media (max-width: 1100px) {
  .pt-wizard { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .pt-steps { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .pt-step small { display: none; }
  .pt-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .pt-mtable { display: none; }
  .pt-mlist { display: grid; gap: var(--s-2); }
  .pt-panel-card { padding: var(--s-4); gap: var(--s-4); }
  .pt-grid3 { grid-template-columns: 1fr 1fr; }
  .pt-scores { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-wound-row { grid-template-columns: 1fr; }
  .pt-choices, .pt-choices.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-postures { gap: 6px; }
  .pt-posture { font-size: var(--fs-12); padding: var(--s-2) 4px; }
  .pt-summary-grid { grid-template-columns: 1fr; }
  .pt-actions { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .pt-actions .btn { flex: 1; }
  .pt-meter { padding: var(--s-3) var(--s-4); gap: var(--s-3); }
  .pt-meter-n { font-size: var(--fs-24); }
  .pt-toolbar .search-wrap { max-width: none; }
}
.pt-page .page-head .actions { flex-wrap: nowrap; }
.pt-page .page-head .select { width: auto; min-width: 11rem; }
.le-inspector > * { flex-shrink: 0; }

/* 상단 도구줄 줄이기(대표 지적 ⑨): 평소 상태는 글자 없이 점·아이콘만, 문제·울림·음소거일 때만 글자 */
.conn-dot[data-conn="live"] .tbp-text, .tb-pill.is-quiet .tbp-text, .tb-vclock .tbv-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tb-pill[hidden] { display: none; }
