:root { color-scheme: light; --paper: #fcf9f2; --card: #fffdf8; --green: #215239; --ink: #282a25; --muted: #686c63; --line: #d8dbd0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { position: relative; margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
body[data-focused="true"] { min-height: 100vh; min-height: var(--intake-viewport-height, 100svh); }
/* Content placement is explicit; do not let browser anchoring compensate too. */
body[data-focused="true"] { overflow-anchor: none; }
main { flex: 1; display: flex; flex-direction: column; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #5f866f; outline-offset: 4px; }
/* Stage headings receive focus for screen-reader orientation, not interaction. */
.focus-card h1[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.site-header { padding: 24px 5%; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { font-family: Georgia, serif; font-size: 32px; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-header nav { display: flex; gap: 24px; font-size: 14px; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a[aria-current] { color: var(--green); text-decoration: underline; text-underline-offset: 6px; }
.close-focus { font-size: 30px; line-height: 1; text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 50%; }
.close-focus:hover { background: #21523909; }
.primary { border: 0; background: var(--green); color: white; border-radius: 10px; min-height: 46px; padding: 13px 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 650; text-decoration: none; white-space: nowrap; transition: background .15s; }
.primary:hover:not(:disabled) { background: #163d29; }
.text-button { border: 0; background: none; color: var(--green); font-size: 14px; padding: 12px 0; text-decoration: underline; text-underline-offset: 4px; text-align: left; }
.text-button:hover { color: #163d29; }
.focused-layout { flex: 1; display: flex; flex-direction: column; width: min(760px, 100%); margin: 0 auto; padding: 0 24px; }
.focus-card { flex: 1; display: flex; flex-direction: column; view-transition-name: pool-surface; }
[data-focused="true"] .site-header { padding: 14px 28px; }
[data-focused="true"] .brand { font-size: 25px; gap: 9px; }
[data-focused="true"] .brand svg { width: 13px; height: 22px; }
[data-focused="true"] .close-focus { font-size: 26px; }
.flow-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.conversation { flex: none; padding: 36px 0 24px; }
/* A short conversation starts at the top, with its controls at the bottom.
   Extra viewport height belongs above the dock, never below its buttons. */
[data-conversation="true"] .conversation { flex: 1 0 auto; }
.focus-card h1 { font-size: clamp(27px, 3vw, 34px); letter-spacing: -.04em; line-height: 1.2; margin: 0 0 16px; color: var(--green); }
.intro { text-align: center; margin: 0 0 28px; }
.intro h1 { font-size: clamp(26px, 3vw, 34px); margin: 0; text-wrap: balance; }
[data-conversation="false"] #intake-body { justify-content: center; padding: 16px 0; }
[data-conversation="false"] .conversation { flex: none; padding: 0; }
[data-conversation="false"] #intake-body > .flow-dock { position: static; padding-top: 0; background: none; }
.step-description { font-size: 16px; line-height: 1.65; color: var(--muted); margin: 0 0 24px; }
.transcript:empty { display: none; }
.exchange { margin-bottom: 28px; overflow-wrap: anywhere; }
.exchange:last-child { margin-bottom: 0; }
.exchange.user { width: fit-content; max-width: 92%; margin-left: auto; font-size: 15px; line-height: 1.65; color: #43513f; padding: 15px 20px; border-radius: 15px 15px 4px 15px; background: #edf0e6; }
.exchange.assistant { width: fit-content; max-width: 96%; margin-right: auto; font-size: 18px; line-height: 1.65; color: var(--ink); padding: 15px 20px; border: 1px solid #e0e3d8; border-radius: 15px 15px 15px 4px; background: var(--card); }
.exchange p { margin: 0 0 14px; white-space: pre-wrap; }
.exchange p:last-child { margin-bottom: 0; }
.flow-dock { position: static; bottom: 0; z-index: 2; flex: none; display: flex; flex-direction: column; justify-content: flex-end; padding: 24px 0 max(8px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, #fcf9f200, var(--paper) 20px); }
@media (hover: hover) and (pointer: fine) { #intake-body > .flow-dock { position: sticky; } }

.composer { border: 1px solid #c4cdbd; border-radius: 13px; background: white; padding: 14px 0; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: #78927e; box-shadow: 0 0 0 3px #21523908; }
textarea { display: block; width: 100%; border: 0; background: transparent; resize: none; padding: 0 18px; min-height: 56px; max-height: min(160px, 26svh); font-size: 17px; color: var(--ink); line-height: 1.6; }
textarea:focus-visible { outline: none; }
textarea::placeholder { color: #6d7368; }
.action-row { display: flex; align-items: center; justify-content: flex-end; gap: 22px; min-height: 60px; padding-top: 12px; }
.composer-help { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 auto 0 0; }
/* Measure without collapsing the focused control, which can displace Safari's caret. */
textarea.intake-measure { position: fixed; left: -10000px; top: 0; height: 0; min-height: 0; max-height: none; visibility: hidden; pointer-events: none; }
.secondary-actions { display: contents; }
/* Waiting removes editing, not its footprint. This avoids a second layout
   collapse while the native keyboard is sliding away. */
#message-form { margin: 0; }
.flow-dock[data-composer="waiting"] #message-form { opacity: 0; pointer-events: none; transition: opacity 160ms ease-out; }
.flow-dock[data-composer="waiting"] #conversation-actions { visibility: hidden; }
.flow-dock[data-composer="complete"] #message-form { visibility: hidden; pointer-events: none; }
.flow-dock[data-composer="complete"] #conversation-actions { animation: controls-in 240ms ease-out; }
#waiting:focus { outline: none; }
@keyframes controls-in { from { opacity: 0; } to { opacity: 1; } }
.waiting { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.thinking { width: fit-content; min-height: 50px; margin: 20px 0 0; padding: 14px 20px; border: 1px solid #e0e3d8; border-radius: 15px 15px 15px 4px; background: var(--card); }
.thinking-dots { display: inline-flex; align-items: center; gap: 6px; height: 16px; }
.thinking-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: breathe 1.3s ease-in-out infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .16s; }
.thinking-dots i:nth-child(3) { animation-delay: .32s; }
.error { font-size: 14px; line-height: 1.5; color: #8a2929; background: #fff0e9; padding: 12px 16px; border-radius: 10px; margin: 0 0 14px; }
.unsent-choice { font-size: 15px; line-height: 1.5; }
.unsent-choice p { margin: 0; }
.finish-stage { justify-content: center; padding: 28px 0 8vh; }
.review-content > h1 { margin-bottom: 24px; }
.review-sheet { border: 1px solid #d4d9cb; border-radius: 16px; padding: 12px 26px; background: var(--card); }
#pool-summary { padding: 0; margin: 0; list-style: none; }
#pool-summary li { font-size: 17px; line-height: 1.5; padding: 15px 0; overflow-wrap: anywhere; }
#pool-summary li + li { border-top: 1px solid #e8eadd; }
#pool-summary strong { font-weight: 650; color: var(--green); }
#summary-fallback p { font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.summary-disclosure { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 12px 0 6px; }
.review-actions { position: sticky; bottom: 0; padding: 8px 0 max(12px, env(safe-area-inset-bottom)); background: var(--paper); }
.contact-stage { max-width: 540px; margin: 0 auto; }
.contact-stage .review-actions { position: static; margin-top: 12px; background: none; }
.contact-stage .step-description { margin-bottom: 24px; }
.receipt-next { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.receipt-next h2 { margin: 0 0 10px; font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--green); }
.receipt-next p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.receipt-next .text-button { display: inline-flex; align-items: center; min-height: 44px; }
#receipt-email { overflow-wrap: anywhere; }
.preparing-stage { flex: 1; min-height: 0; padding: 12vh 0 9vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.preparing-stage .step-description { margin-bottom: 12px; }
.preparing-stage .action-row { justify-content: center; }
.preparing-stage h1 { font-size: 23px; letter-spacing: -.025em; }
.preparing-stage[data-loading="true"] .action-row { margin-top: 6px; }
.brief-animation { position: relative; width: 150px; height: 174px; background: var(--card); border: 1px solid #cdd5c6; border-radius: 13px; margin-bottom: 36px; box-shadow: 7px 8px 0 -1px var(--paper), 7px 8px 0 0 #e2e5da; }
.brief-bookmark { position: absolute; top: -1px; left: 24px; width: 14px; height: 32px; background: var(--green); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.brief-line { position: absolute; left: 24px; height: 3px; border-radius: 3px; background: #8da78e; transform-origin: left; animation: brief-write 2.4s ease-in-out infinite both; }
.line-one { top: 65px; width: 96px; }
.line-two { top: 91px; width: 83px; animation-delay: .24s; }
.line-three { top: 117px; width: 61px; animation-delay: .48s; }
#review-preparing[data-loading="false"] .brief-animation { display: none; }
.email-label { display: block; font-size: 15px; font-weight: 600; margin: 0 0 10px; }
#contact-email { display: block; width: 100%; padding: 15px 17px; font-size: 17px; border: 1px solid #c4cdbd; border-radius: 10px; background: white; color: var(--ink); }
/* Keep the focus indicator inside the field at narrow viewport edges. */
#contact-email:focus { outline: none; border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
#send-error { margin-top: 16px; }
@keyframes breathe { 50% { opacity: .35; transform: scale(.75); } }
@keyframes brief-write { 0%, 8% { transform: scaleX(0); opacity: .3; } 35%, 78% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: .15; } }
::view-transition { pointer-events: none; }
::view-transition-group(pool-surface) { animation-duration: 380ms; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(pool-surface) { animation: none; opacity: 0; }
::view-transition-new(pool-surface) { animation: none; mix-blend-mode: normal; }
@media (max-width: 700px) {
  .site-header { padding: 16px 20px; } .brand { font-size: 24px; } .site-header nav { gap: 10px; font-size: 11px; }
  .entry-layout { display: flex; flex-direction: column; gap: 16px; margin: 12px auto 24px; padding: 0 20px; width: 100%; }
  .entry-copy { display: contents; }
  .entry-copy .eyebrow { margin: 0; font-size: 10px; }
  .entry-copy h1 { font-size: clamp(32px, 9.5vw, 42px); margin: 0; }
  .entry-card { order: 1; padding: 20px; border-radius: 18px; }
  .entry-card h2 { font-size: 20px; margin-bottom: 14px; }
  .entry-target { min-height: 88px; padding: 12px; font-size: 16px; line-height: 1.5; }
  .entry-bottom { margin-top: 14px; gap: 12px; }
  .entry-bottom p { margin: 0; }
  .lead { order: 2; font-size: 15px; margin: 0; }
  [data-focused="true"] .site-header { padding: 12px 20px; }
  [data-focused="true"] .brand { font-size: 23px; }
  .focused-layout { padding: 0 20px; }
  .conversation { padding: 24px 0 12px; }
  .flow-dock { padding-top: 20px; }
  .intro { margin-bottom: 22px; }
  .exchange.assistant { font-size: 17px; padding: 13px 16px; } .exchange.user { font-size: 14px; padding: 13px 16px; }
  textarea { padding: 0 15px; font-size: 16px; }
  .primary { padding: 12px 16px; font-size: 14px; } .action-row { gap: 18px; min-height: 60px; }
  .text-button { font-size: 13px; } .review-sheet { padding: 8px 20px; }
  #send-early { margin-right: auto; }
  .finish-stage { padding: 24px 0 5vh; } .review-content > h1 { margin-bottom: 22px; }
  #pool-summary li { font-size: 16px; padding-top: 13px; padding-bottom: 13px; }
}
@media (max-width: 420px) { .action-row { gap: 14px; } }
@media (max-height: 640px) {
  .finish-stage { padding: 12px 0 16px; }
  .finish-stage h1 { font-size: 28px; margin-bottom: 20px; }
  .review-sheet { padding: 6px 24px; }
  #pool-summary li { font-size: 16px; line-height: 1.45; padding-top: 10px; padding-bottom: 10px; }
  .review-actions { padding-top: 4px; padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

@view-transition { navigation: auto; }
#pool-intake { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#flow-content { display: flex; flex: 1; flex-direction: column; }
.site-header .brand svg { width: auto; height: 20px; }

/* Keep a delivery failure attached to its original message without moving the
   bubble when a server acknowledgement arrives. */
.exchange.user { position: relative; margin-bottom: 32px; }
.message-delivery { position: absolute; top: 100%; right: 0; display: flex; align-items: center; gap: 12px; white-space: nowrap; font-size: 12px; color: var(--muted); }
.message-delivery .text-button { font-size: 12px; padding: 6px 0; }
[data-conversation="false"] #pool-message { max-height: min(280px, 38svh); }
@media (max-width: 700px) {
  [data-conversation="false"] #intake-body { justify-content: flex-start; padding-top: 5svh; }
  .finish-stage { justify-content: flex-start; padding-top: 4svh; }
  .preparing-stage { justify-content: flex-start; padding-top: 10svh; }
}
/* Stable touch geometry: no resizing in response to the keyboard or a reply. */
@media (hover: none), (pointer: coarse) {
  #pool-message { height: 3lh; min-height: 0; max-height: none; }
  [data-conversation="false"] #pool-message { height: 6lh; max-height: none; }
}
