/* Existing portal palette. Scoped to history; no shared layout overrides. */
.service-history{margin-top:28px;font:15px/1.55 system-ui,sans-serif;color:var(--alfa-ink,#213b35);min-width:0}
.service-history *{box-sizing:border-box}.service-history p,.service-history h2,.service-history h3{overflow-wrap:anywhere}
.service-history .history-eyebrow{font-size:11px;font-weight:750;letter-spacing:.1em;color:var(--alfa-muted,#59695f);margin:0 0 5px}
.service-history .history-heading{font-size:27px;margin:0 0 8px}.service-history .history-intro{max-width:780px;color:var(--alfa-muted,#59695f);margin:0 0 20px}
.service-history-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;border:1px solid var(--alfa-line,#d5ddcf);border-radius:12px;overflow:hidden;background:var(--alfa-line,#d5ddcf);margin:0 0 16px}
.service-history-summary>div{display:flex;flex-direction:column-reverse;background:var(--alfa-paper,#fff);padding:14px 18px;gap:2px}.service-history-summary dt{font-size:12px;color:var(--alfa-muted,#59695f)}.service-history-summary dd{margin:0;font-size:24px;font-weight:650;font-variant-numeric:tabular-nums}
.service-history details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:9px;font-size:13px;font-weight:600;list-style:none}.service-history details summary::before{content:'+';font-size:19px;font-weight:400}.service-history details[open]>summary::before{content:'−'}
.history-about{padding:0 14px;border-left:3px solid var(--alfa-yellow,#f5d47b);background:var(--alfa-soft,#e8ece3);border-radius:4px;margin-bottom:22px}.history-about p{font-size:13px;color:var(--alfa-muted,#59695f);padding-bottom:10px}
.service-history .history-controls{display:flex;gap:14px;align-items:end;justify-content:space-between;flex-wrap:wrap;margin:14px 0 8px}.history-controls label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:650}.history-controls select{font:inherit;font-size:14px;min-height:44px;max-width:100%;padding:9px 35px 9px 12px;border:1px solid var(--alfa-line,#d5ddcf);border-radius:8px;color:inherit;background:white}
.history-page-buttons{display:flex;gap:8px}.service-history button{font:inherit;min-height:44px;padding:9px 15px;border:1px solid var(--alfa-line,#d5ddcf);border-radius:8px;color:inherit;background:white;cursor:pointer}.service-history button:disabled{opacity:.45;cursor:default}.service-history :is(button,select,summary):focus-visible{outline:3px solid #b48929;outline-offset:3px}
.service-history .history-count{font-size:12px;color:var(--alfa-muted,#59695f);margin:10px 0 16px}.service-history-entries{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.history-entry{padding:20px 22px;border:1px solid var(--alfa-line,#d5ddcf);border-radius:12px;background:var(--alfa-paper,#fff)}.history-entry-meta{display:flex;gap:12px;justify-content:space-between;align-items:center;flex-wrap:wrap;font-size:12px;color:var(--alfa-muted,#59695f)}.history-kind{background:var(--alfa-soft,#e8ece3);padding:4px 9px;border-radius:5px;font-weight:600}
.service-history .history-entry h3{font-size:17px;margin:12px 0 4px}.service-history .history-position{font-size:13px;color:var(--alfa-muted,#59695f);margin:0 0 12px}.service-history .history-observation{white-space:pre-wrap;margin:0 0 12px}.service-history .history-source-note{font-size:12px;color:#735b27;background:#fff6dc;padding:6px 10px;border-radius:5px;display:table;margin:8px 0}
.history-source{border-top:1px solid var(--alfa-line,#d5ddcf);margin-top:14px}.history-source summary{color:var(--alfa-muted,#59695f)}.history-source dl{display:grid;grid-template-columns:minmax(110px,1fr) minmax(0,3fr);gap:9px 16px;font-size:12px;margin:8px 0}.history-source dt{color:var(--alfa-muted,#59695f)}.history-source dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap}.history-empty{padding:24px;background:white;border:1px solid var(--alfa-line,#d5ddcf);border-radius:10px}
.history-bottom-nav{display:flex;justify-content:flex-end;margin-top:18px}
.history-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 22px;margin:18px 0}.history-fields>div{min-width:0}.history-fields dt{font-size:12px;color:var(--alfa-muted,#59695f);margin-bottom:3px}.history-fields dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.history-field-wide{grid-column:1/-1}.history-original pre{font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:360px;overflow:auto;padding:14px;background:var(--alfa-soft,#e8ece3);border-radius:6px}.history-original{grid-column:1/-1}
@media(max-width:600px){.history-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.history-fields dt{font-size:11px}.history-fields dd{font-size:14px}}
@media(max-width:600px){.service-history-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.service-history-summary>div{padding:12px}.service-history-summary dd{font-size:21px}.history-entry{padding:16px}.history-controls label{width:100%}.history-controls select{width:100%}.history-source dl{grid-template-columns:1fr;gap:3px}.history-source dd{margin-bottom:9px}.history-page-buttons{width:100%}.history-page-buttons button{flex:1}.service-history .history-heading{font-size:24px}}
/* Building/facade overview within the existing portal shell. */
.hb-building{max-width:1320px}.hb-heading{display:flex;align-items:center;justify-content:space-between;gap:24px}.hb-heading h2{font-size:20px;line-height:1.3;margin:0}.hb-source{display:grid;gap:5px;font-size:12px;color:#59695f}.hb-building select{font:inherit;background:white;border:1px solid #cad4c7;border-radius:8px;padding:10px;min-height:44px;color:#213b35}.hb-intro{color:#59695f;font-size:15px;line-height:1.55;margin:10px 0 14px;max-width:80ch}.hb-tabs{display:flex;gap:6px;border-bottom:1px solid #d5ddcf;padding:10px 0 14px;margin-bottom:20px}.hb-building button.is-active,.hb-building .hb-primary{background:#314e42;border-color:#314e42;color:white}.hb-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:24px}.hb-metrics>div{display:grid;gap:3px;background:white;border:1px solid #dce3d8;border-radius:12px;padding:18px}.hb-metrics strong{font-size:29px;font-variant-numeric:tabular-nums}.hb-metrics span{font-size:12px;color:#59695f}.hb-overview{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:28px}.hb-map{margin:0;background:#eef1e9;border:1px solid #d5ddcf;padding:16px;border-radius:14px}.hb-map img{display:block;width:100%;max-height:510px;object-fit:contain;border-radius:8px}.hb-map figcaption,.hb-caption{font-size:12px;color:#59695f;margin:10px 0}.hb-parts{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.hb-parts button{font-size:12px;padding:8px 10px}.hb-overview-side{display:flex;flex-direction:column;gap:10px}.hb-overview-side h3{margin:0}.hb-overview-side p{margin:0 0 12px;color:#59695f}.hb-followup{text-align:left!important;display:flex;justify-content:space-between;padding:17px!important}.hb-facade-controls,.hb-filter{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0}.hb-facade-layout{display:grid;grid-template-columns:205px minmax(0,1fr);gap:22px}.hb-facade-list{display:flex;flex-direction:column;gap:5px;align-self:start}.hb-facade-list button{display:grid;gap:5px;text-align:left}.hb-facade-list span{font-size:11px}.hb-facade-content{min-width:0;background:white;padding:22px;border:1px solid #d5ddcf;border-radius:12px}.hb-facade-content h3{margin-top:0}.hb-facade-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.hb-facade-cards button{text-align:left;display:grid;gap:8px}.hb-facade-cards h4{margin:0;font-size:17px}.hb-facade-cards span{font-size:12px}.hb-floor{padding:13px 0;border-top:1px solid #e4e8df}.hb-floor h4{margin:0 0 10px}.hb-window-grid{display:flex;gap:7px;flex-wrap:wrap}.service-history .hb-window{width:54px;min-height:58px;padding:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-width:2px}.hb-window strong{font-size:18px}.hb-window span{font-size:12px;line-height:1}.hb-status{display:inline-flex;align-items:center;padding:4px 8px;border-radius:5px;font-size:11px}.hb-building .hb-action{background:#fff0e7;border-color:#c26838;color:#7d351e}.hb-building .hb-invoiced{background:#ede6fa;border-color:#70509b;color:#3f285f}.hb-building .hb-performed{background:#dcecff;border-color:#2463a6;color:#123d6a}.hb-building .hb-unmarked,.hb-building .hb-unknown{background:#f4f5f1;border-color:#cfd6c9;color:#536157}.hb-window.is-selected{outline:3px solid #274839;outline-offset:2px}.hb-legend{display:flex;flex-wrap:wrap;gap:7px;margin:16px 0}.hb-window-detail{margin-top:24px;padding:20px;border:2px solid #b8c8af;border-radius:12px;background:#fafbf8;scroll-margin-top:80px}.hb-detail-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.hb-detail-title h4{margin:0;font-size:17px}.hb-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.hb-facts dt{font-size:12px;color:#59695f}.hb-facts dd{margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.hb-source-details pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:250px;overflow:auto;font-size:12px}.hb-notice{padding:12px 15px;background:#fff5d8;color:#6c5221;border-radius:8px;font-size:13px}.hb-faults{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}.hb-summary-table{display:grid;gap:7px}.hb-summary-row{display:grid;grid-template-columns:1.2fr .7fr 1.2fr 1fr;gap:14px;text-align:left;align-items:center}.hb-summary-row span{font-size:12px}.hb-estimates{margin-top:28px}.hb-estimate{background:white;border:1px solid #d5ddcf;padding:18px;border-radius:10px;margin:12px 0}.hb-estimate h4{margin:0 0 10px}.hb-archive{margin-top:28px;border-top:1px solid #d5ddcf;padding-top:8px}.hb-archive p{font-size:13px;color:#59695f}
@media(max-width:760px){.hb-heading{align-items:start;flex-direction:column;gap:14px}.hb-heading h2{font-size:24px}.hb-source{width:100%}.hb-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.hb-metrics>div{padding:13px}.hb-overview{grid-template-columns:1fr;gap:20px}.hb-facade-layout{grid-template-columns:1fr}.hb-facade-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.hb-facade-list button{min-width:0;overflow-wrap:anywhere}.hb-facade-content{padding:14px}.hb-facade-cards{grid-template-columns:1fr}.hb-facts{grid-template-columns:1fr}.hb-summary-row{grid-template-columns:1fr 1fr;gap:8px}.hb-map img{max-height:400px}.hb-window-detail{padding:14px}.hb-filter button{font-size:12px;padding:8px}.hb-building .hb-window{width:48px;min-height:54px}.hb-facade-controls button{padding:8px 10px;font-size:12px}.hb-tabs button{flex:1}}
.hb-building button.is-active:hover,.hb-building button.is-active:focus{background:#314e42;color:white;border-color:#314e42}
@media(max-width:760px){.hb-tabs button{font-size:13px;white-space:nowrap;padding:9px 10px}}
.hb-estimate strong{display:block;white-space:pre-wrap;font-weight:500;overflow-wrap:anywhere}
/* Private facade photos: contained image, one active resource, same existing palette. */
.hb-photo-gallery{margin:18px 0 24px;border:1px solid #d5ddcf;border-radius:10px;overflow:hidden;background:#f3f5ef}
.service-history .hb-photo-open{display:block;padding:0;width:100%;border:0;border-radius:0;background:#e8ece3;cursor:zoom-in}
.hb-photo-open img{display:block;width:100%;height:auto;max-height:380px;object-fit:contain}
.hb-photo-controls{padding:12px;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.hb-photo-controls figcaption{font-size:12px;color:#59695f}.hb-photo-controls>div{display:flex;flex-wrap:wrap;gap:6px}.hb-photo-controls button{font-size:12px;padding:8px 10px}
.hb-photo-message{min-height:120px;display:grid;place-content:center;padding:16px;font-size:13px}
.hb-photo-dialog{width:min(1200px,96vw);max-width:96vw;max-height:94dvh;padding:0;border:1px solid #d5ddcf;border-radius:12px;color:#213b35;background:#f5f6f1;font:14px/1.5 system-ui,sans-serif}
.hb-photo-dialog::backdrop{background:rgba(17,29,24,.8)}.hb-photo-dialog *{box-sizing:border-box}
.hb-photo-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px;border-bottom:1px solid #d5ddcf;background:#fff}
.hb-photo-toolbar strong{margin-right:auto}.hb-photo-toolbar button{font:inherit;min-height:44px;padding:8px 12px;border:1px solid #cad4c7;border-radius:7px;background:#fff;color:#213b35;cursor:pointer}
.hb-photo-toolbar button:disabled{opacity:.4;cursor:default}.hb-photo-toolbar button:focus-visible{outline:3px solid #b48929;outline-offset:2px}
.hb-photo-viewport{max-height:calc(94dvh - 124px);overflow:auto;overscroll-behavior:contain}.hb-photo-viewport img{display:block;max-width:none;height:auto;margin:0 auto}
@media(max-width:600px){.hb-photo-controls>div{width:100%}.hb-photo-controls button{flex:1}.hb-photo-toolbar{gap:5px;padding:8px}.hb-photo-toolbar strong{width:100%;font-size:13px}.hb-photo-toolbar button{font-size:12px;padding:8px}.hb-photo-open img{max-height:290px}}

/* KTP source-stage labels do not claim verified completion. */
.hb-window.hb-source-invoiced,.hb-status.hb-source-invoiced{background:#e5eee9;border-color:#78988b;color:#284c3e}
.hb-window.hb-source-work,.hb-status.hb-source-work{background:#f1eee1;border-color:#b4ac8a;color:#625a3b}
.hb-window.hb-started,.hb-status.hb-started{background:#fff1cc;border-color:#c6a54c;color:#66521a}
/* Billing review in the existing authorized building view. */
.hb-tabs{flex-wrap:wrap}.hb-billing-intro{margin:0 0 22px;max-width:78ch}.hb-billing-intro h3{margin-bottom:8px}.hb-billing-intro p,.hb-billing-documents>p{color:#59695f;line-height:1.6}.hb-billing-cases{display:grid;gap:16px}.hb-billing-case{padding:22px;background:#fff;border:1px solid #d5ddcf;border-radius:12px;min-width:0}.hb-billing-case h4{margin:0}.hb-billing-description{font-size:16px;line-height:1.5;overflow-wrap:anywhere}.hb-billing-actions{display:flex;align-items:center;gap:18px;flex-wrap:wrap}.hb-billing-actions a{padding:12px 0;color:#314e42;text-underline-offset:3px}.hb-billing-documents{margin-top:32px}.hb-invoice{background:#fff;border:1px solid #d5ddcf;border-radius:10px;padding:16px;margin:12px 0;overflow-wrap:anywhere}.hb-invoice summary{display:flex;align-items:center;gap:14px;flex-wrap:wrap;cursor:pointer;min-height:44px}.hb-invoice summary:before{content:'+'}.hb-invoice[open] summary:before{content:'−'}.hb-invoice summary>strong:last-child{margin-left:auto;font-variant-numeric:tabular-nums}.hb-invoice-lines{padding-left:24px}.hb-invoice-lines li{padding:10px 0;border-top:1px solid #e4e8df}.hb-invoice-lines span{display:block;line-height:1.5}.hb-invoice-lines span:last-child{font-size:12px;color:#59695f}.hb-billing-case .hb-detail-title{flex-wrap:wrap;gap:10px}@media(max-width:600px){.hb-billing-case{padding:16px}.hb-invoice summary{gap:8px}.hb-invoice summary>strong:last-child{width:100%;margin-left:0}.hb-billing-case .hb-detail-title h4{font-size:16px}}

.sf-panel{padding:24px;margin:20px 0;background:#fff;border:1px solid #cad4ce;border-radius:16px;color:#173b2d}.sf-panel button,.hb-followup-actions button{min-height:44px;margin:6px;padding:10px 16px;border:1px solid #728b7d;border-radius:8px;background:#f3f7f4;color:#173b2d;cursor:pointer}.sf-panel button:disabled{opacity:.55;cursor:default}.sf-form{display:grid;gap:14px;padding:18px;background:#f4f7f5;border-radius:10px;margin:16px 0}.sf-form label{display:grid;gap:6px;font-weight:600}.sf-form input,.sf-form textarea,.sf-form select{box-sizing:border-box;width:100%;font:inherit;padding:12px;border:1px solid #789182;border-radius:7px;background:white;color:#173b2d}.sf-form textarea{min-height:100px;resize:vertical}.sf-case{border-top:1px solid #ccd7d0;padding:18px 0;overflow-wrap:anywhere}.sf-case strong{display:inline-block;padding:5px 10px;background:#e0eee5;border-radius:20px}.hb-building .hb-resolved{background:#d8eee1;border-color:#28704a;color:#16462e}.hb-building .hb-dismissed{background:#e5e7eb;border-color:#9ca3af;color:#173b2d}@media(max-width:500px){.sf-panel{padding:14px}.sf-form{padding:12px}.sf-panel button{margin-left:0;max-width:100%}}
.hb-legend .hb-status-marker{margin-inline-end:.35em;font-weight:700}
.hb-window .hb-status-marker{font-weight:700}
