:root {
  color-scheme: light;
  --navy: #071b36;
  --blue: #1268a7;
  --blue-dark: #0b4f82;
  --sky: #eaf5fc;
  --gold: #f2c94c;
  --ink: #172334;
  --muted: #607084;
  --line: #d7e1ea;
  --green: #177a54;
  --red: #bd4147;
  --surface: #fff;
  --shadow: 0 18px 48px rgba(7,27,54,.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #edf3f7; color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, label:focus-within { outline: 3px solid rgba(18,104,167,.17); outline-offset: 2px; }
.topbar { min-height: 82px; padding: 10px clamp(18px,4vw,58px); display: flex; align-items: center; gap: 13px; background: white; border-bottom: 1px solid var(--line); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; color: white; background: var(--navy); font-weight: 900; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { color: var(--navy); }
.brand-copy span { color: var(--muted); font-size: .72rem; }
.prototype-pill { margin-left: auto; padding: 7px 10px; border-radius: 999px; background: #fff0bd; color: #6f5110; font-size: .68rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.shell { width: min(1440px,calc(100% - 32px)); margin: 0 auto; padding: 34px 0 70px; }
.intro { max-width: 820px; margin-bottom: 24px; }
.eyebrow, .step-label { display: block; margin-bottom: 5px; color: var(--blue); font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; color: var(--navy); font-size: clamp(2rem,4vw,3.15rem); line-height: 1.04; letter-spacing: -.035em; }
h2 { margin-bottom: 0; color: var(--navy); font-size: clamp(1.35rem,2vw,1.7rem); }
.intro p { margin: 0; color: var(--muted); line-height: 1.6; }
.app-card { padding: clamp(20px,3vw,32px); border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.app-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.text-button { padding: 8px; border: 0; background: transparent; color: var(--blue); font-weight: 850; }
.progress { margin: 24px 0 28px; padding: 0; display: grid; grid-template-columns: repeat(5,1fr); list-style: none; }
.progress li { position: relative; display: grid; justify-items: center; gap: 5px; color: #929fac; font-size: .68rem; font-weight: 800; }
.progress li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: #dfe6ed; }
.progress li:first-child::before { display: none; }
.progress b { position: relative; z-index: 1; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: #6f7d8c; background: #e8edf2; }
.progress .is-active, .progress .is-complete { color: var(--blue); }
.progress .is-active b, .progress .is-complete b { color: white; background: var(--blue); }
.progress .is-active::before, .progress .is-complete::before { background: #79b9d9; }
.page-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(340px,1fr); gap: 24px; align-items: start; }
.wizard-page { min-height: 610px; padding: clamp(22px,3vw,30px); display: flex; flex-direction: column; border: 1px solid #bad4e7; border-radius: 17px; background: linear-gradient(135deg,#f9fdff,#eaf5fc); }
.wizard-page .lead { margin: 8px 0 20px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.upload-grid { display: grid; grid-template-columns: minmax(0,420px); gap: 11px; }
.upload-tile { position: relative; min-height: 170px; padding: 17px; display: grid; align-content: start; gap: 6px; border: 1px dashed #8db6d2; border-radius: 13px; background: white; cursor: pointer; }
.upload-tile.is-ready { border-style: solid; border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,122,84,.08); }
.upload-number { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-size: .74rem; font-weight: 900; }
.upload-tile strong { color: var(--navy); }
.upload-tile small { min-height: 38px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.upload-tile input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-status { margin-top: auto; padding: 7px 9px; overflow: hidden; border-radius: 8px; background: var(--sky); color: var(--blue); font-size: .69rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.upload-tile.is-ready .file-status { background: #e6f5ed; color: var(--green); }
.garage-choice { margin: 18px 0 0; padding: 17px; border: 1px solid #bdd3e3; border-radius: 14px; background: rgba(255,255,255,.7); }
.garage-choice legend { padding: 0 7px; color: var(--navy); font-weight: 850; }
.garage-choice > p { margin: 2px 0 12px; color: var(--muted); font-size: .77rem; }
.garage-choice > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.garage-choice label { padding: 12px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; }
.garage-choice label.is-selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,104,167,.09); }
.garage-choice input { width: 18px; height: 18px; margin: 2px 0 0; }
.garage-choice span { display: grid; gap: 3px; }
.garage-choice strong { color: var(--navy); font-size: .82rem; }
.garage-choice small { color: var(--muted); font-size: .7rem; }
.privacy-note { margin: 14px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.scope-note { margin: 13px 0 0; padding: 12px 14px; border: 1px solid #bdd3e3; border-radius: 11px; background: #fff; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.scope-note strong { color: var(--navy); }
.page-actions { margin-top: auto; padding-top: 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-actions > div, .trace-actions, .trace-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.split-actions { align-items: stretch; }
.single-action { justify-content: flex-end; }
.primary-button, .secondary-button { min-height: 43px; padding: 9px 14px; border-radius: 9px; font-weight: 850; }
.primary-button { border: 1px solid var(--blue); background: var(--blue); color: white; }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { border: 1px solid #b7c7d4; background: white; color: var(--navy); }
.instruction-box { margin-top: 6px; padding: 14px; display: flex; gap: 12px; align-items: center; border-radius: 12px; background: white; border: 1px solid var(--line); color: #44546a; font-size: .82rem; line-height: 1.45; }
.instruction-box b { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--blue); }
.scale-readout { margin: 14px 0 0; padding: 11px 13px; border-radius: 9px; background: #f5f8fa; color: var(--muted); font-size: .78rem; }
.scale-readout.is-ready { background: #e7f5ee; color: var(--green); font-weight: 800; }
.run-summary { margin: 15px 0; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 12px; background: white; border: 1px solid var(--line); }
.run-summary span { color: var(--muted); font-size: .78rem; }
.run-summary strong { color: var(--navy); font-size: 1.2rem; }
.run-summary > div { display: grid; gap: 2px; text-align: right; }
.run-summary small { color: var(--muted); font-size: .66rem; }
.saved-runs { margin: -4px 0 14px; overflow: hidden; border: 1px solid #bdd3e3; border-radius: 12px; background: white; }
.saved-runs-heading { padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; background: #f5f8fa; }
.saved-runs-heading strong { color: var(--navy); font-size: .76rem; }
.saved-runs-heading span { color: var(--muted); font-size: .68rem; }
.saved-run-row { padding: 10px 12px; display: grid; grid-template-columns: 26px 1fr auto auto; gap: 9px; align-items: center; border-top: 1px solid #edf1f4; }
.saved-run-row b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--run-color); color: #071b36; font-size: .7rem; }
.saved-run-row span { display: grid; gap: 2px; color: var(--muted); font-size: .72rem; }
.saved-run-row small { color: #8794a2; font-size: .61rem; }
.saved-run-row strong { color: var(--navy); font-size: .82rem; }
.saved-run-row button { border: 0; background: transparent; color: #a33b31; font-size: .68rem; font-weight: 800; }
.trace-actions, .trace-buttons { margin-top: 3px; }
.run-choice { margin-top: 14px; padding: 16px; border: 1px solid #9fc5df; border-radius: 13px; background: #eef8ff; }
.run-choice strong { display: block; color: var(--navy); font-size: .95rem; }
.run-choice p { margin: 5px 0 13px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.run-choice > div { display: flex; flex-wrap: wrap; gap: 8px; }
.visual-panel { position: sticky; top: 18px; min-height: 500px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #f7fafc; box-shadow: 0 12px 30px rgba(7,27,54,.07); }
.visual-empty { min-height: 500px; padding: 35px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.visual-empty > span { font-size: 3rem; color: #9fb1c1; }
.visual-empty strong { margin-top: 8px; color: var(--navy); }
.visual-empty p { max-width: 250px; margin: 6px auto 0; font-size: .8rem; line-height: 1.45; }
.visual-heading { padding: 13px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; background: white; border-bottom: 1px solid var(--line); }
.visual-heading > div { display: grid; gap: 2px; }
.visual-heading span:not(.view-badge) { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; }
.visual-heading strong { color: var(--navy); }
.view-badge { padding: 5px 8px; border-radius: 999px; background: var(--sky); color: var(--blue); font-size: .63rem; font-weight: 850; }
.canvas-wrap { position: relative; min-height: 360px; display: grid; place-items: center; overflow: hidden; background: #dfe6ec; touch-action: none; }
canvas { display: block; width: 100%; height: auto; max-height: 65vh; object-fit: contain; cursor: crosshair; }
.canvas-prompt { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 8px 12px; border-radius: 999px; background: rgba(7,27,54,.91); color: white; font-size: .72rem; font-weight: 800; white-space: nowrap; pointer-events: none; }
.photo-strip { padding: 10px; display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; background: white; border-top: 1px solid var(--line); }
.photo-thumb { position: relative; height: 70px; overflow: hidden; border: 2px solid transparent; border-radius: 9px; background: #e1e7ed; }
.photo-thumb:only-child { grid-column: 1 / -1; }
.photo-thumb.is-front { border-color: var(--blue); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb span { position: absolute; inset: auto 0 0; padding: 3px; background: rgba(7,27,54,.76); color: white; text-align: center; font-size: .58rem; font-weight: 800; }
.visual-note { margin: 0; padding: 10px 13px; background: white; color: var(--muted); font-size: .67rem; line-height: 1.4; }
.totals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.totals-grid > div { padding: 14px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.totals-grid span { color: var(--muted); font-size: .72rem; }
.totals-grid strong { color: var(--navy); font-size: 1.15rem; }
.totals-grid small { color: #8794a2; font-size: .64rem; }
.totals-grid .total { grid-column: 1/-1; background: var(--navy); }
.totals-grid .total span { color: #afc5d9; }
.totals-grid .total strong { color: var(--gold); font-size: 1.45rem; }
.totals-grid .total small { color: #afc5d9; }
.audit-card { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.audit-heading { padding: 12px; display: flex; justify-content: space-between; gap: 12px; background: #f5f8fa; }
.audit-heading strong { color: var(--navy); font-size: .8rem; }
.audit-heading span { color: var(--muted); font-size: .65rem; }
.audit-row { padding: 10px 12px; display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; align-items: center; border-top: 1px solid #edf1f4; }
.audit-row i { width: 9px; height: 9px; border-radius: 50%; background: var(--run-color); }
.audit-row div { display: grid; gap: 2px; }
.audit-row span { color: var(--muted); font-size: .7rem; }
.audit-row small { color: #8794a2; font-size: .61rem; }
.audit-row strong { color: var(--navy); font-size: .78rem; }
.audit-row button { padding: 4px; border: 0; background: transparent; color: var(--red); font-size: .63rem; font-weight: 800; }
.accuracy-note { margin-top: 14px; padding: 13px; border-radius: 11px; background: #fff7da; color: #64552a; font-size: .72rem; line-height: 1.45; }
.toast { position: fixed; z-index: 10; right: 18px; bottom: 18px; max-width: 340px; padding: 11px 14px; border-radius: 10px; background: var(--navy); color: white; font-size: .8rem; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .page-layout { grid-template-columns: 1fr; }
  .visual-panel { position: static; min-height: auto; }
  .visual-empty { min-height: 260px; }
  .wizard-page { min-height: 0; }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 20px,1440px); padding-top: 22px; }
  .topbar { padding: 10px 12px; }
  .brand-copy span { display: none; }
  .prototype-pill { max-width: 130px; text-align: center; font-size: .55rem; }
  .app-card { padding: 14px; }
  .upload-grid { grid-template-columns: 1fr; }
  .upload-tile { min-height: 128px; }
  .garage-choice > div, .totals-grid { grid-template-columns: 1fr; }
  .progress li span { font-size: .56rem; }
  .page-actions, .split-actions { align-items: stretch; flex-direction: column-reverse; }
  .page-actions > div { justify-content: stretch; }
  .page-actions > div button, .page-actions > button { flex: 1; }
  .saved-run-row { grid-template-columns: 26px 1fr auto; }
  .saved-run-row button { grid-column: 2 / 4; justify-self: start; }
  .canvas-wrap { min-height: 250px; }
}

/* Office four-side workspace */
.office-intro { max-width: 900px; }
.office-layout { grid-template-columns: minmax(0, 1.65fr) minmax(340px, .85fr); align-items: start; }
.office-workspace { min-width: 0; }
.property-fields { display: grid; grid-template-columns: 1fr 190px; gap: 14px; margin: 18px 0; }
.property-fields label, .side-setup-card > label:not(.upload-tile) { display: grid; gap: 7px; color: #34465f; font-size: .78rem; font-weight: 800; }
.property-fields input, .property-fields select, .side-setup-card select, .side-setup-card input[type="number"] { min-height: 44px; width: 100%; border: 1px solid #bed1e2; border-radius: 10px; background: #fff; padding: 9px 11px; color: #0a2342; font: inherit; }
.office-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.side-setup-card { display: grid; gap: 11px; padding: 12px; border: 1px solid #c8d9e8; border-radius: 14px; background: rgba(255,255,255,.64); }
.side-setup-card .upload-tile { min-height: 128px; margin: 0; }
.side-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.side-tab { display: grid; gap: 2px; min-height: 58px; border: 1px solid #bdd1e4; border-radius: 11px; background: #fff; padding: 9px; color: #24415f; text-align: left; font-weight: 800; cursor: pointer; }
.side-tab small { color: #677d94; font-size: .66rem; font-weight: 700; }
.side-tab.is-active { border-color: #0f6ca8; box-shadow: inset 0 0 0 1px #0f6ca8; background: #e8f5fc; color: #072b4e; }
.side-tab.is-complete small { color: #13734d; }
.side-status-list { display: grid; gap: 7px; margin: 14px 0; }
.side-status-row { display: flex; justify-content: space-between; gap: 12px; border: 1px solid #d4e0ea; border-radius: 10px; background: #fff; padding: 10px 12px; font-size: .76rem; color: #4a6077; }
.side-status-row strong { color: #102a46; text-transform: capitalize; }
.office-total-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.office-total-grid > div { display: grid; gap: 4px; border: 1px solid #cbdbe8; border-radius: 13px; background: #fff; padding: 14px; }
.office-total-grid span { color: #5b6e82; font-size: .75rem; font-weight: 800; }
.office-total-grid strong { color: #092846; font-size: 1.18rem; }
.office-total-grid small { color: #708399; }
.office-total-grid .grand { grid-column: 1 / -1; background: #08294a; }
.office-total-grid .grand span, .office-total-grid .grand strong, .office-total-grid .grand small { color: #fff; }
.side-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 15px 0; }
.side-breakdown-card { border: 1px solid #cfdeea; border-radius: 12px; background: #f9fcff; padding: 12px; }
.side-breakdown-card strong { display: block; color: #0a2d50; text-transform: capitalize; margin-bottom: 6px; }
.side-breakdown-card span { display: block; color: #5d7187; font-size: .75rem; line-height: 1.45; }
.office-layout .visual-panel { position: sticky; top: 18px; }
.supplemental-views { margin-top: 18px; padding: 16px; border: 1px dashed #95bad5; border-radius: 15px; background: #f1f8fd; }
.supplemental-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 12px; }
.supplemental-heading h3 { margin: 0; color: #0a2d50; font-size: 1rem; }
.supplemental-heading p { max-width: 660px; margin: 5px 0 0; color: #60758b; font-size: .74rem; line-height: 1.45; }
.optional-side-card[hidden] { display: none; }
.optional-side-card { background: #fff; }
.remove-extra-button { justify-self: start; border: 0; background: transparent; padding: 3px 0; color: #a13e35; font: inherit; font-size: .7rem; font-weight: 800; cursor: pointer; }
.optional-limit { margin: 10px 0 0; color: #60758b; font-size: .7rem; font-weight: 700; }

@media (max-width: 1020px) {
  .office-layout { grid-template-columns: 1fr; }
  .office-layout .visual-panel { position: static; }
}
@media (max-width: 700px) {
  .property-fields, .office-upload-grid, .office-total-grid, .side-breakdown { grid-template-columns: 1fr; }
  .office-total-grid .grand { grid-column: auto; }
  .side-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supplemental-heading { align-items: stretch; flex-direction: column; }
}
