/* chat.css - the assistant: a launcher above the phone dock, a bottom sheet on phones, a panel on wide screens. Tokens only. */
.chat-fab { position: fixed; right: max(var(--s-4), env(safe-area-inset-right, 0px)); bottom: calc(var(--s-5) + var(--safe-b)); z-index: var(--z-chat); display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--chat-fab); padding: 0 var(--s-5) 0 var(--s-4); background: var(--c-white); color: var(--c-black); border: 0; font-family: var(--f-display); font-weight: var(--wght-ui); font-stretch: var(--wdth-ui); font-size: var(--t-s); letter-spacing: .02em; text-transform: uppercase; clip-path: polygon(calc(var(--chat-fab) * var(--tan)) 0, 100% 0, 100% 100%, 0 100%); padding-left: calc(var(--chat-fab) * var(--tan) + var(--s-2)); transition: translate var(--d-ui) var(--e-out), opacity var(--d-ui) linear; }
.chat-fab svg { width: 20px; height: 20px; flex: none; }
.chat-fab:hover { translate: 0 -2px; }
.chat-fab:focus-visible { outline: var(--rule) solid var(--c-yellow); outline-offset: 4px; }
/* phones: the chat lives in the dock (third slot), never floating over the copy */
@media (max-width: 900px) { .chat-fab { display: none; } }
html.intro-on .chat-fab { visibility: hidden; }
html.chat-open .chat-fab { visibility: hidden; }

.chat { position: fixed; z-index: var(--z-panel); right: var(--s-5); bottom: var(--s-5); width: min(25rem, calc(100vw - 2 * var(--s-5))); height: min(38rem, calc(100svh - var(--nav-h) - 2 * var(--s-5))); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: var(--c-surface-2); box-shadow: var(--shadow-panel), 0 0 0 1px var(--c-line-2); overscroll-behavior: contain; animation: chat-in var(--d-ui) var(--e-out) both; }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .chat { left: 0; right: 0; bottom: 0; width: 100%; height: min(88svh, 44rem); padding-bottom: var(--safe-b); box-shadow: 0 calc(var(--hair) * -1) 0 var(--c-line-2); }
  @keyframes chat-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.chat__head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-bottom: var(--hair) solid var(--c-line); background: var(--c-black); }
.chat__title { font-family: var(--f-display); font-weight: 850; font-stretch: var(--wdth-display); text-transform: uppercase; font-size: var(--t-s); color: var(--c-white); letter-spacing: .02em; line-height: 1.1; }
.chat__title:focus { outline: none; }
.chat__title:focus-visible { outline: var(--rule) solid var(--c-white); outline-offset: 2px; }
.chat__tag { font-size: var(--t-s); color: var(--c-body); line-height: 1.3; }
.chat__call { --h: var(--tap); margin-inline: calc(var(--tap) * var(--tan) / 2); }
.chat__x { width: var(--tap); height: var(--tap); display: grid; place-items: center; background: none; border: 0; color: var(--c-white); padding: 0; }
.chat__x svg { width: 22px; height: 22px; }
.chat__log { overflow-y: auto; padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); overscroll-behavior: contain; scroll-behavior: smooth; }
.chat__log:focus-visible { outline: var(--rule) solid var(--c-white); outline-offset: -4px; }
.msg { display: flex; }
.msg--me { justify-content: flex-end; }
.msg__b { max-width: 88%; padding: var(--s-3) var(--s-4); font-size: var(--t-s); line-height: 1.45; color: var(--c-white); background: var(--c-surface); text-wrap: pretty; }
.msg--me .msg__b { background: var(--c-white); color: var(--c-black); }
.msg__b a { color: var(--c-white); font-weight: 600; text-decoration-thickness: var(--hair); text-underline-offset: .2em; }
.msg--typing .msg__b { color: var(--c-muted); }
.msg__small { margin-top: var(--s-2); font-size: var(--t-s); color: var(--c-body); }
.chat__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-2) var(--s-4) var(--s-3); max-height: 15.5rem; overflow-y: auto; overscroll-behavior: contain; border-top: var(--hair) solid var(--c-line); }
.chat__chips:empty { display: none; }
.chip { min-height: var(--tap); padding: 0 var(--s-3); display: inline-flex; align-items: center; background: transparent; border: var(--hair) solid var(--c-line-2); color: var(--c-white); font-size: var(--t-xs); font-weight: 500; text-align: left; text-decoration: none; line-height: 1.2; }
.chip:hover { border-color: var(--c-white); }
.chip--go { background: var(--c-yellow); color: var(--c-ink-on-yellow); border-color: var(--c-yellow); font-weight: 650; }
.chip--call { background: var(--c-white); color: var(--c-black); border-color: var(--c-white); font-weight: 650; }
.chip--wide { flex: 1 1 100%; justify-content: center; }
.chat__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: var(--hair) solid var(--c-line); background: var(--c-black); }
.chat__in { min-height: 52px; padding: 0 var(--s-4); background: transparent; border: 0; color: var(--c-white); font-size: 1rem; }
.chat__in::placeholder { color: var(--c-muted); }
.chat__in:focus-visible { outline: var(--rule) solid var(--c-white); outline-offset: -3px; }
.chat__send { width: 52px; display: grid; place-items: center; background: none; border: 0; color: var(--c-white); }
.chat__send svg { width: 22px; height: 22px; }
.chat__consent { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
.consent--chat { font-size: var(--t-s); }   /* consent is read as a sentence: 16 px (older-reader pass, 2026-11-17) */
.chat__sendlead { justify-self: start; margin-left: calc(44px * var(--tan) / 2); }
/* the chat button waits until the visitor scrolls past the top of the first screen */
html.at-top .chat-fab { opacity: 0; visibility: hidden; pointer-events: none; translate: 0 8px; transition: translate var(--d-ui) var(--e-out), opacity var(--d-ui) linear, visibility 0s linear var(--d-ui); }
html.form-in .chat-fab { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--d-ui) linear, visibility 0s linear var(--d-ui); }
/* the open sheet sits above the phone dock (which itself sits above the intro); the dock steps away while it is open */
.chat { z-index: calc(var(--z-intro) + 2); }
html.chat-open .dock { translate: 0 calc(100% + 2px); }
@media (max-width: 900px) { html.chat-open body::after { content: ""; position: fixed; inset: 0; z-index: calc(var(--z-intro) + 1); background: var(--c-veil-strong); } }
