:root {
  color-scheme: light;
  --ink: #14283d;
  --ink-2: #243c53;
  --orange: #f4a226;
  --orange-dark: #c66e08;
  --paper: #ffffff;
  --canvas: #edf1f4;
  --line: #d7dee4;
  --muted: #667585;
  --soft: #f6f8fa;
  --danger: #a93434;
  --shadow: 0 14px 34px rgba(20, 40, 61, .1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
input, textarea, select { color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.is-hidden { display: none !important; }

.landing-view { min-height: 100vh; background: #f4f6f7; }
.landing-nav { min-height: 74px; padding: 0 clamp(20px, 5vw, 72px); background: var(--ink); color: white; display: flex; align-items: center; justify-content: space-between; }
.btn-nav { color: white; background: #243d54; border-color: #50677a; }
.btn-nav:hover { background: #304b63; }
.landing-hero { min-height: 620px; padding: clamp(58px, 7vw, 96px) clamp(20px, 7vw, 104px); display: grid; grid-template-columns: minmax(0, .92fr) minmax(440px, .82fr); align-items: center; gap: clamp(48px, 8vw, 120px); background: var(--ink); color: white; position: relative; overflow: hidden; }
.landing-hero::after { content: ""; position: absolute; width: 320px; height: 320px; border: 70px solid rgba(244,162,38,.08); transform: rotate(18deg); right: -210px; top: 50px; }
.hero-copy, .profit-preview { position: relative; z-index: 1; }
.landing-kicker { display: block; color: var(--orange); font-weight: 850; text-transform: uppercase; font-size: .78rem; letter-spacing: .11em; margin-bottom: 16px; }
.hero-copy h1 { max-width: 760px; margin: 0; font-size: clamp(2.65rem, 5.4vw, 5.6rem); line-height: .99; letter-spacing: -.055em; }
.hero-copy h1 em { color: var(--orange); font-style: normal; }
.hero-lede { max-width: 650px; color: #c9d3dc; font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.65; margin: 26px 0 30px; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.btn-large { min-height: 52px; padding: 0 22px; font-size: .98rem; }
.text-button { color: white; background: transparent; border: 0; padding: 12px 0; font-weight: 800; }
.text-button:hover { color: var(--orange); }
.text-button span { margin-left: 7px; }
.local-promise { color: #9eb0bf; font-size: .78rem; margin: 20px 0 0; }
.local-promise span { color: #63b486; margin-right: 5px; }
.profit-preview { background: white; color: var(--ink); padding: clamp(24px, 3vw, 38px); box-shadow: 18px 18px 0 rgba(244,162,38,.92); border-top: 6px solid var(--orange); }
.preview-topline { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.preview-label { color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: .09em; font-weight: 850; }
.preview-topline h2 { margin: 5px 0 0; font-size: 1.35rem; }
.status-pill { background: #e5f3eb; color: #26704a; border: 1px solid #c0dfce; border-radius: 99px; padding: 6px 10px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.preview-stats { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 12px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.preview-stats span, .preview-stats strong, .preview-stats small { display: block; }
.preview-stats span { color: var(--muted); font-size: .72rem; font-weight: 750; }
.preview-stats strong { font-size: clamp(1.2rem, 2.1vw, 1.75rem); margin-top: 5px; letter-spacing: -.03em; }
.preview-stats small { color: #26704a; margin-top: 3px; font-weight: 800; font-size: .72rem; }
.profit-stat { border-left: 3px solid var(--orange); padding-left: 14px; }
.cost-progress { padding: 23px 0 8px; display: grid; gap: 18px; }
.progress-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: .78rem; }
.progress-row span { color: var(--muted); }
.progress-track { height: 7px; background: #e6eaed; margin-top: 8px; overflow: hidden; }
.progress-fill { display: block; height: 100%; background: #52738f; }
.progress-fill.over { background: #cf553e; }
.budget-warning { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; background: #fff0ec; color: #7f3023; padding: 14px; border-left: 4px solid #cf553e; }
.budget-warning > span { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: #cf553e; color: white; font-weight: 900; }
.budget-warning p { margin: 0; font-size: .78rem; line-height: 1.45; }
.budget-warning strong { display: block; }
.landing-focus { padding: clamp(64px, 8vw, 110px) clamp(20px, 7vw, 104px); max-width: 1500px; margin: 0 auto; }
.focus-intro { display: grid; grid-template-columns: 1.15fr .85fr; column-gap: 80px; align-items: end; }
.focus-intro .landing-kicker { grid-column: 1 / -1; color: var(--orange-dark); }
.focus-intro h2 { margin: 0; font-size: clamp(2rem, 4vw, 4rem); line-height: 1; letter-spacing: -.045em; }
.focus-intro p { color: var(--muted); line-height: 1.65; margin: 0; font-size: 1.05rem; }
.focus-steps { margin-top: 52px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.focus-steps article { padding: 28px 30px 32px 0; }
.focus-steps article + article { border-left: 1px solid var(--line); padding-left: 30px; }
.focus-steps span { color: var(--orange-dark); font-size: .75rem; font-weight: 900; }
.focus-steps h3 { margin: 20px 0 8px; font-size: 1.1rem; }
.focus-steps p { color: var(--muted); line-height: 1.55; margin: 0; font-size: .9rem; }
.build-note { margin: 28px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.build-note strong { color: var(--ink); }

.topbar { height: 72px; padding: 0 24px; background: var(--ink); color: white; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 11px; }
.brand-button { border: 0; background: transparent; padding: 0; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--orange); color: var(--ink); font-weight: 900; letter-spacing: -.08em; clip-path: polygon(50% 0, 100% 25%, 100% 100%, 0 100%, 0 25%); padding-top: 5px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; letter-spacing: .01em; }
.brand small { font-size: .75rem; color: #b8c5d0; margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.save-status { font-size: .8rem; color: #b8c5d0; margin-right: 6px; }
.btn { min-height: 42px; border-radius: 6px; border: 1px solid transparent; padding: 0 16px; font-weight: 750; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, textarea:focus-visible, .estimate-item:focus-visible { outline: 3px solid rgba(244, 162, 38, .42); outline-offset: 2px; }
.btn-primary { background: var(--orange); color: #1b2835; border-color: var(--orange); }
.btn-primary:hover { background: #ffb23b; }
.btn-secondary { background: transparent; color: white; border-color: #597086; }
.btn-secondary:hover { background: #243c53; }
.btn-wide { width: 100%; }

.app-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.project-rail { background: #f8fafb; border-right: 1px solid var(--line); padding: 24px 16px 18px; display: flex; flex-direction: column; min-width: 0; }
.rail-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 16px; }
.rail-heading h2, .summary-card h2 { margin: 3px 0 0; font-size: 1.2rem; }
.eyebrow { color: var(--orange-dark); font-weight: 850; text-transform: uppercase; font-size: .72rem; letter-spacing: .09em; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 5px; background: var(--ink); color: white; font-size: 1.55rem; line-height: 1; }
.search-field { margin: 0 0 16px; }
.search-field input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 5px; padding: 0 11px; background: white; font-size: .88rem; }
.estimate-list { display: grid; gap: 7px; overflow-y: auto; }
.estimate-item { width: 100%; text-align: left; border: 1px solid transparent; background: transparent; padding: 11px 12px; border-radius: 5px; color: var(--ink); }
.estimate-item:hover { background: #eef3f6; }
.estimate-item.active { background: white; border-color: var(--line); box-shadow: 0 3px 12px rgba(20,40,61,.07); border-left: 4px solid var(--orange); padding-left: 9px; }
.estimate-item strong, .estimate-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.estimate-item strong { font-size: .9rem; }
.estimate-item span { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.local-note { margin: auto 4px 0; padding-top: 18px; color: var(--muted); font-size: .75rem; }
.local-note span { color: #397b59; margin-right: 4px; }

.workspace { min-width: 0; padding: 28px; display: grid; grid-template-columns: minmax(560px, 920px) 292px; gap: 24px; align-items: start; justify-content: center; }
.friday-review { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 24px; align-items: center; background: var(--ink); color: white; padding: 22px 24px; border-top: 5px solid var(--orange); box-shadow: var(--shadow); }
.friday-review h2 { margin: 4px 0 6px; font-size: 1.35rem; }
.friday-review p { margin: 0; color: #c8d3dc; font-size: .82rem; line-height: 1.5; max-width: 590px; }
.friday-review .eyebrow { color: #ffbd58; }
.friday-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(105px, 1fr)); border-left: 1px solid #42566a; }
.friday-stats > div { padding: 3px 17px; border-right: 1px solid #42566a; }
.friday-stats dt { color: #afbdc9; font-size: .68rem; }
.friday-stats dd { margin: 5px 0 0; color: white; font-size: 1.05rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.friday-actions { display: grid; gap: 8px; min-width: 160px; }
.friday-actions .btn { min-height: 40px; }
.friday-actions .btn-secondary { color: white; border-color: #607386; }
.estimate-paper { background: var(--paper); box-shadow: var(--shadow); border-top: 5px solid var(--ink); min-width: 0; grid-column: 1; grid-row: 2; }
.paper-head { padding: 28px 30px 24px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.paper-meta-fields { display: grid; grid-template-columns: 190px 170px; gap: 12px; align-items: end; }
.title-input { display: block; border: 0; padding: 3px 0; width: min(520px, 100%); font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 850; letter-spacing: -.035em; background: transparent; }
.estimate-ref { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.field { display: block; min-width: 0; }
.field > span { display: block; margin-bottom: 6px; font-size: .78rem; font-weight: 800; color: var(--ink-2); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: white; padding: 10px 11px; min-height: 42px; }
.field textarea { resize: vertical; line-height: 1.45; }
.date-field { min-width: 170px; }
.details-grid { padding: 24px 30px 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-bottom: 1px solid var(--line); }
.section-title { grid-column: 1 / -1; margin: 0 0 3px; font-size: 1.05rem; }
.field-wide { grid-column: 1 / -1; }

.actual-costs-section { background: #edf4f8; border-bottom: 1px solid #cbd8e1; padding-bottom: 24px; }
.actual-heading { padding-bottom: 8px; }
.actual-help { margin: 0 30px 16px; color: var(--muted); font-size: .82rem; }
.quick-forecast { display: none; }
.actual-cost-form { padding: 0 30px; display: grid; grid-template-columns: 120px 150px minmax(190px, 1fr); gap: 10px; align-items: end; }
.actual-cost-form .btn { min-height: 42px; }
.actual-form-actions { display: flex; align-items: center; gap: 14px; min-height: 42px; }
.cancel-cost { color: #175f82; padding: 8px 0; }
.cancel-cost:hover { color: var(--ink); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: white; }
.btn-ink:hover { background: var(--ink-2); }
.prefix-input { position: relative; }
.prefix-input > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 750; }
.prefix-input input { padding-left: 27px; }
.actual-cost-list { margin: 18px 30px 0; background: white; border: 1px solid #d6e0e7; }
.actual-empty { margin: 0; padding: 16px; color: var(--muted); font-size: .82rem; }
.actual-cost-row { display: grid; grid-template-columns: 82px 116px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #e8edf0; }
.actual-cost-row:last-child { border-bottom: 0; }
.actual-category { color: #285c77; background: #e8f2f7; padding: 5px 7px; font-weight: 800; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.cost-timing { padding: 5px 7px; font-weight: 850; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.cost-timing.spent { background: #e8f2f7; color: #285c77; }
.cost-timing.upcoming { background: #fff1dc; color: #8a5416; }
.actual-description-text strong, .actual-description-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actual-description-text strong { font-size: .84rem; }
.actual-description-text small { color: var(--muted); font-size: .7rem; margin-top: 2px; }
.actual-amount { font-weight: 850; font-size: .86rem; font-variant-numeric: tabular-nums; }
.actual-row-actions { display: flex; align-items: center; gap: 5px; }
.actual-action { min-height: 34px; border: 1px solid var(--line); background: white; color: #315d76; border-radius: 4px; padding: 5px 8px; font-weight: 800; font-size: .7rem; }
.actual-action:hover { background: #eef5f8; }
.actual-action.mark-paid { color: #256847; border-color: #bfd8c9; }
.remove-actual { width: 34px; height: 34px; border: 0; background: transparent; color: #7e8b97; border-radius: 4px; font-size: 1.1rem; }
.remove-actual:hover { background: #faeeee; color: var(--danger); }
.cost-list-toggle { display: block; margin: 12px 30px 0; border: 0; background: transparent; color: #175f82; font-weight: 850; font-size: .8rem; padding: 5px 0; }
.cost-list-toggle:hover { text-decoration: underline; }

.job-setup { border-top: 1px solid var(--line); }
.job-setup > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 30px; cursor: pointer; background: #f8fafb; border-bottom: 1px solid var(--line); }
.job-setup > summary::-webkit-details-marker { display: none; }
.job-setup > summary strong, .job-setup > summary small { display: block; }
.job-setup > summary strong { font-size: 1rem; }
.job-setup > summary small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.job-setup > summary > span:last-child { color: #315d76; font-size: 1.4rem; transition: transform .15s ease; }
.job-setup[open] > summary > span:last-child { transform: rotate(180deg); }
.setup-print { margin-top: 16px; color: var(--ink); border-color: #98a7b4; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.setup-actions .btn { color: var(--ink); border-color: #98a7b4; }

.cost-section { border-bottom: 1px solid var(--line); }
.section-heading { padding: 20px 30px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading > div { display: flex; align-items: baseline; gap: 11px; }
.section-heading h2 { margin: 0; font-size: 1rem; }
.step-number { color: var(--orange-dark); font-weight: 900; font-size: .74rem; letter-spacing: .05em; }
.section-total { color: var(--muted); font-weight: 750; font-size: .82rem; }
.cost-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cost-table th { text-align: left; color: var(--muted); font-size: .71rem; text-transform: uppercase; letter-spacing: .05em; background: var(--soft); padding: 9px 8px; border-top: 1px solid #e7ebee; border-bottom: 1px solid #e7ebee; }
.cost-table th:first-child, .cost-table td:first-child { padding-left: 30px; width: auto; }
.cost-table th:nth-child(2), .cost-table td:nth-child(2) { width: 92px; }
.cost-table th:nth-child(3), .cost-table td:nth-child(3) { width: 112px; }
.cost-table th:nth-child(4), .cost-table td:nth-child(4) { width: 104px; }
.cost-table th:nth-child(5), .cost-table td:nth-child(5) { width: 50px; }
.cost-table td { padding: 8px; border-bottom: 1px solid #eef1f3; }
.cost-table input { width: 100%; min-height: 38px; border: 1px solid transparent; border-radius: 3px; padding: 7px 8px; background: transparent; }
.cost-table input:hover, .cost-table input:focus { border-color: var(--line); background: white; }
.line-value { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; font-size: .88rem; }
.remove-line { width: 34px; height: 34px; border: 0; background: transparent; color: #8592a0; font-size: 1.2rem; border-radius: 4px; }
.remove-line:hover { color: var(--danger); background: #faeeee; }
.add-line { margin: 10px 30px 18px; border: 0; background: transparent; color: #175f82; padding: 4px 0; font-weight: 800; font-size: .82rem; }
.add-line:hover { text-decoration: underline; }

.adjustments { border-bottom: 1px solid var(--line); }
.adjustment-grid { padding: 0 30px 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
.suffix-input { position: relative; }
.suffix-input input { padding-right: 34px; }
.suffix-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.check-field { min-height: 65px; border: 1px solid var(--line); border-radius: 4px; display: flex; align-items: center; padding: 9px 10px; gap: 8px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--ink); }
.check-field strong, .check-field small { display: block; }
.check-field strong { font-size: .78rem; }
.check-field small { color: var(--muted); font-size: .7rem; margin-top: 2px; }
.notes-section { padding: 24px 30px 30px; }

.summary-panel { position: sticky; top: 96px; display: grid; gap: 14px; grid-column: 2; grid-row: 2; }
.health-card { background: white; padding: 21px; border-top: 5px solid #3d7796; box-shadow: var(--shadow); }
.health-card h2 { margin: 3px 0 17px; font-size: 1.2rem; }
.health-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.job-status { border-radius: 99px; padding: 6px 9px; font-size: .68rem; font-weight: 900; white-space: nowrap; }
.job-status.green { background: #e3f3e9; color: #256847; }
.job-status.amber { background: #fff0d7; color: #8c550f; }
.job-status.red { background: #fae4e1; color: #9c3026; }
.job-status.neutral { background: #e9edf0; color: #5b6873; }
.forecast-list { margin: 0; }
.forecast-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; color: var(--muted); font-size: .8rem; }
.forecast-list dd { margin: 0; color: var(--ink); font-weight: 850; font-variant-numeric: tabular-nums; }
.forecast-list .forecast-cost { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 12px; color: var(--ink); }
.forecast-profit { margin: 14px -21px 12px; padding: 16px 21px; background: #eff7f2; border-top: 1px solid #cfe3d6; border-bottom: 1px solid #cfe3d6; }
.forecast-profit span, .forecast-profit strong, .forecast-profit small { display: block; }
.forecast-profit span { color: var(--muted); font-size: .72rem; }
.forecast-profit strong { color: #276b4d; font-size: 1.8rem; letter-spacing: -.035em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.forecast-profit small { color: #317a58; font-weight: 800; font-size: .7rem; margin-top: 2px; }
.forecast-profit.amber { background: #fff7e9; border-color: #ecd8b6; }
.forecast-profit.amber strong, .forecast-profit.amber small { color: #8c550f; }
.forecast-profit.red { background: #fff0ed; border-color: #eccbc5; }
.forecast-profit.red strong, .forecast-profit.red small { color: #9c3026; }
.forecast-formula { font-size: .69rem; color: var(--muted); padding: 0 0 10px; margin: 0; border-bottom: 1px solid var(--line); }
.forecast-rule { margin: 0; padding: 9px 0; color: var(--muted); font-size: .67rem; line-height: 1.4; border-bottom: 1px solid var(--line); }
.forecast-draft { margin: 0; padding: 9px 0; color: #285c77; font-size: .7rem; font-weight: 800; border-bottom: 1px solid var(--line); }
.health-alert { color: var(--muted); font-size: .73rem; line-height: 1.45; margin: 0; }
.health-alert.warning { color: #9a5815; font-weight: 750; }
.health-alert.danger { color: var(--danger); font-weight: 800; }
.summary-card { background: var(--ink); color: white; padding: 24px; box-shadow: var(--shadow); border-top: 5px solid var(--orange); }
.summary-card .eyebrow { color: #ffbd58; }
.summary-card dl { margin: 20px 0 0; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; color: #ced7df; font-size: .84rem; }
.summary-row dd { margin: 0; color: white; font-weight: 750; font-variant-numeric: tabular-nums; }
.summary-row.rule { border-top: 1px solid #41576b; margin-top: 5px; padding-top: 13px; }
.grand-total { margin: 15px -24px 16px; padding: 18px 24px; background: #0d1d2c; border-top: 1px solid #41576b; border-bottom: 1px solid #41576b; }
.grand-total span, .grand-total strong { display: block; }
.grand-total span { color: #ced7df; font-size: .76rem; margin-bottom: 4px; }
.grand-total strong { color: #ffbd58; font-size: 2rem; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.profit-note { color: #b9c7d2; font-size: .74rem; line-height: 1.45; margin: 0 0 17px; }
.danger-link { width: 100%; border: 0; background: transparent; color: var(--danger); font-weight: 750; font-size: .8rem; margin-top: 12px; padding: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 11px 16px; border-radius: 5px; box-shadow: var(--shadow); font-size: .85rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-quote { display: none; }

@media (max-width: 1100px) {
  .landing-hero { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: 900px; }
  .profit-preview { max-width: 760px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .friday-review { grid-column: 1; grid-row: 1; grid-template-columns: 1fr; }
  .friday-stats { border-left: 0; border-top: 1px solid #42566a; padding-top: 14px; }
  .friday-stats > div:first-child { padding-left: 0; }
  .friday-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estimate-paper { grid-column: 1; grid-row: 3; }
  .summary-panel { position: static; display: grid; grid-column: 1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; align-items: start; }
  .summary-panel .danger-link { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .landing-nav { min-height: 66px; padding: 9px 16px; }
  .landing-nav .brand small { display: none; }
  .btn-nav { min-height: 40px; padding: 0 12px; font-size: .82rem; }
  .landing-hero { min-height: 0; padding: 52px 20px 64px; gap: 46px; }
  .hero-copy h1 { font-size: clamp(2.55rem, 12vw, 4rem); }
  .hero-lede { font-size: 1rem; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 7px; }
  .profit-preview { padding: 22px 18px; box-shadow: 10px 10px 0 rgba(244,162,38,.92); }
  .preview-stats { grid-template-columns: 1fr 1fr; }
  .profit-stat { grid-column: 1 / -1; border-left: 0; border-top: 3px solid var(--orange); padding: 13px 0 0; }
  .landing-focus { padding: 64px 20px; }
  .focus-intro { display: block; }
  .focus-intro p { margin-top: 20px; }
  .focus-steps { grid-template-columns: 1fr; margin-top: 36px; }
  .focus-steps article { padding: 24px 0; }
  .focus-steps article + article { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .topbar { height: auto; min-height: 64px; padding: 10px 14px; }
  .brand small, .save-status { display: none; }
  .top-actions .btn { padding: 0 11px; min-height: 40px; }
  .app-shell { display: block; }
  .project-rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .rail-heading { padding-bottom: 10px; }
  .estimate-list { grid-auto-flow: column; grid-auto-columns: minmax(180px, 75%); overflow-x: auto; padding-bottom: 4px; }
  .local-note { margin: 8px 4px 0; padding: 0; }
  .workspace { padding: 12px; gap: 12px; }
  .friday-review { padding: 19px 18px; gap: 16px; }
  .friday-review h2 { font-size: 1.2rem; }
  .friday-stats { grid-template-columns: 1fr; padding: 0; border-top: 1px solid #42566a; }
  .friday-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 9px 0; border-right: 0; border-bottom: 1px solid #354b5e; }
  .friday-stats dd { font-size: .95rem; }
  .friday-actions { grid-template-columns: 1fr 1fr; }
  .paper-head { padding: 22px 18px 18px; display: block; }
  .paper-meta-fields { grid-template-columns: 1fr; margin-top: 16px; }
  .date-field { min-width: 0; }
  .details-grid { padding: 20px 18px; grid-template-columns: 1fr; }
  .field-wide, .section-title { grid-column: 1; }
  .section-heading { padding: 18px 18px 12px; }
  .cost-table thead { display: none; }
  .cost-table, .cost-table tbody, .cost-table tr, .cost-table td { display: block; width: 100% !important; }
  .cost-table tr { padding: 10px 46px 10px 18px; border-top: 1px solid #eef1f3; position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .cost-table td { border: 0; padding: 0 !important; }
  .cost-table td:first-child { grid-column: 1 / -1; }
  .cost-table td:nth-child(4) { text-align: left; padding: 8px 8px 0 !important; color: var(--muted); }
  .cost-table td:nth-child(5) { position: absolute; right: 8px; top: 14px; width: 34px !important; }
  .cost-table input { border-color: var(--line); background: white; }
  .cost-table td:nth-child(2)::before, .cost-table td:nth-child(3)::before { display: block; font-size: .68rem; color: var(--muted); margin-bottom: 3px; }
  .cost-table td:nth-child(2)::before { content: "Quantity"; }
  .cost-table td:nth-child(3)::before { content: "Rate"; }
  .add-line { margin-left: 18px; }
  .actual-help { margin: 0 18px 15px; }
  .quick-forecast { position: sticky; top: 64px; z-index: 8; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 18px 14px; background: #d9e2e8; border: 1px solid #d9e2e8; box-shadow: 0 5px 12px rgba(18, 43, 61, .12); }
  .quick-forecast > span { min-width: 0; padding: 9px 8px; background: white; text-align: center; }
  .quick-forecast small, .quick-forecast strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .quick-forecast small { color: var(--muted); font-size: .61rem; text-transform: uppercase; letter-spacing: .04em; }
  .quick-forecast strong { margin-top: 3px; color: var(--ink); font-size: .78rem; }
  .quick-forecast.amber strong { color: #8c550f; }
  .quick-forecast.red strong { color: #9c3026; }
  .actual-cost-form { padding: 0 18px; grid-template-columns: 1fr 1fr; }
  .actual-description { grid-column: 1 / -1; grid-row: 1; }
  .actual-form-actions { align-self: end; grid-column: 1 / -1; }
  .actual-form-actions .btn { flex: 1; }
  .actual-cost-list { margin: 16px 18px 0; }
  .cost-list-toggle { margin-left: 18px; }
  .actual-cost-row { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
  .actual-category { grid-column: 1; }
  .cost-timing { grid-column: 1; }
  .actual-description-text { grid-column: 2; grid-row: 1 / span 2; }
  .actual-amount { grid-column: 2; grid-row: 3; }
  .actual-row-actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px solid #eef1f3; padding-top: 8px; }
  .actual-action { min-height: 40px; padding: 7px 11px; }
  .remove-actual { width: 40px; height: 40px; }
  .job-setup > summary { padding: 18px; }
  .adjustment-grid { padding: 0 18px 22px; grid-template-columns: 1fr 1fr; }
  .notes-section { padding: 20px 18px; }
  .summary-panel { display: grid; grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 16mm; }
  body { background: white; color: #111; }
  .no-print, .workspace, .topbar, .app-shell, .landing-view { display: none !important; }
  .print-quote { display: block; font-family: Arial, sans-serif; }
  .quote-head { display: flex; justify-content: space-between; border-bottom: 4px solid #14283d; padding-bottom: 16px; margin-bottom: 24px; }
  .quote-brand { font-size: 22pt; font-weight: 900; color: #14283d; }
  .quote-title { text-align: right; }
  .quote-title h1 { margin: 0; font-size: 20pt; }
  .quote-title p { margin: 4px 0 0; }
  .quote-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
  .quote-block h2, .quote-scope h2 { margin: 0 0 7px; font-size: 9pt; text-transform: uppercase; color: #5c6874; letter-spacing: .08em; }
  .quote-block p, .quote-scope p { margin: 2px 0; line-height: 1.4; }
  .quote-scope { border: 1px solid #d7dee4; padding: 14px; margin-bottom: 22px; }
  .quote-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
  .quote-table th { background: #14283d; color: white; text-align: left; padding: 9px; font-size: 9pt; }
  .quote-table th:last-child, .quote-table td:last-child { text-align: right; }
  .quote-table td { padding: 9px; border-bottom: 1px solid #d7dee4; }
  .quote-totals { margin-left: auto; width: 290px; }
  .quote-total-row { display: flex; justify-content: space-between; padding: 6px 0; }
  .quote-total-row.grand { border-top: 2px solid #14283d; margin-top: 6px; padding-top: 10px; font-size: 15pt; font-weight: 900; }
  .quote-notes { margin-top: 28px; border-top: 1px solid #d7dee4; padding-top: 14px; white-space: pre-wrap; font-size: 9pt; }
  .quote-footer { margin-top: 30px; color: #667585; font-size: 8pt; }
}
