.freight-chat-launcher {
  position: fixed; z-index: 6; right: clamp(14px,3vw,36px);
  bottom: calc(16px + env(safe-area-inset-bottom,0px));
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 1px solid #627269; border-radius: 50%; color: #e4f2e8; background: #141b16;
}
@media (hover: hover) and (pointer: fine) { .freight-chat-launcher:hover { background: #26342b; color: var(--signal); } }
body.logo-opening .freight-chat-launcher { visibility: hidden; }

.freight-chat {
  width: min(386px,calc(100% - 24px)); height: min(480px,calc(100dvh - 38px - env(safe-area-inset-bottom,0px)));
  max-width: none; max-height: none;
  margin: auto clamp(12px,3vw,36px) calc(12px + env(safe-area-inset-bottom,0px)) auto;
  padding: 0; border: 1px solid #495850; border-radius: 12px;
  color: #eff5f1; background: #111613; box-shadow: 0 12px 40px #0008; overflow: hidden;
}
.freight-chat[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.freight-chat::backdrop { background: #070a083d; }
body:has(.freight-chat[open]) { overflow: hidden; }
.freight-chat :focus-visible, .freight-chat-launcher:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.chat-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 8px 6px 18px; border-bottom: 1px solid #2d3731;
}
.chat-header h2 { font-size: 1rem; margin: 0; letter-spacing: -.02em; outline: none; }
.chat-close {
  width: 44px; height: 44px; padding: 0; font-size: 1.45rem; line-height: 1;
  color: #c6d5cc; border: 0; border-radius: 5px; background: transparent;
}
@media (hover: hover) and (pointer: fine) { .chat-close:hover { background: #242f28; color: #fff; } }
.chat-history { position: relative; overflow: auto; padding: 16px 18px; overscroll-behavior: contain; }
.chat-history:focus-visible { outline-offset: -3px; }
.chat-start p { color: #c2d0c7; font-size: .92rem; margin: 4px 0 17px; }
.chat-prompts { display: grid; }
.chat-prompts button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 4px 1px; border: 0; border-top: 1px solid #303b33;
  background: transparent; color: #e3eee6; text-align: left; font-size: .88rem;
}
.chat-prompts button::after { content: "↗" / ""; color: #a7c2ae; }
@media (hover: hover) and (pointer: fine) { .chat-prompts button:hover { color: var(--signal); } }
.chat-message { max-width: 95%; margin: 0 0 15px; font-size: .92rem; overflow-wrap: anywhere; }
.chat-message p { margin: 0; }
.chat-message a { display: inline-block; margin-top: 6px; color: #a9e9b8; text-decoration: underline; text-underline-offset: 4px; }
@media (hover: hover) and (pointer: fine) { .chat-message a:hover { color: var(--signal); } }
.chat-message-customer {
  width: fit-content; max-width: 85%; margin-left: auto; padding: 8px 12px;
  border-radius: 10px 10px 3px 10px; background: #28362d; color: #eff5f1;
}
.chat-footer { padding: 10px 14px 9px; border-top: 1px solid #2d3731; }
.chat-compose {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center;
  border: 1px solid #526458; border-radius: 7px; background: #181f1a;
}
.chat-compose:focus-within { border-color: #a4c5ad; }
.chat-compose input {
  min-width: 0; min-height: 47px; padding: 7px 10px;
  border: 0; background: transparent; color: #fff; font-size: 16px;
}
.chat-compose input::placeholder { color: #a5b6aa; }
.chat-compose input:focus-visible { outline: none; }
.chat-compose button {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 2px;
  padding: 0; border: 0; border-radius: 5px; background: var(--signal); color: #102317;
}
.chat-compose button:disabled { color: #9faea4; background: transparent; cursor: default; }
.chat-compose button:focus-visible { outline-offset: -2px; }
.chat-note { margin: 6px 0 0; color: #a6b7ac; font-size: .72rem; }
