:root {
  color-scheme: light;
  --navy: #083b5c;
  --navy-deep: #052b43;
  --blue: #1976b9;
  --blue-soft: #eaf4fa;
  --gold: #d69b2d;
  --ink: #183244;
  --muted: #667d8b;
  --line: #d7e3ea;
  --surface: #ffffff;
  --background: #f3f7fa;
  --success: #23825a;
  --danger: #b42318;
  --shadow: 0 14px 38px rgba(8, 59, 92, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  color: white;
  background: linear-gradient(115deg, var(--navy-deep), var(--navy) 55%, #0c527c);
  box-shadow: 0 8px 28px rgba(5, 43, 67, 0.22);
}
.header-inner {
  display: flex;
  width: min(1440px, calc(100% - 40px));
  min-height: 82px;
  margin: auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header-accent { height: 4px; background: linear-gradient(90deg, var(--gold) 0 24%, #f0bb54 24% 36%, var(--blue) 36% 100%); }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 12px;
  color: white;
  background: rgba(255,255,255,.1);
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand-lockup p, .brand-lockup h1 { margin: 0; }
.brand-lockup p { color: #cfe4f1; font-size: .78rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.brand-lockup h1 { font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.2; }
.header-meta { display: flex; align-items: center; gap: 18px; color: #dcebf4; font-size: .9rem; }
.sync-status { max-width: 310px; color: #d9ebf5; font-size: .8rem; font-weight: 700; text-align: right; }

.button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 750;
}
.button-ghost { border: 1px solid rgba(255,255,255,.36); color: white; background: rgba(255,255,255,.08); }
.button-ghost:hover { background: rgba(255,255,255,.16); }
.button-primary { color: white; background: var(--blue); }
.button-primary:hover { background: #12669f; }
.button-primary:disabled { cursor: not-allowed; opacity: .48; }
.button-secondary { border: 1px solid var(--line); color: var(--navy); background: white; }
.button-preview { border: 1px solid #a9c4d4; color: var(--navy); background: #edf6fb; }
.button-preview:hover { border-color: var(--blue); background: #e1f1f9; }
.preview-note { margin-top: -7px; color: var(--muted); font-size: .76rem; text-align: center; }

.auth-gate { display: grid; min-height: calc(100vh - 86px); place-items: center; padding: 32px 20px; background: radial-gradient(circle at 20% 10%, #dceef8 0, transparent 34%), var(--background); }
.auth-card { display: grid; width: min(430px, 100%); gap: 15px; border: 1px solid var(--line); border-radius: 22px; padding: 34px; background: white; box-shadow: var(--shadow); }
.auth-card h2, .auth-card p { margin: 0; }
.auth-card > p:not(.eyebrow) { color: var(--muted); }
.auth-mark { color: white; background: var(--navy); }
.auth-message { min-height: 24px; color: var(--success) !important; font-size: .88rem; }
.auth-message.error { color: var(--danger) !important; }

.workspace { width: min(1440px, calc(100% - 40px)); margin: 32px auto 88px; }
.intro-row { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin: 0 0 24px; }
.intro-row h2 { margin: 2px 0 0; color: var(--navy); font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -.035em; }
.intro-copy { width: min(520px, 100%); margin: 0; color: var(--muted); }
.eyebrow { margin: 0; color: var(--blue); font-size: .76rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }

.calculator-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(360px, .75fr); gap: 22px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.input-card, .pricing-card, .funding-card, .upload-card { padding: 24px; }
.pricing-card, .funding-card, .upload-card { margin-top: 22px; }
.section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.section-heading h3 { margin: 1px 0 0; color: var(--navy); font-size: 1.25rem; letter-spacing: -.02em; }
.section-heading-split { justify-content: space-between; }
.heading-lockup { display: flex; align-items: center; gap: 13px; }
.step-number { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: white; background: var(--blue); font-weight: 850; }
.price-list-note { border-radius: 999px; padding: 6px 10px; color: var(--navy); background: var(--blue-soft); font-size: .78rem; font-weight: 750; }

.form-grid, .pricing-inputs, .funding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pricing-inputs { grid-template-columns: repeat(5, minmax(145px, 1fr)); }
.funding-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span, .field-label-row > label, .locked-field > span { color: #405968; font-size: .85rem; font-weight: 750; }
.field-label-row { display: flex; min-height: 22px; align-items: center; justify-content: space-between; gap: 10px; }
.calculated-reset { border: 0; padding: 0; color: var(--blue); background: transparent; font: inherit; font-size: .72rem; font-weight: 850; cursor: pointer; }
.calculated-reset:hover { color: var(--navy); text-decoration: underline; }
input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9d9e3;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: white;
  padding: 0 12px;
}
textarea {
  width: 100%;
  border: 1px solid #c9d9e3;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: white;
  padding: 10px 12px;
  resize: vertical;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,118,185,.14); }
input[readonly] { color: #35505f; background: #f3f7fa; cursor: default; }
.input-prefix, .input-suffix { display: flex; min-height: 46px; align-items: center; border: 1px solid #c9d9e3; border-radius: 10px; background: white; overflow: hidden; }
.input-prefix:focus-within, .input-suffix:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,118,185,.14); }
.input-prefix input, .input-suffix input { min-height: 44px; border: 0; border-radius: 0; box-shadow: none; }
.input-prefix > span, .input-suffix > span { flex: 0 0 auto; padding: 0 11px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.input-prefix > span { border-right: 1px solid var(--line); }
.input-suffix > span { border-left: 1px solid var(--line); }

.details-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; }
.details-panel summary { padding: 13px 15px; color: var(--navy); font-weight: 800; cursor: pointer; }
.details-panel > p { margin: -2px 15px 14px; color: var(--muted); font-size: .86rem; }
.compact-grid { padding: 0 15px 16px; }
[data-detail][hidden] { display: none; }
.integration-status-card { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 11px; align-items: center; border: 1px solid #c8d9e3; border-radius: 11px; padding: 12px 13px; background: white; }
.integration-status-card > div { display: grid; gap: 2px; }
.integration-status-card strong { color: var(--navy); font-size: .87rem; }
.integration-status-card span:not(.integration-status-dot) { color: var(--ink); font-size: .82rem; font-weight: 750; }
.integration-status-card small { color: var(--muted); font-size: .74rem; line-height: 1.4; }
.integration-status-dot { width: 10px; height: 10px; border-radius: 50%; background: #c68a21; box-shadow: 0 0 0 4px rgba(198,138,33,.12); }
.integration-status-card[data-tone="success"] { border-color: #acd1bc; background: #f7fcf9; }
.integration-status-card[data-tone="success"] .integration-status-dot { background: #2f8a58; box-shadow: 0 0 0 4px rgba(47,138,88,.12); }
.integration-status-card[data-tone="error"] { border-color: #e0b6b6; background: #fffafa; }
.integration-status-card[data-tone="error"] .integration-status-dot { background: #b84b4b; box-shadow: 0 0 0 4px rgba(184,75,75,.12); }
.integration-status-card .button { min-height: 36px; padding: 8px 12px; font-size: .76rem; }
.integration-status-card > .integration-action-stack { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }

.connected-record-picker { display: grid; gap: 10px; border: 1px solid #b9d5e4; border-radius: 14px; padding: 16px; background: linear-gradient(145deg, #f8fcfe, #edf6fb); }
.connected-record-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.connected-record-heading > div { display: grid; gap: 2px; }
.field-caption { color: #405968; font-size: .85rem; font-weight: 800; }
.connected-record-heading small, .connected-record-status { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.source-lock { flex: 0 0 auto; border-radius: 999px; padding: 5px 9px; color: #176443; background: #e5f5ec; font-size: .69rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.connected-record-search-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
.connected-record-status { min-height: 18px; margin: 0; }
.connected-record-results { display: grid; gap: 8px; max-height: 390px; overflow: auto; border-top: 1px solid #d7e6ee; padding-top: 10px; }
.connected-record-result, .connected-record-selected { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 11px; background: white; }
.connected-record-result.is-ready { border-color: #b4d9c5; }
.connected-record-result.is-blocked { background: #fffaf6; }
.record-source-state, .connection-check { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: .8rem; font-weight: 900; }
.connected-record-result.is-blocked .record-source-state { background: #c18427; }
.record-result-copy, .connected-record-selected > div { display: grid; min-width: 0; gap: 2px; }
.record-result-copy strong, .connected-record-selected strong { overflow-wrap: anywhere; color: var(--navy); font-size: .86rem; }
.record-result-copy span, .connected-record-selected span:not(.connection-check) { overflow-wrap: anywhere; color: var(--ink); font-size: .78rem; }
.record-result-copy small, .connected-record-selected small { overflow-wrap: anywhere; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.record-waiting { border-radius: 999px; padding: 5px 8px; color: #8a5b12; background: #fff0d6; font-size: .7rem; font-weight: 850; }
.connected-record-empty { margin: 0; border-radius: 9px; padding: 12px; color: var(--muted); background: white; font-size: .8rem; }
.connected-record-selected { border: 1px solid #8fc8aa; background: #f5fcf8; }
.connected-record-selected .text-button { justify-self: end; }

.custom-plan-builder { margin-top: 20px; border: 1px solid #b9d5e4; border-radius: 14px; padding: 18px; background: linear-gradient(145deg, #f7fbfd, #edf6fb); }
.custom-plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.custom-plan-heading h4 { margin: 2px 0 3px; color: var(--navy); font-size: 1.08rem; }
.custom-plan-heading > div > span { color: var(--muted); font-size: .875rem; }
.custom-plan-heading > strong { flex: 0 0 auto; border-radius: 999px; padding: 7px 11px; color: white; background: var(--navy); font-size: .82rem; }
.custom-service-groups { display: grid; gap: 14px; margin-top: 17px; }
.custom-service-group { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.custom-service-group h5 { margin: 0; border-bottom: 1px solid var(--line); padding: 10px 13px; color: var(--navy); background: #f3f8fb; font-size: .84rem; letter-spacing: .045em; text-transform: uppercase; }
.custom-service-list { display: grid; }
.custom-service-row { display: grid; grid-template-columns: minmax(240px, 1fr) 145px 145px; gap: 12px; align-items: center; padding: 12px 13px; }
.custom-service-row + .custom-service-row { border-top: 1px solid #e5edf2; }
.custom-service-main { display: flex; min-width: 0; align-items: flex-start; gap: 10px; cursor: pointer; }
.custom-service-main input { width: 20px; min-height: 20px; flex: 0 0 auto; margin-top: 2px; }
.custom-service-copy strong, .custom-service-copy span { display: block; }
.custom-service-copy strong { color: var(--ink); font-size: .88rem; line-height: 1.35; }
.custom-service-copy span { margin-top: 2px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.custom-price-field { display: grid; gap: 5px; }
.custom-price-field > span { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.custom-price-field .input-prefix { min-height: 40px; }
.custom-price-field input { min-height: 38px; padding: 0 8px; }
.custom-price-field .input-prefix > span { padding: 0 8px; }
.custom-service-row:not(.is-selected) .custom-price-field { opacity: .48; }
.custom-service-row:not(.is-selected) .custom-price-field input { pointer-events: none; }
.custom-service-row.is-restoration { border-left: 4px solid var(--gold); background: #fffaf0; }
.custom-service-row.is-restoration .custom-price-field { display: none; }
.custom-pricing-note { margin: 14px 0 0; color: var(--muted); font-size: .78rem; }
input.calculated-field { color: var(--navy); background: #edf4f8; font-weight: 800; }
input.manual-override-field { color: var(--navy); background: #fffaf0; font-weight: 850; }
.input-prefix:has(input.manual-override-field) { border-color: #d4a33b; box-shadow: 0 0 0 3px rgba(212,163,59,.12); }
.custom-total-note { grid-column: 1 / -1; margin: -2px 0 0; border-radius: 9px; padding: 10px 12px; color: #405968; background: #f3f8fb; font-size: .78rem; line-height: 1.45; }

.result-card { position: sticky; top: 108px; overflow: hidden; }
.result-band { padding: 25px 24px 22px; color: white; background: linear-gradient(135deg, var(--navy-deep), var(--navy) 58%, var(--blue)); }
.result-band p { margin: 0 0 2px; color: #cae1ef; font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.result-band h3 { display: flex; align-items: baseline; gap: 7px; margin: 0; font-size: clamp(2.15rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.05em; }
.result-band h3 small { font-size: 1rem; font-weight: 700; letter-spacing: 0; }
.funded-pill { display: inline-flex; margin-top: 15px; border: 1px solid rgba(255,255,255,.27); border-radius: 999px; padding: 6px 10px; background: rgba(255,255,255,.1); font-size: .78rem; font-weight: 800; }
.result-body { padding: 16px 20px 10px; }
.result-line { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e5edf2; padding: 10px 0; }
.result-line span { color: var(--muted); font-size: .86rem; }
.result-line strong { text-align: right; color: var(--navy); }
.total-line { margin-top: 5px; border-bottom: 0; border-radius: 10px; padding: 12px; background: var(--blue-soft); }
.contract-total { border-bottom: 0; }
.contract-total strong { color: var(--success); }
.result-note { margin: 0; padding: 0 20px 20px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.result-action { padding: 0 20px 20px; }
.result-action .button { width: 100%; }

.materials-wrap { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.materials-table { width: 100%; min-width: 890px; border-collapse: collapse; }
.materials-table th { padding: 11px 13px; color: #526b7a; background: #f2f7fa; font-size: .76rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.materials-table th:nth-last-child(-n+2), .materials-table td:nth-last-child(-n+2) { text-align: right; }
.materials-table td { border-top: 1px solid #e4edf2; padding: 12px 13px; vertical-align: top; font-size: .86rem; }
.material-name { display: grid; gap: 5px; }
.material-name strong { color: var(--ink); }
.material-name small { color: var(--muted); }
.qty-control { display: grid; grid-template-columns: minmax(70px, 100px) auto; align-items: center; gap: 7px; }
.qty-control input { min-height: 38px; padding: 0 8px; }
.plan-copy { color: #526b7a; line-height: 1.4; }
.empty-materials { padding: 30px; text-align: center; color: var(--muted); }
.warning-box { margin-top: 14px; border-left: 4px solid var(--gold); border-radius: 8px; padding: 11px 13px; color: #704c0c; background: #fff8e8; font-size: .84rem; }

.restoration-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.restoration-summary > div { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #f9fbfc; }
.restoration-summary span { color: var(--muted); font-size: .75rem; }
.restoration-summary strong { color: var(--navy); font-size: 1rem; }
.restoration-summary .featured-total { border-color: var(--blue); color: white; background: var(--navy); }
.restoration-summary .featured-total span, .restoration-summary .featured-total strong { color: white; }
.restoration-summary .featured-total strong { font-size: 1.2rem; }
.locked-field { display: grid; align-content: center; gap: 5px; min-height: 74px; border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #f7fafc; }
.locked-field strong { color: var(--navy); }

.manual-upload-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 22px; align-items: start; }
.manual-upload-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.field small { color: var(--muted); font-size: .75rem; font-weight: 650; }
.file-drop { position: relative; display: grid; min-height: 116px; place-content: center; justify-items: center; border: 2px dashed #b7cedb; border-radius: 13px; padding: 18px; color: var(--navy); background: #f5fafc; text-align: center; cursor: pointer; }
.file-drop:hover, .file-drop:focus-within { border-color: var(--blue); background: #edf7fb; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop strong { font-size: .95rem; }
.file-drop span { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.file-drop.has-files { border-style: solid; border-color: var(--success); background: #edf8f3; }
.customer-visible-toggle { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; color: #405968; background: #f8fbfd; cursor: pointer; }
.customer-visible-toggle input { width: 20px; min-height: 20px; flex: 0 0 auto; margin-top: 1px; }
.customer-visible-toggle span, .customer-visible-toggle strong, .customer-visible-toggle small { display: block; }
.customer-visible-toggle strong { color: var(--navy); font-size: .86rem; }
.customer-visible-toggle small { margin-top: 2px; }
.manual-upload-actions { display: flex; align-items: center; gap: 14px; }
.manual-upload-actions p { margin: 0; color: var(--muted); font-size: .82rem; }
.manual-upload-actions p.success { color: var(--success); }
.manual-upload-actions p.error { color: var(--danger); }
.recent-upload-panel { min-height: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #f8fbfd; }
.recent-upload-panel h4 { margin: 2px 0 15px; color: var(--navy); font-size: 1.05rem; }
.recent-upload-list { display: grid; gap: 9px; }
.recent-upload-item { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: white; }
.recent-upload-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: .7rem; font-weight: 900; }
.recent-upload-copy { min-width: 0; }
.recent-upload-copy strong, .recent-upload-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-upload-copy strong { color: var(--navy); font-size: .8rem; }
.recent-upload-copy span { margin-top: 2px; color: var(--muted); font-size: .69rem; }
.recent-upload-item button { min-height: 32px; border: 1px solid #bfd1db; border-radius: 7px; padding: 0 9px; color: var(--navy); background: white; font-size: .73rem; font-weight: 800; }

.mobile-total { display: none; }

.portal-workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 86px);
  background: #eef4f7;
}
.portal-sidebar {
  position: sticky;
  top: 86px;
  height: calc(100vh - 86px);
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  color: white;
  background: linear-gradient(180deg, #0d4162, #082f49 62%, #06273c);
}
.portal-sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 25px; border-bottom: 1px solid rgba(255,255,255,.12); }
.portal-sidebar-brand .brand-mark { width: 42px; height: 42px; border-radius: 10px; }
.portal-sidebar-brand strong, .portal-sidebar-brand small { display: block; }
.portal-sidebar-brand strong { font-size: 1.05rem; }
.portal-sidebar-brand small { color: #bad4e3; font-size: .76rem; }
.portal-nav { display: grid; gap: 5px; margin-top: 24px; }
.portal-nav-button {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  color: #d6e6ef;
  background: transparent;
  font-size: .88rem;
  font-weight: 700;
  text-align: left;
}
.portal-nav-button > span { display: grid; width: 22px; height: 22px; place-items: center; color: #edc572; font-size: 1rem; }
.portal-nav-button:hover { color: white; background: rgba(255,255,255,.08); }
.portal-nav-button.is-active { color: white; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 0 #edbd5b; }
.portal-support { display: grid; gap: 3px; margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 20px 8px 0; }
.portal-support strong { font-size: .84rem; }
.portal-support span { color: #b8d0dd; font-size: .76rem; }
.portal-support a { color: #f1c86f; font-size: .86rem; font-weight: 750; text-decoration: none; }
.portal-stage { min-width: 0; }
.portal-topbar {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 12px 28px;
  background: white;
}
.portal-property-picker { display: grid; gap: 3px; }
.portal-property-picker > span, .portal-demo-controls > span { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.portal-property-picker select { min-height: 34px; border: 0; padding: 0 28px 0 0; color: var(--navy); background: white; font-weight: 800; }
.portal-demo-controls { display: flex; align-items: center; gap: 10px; }
.portal-plan-switch { display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: #f4f8fa; }
.portal-plan-switch button { min-height: 32px; border: 0; border-radius: 6px; padding: 0 12px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 800; }
.portal-plan-switch button.is-active { color: white; background: var(--blue); box-shadow: 0 4px 12px rgba(25,118,185,.2); }
.portal-content { width: min(1320px, calc(100% - 48px)); margin: 24px auto 70px; }
.portal-view { display: none; }
.portal-view.is-active { display: block; }
.portal-demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; border: 1px solid #eed394; border-radius: 12px; padding: 11px 14px; color: #755211; background: #fff8e8; font-size: .82rem; }
.portal-demo-banner > div:first-child { display: grid; gap: 2px; }
.portal-demo-banner strong { font-weight: 850; }
.portal-demo-banner-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.portal-demo-banner-actions button { min-height: 34px; border: 1px solid #dfbf72; border-radius: 8px; padding: 0 11px; color: #65460d; background: #fffdf7; font-size: .76rem; font-weight: 850; }
.portal-demo-banner-actions button:hover { border-color: #b98521; background: white; }
.portal-live-notice, .portal-live-empty { border: 1px solid #b9d7e6; border-radius: 11px; padding: 14px 16px; color: #315a70; background: #eff8fc; }
.portal-live-notice { display: flex; gap: 8px; margin-top: 14px; }
.portal-live-empty { margin: 0; }
.portal-live-notice strong { color: var(--navy); }
.portal-hero { position: relative; min-height: 220px; overflow: hidden; border-radius: 18px; color: white; box-shadow: var(--shadow); }
.portal-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }
.portal-hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,36,54,.94) 0, rgba(7,51,76,.79) 45%, rgba(7,51,76,.12) 100%); }
.portal-hero-copy { position: relative; z-index: 1; max-width: 680px; padding: 44px 34px; }
.portal-hero-copy p, .portal-hero-copy h2, .portal-hero-copy span { display: block; margin: 0; }
.portal-hero-copy p { margin-bottom: 5px; color: #eec76e; font-size: .8rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.portal-hero-copy h2 { font-size: clamp(1.7rem, 3.6vw, 2.75rem); line-height: 1.12; letter-spacing: -.035em; }
.portal-hero-copy span { margin-top: 9px; color: #d7e8f1; }
.customer-plan-pill { position: absolute; z-index: 2; top: 24px; right: 24px; border: 1px solid rgba(255,218,143,.66); border-radius: 999px; padding: 8px 13px; color: #ffdc90; background: rgba(5,43,67,.82); font-size: .8rem; font-weight: 850; backdrop-filter: blur(8px); }
.portal-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.portal-stat { display: grid; min-height: 128px; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: white; box-shadow: 0 8px 24px rgba(8,59,92,.05); }
.portal-stat > span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.portal-stat strong { color: var(--navy); font-size: 1.16rem; }
.portal-stat small { color: var(--muted); font-size: .75rem; }
.portal-stat .status-good { color: var(--success); }
.portal-stat-gold { border-color: #e7c878; background: #fffaf0; }
.portal-stat-gold strong { color: #7a5611; }
.portal-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.75fr); gap: 14px; margin-top: 14px; }
.portal-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: white; box-shadow: 0 8px 24px rgba(8,59,92,.05); }
.portal-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.portal-card-heading p, .portal-card-heading h3 { margin: 0; }
.portal-card-heading p { color: var(--blue); font-size: .72rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.portal-card-heading h3 { margin-top: 3px; color: var(--navy); font-size: 1.08rem; }
.portal-text-button { flex: 0 0 auto; border: 0; padding: 3px 0; color: var(--blue); background: transparent; font-size: .8rem; font-weight: 850; }
.portal-inspection-body { display: grid; grid-template-columns: 130px minmax(0,1fr); align-items: center; gap: 24px; }
.roof-score { display: grid; width: 116px; aspect-ratio: 1; place-items: center; border-radius: 50%; background: conic-gradient(var(--success) 0 87%, #dce7ec 87% 100%); }
.roof-score > div { display: grid; width: 94px; aspect-ratio: 1; place-content: center; border-radius: 50%; text-align: center; background: white; }
.roof-score strong, .roof-score span { display: block; }
.roof-score strong { color: var(--navy); font-size: 2rem; line-height: 1; }
.roof-score span { margin-top: 4px; color: var(--muted); font-size: .69rem; }
.inspection-findings { display: grid; gap: 13px; }
.inspection-findings p { display: grid; grid-template-columns: 27px minmax(0,1fr); margin: 0; }
.inspection-findings p strong, .inspection-findings p small { grid-column: 2; }
.inspection-findings p strong { color: var(--ink); font-size: .88rem; }
.inspection-findings p small { margin-top: 2px; color: var(--muted); font-size: .76rem; }
.finding-icon { grid-row: 1 / 3; display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; font-size: .72rem; font-weight: 900; }
.finding-icon.good { color: #176d4e; background: #e2f4eb; }
.finding-icon.watch { color: #80580e; background: #fff1cd; }
.forecast-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.forecast-list li { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 10px; border-top: 1px solid #e4ebef; padding: 13px 0; }
.forecast-list li:first-child { border-top: 0; padding-top: 0; }
.forecast-list li > span { color: var(--blue); font-size: .76rem; font-weight: 850; }
.forecast-list strong, .forecast-list small { display: block; }
.forecast-list strong { color: var(--navy); font-size: .85rem; }
.forecast-list small { margin-top: 2px; color: var(--muted); font-size: .73rem; line-height: 1.35; }
.forecast-list .forecast-highlight > span, .forecast-list .forecast-highlight strong { color: #8a6011; }
.portal-preview-photos { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.portal-preview-photos button { position: relative; min-height: 128px; overflow: hidden; border: 0; border-radius: 10px; padding: 0; background: #dbe7ed; }
.portal-preview-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portal-preview-photos button:nth-child(2) img { object-position: 70% 50%; transform: scale(1.7); }
.portal-preview-photos button:nth-child(3) img { object-position: 28% 60%; transform: scale(1.9); }
.portal-preview-photos span { position: absolute; right: 0; bottom: 0; left: 0; padding: 8px; color: white; background: linear-gradient(transparent, rgba(5,37,55,.9)); font-size: .72rem; font-weight: 800; text-align: left; }
.connection-list { display: grid; }
.connection-list p { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; border-top: 1px solid #e4ebef; padding: 14px 0; font-size: .82rem; }
.connection-list p:first-child { border-top: 0; padding-top: 0; }
.connection-list strong { color: var(--success); font-size: .76rem; }
.portal-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.portal-page-heading p, .portal-page-heading h2, .portal-page-heading span { margin: 0; }
.portal-page-heading p { color: var(--blue); font-size: .76rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.portal-page-heading h2 { margin-top: 4px; color: var(--navy); font-size: clamp(1.6rem,3vw,2.3rem); letter-spacing: -.035em; }
.portal-page-heading span { display: block; margin-top: 5px; color: var(--muted); }
.portal-guide-heading { align-items: center; }
.portal-guide-heading .button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; text-decoration: none; }
.portal-guide-highlights { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.portal-guide-highlights article { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 12px; min-height: 104px; border: 1px solid var(--line); border-radius: 13px; padding: 16px; background: white; box-shadow: 0 8px 24px rgba(8,59,92,.05); }
.portal-guide-highlights article > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: white; background: var(--navy); font-size: .76rem; font-weight: 900; }
.portal-guide-highlights article:nth-child(2) > span { background: var(--blue); }
.portal-guide-highlights article:nth-child(3) > span { color: #593e0a; background: #f0c466; }
.portal-guide-highlights strong, .portal-guide-highlights small { display: block; }
.portal-guide-highlights strong { color: var(--navy); font-size: .92rem; }
.portal-guide-highlights small { margin-top: 3px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.portal-handout-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.portal-handout-card { min-width: 0; overflow: hidden; border: 1px solid #bfd2de; border-radius: 16px; padding: 0; color: inherit; background: white; box-shadow: 0 10px 30px rgba(8,59,92,.08); text-align: left; }
.portal-handout-card:hover { border-color: var(--blue); box-shadow: 0 14px 34px rgba(8,59,92,.14); transform: translateY(-1px); }
.portal-handout-card:focus-visible { outline: 3px solid rgba(25,118,185,.3); outline-offset: 3px; }
.portal-handout-label { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; }
.portal-handout-label strong { color: var(--navy); font-size: .92rem; }
.portal-handout-label small { color: var(--muted); font-size: .76rem; text-align: right; }
.portal-handout-image-wrap { position: relative; display: block; overflow: hidden; border-top: 1px solid var(--line); background: #dce8ee; }
.portal-handout-image-wrap img { display: block; width: 100%; aspect-ratio: 11/6; object-fit: cover; }
.portal-handout-image-wrap > span { position: absolute; right: 12px; bottom: 12px; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 6px 10px; color: white; background: rgba(5,43,67,.88); font-size: .72rem; font-weight: 850; backdrop-filter: blur(5px); }
.portal-guide-note { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 24px; margin-top: 16px; border-left: 5px solid var(--gold); border-radius: 13px; padding: 18px 20px; color: var(--ink); background: #fffaf0; }
.portal-guide-note strong, .portal-guide-note span { display: block; }
.portal-guide-note strong { color: var(--navy); }
.portal-guide-note span { margin-top: 3px; max-width: 760px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.portal-guide-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.portal-guide-actions .button { min-height: 38px; font-size: .78rem; }
.portal-handout-large { display: block; width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.portal-handout-caption { margin: 12px 2px 0; color: var(--muted); font-size: .84rem; }
.portal-record-list { display: grid; gap: 12px; }
.portal-record-list article { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: white; box-shadow: 0 8px 24px rgba(8,59,92,.04); }
.record-date { display: grid; place-items: center; border-right: 1px solid var(--line); padding-right: 18px; }
.record-date strong { color: var(--navy); font-size: 1.65rem; line-height: 1; }
.record-date span { margin-top: 4px; color: var(--muted); font-size: .67rem; font-weight: 850; }
.portal-record-list h3, .portal-record-list p { margin: 0; }
.portal-record-list h3 { color: var(--navy); font-size: 1rem; }
.portal-record-list p { margin-top: 3px; color: var(--muted); font-size: .83rem; }
.portal-record-list small { color: #78909d; font-size: .73rem; }
.portal-record-list button, .portal-document-list button { min-height: 38px; border: 1px solid #bad0dd; border-radius: 8px; padding: 0 13px; color: var(--navy); background: white; font-weight: 800; }
.portal-inline-select { display: grid; gap: 4px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.portal-inline-select select { min-width: 210px; }
.customer-photo-library { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.customer-photo-library > button { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; padding: 0; background: white; text-align: left; box-shadow: 0 8px 24px rgba(8,59,92,.05); }
.customer-photo-library img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.customer-photo-library > button:nth-child(2) img, .customer-photo-library > button:nth-child(5) img { object-position: 70% 50%; transform: scale(1.5); }
.customer-photo-library > button:nth-child(3) img, .customer-photo-library > button:nth-child(6) img { object-position: 25% 60%; transform: scale(1.65); }
.customer-photo-library button > span { display: grid; gap: 2px; padding: 11px 13px; }
.customer-photo-library strong { color: var(--navy); font-size: .84rem; }
.customer-photo-library small { color: var(--muted); font-size: .72rem; }
.maintenance-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 8px 24px rgba(8,59,92,.04); }
.maintenance-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.maintenance-table th { padding: 13px 16px; color: #57707f; background: #f4f8fa; font-size: .73rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.maintenance-table td { border-top: 1px solid #e3ebef; padding: 16px; color: #405968; font-size: .84rem; }
.maintenance-table td:first-child { color: var(--navy); font-weight: 800; }
.maintenance-table td:last-child span { border-radius: 999px; padding: 5px 8px; color: #176d4e; background: #e3f4eb; font-size: .72rem; font-weight: 850; }
.portal-document-list { display: grid; gap: 11px; }
.portal-document-list article { display: grid; grid-template-columns: 50px minmax(0,1fr) auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: white; }
.document-type { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: .7rem; font-weight: 900; }
.portal-document-list h3, .portal-document-list p { margin: 0; }
.portal-document-list h3 { color: var(--navy); font-size: .92rem; }
.portal-document-list p { margin-top: 2px; color: var(--muted); font-size: .76rem; }
.portal-account-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.portal-list { display: grid; gap: 10px; }
.portal-property-record, .portal-item { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 11px; padding: 14px; color: inherit; background: #f8fbfd; text-align: left; }
.portal-property-record strong, .portal-item strong { color: var(--navy); }
.portal-property-record span, .portal-property-record small, .portal-item span, .portal-item small, .portal-empty { color: var(--muted); }
.coverage-list { display: grid; gap: 9px; }
.coverage-list p { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: start; gap: 7px; margin: 0; color: #405968; font-size: .82rem; }
.coverage-list p::before { content: "✓"; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #176d4e; background: #e3f4eb; font-size: .68rem; font-weight: 900; }
.current-plan-summary { flex: 0 0 auto; border: 1px solid #b9d7e6; border-radius: 999px; padding: 8px 12px; color: var(--navy) !important; background: #edf7fb; font-size: .78rem; font-weight: 850; }
.portal-plan-estimator { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(420px,.8fr); align-items: end; gap: 26px; border: 1px solid #b9d5e4; border-radius: 16px; padding: 22px; background: linear-gradient(135deg, #f8fcfe, #eaf5fa); box-shadow: 0 8px 24px rgba(8,59,92,.05); }
.portal-plan-estimator h3, .portal-plan-estimator p { margin: 0; }
.portal-plan-estimator h3 { margin-top: 3px; color: var(--navy); font-size: 1.18rem; }
.portal-plan-estimator > div > p:last-child { margin-top: 7px; max-width: 650px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.portal-plan-estimator-fields { display: grid; grid-template-columns: minmax(170px,.7fr) minmax(250px,1.3fr); gap: 12px; }
.portal-plan-estimator-fields .field { margin: 0; }
.input-suffix { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; overflow: hidden; border: 1px solid #b8ccd8; border-radius: 9px; background: white; }
.input-suffix input { min-width: 0; border: 0; }
.input-suffix > span { padding: 0 12px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.customer-plan-price-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.customer-plan-price-card { position: relative; display: grid; min-height: 138px; align-content: center; gap: 7px; overflow: hidden; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 14px; padding: 18px; background: white; box-shadow: 0 8px 24px rgba(8,59,92,.05); }
.customer-plan-price-card::after { content: ""; position: absolute; right: -34px; bottom: -52px; width: 125px; height: 125px; border-radius: 50%; background: rgba(25,118,185,.07); }
.customer-plan-price-card.plan-plus { border-top-color: #1686a8; }
.customer-plan-price-card.plan-plus::after { background: rgba(22,134,168,.08); }
.customer-plan-price-card.plan-signature { border-top-color: #d3a23e; background: linear-gradient(145deg, #fffdf7, #fff8e8); }
.customer-plan-price-card.plan-signature::after { background: rgba(211,162,62,.12); }
.customer-plan-price-card.is-current { border-color: #d3a23e; box-shadow: 0 10px 30px rgba(132,94,19,.14), inset 0 0 0 1px #edd28f; }
.plan-card-topline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-card-topline > span { color: var(--blue); font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.plan-signature .plan-card-topline > span { color: #855c0f; }
.plan-card-topline em { border-radius: 999px; padding: 4px 8px; color: #6f4c0c; background: #f7dfaa; font-size: .67rem; font-style: normal; font-weight: 900; text-transform: uppercase; }
.customer-plan-price-card > strong, .customer-plan-price-card > small { position: relative; z-index: 1; }
.customer-plan-price-card > strong { color: var(--navy); font-size: clamp(1.08rem,2vw,1.45rem); }
.customer-plan-price-card > small { max-width: 360px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.portal-estimate-disclaimer { margin: 14px 0; border-left: 4px solid #d3a23e; border-radius: 10px; padding: 12px 15px; color: #5b6870; background: #fffaf0; font-size: .78rem; line-height: 1.5; }
.portal-estimate-disclaimer strong { color: #6f4c0c; }
.plan-comparison-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 8px 24px rgba(8,59,92,.05); }
.plan-comparison-table { width: 100%; min-width: 860px; border-collapse: collapse; table-layout: fixed; }
.plan-comparison-table th, .plan-comparison-table td { border-left: 1px solid #e3ebef; border-top: 1px solid #e3ebef; padding: 14px 15px; color: #405968; font-size: .8rem; line-height: 1.35; text-align: center; vertical-align: middle; }
.plan-comparison-table tr > :first-child { border-left: 0; }
.plan-comparison-table thead th { border-top: 0; color: var(--navy); background: #f2f7fa; font-size: .86rem; }
.plan-comparison-table thead th:first-child { width: 34%; text-align: left; }
.plan-comparison-table thead th:nth-child(4) { color: #704c0c; background: #fff5dc; }
.plan-comparison-table thead th.is-current { box-shadow: inset 0 4px 0 #d3a23e; }
.plan-comparison-table thead th span { display: block; width: fit-content; margin: 5px auto 0; border-radius: 999px; padding: 3px 7px; color: #6f4c0c; background: #f6dda5; font-size: .62rem; letter-spacing: .05em; text-transform: uppercase; }
.plan-comparison-table tbody th { color: var(--navy); background: #fbfdfe; font-weight: 750; text-align: left; }
.plan-comparison-table.current-essential tbody td:nth-child(2), .plan-comparison-table.current-plus tbody td:nth-child(3), .plan-comparison-table.current-signature tbody td:nth-child(4) { background: #fffcf4; }
.comparison-check { display: inline-grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; color: white; background: #16805c; font-size: .72rem; font-weight: 900; }
.comparison-dash { color: #9aacb6; font-weight: 800; }
.custom-plan-callout { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 14px; border-radius: 16px; padding: 20px 22px; color: white; background: linear-gradient(115deg, #083b5c, #0d557e); box-shadow: 0 10px 28px rgba(8,59,92,.16); }
.custom-plan-callout p, .custom-plan-callout h3, .custom-plan-callout span { margin: 0; }
.custom-plan-callout .eyebrow { color: #f0ca75; }
.custom-plan-callout h3 { margin-top: 3px; color: white; font-size: 1.08rem; }
.custom-plan-callout span { display: block; margin-top: 5px; max-width: 760px; color: #d7e8f1; font-size: .82rem; line-height: 1.45; }
.custom-plan-callout .button { flex: 0 0 auto; text-decoration: none; }
.portal-detail-dialog { width: min(900px, calc(100% - 28px)); max-height: calc(100vh - 28px); overflow: auto; border: 0; border-radius: 18px; padding: 0; color: var(--ink); box-shadow: 0 30px 90px rgba(5,43,67,.35); }
.portal-detail-dialog::backdrop { background: rgba(5,29,44,.68); backdrop-filter: blur(4px); }
.portal-detail-shell { padding: 26px; }
.portal-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.portal-detail-header p, .portal-detail-header h2 { margin: 0; }
.portal-detail-header h2 { margin-top: 3px; color: var(--navy); }
.report-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.report-summary > div { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #f7fafc; }
.report-summary span { color: var(--muted); font-size: .72rem; }
.report-summary strong { color: var(--navy); font-size: .9rem; }
.report-section { border-top: 1px solid var(--line); padding: 17px 0; }
.report-section h3 { margin: 0 0 8px; color: var(--navy); font-size: 1rem; }
.report-section p, .report-section li { color: #4d6573; font-size: .86rem; }
.report-photo { width: 100%; max-height: 480px; border-radius: 12px; object-fit: cover; }

.agreement-dialog { width: min(940px, calc(100% - 28px)); max-height: calc(100vh - 28px); border: 0; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: 0 30px 90px rgba(5,43,67,.35); }
.agreement-dialog::backdrop { background: rgba(5,29,44,.68); backdrop-filter: blur(4px); }
.agreement-shell { padding: 28px; }
.agreement-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.agreement-header h2 { margin: 2px 0 0; color: var(--navy); }
.portal-detail-actions { display: flex; align-items: center; gap: 10px; }
.dialog-close { width: 40px; height: 40px; border: 0; border-radius: 50%; color: var(--navy); background: var(--blue-soft); font-size: 1.6rem; line-height: 1; }
.legal-warning { margin: 20px 0; border-left: 4px solid var(--gold); border-radius: 9px; padding: 13px 15px; color: #704c0c; background: #fff8e8; font-weight: 700; }
.agreement-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.agreement-summary > div { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 10px; padding: 11px; background: #f8fbfd; }
.agreement-summary span { color: var(--muted); font-size: .76rem; }
.agreement-summary strong { color: var(--navy); font-size: .9rem; }
.agreement-copy { max-height: 430px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: white; }
.agreement-copy h1, .agreement-copy h2, .agreement-copy h3 { color: var(--navy); }
.agreement-copy h2 { margin: 22px 0 8px; font-size: 1.05rem; }
.agreement-copy p, .agreement-copy li { color: #405968; font-size: .88rem; line-height: 1.55; }
.agreement-copy ol, .agreement-copy ul { padding-left: 22px; }
.legal-draft-banner { margin: 0 0 18px; border: 2px solid #d6a234; border-radius: 11px; padding: 13px 15px; color: #704c0c; background: #fff8e8; }
.legal-draft-banner strong, .legal-draft-banner span { display: block; }
.legal-draft-banner span { margin-top: 3px; font-size: .82rem; line-height: 1.4; }
.agreement-order-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .86rem; }
.agreement-order-table th, .agreement-order-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.agreement-order-table th { width: 34%; color: var(--navy); background: #f3f8fb; }
.legal-decision { border-left: 4px solid var(--gold); padding: 10px 12px; background: #fffaf0; }
.signature-disclosure-heading { color: #803728; }
.signature-disclosure { border: 2px solid #b9513a; border-radius: 10px; padding: 12px 14px; color: #5d2d24; background: #fff5f1; }
.agreement-selected-scope { margin: 0 0 18px; border: 1px solid #b9d5e4; border-radius: 11px; padding: 14px 16px; background: #f1f8fc; }
.agreement-selected-scope h3 { margin: 0 0 8px; }
.agreement-selected-scope ul { margin: 0; padding-left: 20px; columns: 2; }
.agreement-selected-scope li { break-inside: avoid; margin: 4px 0; }
.agreement-selected-scope p { margin: 12px 0 0; color: var(--navy); }
.signature-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.attestation-stack { margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; background: #f8fbfd; }
.consent-row { display: flex; gap: 10px; margin: 12px 0; align-items: start; color: #405968; font-size: .9rem; line-height: 1.45; }
.consent-row input { width: 20px; min-height: 20px; flex: 0 0 auto; margin-top: 2px; }
.signature-nonrefund-row { border: 2px solid #b9513a; border-radius: 10px; padding: 12px; color: #5d2d24; background: #fff5f1; }
.electronic-record-note { margin: 0 0 12px 30px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.signed-agreement-record { color: #334f5f; }
.signed-agreement-record h1, .signed-agreement-record h2, .signed-agreement-record h3 { color: var(--navy); }
.execution-certificate { margin-top: 20px; border: 2px solid var(--navy); border-radius: 12px; padding: 16px; background: #f7fbfd; }
.execution-certificate h3 { margin: 0 0 12px; color: var(--navy); }
.execution-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.execution-grid div { display: grid; gap: 2px; }
.execution-grid span { color: var(--muted); font-size: .74rem; }
.execution-grid strong { overflow-wrap: anywhere; color: var(--navy); font-size: .84rem; }
.execution-signature { display: block; width: min(360px,100%); max-height: 130px; margin-top: 14px; border-bottom: 1px solid var(--line); object-fit: contain; object-position: left bottom; }
.signature-pad-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.signature-pad-heading { display: flex; justify-content: space-between; padding: 9px 12px; color: var(--navy); background: #f2f7fa; font-size: .85rem; font-weight: 800; }
.text-button { border: 0; color: var(--blue); background: transparent; font-weight: 800; }
#signature_pad { display: block; width: 100%; height: 150px; background: repeating-linear-gradient(0deg, #fff 0, #fff 36px, #eef3f6 37px); touch-action: none; }
.agreement-message { min-height: 24px; color: var(--muted); font-size: .86rem; }
.agreement-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 1120px) {
  .pricing-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .restoration-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manual-upload-layout { grid-template-columns: 1fr; }
  .recent-upload-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .portal-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .portal-dashboard-grid { grid-template-columns: 1fr; }
  .portal-photo-preview { grid-row: auto; }
}

@media (max-width: 900px) {
  .calculator-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
  .intro-row { display: block; }
  .intro-copy { margin-top: 10px; }
  .portal-workspace { grid-template-columns: 82px minmax(0,1fr); }
  .portal-sidebar { padding: 18px 10px; }
  .portal-sidebar-brand { justify-content: center; padding: 0 0 18px; }
  .portal-sidebar-brand > div, .portal-nav-button:not(.is-active) { font-size: 0; }
  .portal-nav-button { justify-content: center; gap: 0; padding: 0; font-size: 0; }
  .portal-nav-button.is-active { font-size: 0; }
  .portal-nav-button > span { font-size: 1.05rem; }
  .portal-support { display: none; }
  .portal-topbar { align-items: flex-start; padding: 12px 18px; }
  .portal-demo-controls { align-items: flex-end; flex-direction: column; gap: 4px; }
  .portal-content { width: min(100% - 30px, 1320px); }
  .portal-account-grid { grid-template-columns: 1fr; }
  .portal-plan-estimator { grid-template-columns: 1fr; }
  .portal-guide-highlights { grid-template-columns: 1fr; }
  .portal-guide-note { grid-template-columns: 1fr; }
  .portal-guide-actions { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .header-inner, .workspace { width: min(100% - 24px, 1440px); }
  .header-inner { min-height: 70px; }
  .header-meta > span { display: none; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-lockup p { font-size: .68rem; }
  .workspace { margin-top: 22px; }
  .input-card, .pricing-card, .funding-card, .upload-card { padding: 18px; }
  .form-grid, .pricing-inputs, .funding-grid, .manual-upload-form { grid-template-columns: 1fr; }
  .connected-record-heading { display: grid; }
  .source-lock { justify-self: start; }
  .connected-record-result, .connected-record-selected { grid-template-columns: 30px minmax(0,1fr); }
  .connected-record-result > .button, .connected-record-result > .record-waiting, .connected-record-selected > .text-button { grid-column: 2; justify-self: start; }
  .custom-service-row { grid-template-columns: 1fr; gap: 9px; }
  .custom-service-row .custom-price-field { grid-template-columns: 105px minmax(0,1fr); align-items: center; }
  .custom-service-row.is-restoration { padding-left: 10px; }
  .custom-plan-heading { display: grid; }
  .custom-plan-heading > strong { justify-self: start; }
  .recent-upload-list { grid-template-columns: 1fr; }
  .manual-upload-actions { align-items: stretch; flex-direction: column; }
  .manual-upload-actions .button { width: 100%; }
  .restoration-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading-split { align-items: flex-start; }
  .price-list-note { display: none; }
  .mobile-total {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 14px;
    padding: 12px 15px;
    color: white;
    background: rgba(8,59,92,.96);
    box-shadow: 0 14px 34px rgba(5,43,67,.28);
    backdrop-filter: blur(10px);
  }
  .agreement-shell { padding: 20px; }
  .agreement-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signature-fields { grid-template-columns: 1fr; }
  .execution-grid { grid-template-columns: 1fr; }
  .mobile-total strong { margin-right: 3px; font-size: 1.25rem; }
  .mobile-total small { color: #cfe3ef; }
  .portal-workspace { display: block; min-height: calc(100vh - 74px); }
  .portal-sidebar { position: sticky; z-index: 15; top: 74px; width: 100%; height: auto; padding: 8px 10px; }
  .portal-sidebar-brand, .portal-support { display: none; }
  .portal-nav { grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; margin: 0; }
  .portal-nav-button { min-height: 42px; }
  .portal-nav-button[data-portal-view="account"] { display: none; }
  .portal-topbar { display: block; min-height: 0; padding: 10px 14px; }
  .portal-property-picker select { width: 100%; }
  .portal-demo-controls { margin-top: 8px; align-items: stretch; }
  .portal-plan-switch { width: 100%; }
  .portal-plan-switch button { flex: 1; padding: 0 6px; }
  .agreement-selected-scope ul { columns: 1; }
  .portal-content { width: min(100% - 20px, 1320px); margin-top: 12px; }
  .portal-demo-banner { align-items: stretch; flex-direction: column; }
  .portal-demo-banner-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .portal-hero { min-height: 260px; }
  .portal-hero-overlay { background: linear-gradient(180deg, rgba(5,36,54,.25), rgba(5,36,54,.93) 75%); }
  .portal-hero-copy { position: absolute; right: 0; bottom: 0; left: 0; padding: 78px 20px 20px; }
  .customer-plan-pill { top: 14px; right: 14px; }
  .portal-stat-grid { grid-template-columns: 1fr; }
  .portal-inspection-body { grid-template-columns: 1fr; }
  .roof-score { margin: 0 auto; }
  .portal-preview-photos, .customer-photo-library { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .portal-page-heading { align-items: stretch; flex-direction: column; }
  .portal-handout-grid { grid-template-columns: 1fr; }
  .portal-guide-heading .button { width: 100%; }
  .portal-record-list article { grid-template-columns: 60px minmax(0,1fr); }
  .portal-record-list article > button { grid-column: 2; justify-self: start; }
  .portal-document-list article { grid-template-columns: 45px minmax(0,1fr); }
  .portal-document-list article > button { grid-column: 2; justify-self: start; }
  .report-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .portal-plan-estimator-fields, .customer-plan-price-grid { grid-template-columns: 1fr; }
  .custom-plan-callout { align-items: stretch; flex-direction: column; }
  .custom-plan-callout .button { width: 100%; }
}

@media (max-width: 470px) {
  .button-ghost { min-height: 38px; padding: 0 11px; }
  .brand-lockup h1 { font-size: 1.05rem; }
  .brand-lockup p { display: none; }
  .restoration-summary { grid-template-columns: 1fr; }
  .intro-row h2 { font-size: 1.6rem; }
  .connected-record-search-row { grid-template-columns: 1fr; }
  .portal-preview-photos, .customer-photo-library { grid-template-columns: 1fr; }
  .portal-hero-copy h2 { font-size: 1.55rem; }
  .portal-detail-shell { padding: 18px; }
  .portal-guide-actions { display: grid; }
  .report-summary { grid-template-columns: 1fr; }
}

@media print {
  .app-header { position: static; }
  .button, .mobile-total { display: none !important; }
  .workspace { width: 100%; margin: 20px 0; }
  .card { break-inside: avoid; box-shadow: none; }
  .result-card { position: static; }
}
