/* Guided process review */
html:has(body.chat-open),
body.chat-open { overflow: hidden; }

.chat-sheet {
  position: fixed;
  inset: 28px 28px 28px auto;
  width: min(480px, calc(100vw - 56px));
  max-width: none;
  height: auto;
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 30px;
  background: #fafaf9e6;
  color: #0c0a09;
  backdrop-filter: blur(28px);
  box-shadow: inset 0 0 0 1px #ffffffb3, 0 40px 90px -30px #0e0a1e99;
  overflow: clip;
  font: 400 15px/22px var(--body, Inter, sans-serif);
  --chat-gutter: 22px;
  --chat-gap: 18px;
  --chat-rule: #1c191714;
  --chat-muted: #57534e;
}

.chat-sheet[open] { animation: chat-arrive .21s cubic-bezier(.22,1,.36,1) both; }
.chat-sheet::backdrop { background: #14102652; }
@keyframes chat-arrive { from { opacity: 0; transform: translateX(14px); } }

.chat-panel { height: 100%; display: flex; flex-direction: column; }
.chat-handle { display: none; }
.chat-header { flex: 0 0 auto; padding: 20px 20px 16px; border-bottom: 1px solid var(--chat-rule); }
.chat-heading-row { display: flex; gap: 12px; align-items: center; }
.chat-heading-group { flex: 1; min-width: 0; }
.chat-heading-group h2 { font: 600 19px/24px var(--display); letter-spacing: -.02em; }
.chat-heading-group p { margin-top: 2px; color: var(--chat-muted); font-size: 13px; line-height: 17px; }
.chat-step-label { flex: none; padding: 6px 11px; color: #44403c; background: #1c19170f; border-radius: 999px; font: 500 12px/15px var(--body); }
.chat-mark, .chat-icon-button {
  width: 40px;
  height: 40px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 1px #eceae7;
}
.chat-icon-button { width: 36px; height: 36px; }
.chat-icon-button svg { width: 14px; height: 14px; }
.chat-progress { margin-top: 16px; display: flex; gap: 6px; }
.chat-progress i { height: 4px; flex: 1; border-radius: 999px; background: #1c19171a; }
.chat-progress .is-filled { background: #3ba6f1; }

.chat-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--chat-gap);
  padding: 22px var(--chat-gutter) 20px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scroll-padding-block: 12px;
}
.chat-scroll::before { content: ''; flex: 1 0 0; margin-bottom: calc(-1 * var(--chat-gap)); }
.chat-sheet[data-state="opener"]:not(.is-editing) .chat-scroll,
.chat-sheet[data-state="sent"] .chat-scroll { padding-top: 26px; }
.chat-sheet[data-state="opener"]:not(.is-editing) .chat-scroll::before,
.chat-sheet[data-state="sent"] .chat-scroll::before { display: none; }
.chat-transcript { display: grid; flex: none; gap: var(--chat-gap); }
.chat-transcript:empty, .chat-stage:empty { display: none; }
.chat-stage { flex: none; min-width: 0; }
.chat-sheet [tabindex="-1"]:focus { outline: none; }

.chat-turn { display: grid; justify-items: end; gap: 4px; min-width: 0; }
.chat-turn-label { display: flex; align-items: center; gap: 7px; justify-self: start; color: #57534e; font: 400 13px/18px var(--body); }
.chat-turn-label::before { content: ''; flex: 0 0 24px; height: 24px; border-radius: 50%; background: white url('/assets/logo.svg') center / 19px no-repeat; box-shadow: inset 0 0 0 1px #eceae7; }
.chat-user-bubble { max-width: min(330px, 90%); padding: 12px 16px; border-radius: 22px 22px 6px 22px; background: #1c1917; color: #fafaf9; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-turn:has(.chat-turn-label) .chat-user-bubble { padding: 10px 15px; max-width: min(300px, 90%); font-size: 14px; line-height: 20px; }
.chat-user-bubble.is-editing { background: white; color: #0c0a09; border: 1px dashed #1c1917; }
.chat-editing-label { display: block; font-size: 12px; }
.chat-edit-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding-inline: 5px;
  color: var(--chat-muted);
  font: 500 12px/16px var(--body);
}
.chat-edit-button svg { width: 12px; height: 12px; }
@media (hover: hover) and (pointer: fine) {
  .chat-edit-button { opacity: 0; }
  .chat-turn:hover .chat-edit-button, .chat-turn:focus-within .chat-edit-button { opacity: 1; }
}

.chat-bot-turn { display: flex; align-items: flex-start; gap: 8px; }
.chat-bot-turn .chat-mark, .chat-question-mark { width: 28px; height: 28px; }
.chat-bot-bubble { display: grid; gap: 8px; padding-top: 3px; color: #1c1917; overflow-wrap: anywhere; }
.chat-filed { color: #57534e; font-size: 13px; line-height: 18px; }
.chat-filed strong, .chat-filed button { color: #0c0a09; }
.chat-filed .chat-text-button { min-height: 20px; }
.chat-typing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 16px;
  background: white;
}
.chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: #78716c; animation: chat-dot .55s alternate infinite; }
.chat-typing i:nth-child(2) { animation-delay: 60ms; }
.chat-typing i:nth-child(3) { animation-delay: 120ms; }
@keyframes chat-dot { to { opacity: .35; } }

.chat-opener, .chat-question, .chat-contact, .chat-result { display: grid; gap: 14px; min-width: 0; }
.chat-opener { gap: 18px; }
.chat-opener > .chat-question-title + .chat-helper { margin-top: -8px; color: #57534e; font-size: 15px; line-height: 23px; }
.chat-opener .chat-question-title { font: 500 32px/36px var(--display); letter-spacing: -.035em; }
.chat-question, .chat-contact {
  padding: 18px;
  background: #fff;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px #eceae7, 0 18px 40px -26px #1c191759;
}
.chat-question { position: relative; margin-left: 36px; }
.chat-question-mark { position: absolute; left: -36px; top: 0; }
.chat-question fieldset { min-inline-size: 0; }
.chat-question legend { padding: 0; }
.chat-question legend + .chat-helper { margin-top: 8px; }
.chat-question-title { display: block; font: 500 21px/26px var(--display); letter-spacing: -.02em; }
.chat-eyebrow { display: block; margin-bottom: 4px; color: var(--chat-muted); font: 500 12px/16px var(--body); }
.chat-helper { color: var(--chat-muted); font: 400 13px/18px var(--body); }
.chat-question .chat-chips { margin-top: 14px; }
.chat-category-confirm { display: grid; gap: 12px; }
.chat-starters { display: grid; gap: 12px; padding-top: 8px; }
.chat-starters > p { display: flex; align-items: center; gap: 12px; }
.chat-starters > p::before, .chat-starters > p::after { content: ''; flex: 1; height: 1px; background: #1c19171a; }
.chat-chips, .chat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chat-actions { gap: 12px; }

.chat-choice { position: relative; }
.chat-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.chat-chip, .chat-primary, .chat-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  min-height: 40px;
  padding: 6px 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #d6d3d1;
  color: #1c1917;
  font: 500 14px/18px var(--body);
  text-align: center;
  cursor: pointer;
}
.chat-choice .chat-chip svg { display: none; }
.chat-choice input:checked + .chat-chip { padding-left: 11px; color: #fafaf9; background: #1c1917; box-shadow: none; }
.chat-choice input:checked + .chat-chip svg { display: block; color: #3ba6f1; width: 14px; height: 14px; }
.chat-choice input:focus-visible + .chat-chip { outline: 3px solid #1678c2; outline-offset: 2px; }
.chat-primary {
  gap: 8px;
  min-height: 44px;
  padding: 8px 20px;
  background: #3ba6f1;
  color: #0c0a09;
  box-shadow: inset 0 0 0 1px #3398e1;
  font-size: 15px;
}
.chat-opener .chat-primary, .chat-contact .chat-primary { min-height: 48px; }
.chat-primary:disabled { background: #e8e6e5; color: #57534e; box-shadow: none; cursor: default; }
.chat-secondary { min-height: 44px; padding-inline: 18px; }
.chat-text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: #57534e;
  font: 500 13px/18px var(--body);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-field { display: grid; gap: 6px; min-width: 0; }
.chat-field label { color: #0c0a09; font: 500 13px/16px var(--body); }
.chat-field input, .chat-field textarea, .chat-manual-summary {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid #e2dfdc;
  border-radius: 14px;
  background: #fafaf9;
  color: #0c0a09;
}
.chat-field textarea { min-height: 132px; padding: 15px 17px; border-color: #e8e6e5; border-radius: 22px; background: #fff; resize: vertical; }
.chat-field input::placeholder, .chat-field textarea::placeholder, .chat-reply::placeholder { color: var(--chat-muted); opacity: 1; }
.chat-field [aria-invalid="true"] { border-color: #b42318; }
.chat-field-error { color: #9b1c13; font: 500 13px/18px var(--body); }
.chat-field-error:empty { display: none; }
.chat-intro .chat-helper { margin-top: 6px; }
.chat-contact-fields { display: grid; gap: 12px; }
.chat-contact > .chat-primary { width: 100%; }
.chat-contact-details { display: grid; gap: 8px; }
.chat-contact-detail { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 6px 16px; border-radius: 14px; background: #fafaf9; box-shadow: inset 0 0 0 1px #e2dfdc; overflow-wrap: anywhere; font-size: 14px; line-height: 18px; }
.chat-contact-detail dt { color: var(--chat-muted); font: 500 12px/16px var(--body); }
.chat-contact-detail dd { min-width: 0; text-align: right; }
.chat-honeypot { position: absolute; width: 1px; height: 1px; left: -10000px; top: 0; opacity: 0; pointer-events: none; }

.chat-dock { flex: none; display: grid; gap: 10px; padding: 14px var(--chat-gutter) 18px; border-top: 1px solid var(--chat-rule); }
.chat-dock-form { display: flex; gap: 8px; align-items: center; min-height: 52px; padding: 4px 6px 4px 18px; border-radius: 999px; background: white; box-shadow: inset 0 0 0 1px #e8e6e5; }
.chat-dock-form:has(.chat-reply:disabled) { background: #f5f5f4; }
.chat-reply { flex: 1; min-width: 0; border: none; padding: 6px 0; background: transparent; }
.chat-dock-send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #3ba6f1; }
.chat-dock-send:disabled { background: #1c19170f; color: #78716c; cursor: default; }
.chat-privacy { color: var(--chat-muted); font: 400 12px/17px var(--body); }
.chat-privacy a { color: #0c0a09; font-weight: 600; text-decoration: underline; }

.chat-error-notice { display: flex; align-items: start; gap: 12px; padding: 14px; border-radius: 18px; background: #fdf6e9; box-shadow: inset 0 0 0 1px #f1ddb4; }
.chat-error-notice svg { width: 20px; height: 20px; flex: none; }
.chat-error-notice h4 { font: 600 14px/20px var(--body); margin-bottom: 4px; }
.chat-error-copy { line-height: 20px; font-size: 13px; }
.chat-inline-email { font-weight: 600; text-decoration: underline; }
.chat-error-card, .chat-error-actions { display: grid; gap: 10px; }
.chat-error-actions .chat-actions > * { flex: 1 1 auto; }
.chat-manual-summary { min-height: 140px; margin-top: 12px; }

.chat-result { gap: 18px; }
.chat-receipt { display: flex; align-items: start; gap: 10px; font: 400 16px/25px var(--body); overflow-wrap: anywhere; }
.chat-receipt strong { font-family: var(--display); }
.chat-success-check { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px #eceae7; flex: none; }
.chat-outline { overflow: clip; border-radius: 24px; background: white; box-shadow: inset 0 0 0 1px #eceae7, 0 18px 40px -26px #1c191759; overflow-wrap: anywhere; }
.chat-outline-intro { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid #f0eeec; }
.chat-outline-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: #c1e1f7; color: #236796; }
.chat-outline-title { font: 500 19px/24px var(--display); letter-spacing: -.02em; }
.chat-outline-block, .chat-ownership { padding: 14px 18px; border-bottom: 1px solid #f0eeec; font: 400 14px/21px var(--body); }
.chat-outline-block h4 { margin-bottom: 6px; color: var(--chat-muted); font: 500 12px/16px var(--body); }
.chat-ownership { border-bottom: 0; border-top: 1px solid #f0eeec; color: var(--chat-muted); font-size: 12px; line-height: 17px; }
.chat-outline-toggle { width: 100%; min-height: 48px; padding-inline: 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 500; text-align: left; }
.chat-outline-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.chat-outline-details > .chat-primary { margin: 14px 18px; }

.hero-ask textarea { resize: none; overflow-wrap: anywhere; }
.chat-hero-composer { min-width: 0; align-self: start; }
.chat-hero-guidance { display: grid; gap: 2px; padding: 8px 4px 0; color: #1c1917; font-size: 12px; line-height: 17px; }
.chat-hero-starters { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.chat-hero-starters a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; background: #fafaf9db; box-shadow: inset 0 0 0 1px #fff9; font-weight: 500; }
.chat-hero-composer + .text-link { align-self: start; margin-top: 20px; }
.chat-resume, .chat-restart { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 500 13px/18px var(--body); }
.chat-resume, .chat-composer-error { width: fit-content; margin-block: 6px; padding: 4px 10px; border-radius: 12px; background: #fafaf9ee; color: #0c0a09; }
.chat-composer-error { color: #9b1c13; font-size: 13px; }
.chat-composer-error:empty { display: none; }
.chat-fallback a { text-decoration: underline; }
.closing-ask .chat-resume, .closing-ask .chat-composer-error { margin: 0; }
.closing .chat-fallback { position: absolute; top: 56px; right: 4%; max-width: 43%; padding: 16px; background: #fafaf9ee; color: #0c0a09; border-radius: 16px; }

@media (max-width: 767px) {
  .chat-sheet {
    inset: calc(var(--chat-viewport-top, 0px) + 26px) 0 auto;
    width: 100%;
    height: calc(var(--chat-viewport-height, 100dvh) - 26px);
    border-radius: 28px 28px 0 0;
    background: #fafaf9e6;
    backdrop-filter: blur(30px);
    box-shadow: inset 0 1px #fffc, 0 -20px 60px -20px #0e0a1e80;
    --chat-gutter: 16px;
    --chat-gap: 16px;
  }
  .chat-sheet[open] { animation-name: chat-rise; }
  @keyframes chat-rise { from { opacity: 0; transform: translateY(16px); } }
  .chat-sheet::backdrop { background: #14102661; }
  .chat-handle { display: block; flex: 0 0 5px; width: 38px; align-self: center; margin-top: 8px; border-radius: 999px; background: #1c19172e; }
  .chat-header { padding: 8px 16px 14px; }
  .chat-heading-row { gap: 8px; }
  .chat-heading-group h2 { font-size: 18px; line-height: 22px; }
  .chat-heading-group p { display: none; }
  .chat-step-label { padding-inline: 8px; }
  .chat-header .chat-mark { width: 36px; height: 36px; }
  .chat-header .chat-icon-button { width: 44px; height: 44px; }
  .chat-progress { margin-top: 12px; }
  .chat-scroll { padding-block: 18px 16px; }
  .chat-sheet[data-state="opener"]:not(.is-editing) .chat-scroll,
  .chat-sheet[data-state="sent"] .chat-scroll { padding-top: 22px; }
  .chat-opener { gap: 16px; }
  .chat-opener:not(:has([data-cta="chat-edit-save"])) .chat-primary { width: 100%; }
  .chat-question .chat-actions { justify-content: space-between; }
  .chat-opener .chat-question-title { font-size: 28px; line-height: 32px; }
  .chat-question { margin-left: 0; }
  .chat-question-mark { display: none; }
  .chat-chip, .chat-text-button, .chat-filed .chat-text-button, .chat-edit-button { min-height: 44px; }
  .chat-turn { position: relative; padding-bottom: 32px; }
  .chat-turn:has(.is-editing), .chat-turn:not(:has(button)) { padding-bottom: 0; }
  .chat-edit-button { position: absolute; bottom: -7px; right: 0; min-width: 44px; }
  .chat-field input, .chat-field textarea, .chat-reply { font-size: 16px; }
  .chat-field input { min-height: 48px; }
  .chat-contact-detail { min-height: 46px; font-size: 15px; }
  .chat-result > .chat-secondary,
  .chat-error-actions .chat-actions > * { width: 100%; }
  .chat-error-actions .chat-actions { display: grid; gap: 8px; }
  .chat-dock { padding-block: 12px max(26px, env(safe-area-inset-bottom)); }
  .chat-dock-send { width: 44px; height: 44px; }
  .chat-sheet.is-keyboard-visible.is-field-focused .chat-dock { display: none; }
  .chat-privacy a { display: inline-block; position: relative; z-index: 1; }
  .chat-privacy a::after { content: ''; position: absolute; inset: -13px -5px; }

  .chat-hero-composer { width: 100%; }
  .closing .chat-fallback { inset: 360px 10px auto; max-width: none; }
  .chat-hero-starters a { min-height: 44px; }
  .chat-hero-guidance { padding-top: 4px; font-size: 11px; }
  .chat-hero-composer + .text-link { margin-top: -10px; }
}
@media (max-width: 380px) {
  .chat-hero-starters { gap: 2px 4px; }
  .chat-hero-starters a { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-sheet[open], .chat-typing i { animation: none; }
}
