/* Public chat styles, shared by the standalone page and script embed. */
:root, :host {
  --ink: #252b2e;
  --ink-soft: #4c5457;
  --muted: #6e7374;
  --line: #e3e0d9;
  --line-strong: #cecbc3;
  --paper: #f6f3ec;
  --surface: #fff;
  --surface-soft: #faf8f3;
  --forest: #142a22;
  --forest-2: #1e3a30;
  --accent: #b84f32;
  --widget-accent: var(--accent);
  --accent-dark: #963d25;
  --accent-soft: #f9e9de;
  --success: #25825d;
  --success-soft: #e3f3ec;
  --warning: #a66a10;
  --warning-soft: #fff2d6;
  --danger: #ba453d;
  --danger-soft: #fbe8e6;
  --info: #3b6e8c;
  --info-soft: #e7f1f7;
  --shadow-xs: 0 1px 2px rgba(18, 34, 27, .06);
  --shadow-sm: 0 7px 24px rgba(18, 34, 27, .07);
  --shadow-md: 0 18px 48px rgba(18, 34, 27, .14);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .58; }
img { max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent), transparent 40%); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 9999; left: 16px; top: -60px; padding: 11px 16px; border-radius: 0 0 8px 8px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md); font-weight: 700; }
.skip-link:focus { top: 0; }

.status-pill { display: inline-flex; align-items: center; width: fit-content; gap: 6px; padding: 5px 9px; border-radius: 999px; background: #eef1ef; color: #53605a; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill--review, .status-pill--pending { background: var(--warning-soft); color: var(--warning); }
.status-pill--approved, .status-pill--active, .status-pill--sent { background: var(--success-soft); color: var(--success); }
.status-pill--draft { background: var(--info-soft); color: var(--info); }
.status-pill--rejected, .status-pill--inactive, .status-pill--failed { background: var(--danger-soft); color: var(--danger); }
.status-pill--automatic { background: #eee9fa; color: #694fa0; }
.progress { height: 6px; overflow: hidden; border-radius: 999px; background: #e1e6e2; }
.progress > span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
/* Widget */
.widget-body { position: fixed; inset: var(--widget-viewport-top, 0px) 0 auto; height: var(--widget-viewport-height, 100dvh); overflow: hidden; background: transparent; }
.widget-shell { width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #f7f6f2; }
.widget-header { min-height: 69px; flex: 0 0 auto; padding: 10px clamp(14px, 4vw, 24px); display: flex; align-items: center; justify-content: space-between; gap: 15px; color: #fff; background: var(--forest); }
.widget-company { min-width: 0; display: flex; align-items: center; gap: 10px; }
.widget-company__logo { width: 39px; height: 39px; flex: 0 0 39px; border-radius: 9px; display: grid; place-items: center; overflow: hidden; color: #fff; background: var(--widget-accent); font-size: 13px; font-weight: 850; }
.widget-company__logo img { width: 100%; height: 100%; object-fit: cover; }
.widget-company > span:last-child { min-width: 0; display: grid; gap: 2px; }
.widget-company strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.widget-company small { color: #b1c2b9; font-size: 9px; }
.widget-company small i { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: #5bc58e; }
.widget-header__actions { display: flex; gap: 6px; }
.widget-icon-button { width: 36px; height: 36px; min-width: 36px; min-height: 36px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; color: #d9e4de; background: rgba(255,255,255,.055); font-size: 19px; }
.widget-icon-button:hover { color: #fff; background: rgba(255,255,255,.1); }
.widget-main { width: 100%; max-width: 820px; min-height: 0; flex: 1 1 auto; overflow-y: auto; margin: 0 auto; padding: clamp(24px, 5vw, 43px) clamp(15px, 5vw, 42px) 38px; }
.widget-progress { margin: -15px 0 26px; }
.widget-progress > div:first-child { margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 750; }
.widget-progress .progress { height: 4px; }
.widget-progress .progress span { background: var(--widget-accent); }
.widget-stage { animation: widget-stage-in .28s ease both; }
@keyframes widget-stage-in { from { opacity: 0; transform: translateY(7px); } }
.widget-loading { min-height: 0; height: 100%; display: grid; place-content: center; justify-items: center; gap: 17px; color: var(--muted); font-size: 12px; }
.craft-loader { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.craft-loader i { display: block; width: 7px; border-radius: 2px; background: var(--widget-accent); animation: craft 1s ease-in-out infinite alternate; }
.craft-loader i:nth-child(1) { height: 14px; }
.craft-loader i:nth-child(2) { height: 30px; animation-delay: .14s; }
.craft-loader i:nth-child(3) { height: 21px; animation-delay: .27s; }
@keyframes craft { to { opacity: .35; transform: scaleY(.75); transform-origin: bottom; } }
.widget-error { min-height: 0; height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; }
.widget-error > span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--danger); background: var(--danger-soft); font-size: 23px; font-weight: 800; }
.widget-error h1 { margin: 17px 0 7px; font-family: Georgia, serif; font-size: 27px; font-weight: 550; }
.widget-error p { max-width: 390px; margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.assistant-message { display: flex; align-items: flex-start; gap: 12px; }
.assistant-message--welcome { align-items: flex-start; gap: 10px; }
.assistant-avatar { width: 37px; height: 37px; flex: 0 0 37px; border-radius: 10px 10px 10px 3px; display: grid; place-items: center; color: #fff; background: var(--forest); font-size: 14px; }
.assistant-message > div { min-width: 0; flex: 1; }
.message-label, .stage-label { margin: 0 0 5px; color: color-mix(in srgb, var(--widget-accent), #76310e 35%); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.assistant-message h1 { margin: 0 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 5vw, 35px); font-weight: 550; line-height: 1.12; letter-spacing: -.02em; }
.assistant-message p:last-child:not(.message-label) { max-width: 620px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.service-section { margin: 18px 0 0 40px; }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.service-card { min-height: 92px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 11px; display: grid; grid-template-columns: 39px 1fr 20px; align-items: center; gap: 11px; color: var(--ink); background: #fff; text-align: left; transition: .18s; }
.service-card:hover { border-color: var(--widget-accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.service-card__icon { width: 39px; height: 39px; border-radius: 9px; display: grid; place-items: center; color: color-mix(in srgb, var(--widget-accent), #5d260b 45%); background: color-mix(in srgb, var(--widget-accent), white 85%); font-weight: 850; }
.service-card > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.service-card strong { font-size: 12px; }
.service-card small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.service-card__arrow { color: var(--widget-accent); font-size: 18px; }
.widget-empty { padding: 27px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; }
.widget-empty p { margin: 0 0 4px; font-size: 12px; font-weight: 750; }
.widget-empty small { color: var(--muted); font-size: 10px; }
.chat-history { margin: 0 0 24px 49px; display: grid; gap: 8px; }
.history-row { display: flex; align-items: flex-start; justify-content: flex-end; gap: 7px; }
.history-bubble { max-width: 78%; padding: 9px 12px; border-radius: 11px 11px 3px 11px; color: #fff; background: var(--forest-2); font-size: 10px; line-height: 1.45; }
.history-edit { width: 28px; height: 28px; flex: 0 0 28px; border: 0; border-radius: 6px; color: var(--muted); background: #e9edea; font-size: 10px; }
.question-content { padding: 20px 21px; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; background: #fff; box-shadow: var(--shadow-xs); }
.question-content h1 { font-size: clamp(22px, 4vw, 29px); }
.answer-form { margin-top: 21px; }
.answer-form input:not([type="radio"]):not([type="checkbox"]), .answer-form select, .answer-form textarea { width: 100%; min-height: 49px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--ink); background: #fff; font-size: 13px; }
.answer-form textarea { min-height: 100px; resize: vertical; }
.answer-form input:focus, .answer-form select:focus, .answer-form textarea:focus { border-color: var(--widget-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--widget-accent), transparent 87%); }
.answer-form .input-unit { position: relative; }
.answer-form .input-unit input { padding-right: 62px !important; }
.answer-form .input-unit span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.option-card { position: relative; min-height: 47px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 11px; font-weight: 650; }
.option-card:hover { border-color: var(--widget-accent); }
.option-card:has(input:checked) { border-color: var(--widget-accent); color: color-mix(in srgb, var(--widget-accent), #4e210b 42%); background: color-mix(in srgb, var(--widget-accent), white 91%); }
.option-card input { width: 17px; height: 17px; margin: 0; accent-color: var(--widget-accent); }
.answer-actions { margin-top: 17px; display: flex; justify-content: space-between; gap: 9px; }
.widget-button { min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: var(--ink); background: #fff; font-size: 11px; font-weight: 800; text-decoration: none; transition: .18s; }
.widget-button--primary { color: #fff; background: var(--widget-accent); border-color: var(--widget-accent); }
.widget-button--primary:hover:not(:disabled) { filter: brightness(.9); box-shadow: 0 6px 17px color-mix(in srgb, var(--widget-accent), transparent 72%); }
.widget-button--secondary, .widget-button--unknown, .widget-button--ghost { border-color: var(--line-strong); }
.widget-button--ghost { margin-right: auto; }
.widget-button--secondary:hover, .widget-button--unknown:hover { border-color: var(--widget-accent); color: color-mix(in srgb, var(--widget-accent), #4c1f09 45%); }
.widget-button--wide { width: 100%; }
.widget-button--large { min-height: 52px; font-size: 12px; }
.answer-error { margin: 10px 0 0; color: var(--danger); font-size: 10px; }
.contact-form { margin: 25px 0 0 49px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.widget-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.widget-form-field { margin-bottom: 13px; display: grid; gap: 6px; }
.widget-form-field label { color: #3d4943; font-size: 10px; font-weight: 750; }
.widget-form-field label small { color: var(--muted); font-weight: 500; }
.widget-form-field input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; }
.widget-form-field input:focus { border-color: var(--widget-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--widget-accent), transparent 87%); }
.widget-form-field input[aria-invalid="true"] { border-color: var(--danger); }
.consent-check { margin: 3px 0 17px; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 9px; line-height: 1.45; cursor: pointer; }
.consent-check input { width: 16px; height: 16px; margin: 1px 0 0; flex: 0 0 16px; accent-color: var(--widget-accent); }
.consent-check a { color: color-mix(in srgb, var(--widget-accent), #5c250a 42%); font-weight: 700; }
.welcome-consent { margin: 0 0 10px; max-width: none; gap: 8px; font-size: 11px; line-height: 1.45; }
.welcome-consent-error { margin: 0 0 10px; font-size: 12px; }
.summary-card { margin: 16px 0 0 49px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.summary-card__head { min-height: 63px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f1f4f1; }
.summary-card__head > span { display: grid; gap: 3px; }
.summary-card__head small { color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.summary-card__head strong { font-size: 12px; }
.summary-edit { border: 0; background: transparent; color: color-mix(in srgb, var(--widget-accent), #5b2409 42%); font-size: 9px; font-weight: 800; }
.summary-list { margin: 0; padding: 5px 15px; }
.summary-list > div { min-height: 46px; padding: 9px 0; border-top: 1px solid #edf0ee; display: grid; grid-template-columns: minmax(100px, .8fr) 1.2fr auto; align-items: center; gap: 10px; }
.summary-list > div:first-child { border-top: 0; }
.summary-list dt { color: var(--muted); font-size: 9px; }
.summary-list dd { margin: 0; font-size: 10px; font-weight: 700; }
.summary-list button { border: 0; background: none; color: var(--muted); font-size: 9px; text-decoration: underline; }
.summary-contact { padding: 13px 15px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.assumption-note { margin: 13px 0 0 49px; padding: 11px 13px; border-radius: 9px; display: flex; gap: 9px; color: #815412; background: var(--warning-soft); }
.assumption-note > span { width: 19px; height: 19px; flex: 0 0 19px; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.assumption-note p { margin: 1px 0 0; font-size: 9px; line-height: 1.45; }
#stage-summary > .widget-button, #stage-summary > .answer-error, .submit-note { width: calc(100% - 49px); margin-left: 49px; }
#stage-summary > .widget-button { margin-top: 18px; }
.submit-note { color: var(--muted); text-align: center; font-size: 8px; }
.result-hero { display: grid; justify-items: center; text-align: center; }
.result-check { width: 62px; height: 62px; margin-bottom: 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--success); box-shadow: 0 0 0 8px var(--success-soft); font-size: 27px; font-weight: 850; }
.result-hero h1 { margin: 0 0 9px; font-family: Georgia, serif; font-size: clamp(27px, 5vw, 36px); font-weight: 550; }
.result-hero > p:last-child { max-width: 530px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.quote-result { max-width: 560px; margin: 25px auto; border: 1px solid #d5ded8; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.quote-result__head { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #f3f5f2; }
.quote-result__head > span:first-child { display: grid; }
.quote-result__head small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.quote-result__head strong { font-size: 11px; }
.quote-result__price { padding: 21px 16px 16px; display: grid; justify-items: center; }
.quote-result__price small { color: var(--muted); font-size: 9px; }
.quote-result__price strong { margin: 4px 0; font-family: Georgia, serif; font-size: 30px; }
.quote-result__price em { color: var(--muted); font-size: 8px; font-style: normal; }
.quote-result .widget-button { margin: 0 16px 16px; width: calc(100% - 32px); }
.next-steps { max-width: 560px; margin: 26px auto; }
.next-steps h2 { margin: 0 0 13px; font-size: 12px; }
.next-steps ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.next-steps li { padding: 10px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.62); }
.next-steps li > span { width: 27px; height: 27px; flex: 0 0 27px; border-radius: 50%; display: grid; place-items: center; color: color-mix(in srgb, var(--widget-accent), #522009 43%); background: color-mix(in srgb, var(--widget-accent), white 86%); font-size: 9px; font-weight: 850; }
.next-steps p { margin: 0; display: grid; gap: 2px; }
.next-steps strong { font-size: 10px; }
.next-steps small { color: var(--muted); font-size: 9px; }
#new-request { max-width: 560px; margin: 0 auto; display: flex; }
.widget-footer { min-height: 36px; flex: 0 0 auto; padding: 0 16px; border-top: 1px solid var(--line); display: grid; align-items: start; justify-content: normal; gap: 10px; color: #8a938e; background: #f1f2ef; font-size: 10px; position: relative; grid-template-columns: minmax(0, 1fr) auto; }
.widget-toast { flex: 0 0 auto; max-height: 25%; overflow-y: auto; margin: 8px 16px 0; padding: 10px 14px; border-radius: 8px; color: #fff; background: var(--forest); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

/* Public conversation: free questions first, optional quote details alongside. */
.customer-composer { display: grid; gap: 6px; margin: 0; }
.customer-composer label { font-size: 14px; font-weight: 600; }
.customer-transcript { display: flex; flex-direction: column; gap: 12px; }
.customer-bubble { max-width: 92%; border-radius: 16px; padding: 12px 14px; background: white; border: 1px solid #e2e8e4; overflow-wrap: anywhere; font-size: 14px; }
.customer-bubble > strong { font-size: 10px; color: #587064; display: block; line-height: 1.4; }
.customer-bubble p { white-space: pre-wrap; line-height: 1.55; margin: 5px 0 0; }
.customer-bubble--customer { align-self: flex-end; background: #e7eee8; border-color: #d6e1d8; }
.customer-bubble--assistant { align-self: flex-start; }
.customer-bubble--notice { align-self: flex-start; background: #f0f4f1; }
.customer-options { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.customer-options p { flex: 0 0 100%; font-size: 12px; margin: 0 0 4px; }
.customer-options .widget-button { min-height: 34px; font-size: 12px; padding: 7px 12px; border-radius: 18px; }
.customer-preview { background: #f0f5ef; border: 1px solid #d2dfd0; border-radius: 12px; padding: 16px; margin-top: 16px; font-size: 12px; }
.customer-preview-total { font-size: 26px; letter-spacing: -1px; }
.customer-preview > p { font-size: 13px; }
.customer-preview dl > div { display: flex; justify-content: space-between; gap: 4px 12px; padding: 8px 0; flex-wrap: wrap; }
.customer-preview dd { white-space: nowrap; margin: 0; }
.customer-facts { margin-top: 12px; padding: 12px; border: 1px solid #e2e8e4; border-radius: 12px; background: var(--surface); }
.customer-facts summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.customer-next-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; border-top: 0; padding-top: 5px; justify-content: flex-end; align-items: center; }
#customer-typing { font-size: 13px; color: #587064; padding: 12px; }
#customer-quote-notice { line-height: 1.6; margin: 12px 0 0; font-size: 12px; }

.widget-body :is(h1,h2,h3,h4), .widget-shell :is(h1,h2,h3,h4) { font-family: var(--font); }
.widget-footer .widget-credit { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.widget-credit img { width: 16px; height: 16px; }

/* Keep the conversation scrollable and its composer inside the available viewport. */
.widget-main.widget-main--conversation { display: flex; overflow: hidden; padding: 0; }
.widget-main--conversation > .widget-stage { width: 100%; min-height: 0; display: flex; flex-direction: column; animation: none; }
.chat-scroll-area { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 16px; scrollbar-width: thin; }
.assistant-message--welcome .assistant-avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; }
.assistant-message--welcome > div { flex: 0 1 auto; padding: 13px 15px; border: 1px solid var(--line); border-radius: 3px 15px 15px; background: var(--surface); }
.welcome-introduction { overflow-wrap: anywhere; margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.assistant-message--welcome #welcome-title { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.4; letter-spacing: 0; overflow-wrap: anywhere; }
.assistant-message--welcome #welcome-guidance { margin-top: 7px; font-size: 13px; }
.service-section .stage-label { margin-bottom: 9px; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
#stage-welcome:not(.is-guided) .service-grid { display: flex; flex-wrap: wrap; gap: 7px; }
#stage-welcome:not(.is-guided) .service-card { display: flex; min-height: 36px; max-width: 100%; padding: 8px 12px; border-radius: 18px; gap: 6px; box-shadow: none; }
#stage-welcome:not(.is-guided) .service-card strong { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
#stage-welcome:not(.is-guided) .service-card__icon,
#stage-welcome:not(.is-guided) .service-card small,
#stage-welcome:not(.is-guided) .service-card__arrow { display: none; }
.chat-dock { flex: 0 0 auto; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.chat-dock .consent-check input { width: 18px; height: 18px; flex-basis: 18px; }
.composer-input { display: flex; align-items: flex-end; gap: 8px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.composer-input:focus-within { border-color: var(--widget-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--widget-accent), transparent 88%); }
.composer-input textarea { display: block; flex: 1; min-width: 0; height: 44px; min-height: 44px; max-height: 120px; padding: 11px 8px; border: 0; border-radius: 10px; resize: none; font-size: 16px; line-height: 22px; }
.composer-input textarea:focus { outline: 0; }
.chat-send { width: 44px; height: 44px; flex: 0 0 44px; min-height: 44px; padding: 0; border-radius: 12px; font-size: 23px; }
.chat-send[aria-busy="true"] { font-size: 14px; }
.chat-send .spinner { border: 2px solid #ffffff55; border-top-color: currentColor; border-radius: 50%; animation: chat-spin .7s linear infinite; }
@keyframes chat-spin { to { transform: rotate(360deg); } }
.customer-options:empty { display: none; }
.customer-preview .submit-note, .customer-facts .submit-note { width: 100%; margin-left: 0; font-size: 11px; text-align: left; }
.customer-facts .summary-list { padding: 5px 0; }
.customer-next-actions > .widget-button { width: auto; min-height: 32px; margin: 0; padding: 5px 0; border: 0; background: transparent; font-size: 11px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.customer-next-actions > #customer-create-quote { margin-right: auto; color: var(--ink); font-weight: 700; }
.widget-credit { padding: 9px 0; white-space: nowrap; }
.chat-info { min-width: 0; }
.chat-info summary { min-height: 36px; padding: 10px 0; width: fit-content; cursor: pointer; color: var(--ink-soft); }
.chat-info[open] { grid-column: 1 / -1; }
.chat-info[open] + .widget-credit { position: absolute; top: 0; right: 16px; }
.chat-info__content { max-height: 28dvh; overflow-y: auto; padding: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.chat-info__content p { margin: 0 0 10px; }
.chat-info__content p:last-child { margin-bottom: 0; }

.chat-disclosure { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }

@media (min-width: 700px) {
  .widget-body { padding: 18px; background: radial-gradient(circle at 15% 5%, #e9eee9, transparent 33%), #dfe5e0; }
  .widget-shell { width: min(780px, 100%); height: 100%; margin: 0 auto; border: 1px solid rgba(20,42,34,.12); border-radius: 17px; box-shadow: 0 24px 70px rgba(20,42,34,.18); }
}

@media (max-width: 520px) {
  .widget-body { padding: 0; }
  .widget-main { padding-top: 27px; }
  .widget-header { min-height: 64px; }
  .assistant-message { gap: 9px; }
  .assistant-avatar { width: 31px; height: 31px; flex-basis: 31px; border-radius: 8px 8px 8px 2px; font-size: 11px; }
  .assistant-message h1 { font-size: 25px; }
  .chat-history, .contact-form, .summary-card, .assumption-note, #stage-summary > .widget-button, #stage-summary > .answer-error, .submit-note { margin-left: 40px; }
  #stage-summary > .widget-button, #stage-summary > .answer-error, .submit-note { width: calc(100% - 40px); }
  .service-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 78px; }
  .question-content { padding: 17px 15px; }
  .option-grid { grid-template-columns: 1fr; }
  .answer-actions { flex-direction: column-reverse; }
  .answer-actions .widget-button { width: 100%; }
  .contact-form { padding: 15px; }
  .widget-form-grid { grid-template-columns: 1fr; gap: 0; }
  .summary-list > div { grid-template-columns: 1fr auto; }
  .summary-list dt { grid-column: 1/-1; }
}

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

@media (max-height: 520px) {
  .widget-body { padding: 0; }
  .widget-header { min-height: 56px; padding-top: 7px; padding-bottom: 7px; }
  .chat-scroll-area { padding-top: 12px; padding-bottom: 12px; }
  .chat-dock { padding-top: 8px; padding-bottom: 8px; }
}
/* Database-owned product cards, optional for businesses with approved images. */
.customer-product-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; max-width: 320px; background: var(--surface); margin: 16px 0; }
.customer-product-card > img { display: block; width: 100%; height: 200px; object-fit: contain; }
.customer-product-card > strong, .customer-product-card > p, .customer-product-card > small { display: block; margin: 12px 16px; }
.customer-product-card > p { font-weight: 700; font-size: 20px; }

/* Explicit themes leave older snippets and the standalone page unchanged. */
.widget-body--inline { padding: 0; background: transparent; }
.widget-body--inline .skip-link:not(:focus) { box-shadow: none; }
.widget-body--inline .widget-shell { width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.widget-themed { color: var(--widget-text); background: var(--widget-background); font-family: var(--font); font-size: var(--widget-font-size); }
.widget-themed[data-presentation=inline][data-style=framed] { border: 1px solid var(--line); border-radius: var(--widget-radius); }
.widget-themed .widget-header { background: var(--widget-accent); color: var(--widget-accent-text); }
.widget-themed .widget-company small, .widget-themed .widget-icon-button { color: inherit; }
.widget-themed .widget-company__logo { color: inherit; background: transparent; }
.widget-themed .widget-company__logo img { object-fit: contain; }
.widget-themed[data-presentation=inline] .widget-header { flex-shrink: 0; min-height: 36px; padding: 4px 0; }
.widget-themed[data-presentation=inline][data-company-header=false] .widget-header { justify-content: flex-end; background: transparent; color: var(--ink-soft); }
.widget-themed[data-company-header=false] .widget-company { display: none; }
.widget-themed[data-presentation=inline] .widget-icon-button { width: auto; min-height: 32px; height: auto; padding: 4px 8px; font-size: 12px; border: 0; background: transparent; }
.widget-themed[data-presentation=inline] .widget-main { max-width: none; }
.widget-themed[data-presentation=inline] .assistant-message--welcome .assistant-avatar { display: none; }
.widget-themed[data-presentation=inline] .assistant-message--welcome > div { padding: 0; border: 0; background: transparent; }
.widget-themed[data-presentation=inline] .service-section { margin-left: 0; }
.widget-themed[data-presentation=inline][data-style=integrated] .chat-scroll-area { padding: 12px 0; }
.widget-themed[data-presentation=inline][data-style=integrated] .chat-dock { padding: 12px 0; }
.widget-themed[data-presentation=inline][data-style=integrated] .widget-footer { padding-left: 0; padding-right: 0; }
.widget-themed .widget-footer { background: var(--surface-soft); color: var(--muted); }
.widget-themed .chat-dock { background: var(--surface-soft); }
.widget-themed .widget-button--primary { color: var(--widget-accent-text); }
.widget-themed .widget-button:not(.widget-button--primary) { color: var(--ink); background: var(--surface); }
.widget-themed :is(.customer-bubble, .service-card, .option-card, .question-content, .contact-form, .summary-card, .quote-result, .customer-facts, .composer-input, .widget-button, .customer-product-card) { border-radius: var(--widget-radius); }
.widget-themed :is(.customer-bubble, .service-card, .question-content, .contact-form, .summary-card, .quote-result, .composer-input, .widget-form-field input, .answer-form input, .answer-form textarea, .answer-form select) { color: var(--ink); background: var(--surface); }
.widget-themed :is(.customer-bubble--customer, .customer-bubble--notice, .customer-preview, .summary-card__head, .quote-result__head) { background: var(--surface-soft); }
.widget-themed .customer-bubble > strong, .widget-themed .widget-form-field label { color: var(--ink-soft); }
.widget-themed :is(.customer-bubble, .welcome-introduction, .composer-input textarea, .widget-form-field input, .answer-form input, .answer-form textarea, .answer-form select) { font-size: var(--widget-font-size); }
.widget-themed :is(.widget-button, .service-card strong, .option-card) { font-size: calc(var(--widget-font-size) * .875); }
.widget-themed :is(.welcome-consent, .chat-disclosure, .chat-info__content) { font-size: calc(var(--widget-font-size) * .75); }
.widget-themed .composer-input textarea { color: var(--ink); background: transparent; }
.widget-themed #welcome-title { font-size: calc(var(--widget-font-size) * 1.25); }
.widget-themed .customer-product-card > img { height: auto; max-height: 200px; }
