/* MRMS 콘솔 — 호텔 문패(door plate)를 모티프로 한 운영 화면.
   교대 근무 내내 켜 두는 화면이라 바탕은 조용하게, 주의가 필요한 것만 황동색·상태색으로 띄운다. */

@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url(fonts/pretendard_regular.ttf) format("truetype"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-display: swap; src: url(fonts/pretendard_semibold.ttf) format("truetype"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url(fonts/pretendard_bold.ttf) format("truetype"); }

:root {
  --navy: #18223a;      /* 레일 · 문패 바탕 */
  --navy-2: #233052;
  --brass: #b5893a;     /* 주의·선택 */
  --brass-soft: #f4ead6;
  --ground: #eef0f4;    /* 작업면 바탕 */
  --surface: #ffffff;
  --sunken: #f6f7f9;
  --ink: #1b2233;
  --ink-2: #566079;
  --ink-3: #8a93a8;
  --line: #e2e5ec;
  --line-2: #d3d8e2;
  --blue: #2d5bd3;      /* 프론트 / 주 동작 */
  --violet: #6a4fc2;    /* 관제실 */
  --green: #2c8a66;     /* 투숙중 · 정상 */
  --amber: #c4821a;     /* 퇴실 임박 */
  --red: #c63f30;       /* 경과 · 미전달 · 오프라인 */
  --bubble-guest: #f0f2f6;
  --bubble-staff: #2d5bd3;
  --shadow-pop: 0 12px 32px rgba(24, 34, 58, .16), 0 2px 6px rgba(24, 34, 58, .08);
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --rail: 76px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0f1524; --surface: #161e31; --sunken: #121a2b;
    --ink: #e8ebf3; --ink-2: #a5aec4; --ink-3: #6f7892; --line: #253049; --line-2: #2f3b58;
    --brass-soft: #3a2f1b; --bubble-guest: #1f2940; --bubble-staff: #3b63d9;
    --blue: #6b8ff0; --violet: #9a83e6; --green: #4cb48b; --amber: #e0a23f; --red: #ec6a5a;
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ground); color: var(--ink);
  font: 15px/1.5 "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.num, .plate span, .code, .badge { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── 입력 요소 ───────────────────────────────────────────────────────────── */
input, select, textarea {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 9px 11px; min-height: 40px; transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
textarea { width: 100%; min-height: 96px; resize: vertical; line-height: 1.55; }
input[type="checkbox"] { min-height: 0; width: 16px; height: 16px; accent-color: var(--blue); }
.select-quiet { border-color: transparent; background: transparent; font-weight: 600; padding-left: 8px; }
.select-quiet:hover { background: var(--surface); border-color: var(--line-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.accent { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field > small { color: var(--ink-3); font-size: 12px; }

/* ── 문패 (시그니처 요소) ────────────────────────────────────────────────── */
.plate {
  position: relative; background: var(--navy); color: #f3e6c8; border-radius: 4px;
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 -3px 0 rgba(0,0,0,.25);
}
.plate span { font-weight: 700; letter-spacing: .04em; }
.plate i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--brass); top: 8px; }
.plate-lg { width: 260px; height: 132px; }
.plate-lg span { font-size: 72px; }
.plate-lg i { left: 12px; box-shadow: 230px 0 0 var(--brass); }

/* ── 로그인 ─────────────────────────────────────────────────────────────── */
.login { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--navy); color: #c9cfdf; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 32px; }
.login-art .plate { background: #0f1729; box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(181,137,58,.35); }
.login-art p { margin: 0; font-size: 15px; letter-spacing: .02em; }
.login-form { align-self: center; justify-self: center; width: min(380px, 100% - 32px); display: grid; gap: 18px; padding: 32px 0; }
.login-form .mark { font-weight: 700; color: var(--brass); letter-spacing: .08em; }
.login-form h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.02em; }
.form-error { color: var(--red); min-height: 1.4em; margin: 0; font-size: 14px; }
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-art { padding: 36px 16px 28px; }
  .plate-lg { width: 180px; height: 92px; } .plate-lg span { font-size: 48px; } .plate-lg i { box-shadow: 156px 0 0 var(--brass); }
}

/* ── 셸 ─────────────────────────────────────────────────────────────────── */
.shell { height: 100dvh; display: grid; grid-template-columns: var(--rail) 1fr; }
.rail {
  background: var(--navy); color: #aeb7cc; display: flex; flex-direction: column; align-items: stretch;
  gap: 4px; padding: 14px 8px; position: relative; z-index: 5;
}
.rail-mark { width: 40px; height: 40px; margin: 0 auto 14px; border-radius: 8px; background: var(--brass); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.rail > button {
  position: relative; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: var(--r);
  display: grid; justify-items: center; gap: 3px; padding: 10px 0 8px; font-size: 12px; font-weight: 600;
}
.rail > button:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail > button.active { background: rgba(181,137,58,.16); color: #f3e6c8; }
.rail > button.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brass); }
.badge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--blue); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.badge.hot { background: var(--red); }
.badge:empty { display: none; }
.rail-foot { margin-top: auto; display: grid; justify-items: center; gap: 12px; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.conn.on { background: #4cc18e; }
.rail-user { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: var(--navy-2); color: #fff; font-weight: 700; cursor: pointer; }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pagebar { display: flex; align-items: center; gap: 14px; padding: 14px 24px; min-height: 68px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.pagebar h1 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.route { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.route-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--sunken); font-size: 13px; color: var(--ink-2); }
.route-state b { font-size: 14px; }
.route-state b.front { color: var(--blue); } .route-state b.control { color: var(--violet); }
.route-state .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.route-state.front .pulse { color: var(--blue); } .route-state.control .pulse { color: var(--violet); }

.pane { display: none; flex: 1; min-height: 0; overflow: auto; padding: 24px; }
.pane.active { display: block; }

/* ── 문의 ───────────────────────────────────────────────────────────────── */
#pane-chat.active { display: grid; grid-template-columns: 340px minmax(0, 1fr) 300px; padding: 0; overflow: hidden; }
.inbox { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.inbox-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; background: var(--sunken); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(24,34,58,.12); }
.inbox-list { overflow: auto; flex: 1; }
.conv { display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.conv:hover { background: var(--sunken); }
.conv.active { background: color-mix(in srgb, var(--brass) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--brass); }
.conv .mini-plate { grid-row: span 2; height: 34px; border-radius: 4px; background: var(--navy); color: #f3e6c8; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.conv .who { font-weight: 600; font-size: 14px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; min-width: 0; }
.conv .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .when { font-size: 12px; color: var(--ink-3); text-align: right; }
.conv .preview { color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.conv .unread { justify-self: end; min-width: 20px; height: 20px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.conv.waiting .when { color: var(--red); font-weight: 700; }
.conv.waiting .preview { color: var(--ink); font-weight: 600; }
.to { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; flex: none; }
.to.FRONT { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.to.CONTROL { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }

.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--ground); }
.blank { margin: auto; text-align: center; color: var(--ink-2); padding: 40px 24px; max-width: 360px; }
.blank p { margin: 0 0 6px; font-weight: 600; }
.blank .sub { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 64px; }
.thread-head .back { display: none; }
.thread-head h2 { margin: 0; font-size: 18px; }
.thread-head .sub { color: var(--ink-2); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.thread-head .spacer { flex: 1; }
.messages { flex: 1; overflow: auto; padding: 24px 24px 12px; display: flex; flex-direction: column; gap: 6px; }
.day { align-self: center; font-size: 12px; color: var(--ink-3); margin: 10px 0; }
.msg { max-width: min(560px, 78%); display: grid; gap: 3px; }
.msg .b { padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.msg .t { font-size: 11px; color: var(--ink-3); padding: 0 6px; }
.msg.guest { align-self: flex-start; }
.msg.guest .b { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.staff { align-self: flex-end; justify-items: end; }
.msg.staff .b { background: var(--bubble-staff); color: #fff; border-top-right-radius: 4px; }
.msg.qk .b { border-color: color-mix(in srgb, var(--brass) 50%, var(--line)); background: var(--brass-soft); }
.msg.system { align-self: center; max-width: 90%; }
.msg.system .b { background: transparent; color: var(--ink-2); font-size: 13px; padding: 4px 10px; text-align: center; }
.composer-wrap { background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px 14px; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.quick button { flex: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.quick button:hover { border-color: var(--blue); color: var(--blue); }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; height: 44px; max-height: 160px; resize: none; border-radius: 22px; padding: 11px 16px; }
.composer .btn { border-radius: 22px; min-height: 44px; }
.closed-note { text-align: center; color: var(--ink-3); font-size: 13px; padding: 6px; }

.context { border-left: 1px solid var(--line); background: var(--surface); overflow: auto; padding: 22px 20px; }
.context:empty { display: block; }
.ctx-plate { width: 100%; height: 88px; }
.ctx-plate span { font-size: 40px; }
.ctx-plate i { left: 12px; box-shadow: 0 0 0 transparent; }
.ctx-hotel { margin: 10px 0 18px; color: var(--ink-2); font-size: 14px; text-align: center; }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.ctx-actions { display: grid; gap: 8px; margin-top: 18px; }

/* ── 객실 (문패 평면도) ─────────────────────────────────────────────────── */
.board-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.tools-right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.chips button b { font-weight: 700; color: var(--ink); }
.chips button.on { background: var(--navy); border-color: var(--navy); color: #e9ecf4; }
.chips button.on b { color: #f3e6c8; }
.chips button.alarm b { color: var(--red); }

.floor-group { margin-bottom: 28px; }
.floor-label { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 0 0 10px 2px; }
.floor { display: block; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.room {
  position: relative; text-align: left; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 0; cursor: pointer; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; min-height: 168px;
  transition: border-color .15s, transform .15s;
}
.room:hover { border-color: var(--ink-3); }
.room:active { transform: scale(.99); }
.room .door { background: var(--navy); color: #f3e6c8; padding: 12px 14px 10px; display: flex; align-items: center; justify-content: space-between; }
.room .door span { font-size: 28px; font-weight: 700; letter-spacing: .03em; line-height: 1; }
.room .door .dev { width: 9px; height: 9px; border-radius: 50%; background: #4cc18e; box-shadow: 0 0 0 3px rgba(76,193,142,.18); }
.room .door .dev.off { background: var(--red); box-shadow: 0 0 0 3px rgba(198,63,48,.25); }
.room .door .dev.none { background: transparent; border: 1px dashed #6d7894; box-shadow: none; }
.room .body { padding: 12px 14px 8px; display: grid; gap: 2px; align-content: start; }
.room .state { font-weight: 700; font-size: 14px; }
.room .co { font-size: 13px; color: var(--ink-2); }
.room .co b { color: var(--ink); font-size: 15px; }
.room .note { font-size: 12px; color: var(--red); font-weight: 600; margin-top: 2px; }
.room .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 14px 14px; }
.room .steps i { height: 5px; border-radius: 3px; background: var(--line); }
.room .steps i.sent { background: var(--amber); }
.room .steps i.ok { background: var(--green); }
.room .steps i.bad { background: var(--red); }
.room .steps i.skip { background: repeating-linear-gradient(90deg, var(--line-2) 0 3px, transparent 3px 6px); }
.room.vacant { background: var(--sunken); }
.room.vacant .door { background: color-mix(in srgb, var(--navy) 55%, var(--ground)); }
.room.vacant .state { color: var(--ink-3); font-weight: 600; }
.room.st-in_house .state { color: var(--green); }
.room.st-upcoming .state { color: var(--ink-2); }
.room.st-pre_alarm { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
.room.st-pre_alarm .state { color: var(--amber); }
.room.st-due, .room.st-overdue { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.room.st-due .state, .room.st-overdue .state { color: var(--red); }
.room.st-overdue .door { background: #5a1f1a; }
.room.undelivered::after { content: "!"; position: absolute; top: 52px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); font-size: 13px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg.in { background: var(--green); } .lg.pre { background: var(--amber); } .lg.due { background: var(--red); } .lg.vac { background: var(--line-2); }
.legend-note { color: var(--ink-3); }
.empty-state { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 48px 24px; text-align: center; color: var(--ink-2); }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); font-size: 17px; }
.empty-state p { margin: 0 0 16px; }

/* ── 서랍 ───────────────────────────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(15, 21, 36, .38); opacity: 0; transition: opacity .2s; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface);
  box-shadow: var(--shadow-pop); transform: translateX(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
  overflow: auto; padding: 24px;
}
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-x { position: absolute; top: 14px; right: 14px; }
.drawer h2 { margin: 0 0 4px; font-size: 22px; }
.drawer .lead { color: var(--ink-2); margin: 0 0 20px; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline .pt { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--line-2); }
.timeline .pt.ok { background: var(--green); } .timeline .pt.bad { background: var(--red); } .timeline .pt.sent { background: var(--amber); }
.timeline small { color: var(--ink-3); display: block; }
.timeline time { color: var(--ink-2); font-size: 13px; }
.drawer-section { margin-top: 24px; }
.drawer-section h3 { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; font-weight: 600; }
.inline-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-row input[type="datetime-local"] { flex: 1; min-width: 200px; }

/* ── 태블릿 ─────────────────────────────────────────────────────────────── */
.pairing { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 28px; }
.pairing-head h2, .list-head h2 { margin: 0; font-size: 17px; }
.pairing-head p { margin: 4px 0 16px; color: var(--ink-2); font-size: 14px; }
.pair-form { display: flex; gap: 8px; flex-wrap: wrap; }
.code-input { width: 150px; font-size: 20px; font-weight: 700; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.room-input { width: 120px; }
.pending { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 16px; }
.pending:empty { display: none; }
.pend { border: 1px solid color-mix(in srgb, var(--brass) 45%, var(--line)); background: color-mix(in srgb, var(--brass-soft) 55%, var(--surface)); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px; }
.pend .code { font-size: 32px; font-weight: 700; letter-spacing: .18em; line-height: 1; }
.pend .meta { color: var(--ink-2); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.pend form { display: flex; gap: 6px; }
.pend form select { flex: 1; min-width: 0; }
.pend form input { width: 90px; }
.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.count-text { color: var(--ink-3); font-weight: 600; margin-left: 6px; }

.devlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.devrow { display: grid; grid-template-columns: 76px minmax(120px, 1.2fr) 1fr 1fr 1fr 1.1fr 44px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.devrow:last-child { border-bottom: 0; }
.devrow.head { background: var(--sunken); color: var(--ink-3); font-size: 12px; font-weight: 600; padding-top: 9px; padding-bottom: 9px; }
.devrow .mini-plate { height: 36px; border-radius: 4px; background: var(--navy); color: #f3e6c8; display: grid; place-items: center; font-weight: 700; }
.devrow .mini-plate.off { background: #5a1f1a; }
.devrow .k { display: none; }
.devrow .main-col b { display: block; font-size: 14px; }
.devrow .main-col small, .devrow small { color: var(--ink-3); font-size: 12px; display: block; }
.batt { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.batt .bar { width: 28px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; color: var(--ink-3); }
.batt .bar i { position: absolute; left: 1px; top: 1px; bottom: 1px; border-radius: 1px; background: var(--green); }
.batt .bar.low i { background: var(--red); }
.ok { color: var(--green); } .bad { color: var(--red); } .warn { color: var(--amber); } .muted { color: var(--ink-3); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 42px; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px; min-width: 200px; display: none; }
.menu.open { display: grid; }
.menu button { border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.menu button:hover { background: var(--sunken); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .danger { color: var(--red); }

/* ── 경보 ───────────────────────────────────────────────────────────────── */
.alerts { max-width: 860px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.alert { display: grid; grid-template-columns: 4px 88px 1fr; gap: 14px; padding: 14px 18px 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.alert:last-child { border-bottom: 0; }
.alert .lvl { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--line-2); }
.alert.warn .lvl { background: var(--amber); } .alert.critical .lvl { background: var(--red); } .alert.info .lvl { background: var(--blue); }
.alert time { color: var(--ink-3); font-size: 13px; }
.alert.critical .txt { font-weight: 600; }

/* ── 설정 ───────────────────────────────────────────────────────────────── */
#pane-settings.active { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.subnav { display: grid; gap: 2px; position: sticky; top: 0; }
.subnav button { border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.subnav button:hover { background: var(--surface); color: var(--ink); }
.subnav button.active { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--brass); }
.settings-body { max-width: 860px; }
.settings-body > h2 { margin: 0 0 4px; font-size: 20px; }
.settings-body > .lead { margin: 0 0 22px; color: var(--ink-2); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; }
.panel > h3 { margin: 0 0 4px; font-size: 16px; }
.panel > p.desc { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.span2 { grid-column: 1 / -1; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 0; background: linear-gradient(transparent, var(--ground) 30%); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.days { display: inline-flex; gap: 3px; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.days input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.days input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.time-range { display: inline-flex; align-items: center; gap: 6px; }
.time-range input { width: 96px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.channel { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 6px; align-content: start; }
.channel h4 { margin: 0; font-size: 14px; color: var(--ink-2); }
.channel .ver { font-size: 26px; font-weight: 700; }
.channel .ver small { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.channel .who { font-size: 13px; color: var(--ink-2); }
.channel .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.qr-out { display: grid; grid-template-columns: auto 1fr; gap: 20px; margin-top: 18px; align-items: start; }
.qr-out img { background: #fff; border-radius: var(--r); padding: 8px; border: 1px solid var(--line); width: 300px; height: 300px; }
.qr-out details { font-size: 13px; color: var(--ink-2); }
.qr-out pre { font-size: 11px; background: var(--sunken); padding: 12px; border-radius: 8px; overflow: auto; max-height: 300px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat-row div { padding: 14px 16px; border-right: 1px solid var(--line); }
.stat-row div:last-child { border-right: 0; }
.stat-row dt { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.stat-row dd { margin: 0; font-weight: 700; }
code { font-size: 13px; background: var(--sunken); padding: 1px 6px; border-radius: 4px; }

/* ── 토스트 · 대화상자 ─────────────────────────────────────────────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--navy); color: #eef1f7; padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow-pop); max-width: 380px; font-size: 14px; animation: rise .22s ease-out; border-left: 3px solid var(--brass); }
.toast.critical { border-left-color: #ff7a68; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
dialog { border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgba(15, 21, 36, .45); }
dialog h3 { margin: 0 0 8px; font-size: 18px; }
dialog p { margin: 0 0 8px; color: var(--ink-2); }
dialog .field { margin-top: 14px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 22px 0 0; flex-wrap: wrap; }

/* ── 반응형 ─────────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  #pane-chat.active { grid-template-columns: 320px minmax(0, 1fr); }
  .context { display: none; }
}
@media (max-width: 1100px) {
  .devrow { grid-template-columns: 64px 1.3fr 1fr 1fr 44px; }
  .devrow .c-wifi, .devrow .c-upd { display: none; }
  .channels { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  #pane-settings.active { grid-template-columns: 1fr; gap: 14px; }
  .subnav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; }
  .subnav button { flex: none; }
  .subnav button.active { box-shadow: inset 0 -2px 0 var(--brass); }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .qr-out { grid-template-columns: 1fr; }
  .qr-out img { width: 100%; max-width: 320px; height: auto; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail {
    grid-row: 2; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    gap: 0;
  }
  .rail-mark, .rail-foot { display: none; }
  .rail > button { flex: 1; padding: 6px 0; font-size: 11px; }
  .rail > button.active::before { left: 25%; right: 25%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .badge { right: calc(50% - 22px); }
  .main { grid-row: 1; }
  .pagebar { padding: 10px 16px; min-height: 56px; gap: 8px; }
  .pagebar h1 { font-size: 18px; }
  .route { margin-left: 0; width: 100%; }
  .pane { padding: 16px; }
  #pane-chat.active { grid-template-columns: 1fr; }
  #pane-chat .thread { display: none; }
  #pane-chat.reading .inbox { display: none; }
  #pane-chat.reading .thread { display: flex; }
  .thread-head { padding: 10px 12px; }
  .thread-head .back { display: grid; }
  .thread-head .sub .hide-sm { display: none; }
  .messages { padding: 16px 12px 8px; }
  .msg { max-width: 86%; }
  .rooms { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .room { min-height: 150px; }
  .room .door span { font-size: 24px; }
  .tools-right { margin-left: 0; width: 100%; }
  .tools-right .btn { flex: 1; }
  .devrow.head { display: none; }
  .devrow { grid-template-columns: 56px 1fr 44px; gap: 6px 12px; padding: 14px 14px; }
  .devrow > .c-batt, .devrow > .c-lock, .devrow > .c-ver { grid-column: 2; }
  .devrow > .c-menu { grid-column: 3; grid-row: 1; }
  .devrow .mini-plate { grid-row: span 4; align-self: start; }
  .devrow .k { display: inline; color: var(--ink-3); font-size: 12px; margin-right: 6px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-row div:nth-child(2) { border-right: 0; }
  .stat-row div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .panel { padding: 18px 16px; }
  .alert { grid-template-columns: 4px 1fr; }
  .alert time { grid-column: 2; }
  .alert .txt { grid-column: 2; }
  .toasts { left: 16px; right: 16px; bottom: 76px; }
  .table .hide-sm { display: none; }
}

/* 다듬기 */
.composer textarea { overflow-y: auto; scrollbar-width: none; }
.composer textarea::-webkit-scrollbar { display: none; }
.code-input::placeholder { letter-spacing: 0; font-size: 15px; font-weight: 400; }
@media (max-width: 760px) {
  .route { flex-wrap: nowrap; gap: 6px; }
  .route-state { flex: 1; min-width: 0; padding: 5px 10px; }
  .route-state > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .route-state .muted { display: none; }
  .route .btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
  #pane-chat.reading { margin-top: 0; }
}
.field { align-content: start; }

/* ── 객실 공지: 평면도에서 객실 고르기 ── */
.selbar {
  position: sticky; top: -24px; z-index: 5; margin: -4px 0 20px; padding: 12px 14px 12px 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--navy); color: #e9ecf4; border-radius: var(--r); box-shadow: var(--shadow-pop);
}
.selbar-text { flex: 1; min-width: 200px; font-size: 14px; }
.selbar-text b { font-size: 20px; color: #f3e6c8; font-variant-numeric: tabular-nums; }
.selbar-text span { display: block; color: #aab3c8; font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.selbar .btn.ghost { color: #cfd5e3; }
.selbar .btn.ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.selbar .btn:not(.ghost):not(.accent) { background: transparent; color: #e9ecf4; border-color: rgba(255,255,255,.25); }
.selbar .btn.accent:disabled { opacity: .4; }

.picking .room.unpickable { opacity: .38; cursor: not-allowed; }
.picking .room.pickable .body, .picking .room.pickable .steps { opacity: .7; }
.picking .room.picked { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass); }
.picking .room.picked .body, .picking .room.picked .steps { opacity: 1; }
.pick-mark {
  position: absolute; right: 10px; bottom: 10px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line-2); background: var(--surface); display: grid; place-items: center;
}
.room.picked .pick-mark { background: var(--brass); border-color: var(--brass); }
.pick-mark svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* 공지 쓰기 · 보낸 공지 */
dialog.wide { width: min(620px, calc(100vw - 32px)); }
.tpl { display: grid; gap: 6px; margin-top: 14px; }
.tpl-item {
  text-align: left; border: 1px solid var(--line-2); background: var(--sunken); border-radius: var(--r-sm);
  padding: 9px 12px; font-size: 14px; line-height: 1.45; cursor: pointer; color: var(--ink);
}
.tpl-item:hover { border-color: var(--brass); }
.tpl-item.on { border-color: var(--brass); background: var(--brass-soft); }
.field small#ntcLen { justify-self: end; }

.rk-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.rk { display: inline-block; min-width: 46px; text-align: center; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.rk.read { background: color-mix(in srgb, var(--green) 16%, var(--surface)); color: var(--green); }
.rk.shown { background: color-mix(in srgb, var(--amber) 16%, var(--surface)); color: var(--amber); }
.rk.wait { background: var(--sunken); color: var(--ink-3); border-color: var(--line-2); border-style: dashed; }
.rk.lost { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); text-decoration: line-through; }
.ntc-list { list-style: none; padding: 0; margin: 14px 0 0; max-height: min(60vh, 560px); overflow: auto; display: grid; gap: 10px; }
.ntc-list li { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.ntc-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--ink-2); }
.ntc-head time { font-weight: 700; color: var(--ink); }
.ntc-head b { margin-left: auto; font-size: 13px; }
.ntc-body { margin: 6px 0 10px !important; color: var(--ink) !important; white-space: pre-wrap; line-height: 1.5; }
.ntc-rooms { display: flex; gap: 4px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .selbar { top: -16px; }
  .selbar-actions { width: 100%; }
  .selbar-actions .btn.accent { margin-left: auto; }
}

/* 한국어는 어절 단위로 줄을 바꾼다 ("누릅니/다" 방지). 긴 영문·URL 은 넘치지 않게 끊는다. */
body { word-break: keep-all; overflow-wrap: break-word; }

/* 객실 문패의 배터리 표시 — 충전 중이면 번개, 충전기 빠지면 빨간 바탕 */
.room .door .batt-mini { margin-left: auto; margin-right: 10px; display: inline-flex; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 700; color: #c9cfdd; font-variant-numeric: tabular-nums; }
.room .door .batt-mini svg { width: 12px; height: 12px; fill: #f3e6c8; }
.room .door .batt-mini.unplugged { color: #fff; background: var(--red); border-radius: 4px; padding: 1px 6px; }


/* ── 다듬기 2 (2026-11-22) ───────────────────────────────────────────────── */

/* 채팅: 메시지를 입력창 쪽에 붙인다(메신저처럼). 짧은 대화에서 아래가 비어 보이던 문제. */
.messages > :first-child { margin-top: auto; }
/* 대화를 고르기 전에는 오른쪽 객실 정보 칸을 숨긴다 */
#pane-chat.active:has(.context:empty) { grid-template-columns: 340px minmax(0, 1fr); }
.context:empty { display: none; }
/* 빠른 답장 줄: 넘치는 쪽을 흐리게 — 옆으로 밀 수 있다는 신호 */
.quick { mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); padding-right: 32px; }
.quick button { transition: border-color .15s, color .15s, background .15s; }
.quick button:hover { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.composer-wrap { padding: 10px 16px 16px; }
.composer textarea { background: var(--sunken); border-color: transparent; }
.composer textarea:focus { background: var(--surface); }

/* 설정: 저장 막대를 떠 있는 카드로(아래 내용을 덮어 보이던 문제) */
.savebar {
  position: sticky; bottom: 12px; z-index: 3; margin-top: 4px;
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding: 10px 10px 10px 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-pop);
}
.savebar::before { content: "저장하면 태블릿에 바로 반영됩니다."; margin-right: auto; color: var(--ink-2); font-size: 13px; }
.panel { box-shadow: 0 1px 2px rgba(24, 34, 58, .04); }

/* 경보 */
.alerts-wrap { max-width: 960px; }
.alerts-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.alerts-head .muted { font-size: 13px; }
.alert-day { margin-bottom: 22px; }
.alert-day h3 { margin: 0 0 8px 2px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.alert-items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.alert-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: 0; }
.alert-item .lv { justify-self: start; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); }
.alert-item.critical .lv { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); }
.alert-item.warn .lv { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); color: var(--amber); }
.alert-item.info .lv { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); color: var(--blue); }
.alert-item.critical .txt { font-weight: 600; }
.alert-item .txt { line-height: 1.5; font-size: 14px; }
.alert-item time { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.alerts-empty { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 48px 24px; text-align: center; }
.alerts-empty p { margin: 0 0 6px; font-weight: 600; color: var(--ink-2); }
.alerts-empty .sub { font-weight: 400; color: var(--ink-3); font-size: 13px; }

@media (max-width: 900px) {
  /* 모바일 설정: 그리드 첫 행(탭 줄)이 0px 로 눌려 제목과 겹치던 문제 — 블록으로 쌓는다 */
  #pane-settings.active { display: block; }
  .subnav { position: sticky; top: -16px; z-index: 4; margin: -16px -16px 16px; padding: 8px 12px; background: var(--ground); border-bottom: 1px solid var(--line); }
  .subnav button { padding: 8px 12px; }
  .subnav button.active { background: var(--surface); box-shadow: inset 0 -2px 0 var(--brass); }
}
@media (max-width: 760px) {
  .alert-item { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px; }
  .alert-item time { grid-column: 2; }
  .savebar::before { display: none; }
  .savebar { bottom: 8px; }
  .tools-right { display: grid; grid-template-columns: 1fr 1fr; }
  .tools-right .btn { min-height: 40px; }
}

.alert-item .txt { color: var(--ink); }

/* 근무 시간표: 시각 입력이 "오전 09" 로 잘리던 문제 */
.time-range { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.time-range input[type="time"] { min-width: 132px; }
@media (max-width: 760px) {
  /* 새 태블릿 연결: 코드 한 줄, 지점·객실 한 줄, 버튼 한 줄 */
  .pair-form { display: grid; grid-template-columns: 1fr 1fr; }
  .pair-form .code-input { grid-column: 1 / -1; width: 100%; }
  .pair-form .btn { grid-column: 1 / -1; }
  .pair-form > * { min-width: 0; }
}

/* ══ 모달 (2026-11-22) — 모든 대화상자와 객실 상세가 같은 틀: 머리 / 본문 / 아래 버튼 줄 ══ */
dialog.modal {
  padding: 0; border: 0; border-radius: 18px; width: min(480px, calc(100vw - 32px));
  max-height: min(88dvh, 860px); box-shadow: 0 24px 64px rgba(15, 21, 36, .28); overflow: hidden;
}
dialog.modal.wide { width: min(640px, calc(100vw - 32px)); }
dialog.modal.xl { width: min(940px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(15, 21, 36, .5); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
#dlgBody, .modal-frame { display: flex; flex-direction: column; max-height: min(88dvh, 860px); }
.modal-head { display: flex; align-items: center; gap: 14px; padding: 18px 16px 16px 24px; border-bottom: 1px solid var(--line); flex: none; }
dialog.modal .modal-head h3 { margin: 0; font-size: 18px; flex: 1; letter-spacing: -0.01em; }
.modal-x { margin-left: auto; width: 38px; height: 38px; flex: none; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.modal-x:hover { background: var(--sunken); color: var(--ink); }
.modal-x svg { width: 20px; height: 20px; }
.modal-body { padding: 20px 24px 22px; overflow: auto; flex: 1; min-height: 0; }
dialog.modal .modal-body > p { margin: 0 0 8px; line-height: 1.6; }
dialog.modal .modal-body > .field:first-child { margin-top: 0; }
dialog.modal menu.modal-foot, .modal-foot {
  display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; flex: none;
  margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--sunken);
}
.modal-foot .spacer { flex: 1; }
.btn.danger-fill { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-fill:hover { filter: brightness(.95); }

/* 도난 의심·동시 끊김 — [확인] 전까지 남는 창 */
dialog.modal.urgent { width: min(560px, calc(100vw - 32px)); border-top: 6px solid var(--red); }
dialog.modal.urgent.ok { border-top-color: var(--navy); }
dialog.modal.urgent .modal-head h3 { font-size: 24px; color: var(--red); }
dialog.modal.urgent.ok .modal-head h3 { color: var(--navy); }
dialog.modal.urgent .urgent-text { font-size: 19px; line-height: 1.6; margin: 0 0 10px; color: var(--ink); }
dialog.modal.urgent .sub { color: var(--ink-3); font-size: 13px; margin: 0; }
dialog.modal.urgent .modal-foot .btn { min-height: 46px; padding: 0 22px; font-size: 16px; }

/* 객실 상세 */
.room-head { gap: 16px; }
.room-mark { width: 68px; height: 50px; flex: none; border-radius: 8px; background: var(--navy); color: #f3e6c8; display: grid; place-items: center; font-weight: 700; font-size: 20px; letter-spacing: .02em; position: relative; }
.room-mark::before, .room-mark::after { content: ""; position: absolute; top: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--brass); }
.room-mark::before { left: 7px; }
.room-mark::after { right: 7px; }
.room-mark.st-due, .room-mark.st-overdue { background: #5a1f1a; }
.room-mark.vacant { background: color-mix(in srgb, var(--navy) 55%, var(--ground)); }
.room-title { flex: 1; min-width: 0; }
dialog.modal .room-title h3 { font-size: 20px; }
.room-title p { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); }
.pill.ok { background: color-mix(in srgb, var(--green) 13%, var(--surface)); color: var(--green); }
.pill.warn { background: color-mix(in srgb, var(--amber) 15%, var(--surface)); color: var(--amber); }
.pill.bad { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); }
.room-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; }
.room-col h4 { margin: 24px 0 10px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.room-col > h4:first-child, .side-card h4 { margin-top: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat-strip > div { padding: 12px 14px; border-right: 1px solid var(--line); display: grid; gap: 2px; align-content: start; }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip span { font-size: 12px; color: var(--ink-3); }
.stat-strip b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-strip small { font-size: 12px; color: var(--ink-2); }
.stat-strip .bad b, .stat-strip .bad small { color: var(--red); }
.stat-strip .warn b { color: var(--amber); }
.co-form { display: flex; gap: 8px; }
.co-form input { flex: 1; min-width: 0; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.room-col.side { display: grid; gap: 12px; align-content: start; }
.side-card { background: var(--sunken); border-radius: 12px; padding: 14px 16px; }
.side-card .facts.compact div { padding: 8px 0; }
.side-card .facts.compact div:last-child { border-bottom: 0; }
.test-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.test-form label { display: flex; align-items: center; gap: 6px; font-size: 14px; flex: 1; color: var(--ink-2); }
.test-form input { width: 72px; min-height: 38px; }
.small { font-size: 12px; }
.side-card .muted.small { margin: 8px 0 0; line-height: 1.5; }
.room-empty { text-align: center; padding: 36px 16px; border: 1px dashed var(--line-2); border-radius: 12px; }
.room-empty p { margin: 0 0 6px; font-weight: 600; }
.room-empty .btn { margin-top: 12px; }

/* 휴대폰: 모달은 아래에서 올라오는 시트 */
@media (max-width: 600px) {
  dialog.modal, dialog.modal.wide, dialog.modal.xl {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh;
  }
  #dlgBody, .modal-frame { max-height: 92dvh; }
  dialog.modal[open] { animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
  .modal-body { padding: 16px 18px 20px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: .6; } }
@media (max-width: 760px) {
  .room-body { grid-template-columns: 1fr; gap: 16px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip > div:nth-child(2) { border-right: 0; }
  .stat-strip > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}

/* ══ 객실 현황판 ══ */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 16px; cursor: pointer; display: grid; gap: 2px; font: inherit; color: inherit; }
.kpi b { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; font-weight: 700; }
.kpi span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.kpi:hover { border-color: var(--ink-3); }
.kpi.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.kpi.warn b { color: var(--amber); }
.kpi.bad b { color: var(--red); }
.kpi.bad { background: color-mix(in srgb, var(--red) 4%, var(--surface)); }
.board-tools { justify-content: space-between; }
.floor-label small { margin-left: 6px; color: var(--ink-3); font-weight: 400; }

.room { min-height: 0; grid-template-rows: auto 1fr auto auto; }
.room .door { padding: 10px 12px 10px 14px; }
.room .door .no { font-size: 24px; font-weight: 700; letter-spacing: .03em; line-height: 1; }
.room .door .icons { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.room .door .icons .batt-mini { margin: 0; }
.room .body { padding: 11px 14px 10px; gap: 3px; }
.room .state, .room-row .state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.room .state i, .room-row .state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.t-in .state { color: var(--green); }
.t-soon .state { color: var(--amber); }
.t-late .state { color: var(--red); }
.t-vac .state { color: var(--ink-3); }
.t-up .state { color: var(--blue); }
.room .guest { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .co { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; font-size: inherit; color: inherit; }
.room .co span { font-size: 12px; color: var(--ink-3); }
.room .co b { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.room .co small { font-size: 12px; color: var(--ink-2); }
.room .left { font-size: 12px; color: var(--ink-2); }
.room .left.over { color: var(--red); font-weight: 700; }
.room .prog { height: 4px; margin: 0 14px 12px; background: var(--line); border-radius: 2px; overflow: hidden; }
.room .prog i { display: block; height: 100%; background: var(--green); border-radius: 2px; }
.room.t-soon .prog i { background: var(--amber); }
.room.t-late .prog i { background: var(--red); }
.room .prog.empty { background: transparent; }
.room .issue { background: color-mix(in srgb, var(--red) 9%, var(--surface)); color: var(--red); font-size: 12px; font-weight: 700; padding: 7px 14px; border-top: 1px solid color-mix(in srgb, var(--red) 22%, var(--line)); }
.room.t-late { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.room.t-late .door { background: #5a1f1a; }
.room.t-soon { border-color: color-mix(in srgb, var(--amber) 60%, var(--line)); }
.room.t-vac { background: var(--sunken); }
.room.t-vac .door, .room.t-up .door { background: color-mix(in srgb, var(--navy) 55%, var(--ground)); }

.room-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; }
.room-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.room-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--sunken); white-space: nowrap; }
.room-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.room-table tr:last-child td { border-bottom: 0; }
.room-row { cursor: pointer; }
.room-row:hover, .room-row:focus-visible { background: var(--sunken); outline: none; }
.room-row .mini-plate { display: inline-grid; place-items: center; min-width: 56px; height: 30px; padding: 0 8px; border-radius: 4px; background: var(--navy); color: #f3e6c8; font-weight: 700; }
.room-row.t-late .mini-plate { background: #5a1f1a; }
.room-row.t-vac .mini-plate, .room-row.t-up .mini-plate { background: color-mix(in srgb, var(--navy) 55%, var(--ground)); }
.room-table td.bad { color: var(--red); font-weight: 700; }
.issue-cell { color: var(--red); font-weight: 600; font-size: 13px; }
.room-table .icons { display: inline-flex; gap: 8px; align-items: center; }
.room-table .batt-mini { font-size: 12px; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 2px; }
.room-table .batt-mini svg { width: 12px; height: 12px; fill: var(--amber); stroke: none; }
.room-table .batt-mini.unplugged { color: #fff; background: var(--red); border-radius: 4px; padding: 1px 6px; }
.room-table .dev { width: 9px; height: 9px; border-radius: 50%; background: #4cc18e; display: inline-block; }
.room-table .dev.off { background: var(--red); }
.room-table .dev.none { background: transparent; border: 1px dashed var(--ink-3); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .kpis { gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi b { font-size: 22px; }
  .room-table .hide-sm { display: none; }
  .room .co b { font-size: 20px; }
}

.modal-foot .btn.ghost.danger { color: var(--red); }
.modal-foot .btn.ghost.danger:hover { background: color-mix(in srgb, var(--red) 8%, var(--surface)); }

/* ══ 설정 (주제별 페이지) ══ */
#pane-settings.active { grid-template-columns: 232px minmax(0, 1fr); gap: 32px; }
.subnav { gap: 2px; align-content: start; }
.sub-hotel { display: grid; gap: 6px; margin: 0 0 14px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.sub-hotel span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.sub-hotel select { width: 100%; }
.sub-group { margin: 14px 12px 6px; font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.sub-group:first-of-type { margin-top: 2px; }
.subnav button { font-size: 14px; }
.settings-body { max-width: 880px; }
.set-head { margin-bottom: 18px; }
.set-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.set-head .lead { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.set-head .lead code, .panel .desc code { background: var(--sunken); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.cfg-form { padding-bottom: 80px; }
.panel { padding: 22px 24px; }
.panel > h3 { font-size: 16px; }
.panel > p.desc { line-height: 1.6; }

/* 저장 막대: 바꾼 내용이 있을 때만 */
.savebar::before { content: none; }
.savebar > span { margin-right: auto; color: var(--ink-2); font-size: 13px; }
.savebar { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); }

/* Wi-Fi */
.input-add { display: flex; gap: 6px; }
.input-add input { flex: 1; min-width: 0; }
.input-add .btn { white-space: nowrap; min-height: 40px; }
.wifi-preview { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 4px; font-size: 13px; color: var(--ink-2); }
.wifi-preview:empty { display: none; }
.wifi-preview b { color: var(--ink); margin-right: 4px; }
.wifi-preview em { font-style: normal; color: var(--brass); font-weight: 700; font-size: 12px; }
.sub-h { margin: 22px 0 8px; font-size: 14px; }
.sub-h small { font-weight: 400; color: var(--ink-3); margin-left: 6px; font-size: 12px; }
.ex-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.ex-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 0 6px 6px; }
.ex-table td { padding: 4px 6px 4px 0; }
.ex-table td:first-child input { width: 96px; }
.ex-table input { width: 100%; }
.ex-table td:last-child { width: 40px; }
.ex-table tbody:empty::after { content: "없음 — 모든 객실이 위 규칙을 따릅니다."; display: block; color: var(--ink-3); font-size: 13px; padding: 4px 0 6px; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--ink-3); }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* 알람 문구: 단계별 한 줄 */
.alarm-texts { display: grid; gap: 14px; }
.alarm-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1.6fr); gap: 12px; align-items: end; }
.alarm-row .tag { align-self: center; justify-self: start; margin-top: 18px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); }
.alarm-row .field { margin: 0; }

@media (max-width: 900px) {
  .sub-group, .sub-hotel span { display: none; }
  .sub-hotel { margin: 0 8px 0 0; padding: 0; border: 0; background: transparent; flex: none; }
  .sub-hotel select { min-height: 36px; }
  .settings-body { max-width: none; }
  .alarm-row { grid-template-columns: 1fr; }
  .alarm-row .tag { margin-top: 0; }
}

.set-head .lead code, .panel .desc code { font-family: inherit; font-weight: 600; color: var(--ink); letter-spacing: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   온하재 "쪽빛 노렌" (2026-11-22) — 태블릿과 같은 재료: 생마 바탕, 쪽빛 천, 나무 봉, 감물(경고), 마루부리 제목.
   앞의 남색·황동 토큰을 덮어쓴다.
   ════════════════════════════════════════════════════════════════════════════ */
@font-face { font-family: "MaruBuri"; font-weight: 400; font-display: swap; src: url(fonts/maruburi-regular.woff2) format("woff2"); }
@font-face { font-family: "MaruBuri"; font-weight: 700; font-display: swap; src: url(fonts/maruburi-bold.woff2) format("woff2"); }

:root {
  --navy: #1F3350;      /* 쪽빛 — 레일·문패·주 버튼 */
  --navy-2: #2A4266;
  --brass: #7A5A3E;     /* 나무 — 선택 표시·강조 */
  --brass-soft: #EFE4D3;
  --rod: #6E5038;       /* 노렌 봉 */
  --ground: #E9E3D6;    /* 생마 */
  --surface: #FBF8F2;
  --sunken: #F2EDE3;
  --ink: #1E2A3B;
  --ink-2: #4F5D73;
  --ink-3: #868B95;
  --line: #E0D8C8;
  --line-2: #CFC6B3;
  --blue: #2F5A8C;      /* 프론트 */
  --violet: #6B5B95;    /* 관제실 */
  --green: #3F7A5A;     /* 투숙 · 정상 */
  --amber: #B07A2A;     /* 곧 퇴실 */
  --red: #B4532A;       /* 감물 — 퇴실 지남 · 미전달 · 끊김 */
  --bubble-guest: #F2EDE3;
  --bubble-staff: #1F3350;
  --plate-ink: #F2EEE6; /* 쪽빛 위 글자 */
  --late-plate: #8E3F1F;
  --shadow-pop: 0 14px 36px rgba(31, 51, 80, .16), 0 2px 6px rgba(31, 51, 80, .08);
  --serif: "MaruBuri", "Pretendard", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #10151F; --surface: #171E2B; --sunken: #131925;
    --ink: #EDE7DB; --ink-2: #AFB6C3; --ink-3: #79808E; --line: #273042; --line-2: #313B50;
    --brass: #C2A27E; --brass-soft: #3A2E22; --bubble-guest: #1F2838; --bubble-staff: #3A5A8C;
    --blue: #7FA3D6; --violet: #A497C8; --green: #6FB08E; --amber: #D9A35A; --red: #E07A52;
    --late-plate: #7A3318;
  }
}

/* 제목·숫자는 마루부리 */
h1, h2, h3, .pagebar h1, .set-head h2, dialog.modal .modal-head h3,
.kpi b, .room .door .no, .room .co b, .mini-plate, .room-mark, .stat-strip b, .conv .mini-plate { font-family: var(--serif); }
.pagebar h1 { font-weight: 700; letter-spacing: 0; }

/* 쪽빛 위 글자 · 감물 문패 (앞의 고정 색 덮기) */
.room .door, .conv .mini-plate, .devrow .mini-plate, .room-mark, .room-row .mini-plate { color: var(--plate-ink); }
.room.t-late .door, .room-mark.st-due, .room-mark.st-overdue, .room-row.t-late .mini-plate, .devrow .mini-plate.off { background: var(--late-plate); }
.room.t-late { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.room .door .batt-mini { color: #C9D0DC; }
.room .door .batt-mini svg { fill: var(--plate-ink); }
.selbar { background: var(--navy); }
.selbar-text b { color: var(--plate-ink); }
.toast { background: var(--navy); color: var(--plate-ink); border-left-color: var(--rod); }
.chips button.on b { color: var(--plate-ink); }

/* 객실 이름 */
.room .door .rname { margin-left: 8px; margin-right: auto; font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--plate-ink); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rname-t { font-family: var(--serif); font-weight: 700; color: var(--ink); }
.room-title h3 small { font-family: "Pretendard", sans-serif; font-size: 14px; color: var(--ink-3); font-weight: 600; margin-left: 4px; }
.room-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.room-names .rn { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.room-names .rn-no { flex: none; width: 70px; align-self: stretch; display: grid; place-items: center; background: var(--navy); color: var(--plate-ink); font-family: var(--serif); font-weight: 700; }
.room-names .rn input { border: 0; border-radius: 0; min-height: 42px; flex: 1; min-width: 0; font-family: var(--serif); font-size: 16px; background: transparent; }
.room-names .rn input:focus { box-shadow: none; }
.room-names .rn:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 15%, transparent); }

/* 레일 = 세로로 드리운 쪽빛 노렌. 맨 위 문장 */
.rail { background: var(--navy); color: #BFC8D8; }
.rail-mark { width: 44px; height: 44px; border-radius: 50%; background: transparent; border: 1.5px solid var(--plate-ink); color: var(--plate-ink); font-family: var(--serif); font-weight: 700; font-size: 20px; }
.rail > button.active { background: rgba(242, 238, 230, .12); color: var(--plate-ink); }
.rail > button.active::before { background: #C9A27A; }
.rail-user { border-color: rgba(242, 238, 230, .25); background: var(--navy-2); }
.badge { background: var(--blue); }
.badge.hot { background: var(--red); }
.conn.on { background: #6FB08E; }

/* 페이지 머리 위 나무 봉 */
.pagebar { box-shadow: inset 0 4px 0 var(--rod); padding-top: 18px; }

/* 로그인: 쪽빛 노렌 */
.login-art { background: var(--ground); position: relative; color: var(--plate-ink); }
.login-art .noren { position: relative; width: min(420px, 80%); padding: 70px 24px 60px; background: var(--navy); display: grid; justify-items: center; gap: 12px; text-align: center; }
.login-art .noren::before { content: ""; position: absolute; left: -16px; right: -16px; top: -10px; height: 10px; border-radius: 5px; background: var(--rod); }
.login-art .noren::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 10px; height: 38%; transform: translateX(-50%); background: var(--ground); }
.login-art .crest { width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--plate-ink); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 42px; }
.login-art .store { margin: 6px 0 0; font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: .4em; margin-right: -.4em; }
.login-art .sub { margin: 0; font-size: 15px; color: #BFC8D8; letter-spacing: .04em; }
.login-form .mark { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--navy); color: var(--navy); display: grid; place-items: center; font-family: var(--serif); font-size: 22px; letter-spacing: 0; }
.login-form h1 { font-size: 26px; }
.login { background: var(--surface); }

/* 버튼·포커스 */
.btn.primary { background: var(--navy); border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-2); }
.btn.accent { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn { border-radius: 8px; }
:focus-visible { outline-color: var(--brass); }
.kpi.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.subnav button.active { box-shadow: inset 3px 0 0 var(--brass); }
.conv.active { background: color-mix(in srgb, var(--brass) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--brass); }
.msg.staff .b { background: var(--navy); }

@media (max-width: 900px) {
  .subnav button.active { box-shadow: inset 0 -2px 0 var(--brass); }
}
@media (max-width: 760px) {
  .rail > button.active::before { background: #C9A27A; }
  .login-art .noren { padding: 44px 20px 40px; }
  .login-art .crest { width: 72px; height: 72px; font-size: 32px; }
  .login-art .store { font-size: 24px; }
}

/* 로그인 노렌: 폭 고정, 갈라진 틈은 글자 아래로만 */
.login-art .noren { width: 380px; max-width: calc(100vw - 64px); padding: 72px 24px 120px; }
.login-art .noren::after { height: 84px; }
@media (max-width: 760px) { .login-art .noren { width: 300px; padding: 48px 20px 84px; } .login-art .noren::after { height: 56px; } }

/* ════════════════════════════════════════════════════════════════════════════
   C안 「평면도」 — 위쪽 쪽빛 띠 + 층별 실제 배치도 + 편지함
   ════════════════════════════════════════════════════════════════════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell { display: flex; flex-direction: column; height: 100dvh; }
.main { flex: 1; min-height: 0; }

/* 위쪽 띠 — 아래에 나무 봉 */
.topbar {
  display: flex; align-items: center; gap: 22px; padding: 0 24px; min-height: 64px; flex-wrap: wrap;
  background: var(--navy); color: var(--plate-ink); box-shadow: inset 0 -4px 0 var(--rod); position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-crest { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--plate-ink); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 18px; }
.brand .store-name { font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .3em; }
.topbar .rail { background: transparent; flex-direction: row; align-self: stretch; padding: 0; gap: 2px; }
.topbar .rail > button { display: flex; align-items: center; gap: 7px; padding: 0 14px; min-height: 60px; border-radius: 0; font-size: 15px; font-weight: 600; color: #BFC8D8; }
.topbar .rail > button svg { width: 18px; height: 18px; }
.topbar .rail > button:hover { background: rgba(242, 238, 230, .06); color: var(--plate-ink); }
.topbar .rail > button.active { background: transparent; color: var(--plate-ink); font-family: var(--serif); font-weight: 700; }
.topbar .rail > button.active::before { left: 12px; right: 12px; top: auto; bottom: 4px; width: auto; height: 3px; border-radius: 2px; background: #C9A27A; }
.topbar .badge { position: static; margin-left: 2px; }
.topbar .route { margin-left: auto; }
.topbar .route-state { background: rgba(242, 238, 230, .10); color: #BFC8D8; }
.topbar .route-state b.front { color: #A9C6EA; } .topbar .route-state b.control { color: #C7BCE6; }
.topbar .route-state .muted { color: #8E9AB0; }
.topbar .route .btn { background: transparent; color: var(--plate-ink); border-color: rgba(242, 238, 230, .3); }
.top-user { display: flex; align-items: center; gap: 10px; }
.topbar .select-quiet { color: var(--ink); }
@media (max-width: 760px) {
  .topbar { padding: 8px 12px; gap: 10px; min-height: 56px; }
  .brand .store-name { font-size: 16px; letter-spacing: .2em; }
  .topbar .route { order: 3; width: 100%; margin-left: 0; }
  .topbar .top-user { margin-left: auto; }
  .topbar .rail { position: fixed; left: 0; right: 0; bottom: 0; background: var(--navy); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); z-index: 20; box-shadow: 0 -1px 0 rgba(0,0,0,.2); }
  .topbar .rail > button { flex: 1; flex-direction: column; gap: 2px; min-height: 52px; padding: 4px 0; font-size: 11px; justify-content: center; }
  .topbar .rail > button.active::before { left: 30%; right: 30%; top: 0; bottom: auto; }
  .topbar .badge { position: absolute; top: 2px; right: calc(50% - 24px); }
  .main { padding-bottom: 64px; }
}

/* 객실 탭: 평면도 + 편지함 */
.plan-wrap { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.plan-main { flex: 999 1 720px; min-width: 0; }
.floor-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ft { display: flex; flex-direction: column; gap: 8px; align-items: stretch; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.ft:hover { border-color: var(--navy); }
.ft.on { background: var(--navy); border-color: var(--navy); color: var(--plate-ink); }
.ft-top { display: flex; align-items: baseline; gap: 8px; }
.ft-top b { font-family: var(--serif); font-size: 19px; }
.ft-top small { font-size: 12px; color: var(--ink-3); }
.ft.on .ft-top small { color: #BFC8D8; }
.ft-top i { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: var(--red); border-radius: 9px; padding: 1px 7px; }
.ft-mini { position: relative; display: block; height: 52px; }
.ftm-floor { position: absolute; background: #E4DED2; border-radius: 1px; }
.ft.on .ftm-floor { background: #2E4566; }
.ftm { position: absolute; box-shadow: inset 0 0 0 1px var(--surface); }
.ft.on .ftm { box-shadow: inset 0 0 0 1px var(--navy); }
.ftm.t-in { background: #7F93B3; } .ftm.t-rent { background: #97A27E; } .ftm.t-soon { background: #D9A955; } .ftm.t-late { background: #C8643A; }
.ftm.t-up, .ftm.t-vac { background: #D8D0C0; } .ft.on .ftm.t-up, .ft.on .ftm.t-vac { background: #4A5F80; }

.plan-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 4px 0 10px; }
.plan-head h2 { margin: 0; font-family: var(--serif); font-size: 26px; letter-spacing: .1em; }
.plan-sum { font-size: 14px; color: var(--ink-2); }
.legend { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border: 1px solid; display: inline-block; }
.legend .t-in { background: #DCE3EE; border-color: #1F3350; } .legend .t-rent { background: #E3E6DA; border-color: #5E6B4A; }
.legend .t-soon { background: #F3E4C8; border-color: #B07A2A; } .legend .t-late { background: #F3D9CC; border-color: #B4532A; }
.legend .t-up { background: #FBF8F2; border: 1.5px dashed #1F3350; } .legend .t-vac { background: #FBF8F2; border-color: #CFC6B3; }

/* 배치도 — 종이 위 도면처럼 늘 밝게. 방 사이 틈 = 벽(나무색) */
.plan-frame { position: relative; width: 100%; margin: 3px; background: repeating-linear-gradient(45deg, #EDE8DE 0 6px, #E4DED2 6px 12px); color: #1E2A3B; }
.pa, .pr, .pr-extra, .pz { position: absolute; box-sizing: border-box; }
.pa { display: grid; place-items: center; overflow: hidden; }
.pa > span { font-family: var(--serif); font-size: 13px; color: #5B4330; letter-spacing: .1em; background: rgba(251, 248, 242, .85); padding: 1px 6px; white-space: nowrap; }
.a-floor { background: #6E5038; box-shadow: 0 0 0 3px #5B4330; }
.a-corr { background: repeating-linear-gradient(90deg, #E6D8BE 0 40px, #DFCFB2 40px 41px); }
.a-corr > span { background: transparent; letter-spacing: .5em; font-size: 14px; }
.a-common { background: #E4DED2; } .a-lobby { background: #EDE5D5; }
.a-stair { background: linear-gradient(90deg, transparent calc(50% - 2px), #9C8668 calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)), repeating-linear-gradient(180deg, #EDE7DB 0 10px, #A8977C 10px 11px); box-shadow: inset 0 0 0 1px #A8977C; }
.a-stair1 { background: repeating-linear-gradient(180deg, #EDE7DB 0 10px, #A8977C 10px 11px); box-shadow: inset 0 0 0 1px #A8977C; }
.a-garden { background: repeating-linear-gradient(45deg, #E2E7D8 0 8px, #D8DFCB 8px 16px); }
.a-void { background: repeating-linear-gradient(45deg, #EDE8DE 0 6px, #E4DED2 6px 12px); }
.a-door { background: var(--red); z-index: 2; overflow: visible; }
.a-door > span { background: transparent; color: #fff; writing-mode: vertical-rl; font-size: 11px; padding: 0; }

.pr {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px; overflow: hidden;
  border: 0; border-radius: 0; font: inherit; text-align: left; cursor: pointer; color: #1E2A3B; background: #FBF8F2;
}
.pr:hover { filter: brightness(.97); }
.pr:focus-visible { outline: 3px solid var(--brass); outline-offset: -3px; z-index: 3; }
.pr.t-in { background-color: #DCE3EE; } .pr.t-rent { background-color: #E3E6DA; } .pr.t-soon { background-color: #F3E4C8; }
.pr.t-late { background-color: #F3D9CC; box-shadow: inset 0 0 0 4px #B4532A; }
.pr.t-up { background-color: #FBF8F2; outline: 1.5px dashed #1F3350; outline-offset: -8px; }
.pr.tatami { background-image: linear-gradient(90deg, transparent calc(50% - 1px), rgba(140,120,80,.18) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(transparent calc(33% - 1px), rgba(140,120,80,.18) calc(33% - 1px) calc(33% + 1px), transparent calc(33% + 1px) calc(66% - 1px), rgba(140,120,80,.18) calc(66% - 1px) calc(66% + 1px), transparent calc(66% + 1px)); }
.pr-extra { pointer-events: none; background: #FBF8F2; }
.pr-extra.t-in { background: #DCE3EE; } .pr-extra.t-soon { background: #F3E4C8; } .pr-extra.t-late { background: #F3D9CC; } .pr-extra.t-rent { background: #E3E6DA; }
.pr > span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-no { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.15; }
.pr-no em { font-style: normal; font-size: 15px; color: #5B4330; margin-left: 4px; }
.pr-type { font-size: 12px; color: #5B4330; }
.pr-guest { font-size: 12px; color: #4F5D73; margin-top: 6px; }
.pr-time { font-size: 14px; font-weight: 600; }
.pr-chip { margin-top: auto; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #FBF8F2; border: 1px solid #CFC6B3; color: #6B7280; }
.pr.t-in .pr-chip, .pr.t-up .pr-chip { color: #1F3350; border-color: #1F3350; }
.pr.t-rent .pr-chip { color: #46502F; border-color: #5E6B4A; }
.pr.t-soon .pr-chip { color: #8A5A16; border-color: #B07A2A; }
.pr.t-late .pr-chip { color: #9A3F1A; border-color: #B4532A; }
.pr-flag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; color: #fff; background: #B4532A; border-radius: 4px; padding: 2px 6px; }
.pr-pick { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; }
.pr-pick svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 3; }
.plan-frame.picking .pr.unpickable { opacity: .45; cursor: not-allowed; }
.plan-frame.picking .pr.picked { box-shadow: inset 0 0 0 4px var(--navy); }

/* 테라스 안 — 정원·데크·자쿠지·정자 (눌림은 방으로 통과) */
.pz { pointer-events: none; }
.pz > span { position: absolute; left: 6px; top: 6px; font-size: 11px; color: #5B4330; white-space: nowrap; }
.z-garden { background: repeating-linear-gradient(45deg, rgba(94,107,74,.22) 0 6px, rgba(94,107,74,.07) 6px 12px); border: 1px solid rgba(94,107,74,.35); }
.z-deck { background: repeating-linear-gradient(0deg, rgba(138,106,74,.20) 0 5px, rgba(138,106,74,.06) 5px 10px); }
.z-pool { border: 1.5px solid rgba(47,90,140,.6); border-radius: 3px; background: rgba(205,222,230,.85); }
.z-pavilion { background: rgba(110,80,56,.20); border: 1.5px solid rgba(91,67,48,.6); }
.z-pool > span, .z-pavilion > span { inset: 0; display: grid; place-items: center; font-family: var(--serif); }
.z-pool > span { color: #2F5A8C; }
.plan-strays { margin: 12px 2px 0; font-size: 13px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 편지함 */
.letters { flex: 1 1 280px; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.letters h2 { margin: 0 0 2px; font-family: var(--serif); font-size: 22px; letter-spacing: .1em; }
.letters h2 small { font-family: "Pretendard", sans-serif; font-size: 13px; color: #fff; background: var(--red); border-radius: 9px; padding: 1px 7px; letter-spacing: 0; vertical-align: 3px; }
.letter { position: relative; display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); padding: 13px 16px 12px; cursor: pointer; overflow: hidden; border-radius: 0; }
.letter::after { content: ""; position: absolute; top: 0; right: 0; border-top: 24px solid var(--ink-3); border-left: 24px solid transparent; }
.letter.seal-hot::after { border-top-color: var(--red); } .letter.seal-mid::after { border-top-color: var(--amber); }
.letter:hover { border-color: var(--navy); }
.l-top { display: flex; align-items: baseline; gap: 8px; padding-right: 18px; }
.l-top b { font-family: var(--serif); font-size: 17px; }
.l-kind { font-size: 12px; font-weight: 700; color: var(--red); }
.seal-mid .l-kind { color: var(--amber); }
.l-when { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.l-text { display: block; margin-top: 5px; font-size: 14px; line-height: 1.5; }
.letters-empty { margin: 0; padding: 18px 16px; border: 1px dashed var(--line-2); color: var(--ink-3); font-size: 14px; }
@media (max-width: 1100px) { .letters { max-width: none; flex-basis: 100%; } }

/* 테라스가 붙은 객실: 방과 테라스 사이에 선을 긋지 않는다 */
.pr.has-extra.t-late { box-shadow: none; }
/* 여러 칸으로 나뉜 공간의 이름만 그 공간 가운데에 */
.a-label { background: transparent; pointer-events: none; z-index: 1; }
/* 객실에 딸린 테라스도 그 객실 버튼 — 어느 쪽을 눌러도 같은 객실 */
.pr-extra { pointer-events: auto; border: 0; border-radius: 0; padding: 0; cursor: pointer; }
.plan-frame:has(.pr-extra:hover) .pr-extra:hover { filter: brightness(.97); }
.plan-frame.picking .pr-extra.picked { box-shadow: inset 0 0 0 4px var(--navy); }
/* 여러 직사각형으로 된 객실(ㄱ자 등): 버튼 하나를 그 모양으로 잘라 쓴다. 글자는 본 칸에 */
.pr.shaped { padding: 0; display: block; }
.pr-in { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px; box-sizing: border-box; overflow: hidden; }
.pr-in > span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr.shaped.t-late { box-shadow: none; }

/* 태블릿 상세 */
.dl-h { margin: 16px 0 6px; font-size: 14px; color: var(--ink-2); font-family: "Pretendard", sans-serif; font-weight: 700; }
.dl-h:first-child { margin-top: 4px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv > div { display: contents; }
dl.kv dt { color: var(--ink-3); font-size: 14px; }
dl.kv dd { margin: 0; font-size: 14px; }
.devrow small.inline { display: inline; color: var(--ink-3); }
.devrow .main-col small + small { display: block; }

/* 태블릿 목록이 짧아도 메뉴가 잘리지 않게 */
.devlist { overflow: visible; }
.devlist > .devrow.head { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.devlist > .devrow:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
dl.kv { grid-template-columns: 96px 1fr; }

/* 평면도 방 칸: 태블릿 상태(오른쪽 아래) */
.pr-dev { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; align-items: center; font-size: 12px; color: #4F5D73; }
.pr-dev .bt { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pr-dev .bt svg { width: 11px; height: 11px; fill: #3F7A5A; stroke: none; }
.pr-dev .bt.bad { color: #B4532A; }
.pr-dev .held { font-weight: 700; color: #fff; background: #B07A2A; border-radius: 4px; padding: 1px 6px; }
.pr-dev .scr { color: #868B95; }
/* 객실 창 태블릿 카드 버튼 */
.side-card .btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* 태블릿 점검 카드(객실 창) */
.side-card.insp.open { border-color: var(--red); background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.side-card.insp.open h4 { color: var(--red); }
.insp-item { display: grid; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.insp-item:last-of-type { border-bottom: 0; }
.insp-item p { margin: 0; }
.insp-pick { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.insp-pick label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; }
.insp-note { width: 100%; min-height: 38px; box-sizing: border-box; }
.insp-past { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.insp-past li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.insp-past small { grid-column: 1 / -1; }

/* ── 음성통화 ─────────────────────────────────────────────────────────────
   들어오는 전화: 화면 가운데 큰 카드(뒤를 가린다). 통화 중·거는 중: 위쪽 띠(다른 일을 계속할 수 있게). */
.call-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(15, 21, 36, .55); display: grid; place-items: center; padding: 16px; animation: call-fade .15s ease-out; }
@keyframes call-fade { from { opacity: 0; } }
@keyframes call-pop { from { opacity: 0; transform: translateY(8px); } }
.call-card { animation: call-pop .18s ease-out; width: min(620px, 100%); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop); overflow: hidden; border-top: 8px solid var(--rod); }
.call-kicker { margin: 0; padding: 18px 26px; background: var(--navy); color: var(--plate-ink); font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: .12em; display: flex; align-items: center; gap: 12px; }
.call-in { display: grid; grid-template-columns: auto 1fr; gap: 18px 20px; align-items: center; padding: 24px 26px; }
.call-in + .call-in { border-top: 1px solid var(--line); }
.call-plate { width: 120px; height: 84px; border-radius: 8px; background: var(--navy); color: var(--plate-ink); display: grid; place-items: center; font-family: var(--serif); font-size: 40px; font-weight: 700; }
.call-who b { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.2; }
.call-who b small, .call-bar-who b small { font-family: "Pretendard", sans-serif; font-size: 15px; color: var(--ink-3); margin-left: 4px; }
.call-who small { display: block; margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.call-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.call-btns .btn { min-height: 64px; font-size: 19px; border-radius: 10px; }
.call-accept { background: var(--green); border-color: var(--green); color: #fff; }
.call-accept:hover { filter: brightness(1.06); border-color: var(--green); }
.call-accept svg { width: 24px; height: 24px; }
.call-decline { color: var(--red); }
.call-dot { width: 12px; height: 12px; border-radius: 50%; background: #6FB08E; flex: none; animation: call-pulse 1.2s ease-in-out infinite; }
@keyframes call-pulse { 50% { box-shadow: 0 0 0 8px rgba(111, 176, 142, 0); } 0% { box-shadow: 0 0 0 0 rgba(111, 176, 142, .55); } }

.call-bar { position: fixed; z-index: 55; top: 14px; left: 0; right: 0; margin: 0 auto; width: min(640px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 22px; border-radius: 14px;
  background: var(--navy); color: var(--plate-ink); box-shadow: var(--shadow-pop); border-bottom: 4px solid var(--rod); animation: call-pop .18s ease-out; }
.call-bar.dialing .call-dot { background: var(--brass); }
.call-bar-who { flex: 1; min-width: 0; }
.call-bar-who b { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-bar-who b small { color: #BFC8D8; }
.call-bar-who small { color: #BFC8D8; font-size: 14px; font-variant-numeric: tabular-nums; }
.call-bar .btn { min-height: 52px; padding: 0 20px; font-size: 16px; border-radius: 10px; }
.call-mute { background: transparent; color: var(--plate-ink); border-color: rgba(242, 238, 230, .35); }
.call-mute:hover { border-color: var(--plate-ink); }
.call-mute.on { background: var(--brass); border-color: var(--brass); color: #fff; }
.call-end { background: var(--red); border-color: var(--red); color: #fff; }
.call-end:hover { filter: brightness(1.08); border-color: var(--red); }
.side-card .call-btn { min-height: 48px; font-size: 16px; margin-bottom: 8px; }
@media (max-width: 560px) {
  .call-in { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .call-bar { flex-wrap: wrap; }
}
