:root {
  --ink: #171a1e;
  --paper: #f3f2ee;
  --surface: #fff;
  --line: #dcdedb;
  --muted: #697078;
  --copper: #b95d2c;
  --copper-dark: #92431d;
  --green: #2f7652;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
button, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.quote-site-head { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(20px, 4vw, 58px); color: #fff; background: var(--ink); border-bottom: 1px solid rgba(255,255,255,.12); }
.quote-brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.quote-brand img { width: 40px; height: 40px; object-fit: contain; filter: brightness(0) invert(1); }
.quote-brand strong, .quote-brand small { display: block; }
.quote-brand strong { font: 600 17px var(--font-serif); }
.quote-brand small { margin-top: 2px; color: #9da3aa; font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.site-back { color: #e5e7e8; font-size: 12px; text-underline-offset: 4px; }
.site-back:hover { color: #fff; }

.intake-layout { min-height: calc(100svh - 76px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); }
.conversation-pane { min-width: 0; display: grid; grid-template-rows: auto minmax(220px, 1fr) auto auto; padding: clamp(28px, 5vw, 68px); border-right: 1px solid var(--line); }
.conversation-heading { max-width: 690px; }
.eyebrow { margin: 0 0 8px; color: var(--copper); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.conversation-heading h1 { max-width: 760px; margin: 0; font: 600 clamp(38px, 6vw, 70px)/.98 var(--font-serif); }
.conversation-heading > p:last-child { max-width: 58ch; margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.conversation-stream { display: grid; align-content: end; gap: 18px; max-width: 760px; width: 100%; padding: 38px 0 24px; overflow-y: auto; }
.message { max-width: 84%; display: grid; gap: 5px; animation: message-in .22s ease both; }
.message span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.message p { margin: 0; white-space: pre-wrap; }
.message[data-role="assistant"] { padding-left: 13px; border-left: 2px solid var(--copper); }
.message[data-role="user"] { justify-self: end; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.message-form { max-width: 760px; display: grid; gap: 7px; }
.message-form > label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.message-form textarea { width: 100%; min-height: 104px; padding: 14px 15px; background: var(--surface); border: 1px solid #c7cac7; border-radius: 6px; resize: vertical; }
.message-actions { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.voice-control, .send-control { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border-radius: 5px; font-weight: 600; }
.voice-control { color: var(--muted); background: transparent; border: 1px solid #c7cac7; }
.voice-control:hover, .voice-control.is-listening { color: var(--copper); border-color: var(--copper); }
.send-control { min-width: 116px; color: #fff; background: var(--copper); border: 1px solid var(--copper); }
.send-control:hover { background: var(--copper-dark); }
.send-control:disabled, .voice-control:disabled { opacity: .48; cursor: not-allowed; }
.message-status { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.privacy-note { max-width: 760px; margin: 12px 0 0; color: var(--muted); font-size: 10px; }

.draft-pane { min-width: 0; padding: clamp(28px, 5vw, 68px); background: var(--surface); }
.draft-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.draft-head h2 { margin: 0; font: 600 clamp(30px, 4vw, 43px)/1 var(--font-serif); }
.draft-status { padding: 5px 7px; color: #6d511f; background: #f4e8c9; border-radius: 4px; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.draft-empty { min-height: 360px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); text-align: center; }
.draft-empty svg { width: 30px; height: 30px; color: var(--copper); }
.draft-empty p { max-width: 34ch; margin: 0; }
.draft-content { padding-top: 20px; }
.project-summary { display: grid; grid-template-columns: 1fr 1.35fr 1.3fr 1.3fr; gap: 12px; margin: 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.project-summary dt { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.project-summary dd { margin: 4px 0 0; font-weight: 600; }
.request-summary { margin: 18px 0; color: var(--muted); }
.draft-lines { border-top: 1px solid var(--ink); }
.draft-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.draft-line strong, .draft-line span { display: block; }
.draft-line span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.draft-line > strong { text-align: right; font-variant-numeric: tabular-nums; }
.draft-line em { display: inline-block; margin-top: 5px; color: var(--copper); font-size: 8px; font-style: normal; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.draft-checks { margin-top: 18px; padding: 13px 14px; background: #fbf7ee; border-left: 2px solid #b57925; }
.draft-checks.has-critical { background: #fbefed; border-left-color: #a24137; }
.draft-checks-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.draft-checks-head strong { font-size: 11px; }
.draft-checks-head span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.draft-check { display: grid; grid-template-columns: 7px 1fr; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.draft-check::before { content: ""; width: 6px; height: 6px; margin-top: 5px; border-radius: 50%; background: #b57925; }
.draft-check.is-critical::before { background: #a24137; }
.draft-totals { width: min(340px, 100%); margin: 22px 0 0 auto; border-top: 1px solid var(--ink); }
.draft-totals div { min-height: 38px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.draft-totals dt { color: var(--muted); }
.draft-totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.draft-totals .draft-grand { min-height: 54px; border-bottom-color: var(--ink); }
.draft-grand dt { color: var(--ink); font-weight: 700; }
.draft-grand dd { color: var(--copper-dark); font: 600 24px var(--font-serif); }
.draft-assumptions { margin: 20px 0 0; padding: 11px 12px; color: var(--muted); background: #f7f7f4; border-left: 2px solid #c5c8c5; font-size: 10px; }
.draft-submitted { margin-top: 18px; display: grid; gap: 3px; padding: 13px 14px; color: #285f43; background: #e6f1ea; border-left: 2px solid var(--green); }
.draft-submitted span { font-size: 11px; }

@media (max-width: 1200px) and (min-width: 941px) {
  .project-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 940px) {
  .intake-layout { grid-template-columns: 1fr; }
  .conversation-pane { min-height: calc(100svh - 76px); border-right: 0; border-bottom: 1px solid var(--line); }
  .draft-pane { min-height: 560px; }
}

@media (max-width: 560px) {
  .quote-site-head { height: 66px; padding-inline: 16px; }
  .quote-brand strong { font-size: 15px; }
  .site-back { font-size: 10px; }
  .intake-layout { min-height: calc(100svh - 66px); }
  .conversation-pane, .draft-pane { padding: 28px 18px; }
  .conversation-heading h1 { font-size: 42px; }
  .conversation-stream { min-height: 270px; }
  .message { max-width: 94%; }
  .message-actions { grid-template-columns: auto 1fr; }
  .message-status { text-align: right; }
  .send-control { grid-column: 1 / -1; width: 100%; }
  .project-summary { grid-template-columns: 1fr; }
}
