:root {
  color-scheme: light;
  --page:#f0f5fa; --surface:#fff; --ink:#12233a; --muted:#46566b;
  --border:#aebac8; --strong:#44566e; --rule:#d9e0e8;
  --pending:#1d57d4; --cleaned:#147c50; --idle:#e5ebf2;
  --tile-height:clamp(99px,9.05vw,139px);
  font-family:"Microsoft YaHei UI","PingFang SC","Noto Sans CJK SC",system-ui,sans-serif;
}
*,*::before,*::after { box-sizing:border-box; }
body { margin:0; min-width:280px; background:var(--page); color:var(--ink); }
button,input { font:inherit; }
button { color:inherit; cursor:pointer; }
button:focus-visible,input:focus-visible { outline:3px solid #5c88f0; outline-offset:3px; }
svg { display:block; width:1.15em; height:1.15em; flex:none; }
.frame { width:min(100% - 56px, 1480px); margin-inline:auto; }
.topbar { background:var(--surface); border-bottom:1px solid var(--rule); }
.topbar-inner { min-height:88px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.brand { display:flex; gap:22px; align-items:center; font-size:clamp(21px,2.65vw,41px); font-weight:800; white-space:nowrap; }
.brand svg { width:1.36em; height:1.36em; }
.outline,.primary,.icon-button { display:inline-flex; align-items:center; justify-content:center; gap:.5em; border:1px solid var(--strong); border-radius:10px; background:var(--surface); min-height:42px; padding:9px 15px; font-weight:650; }
.topbar .outline { font-size:clamp(14px,1.65vw,25px); min-height:62px; padding-inline:22px; white-space:nowrap; }
.outline:hover,.icon-button:hover { background:#eaf0f8; }
main.frame { padding-block:26px 24px; }
.intro h1 { margin:0; font-size:clamp(33px,3.62vw,56px); line-height:1.2; font-weight:800; }
.intro p { margin:8px 0 0; color:var(--muted); font-size:clamp(15px,1.63vw,25px); }
.toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px 20px; margin-block:29px 30px; }
#floor-nav { display:flex; flex-wrap:wrap; gap:0; border:1px solid var(--strong); border-radius:9px; background:var(--surface); overflow:clip; }
.floor { font-weight:700; font-size:clamp(14px,1.45vw,22px); min-width:clamp(57px,6.03vw,93px); min-height:54px; background:none; border:0; padding:10px 11px; }
.floor[aria-pressed="true"] { background:#112945; color:white; }
.floor:not([aria-pressed="true"]):hover { background:#e8eef6; }
.floor:focus-visible { outline-offset:-4px; }
.legend { display:flex; flex-wrap:wrap; gap:clamp(7px,1.15vw,18px); list-style:none; margin:0; padding:0; }
.legend li { display:flex; align-items:center; gap:10px; border:1px solid var(--border); border-radius:9px; background:#fff; padding:10px 14px; font-size:clamp(13px,1.38vw,21px); font-weight:650; min-height:54px; white-space:nowrap; }
.swatch { width:1.1em; height:1.1em; border-radius:4px; flex:none; }
.pending { background:var(--pending); color:white; }
.cleaned { background:var(--cleaned); color:white; }
.idle { background:var(--idle); color:var(--ink); }
.map-panel { background:var(--surface); border:1px solid var(--strong); border-radius:15px; }
.map-header { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:16px 23px; border-bottom:1px solid var(--rule); }
.map-header h2 { margin:0; font-size:clamp(22px,2.45vw,38px); line-height:1.1; }
.map-header span { color:var(--muted); font-size:clamp(14px,1.6vw,24px); }
.plan-grid { display:grid; padding:14px 24px 17px; grid-template-columns:repeat(14,minmax(0,1fr)); grid-template-rows:auto var(--tile-height) clamp(32px,3vw,47px) var(--tile-height) auto; gap:11px 8px; }
.direction { color:var(--muted); font-size:clamp(11px,.97vw,15px); font-weight:650; grid-column:1 / -1; }
.north-direction { grid-row:1; }
.south-direction { grid-row:5; }
.room,.utility,.empty-space { grid-column:var(--slot); border-radius:7px; min-width:0; }
.north { grid-row:2; }
.south { grid-row:4; }
.room { border:0; padding:5px 1px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; }
.room:hover { box-shadow:inset 0 0 0 2px currentColor; }
.room-number { font-variant-numeric:tabular-nums; font-size:clamp(17px,2.16vw,35px); font-weight:800; line-height:1.1; }
.room-state { font-size:clamp(9px,1.05vw,16px); font-weight:650; white-space:nowrap; }
.utility { border:1px solid var(--strong); background:repeating-linear-gradient(135deg,#fafcfe 0 9px,#dbe3ee 9px 11px); display:flex; align-items:center; justify-content:center; gap:3px; flex-direction:column; font-size:clamp(10px,1.15vw,18px); font-weight:750; white-space:nowrap; }
.utility .position { font-size:.65em; color:var(--muted); }
.corridor { grid-area:3 / 1 / 4 / -1; border-radius:5px; background:#e8edf3; display:grid; place-items:center; font-weight:750; font-size:clamp(14px,1.7vw,26px); }
.totals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin:28px 0 0; padding:9px 0; background:white; border:1px solid var(--strong); border-radius:12px; }
.totals div { display:flex; gap:.5em; justify-content:center; align-items:baseline; text-align:center; padding:8px 4px; }
.totals div + div { border-left:1px solid var(--rule); }
.totals dt { font-size:clamp(13px,1.7vw,25px); font-weight:650; }
.totals dd { margin:0; font-size:clamp(14px,1.78vw,27px); font-weight:750; white-space:nowrap; }
.save-note { color:var(--muted); font-size:clamp(13px,1.34vw,20px); margin:14px 0 0; }
.visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
dialog { width:min(440px,calc(100% - 32px)); max-height:calc(100dvh - 32px); background:white; color:var(--ink); border:1px solid var(--strong); border-radius:15px; padding:22px; box-shadow:0 18px 64px #10253b35; }
dialog::backdrop { background:#101f356e; }
.dialog-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.dialog-head h2 { margin:0; font-size:23px; }
.icon-button { border-color:transparent; min-height:36px; min-width:36px; padding:6px; }
dialog p { font-size:14px; color:var(--muted); margin:8px 0 17px; line-height:1.55; }
.status-options { display:grid; gap:8px; }
.status-option { border:1px solid var(--rule); min-height:49px; border-radius:8px; padding:8px 11px; background:#fff; display:flex; align-items:center; text-align:left; gap:10px; }
.status-option:hover,.status-option[aria-pressed="true"] { background:#f0f5fa; border-color:var(--strong); }
.status-option .current { margin-left:auto; color:var(--muted); font-size:12px; }
.field { display:block; margin:16px 0 7px; font-size:14px; font-weight:650; }
input { width:100%; padding:10px; border:1px solid var(--border); border-radius:8px; color:var(--ink); background:#fff; }
.form-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.primary { background:#112945; color:white; }
.primary:hover { background:#233f61; }
@media (max-width:1050px) {
  .frame { width:calc(100% - 36px); }
  .topbar-inner { min-height:67px; }
  .brand { gap:11px; }
  .topbar .outline { min-height:42px; padding-inline:11px; }
  .plan-grid { padding-inline:13px; gap:8px 5px; }
  .map-header { padding-inline:13px; }
}
@media (max-width:850px) {
  .plan-grid { grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr); grid-template-rows:auto repeat(14,65px); gap:7px; }
  .north-direction { grid-area:1 / 1 / 2 / 2; }
  .south-direction { grid-area:1 / 3 / 2 / 4; text-align:right; }
  .north { grid-column:1; grid-row:calc(var(--slot) + 1); }
  .south { grid-column:3; grid-row:calc(var(--slot) + 1); }
  .corridor { grid-area:2 / 2 / 16 / 3; writing-mode:vertical-rl; letter-spacing:.25em; }
  .room { flex-direction:row; gap:10px; }
  .room-number { font-size:22px; }
  .room-state { font-size:11px; }
  .utility { font-size:14px; }
}
@media (max-width:510px) {
  .frame { width:calc(100% - 24px); }
  .brand { font-size:19px; }
  .brand svg { width:22px; height:22px; }
  main.frame { padding-top:19px; }
  .toolbar { gap:12px; margin-block:19px; }
  #floor-nav { width:100%; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); }
  .floor { min-width:0; min-height:40px; padding:6px 3px; }
  .legend { gap:5px; }
  .legend li { gap:6px; min-height:36px; padding:5px 7px; font-size:12px; }
  .plan-grid { grid-template-columns:minmax(0,1fr) 33px minmax(0,1fr); gap:6px; padding:9px; }
  .room { gap:4px; flex-direction:column; }
  .totals { margin-top:15px; }
  .totals div { flex-direction:column; align-items:center; gap:1px; }
}

[hidden] { display:none!important; }
.board-actions { display:flex; align-items:center; gap:9px; }
.role-label { font-size:clamp(13px,1.15vw,17px); color:var(--muted); font-weight:650; }
.topbar .board-actions button { font-size:clamp(13px,1.28vw,19px); min-height:44px; padding:7px 11px; }
.entry-panel { max-width:420px; margin:clamp(24px,6vw,78px) auto; background:white; border:1px solid var(--border); border-radius:15px; padding:25px; }
.entry-panel h1 { font-size:28px; margin:0; }
.entry-panel p { color:var(--muted); line-height:1.55; }
.entry-panel .primary { width:100%; margin-top:16px; }
.message { border:1px solid #a1b7d4; background:#f6f9ff; border-radius:8px; padding:8px 12px; font-size:14px; margin:0 0 12px; }
.message.error { color:#932525; border-color:#e1b8b8; background:#fff6f6; }
.status-option:disabled,.primary:disabled { opacity:.6; cursor:wait; }
.room:disabled { cursor:default; }
.room:disabled:hover { box-shadow:none; }
@media (max-width:510px) {
  .topbar .board-actions { gap:5px; flex-wrap:wrap; justify-content:flex-end; }
  .topbar .board-actions button { min-height:33px; padding-inline:7px; }
  .topbar .board-actions .role-label { display:none; }
}
