:root {
  color-scheme: light;
  --ink: #17221b;
  --muted: #667269;
  --paper: #f4f1e9;
  --surface: #fffdf7;
  --surface-soft: #ebe8df;
  --line: #dcd9cf;
  --green-900: #123c2b;
  --green-700: #245b43;
  --green-500: #4f8468;
  --green-100: #dbe8de;
  --lime: #bfd66d;
  --amber: #c9802d;
  --amber-soft: #f4e6d2;
  --red: #a14539;
  --shadow: 0 16px 48px rgb(23 34 27 / 8%);
  --radius: 20px;
  --sidebar: 246px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.8rem); font-weight: 500; letter-spacing: -0.045em; line-height: 0.98; }
h2 { margin-bottom: 8px; font-size: 1.05rem; line-height: 1.25; }
h3 { margin: 24px 0 10px; font-size: .92rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; grid-template-rows: 72px 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20; display: flex; flex-direction: column; gap: 25px; padding: 22px 18px; background: var(--green-900); color: #f9f7ef; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; }
.brand-mark, .grainwork-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px 3px 10px 3px; background: var(--lime); color: var(--green-900); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; }
.brand-name { font-size: 1.05rem; font-weight: 750; letter-spacing: -.02em; }
.sidebar-project { display: flex; flex-direction: column; gap: 5px; padding: 14px; border: 1px solid rgb(255 255 255 / 13%); border-radius: 15px; background: rgb(255 255 255 / 5%); }
.sidebar .eyebrow, .sidebar .muted-small { color: rgb(255 255 255 / 60%); }
.desktop-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-button, .mobile-nav-button { appearance: none; border: 0; background: transparent; cursor: pointer; }
.nav-button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 11px; color: rgb(255 255 255 / 70%); text-align: left; transition: .16s ease; }
.nav-button:hover { color: white; background: rgb(255 255 255 / 7%); }
.nav-button-active { background: rgb(255 255 255 / 12%); color: white; }
.nav-icon { position: relative; display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; border: 1.6px solid currentColor; border-radius: 5px; opacity: .9; }
.nav-icon-capture::before { content: "+"; position: absolute; inset: -3px 0 0; text-align: center; font-weight: 700; }
.nav-icon-estimate::before { content: "$"; position: absolute; inset: 0; text-align: center; font-size: 11px; font-weight: 800; line-height: 16px; }
.nav-icon-plan { border-radius: 50%; }
.nav-icon-plan::after { content: ""; position: absolute; left: 4px; top: 3px; width: 6px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(35deg); }
.nav-icon-work { border-radius: 3px; transform: rotate(45deg) scale(.8); }
.nav-icon-record::before { content: ""; position: absolute; left: 4px; top: 4px; width: 8px; height: 1px; background: currentColor; box-shadow: 0 3px currentColor, 0 6px currentColor; }
.nav-icon-overview::before { content: ""; position: absolute; left: 3px; top: 3px; width: 4px; height: 4px; background: currentColor; box-shadow: 7px 0 currentColor, 0 7px currentColor, 7px 7px currentColor; }
.topbar { grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid rgb(220 217 207 / 70%); background: rgb(244 241 233 / 90%); backdrop-filter: blur(16px); }
.topbar-project { display: flex; align-items: center; gap: 12px; }
.mobile-brand { display: none; color: var(--green-700); font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.sync-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .78rem; cursor: pointer; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 3px var(--green-100); }
.sync-offline .sync-dot, .sync-waiting .sync-dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.sync-needs_review .sync-dot, .sync-error .sync-dot { background: var(--red); box-shadow: 0 0 0 3px #f1dcd8; }
.sync-refreshing .sync-dot, .sync-syncing .sync-dot, .sync-analyzing .sync-dot, .sync-uploading .sync-dot { animation: pulse 1s infinite alternate; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green-900); color: white; font-size: .72rem; font-weight: 800; }

.workspace-main { grid-column: 2; grid-row: 2; min-width: 0; }
.sync-notice { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 22px 38px -14px; padding: 17px 18px; border: 1px solid #dfc394; border-radius: 15px; background: #f8eddb; }
.sync-notice-error { border-color: #dfb5ae; background: #f5e4e0; }
.sync-notice strong { display: block; margin-bottom: 5px; }
.sync-notice p { max-width: 720px; margin: 0; }
.page { width: min(1260px, 100%); margin: 0 auto; padding: 42px 38px 70px; }
.page-header { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-bottom: 30px; }
.page-header > div:first-child { max-width: 760px; }
.page-description { max-width: 680px; margin: 11px 0 0; color: var(--muted); line-height: 1.55; }
.page-actions, .inline-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--green-700); font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.5; }
.muted-small { color: var(--muted); font-size: .72rem; line-height: 1.4; }

.button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 11px; font-size: .82rem; font-weight: 750; cursor: pointer; transition: transform .14s ease, background .14s ease; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .6; }
.button-primary { background: var(--green-900); color: white; }
.button-primary:hover { background: #1b4a36; }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--green-900); }
.button-quiet { background: var(--green-100); color: var(--green-900); }
.text-button { appearance: none; border: 0; padding: 0; background: transparent; color: var(--green-700); font-size: .8rem; font-weight: 800; cursor: pointer; text-align: left; }

.overview-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 18px; }
.card { min-width: 0; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 18px rgb(23 34 27 / 3%); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price-card { min-height: 315px; background: var(--green-900); color: white; border-color: transparent; }
.price-card .eyebrow, .price-card .muted, .price-card .metric-label { color: rgb(255 255 255 / 64%); }
.price-card .text-button { color: var(--lime); }
.confidence { padding: 6px 9px; border-radius: 999px; background: rgb(255 255 255 / 11%); color: rgb(255 255 255 / 75%); font-size: .69rem; }
.confidence-good { background: rgb(191 214 109 / 16%); color: #d9e6a8; }
.price-range { display: flex; flex-direction: column; gap: 7px; margin: 25px 0 28px; }
.price-range strong { font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 500; letter-spacing: -.045em; white-space: nowrap; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.metric-label { color: var(--muted); font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.metric strong { overflow: hidden; font-size: .93rem; text-overflow: ellipsis; white-space: nowrap; }
.price-stack { display: flex; height: 8px; margin: 25px 0 18px; overflow: hidden; border-radius: 99px; background: rgb(255 255 255 / 10%); }
.price-segment-material { background: #85b397; }
.price-segment-labor { background: var(--lime); }
.price-segment-other { background: #d8b985; }
.price-segment-overhead { background: #e8be71; }
.price-segment-profit { background: #dd8855; }
.price-segment-scope { background: var(--lime); }
.next-card { display: flex; flex-direction: column; justify-content: center; min-height: 315px; }
.next-card h2 { margin: 15px 0 7px; font-family: Georgia, serif; font-size: 1.75rem; font-weight: 500; letter-spacing: -.025em; }
.phase-pill, .status-chip, .verification { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 999px; background: var(--surface-soft); color: var(--green-700); font-size: .67rem; font-weight: 750; }
.next-card .inline-actions { margin-top: 16px; }
.count-badge { display: grid; place-items: center; min-width: 25px; height: 25px; padding: 0 7px; border-radius: 999px; background: var(--green-100); color: var(--green-900); font-size: .72rem; font-weight: 800; }
.consideration-preview { margin: 15px 0; border-top: 1px solid var(--line); }
.suggestion-row { appearance: none; display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: .82rem; text-align: left; cursor: pointer; }
.suggestion-severity { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }
.severity-risk { background: var(--amber); }
.severity-safety { background: var(--red); }
.chevron { color: #99a19a; font-size: 1.25rem; }
.progress-track { height: 9px; margin: 16px 0 21px; border-radius: 99px; background: var(--surface-soft); overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--green-500); }
.status-list { display: flex; flex-direction: column; gap: 12px; }
.progress-card .text-button { margin-top: 18px; }
.status-row { display: grid; grid-template-columns: 21px 1fr auto; gap: 9px; align-items: center; font-size: .8rem; }
.status-check { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; color: white; font-size: .7rem; }
.status-complete { border-color: var(--green-500); background: var(--green-500); }

.capture-zone { display: flex; flex-direction: column; align-items: center; padding: 42px 24px; border: 1.5px dashed #a8b5aa; border-radius: var(--radius); background: var(--surface); text-align: center; }
.capture-zone p { max-width: 520px; }
.capture-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 16px; background: var(--green-100); color: var(--green-900); font-size: 1.8rem; }
.upload-progress { width: min(420px, 100%); height: 7px; margin: 20px 0 8px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.upload-progress span { display: block; height: 100%; background: var(--green-500); transition: width .15s linear; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.media-tile { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.media-tile img, .media-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-placeholder { display: grid; place-items: center; background: var(--surface-soft); color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.media-meta { display: flex; flex-direction: column; gap: 7px; padding: 12px; font-size: .76rem; }
.verification-verified { background: var(--green-100); }
.verification-uploading { background: var(--amber-soft); color: #8b5b21; }

.estimate-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.estimate-strip .metric { padding: 16px; background: var(--surface); }
.estimate-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.estimate-search { min-width: min(360px, 100%); min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font: inherit; }
.estimate-filter-row { display: flex; align-items: center; gap: 7px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.estimate-filter { flex: 0 0 auto; min-height: 34px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: .7rem; cursor: pointer; }
.estimate-filter-active { border-color: var(--green-700); background: var(--green-100); color: var(--green-900); font-weight: 800; }
.estimate-table { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.estimate-row { display: grid; grid-template-columns: minmax(210px, 1.6fr) repeat(4, minmax(90px, .68fr)) 30px; gap: 12px; align-items: center; min-height: 66px; padding: 10px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.estimate-header { min-height: 42px; color: var(--muted); font-size: .67rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.estimate-phase { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; min-height: 62px; padding: 11px 18px; border-bottom: 1px solid #bdd0c0; background: var(--green-100); color: var(--green-900); }
.estimate-phase > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.estimate-phase small { color: var(--green-700); }
.estimate-line { border-bottom: 1px solid var(--line); }
.estimate-line .estimate-row { border-bottom: 0; }
.estimate-line-expanded { background: #fbfaf5; }
.estimate-item { width: 100%; cursor: pointer; transition: background .14s ease; }
.estimate-item:hover { background: #f9f7f0; }
.estimate-name { display: flex; flex-direction: column; gap: 4px; }
.estimate-name small { color: var(--muted); }
.estimate-range { color: var(--muted); font-size: .72rem; }
.estimate-inline-detail { display: grid; grid-template-columns: minmax(220px, .7fr) 1.5fr auto; gap: 20px; align-items: center; padding: 18px; border-top: 1px solid var(--line); background: #fbfaf5; }
.estimate-math { display: flex; flex-direction: column; gap: 6px; }
.estimate-math span { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.estimate-costs { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 12px; }
.estimate-costs .metric { min-width: 0; }
.estimate-inline-detail .source-note { grid-column: 1 / -1; margin: 0; }
.estimate-empty { display: flex; min-height: 150px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px; text-align: center; }
.margin { color: var(--green-700); font-weight: 750; }
.margin-low { color: var(--amber); }
.estimate-total { border-bottom: 0; background: var(--green-900); color: white; }

.plan-timeline { position: relative; display: flex; flex-direction: column; gap: 12px; }
.plan-timeline::before { content: ""; position: absolute; left: 25px; top: 28px; bottom: 28px; width: 1px; background: var(--line); }
.plan-step { position: relative; z-index: 1; display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; min-height: 100px; padding: 18px 20px 18px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.step-number { display: grid; place-items: center; justify-self: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: .75rem; font-weight: 800; }
.plan-complete .step-number { border-color: var(--green-500); background: var(--green-500); color: white; }
.step-copy h2 { margin-bottom: 7px; }
.step-meta { display: flex; gap: 15px; color: var(--muted); font-size: .72rem; }
.step-actions { display: flex; align-items: center; gap: 12px; }

.active-work-card { padding: 28px; border-radius: var(--radius); background: var(--green-900); color: white; }
.work-progress { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid rgb(255 255 255 / 12%); }
.active-work-card .eyebrow { color: rgb(255 255 255 / 60%); }
.active-work-card .button-primary { background: var(--lime); color: var(--green-900); }
.active-work-card .button-primary:hover { background: #cfdf92; }
.work-checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 20px 0; overflow: hidden; border-radius: 12px; background: rgb(255 255 255 / 12%); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 55px; padding: 13px; background: rgb(255 255 255 / 6%); font-size: .8rem; }
.check-row input { accent-color: var(--lime); }
.completion-ready { max-width: 640px; padding: 28px; border: 1px solid #b9caa5; border-radius: var(--radius); background: #eef3df; }
.completion-ready h2 { margin-bottom: 7px; font-family: Georgia, serif; font-size: 1.75rem; font-weight: 500; }
.completion-ready .button { margin-top: 10px; }

.record-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 14px; align-items: center; margin-bottom: 28px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.record-timeline { display: flex; flex-direction: column; }
.record-event { display: grid; grid-template-columns: 17px 1fr; gap: 16px; padding: 0 0 24px; }
.record-event:not(:last-child) { background: linear-gradient(var(--line), var(--line)) 7px 15px / 1px calc(100% - 2px) no-repeat; }
.record-event p { margin: 4px 0; }
.record-dot { width: 15px; height: 15px; border: 4px solid var(--paper); border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 1px var(--green-500); }
.record-change { background: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.record-completion { background: var(--lime); box-shadow: 0 0 0 1px var(--green-700); }

.drawer-layer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.drawer-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgb(10 22 16 / 42%); backdrop-filter: blur(2px); cursor: default; }
.drawer { position: relative; z-index: 1; width: min(510px, 94vw); height: 100%; padding: 27px; overflow-y: auto; background: var(--surface); box-shadow: -20px 0 60px rgb(10 22 16 / 18%); animation: drawer-in .18s ease-out; }
.drawer-close { appearance: none; position: absolute; top: 17px; right: 17px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 1.25rem; cursor: pointer; }
.drawer-body { padding-top: 36px; }
.drawer-body h2 { max-width: 400px; margin-bottom: 11px; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; letter-spacing: -.03em; }
.drawer-lead { color: #445048; font-size: 1rem; line-height: 1.55; }
.drawer-list { margin-top: 17px; border-top: 1px solid var(--line); }
.drawer-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 25px; }
.labor-rate-list { margin-top: 18px; }
.labor-rate-row { margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid var(--line); }
.labor-rate-row legend { padding: 0; color: var(--ink); font-weight: 800; }
.labor-rate-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.labor-rate-field { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 750; }
.currency-input { display: flex; align-items: center; gap: 5px; min-height: 46px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.currency-input input { min-width: 0; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .94rem; }
.currency-input input:focus { outline: 0; }
.progress-requirements { margin: 22px 0; padding: 16px; border-radius: 13px; background: var(--surface-soft); }
.progress-requirements .compact-list { margin-top: 10px; }
.evidence-picker { display: flex; flex-direction: column; gap: 1px; margin: 22px 0; padding: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.evidence-picker legend { width: 100%; padding: 12px 14px; background: var(--surface-soft); font-size: .74rem; font-weight: 800; }
.evidence-picker > p { padding: 12px 14px; }
.evidence-choice { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 10px 14px; border-top: 1px solid var(--line); background: white; color: #435047; font-size: .82rem; cursor: pointer; }
.evidence-choice input { width: 18px; height: 18px; accent-color: var(--green-700); }
.field-check-picker { margin-bottom: 0; }
.progress-field { display: flex; flex-direction: column; gap: 7px; margin-top: 15px; color: #435047; font-size: .76rem; font-weight: 750; }
.progress-field textarea, .progress-field select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); resize: vertical; }
.progress-field textarea:focus, .progress-field select:focus { outline: 2px solid var(--green-500); outline-offset: 1px; }
.impact-card, .stop-card { margin-top: 20px; padding: 17px; border-radius: 13px; background: var(--amber-soft); }
.impact-card { display: flex; flex-direction: column; gap: 4px; }
.walkthrough-section { padding: 18px 0; border-top: 1px solid var(--line); }
.compact-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding-left: 20px; color: #445048; font-size: .85rem; line-height: 1.45; }
.stop-card { background: #f1ddd8; color: #70352d; }
.stop-card .compact-list { margin-top: 10px; color: inherit; }
.source-note { margin-top: 25px; color: var(--muted); font-size: .72rem; }
.drawer-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px; padding: 17px; border-radius: 13px; background: var(--surface-soft); }
.drawer-math { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; padding: 17px; border-radius: 13px; background: var(--surface-soft); }
.drawer-math strong { font-size: 1.2rem; }
.drawer-math span, .drawer-math small { color: var(--muted); line-height: 1.5; }
.drawer-costs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; }
.drawer-costs .metric { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.supplier-list { display: flex; flex-direction: column; margin-top: 10px; border-top: 1px solid var(--line); }
.supplier-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 12px 2px; border-bottom: 1px solid var(--line); color: inherit; }
.supplier-row > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.supplier-row small { color: var(--muted); line-height: 1.35; }
.supplier-row .supplier-availability { color: var(--green-700); font-weight: 700; }
.supplier-row > strong { flex: 0 0 auto; }
a.supplier-row:hover strong:first-child { color: var(--green-700); }
.supplier-unavailable { display: flex; flex-direction: column; gap: 5px; margin-top: 18px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.supplier-unavailable strong { font-size: .8rem; }
.supplier-unavailable span { color: var(--muted); font-size: .72rem; line-height: 1.4; }

.mobile-nav { display: none; }
.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; }
.loading-title { margin: 18px 0 8px; font-size: 2rem; }
.sign-in-screen { width: min(960px, 100%); margin: auto; }
.sign-in-screen > .muted { max-width: 610px; margin-bottom: 24px; font-size: 1rem; }
.sign-in-capabilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; margin: 14px 0 24px; text-align: left; }
.sign-in-capabilities article { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 5px 18px rgb(23 34 27 / 3%); }
.sign-in-capabilities h2 { margin-bottom: 7px; font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; font-weight: 500; }
.sign-in-capabilities p { margin-bottom: 0; }
.sign-in-access { margin: 0 0 13px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 200; max-width: calc(100vw - 30px); padding: 11px 16px; border-radius: 999px; background: var(--ink); color: white; font-size: .8rem; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .18s ease; }
.toast-visible { transform: translate(-50%, 0); opacity: 1; }

.project-index { min-height: 100vh; padding: 28px clamp(22px, 5vw, 75px) 80px; }
.index-header { display: flex; justify-content: space-between; align-items: center; }
.index-header .brand-name { color: var(--green-900); }
.index-intro { max-width: 830px; padding: clamp(70px, 12vw, 145px) 0 55px; }
.index-intro h1 { font-size: clamp(2.8rem, 7vw, 6.4rem); }
.index-intro p { max-width: 650px; margin: 22px 0 27px; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }
.project-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-card, .empty-projects { display: flex; flex-direction: column; min-height: 190px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.project-card { transition: transform .15s ease, box-shadow .15s ease; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card h2 { margin: 18px 0 4px; font-family: Georgia, serif; font-size: 1.4rem; font-weight: 500; }
.project-card p { color: var(--muted); }
.project-card strong { margin-top: auto; }
.empty-projects { grid-column: 1 / -1; align-items: center; justify-content: center; min-height: 240px; text-align: center; }
.create-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgb(10 22 16 / 47%); backdrop-filter: blur(4px); }
.create-form { position: relative; display: flex; flex-direction: column; gap: 15px; width: min(620px, 100%); max-height: calc(100vh - 36px); padding: 32px; overflow-y: auto; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.create-form h2 { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.create-form label { display: flex; flex-direction: column; gap: 7px; color: #435047; font-size: .76rem; font-weight: 750; }
.create-form input, .create-form select, .create-form textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.create-form textarea { min-height: 94px; line-height: 1.45; resize: vertical; }
.create-form input:focus, .create-form select:focus, .create-form textarea:focus { outline: 2px solid var(--green-500); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: 1.4fr .5fr .7fr; gap: 10px; }
.form-status { min-height: 20px; margin: 0; color: var(--red); font-size: .75rem; }

@keyframes pulse { from { opacity: .4; } to { opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 980px) {
  :root { --sidebar: 208px; }
  .page { padding-inline: 25px; }
  .overview-grid { grid-template-columns: 1fr; }
  .price-card, .next-card { min-height: 280px; }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
  .estimate-row { grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(80px, .7fr)) 28px; }
  .estimate-row > :nth-child(2) { display: none; }
  .project-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  :root { --radius: 17px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  h1 { font-size: 2.15rem; }
  .app-shell { display: block; min-height: 100vh; }
  .sidebar { display: none; }
  .topbar { position: sticky; grid-column: auto; height: 60px; padding: 0 16px; }
  .topbar-project { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.1; }
  .topbar-project strong { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
  .mobile-brand { display: inline; font-size: .7rem; }
  .avatar { display: none; }
  .sync-pill { min-height: 34px; padding: 6px 9px; }
  .workspace-main { display: block; }
  .sync-notice { align-items: stretch; flex-direction: column; gap: 13px; margin: 14px 16px -10px; }
  .sync-notice .inline-actions .button { flex: 1; }
  .page { padding: 26px 16px 35px; }
  .page-header { align-items: flex-start; margin-bottom: 22px; }
  .page-header .page-actions { display: none; }
  .estimate-page .page-header, .plan-page .page-header { flex-direction: column; }
  .estimate-page .page-header .page-actions, .plan-page .page-header .page-actions { display: flex; width: 100%; }
  .estimate-page .page-header .page-actions .button, .plan-page .page-header .page-actions .button { width: 100%; }
  .page-description { font-size: .84rem; }
  .overview-grid { display: flex; flex-direction: column; gap: 12px; }
  .card { padding: 18px; box-shadow: none; }
  .price-card { min-height: 0; order: 1; }
  .next-card { min-height: 245px; order: 0; }
  .considerations-card { order: 2; }
  .progress-card { order: 3; }
  .price-range { margin: 19px 0 22px; }
  .price-range strong { font-size: clamp(1.72rem, 8vw, 2.25rem); }
  .price-stack { margin: 20px 0 15px; }
  .next-card h2 { font-size: 1.65rem; }
  .status-row { grid-template-columns: 21px 1fr; }
  .status-row .muted-small { grid-column: 2; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(64px + env(safe-area-inset-bottom)); padding: 7px 6px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgb(255 253 247 / 96%); backdrop-filter: blur(18px); }
  .mobile-nav-button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 1px; color: #7b847e; font-size: .6rem; }
  .mobile-nav-button .nav-icon { width: 17px; height: 17px; }
  .mobile-nav-active { color: var(--green-700); font-weight: 800; }
  .capture-zone { padding: 34px 16px; }
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .estimate-strip { grid-template-columns: repeat(2, 1fr); }
  .estimate-strip .metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .estimate-controls { align-items: stretch; }
  .estimate-search { width: 100%; min-width: 0; }
  .estimate-filter-row { width: 100%; }
  .estimate-table { border: 0; background: transparent; }
  .estimate-header, .estimate-total { display: none; }
  .estimate-phase { margin: 12px 0 8px; border: 0; border-radius: 12px; }
  .estimate-row { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 8px 12px; min-height: 96px; margin-bottom: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .estimate-row > :nth-child(2), .estimate-row > :nth-child(3), .estimate-row > :nth-child(6) { display: none; }
  .estimate-row > :nth-child(4) { grid-column: 2; grid-row: 1; }
  .estimate-row > :nth-child(5) { grid-column: 2; grid-row: 2; text-align: right; }
  .estimate-line { border: 0; }
  .estimate-inline-detail { grid-template-columns: 1fr; margin: -11px 0 10px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; }
  .estimate-costs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estimate-inline-detail .source-note { grid-column: 1; }
  .plan-step { grid-template-columns: 42px 1fr; padding: 14px 14px 14px 0; }
  .plan-timeline::before { left: 20px; }
  .step-actions { grid-column: 2; justify-content: flex-start; }
  .step-actions .button { min-height: 36px; padding: 8px 11px; }
  .work-checklist { grid-template-columns: 1fr; }
  .record-summary { grid-template-columns: 1fr 1fr; }
  .record-summary .button { grid-column: 1 / -1; }
  .drawer { width: 100%; height: min(86vh, 760px); margin-top: auto; padding: 22px; border-radius: 22px 22px 0 0; animation-name: drawer-up; }
  .drawer-body { padding-top: 30px; }
  .drawer-body h2 { font-size: 1.75rem; }
  .drawer-metrics { grid-template-columns: 1fr 1fr; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .project-index { padding: 20px 16px 70px; }
  .index-intro { padding: 70px 0 40px; }
  .index-intro h1 { font-size: 3.15rem; }
  .project-list { grid-template-columns: 1fr; }
  .sign-in-capabilities { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid label:first-child { grid-column: 1 / -1; }
}

@keyframes drawer-up { from { transform: translateY(25px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
