:root{font:15px/1.5 Inter,"Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;color:#24322c;background:#f2f5f1;--line:#d8e1d9;--muted:#54665c;--accent:#245741;--soft:#e5f0e7}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;color:#244837;background:white;border:1px solid var(--line);border-radius:7px;padding:.53rem .8rem;min-height:42px;white-space:nowrap;font-weight:650}button:hover{background:var(--soft)}button:disabled{cursor:default;opacity:.55}button.primary{background:var(--accent);border-color:var(--accent);color:white}button.primary:hover{background:#183e2e}button.danger{color:#923f31}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #357457;outline-offset:2px}
.top{display:flex;align-items:center;justify-content:space-between;padding:.8rem clamp(1rem,4vw,3rem);background:#183b2e;color:#fff}.module{color:#e2eee4;font-size:.9rem}
main{max-width:1500px;margin:auto;display:grid;grid-template-columns:265px minmax(0,1fr);gap:1.2rem;padding:1.35rem clamp(.85rem,3vw,2.2rem)}.library,.box{background:white;border:1px solid var(--line);border-radius:10px}.library{padding:1rem;align-self:start}.work{min-width:0}.heading,.actions,.box-head,.group-head{display:flex;align-items:center;justify-content:space-between;gap:.6rem;flex-wrap:wrap}.actions{justify-content:flex-start}.heading h2,.box h2{font-size:1.03rem;margin:0}.search{display:block;margin:.9rem 0}.search span{display:block;font-size:.8rem;color:var(--muted);margin-bottom:.3rem}.list{display:grid;gap:.38rem;max-height:65vh;overflow:auto}.list button{white-space:normal;text-align:left;display:grid;gap:.2rem}.list button[aria-current="true"]{background:var(--soft);border-color:#90ae99}.list small,.subtitle,.muted{color:var(--muted);font-size:.86rem}.notice{display:none;margin-bottom:.65rem;background:#e0eee4;padding:.6rem .8rem;border-radius:7px}.notice:not(:empty){display:block}.notice.error{color:#842d24;background:#f9e9e4}.work-head{display:flex;align-items:flex-end;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin:0 0 .85rem}.work-head h1{margin:0;font-size:clamp(1.45rem,3vw,2.1rem);overflow-wrap:anywhere}.box{padding:1rem;margin-bottom:.85rem}.box-head{margin-bottom:.7rem}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}.field{min-width:0;display:grid;align-content:start;gap:.25rem}.field span{font-size:.81rem;color:var(--muted);font-weight:650}.field.wide{grid-column:1/-1}input,select,textarea{width:100%;min-width:0;min-height:42px;padding:.49rem .55rem;border:1px solid #c5d0c6;background:white;color:#202e24;border-radius:6px}textarea{resize:vertical}.field :disabled{opacity:1;background:#f0f4ef;color:#435549}
.totals{display:grid;grid-template-columns:repeat(3,1fr);gap:.55rem}.totals>div{background:#f0f5ee;border-radius:7px;padding:.62rem}.totals small{display:block;color:var(--muted)}.totals strong{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.totals .last{background:#dbece0;color:#194832}
.group{padding:.85rem 0;border-top:1px solid var(--line)}.group-head .field{flex:1 1 190px}.item{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.5rem;background:#f6f8f5;border-radius:8px;padding:.68rem;margin-top:.5rem}.item .name,.item .spec,.item .note,.item .subtotal{grid-column:span 2}.item .rate{grid-column:span 2}.item .subtotal{align-self:center;font-variant-numeric:tabular-nums}.item button{justify-self:end;grid-column:span 2}.group-foot{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap;margin-top:.65rem}.placeholder{padding:.8rem;color:var(--muted)}
@media(max-width:850px){main{grid-template-columns:1fr}.list{max-height:12rem}.work-head{align-items:flex-start}.library{padding:.8rem}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:490px){.grid{gap:.55rem}.box{padding:.75rem}.totals{grid-template-columns:repeat(2,minmax(0,1fr))}.totals .last{grid-column:1/-1}.item{grid-template-columns:repeat(2,minmax(0,1fr))}.item .rate{grid-column:span 1}.item .subtotal{grid-column:span 1}.item button{grid-column:span 1}.actions button{flex:1}}

.item{grid-template-columns:repeat(4,minmax(0,1fr));gap:.38rem .48rem;padding:.46rem .55rem}
.item .name,.item .spec,.item .note{grid-column:span 2}
.item .rate,.item .subtotal,.item button{grid-column:span 1}
.item input,.group-head input{min-height:32px;padding:.28rem .4rem;font-size:.9rem}
.item .field{gap:.12rem}.item .field span{font-size:.73rem}
.item .item-delete{align-self:end;min-height:32px;min-width:32px;padding:0}
.group{padding:.62rem 0}.group-foot{margin-top:.42rem}
@media(min-width:1180px){
  .item{grid-template-columns:minmax(5rem,1.5fr) minmax(4rem,1fr) 2.8rem 3.5rem repeat(3,minmax(4.8rem,1fr)) minmax(4rem,1fr) minmax(4.8rem,1fr) 2rem;align-items:end}
  .item .name,.item .spec,.item .note{grid-column:span 1}
}
@media(max-width:490px){
  .item{grid-template-columns:repeat(2,minmax(0,1fr))}
  .item input{min-height:38px}
  .item .item-delete{min-height:38px;min-width:38px}
}
#document,.preview-toolbar{display:none}
.previewing main{display:none}
.previewing .preview-toolbar{display:flex;justify-content:space-between;gap:.6rem;max-width:297mm;margin:.85rem auto 0;padding:0 .85rem}
.previewing #document{display:block;overflow-x:auto;padding:.85rem}
.paper{color:#202622;font:9pt/1.35 Inter,"Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif}
.previewing .paper{background:#fff;width:297mm;min-height:210mm;padding:10mm 11mm;border:1px solid #dfe6de;margin:0 auto .85rem;box-shadow:0 2px 10px #233c2815}
@media screen and (max-width:1024px){
  .document-preview-page.previewing > .top,.document-preview-page.previewing > .project-context{display:none}
  .document-preview-page.previewing #document{padding:.6rem;touch-action:pan-x pan-y}
}
.paper h1{font-size:23pt;margin:0 0 2mm}.paper h2{font-size:14pt;margin:0}.paper h3{font-size:9pt;margin:3mm 0 1mm}
.paper p{margin:1.5mm 0}.print-reference{color:#435249}
.print-note{white-space:pre-wrap;overflow-wrap:anywhere}
.print-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:5mm;margin-bottom:2mm}
.print-section-head span{overflow-wrap:anywhere;min-width:0}
.print-table{width:100%;border-collapse:collapse;table-layout:fixed;margin:0 0 3mm}
.print-table th,.print-table td{border:1px solid #a0ada4;padding:.82mm 1.45mm;text-align:left;overflow-wrap:anywhere}
.print-table th{background:#edf2ed;font-weight:700;text-align:center}
.print-table .num{text-align:right;font-variant-numeric:tabular-nums}
.cover-totals{max-width:142mm;margin:3mm 0}.cover-totals td{padding:1.4mm 2mm}
.print-total td{background:#e3ede5;font-weight:750}
.summary-index{width:8%}.summary-name{width:28%}
.summary-table td:first-child,.detail-table td:nth-child(3){text-align:center}
.summary-table th,.summary-table td{padding-block:var(--summary-row-padding,1.6mm)}
.project-context{margin:1rem auto;padding:1rem;background:#fff;border:1px solid #e0e5eb;border-radius:12px;max-width:1600px;min-width:0}
.project-context-heading{display:flex;justify-content:space-between;gap:1rem;align-items:start}
.project-context-heading h2{margin:.3rem 0;font-size:1.3rem;overflow-wrap:anywhere}
.project-context-heading p{margin:.4rem 0;color:#607080;font-size:.9rem;overflow-wrap:anywhere}
.project-context-heading>a{white-space:nowrap;font-size:.85rem}
.project-tabs{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.8rem}
.project-tabs>a,.project-tabs>span{padding:.6rem .8rem;border-radius:6px;text-decoration:none;font-size:.9rem}
.project-tabs>a{color:#334155;background:#f3f5f7}
.project-tabs>a[aria-current="page"]{background:#253b53;color:white}
.project-tabs>span{color:#84909c;background:#f7f8fa}
.project-stage-hint{font-size:.85rem;color:#667587;margin:.8rem 0 0}
.projects-page main{display:block;max-width:1500px}
.project-focused[data-project-module="contracts"] main,.project-focused[data-project-module="collections"] main{grid-template-columns:minmax(0,1fr)}
.project-focused[data-project-module="contracts"] main>.library,.project-focused[data-project-module="collections"] main>.library,
.project-focused [data-project-selector]{display:none!important}
.projects-page .heading h1{font-size:1.5rem;margin:0}
.projects-overview #project-library{padding:1.25rem}
.projects-overview #projects-list{display:block;max-height:none;overflow:visible}
.project-list-group{margin:1.5rem 0}
.project-list-group>h2{font-size:1.05rem;margin:0 0 .8rem}
.project-list-group>h2>span{font-size:.85rem;color:#718096;margin-left:.4rem;font-weight:400}
.project-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}
.project-cards>button{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;padding:1rem;white-space:normal;text-align:left;min-width:0;overflow-wrap:anywhere}
.project-cards>button>strong{font-size:1.05rem}
.project-cards>button>small,.project-card-address{font-size:.85rem;color:#64748b;font-weight:400}
.projects-detail .project-context{margin-top:0}
.project-context-heading>button{font-size:.85rem;font-weight:400;flex-shrink:0}
.project-switch-dialog{width:min(600px,calc(100vw - 2rem));max-height:85dvh;padding:1.2rem;border:1px solid #dce2e8;border-radius:12px;color:#24322c}
.project-switch-dialog::backdrop{background:#16293c70}
.project-switch-dialog h2{font-size:1.2rem;margin:0}
.project-switch-list{max-height:55dvh;overflow-y:auto;margin-bottom:1rem}
.project-switch-list h3{font-size:.9rem;color:#64748b;margin:1rem 0 .5rem}
.project-switch-list a{display:grid;gap:.2rem;padding:.8rem;margin:.3rem 0;border:1px solid #e1e6ec;border-radius:7px;text-decoration:none;color:#253b53;overflow-wrap:anywhere}
.project-switch-list a:hover{background:#f1f5f9}
.project-switch-list small{color:#64748b}
@media(max-width:1000px){.project-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.project-cards{grid-template-columns:1fr}.projects-overview #project-library{padding:.85rem}.project-switch-dialog{padding:.85rem}}
body>.project-context{width:calc(100% - 2 * clamp(.85rem,3vw,2.2rem));max-width:calc(1500px - 2 * clamp(.85rem,3vw,2.2rem));margin:1rem auto}
.projects-detail #project-form>.project-context{width:100%;max-width:none;margin-inline:0}
.project-focused[data-project-module="estimates"] main{grid-template-columns:minmax(0,1fr)}
.project-focused[data-project-module="estimates"] #list{grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));max-height:none}
@media(max-width:600px){.project-context{padding:.8rem}.project-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.project-tabs>a,.project-tabs>span{text-align:center;padding:.65rem .25rem;font-size:.82rem}.project-context-heading{gap:.5rem}}
@media print{body>.project-context{display:none!important}}
.contract-payment-terms th:last-child,.contract-payment-terms td:last-child{text-align:right}
.detail-table{font-size:9pt;line-height:1.4;margin-bottom:4mm;break-inside:avoid;page-break-inside:avoid}
.detail-table th,.detail-table td{padding:.9mm .8mm}
.detail-table .detail-title th{text-align:left;background:#dce9df;font-size:9pt}
.detail-columns{font-size:9pt;line-height:1.4;margin-bottom:0;break-after:avoid;page-break-after:avoid}
.detail-columns th{padding:.9mm .8mm}
.detail-name{width:15%}.detail-spec{width:11%}.detail-unit{width:4%}.detail-qty{width:5%}
.detail-cost{width:7.2%}.detail-total{width:9%}.detail-note{width:12.8%}
@page{size:A4 landscape;margin:9mm 10mm}
/* Page padding keeps document spacing without reserving room for browser metadata. */
@page estimate-document{size:A4 landscape;margin:10mm}
@media print{
  html,body{background:#fff;margin:0}
  body > .top,main,.preview-toolbar,.previewing .preview-toolbar{display:none}
  #document,.previewing #document{display:block;overflow:visible;padding:0}
  .paper,.previewing .paper{width:auto;min-height:0;padding:0;margin:0;border:0;box-shadow:none;print-color-adjust:exact;-webkit-print-color-adjust:exact}
  .print-summary,.print-details{break-before:page}
  .print-section-head,thead{break-after:avoid}
  thead{display:table-header-group}
  tr{break-inside:avoid}
}

.cover-heading{display:flex;align-items:baseline;justify-content:space-between;gap:6mm;border-bottom:2px solid #274f3a;padding-bottom:3mm}
.cover-heading h1{margin:0}
.cover-label{display:block;color:#54685a;font-size:8pt;margin-bottom:1.5mm}
.cover-project h2{font-size:16pt}
.cover-stamp{display:block;width:13mm;height:13mm;object-fit:contain}
.cover-company .print-note{line-height:1.55}
.cover-totals{max-width:none}
.cover-heading{align-items:center}
.cover-logo{position:relative;display:block;flex:0 0 32mm;height:13mm;overflow:hidden}
.cover-logo img{position:absolute;display:block;width:43mm;max-width:none;left:50%;top:50%;transform:translate(-50%,-50%)}

.module{display:flex;gap:.8rem;flex-wrap:wrap}.module a{color:inherit;text-decoration:none;padding:.2rem 0}.module a[aria-current="page"]{border-bottom:2px solid #cbe4d6}
a.button{display:inline-flex;align-items:center;min-height:42px;border-radius:7px;padding:.53rem .8rem;text-decoration:none;font-weight:650}
a.button.primary{background:var(--accent);color:white}a.button.primary:hover{background:#183e2e}
.contract-create{align-items:end}.contract-create .field{flex:1 1 245px}
.contract-stage{display:grid;grid-template-columns:1fr 1fr minmax(6rem,.8fr) 1fr auto;gap:.65rem;align-items:end;padding:.6rem 0;border-bottom:1px solid var(--line)}
.contract-warning{color:#8d3c33}.contract-page .library h2{margin-bottom:.5rem}
.contract-paper .print-table td{vertical-align:top}
.contract-paper .print-table{font-size:8pt}
.contract-paper h2{margin:3mm 0 1.5mm}
.previewing .contract-paper{width:210mm;min-height:297mm;border:0;outline:1px solid #dfe6de}
@media(max-width:650px){.contract-stage{grid-template-columns:repeat(2,minmax(0,1fr))}.contract-stage button{justify-self:start}}
@page contract{size:A4 portrait;margin:10mm 11mm}
@media print{
  .contract-paper,.previewing .contract-paper{page:contract;width:188mm;max-width:none;min-height:0;box-sizing:border-box;outline:0;zoom:1!important;transform:none!important;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  .contract-section{break-before:page}
}

.contract-parties{display:grid;grid-template-columns:1fr;gap:2.2mm;margin-top:3mm}
.contract-party{position:relative;border:1px solid #a0ada4;padding:1.6mm 3mm;break-inside:avoid}
.contract-party h3{font-size:9pt;margin:0 0 .9mm}
.contract-party dl{display:grid;grid-template-columns:30mm minmax(0,1fr);gap:.45mm 2mm;margin:0 13mm 0 0;font-size:8pt}
.contract-party dt,.contract-party dd{margin:0;overflow-wrap:anywhere}
.contract-party-seal{position:absolute;right:4mm;bottom:2mm}
.contract-clauses .contract-clause{font-size:10pt;line-height:1.58;margin:0 0 3.5mm;orphans:2;widows:2}
.contract-bank-section{break-inside:avoid}
.contract-bank-print{display:grid;grid-template-columns:1fr 1.3fr 1.1fr;gap:2mm;margin:0 0 3mm;padding:1.5mm 2mm;
  border:1px solid #aebbc8;background:var(--doc-tint,#f3f6fa);font-size:8pt}
.contract-bank-print>div{display:flex;gap:1.5mm;align-items:baseline;min-width:0}
.contract-bank-print dt{white-space:nowrap;color:#4e5e70}
.contract-bank-print dd{margin:0;font-weight:700;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.contract-cover{font-size:10pt;line-height:1.3}
.contract-cover .print-table,.contract-cover .contract-bank-print,
.contract-cover .contract-party h3,.contract-cover .contract-party dl{font-size:10pt}
.contract-cover .print-table th,.contract-cover .print-table td{padding:.6mm 1.45mm}

.contract-bankbook img{display:block;width:auto;height:auto;max-width:100%;max-height:248mm;margin:4mm auto 0;object-fit:contain}
@media print{.contract-bankbook img{break-inside:avoid}}
.collection-scroll{overflow-x:auto}.collection-scroll .print-table{min-width:500px;margin-bottom:0}

.schedule-main{display:block}.schedule-main h1{margin:0;font-size:1.5rem}
.schedule-tools{display:flex;justify-content:space-between;gap:.8rem;flex-wrap:wrap;align-items:end}
.schedule-tools .field{min-width:min(100%,230px)}
.schedule-instruction{margin:.7rem 0}
.schedule-scroll{overflow-x:auto}
.calendar-header,.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));min-width:665px}
.calendar-header{color:var(--muted);font-size:.85rem;text-align:center;padding:.4rem;background:var(--soft)}
.calendar-grid{border-left:1px solid var(--line);border-top:1px solid var(--line);user-select:none}
.calendar-day{min-height:104px;min-width:0;padding:.32rem;display:flex;flex-direction:column;align-items:stretch;gap:.24rem;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.calendar-day.outside{background:#f3f6f2}.calendar-day.is-today .calendar-date{background:var(--accent);color:white}
.calendar-day.selected-range{background:#d9eee0}
.calendar-date{align-self:flex-start;min-height:31px;min-width:31px;padding:0 .25rem;border-color:transparent}
.calendar-task{display:flex;flex-direction:column;align-items:flex-start;min-height:0;padding:.3rem .38rem;font-size:.75rem;line-height:1.22;text-align:left;white-space:normal;overflow-wrap:anywhere;gap:.1rem;background:#e4efe8;color:#203c2e}
.calendar-task small{font-size:.69rem;color:var(--muted)}
.schedule-list{margin-top:.9rem}.schedule-list h2{margin-bottom:.4rem}
#schedule-list{display:grid;gap:.4rem}
.schedule-row{display:grid;grid-template-columns:1fr 1.2fr 1fr auto;align-items:center;gap:.5rem;text-align:left;white-space:normal;overflow-wrap:anywhere}
#task-dialog{width:min(calc(100% - 1.4rem),690px);max-height:92vh;padding:1rem;border:1px solid var(--line);border-radius:10px;color:inherit}
#task-dialog h2{margin:0;font-size:1.2rem}#task-dialog::backdrop{background:#182f2570}
@media(max-width:650px){.schedule-row{grid-template-columns:1fr 1fr}.schedule-row span{font-size:.84rem}}

.schedule-move{background:#dcefe3;padding:.65rem;margin:.55rem 0;border-radius:6px}
.schedule-move[hidden],#start-move[hidden]{display:none}
.calendar-grid.is-moving .calendar-day{cursor:crosshair}.calendar-grid.is-moving .calendar-day:hover{background:#e9f4ec}
.calendar-task.task-moving{outline:2px solid #193b2d;outline-offset:1px}
.calendar-task.task-cancelled{opacity:.66;text-decoration:line-through}
.calendar-task,.schedule-print-task,.schedule-title{background:var(--work-fill,#e4efe8);border-left:3px solid var(--work-ink,#3a7456)}
.schedule-title{border-radius:4px;padding:.2rem .35rem}
.work-color-0{--work-fill:#deeee5;--work-ink:#307653}
.work-color-1{--work-fill:#f8e3d5;--work-ink:#b8582a}
.work-color-2{--work-fill:#e1ecff;--work-ink:#3e66ad}
.work-color-3{--work-fill:#f3e5ff;--work-ink:#8151aa}
.work-color-4{--work-fill:#fff2cd;--work-ink:#9d680e}
.work-color-5{--work-fill:#fae0ec;--work-ink:#a84573}
.work-color-6{--work-fill:#ddf2f0;--work-ink:#26796f}
.work-color-7{--work-fill:#ebefd9;--work-ink:#697b27}
.work-color-8{--work-fill:#f6dfde;--work-ink:#ac4d48}
.work-color-9{--work-fill:#e7ecf4;--work-ink:#465d80}
.work-color-10{--work-fill:#ede2ec;--work-ink:#8c507b}
.work-color-11{--work-fill:#edf3d9;--work-ink:#72882b}
.work-color-12{--work-fill:#f0e5d8;--work-ink:#856639}
.work-color-13{--work-fill:#e0e8fc;--work-ink:#5a56a2}
.work-color-14{--work-fill:#dcedf5;--work-ink:#37718d}
.work-color-15{--work-fill:#f5e8e3;--work-ink:#9e584d}
.schedule-print-calendar td{height:22mm;vertical-align:top}.schedule-print-calendar .schedule-print-outside{background:#f3f5f2}
.schedule-print-task{display:block;margin-top:1mm;padding:.42mm 1mm;font-size:9pt;line-height:1.35}
@page schedule-sheet{size:A4 landscape;margin:9mm 10mm}
@media print{
  .schedule-main{display:none}
  .schedule-paper{page:schedule-sheet}
  .schedule-paper h1{font-size:18pt}
  .schedule-paper p{margin:1mm 0 3mm}
}
.vendor-matches[hidden]{display:none}
.vendor-options{display:flex;gap:.35rem;flex-wrap:wrap;max-height:10rem;overflow:auto}
.vendor-options button{white-space:normal;text-align:left;max-width:100%;overflow-wrap:anywhere}
.vendor-options small{display:block;color:var(--muted);font-weight:400}

#schedule-print-dialog{width:min(calc(100% - 1.4rem),520px);padding:1rem;border:1px solid var(--line);border-radius:10px;color:inherit}
#schedule-print-dialog h2{margin:0;font-size:1.2rem}
#schedule-print-dialog::backdrop{background:#182f2570}
#week-date-field[hidden]{display:none}
.schedule-paper-week .schedule-print-calendar td{height:75mm}
@media print{#schedule-print-dialog{display:none}}

.previewing .schedule-print-toolbar{display:block;max-width:none;background:#fff;margin:0;padding:.55rem 1rem;border-bottom:1px solid var(--line)}
.print-toolbar-fields{display:flex;align-items:end;gap:.45rem;flex-wrap:wrap}
.print-toolbar-fields [hidden]{display:none}
.print-toolbar-fields button,.print-toolbar-fields input,.print-toolbar-fields select{min-height:33px;padding:.28rem .42rem}
.print-segment{display:flex;padding:0;margin:0;border:0;gap:2px}
.print-segment legend{padding:0;color:var(--muted);font-size:.8rem}
.print-segment label{position:relative}
.print-segment input{position:absolute;width:1px;height:1px;opacity:0}
.print-segment span{display:block;padding:.34rem .52rem;border:1px solid var(--line);border-radius:4px;cursor:pointer;white-space:nowrap}
.print-segment input:checked+span{background:#162238;border-color:#162238;color:white}
.print-segment input:focus-visible+span{outline:2px solid #466bad}
.print-segment input:disabled+span{opacity:.45;cursor:default}
.print-tag{display:flex;align-items:center;gap:.3rem;min-height:33px;white-space:nowrap}
.print-tag input{width:auto;min-height:0}
.print-range-separator{align-self:end;padding:.25rem 0}
.schedule-print-toolbar p{margin:.25rem 0 0}
.schedule-sheet-heading{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:5mm;border-bottom:1.5pt solid #162238;padding-bottom:2.5mm;margin-bottom:2.5mm;color:#162238}
.schedule-sheet-logo{display:block;width:24mm;height:auto;max-height:10.5mm;object-fit:contain}
.schedule-sheet-heading h1{margin:0;font-size:19pt}
.schedule-sheet-heading>div{text-align:right;font-size:8pt;color:#475569;overflow-wrap:anywhere}
.schedule-sheet-heading>div span{display:block}
.schedule-print-calendar th{background:#edf1f7;color:#162238}
.schedule-print-calendar th:first-child,.schedule-print-calendar td:first-child>strong{color:#a32b2b}
.schedule-print-calendar th:last-child,.schedule-print-calendar td:last-child>strong{color:#284f91}
.schedule-print-calendar .schedule-print-outside>strong{opacity:.4}
.schedule-print-calendar td{height:17mm}
.schedule-print-calendar.print-compact{height:auto}
.schedule-print-calendar.schedule-weeks-1{--schedule-row-height:40mm}
.schedule-print-calendar.schedule-weeks-2{--schedule-row-height:40mm}
.schedule-print-calendar.schedule-weeks-3{--schedule-row-height:40mm}
.schedule-print-calendar.schedule-weeks-4{--schedule-row-height:40.0mm}
.schedule-print-calendar.schedule-weeks-5{--schedule-row-height:32.0mm}
.schedule-print-calendar.schedule-weeks-6{--schedule-row-height:26.666666666666668mm}
.schedule-print-calendar.print-compact td{height:var(--schedule-row-height)}

.schedule-gantt{font-size:7pt}
.schedule-gantt th{background:#162238;color:#fff;padding:.7mm .12mm;overflow-wrap:normal;line-height:1.15}
.schedule-gantt td{padding:.33mm .25mm;text-align:center;height:4.7mm}
.schedule-gantt .gantt-name{text-align:left}
.gantt-index{width:8mm}.gantt-task{width:35mm}.gantt-vendor{width:29mm}.gantt-days{width:9mm}
.schedule-gantt td.gantt-weekend{background:#edf1f7}
.gantt-bar{display:block;height:2.4mm;border-radius:2mm;background:var(--work-ink,#307653);opacity:.78}
@media print{
  .previewing .schedule-print-toolbar{display:none}
  .schedule-paper+.schedule-paper{break-before:page}
}

.schedule-extra-dialog{width:min(calc(100% - 1.4rem),760px);max-height:90vh;overflow:auto;padding:1rem;border:1px solid var(--line);border-radius:10px;color:inherit}
.schedule-extra-dialog::backdrop{background:#182f2570}
.schedule-extra-dialog h2{margin:0;font-size:1.16rem}
.schedule-tools .schedule-jump{min-width:0;flex:0 1 145px}
.schedule-tools>.actions{align-items:end}
.share-tasks{display:grid;gap:.3rem;margin:.4rem 0;max-height:190px;overflow:auto}
.share-tasks label,.share-inclusions label,.share-check{display:flex;align-items:center;gap:.4rem}
.share-tasks label{padding:.35rem .5rem;background:#f5f8f5;border-radius:5px}
.share-tasks label small{display:block;color:var(--muted)}
.share-tasks input,.share-inclusions input,.share-check input{width:auto;min-height:0}
.share-inclusions{margin:.55rem 0}
@media print{.schedule-extra-dialog{display:none}}

:root{
  --brand-blue:#3560ac;--brand-pink:#d9275f;--brand-teal:#129083;--brand-orange:#ea582b;
  --accent:var(--brand-blue);--soft:color-mix(in srgb,var(--brand-blue) 9%,white);
  --line:#d6dfe9;--muted:#4e5e70;background:#f3f6fa;color:#182638
}
@media screen{
  .top{background:#192c4b;display:grid;grid-template-columns:auto minmax(0,1fr);gap:.4rem 1rem}
  .top>.module{grid-area:1/2;justify-content:flex-end}
  .top>.header-logo{grid-area:1/1;justify-self:start;display:block;padding:.35rem 0}
  .header-logo img{display:block;width:clamp(4.875rem,7vw,6.375rem);height:auto}
  .header-logo:focus-visible{outline:2px solid var(--brand-orange);outline-offset:3px}
}
@media screen and (max-width:720px){
  .top>.module{grid-area:2/1/3/3;justify-content:flex-start;gap:.2rem .65rem}
  .top>.module a,.top>.module button{display:inline-flex;align-items:center;min-height:40px}
  .field :is(input:not([type="checkbox"],[type="radio"]),select,textarea){min-width:0;max-width:100%}
}
@media screen and (max-width:720px) and (pointer:coarse){
  .field :is(input:not([type="checkbox"],[type="radio"]),select,textarea),
  .finance-controls :is(input,select){font-size:16px}
}
.module{color:#e6edf8}


.module a[aria-current="page"]{border-color:var(--brand-orange)}
button{color:#26405f}
button.primary:hover,a.button.primary:hover{background:#254782}
:where(a,button,input,textarea,select):focus-visible{outline-color:var(--brand-blue)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline-color:var(--brand-blue)}
.list button[aria-current="true"]{border-color:var(--brand-blue)}
.totals>div{background:var(--soft)}
.totals .last,.notice:not(.error){background:color-mix(in srgb,var(--brand-teal) 12%,white);color:#17574f}
.notice.error{border-left:3px solid var(--brand-pink)}
.field input[type="color"]{width:min(100%,11rem);padding:.24rem .34rem}
.brand-paper{--doc:var(--document-accent,var(--brand-blue));--doc-ink:var(--document-accent-ink,white);
  --doc-tint:color-mix(in srgb,var(--doc) 10%,white);color:#172435}
.brand-paper .cover-heading,.brand-paper .print-section-head{border-bottom:1.5pt solid var(--doc);padding-bottom:2.5mm}
.brand-paper .cover-heading{border-left:4mm solid var(--doc);padding-left:4mm;margin-bottom:4mm}
.brand-paper .cover-logo{height:13mm;flex-basis:33mm}
.brand-paper .cover-logo img{position:static;transform:none;width:100%;height:100%;object-fit:contain}
.brand-paper .print-table th{background:var(--doc);color:var(--doc-ink);border-color:#9eacbb}
.brand-paper .print-table td{border-color:#aebbc8}
.brand-paper .print-table tbody tr:nth-child(even):not(.print-total){background:#f6f8fc}
.brand-paper.print-summary .print-table tbody tr:not(.print-total),
.brand-paper.print-details .print-table tbody tr:not(.print-total){background:transparent}
.brand-paper .print-table .print-total td,.brand-paper .detail-table .detail-title th{background:var(--doc-tint);color:#162338}
.brand-paper .cover-layout{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);gap:9mm;margin:6mm 0}
.brand-paper .cover-company .print-note{margin-top:1mm}
.brand-paper .cover-label{color:#4f6074}
.brand-paper .document-amount{display:grid;gap:1mm;background:var(--doc);color:var(--doc-ink);padding:3mm 4mm}
.brand-paper .document-amount strong{font-size:23pt;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.brand-paper .cover-totals{margin:0}
.brand-paper .contract-amount-bar{display:grid;grid-template-columns:1fr 1fr;gap:2mm;margin-bottom:3mm;break-inside:avoid}
.brand-paper .contract-amount-bar>.document-amount{padding:2mm 3mm}
.brand-paper .contract-amount-bar .document-amount strong{font-size:15pt}
.brand-paper .contract-amount-bar>div:last-child{display:grid;align-content:center;background:var(--doc-tint);padding:2mm 3mm}
.brand-paper .contract-party,.brand-paper .contract-clause{border-left:2pt solid var(--doc);padding-left:3mm}
.brand-paper.contract-section>h2{border-bottom:1.5pt solid var(--doc);padding-bottom:1.5mm;break-after:avoid}
@media print{:root{background:#fff}}

.contract-attachment{font-size:10pt}
.contract-attachment h3{font-size:10pt;break-after:avoid}
.contract-attachment .contract-attachment-items,.contract-attachment .contract-attachment-totals{font-size:10pt}
.contract-attachment .contract-attachment-items{table-layout:auto}
.contract-attachment-items .attachment-name{width:30%}
.contract-attachment-items .attachment-spec{width:14%}
.contract-attachment-items .attachment-unit{width:5%}
.contract-attachment-items .attachment-qty{width:6%}
.contract-attachment-items .attachment-amount{width:10.5%}
.contract-attachment-items th,.contract-attachment-items td{padding:.85mm 1.05mm}
.contract-attachment-items td{word-break:keep-all}
.contract-attachment-items td:nth-child(3),.contract-attachment-items td:nth-child(4){text-align:center}
.contract-attachment-totals td:first-child{width:65%}

.contract-watermark{display:none}
@media print{
  .contract-watermark{display:block;position:fixed;top:50%;left:50%;width:42mm;height:auto;
    transform:translate(-50%,-50%);opacity:.08;z-index:5;pointer-events:none}
}

.contract-special{margin:2.5mm 0;padding:2mm 3mm;border:1px solid var(--doc,#3560ac);
  border-left-width:2pt;background:var(--doc-tint,#f3f6fa)}
.contract-special h2{margin:0 0 1mm;font-size:11pt;break-after:avoid}
.contract-special .print-note{margin:0;orphans:2;widows:2}

.contract-cover .cover-heading{margin-bottom:2.5mm;padding-bottom:1.7mm}
.contract-cover .contract-amount-bar{margin-bottom:2mm}
.contract-cover .print-table,.contract-cover .contract-bank-print{margin-bottom:2mm}
.contract-cover>h2,.contract-cover .contract-bank-section>h2{margin:2mm 0 1mm}
.contract-cover .contract-parties{margin-top:1.6mm;gap:1.6mm}
@media print{
  .contract-signoff,.contract-signoff .contract-parties{
    page-break-inside:avoid;break-inside:avoid-page}
}

.contract-project-agreements{margin-bottom:3mm;font-size:10pt}
.contract-project-agreements h3{break-after:avoid;font-size:10pt}
.contract-project-agreements dl{margin:0}
.contract-project-agreements dl>div{break-inside:avoid;padding:1.2mm 2mm;border-bottom:1px solid #d6dfe9}
.contract-project-agreements dt{font-weight:700}
.contract-project-agreements dd{margin:.6mm 0 0}

.print-cover{display:flex;flex-direction:column;font-size:10pt;line-height:1.45}
.print-cover .cover-heading{margin-bottom:0;padding:1.5mm 0 1.3mm 4mm}
.print-cover .cover-heading .print-reference{margin:1mm 0 0}
.print-cover .cover-heading h1{font-size:24pt;letter-spacing:-.03em}
.print-cover .print-reference,.print-cover .cover-label{font-size:10pt}
.print-cover .cover-layout{flex:1;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);grid-template-rows:auto 1fr;gap:4mm 8mm;margin:5mm 0}
.print-cover .cover-work,.print-cover .cover-company{min-width:0;overflow-wrap:anywhere}
.print-cover .cover-work{display:grid;grid-column:1;grid-row:1 / span 2;grid-template-rows:subgrid}.print-cover .cover-amount{align-self:start}
.print-cover .cover-project h2{font-size:16pt;line-height:1.28}
.cover-project-fields{display:flex;flex-wrap:wrap;gap:1mm 5mm;margin:2mm 0 0}
.cover-project-fields>div{display:flex;gap:1.3mm;align-items:baseline;min-width:0}
.cover-project-fields dt{color:#4f6074;white-space:nowrap;font-size:10pt}
.cover-project-fields dd{margin:0;font-weight:650}
.print-cover .document-amount{gap:.5mm;padding:2mm 4mm}
.print-cover .document-amount strong{font-size:20pt}
.print-cover .cover-totals th,.print-cover .cover-totals td{padding:2.3mm 3mm}
.print-cover .cover-totals th{width:57%;text-align:left;color:#203953;background:var(--doc-tint)}
.print-cover .cover-company{grid-column:2;grid-row:2;align-self:start;padding:0 4mm;text-align:center}
.print-cover .cover-logo{width:45mm;height:20mm;margin:0 auto 5mm}
.print-cover .cover-logo img{object-position:center top}
.print-cover .cover-company strong{font-size:13pt}
.print-cover .cover-company .print-note{margin:4mm 0 0;line-height:1.8}
.print-cover .cover-company-line{padding-inline:4mm}
.print-cover .cover-signature{display:inline-block;position:relative;max-width:100%}
.print-cover .cover-representative{font-weight:400;font-size:11pt}
.print-cover .cover-stamp{position:absolute;top:50%;left:calc(100% - 4mm);transform:translateY(-50%);
  width:14.5mm;height:14.5mm;mix-blend-mode:multiply;opacity:.82}
.cover-remarks{border:1px solid var(--doc);border-left-width:2pt;background:var(--doc-tint);padding:3.5mm 5mm;min-height:31mm}
.print-cover .cover-remarks h3{font-size:12pt;margin:0 0 1.5mm;color:#203953;break-after:avoid}
.print-cover .cover-remarks p{margin:0;orphans:2;widows:2}
@media print{
  .document-preview-page:not(.contract-page) #document .paper{page:estimate-document}
  .print-cover,.previewing .print-cover{min-height:188mm}
}

.contract-signing form{display:grid;gap:.75rem;justify-items:start}
.contract-signing .field{width:min(100%,30rem)}
.contract-signature-confirm{display:flex;align-items:flex-start;gap:.45rem}
.contract-signature-confirm input{min-height:0;width:auto;margin-top:.3rem}

.calendar-more{display:none}
@media screen and (max-width:720px){
  .schedule-main{padding-inline:0}
  .schedule-main>.box{padding:0;border-inline:0;border-radius:0}
  .schedule-main>.box>:is(.box-head,.schedule-tools,.schedule-instruction,.schedule-list,#schedule-notice){margin-inline:.65rem}
  .schedule-tools>label.field{width:100%;min-width:0}
  .schedule-scroll{margin-inline:0}
  .calendar-header,.calendar-grid{min-width:0}
  .calendar-header{padding-inline:0}
  .calendar-day{min-height:76px;padding:0;gap:1px}
  .calendar-date{min-width:0;min-height:26px;width:100%;text-align:left;font-size:.75rem;font-weight:400}
  .calendar-header span:first-child,.calendar-day:nth-child(7n+1):not(.is-today) .calendar-date{color:#a21c42}
  .calendar-header span:last-child,.calendar-day:nth-child(7n):not(.is-today) .calendar-date{color:var(--brand-blue)}
  .calendar-day.outside .calendar-date{opacity:.65}
  .calendar-task{display:block;padding:.15rem 1px;font-size:.78rem;min-height:23px;overflow:hidden;border:0;border-radius:0}
  .calendar-task strong{display:block;overflow:hidden;white-space:nowrap;font-weight:400}
  .schedule-title{border-left:0;font-weight:400}
  .calendar-task small,.calendar-day:not(.calendar-expanded) .calendar-task-extra{display:none}
  .calendar-more{display:block;padding:0;min-height:23px;font-size:.65rem;font-weight:400;white-space:nowrap}
}

@media screen and (max-width:720px){
  .mobile-stack-table{display:block;min-width:0}
  .mobile-stack-table thead{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
  .mobile-stack-table tbody{display:block}
  .mobile-stack-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .field span,.item .field span{font-size:.86rem}
  .item input,.group-head input{min-height:42px}
  .work-head h1,.box-head h2{overflow-wrap:anywhere}
  .collection-scroll .mobile-stack-table{min-width:0}
  .collection-scroll tr{gap:.4rem .75rem;padding:.65rem;border:1px solid var(--line);border-radius:.5rem;margin-bottom:.4rem}
  .collection-scroll .mobile-stack-table td{padding:0;border:0;font-size:.94rem;background:transparent;white-space:normal}
  .collection-scroll td::before{content:attr(data-mobile-label);display:block;color:var(--muted);font-size:.8rem}
  .collection-stages td:first-child,.collection-receipts td:first-child{font-weight:700}
  .collection-stages td:nth-child(5){font-weight:700;color:#23486b}
  .collection-receipts td:last-child{white-space:pre-wrap}
}
@media screen and (max-width:720px) and (pointer:coarse){
  .auth-login input,.finance-form-grid :is(input,select,textarea),
  .finance dialog textarea,.account-dialog input{font-size:16px}
}

.vendor-import-dialog{width:min(1050px,calc(100% - 1rem));max-width:none;max-height:94svh;overflow:auto;border:1px solid var(--line);border-radius:.6rem;padding:1rem;color:inherit}
.vendor-import-dialog::backdrop{background:#172638a6}
.vendor-import-dialog h2{font-size:1.15rem;margin:0}
.vendor-import-help,.vendor-import-source{font-size:.86rem;color:var(--muted)}
.vendor-import-row{border:1px solid var(--line);border-radius:.4rem;padding:.65rem;margin:.6rem 0}
.vendor-import-choice{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin:.5rem 0}
.vendor-import-choice input[type=checkbox]{width:20px;min-height:20px}
.vendor-import-choice small{color:var(--muted)}
.vendor-import-warning,#vendor-import-error{color:#96500c;font-size:.86rem}
.vendor-import-summary{padding:.7rem;background:var(--soft);border-radius:.4rem;margin:.6rem 0}
.vendor-import-summary h3{margin:0;font-size:1rem}
.vendor-import-summary p{white-space:pre-wrap;font-size:.86rem}
@media screen and (max-width:720px){.vendor-import-dialog input{font-size:16px}}
@media print{.vendor-import-dialog{display:none!important}}
@media screen and (max-width:720px){
  .group-head>.estimate-row-actions{width:100%;min-width:0;flex-wrap:wrap}
  .group-head [data-command="import-vendor"]{flex:1 1 100%;white-space:normal}
}

.project-status-filters{display:flex;gap:.3rem;margin:.7rem 0}
.project-status-filters button{flex:1;min-width:0;padding:.4rem .25rem;font-size:.86rem}
.project-status-filters button[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#fff}
.project-status-filters span{font-variant-numeric:tabular-nums}

/* Collections use the same light rows and status accents as expense management. */
.collections-page .collection-scroll{overflow:visible}
.collections-page .collection-table{min-width:0;table-layout:auto;border-collapse:separate;border-spacing:0;border:1px solid #e0e5ec;border-radius:9px;overflow:hidden;font-size:.9rem}
.collections-page .collection-table th{background:#f3f5f8;color:#526174;font-weight:600;border:0;border-bottom:1px solid #e0e5ec;padding:.75rem .7rem;text-align:left;white-space:nowrap}
.collections-page .collection-table td{border:0;border-bottom:1px solid #edf0f4;padding:.85rem .7rem;vertical-align:middle;line-height:1.5}
.collections-page .collection-table tbody tr:last-child td{border-bottom:0}
.collections-page .collection-table tbody tr:nth-child(even){background:#fafbfc}
.collections-page .collection-money{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.collections-page .collection-stages td:first-child{font-weight:650;color:#253b53}
.collections-page .collection-stages td:nth-child(5){font-weight:650;color:#253b53}
.collection-status{display:inline-block;padding:.3rem .55rem;border-radius:5px;font-size:.82rem;white-space:nowrap;background:#edf2fb;color:#3560ac}
.collection-status[data-state="complete"]{background:#087b70;color:#fff}
.collection-status[data-state="overdue"]{background:#fcebf0;color:#b31b4c}
.collection-status[data-state="partial"]{background:#fff0e8;color:#a33e17}
@media screen and (max-width:720px){
  .collections-page .collection-table{display:block;border:0;background:transparent;overflow:visible}
  .collections-page .collection-table thead{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
  .collections-page .collection-table tbody{display:block}
  .collections-page .collection-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .collections-page .collection-table td{min-width:0}
  .collections-page .collection-table td::before{content:attr(data-mobile-label);display:block;color:var(--muted);font-size:.8rem}
  .collections-page .collection-table td[colspan]{grid-column:1/-1}

  .collections-page .collection-table tbody tr{background:#fff;border:1px solid #e0e5ec;border-radius:9px;padding:.9rem;gap:.65rem .8rem;margin-bottom:.65rem}
  .collections-page .collection-table td{padding:0;border:0;font-size:.9rem;background:transparent;white-space:normal;overflow-wrap:anywhere;text-align:left}
  .collections-page .collection-stages td:first-child{grid-column:1;grid-row:1;align-self:center;font-size:1rem}
  .collections-page .collection-stages td:last-child{grid-column:2;grid-row:1;text-align:right}
  .collections-page .collection-stages td:first-child::before,.collections-page .collection-stages td:last-child::before{display:none}
  .collections-page .collection-stages td:nth-child(2){grid-column:1/-1;grid-row:2;color:#64748b}
  .collections-page .collection-stages td:nth-child(2)::before{display:inline;margin-right:.5rem}
  .collections-page .collection-stages td:nth-child(5){grid-column:1/-1;display:flex;justify-content:space-between;gap:.5rem;border-top:1px solid #edf0f4;padding-top:.65rem}
  .collections-page .collection-receipts td:last-child{grid-column:1/-1}
  .collections-page .collection-status{font-size:.76rem;padding:.3rem .4rem}
}

/* Shared table palette: quiet headers, light row dividers, restrained totals. */
:root{--table-line:#e0e5ec;--table-row:#fafbfc;--table-heading:#f3f5f8;--table-heading-ink:#526174;--table-total:#edf2f8}
@media screen and (min-width:720.01px){
  .finance .finance-table{border-collapse:separate;border-spacing:0;border:1px solid var(--table-line);border-radius:9px;overflow:hidden}
  .finance .finance-table th{background:var(--table-heading);color:var(--table-heading-ink);font-weight:600}
  .finance .finance-table :is(th,td){border:0;border-bottom:1px solid var(--table-line);padding:.75rem .65rem;vertical-align:middle}
  .finance .finance-table tbody tr:last-child>td{border-bottom:0}
  .finance .finance-table tbody tr:nth-child(even):not(.settlement-detail-row)>td{background:var(--table-row)}
  .finance .finance-table .finance-date-row{background:#f3f5f8;color:#526174;font-weight:600}
  .finance .finance-table tfoot :is(th,td){background:var(--table-total);border-top:1px solid var(--table-line);font-weight:650}
  .account-permissions table{border-collapse:separate;border-spacing:0;border:1px solid var(--table-line);border-radius:9px;overflow:hidden}
  .account-permissions table :is(th,td){border:0;border-bottom:1px solid var(--table-line);padding:.75rem .65rem}
  .account-permissions table th{background:var(--table-heading);color:var(--table-heading-ink);font-weight:600}
}
.estimate-comparison-table thead th{background:var(--table-heading);color:var(--table-heading-ink);font-weight:600}
.estimate-comparison-table :is(th,td){border-color:var(--table-line)}
.estimate-comparison-table .comparison-grand-total{background:var(--table-total)}
.brand-paper .print-table:not(.schedule-print-calendar):not(.schedule-gantt){border-collapse:collapse;border: .5pt solid #d8dfe7}
.brand-paper .print-table:not(.schedule-print-calendar):not(.schedule-gantt) :is(th,td){border-color:#dce2e9;border-left:0;border-right:0}
.brand-paper .print-table:not(.schedule-print-calendar):not(.schedule-gantt) th{background:var(--doc-tint,#f3f5f8);color:#33465c;font-weight:600}
.brand-paper .print-table:not(.schedule-print-calendar):not(.schedule-gantt) thead tr:first-child th{border-top:1pt solid var(--doc,#3560ac)}
.brand-paper .print-table .print-total td,.brand-paper .detail-table .detail-title th{background:var(--doc-tint,#edf2f8);color:#253b53;font-weight:650}
@media screen and (max-width:720px){
  .finance .expense-record,.finance .settlement-trade-row,.finance .settlement-table tfoot tr{border-color:var(--table-line);border-radius:9px;padding:.85rem}
  .finance .expense-record>:is(td,th),.finance .settlement-trade-row>:is(td,th){border:0;background:transparent}
  .finance .expense-record>:last-child{border-top:1px solid var(--table-line)}
}
@media print{
  .finance .finance-table{border: .5pt solid #d8dfe7}
  .finance .finance-table :is(th,td){border:0;border-bottom:.5pt solid #dce2e9}
  .finance .finance-table th{background:#f3f5f8;color:#33465c}
  .finance .finance-table tfoot :is(th,td){background:#edf2f8;border-top:.7pt solid #cbd5e1}
}

/* Estimate preview and PDF share explicit A4 sheet boundaries. */
@media screen {
  #document .estimate-page {width:297mm;height:210mm;min-height:210mm;padding:10mm;border:0;outline:1px solid #dfe6de;position:relative;box-sizing:border-box;}
  #document .estimate-page::after {content:attr(data-page-label);position:absolute;bottom:2mm;right:10mm;font-size:8pt;color:#83908b;}
}
@media print {
  #document .estimate-page {width:277mm;max-width:none;height:190mm;min-height:190mm;padding:0;margin:0;border:0;outline:0;box-sizing:border-box;break-before:page;zoom:1!important;transform:none!important;-webkit-text-size-adjust:100%;text-size-adjust:100%;}
  #document .estimate-page:first-of-type {break-before:auto;}
}
#document.document-measuring {display:block!important;visibility:hidden;position:absolute;left:0;top:0;width:297mm;padding:0!important;}
#document.document-measuring .estimate-page {width:297mm!important;height:210mm!important;min-height:210mm!important;padding:10mm!important;zoom:1!important;margin:0!important;border:0!important;box-sizing:border-box;}

.contract-money-section{break-inside:avoid;page-break-inside:avoid;margin:2mm 0}.contract-money-section>h2{margin:0 0 1mm;font-size:11pt}.contract-money-section h2 small{font-size:8pt;font-weight:400;color:#647184}.contract-money-table :is(th,td):last-child{background:var(--doc-tint,#f3f6fa);font-weight:650}

.contract-cover .contract-money-section>h2,.contract-cover .contract-bank-section>h2,.contract-cover>h2{font-size:11pt;line-height:1.3;margin:2mm 0 1mm}
.brand-paper.contract-attachment .contract-attachment-items tbody tr:nth-child(n){background:transparent}.contract-attachment-items tbody td{background:transparent}
.contract-final-amounts{margin-top:5mm;break-inside:avoid;page-break-inside:avoid}.contract-final-amounts .contract-final-table tbody tr:last-child td{background:var(--doc-tint,#edf2f8);color:var(--doc,#253b53);font-weight:750;font-size:11pt;border-top:1.2pt solid var(--doc,#506c99);padding-block:2mm}

/* Shared module headings inside a project; document typography remains separate. */
@media screen{
 .project-focused .project-module-title{font-size:1.3rem;font-weight:600;line-height:1.35;letter-spacing:-.02em;color:#253b53;margin:0;padding:0}
 .project-focused .project-repeat-name{display:none}
 .project-focused .work-head>div:first-child{display:flex;flex-direction:column;min-width:0}
 .project-focused .work-head>div:first-child>.subtitle{order:1;margin-top:.25rem;font-size:.85rem}
 .project-focused .work-head,.project-focused .finance-heading{margin-top:0;margin-bottom:.85rem}
 .project-focused .finance-heading>p{font-size:.85rem;margin-top:.25rem}
}

@media screen{
 body.project-focused>main{max-width:1500px;padding-top:0;padding-inline:clamp(.85rem,3vw,2.2rem)}
 .project-focused .work-head,.project-focused .finance-heading,.project-focused .schedule-main>.box-head{min-height:0;margin:0 0 .65rem;padding:0;align-items:flex-start;position:relative}
 .project-focused .work-head .actions,.project-focused .schedule-main>.box-head .actions{align-items:flex-start}
 .project-focused .work-head :is(button,a.button),.project-focused .schedule-main>.box-head button,.project-focused .finance-title-row button{min-height:36px;font-size:.85rem;padding:.4rem .65rem}
 .project-focused #editor>.library{margin-bottom:.85rem}
 .project-focused .finance-title-row{align-items:flex-start;padding-right:8rem}
 .project-focused #settlement-report-actions{position:absolute;top:0;right:0}
}
@media screen and (max-width:720px){
 body.project-focused>.schedule-main{padding-inline:0}
 .project-focused .schedule-main>.box-head{margin-inline:clamp(.85rem,3vw,2.2rem)}
}
@media screen{body.project-focused.finance>main.finance-work{max-width:1500px;padding-top:0;padding-inline:clamp(.85rem,3vw,2.2rem)}}

@media screen and (min-width:720.01px) and (max-width:1100px){
 .collections-page .collection-table{width:100%;table-layout:fixed;font-size:.8rem}
 .collections-page .collection-table th,.collections-page .collection-table td{padding:.5rem .35rem;font-size:.8rem;overflow-wrap:anywhere}
 .collections-page .collection-table th{white-space:normal}
 .collections-page .collection-stages th:nth-child(1){width:12%}.collections-page .collection-stages th:nth-child(2){width:17%}.collections-page .collection-stages th:nth-child(3),.collections-page .collection-stages th:nth-child(4),.collections-page .collection-stages th:nth-child(5){width:17%}.collections-page .collection-stages th:nth-child(6){width:20%}
 .collections-page .collection-status{font-size:.7rem;padding:.2rem .25rem;white-space:normal}
 .collections-page .collection-money{white-space:normal}
}

/* Keep the collection form submit action aligned on every screen size. */
#receipt-form > .group-foot{justify-content:flex-end}
/* Keep document text sizing independent of the device's text inflation. */
.paper{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media print{
 .contract-watermark{top:138.5mm;left:94mm;width:42mm;height:17.8545mm;max-width:none;object-fit:contain}
}

/* Scale the finished sheet visually; do not reflow document text on small screens. */
.preview-sheet{display:contents}
@media screen and (max-width:1024px){
 .document-preview-page.previewing #document>.preview-sheet{display:block;position:relative;width:calc(var(--sheet-width)*var(--preview-render-scale,1));height:calc(var(--sheet-height)*var(--preview-render-scale,1));margin:0 auto .85rem}
 .document-preview-page.previewing #document>.preview-sheet>.paper{position:absolute;top:0;left:0;margin:0;zoom:1!important;transform:scale(var(--preview-render-scale,1));transform-origin:top left}
}
@media print{
 .preview-sheet{display:contents!important}
 .preview-sheet>.paper{position:static!important;transform:none!important;zoom:1!important}
}
@media screen{
 #document .contract-sheet{width:210mm;height:297mm;min-height:297mm;padding:10mm 11mm;box-sizing:border-box;border:0}
}
#document.contract-measuring{display:block!important;visibility:hidden;position:absolute;left:0;top:0;width:210mm;padding:0!important}
#document.contract-measuring .contract-paper{width:210mm!important;height:297mm!important;min-height:297mm!important;padding:10mm 11mm!important;margin:0!important;border:0!important;box-sizing:border-box;zoom:1!important;transform:none!important}
.document-export-status{font-size:.85rem;align-self:center;color:#33465c}
@media print{.document-export-status{display:none!important}}

/* Compact project calendar: one event line, project names in the legend only. */
@media screen{
 .schedule-main .calendar-day{padding:0;gap:1px}
 .schedule-main .calendar-date{min-height:24px;height:24px;line-height:24px;padding:0 4px;font-size:12px;font-weight:400}
 .schedule-main .calendar-task{display:block;height:20px;min-height:20px;max-height:20px;padding:0 3px;border:0;border-radius:2px;line-height:20px;font-size:12px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;background:var(--work-fill);color:#243342}
 .schedule-main .calendar-task strong{display:block;line-height:20px;font-size:inherit;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .schedule-main .calendar-more{height:20px;min-height:20px;padding:0 2px;line-height:20px;font-size:11px;font-weight:400}
 .schedule-main .schedule-row{grid-template-columns:minmax(0,1fr) auto}
 .schedule-main .project-schedule-title{font-weight:400;border:0}
}
.schedule-project-legend{display:flex;flex-wrap:wrap;gap:.35rem 1rem;padding:.65rem 0 .2rem;font-size:12px;color:#526174}
.schedule-project-key{display:inline-flex;align-items:center;gap:.35rem;min-width:0;max-width:100%}
.schedule-project-key i{display:block;width:11px;height:11px;flex:none;border-radius:2px;background:var(--work-fill);box-shadow:inset 0 0 0 1px var(--work-ink)}
.schedule-project-key>span{min-width:0;overflow-wrap:anywhere}
@media screen and (max-width:720px){
 .schedule-main>.box>.schedule-project-legend{margin-inline:.65rem}
 .schedule-main .calendar-task{border-radius:0;padding-inline:1px}
 .schedule-main .schedule-row{grid-template-columns:minmax(0,1fr);gap:.25rem}
}
@media screen{.schedule-main .schedule-row{min-height:28px;padding:.35rem .45rem;font-size:12px;font-weight:400;line-height:1.3}}
/* Normal swipes scroll. Explicit range mode reserves the calendar for dragging. */
.calendar-grid{touch-action:pan-y;-webkit-touch-callout:none}
.calendar-grid.range-selecting{touch-action:none;cursor:crosshair}
.calendar-grid.range-dragging{cursor:crosshair}
#select-period[aria-pressed="true"]{background:var(--accent);color:white;border-color:var(--accent)}
@media screen{
 .calendar-grid.task-moving,.calendar-grid.task-moving .calendar-task{cursor:grabbing}
 .calendar-grid .task-move-source{opacity:.5}
 .calendar-grid .task-move-target{box-shadow:inset 0 0 0 2px var(--accent);background:#eef3fa}
}
@media screen{
 .schedule-main .calendar-task{cursor:grab;-webkit-user-drag:none}
 .calendar-grid.task-move-mode{touch-action:none}
 #move-mode[aria-pressed="true"]{background:var(--accent);color:white;border-color:var(--accent)}
 .schedule-drag-tip{position:fixed;z-index:10000;pointer-events:none;max-width:240px;padding:6px 10px;border-radius:6px;background:#203950;color:#fff;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 3px 12px #0003}
}
/* Only the selected day's event is marked, even for a multi-day registration. */
@media screen{
 .schedule-main .calendar-task.task-selected,.schedule-main .calendar-task.task-move-source{opacity:1;outline:2px solid #172d48;outline-offset:-2px;box-shadow:inset 0 0 0 3px #fff;position:relative;z-index:2}
 .schedule-main .calendar-task.task-selected strong::before,.schedule-main .calendar-task.task-move-source strong::before{content:'✓ ';font-weight:700}
 .calendar-grid.is-moving .calendar-task:not(.task-selected),.calendar-grid.task-moving .calendar-task:not(.task-move-source){opacity:.42}
 .calendar-grid .task-move-target{box-shadow:inset 0 0 0 2px #172d48;background:#e9f1ff}
}
/* Safari needs the prefixed property on the event text as well as the grid. */
.calendar-grid,.calendar-grid *,.schedule-drag-tip{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
@media screen{
 .schedule-drag-tip{max-width:160px;min-height:22px;padding:2px 6px;border:1px solid #ffffffa6;border-radius:2px;color:#243342;font-size:12px;line-height:18px;font-weight:400;box-shadow:0 2px 7px #0003;opacity:.9}
}
.electronic-contract fieldset{min-width:0;margin:.65rem 0;padding:.6rem;border:1px solid var(--line);border-radius:6px}.electronic-contract legend{font-size:13px;padding:0 .3rem}.electronic-contract [data-esign-message]{overflow-wrap:anywhere}
/* Identity headings appear once per trade; each item uses the same columns. */
.item-label-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
.estimate-item-heading,.item-identity{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) 2.8rem 3.5rem;gap:.48rem;min-width:0}
.estimate-item-heading{margin:.5rem .55rem 0;font-size:13px;color:var(--muted);font-weight:500}
.item-identity{grid-column:1/-1}.item .item-identity .field{grid-column:auto;gap:0}
@media(min-width:1180px){
 .estimate-item-heading{grid-template-columns:minmax(5rem,1.5fr) minmax(4rem,1fr) 2.8rem 3.5rem repeat(3,minmax(4.8rem,1fr)) minmax(4rem,1fr) minmax(4.8rem,1fr) 2rem}
 .item-identity{display:contents}
}
@media(min-width:1180px){
 #editor .group{--estimate-columns:minmax(5rem,1.5fr) minmax(4rem,1fr) 2.8rem 3.5rem repeat(3,minmax(4.8rem,1fr)) minmax(4rem,1fr) minmax(4.8rem,1fr) calc(var(--control-icon,28px) + var(--control-icon,28px) + var(--control-icon,28px) + .4rem)}
 #editor .group .item:has(.item-identity),#editor .group .estimate-item-heading{grid-template-columns:var(--estimate-columns)}
}
/* Keep identity and all three unit prices in one row on every viewport. */
@media screen{
 #editor .group{--estimate-inline-columns:minmax(0,1.4fr) minmax(0,.8fr) minmax(0,.45fr) minmax(0,.5fr) repeat(3,minmax(0,1.1fr))}
 #editor .group .item:has(.item-identity),#editor .group .estimate-item-heading{grid-template-columns:var(--estimate-inline-columns);column-gap:4px}
 #editor .item-identity{display:contents}
 #editor .item .field{grid-column:auto;gap:0}
 #editor .item .note{grid-column:1/4;grid-row:2}
 #editor .item .subtotal{grid-column:4/6;grid-row:2;font-size:12px;line-height:1.25;min-width:0;white-space:nowrap}
 #editor .item .subtotal br{display:none}
 #editor .item .subtotal small{display:block;font-size:10px}
 #editor .item .estimate-item-actions{grid-column:6/8;grid-row:2;justify-content:flex-end;min-width:0}
 #editor .estimate-item-heading{font-size:12px;line-height:1.2;align-items:end}
 #editor .item-secondary-heading{display:none}
 #editor .item input[type="number"]{-moz-appearance:textfield;appearance:textfield}
 #editor .item input[type="number"]::-webkit-inner-spin-button,#editor .item input[type="number"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
}
@media screen and (max-width:720px){
 #editor .item input.ui-input{font-size:12px;padding-inline:3px}
 #editor .item input.ui-input:focus{font-size:16px}
 #editor .estimate-item-heading{font-size:10px}
}
@media screen and (min-width:1180px){
 #editor .group .item:has(.item-identity),#editor .group .estimate-item-heading{grid-template-columns:var(--estimate-columns)}
 #editor .item .note,#editor .item .subtotal,#editor .item .estimate-item-actions{grid-column:auto;grid-row:auto}
 #editor .item .subtotal small{display:none}
 #editor .item-secondary-heading{display:block}
}
@media screen and (max-width:720px){
 #editor .group{--estimate-inline-columns:minmax(0,1.1fr) minmax(0,.65fr) minmax(0,.45fr) minmax(0,.5fr) repeat(3,minmax(0,1.25fr))}
 #editor .item .rate input.ui-input{font-size:11px;padding-inline:2px;font-variant-numeric:tabular-nums}
 #editor .item .rate input.ui-input:focus{font-size:16px}
}
/* Match the preview's grouped unit-price / calculated-amount headings. */
@media screen{
 .estimate-cost-heading{min-width:0;text-align:center;align-self:stretch}
 .estimate-cost-heading strong{display:block;font-size:inherit;font-weight:500;border-bottom:1px solid var(--line);padding-bottom:3px;margin-bottom:3px}
 .estimate-cost-heading>div,.estimate-cost-cell{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:3px;min-width:0}
 .estimate-cost-cell{align-items:start}
 #editor .estimate-cost-cell .rate{min-width:0}
 #editor .estimate-cost-cell output{display:flex;align-items:center;justify-content:flex-end;min-width:0;min-height:var(--control-height);padding:3px;background:#eef2f6;border-radius:4px;font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden}
 #editor .estimate-cost-cell input.ui-input{font-size:12px;padding-inline:3px}
}
@media screen and (max-width:720px){
 .estimate-cost-cell{grid-template-columns:minmax(0,1fr);gap:1px}
 .estimate-cost-heading>div{display:block}
 .estimate-cost-heading>div span+span::before{content:' / '}
 #editor .estimate-cost-cell input.ui-input{font-size:11px;padding-inline:2px}
 #editor .estimate-cost-cell input.ui-input:focus{font-size:16px}
 #editor .estimate-cost-cell output{min-height:16px;padding:0 2px;font-size:10px;line-height:16px}
}
@media screen and (min-width:720.01px) and (pointer:coarse){#editor .estimate-cost-cell input.ui-input:focus{font-size:16px}}

@media screen and (min-width:720.01px) and (max-width:1179px){
 .estimate-cost-cell{grid-template-columns:minmax(0,1fr);gap:1px}
 .estimate-cost-heading>div{display:block}
 .estimate-cost-heading>div span+span::before{content:' / '}
 #editor .estimate-cost-cell output{min-height:16px;padding:0 2px;font-size:11px;line-height:16px}
}
@media screen and (min-width:1180px){
 #editor .group{--estimate-columns:minmax(4rem,1.1fr) minmax(3rem,.7fr) 2.5rem 3rem repeat(3,minmax(7.8rem,1.7fr)) minmax(3rem,.7fr) minmax(4.5rem,.8fr) calc(var(--control-icon,28px) + var(--control-icon,28px) + var(--control-icon,28px) + .4rem)}
}
