/* Floor plan grid: shared by the editor (screen) and the printed sheet. */
.plan-grid{display:grid;gap:2px;background:white;border:1px solid #999;padding:2px}
.plan-cell{display:flex;flex-direction:column;gap:1px;min-width:0;padding:3px 4px;background:white;overflow:hidden;font-size:8.5pt;line-height:1.3;text-align:left;border:1px solid #777;border-radius:0}
.plan-cell b{font-size:9.5pt;line-height:1.3}.plan-room.occupied{background:#fff}.plan-room:not(.occupied){background:#f7f7f7}.plan-room.missing{background:#fde8e8}
.plan-label{background:#e8e8e8;align-items:center;justify-content:center;text-align:center;font-weight:600;color:#333}
.plan-person{display:block;font-size:8pt;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plan-person small{margin-left:3px;color:#555;font-size:7pt}.plan-state{font-size:7pt;color:#666}
.plan-person-name,.room-plan-person .room-person{writing-mode:vertical-rl;text-orientation:upright;white-space:normal;overflow-wrap:anywhere;letter-spacing:.04em}
/* 部屋割票（見取り図）: 施設ごとに A4 横 1 枚。大きさは layout-model.js の renderLayoutSheet が mm で計算する（v0.13.52）。 */
.plan-document{width:281mm;height:194mm;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;color:#000;line-height:1.2;overflow-wrap:normal}
.ps-head{display:flex;flex-direction:column;gap:2mm;box-sizing:border-box;min-width:0}
.plan-document>.ps-head{flex:none;height:27mm;margin-bottom:2mm}
.ps-head-wide{flex-direction:row;align-items:flex-start;gap:6mm}.ps-head-wide .ps-title{flex:1}
.ps-board>.ps-head{position:absolute;top:0}
.ps-title{min-width:0}.ps-title h1{font-size:15pt;line-height:1.25;margin:0;font-weight:700}.ps-title span{display:inline-block;font-size:9pt;color:#222;margin:.5mm 4mm 0 0;white-space:nowrap}
.ps-meta{display:flex;gap:5mm;align-items:flex-start;flex-wrap:wrap}
.ps-head-side .ps-meta{flex-direction:column;gap:3mm}.ps-head-side .ps-legend{grid-template-columns:auto}
.ps-sum{border-collapse:collapse;font-size:8pt;flex:none}.ps-sum th,.ps-sum td{border:.5px solid #555;padding:.5mm 1.4mm;text-align:center;line-height:1.3;white-space:nowrap}.ps-sum th{background:#eee;font-weight:600}.ps-sum td{font-weight:700;font-size:10pt;min-width:9mm}
.ps-legend{list-style:none;margin:0;padding:0;font-size:8.5pt;display:grid;grid-template-columns:auto auto;gap:.8mm 4mm;flex:none}.ps-legend li{display:flex;align-items:center;gap:1.4mm;white-space:nowrap}
.ps-swatch{display:inline-block;width:7mm;height:3.4mm;border:.5px solid #555}
.ps-main{flex:none;display:flex;justify-content:center;align-items:flex-start;gap:6mm}.ps-main>.ps-head{flex:none}
.ps-board{flex:none;position:relative}
.ps-floor{position:absolute}
.ps-floor h2{font-size:var(--ps-number);line-height:1;margin:0;padding-top:.3mm;font-weight:700;box-sizing:border-box;white-space:nowrap}
.ps-grid{display:grid;width:max-content;border:.35mm solid #000}
.ps-cell{border-right:.2mm solid #333;border-bottom:.2mm solid #333;box-sizing:border-box;min-width:0;min-height:0;overflow:hidden;display:flex;flex-direction:column;background:#fff}
.ps-corridor{border:0;background:transparent}
.ps-band{flex:none;display:flex;align-items:center;justify-content:center;gap:.8mm;background:#cfe8f1;border-bottom:.2mm solid #555;font-family:Arial,sans-serif;font-size:var(--ps-number);line-height:1.3;padding:.25mm 0;white-space:nowrap}
.ps-band b{font-weight:700}
.ps-body{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0;overflow:hidden;padding:.5mm .3mm;gap:.6mm}
.ps-name{font-weight:700;line-height:1.2;white-space:nowrap}
.ps-vrow{display:flex;flex-direction:row-reverse;justify-content:center;gap:.6mm;min-height:0}
.ps-vname{display:flex;flex-direction:column;align-items:center;gap:.35em;font-weight:700;line-height:1}
.ps-vname>span,.ps-v>span{writing-mode:vertical-rl;text-orientation:upright;white-space:nowrap}
.ps-empty{font-weight:700;font-size:.85em}
.ps-tag,.ps-spare{flex:none;font-family:"BIZ UDPGothic","Yu Gothic",Meiryo,sans-serif;font-size:var(--ps-number);font-weight:700;line-height:1.1;padding:.15mm .8mm;border-radius:.6mm;background:#000;color:#fff;white-space:nowrap}.ps-spare{background:#fff;color:#000;border:.2mm solid #000}
.ps-hospital{background:#ff6b6b}.ps-out{background:#cdb8f2}.ps-care{background:#f9cba7}.ps-vacant{background:#fff35c}.ps-missing{background:#ddd}
.ps-delivery .ps-band,.ps-swatch-delivery{background:#ff9fcf}
.ps-label{align-items:center;justify-content:center;text-align:center;font-weight:600;line-height:1.1;color:#222}
.ps-toilet{background:#e3f5d6}.ps-bath{background:#ddf0f8}.ps-office{background:#e2dcf0}.ps-dining{background:#fff8c2}.ps-store{background:#bdbdbd}.ps-safety{background:#f7c99c}.ps-entrance{background:#f3ead9}.ps-other{background:#eee}
.ps-stairs{background:repeating-linear-gradient(0deg,#fff 0 1.1mm,#666 1.1mm 1.3mm)}.ps-stairs span{background:#fff;padding:.4mm}
.ps-foot{flex:none;font-size:7pt;color:#444;margin:auto 0 0;line-height:1.4}
.plan-document,.plan-document *{print-color-adjust:exact;-webkit-print-color-adjust:exact}
@media print{
  @page caremadoPlan{size:A4 landscape;margin:8mm;@bottom-left{content:none}@bottom-right{content:none}}
  @page caremadoPlanA3{size:A3 landscape;margin:8mm;@bottom-left{content:none}@bottom-right{content:none}}
  .plan-document{page:caremadoPlan;break-inside:avoid;break-after:page}.plan-document:last-child{break-after:auto}
  .plan-document.plan-paper-a3{page:caremadoPlanA3}
}

/* Editor */
@media screen{
  body.printing-report #report-print-root{display:block;position:fixed;left:-100000px;top:0;width:400mm;visibility:hidden;pointer-events:none}
  .report-preview .plan-document+.plan-document{padding-top:0;border-top:0}
  .room-plan-person{display:flex;flex-direction:column;align-items:center;gap:4px}.room-plan-person .room-person{display:block;margin:3px auto;font-size:14px;line-height:1.4}
  .plan-editor .plan-person{overflow:visible;white-space:normal;flex-shrink:0;align-self:center}.plan-editor .plan-person-name{display:block;margin:3px auto;line-height:1.4}
  .room-toolbar{align-items:flex-end}.room-toolbar .field{gap:4px}.room-toolbar select{width:280px;max-width:100%}.room-search{margin-left:auto;width:260px;max-width:100%}
  .room-view-switch{display:flex;gap:4px}.room-view-switch button[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:white}
  #room-content{padding:16px;min-width:0}.room-summary{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.room-summary h2{font-size:17px;margin:0}.room-summary .facility-layout-link{margin-left:auto}
  .room-plan{min-width:calc(var(--plan-columns)*90px + 3px);gap:3px;border-color:var(--line)}.room-plan .plan-cell{min-height:72px;padding:6px;overflow:visible;font-size:13px;border-color:#9aa8b6}
  .room-plan .plan-cell b{font-size:15px;overflow-wrap:anywhere;flex-shrink:0}.room-plan .plan-state{font-size:12px}.room-plan .unavailable{background:#fff3d9}.room-plan .occupied{border-top:3px solid #4f81ba}
  .room-plan-person,.room-plan-note{overflow-wrap:anywhere;font-size:12px}.room-plan .text-button{font-size:12px;min-height:28px;padding:2px 0;margin-top:auto;align-self:flex-start}.room-plan-note{color:var(--muted);white-space:pre-wrap}
  .room-person{color:var(--link);text-decoration:none}.room-person:hover{text-decoration:underline}.room-table-scroll{position:relative}.room-table{min-width:680px}.room-table td,.room-table th{padding:9px 12px;text-align:left;vertical-align:top}.room-table tbody th{background:white;color:inherit;font-size:14px;border-top:1px solid var(--surface-tint);white-space:nowrap}.room-table td:nth-child(2){min-width:170px}.room-table td:nth-child(4){white-space:nowrap}.room-table-notes{white-space:pre-wrap;overflow-wrap:anywhere;min-width:140px;max-width:380px}.room-unplaced{margin-top:16px}.room-unplaced summary{cursor:pointer;margin-bottom:10px}
  @media(max-width:700px){.room-toolbar{align-items:stretch}.room-toolbar>.field{width:100%;margin:0}.room-toolbar select{width:100%}.room-view-switch{width:100%}.room-view-switch button{flex:1}#room-content{padding:12px}.room-summary .facility-layout-link{margin-left:0}.room-table td,.room-table th{padding:8px 10px}}
  .layout-editor{min-width:0}.plan-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}.plan-scroll:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
  .plan-unplaced{margin-bottom:12px}.plan-unplaced summary{cursor:pointer}.plan-unplaced p{overflow-wrap:anywhere}
  .plan-editor{min-width:calc(var(--plan-columns)*83px + 3px)}.plan-editor .plan-room b{overflow-wrap:anywhere}
  #room-sheet-preview:has(.plan-document){width:297mm;max-width:none;min-height:210mm;padding:8mm}
  #room-sheet-preview:has(.plan-paper-a3){width:420mm;min-height:297mm}
  .layout-sheets{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}.layout-sheets button[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:white}
  .layout-settings{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr);gap:12px;margin-bottom:12px}
  .plan-editor{gap:3px;background:white;border-color:var(--line);overflow:auto}.plan-editor .plan-cell{border-color:#9aa8b6}
  .plan-editor .plan-cell,.plan-editor .plan-empty{min-height:64px;cursor:pointer;font-size:13px;color:inherit;font-weight:500}.plan-editor .plan-cell b{font-size:15px}.plan-editor .plan-person{font-size:12px}.plan-editor .plan-state{font-size:11px}
  .plan-empty{background:#fbfcfd;border:1px dashed #c5d0dc;border-radius:0;padding:0;min-width:0}.plan-empty:hover{background:var(--surface-tint)}.plan-editor .plan-cell:hover{outline:2px solid var(--accent);outline-offset:-2px}
  .plan-editor .plan-label{background:var(--surface-grey)}.plan-editor .plan-room:not(.occupied){background:#f3f6f9}
  .layout-actions{margin-top:16px;align-items:center}.layout-dirty{margin-left:auto;color:var(--amber-text);font-size:var(--font-sm)}
  .layout-cell-dialog{max-width:560px}.layout-kind{display:flex;gap:18px;margin-bottom:14px}.layout-kind label{display:flex;align-items:center;gap:8px;min-height:44px;font-weight:600}.layout-kind input{width:20px;height:20px;min-height:20px}
  .facility-layout-link{margin-left:10px;font-size:var(--font-sm);text-decoration:none;display:inline-flex;align-items:center;gap:4px}
  @media(max-width:700px){.layout-settings{grid-template-columns:1fr 1fr}.layout-settings .field:first-child{grid-column:1/-1}.plan-editor .plan-cell,.plan-editor .plan-empty{min-height:52px;font-size:11px}.plan-editor .plan-cell b{font-size:13px}}
}

/* Facility overview uses the same arrangement as the A3 print layout. */
@media screen{
  .room-overview-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:8px}.room-overview-tools p{margin:0}.room-overview-tools [role=group]{display:flex;gap:4px}.room-overview-tools button{font-size:12px;min-height:28px;padding:4px 9px}.room-overview-tools button[aria-pressed=true]{background:var(--accent);color:white;border-color:var(--accent)}
  .room-print{display:flex;align-items:center;gap:6px}.room-print .field{flex-direction:row;align-items:center;gap:6px;font-size:12px;color:var(--muted)}.room-overview-tools .room-print select{min-height:30px;font-size:12px;padding:3px 26px 3px 8px;min-width:0;align-self:auto}
  .room-overview-scroll{overflow:auto;position:relative;max-width:100%;overscroll-behavior:contain}.room-overview-board{display:grid;gap:10px;width:100%;min-width:max(980px,var(--overview-min-width));height:var(--overview-height,500px);min-height:420px}
  .room-overview-building{display:grid;gap:10px;min-width:0;min-height:0}.room-overview-floor{display:flex;flex-direction:column;min-width:0;min-height:0}.room-overview-floor .room-floor-open{display:flex;align-items:center;justify-content:space-between;flex:none;padding:1px 4px;margin:0 0 3px;min-height:22px;height:22px;max-height:22px;font-size:12px;line-height:1.3;text-align:left;border:0;background:var(--surface-tint);border-radius:3px;color:var(--link)}.room-floor-open:hover{background:var(--accent-soft)}
  .room-overview-floor .room-plan-compact{flex:1;min-width:0;min-height:0;gap:1px;padding:1px;border-color:#afbac4}.room-plan-compact .plan-cell{min-height:0;padding:1px;gap:1px;overflow:hidden;border-color:#abb6c1}.room-plan-compact .plan-cell b{font-size:10px;font-family:Arial,sans-serif;line-height:1.1;white-space:nowrap;letter-spacing:-.2px}.room-plan-compact .plan-label b{font-family:inherit;white-space:normal;overflow-wrap:anywhere;font-size:10px}
  .room-plan-compact .room-plan-person{flex:1;min-height:0;gap:0;min-width:0}.room-plan-compact .room-plan-person .room-person{flex:1;min-height:0;font-size:9px;line-height:1.05;margin:0;letter-spacing:0}.room-plan-compact .room-plan-person .badge{flex:none;font-size:9px;line-height:1.1;padding:1px 2px}.room-plan-compact .plan-state{font-size:9px;line-height:1.1;flex:none}.room-plan-compact .occupied{border-top-width:2px}
  .room-overview-scroll.enlarged .room-overview-board{min-width:1600px;height:1000px}.room-overview-scroll.enlarged .plan-cell b{font-size:14px}.room-overview-scroll.enlarged .room-person{font-size:13px}.room-overview-scroll.enlarged .plan-state{font-size:11px}
  @media(max-width:700px){.room-overview-board{height:650px}.room-overview-tools{gap:6px}}
  .room-plan-person .room-person,.plan-editor .plan-person-name{white-space:nowrap;overflow-wrap:normal}
  .room-plan-person .room-person.screen-name-wrap,.plan-editor .plan-person-name.screen-name-wrap{white-space:normal;overflow-wrap:anywhere}
  .room-plan-person{flex:1;min-height:0;min-width:0}
  .room-plan-person .room-person{flex:1;min-height:0}
}

