/* Say hello as a conversation (prototype; hello-chat.js). The chat sits in the same sea card as the form and uses its
   type, fields and buttons: Kyle's stand-in speaks in plain text on the card, the visitor in paper bubbles, and a draft
   note arrives as a paper card with the form's fields. */
.chat h2{font-size:2.3903rem;line-height:1.0816;font-weight:460;font-variation-settings:normal;letter-spacing:0}
.chat .form-intro{margin:17px 0 22px;text-wrap:pretty}

/* The conversation scrolls within the card once it outgrows it */
.chat-log{display:flex;flex-direction:column;gap:14px;max-height:min(480px,58vh);margin:0;padding:2px 4px 6px 0;list-style:none;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.chat-turn{max-width:92%}
.chat-who{margin:0 0 2px;font:500 1.3rem/1.1 Caveat,var(--sans);color:var(--muted)}
.chat-text{margin:0;font-size:1rem;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-text a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.chat-bot{align-self:flex-start}
.chat-you{align-self:flex-end;max-width:85%;padding:9px 14px 10px;background:var(--paper);border:1px solid var(--line);border-radius:16px 17px 5px 15px}
.chat-repair .chat-text{color:var(--muted)}
/* While a reply is on its way: a handwritten "writing…" whose dots come and go */
.chat-writing{font:500 1.2rem/1 Caveat,var(--sans);color:var(--muted)}
.chat-writing::after{content:"…";display:inline-block;animation:chat-dots 1.2s steps(4,end) infinite;overflow:hidden;vertical-align:bottom;width:1.1em}
@keyframes chat-dots{from{width:0}}
.chat-turn:not(.is-writing) .chat-writing{display:none}

/* Replies to tap: the form's option chips */
.chat-replies{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}
.chat-replies:empty{display:none}
.chat-replies button{padding:8px 12px;font-size:.8125rem;line-height:1.3;background:#fff;border:1px solid var(--line);border-radius:var(--radius-small);cursor:pointer;transition:background .2s,border-color .2s}
.chat-replies button:hover{background:var(--paper);border-color:rgb(41 62 57 / 38%)}
.chat-replies button:focus-visible,.chat-send:focus-visible{outline:2px solid #8b5834;outline-offset:3px}

/* Typing */
.chat-composer{display:flex;align-items:flex-end;gap:10px;margin:16px 0 0}
.chat-composer textarea{flex:1;min-height:50px;max-height:150px;padding:13px 14px;font-size:1rem;line-height:1.45;background:#fdfefd;resize:none}
.chat-composer textarea::placeholder{color:#778079;font-size:.9375rem;opacity:1}
.chat-send{flex:0 0 auto;width:50px;height:50px;padding:0;border-radius:50%;cursor:pointer}
.chat-send svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.chat-send:disabled{opacity:.45;cursor:default}

/* Underneath: how it works, starting over, and the form */
.chat-foot{display:flex;flex-wrap:wrap;gap:4px 20px;margin-top:14px}
.chat-foot .text-button{margin:0;color:var(--muted);cursor:pointer}
.chat-foot .text-button:hover{color:var(--ink)}
.chat-how{margin-top:12px;padding:16px 20px 14px;font-size:.9375rem;line-height:1.6;background:rgb(255 254 251 / 62%);border:1px solid var(--line);border-radius:var(--radius-card)}
.chat-how ul{margin:0;padding-left:18px}
.chat-how li+li{margin-top:5px}
.chat-how p{margin:10px 0 0;color:var(--muted)}
.chat-how a{color:inherit;text-underline-offset:3px}
.chat-demo{margin:10px 0 0;font:500 1.2rem/1.25 Caveat,var(--sans);color:#8D4E37}
.chat-back{margin:-12px 0 22px}
.chat-back .text-button{margin:0;cursor:pointer}

/* A draft note: paper, with the form's fields, ready to change and send, under the conversation */
.chat-draft{margin-top:16px}
.chat-note{padding:20px 20px 14px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius-card)}
.chat-note h3{margin:0 0 16px;font-family:var(--serif);font-size:1.5rem;font-weight:460;line-height:1.15;letter-spacing:0}
.chat-note .form-field{margin-bottom:16px}
.chat-note .form-field>textarea{min-height:140px}
.chat-note-tags{margin:-4px 0 16px}
.chat-note .button{cursor:pointer}
.chat-note-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px 22px}
.chat-note-actions .text-button{margin:0;color:var(--muted);cursor:pointer}
.chat-note-actions .text-button:hover{color:var(--ink)}
.chat-note .form-note{margin-top:12px}
.chat-note-fallback{margin-top:14px}
.chat-note-fallback .small-note{margin:0 0 12px}

@media(max-width:700px){
 .chat h2{font-size:1.804rem}
 .chat-log{max-height:62vh}
 .chat-turn{max-width:96%}
 .chat-note{padding:18px 16px 12px}
}
@media(prefers-reduced-motion:reduce){.chat-writing::after{animation:none;width:auto}.chat-replies button{transition:none}}
