:root{font-family:system-ui,sans-serif;color:#172c40;background:#f5f7f9}*{box-sizing:border-box}body{margin:0}header{background:#142d43;color:white;padding:20px 5%;display:flex;align-items:center;gap:30px}header button{margin-left:auto}main{max-width:1240px;margin:auto;padding:40px 24px}h1{font-size:clamp(32px,5vw,60px);line-height:1.1;letter-spacing:-2px}.eyebrow{color:#c45a25;font-weight:700;letter-spacing:2px}form{display:flex;flex-wrap:wrap;align-items:end;gap:16px}label{display:flex;flex-direction:column;gap:7px}label:has([type=checkbox]){flex-direction:row;align-items:center}input,select,textarea{padding:12px;border:1px solid #bec9d2;border-radius:7px;font:inherit}button{background:#e66c32;color:#fff;border:0;border-radius:7px;padding:13px 20px;font:inherit;cursor:pointer}button:disabled{opacity:.5;cursor:wait}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:22px;margin:32px 0}.card{background:white;border-radius:12px;padding:20px;border:1px solid #dae0e6}.placeholder{height:145px;background:#e5ebef;display:grid;place-items:center;border-radius:8px;color:#637889}.card h3{line-height:1.4;font-size:17px}.free{color:#198062}section{margin:30px 0;padding:24px;background:white;border-radius:12px}pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:450px;overflow:auto;font-size:13px}footer{margin-top:50px;color:#637889;font-size:14px}#message{position:sticky;bottom:10px;background:#142d43;color:white;border-radius:10px;padding:18px}#message:empty{display:none}.row{padding:12px;border-bottom:1px solid #e5ebef;display:flex;align-items:center;gap:12px}.row span{flex:1}textarea{min-height:70px}[hidden]{display:none!important}@media(max-width:600px){header span{display:none}main{padding:24px 16px}form{align-items:stretch;flex-direction:column}label{width:100%}.row{align-items:start;flex-direction:column}}

.table-scroll{overflow:auto;max-height:65vh;margin:18px 0}.availability-table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:13px}.availability-table th,.availability-table td{padding:12px;border-bottom:1px solid #c6d2dc;border-right:1px solid #c6d2dc;max-width:190px;min-width:115px;overflow-wrap:anywhere}.availability-table thead th{position:sticky;top:0;background:#142d43;color:white;z-index:2}.availability-table tbody th{position:sticky;left:0;background:white;z-index:1}.availability-table thead th:first-child{left:0;z-index:3}.availability-table td:nth-child(2){min-width:230px;background:#f5f7f9}.table-side{background:transparent;color:#142d43;padding:0;text-align:left;font-size:13px;text-decoration:underline}.status-legend{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}.status-legend span{padding:8px 12px;border:1px solid #c6d2dc;border-radius:5px}.status-free{background:#99ccff;color:#163b5d}.status-reserved{background:#fff1a3;color:#594500}.status-occupied{background:white;color:#263b4d}.status-paid{background:#b9e4b4;color:#194422}.status-unknown{background:#e3e7ea;color:#3d4d59}

#selected-list{margin-bottom:20px}#download-xlsx,#clear-selection{margin:0 10px 18px 0}#selection-period{font-weight:600}button[aria-pressed="true"]{background:#198062}#basket form{margin-top:12px}

/* Work 2: compact desktop tables and stacked cards on narrow screens. */
#workspace-tabs,.crm-nav,.crm-tabs,.crm-shortcuts,.crm-pager{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}.crm-nav button,.crm-tabs button,#workspace-tabs button{background:#e7edf2;color:#142d43;padding:10px 14px}.crm-nav button[aria-pressed=true],.crm-tabs button[aria-pressed=true]{background:#142d43;color:white}.crm-body{min-height:320px}.crm-form{gap:12px;padding:16px 0;align-items:end}.crm-form label{flex:1 1 180px;min-width:0}.crm-form input,.crm-form select,.crm-form textarea{width:100%;min-width:0;padding:9px}.crm-form textarea{min-height:90px}.crm-table-wrap{overflow:auto;max-height:65vh;margin:16px 0}.crm-table{width:100%;border-collapse:collapse;font-size:13px}.crm-table th{background:#e7edf2;text-align:left;position:sticky;top:0;z-index:1}.crm-table td,.crm-table th{padding:10px;border-bottom:1px solid #dae0e6;vertical-align:top;overflow-wrap:anywhere;max-width:320px;min-width:95px}.crm-link{background:none;color:#145a88;text-decoration:underline;padding:0;text-align:left;font:inherit}.crm-actions{display:flex;flex-wrap:wrap;gap:6px}.crm-actions button{padding:6px 8px;font-size:12px}.crm-card-title{display:flex;flex-wrap:wrap;gap:16px;align-items:center}.crm-dialog{border:1px solid #bec9d2;border-radius:12px;padding:24px;max-width:760px;width:90vw;max-height:90vh;overflow:auto;color:#172c40}.crm-dialog::backdrop{background:#142d4380}#crm-root details{border-top:1px solid #dae0e6;padding:14px 0}#crm-root summary{cursor:pointer;font-weight:600}.crm-form fieldset{width:100%;display:flex;flex-wrap:wrap;gap:16px;border:1px solid #dae0e6}.crm-form fieldset input[type=checkbox]{width:auto}#crm-root pre{max-width:600px}.crm-pager{align-items:center}#crm-root h2{font-size:23px}
@media(max-width:700px){#crm-root .crm-table thead{display:none}#crm-root .crm-table,#crm-root .crm-table tbody,#crm-root .crm-table tr,#crm-root .crm-table td{display:block;width:100%;max-width:none}#crm-root .crm-table tr{border:1px solid #dae0e6;border-radius:8px;margin:12px 0;padding:8px}#crm-root .crm-table td{display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px;padding:7px;min-width:0}#crm-root .crm-table td::before{content:attr(data-label);color:#637889}#crm-root .crm-table-wrap{max-height:none}.crm-form label{flex-basis:auto}.crm-dialog .crm-form{display:block}.crm-dialog label{margin-bottom:14px}.crm-nav button,.crm-tabs button{font-size:13px;flex:1}.crm-shortcuts button{font-size:13px;padding:10px}.crm-card-title h2{overflow-wrap:anywhere}}

/* Work 2 manager workspace: one list and one detail pane share the same data. */
.crm-client-count{font-size:13px;color:#52687a;margin:8px 0}.crm-client-layout{display:grid;grid-template-columns:minmax(320px,44%) minmax(0,1fr);gap:18px}.crm-master,.crm-detail{min-width:0}.crm-master{border-right:1px solid #d7e0e7;padding-right:16px}.crm-master .crm-table{table-layout:fixed}.crm-master .crm-table th,.crm-master .crm-table td{padding:7px 5px;min-width:0;font-size:12px}.crm-master .crm-table th:first-child{width:43%}.crm-master small{display:block;color:#637889;font-size:11px;margin-top:5px}.crm-master .crm-table-wrap{height:58vh;max-height:58vh;overflow:auto}.crm-detail{height:78vh;overflow:auto;padding:0 8px}.crm-detail .crm-table-wrap{max-height:48vh}.crm-detail h2{font-size:20px;margin:10px 0}.crm-detail .crm-card-title{gap:8px}.crm-detail .crm-card-title button{font-size:12px;padding:7px}.crm-master .crm-shortcuts button{padding:7px 9px;font-size:12px}.crm-master .crm-form{gap:8px;padding:10px 0}.crm-master .crm-form label{flex:1 1 110px;font-size:12px}.crm-master .crm-form button{padding:9px 12px}.crm-master .crm-form details{width:100%}.crm-filter-fields{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}.crm-master .crm-pager button{padding:8px 12px;font-size:12px}.crm-master h2{font-size:20px!important;margin:10px 0}#crm-root .crm-table tr.crm-planned{background:#d7edff}#crm-root .crm-table tr.crm-planned td{background:#d7edff}.crm-dialog-error{color:#9e2929;white-space:pre-wrap}.crm-dialog-error:empty{display:none}
@media(max-width:999px){.crm-client-layout{display:block}.crm-master{border:0;padding:0}.crm-detail{display:none;height:auto;overflow:visible;padding:0}.crm-client-layout.client-selected>.crm-master{display:none}.crm-client-layout.client-selected>.crm-detail{display:block}.crm-master .crm-table-wrap{height:auto;max-height:none}.crm-detail .crm-table-wrap{max-height:none}}
@media(min-width:1000px){#admin{padding:16px}#admin>h2{font-size:20px;margin:0 0 8px}#workspace>#employee{display:inline-block;margin:8px 16px 8px 0}#workspace>#logout{padding:7px 12px}#workspace-tabs,.crm-nav{margin:9px 0}.crm-detail{height:max(400px,calc(100vh - 330px))}.crm-master .crm-table-wrap{height:max(220px,calc(100vh - 590px));max-height:none}}

/* Status notice has no controls; do not intercept mobile taps. */
#message { pointer-events: none; }

.catalogue-photo,.photo-card img{max-width:100%;height:160px;object-fit:contain;display:block}.photo-card{padding:16px 0;border-bottom:1px solid #bec9d2}.photo-card input[type=file]{max-width:100%}#photos-panel form{margin:18px 0}#photos-panel a{display:block;margin:10px 0}

header{flex-wrap:wrap;gap:12px}header button{margin-left:0}#staff{margin-left:auto}
/* Work 1: independent screens and compact physical construction cards. */
#catalogue.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.construction-card{min-width:0;border:1px solid #d8e0e6;border-radius:8px;overflow:hidden}.construction-card a{display:block;color:inherit;text-decoration:none}.construction-card h3{font-size:15px;line-height:1.4;margin:10px;overflow-wrap:anywhere}.construction-card small{display:block;margin:10px;color:#596f80}.construction-card .catalogue-photo,.construction-card .placeholder{width:100%;height:165px;object-fit:cover;margin:0}.construction-card .placeholder{display:grid;place-items:center;font-size:13px}.basket-row,.inventory-row,.detail-side{padding:16px 0;border-bottom:1px solid #d4dce3;overflow-wrap:anywhere}.basket-row img,.inventory-thumb{width:140px;height:95px;object-fit:contain}.inventory-row button{margin:5px}.inventory-edit{display:flex;flex-wrap:wrap;gap:12px;align-items:end}.inventory-edit label{flex:1 1 180px}.inventory-edit a{flex-basis:100%}#inventory-panel pre{max-height:360px;overflow:auto}#detail h1{font-size:26px}#basket-open{margin-left:auto}#public-catalogue h1{font-size:30px}#public-catalogue nav{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}#digital{font-weight:bold}#detail .catalogue-photo{height:auto;max-height:320px}#inventory-panel details{padding:10px;border-bottom:1px solid #d4dce3}
@media(max-width:1100px){#catalogue.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){#catalogue.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.construction-card .catalogue-photo,.construction-card .placeholder{height:125px}.construction-card h3{font-size:13px;margin:8px}.construction-card small{font-size:11px;margin:8px}#public-catalogue h1{font-size:24px}header{position:sticky;top:0;z-index:5;background:#142d43}#inventory-panel form{display:flex;flex-wrap:wrap}#inventory-panel input{max-width:100%;min-width:0}}
#advanced-filters{flex-basis:100%;padding:6px 0}#advanced-filters summary{cursor:pointer;font-size:13px;color:#405d73}.filter-extra{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin-top:12px}#staff{padding:7px 10px;font-size:12px}@media(max-width:700px){#filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}#filters>label:first-child{grid-column:1/-1}#filters>button{align-self:end}#advanced-filters{grid-column:1/-1}.filter-extra label{width:100%}#public-catalogue>p{font-size:14px}header{padding:12px 16px}#basket-open{padding:9px 12px;font-size:13px}}
.detail-gallery{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}.detail-gallery a{display:block;max-width:100%}.detail-gallery .catalogue-photo{max-width:100%;object-fit:contain}
/* The existing mobile header hides descriptive spans; the basket counter must remain visible. */
#basket-open #count{display:inline!important;font:inherit;color:inherit}

/* Work 1 location and administration: no fixed header or page-width overflow. */
.location-section {width:100%; max-width:100%; margin-block:1rem}
.construction-map {width:100%; height:360px; border:0; overflow:hidden; background:#f1f4f6}
.construction-map iframe {width:100%;height:100%;border:0}
.inventory-row img {max-width:100%}
.import-preview {width:100%;border-collapse:collapse}
.import-preview td,.import-preview th {padding:.5rem;text-align:left;border-bottom:1px solid #ccd3da;overflow-wrap:anywhere}
.inventory-selection {display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
@media(max-width:600px){.construction-map{height:280px}.inventory-row{min-width:0}.inventory-edit input{max-width:100%;min-width:0}.import-preview{font-size:.85rem}}

/* The location frame and side photographs share the same content width and height. */
#detail .location-section {padding:0}
#detail .detail-gallery a {width:100%}
#detail .detail-gallery .catalogue-photo {width:100%;height:360px;max-height:none;object-fit:contain}
@media(max-width:700px){.construction-map{height:280px}#public-view button,#public-view a{scroll-margin-top:140px}#detail .detail-gallery .catalogue-photo{height:280px}header button{padding:9px 12px;font-size:13px}.import-preview{table-layout:fixed}.import-preview td,.import-preview th{padding:4px;font-size:12px}}

#sync-panel{overflow-wrap:anywhere}#sync-panel details{padding:12px 0;border-bottom:1px solid #dae0e6}#sync-panel summary{cursor:pointer}#sync-panel label{margin:10px 0;max-width:100%}#sync-panel input,#sync-panel select{max-width:100%;min-width:0}#sync-panel button{margin:5px}#sync-panel summary input{margin-right:8px}.freshness-warning{padding:12px;border:1px solid #e6b977;border-radius:6px}#inventory-panel .inventory-edit label{min-width:0}#inventory-panel input,#inventory-panel select{max-width:100%}
/* Work 2: compact shared address/proposal workspaces. */
.proposal-nav,.proposal-filters{display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin:8px 0}.proposal-nav a{padding:6px 10px}.proposal-filters label{max-width:220px}.proposal-table{width:100%;border-collapse:collapse;font-size:12px}.proposal-table th,.proposal-table td{padding:6px 8px;border:1px solid #dae2e9;vertical-align:top}.proposal-table thead{position:sticky;top:0;background:#edf3f7}.proposal-table td:nth-child(3){min-width:170px}.proposal-table input[type=number]{width:110px;padding:5px}.proposal-scroll{max-height:68vh;overflow:auto}.proposal-thumb{width:86px;height:54px;object-fit:cover;display:block}.address-free{background:#d7edff}.address-paid{background:#dff2d6}.address-reserved{background:#fff1a8}.address-unknown{background:#f1ece8}.proposal-editor>label{display:inline-flex;flex-direction:column;max-width:260px;margin:6px}.proposal-editor>label:has(input[type=checkbox]){max-width:none}.proposal-editor details a,#proposals-panel>details a{display:block;margin:8px 0}#proposals-panel button{min-height:34px;padding:6px 10px;font-size:13px}#proposals-panel small{display:block}#proposals-panel details{margin:8px 0}#workspace>button{font-size:13px;padding:6px 10px;margin:3px;min-height:34px}@media(max-width:650px){.proposal-filters{gap:6px}.proposal-filters label{flex:1 1 130px;max-width:none}.proposal-editor>label{display:flex;max-width:none}.proposal-table{font-size:11px}.proposal-table th,.proposal-table td{padding:5px}#workspace-tabs{gap:4px;flex-wrap:wrap}#workspace-tabs button{padding:6px 8px;font-size:12px}.proposal-nav{gap:5px}.proposal-nav button{flex:1 1 140px}}
.proposal-editor{display:block;overflow:visible}.proposal-editor>.proposal-scroll{display:block;width:100%;clear:both}.proposal-editor>button{display:block;margin:12px 0}.proposal-editor>details{display:block;clear:both}.proposal-editor input,.proposal-editor select{max-width:100%;min-width:0}.proposal-editor>label{vertical-align:top}.proposal-filters{min-width:0}.proposal-filters details{width:100%}
#admin{padding:16px;margin-top:16px}#workspace>p{margin:8px 0;font-size:14px}#workspace>#staff-freshness{font-size:12px;color:#586b7b}#workspace-tabs{margin:10px 0}#staff-tools{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0}#staff-tools button{font-size:12px;padding:6px 9px;min-height:32px;margin:0}#proposals-panel{padding:0;margin:14px 0}#message{padding:10px 12px;font-size:13px;max-height:25vh;overflow:auto}@media(max-width:650px){#staff-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}#staff-tools button{white-space:normal;font-size:11px;padding:6px;line-height:1.25;min-width:0}#admin{padding:12px}#admin h2{font-size:20px;margin:10px 0}#workspace-tabs button{font-size:11px;padding:6px 8px}#workspace>#staff-freshness{line-height:1.35}#proposals-panel .proposal-nav a{font-size:12px;padding:4px}#proposals-panel .proposal-filters input,#proposals-panel .proposal-filters select{padding:7px;font-size:13px}#workspace-tabs{gap:4px}}
@media(max-width:650px){#proposals-panel .proposal-filters{flex-direction:row;align-items:end}#proposals-panel .proposal-filters label{width:auto;min-width:0;flex:1 1 130px}#proposals-panel .proposal-filters input,#proposals-panel .proposal-filters select{width:100%;max-width:100%;min-width:0}#proposals-panel .proposal-filters>button{flex:0 0 auto}}
#proposals-panel input[type=checkbox]{width:24px;height:24px;min-width:24px;cursor:pointer}.proposal-total{font-size:18px;font-weight:700}#proposals-panel .proposal-filters textarea{width:100%;min-height:120px}.address-occupied{background:#fff}#proposals-panel .proposal-table th{white-space:normal;min-width:85px}

/* Patch 011: contain wide tables and preview on Android. */
.proposal-editor,.proposal-client,.proposal-preview{min-width:0;max-width:100%;box-sizing:border-box}
.proposal-editor input,.proposal-editor textarea,.proposal-editor select{max-width:100%;box-sizing:border-box}
.proposal-client [role=listbox]{max-height:240px;overflow:auto;display:grid;gap:4px}
.proposal-preview iframe{width:100%;height:70vh;border:1px solid #d8e2e9;display:block}
.column-filter{font-weight:normal;min-width:130px;max-width:230px}
.column-filter>div{max-height:190px;overflow:auto}
.column-filter label{display:flex;gap:6px;align-items:center}
.column-filter input[type=checkbox]{width:24px;min-width:24px;height:24px}
.proposal-scroll{width:100%;max-width:100%;overflow-x:auto}
@media(max-width:700px){.proposal-editor{display:flex;flex-direction:column;gap:8px}.proposal-nav{display:flex;flex-wrap:wrap;gap:6px}.proposal-nav button,.proposal-editor>button{padding:8px 10px;font-size:14px;min-height:40px}.proposal-client{width:100%}}

/* Patch 012: compact navigation, table scrolling stays inside the section. */
.scroll-top{position:fixed;right:max(14px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));width:44px;height:44px;padding:0;border-radius:50%;background:#e96b27;color:white;font-size:25px;z-index:80;box-shadow:0 2px 7px #0003}
.scroll-top[hidden],body:has(dialog[open]) .scroll-top{display:none!important}
.crm-table-wrap,.table-scroll{max-width:100%;overflow:auto}.crm-client-layout>*{min-width:0}.crm-body,.crm-detail,#operations{min-width:0;max-width:100%}#operations .row{flex-wrap:wrap}.availability-table small{display:block;font-size:11px;color:#17344a}
.crm-dialog{max-width:min(95vw,720px);max-height:90dvh;overflow:auto}.crm-dialog p{overflow-wrap:anywhere}.crm-dialog button{margin:4px}
@media(max-width:700px){#operations input,#operations select{max-width:100%;box-sizing:border-box}.crm-dialog .crm-table{display:table}#scroll-top{bottom:22px}}

/* Patch 013: public navigation remains native links. */
header>a,#public-catalogue nav>a,#category-back,#basket-back,.construction-detail>a{display:inline-block;background:#ea6b25;color:white;text-decoration:none;border-radius:9px;padding:.7rem 1rem;cursor:pointer}
.address-frozen .proposal-table{border-collapse:separate;border-spacing:0;--number-width:105px;--address-width:240px}
.address-frozen :is(th,td):nth-child(2),.address-frozen :is(th,td):nth-child(3){position:sticky;background:#fff;z-index:2;box-sizing:border-box;overflow-wrap:anywhere}
.address-frozen :is(th,td):nth-child(2){left:0;min-width:var(--number-width);max-width:var(--number-width);width:var(--number-width)}
.address-frozen :is(th,td):nth-child(3){left:var(--number-width);min-width:var(--address-width);max-width:var(--address-width);width:var(--address-width);box-shadow:3px 0 3px #0002}
.address-frozen thead th:nth-child(2),.address-frozen thead th:nth-child(3){z-index:3;background:#edf4f7}
.address-frozen :is(th,td):nth-child(2) :is(input,select),.address-frozen :is(th,td):nth-child(3) :is(input,select){max-width:100%;min-width:0;box-sizing:border-box}
@media(max-width:600px){.address-frozen .proposal-table{--number-width:82px;--address-width:165px}.address-frozen :is(th,td):nth-child(2),.address-frozen :is(th,td):nth-child(3){font-size:12px;padding:5px}}
/* The annual occupancy table uses the same two identifying columns, without selection checkboxes. */
#year-calendar .availability-table{border-collapse:separate;border-spacing:0;--number-width:105px;--address-width:240px}
#year-calendar :is(th,td):nth-child(1),#year-calendar :is(th,td):nth-child(2){position:sticky;background:#fff;z-index:2;box-sizing:border-box;overflow-wrap:anywhere}
#year-calendar :is(th,td):nth-child(1){left:0;min-width:var(--number-width);max-width:var(--number-width);width:var(--number-width)}
#year-calendar :is(th,td):nth-child(2){left:var(--number-width);min-width:var(--address-width);max-width:var(--address-width);width:var(--address-width);box-shadow:3px 0 3px #0002}
#year-calendar thead th:nth-child(1),#year-calendar thead th:nth-child(2){z-index:3;background:#edf4f7}
@media(max-width:600px){#year-calendar .availability-table{--number-width:82px;--address-width:165px}#year-calendar :is(th,td):nth-child(1),#year-calendar :is(th,td):nth-child(2){font-size:12px;padding:5px}}
.address-frozen th:nth-child(2) .column-filter,.address-frozen th:nth-child(3) .column-filter{min-width:0;max-width:100%}
.address-frozen th:nth-child(2) summary,.address-frozen th:nth-child(3) summary{white-space:normal;overflow-wrap:anywhere}
