/* V18.3.0: operational tables and unobscured, scrollable forms. */
/* All ordinary modals share one viewport-bound frame. Only the body scrolls,
   so neither a sticky app header nor a long form can hide the modal title. */
html.has-modal #modalBackdrop:not(.hidden){z-index:400}
html.has-modal #modal:not(.hidden){z-index:410;display:flex;flex-direction:column;box-sizing:border-box;max-height:calc(100dvh - 24px);overflow:hidden}
html.has-modal #modal:not(.hidden)>.modal-head{position:relative;top:auto;flex:0 0 auto;z-index:2}
html.has-modal #modal:not(.hidden):not(.modal-room-return):not(.modal-network-edit):not(.modal-config-template):not(.modal-energy-batch):not(.modal-purchase):not(.modal-energy-proof)>#modalBody{flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scroll-padding-top:16px}
@media(max-width:920px){html.has-modal #modal:not(.hidden){max-height:var(--app-height,100dvh)!important}}
.maintenance-report-photo{display:grid;gap:9px;padding:12px;border:1px dashed #b9cee2;border-radius:9px;background:#f8fbfd}
.maintenance-report-photo>b{color:#263b50;font-size:15px}.maintenance-report-photo-actions{display:flex;gap:8px;flex-wrap:wrap}
.maintenance-report-photo-actions .btn{min-height:44px}.maintenance-report-photo>.multi-photo-preview{min-height:66px}
.maintenance-report-photo>small{color:#526b82}.maintenance-report-evidence{margin-top:14px;padding-top:12px;border-top:1px solid #d3e5f0}
.maintenance-report-gallery{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.maintenance-report-gallery .photo-thumb{width:88px;height:88px}
.maintenance-diagnosis-readonly{margin-top:12px}.maintenance-liability-field{min-width:0;margin:0;padding:10px 12px;border:1px solid #b9cee2;border-radius:9px}
.maintenance-liability-field legend{padding:0 4px;color:#263b50;font-weight:700}.maintenance-liability-field details{position:relative}
.maintenance-liability-field summary{display:flex;align-items:center;min-height:44px;padding:8px 11px;border:1px solid #738aa0;border-radius:8px;background:#fff;color:#263b50;cursor:pointer;list-style:none}
.maintenance-liability-field summary::-webkit-details-marker{display:none}.maintenance-liability-field summary:after{content:'⌄';margin-left:auto}
.maintenance-liability-field summary:focus-visible{outline:3px solid #4b75a2;outline-offset:2px}
.maintenance-liability-options{display:grid;gap:4px;max-height:220px;overflow-y:auto;padding:8px;border:1px solid #b9cee2;border-radius:8px;background:#fff}
.maintenance-liability-options label{display:flex;align-items:center;gap:9px;min-height:44px;margin:0;padding:6px 8px;border-radius:6px;cursor:pointer}
.maintenance-liability-options label:has(input:checked){background:#eaf3f8}.maintenance-liability-options input{width:20px;min-width:20px;height:20px;min-height:20px;margin:0;accent-color:#285e91}
.common-setting-panel #pmMaintenanceLiabilityOptions{width:100%;box-sizing:border-box;min-height:170px;margin-top:6px;font-size:15px;line-height:1.55}
.common-setting-actions{display:flex;justify-content:flex-end;margin-top:10px}
.room-directory-section{border:1px solid var(--line,#d3e5f0);border-radius:10px;background:#fff;margin-bottom:16px}
.room-directory-section>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:var(--mist-blue,#eaf3f8);border-radius:10px 10px 0 0}
.room-directory-section h4{margin:0;font-size:18px}.room-directory-section>header>span{font-size:13px;color:#526b82}
.room-directory-scroll{overflow:auto}.room-directory-table{width:100%;min-width:850px;border-collapse:collapse;table-layout:fixed}
.room-directory-table th,.room-directory-table td{padding:12px;text-align:left;border-bottom:1px solid #d3e5f0;vertical-align:middle;overflow-wrap:anywhere}
.room-directory-table th{font-weight:600;background:#f4f8fb}.room-directory-table th:first-child{width:17%}.room-directory-table th:nth-child(2){width:20%}.room-directory-table th:last-child{width:25%}
body .room-directory-table .parameter-location{display:table-row;padding:0;opacity:1}.room-directory-table td small{display:block;color:#526b82;margin-top:4px}
.room-directory-table tr:last-child td{border-bottom:0}.room-directory-table .parameter-location-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start}
.room-retired-badge{color:#687586;white-space:nowrap}.room-directory-retired{margin-bottom:0}.room-directory-retired td{background:#f7f8fa;color:#596574}
body .ui-asset-model-spec{display:grid;gap:4px}body .ui-asset-model-spec>span{display:block;overflow-wrap:anywhere}
body #assetResults .asset-card-model-spec{grid-column:1/-1;min-width:0;color:#263b50;font-weight:500}
body #assetResults .asset-card-model-spec>span{color:inherit}
.filing-photo-choice{position:relative;display:inline-flex;flex-direction:column;gap:4px;padding-bottom:4px}.filing-photo-choice .photo-thumb-remove{position:static;align-self:flex-end;min-width:44px;min-height:36px;margin:0;font-size:14px}
/* The dialog frame never scrolls out of the viewport. Its header stays outside
   the single body scroller, above the sticky application shell. */
body .modal.modal-filing-need{z-index:410;display:flex;flex-direction:column;top:50%;height:min(90dvh,1000px);max-height:calc(100dvh - 24px);overflow:hidden}
body .modal.modal-filing-need.hidden{display:none}
.modal-filing-need>.modal-head{position:relative;flex:0 0 auto;top:auto}
.modal-filing-need>#modalBody{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding:16px}
body #modalBackdrop:has(+.modal-filing-need){z-index:400}
.task-kind{display:inline-flex;align-items:center;gap:4px;border:1px solid #bfd4e6;border-radius:5px;padding:2px 6px;font-size:13px;line-height:1.4;color:#265c90;background:#edf5fd;white-space:nowrap}
.task-kind svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8}.task-kind.notice{color:#785111;background:#fff6e5;border-color:#e3c58e}
.action-success-confirmation{position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);margin:0;box-sizing:border-box;width:min(340px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid #c7decb;border-radius:12px;background:#fff;color:#263b50;text-align:center;box-shadow:0 16px 64px #142e4555;z-index:10000;animation:action-confirm-in .18s ease-out}
.action-success-confirmation svg{display:block;width:76px;height:76px;margin:0 auto 16px;fill:none;stroke:#5a9d4e;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.action-success-confirmation svg circle{stroke:#e0eed9;stroke-width:3}
.action-success-confirmation h2{font-size:22px;margin:0 0 12px}.action-success-confirmation p{font-size:15px;line-height:1.6;overflow-wrap:anywhere;margin:0 0 16px}.action-success-confirmation .btn{min-height:44px}
@keyframes action-confirm-in{from{opacity:0;transform:translate(-50%,-48%)}to{opacity:1;transform:translate(-50%,-50%)}}
@media(prefers-reduced-motion:reduce){.action-success-confirmation{animation:none}}
body #taskFilters.task-filters{display:grid;grid-template-columns:minmax(180px,2fr) minmax(120px,.85fr) minmax(155px,1.1fr) minmax(135px,.9fr) minmax(125px,.8fr) auto auto;align-items:end;gap:8px}
body #taskFilters.task-filter-mine{grid-template-columns:minmax(200px,2fr) minmax(130px,.85fr) minmax(165px,1.1fr) minmax(135px,.8fr) auto auto}
body #taskFilters>label{min-width:0}
.claim-policy-preview-grid:has(figure:nth-child(3)){grid-template-columns:repeat(3,minmax(0,1fr))}
.claim-policy-preview-set+.claim-policy-preview-set{margin-top:18px;padding-top:16px;border-top:1px solid #d3e5f0}
.claim-policy-preview-set h4{margin:0 0 10px;color:#245d91;font-size:14px}
.claim-policy-preview figure{min-width:0}.claim-policy-preview img{cursor:zoom-in}
.policy-image-open{display:block;width:100%;min-height:44px;padding:8px;border:1px solid #bfd4e6;border-radius:8px;background:#fff;cursor:zoom-in;text-align:center}.policy-image-open img{display:block;width:min(200px,100%);height:auto;margin:auto}.policy-image-open:focus-visible{outline:2px solid #265c90;outline-offset:3px}
.claim-policy-preview-controls{display:flex;align-items:center;gap:10px}.claim-policy-preview-close{width:44px;height:44px;border:1px solid #bfd4e6;border-radius:8px;background:#fff;color:#245d91;font-size:22px;line-height:1;cursor:pointer}.claim-policy-preview-close:hover{background:#e5f1fa}.claim-policy-preview-close:focus-visible{outline:2px solid #265c90;outline-offset:2px}
body .claim-policy-example{min-height:44px;padding:7px 5px}
@media(max-width:900px){.claim-policy-preview-grid:has(figure:nth-child(3)){grid-template-columns:1fr}.room-directory-section>header{align-items:flex-start}.room-directory-section h4{font-size:16px}}
@media(max-width:1150px){body #taskFilters.task-filters,body #taskFilters.task-filter-mine{grid-template-columns:repeat(2,minmax(0,1fr))}body #taskFilters>label:first-child{grid-column:1/-1}}
@media(pointer:coarse),(max-width:680px){.filing-photo-choice .photo-thumb-remove{min-height:48px}.room-directory-table .btn{min-height:44px}.modal.modal-filing-need{max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}}

/* V18.3.8: six compact cards on a wide desktop, with stable metadata alignment. */
body #assetResults.asset-grid:not(.asset-compact){grid-template-columns:repeat(4,minmax(0,1fr))!important;align-items:stretch}
body #assetResults.asset-grid:not(.asset-compact) .asset-card{min-width:0}
body #assetResults.asset-grid:not(.asset-compact) .asset-meta{grid-template-columns:3em minmax(0,1fr);gap:5px 4px}
body #assetResults.asset-grid:not(.asset-compact) .asset-meta>span{white-space:nowrap}
body #assetResults.asset-grid:not(.asset-compact) .asset-meta>b{min-width:0;overflow-wrap:anywhere}
body #assetResults.asset-grid:not(.asset-compact) .asset-info{padding:10px 12px 12px}
@media(min-width:1700px){body #assetResults.asset-grid:not(.asset-compact){grid-template-columns:repeat(6,minmax(0,1fr))!important}body #assetResults.asset-grid:not(.asset-compact) .asset-photo{height:145px}}
@media(max-width:1299px){body #assetResults.asset-grid:not(.asset-compact){grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:999px){body #assetResults.asset-grid:not(.asset-compact){grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:680px){body #assetResults.asset-grid:not(.asset-compact){grid-template-columns:1fr!important}}

/* Room identity, area and retirement date are separate, scan-friendly columns. */
body .room-directory-table{min-width:1180px;table-layout:auto}
body .room-directory-table th,body .room-directory-table td{padding:9px 10px}
body .room-directory-table th:nth-child(n){width:auto}
body .room-directory-table th:nth-child(1){min-width:135px}
body .room-directory-table th:nth-child(2){min-width:90px}
body .room-directory-table th:nth-child(3){min-width:145px}
body .room-directory-table th:nth-child(4){min-width:88px}
body .room-directory-table th:nth-child(7){min-width:95px}
body .room-directory-table th:nth-child(8){min-width:145px}
body .room-directory-table th:last-child{min-width:260px}
.room-directory-table .room-warehouse-yes{color:#b4232d;font-weight:750}
body .room-directory-table .parameter-location-actions{gap:5px;flex-wrap:nowrap}

body #locationCreateForm .location-compact-form{display:grid;grid-template-columns:180px 150px 105px 170px 140px minmax(0,1fr);column-gap:9px;row-gap:9px}
body #locationCreateForm .location-compact-form>label{min-width:0;margin:0}
body #locationCreateForm .location-compact-form>label :is(input,select){width:100%;min-width:0}
body #locationCreateForm .location-compact-form #pmLocLuggage,body #locationCreateForm .location-compact-form #pmLocWarehouse{width:78px}
body .location-utility-fields{gap:7px;padding:9px}
body .location-utility-fields>.location-utility-heading{display:flex;align-items:center;justify-content:flex-start;gap:14px;flex-wrap:wrap}
body .location-utility-fields>.location-utility-heading span{font-size:12px;color:#526b82}
body .location-utility-fields .energy-service-switches label{min-height:36px;padding:5px 10px}
.person-trajectory-option{display:grid;align-content:start;gap:5px;min-width:0}
.person-trajectory-option>span{display:flex;align-items:center;gap:7px;min-height:36px}
body .person-trajectory-option input[type=checkbox]{width:18px;min-width:18px;height:18px;min-height:18px;margin:0;accent-color:#245d91}
.person-trajectory-option small{display:block;color:#526b82;font-size:12px;line-height:1.45}
@media(max-width:1180px){body #locationCreateForm .location-compact-form{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:850px){body #locationCreateForm .location-compact-form{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){body #locationCreateForm .location-compact-form{grid-template-columns:1fr}}

/* In expanded/full-screen mode the sidebar already names the page. */
@media(min-width:921px) and (hover:hover) and (pointer:fine){
  html body .app-shell.hy-sidebar-expanded .main>.topbar:has(>.page-header-actions.field-empty){display:none!important}
  html body .app-shell.hy-sidebar-expanded .main>.topbar:not(:has(>.page-header-actions.field-empty)){min-height:48px!important;margin-bottom:8px;padding-block:4px!important}
}
