.brand-logo {
    display: block;
    width: 152px;
    height: auto;
    background: transparent;
    padding: 0;
}
.brand-logo.is-sm { width: 124px; }
.brand-logo.is-chat {
    width: 96px !important;
    max-width: none !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
a:has(.brand-logo) { line-height: 0; display: inline-flex; align-items: center; }

body.at .at-head .brand-logo { width: 146px; }
body.hb .hb-bar .brand-logo { width: 142px; }
body.sg .sg-pill .brand-logo,
body.sg .brand-logo.is-sm { width: 104px; }
body.fg .brand-logo {
    width: 100%;
    max-width: 198px;
    background: #f6f3ec;
    border-radius: 8px;
    padding: 6px 8px 5px;
}
body.fg .fg-top .brand-logo { width: 126px; max-width: none; }
body.fg .fg-foot .brand-logo { width: 140px; }

.chat-dock {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-family: "Segoe UI", sans-serif;
}
.chat-panel {
    width: min(360px, calc(100vw - 24px));
    height: min(520px, calc(100dvh - 108px));
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    color: #122017;
    border: 1px solid rgba(18, 32, 23, 0.08);
    box-shadow: 0 24px 60px rgba(8, 16, 12, 0.28);
    backdrop-filter: blur(16px);
}
.chat-panel[hidden] { display: none !important; }
.chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 10px;
    background: linear-gradient(180deg, #103028, #0c241e);
    color: #f3fff8;
}
.chat-head strong { display: block; font-size: 0.92rem; }
.chat-head em { font-style: normal; font-size: 0.72rem; color: #8ee0b2; }
.chat-head em::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #25d366; box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.18); }
.chat-x, .chat-launch, .chat-form button, .chat-chips button {
    border: 0;
    cursor: pointer;
    font: inherit;
}
.chat-x { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; font-size: 1.2rem; }
.chat-log { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(#f4f7f5, #eef3f0); }
.chat-msg { max-width: 88%; padding: 9px 11px; border-radius: 14px; white-space: pre-wrap; font-size: 0.88rem; line-height: 1.45; }
.chat-msg.is-bot { align-self: flex-start; background: #fff; border: 1px solid rgba(16, 48, 40, 0.08); }
.chat-msg.is-user { align-self: flex-end; background: #103028; color: #f4fff8; border-radius: 14px 14px 4px 14px; }
.chat-jump, .chat-chips button {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #128c7e;
    color: #fff;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
}
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-chips button { background: #fff; color: #103028; border: 1px solid rgba(16, 48, 40, 0.14); }
.chat-form { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid rgba(16, 48, 40, 0.08); }
.chat-form input { flex: 1; min-width: 0; min-height: 42px; border-radius: 12px; border: 1px solid rgba(16, 48, 40, 0.14); padding: 0 12px; font: inherit; }
.chat-form button { min-height: 42px; padding: 0 14px; border-radius: 12px; background: #103028; color: #fff; }
.chat-launch {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    box-shadow: 0 12px 28px rgba(18, 140, 70, 0.38);
}
.chat-launch svg { width: 30px; height: 30px; }
.chat-launch::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: chat-pulse 2.2s ease-out infinite;
}
@keyframes chat-pulse {
    70% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
body { overflow-x: clip; }
@media (max-width: 720px) {
    .brand-logo { width: 120px; }
    body.at .at-head .brand-logo,
    body.hb .hb-bar .brand-logo { width: 116px; }
    body.sg .sg-pill .brand-logo { width: 96px; }
    .chat-dock { right: 10px; left: 10px; align-items: flex-end; }
    .chat-panel { width: 100%; height: min(70dvh, 560px); }
    .chat-launch { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
    .chat-launch::after { animation: none; }
}
