/* ============================================================
   Human Access — SE AI Chatbot UI Theme
   Version: HA-UI + BUBBLE-REFINEMENT-01
   Source: C:\wamp64-2\www\bot\1.html (current light glass rebuild)
   Scope: #se-chat-panel.ha-reference-chat
          .se-chat-panel-inline.ha-reference-chat
          #se-chat-bubble.ha-chat-bubble (full toggle from 1.html)
   Excluded: launcher label, in-panel avatars
   ============================================================ */

@keyframes ha-ref-orbFloat {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.15); }
    66% { transform: translate(-20px, 30px) scale(0.9); }
    100% { transform: translate(20px, -20px) scale(1.05); }
}
@keyframes ha-ref-borderWaveSlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes ha-ref-borderRotateSlow {
    0% { background-position: 0% 50%; }
    33% { background-position: 100% 50%; }
    66% { background-position: 200% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes ha-send-border-orbit {
    0% { transform: rotate(0deg); }
    14% { transform: rotate(32deg); }
    37% { transform: rotate(118deg); }
    61% { transform: rotate(196deg); }
    83% { transform: rotate(292deg); }
    100% { transform: rotate(360deg); }
}
@keyframes ha-ref-dotBounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
    40% { transform: scale(1.2); opacity: 0.9; }
}
@keyframes ha-ref-linkGlow {
    0%, 100% { box-shadow: 0 0 6px rgba(0, 193, 212, 0.02); }
    50% { box-shadow: 0 0 20px rgba(0, 193, 212, 0.06); }
}
@keyframes ha-ref-statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
@keyframes ha-ref-msgSlide {
    0% { opacity: 0; transform: translateY(20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   FLOATING PANEL — glass-chat (light)
   Core keeps display/position/z-index; we only set size + look.
   ============================================================ */
#se-chat-panel.ha-reference-chat {
    width: 420px;
    height: 640px;
    max-height: 80vh;
    background: #ffffff33;
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #1a1a2e;
    font-family: sans-serif !important;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#se-chat-panel.ha-reference-chat.se-chat-panel-open {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* Border + glow as children (values from glass-chat::before/::after) */
#se-chat-panel.ha-reference-chat > .ha-chat-border,
.se-chat-panel-inline.ha-reference-chat > .ha-chat-border {
    position: absolute;
    inset: -2px;
    border-radius: 42px;
    padding: 2px;
    pointer-events: none;
    z-index: 30;
    background: conic-gradient(
        from 0deg,
        rgba(0, 193, 212, 0.4) 0%, rgba(0, 193, 212, 0.2) 10%,
        transparent 16%, transparent 30%,
        rgba(0, 193, 212, 0.3) 36%, rgba(0, 193, 212, 0.15) 46%,
        transparent 52%, transparent 66%,
        rgba(0, 193, 212, 0.35) 72%, rgba(0, 193, 212, 0.2) 84%,
        transparent 90%, transparent 100%
    );
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: ha-ref-borderWaveSlow 9.6s ease-in-out infinite;
}

#se-chat-panel.ha-reference-chat > .ha-chat-glow,
.se-chat-panel-inline.ha-reference-chat > .ha-chat-glow {
    position: absolute;
    inset: -6px;
    border-radius: 44px;
    pointer-events: none;
    z-index: 0;
    background: conic-gradient(
        from 90deg,
        rgba(0, 193, 212, 0.06) 0%,
        transparent 25%,
        rgba(0, 193, 212, 0.03) 50%,
        transparent 75%,
        rgba(0, 193, 212, 0.08) 100%
    );
    background-size: 300% 300%;
    animation: ha-ref-borderWaveSlow 12s ease-in-out infinite reverse;
    filter: blur(8px);
    opacity: 0.6;
}

/* INLINE — visual only */
.se-chat-panel-inline.ha-reference-chat {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px) saturate(1.8);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    border-radius: 40px;
    overflow: hidden;
    box-shadow:
        0 30px 70px -20px rgba(0, 0, 0, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #1a1a2e;
    font-family: sans-serif !important;
}

/* Panel typography — sans-serif everywhere except icon fonts */
#se-chat-panel.ha-reference-chat :not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]),
.se-chat-panel-inline.ha-reference-chat :not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]) {
    font-family: sans-serif !important;
}

#se-chat-panel.ha-reference-chat .fa,
#se-chat-panel.ha-reference-chat .fas,
#se-chat-panel.ha-reference-chat .far,
#se-chat-panel.ha-reference-chat .fab,
#se-chat-panel.ha-reference-chat [class*="fa-"],
.se-chat-panel-inline.ha-reference-chat .fa,
.se-chat-panel-inline.ha-reference-chat .fas,
.se-chat-panel-inline.ha-reference-chat .far,
.se-chat-panel-inline.ha-reference-chat .fab,
.se-chat-panel-inline.ha-reference-chat [class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free",
        "FontAwesome" !important;
}

#se-chat-panel.ha-reference-chat > .ha-chat-reflection,
.se-chat-panel-inline.ha-reference-chat > .ha-chat-reflection {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
    pointer-events: none;
    z-index: 5;
    border-radius: 40px 40px 0 0;
}

#se-chat-panel.ha-reference-chat > .ha-id-blob,
.se-chat-panel-inline.ha-reference-chat > .ha-id-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
    animation: ha-ref-orbFloat 12s ease-in-out infinite alternate;
}
#se-chat-panel.ha-reference-chat > .ha-id-blob--1,
.se-chat-panel-inline.ha-reference-chat > .ha-id-blob--1 {
    width: 320px;
    height: 320px;
    background: #ffffffa8;
    top: -15%;
    right: -15%;
    animation-duration: 14s;
    opacity: 0.08;
}
#se-chat-panel.ha-reference-chat > .ha-id-blob--2,
.se-chat-panel-inline.ha-reference-chat > .ha-id-blob--2 {
    width: 260px;
    height: 260px;
    background: #00cae32b;
    bottom: -10%;
    left: -15%;
    animation-duration: 18s;
    animation-delay: 1.5s;
    opacity: 0.06;
}
#se-chat-panel.ha-reference-chat > .ha-id-blob--3,
.se-chat-panel-inline.ha-reference-chat > .ha-id-blob--3 {
    width: 200px;
    height: 200px;
    background: #00cae33b;
    top: 35%;
    left: 15%;
    animation-duration: 16s;
    animation-delay: 3s;
    opacity: 0.05;
}

#se-chat-panel.ha-reference-chat > #se-chat-header,
#se-chat-panel.ha-reference-chat > #se-chat-messages,
#se-chat-panel.ha-reference-chat > #se-chat-input-area,
#se-chat-panel.ha-reference-chat > #se-suggested-prompts,
#se-chat-panel.ha-reference-chat > #se-recent-prompts,
#se-chat-panel.ha-reference-chat > #se-ai-suggestions,
#se-chat-panel.ha-reference-chat > .se-followup-suggestions,
#se-chat-panel.ha-reference-chat > .se-gdpr-consent,
#se-chat-panel.ha-reference-chat > .se-gdpr-declined,
.se-chat-panel-inline.ha-reference-chat > #se-chat-header,
.se-chat-panel-inline.ha-reference-chat > #se-chat-messages,
.se-chat-panel-inline.ha-reference-chat > #se-chat-input-area {
    position: relative;
    z-index: 10;
}

/* ============================================================
   HEADER — glass-header
   ============================================================ */
#se-chat-panel.ha-reference-chat #se-chat-header,
.se-chat-panel-inline.ha-reference-chat #se-chat-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: #ffffffcc;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: #00cae3;
    box-shadow: none;
    min-height: 0;
}

#se-chat-panel.ha-reference-chat .se-chat-header-info,
.se-chat-panel-inline.ha-reference-chat .se-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#se-chat-panel.ha-reference-chat .se-chat-header-title,
.se-chat-panel-inline.ha-reference-chat .se-chat-header-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(26, 26, 46, 0.8);
    letter-spacing: -0.025em;
    line-height: 1.25;
}

#se-chat-panel.ha-reference-chat .se-chat-header-status,
.se-chat-panel-inline.ha-reference-chat .se-chat-header-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.125rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(5, 150, 105, 0.7);
    opacity: 1;
}

#se-chat-panel.ha-reference-chat .se-chat-status-dot,
.se-chat-panel-inline.ha-reference-chat .se-chat-status-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background: #34d399;
    box-shadow: none;
    animation: ha-ref-statusPulse 2s ease-in-out infinite;
}

#se-chat-panel.ha-reference-chat #se-chat-close,
#se-chat-panel.ha-reference-chat #se-chat-reset,
.se-chat-panel-inline.ha-reference-chat #se-chat-close,
.se-chat-panel-inline.ha-reference-chat #se-chat-reset {
    position: relative;
    isolation: isolate;
    overflow: visible;
    background: #ffffffb3 !important;
    border: none !important;
    color: #00cae3 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    padding: 0.575rem !important;
    border-radius: 22px !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: color 0.2s ease, background 0.2s ease;
    box-shadow: none !important;
}

#se-chat-panel.ha-reference-chat #se-chat-close::before,
#se-chat-panel.ha-reference-chat #se-chat-reset::before,
.se-chat-panel-inline.ha-reference-chat #se-chat-close::before,
.se-chat-panel-inline.ha-reference-chat #se-chat-reset::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgb(0 193 212 / 5%) 115deg,
        #00c1d4 150deg,
        #51dbe7 180deg,
        rgba(255, 255, 255, 0.95) 215deg,
        #00cae3 250deg,
        rgba(124, 58, 237, 0.65) 280deg,
        transparent 315deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
    animation: ha-header-button-border-orbit 16s linear infinite;
}

#se-chat-panel.ha-reference-chat #se-chat-close > *,
#se-chat-panel.ha-reference-chat #se-chat-reset > *,
.se-chat-panel-inline.ha-reference-chat #se-chat-close > *,
.se-chat-panel-inline.ha-reference-chat #se-chat-reset > * {
    position: relative;
    z-index: 1;
}

#se-chat-panel.ha-reference-chat #se-chat-close:hover,
#se-chat-panel.ha-reference-chat #se-chat-reset:hover,
#se-chat-panel.ha-reference-chat #se-chat-close:focus-visible,
#se-chat-panel.ha-reference-chat #se-chat-reset:focus-visible,
.se-chat-panel-inline.ha-reference-chat #se-chat-close:hover,
.se-chat-panel-inline.ha-reference-chat #se-chat-reset:hover,
.se-chat-panel-inline.ha-reference-chat #se-chat-close:focus-visible,
.se-chat-panel-inline.ha-reference-chat #se-chat-reset:focus-visible {
    background: #00c1d4 !important;
    color: #ffffff !important;
}

#se-chat-panel.ha-reference-chat #se-chat-close:hover i,
#se-chat-panel.ha-reference-chat #se-chat-reset:hover i,
#se-chat-panel.ha-reference-chat #se-chat-close:focus-visible i,
#se-chat-panel.ha-reference-chat #se-chat-reset:focus-visible i,
.se-chat-panel-inline.ha-reference-chat #se-chat-close:hover i,
.se-chat-panel-inline.ha-reference-chat #se-chat-reset:hover i,
.se-chat-panel-inline.ha-reference-chat #se-chat-close:focus-visible i,
.se-chat-panel-inline.ha-reference-chat #se-chat-reset:focus-visible i {
    color: #ffffff !important;
}

@keyframes ha-header-button-border-orbit {
    0% { transform: rotate(0deg); }
    18% { transform: rotate(42deg); }
    43% { transform: rotate(142deg); }
    69% { transform: rotate(244deg); }
    88% { transform: rotate(326deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================
   MESSAGES
   ============================================================ */
#se-chat-panel.ha-reference-chat #se-chat-messages,
.se-chat-panel-inline.ha-reference-chat #se-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 20px;
    gap: 16px;
    overflow-y: auto;
    position: relative;
    background: transparent;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
}

#se-chat-panel.ha-reference-chat #se-chat-messages::-webkit-scrollbar,
.se-chat-panel-inline.ha-reference-chat #se-chat-messages::-webkit-scrollbar {
    width: 3px;
}
#se-chat-panel.ha-reference-chat #se-chat-messages::-webkit-scrollbar-track,
.se-chat-panel-inline.ha-reference-chat #se-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#se-chat-panel.ha-reference-chat #se-chat-messages::-webkit-scrollbar-thumb,
.se-chat-panel-inline.ha-reference-chat #se-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 20px;
}
#se-chat-panel.ha-reference-chat #se-chat-messages::-webkit-scrollbar-thumb:hover,
.se-chat-panel-inline.ha-reference-chat #se-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 193, 212, 0.3);
}

#se-chat-panel.ha-reference-chat .se-chat-msg,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg {
    max-width: 100%;
    gap: 0.625rem;
    animation: ha-ref-msgSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-content,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-content {
    padding: 12px 16px;
    font-size: 0.85rem;
    line-height: 1.625;
    font-weight: 300;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* bubble-ai */
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content {
    max-width: 85%;
    background: rgb(255 255 255);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    filter: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px 20px 4px 20px;
    color: #000000;
    font-family: sans-serif !important;
    font-size: 14px;
    line-height: 1.65;
    font-weight: normal;
    box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.04);
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content p,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content span:not(.ha-assistant-meta-date),
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content strong,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content b,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content em,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content p,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content span:not(.ha-assistant-meta-date),
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content strong,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content b,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content em {
    font-family: sans-serif !important;
    color: #000000;
    font-size: 14px;
    line-height: 1.65;
    font-weight: normal;
    filter: none;
    text-shadow: none;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a span,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a span {
    font-family: sans-serif !important;
    font-size: inherit;
    line-height: inherit;
    filter: none;
    text-shadow: none;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a span,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a span {
    color: inherit !important;
    -webkit-text-fill-color: inherit;
}

/* bubble-user */
#se-chat-panel.ha-reference-chat .se-chat-msg-user .se-chat-msg-content,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-user .se-chat-msg-content {
    width: auto;
    background: rgb(0 193 212 / 70%);
    color: #ffffff;
    border: 1px solid rgba(0, 193, 212, 0.05);
    border-radius: 20px 20px 20px 4px;
    box-shadow: 0 4px 20px -8px rgba(0, 193, 212, 0.04);
    font-weight: 400;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-content p,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-content p {
    margin: 0 0 0.5rem;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    font-weight: 300;
}
#se-chat-panel.ha-reference-chat .se-chat-msg-user .se-chat-msg-content p,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-user .se-chat-msg-content p {
    font-weight: 400;
    color: #1a1a2e;
}
#se-chat-panel.ha-reference-chat .se-chat-msg-content p:last-child,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-content p:last-child {
    margin-bottom: 0;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-content h1,
#se-chat-panel.ha-reference-chat .se-chat-msg-content h2,
#se-chat-panel.ha-reference-chat .se-chat-msg-content h3,
#se-chat-panel.ha-reference-chat .se-chat-msg-content h4,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-content h1,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-content h2,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-content h3,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-content h4 {
    color: rgba(26, 26, 46, 0.9);
    font-weight: 500;
    margin: 0.4rem 0;
    line-height: 1.35;
}

/* Lists — spacing; link-lists styled separately as opt-btn cards */
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content ul,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content ol,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content ul,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content ol {
    margin-block: 0.5rem;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-text-list,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-text-list {
    margin-block: 0.5rem;
    padding-inline-start: 1.25rem;
    list-style-position: outside;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-text-list > li,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-text-list > li {
    margin: 0 8px;
    padding: 0;
    line-height: 1.65;
    color: #00cae3;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-text-list > li + li,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-text-list > li + li {
    margin-top: 0.2rem;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-text-list > br,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-text-list > br {
    display: none !important;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li {
    margin: 0 8px;
    line-height: 1.65;
    color: #00cae3;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li > strong,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li > b,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li > span,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li > strong,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li > b,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li > span {
    color: inherit;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li > p,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content li > p {
    margin: 0;
    color: inherit;
    filter: none;
    text-shadow: none;
}

/* creative-link — inline text links (from 1.html); link-list overrides follow */
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a {
    display: inline;
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    background: rgba(0, 193, 212, 0.06);
    border: 1px solid rgba(0, 193, 212, 0.12);
    color: #00c1d4 !important;
    -webkit-text-fill-color: #00c1d4;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.4s ease;
    animation: ha-ref-linkGlow 4s ease-in-out infinite;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    filter: none;
    text-shadow: none;
    font-size: inherit;
    margin: 0 0.1rem;
    white-space: normal;
    word-break: break-word;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-creative-link,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-creative-link {
    color: #00c1d4 !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-shadow: none !important;
}

/* Trailing meta date after em dash */
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-meta-date,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-meta-date {
    display: inline;
    margin-inline-start: 0.3rem;
    color: #7a7f86 !important;
    -webkit-text-fill-color: #7a7f86;
    font-family: sans-serif !important;
    font-size: 12px !important;
    line-height: 1.65;
    font-weight: 400;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-shadow: none !important;
    white-space: nowrap;
}

@media (max-width: 480px) {
    #se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-meta-date,
    .se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-meta-date {
        white-space: normal;
    }
}
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a::after,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a::after {
    content: "↗";
    display: inline-block;
    margin-right: 0.2rem;
    font-size: 0.65em;
    transition: transform 0.3s ease;
    color: #4dd0e1 !important;
    -webkit-text-fill-color: #4dd0e1;
}
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a:hover,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a:hover {
    background: rgba(0, 193, 212, 0.1);
    border-color: rgba(0, 193, 212, 0.2);
    box-shadow: 0 0 25px rgba(0, 193, 212, 0.04);
    color: #0097a7 !important;
    -webkit-text-fill-color: #0097a7;
}
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a:hover::after,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a:hover::after {
    transform: translate(2px, -2px);
}

/* Link-list = opt-btn cards — tight spacing + soft brand default */
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li {
    margin: 0;
    padding: 0;
    line-height: normal;
    color: inherit;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li > p,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li > p {
    margin: 0;
    padding: 0;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > br,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > br,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li > p:empty,
#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li > br:last-child,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li > p:empty,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li > br:last-child {
    display: none !important;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 0.5rem 0.9rem;
    border-radius: 16px;
    background: rgb(0 202 227 / 4%);
    border: 1px solid rgb(0 202 227 / 11%);
    border-bottom: 1px solid rgb(0 202 227 / 11%);
    color: #00c1d4 !important;
    -webkit-text-fill-color: #00c1d4;
    font-size: 0.8rem;
    line-height: 1.5;
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-underline-offset: unset;
    font-weight: 400;
    margin: 0;
    margin-bottom: 0;
    animation: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease,
        background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a::before,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 193, 212, 0.06), rgba(0, 193, 212, 0.01));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a::after,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a::after {
    content: "←";
    display: block;
    flex: 0 0 auto;
    margin: 0;
    color: #00c1d4 !important;
    -webkit-text-fill-color: #00c1d4;
    font-size: 0.85rem;
    transform: none;
    position: relative;
    z-index: 1;
    text-decoration: none !important;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a:hover,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a:hover {
    background: rgb(0 202 227 / 9%);
    border-color: rgb(0 202 227 / 30%);
    transform: translateX(-4px);
    box-shadow: 0 4px 20px -8px rgb(0 202 227 / 18%);
    color: #00c1d4 !important;
    -webkit-text-fill-color: #00c1d4;
    text-decoration: none !important;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a:hover::before,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a:hover::before {
    opacity: 1;
}

#se-chat-panel.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a:hover::after,
.se-chat-panel-inline.ha-reference-chat .se-chat-msg-assistant .ha-assistant-link-list > li a:hover::after {
    transform: none;
    color: #00c1d4 !important;
    -webkit-text-fill-color: #00c1d4;
}

/* ============================================================
   TYPING
   ============================================================ */
#se-chat-panel.ha-reference-chat #se-chat-typing .se-chat-msg-content,
.se-chat-panel-inline.ha-reference-chat #se-chat-typing .se-chat-msg-content {
    padding: 0.625rem 1rem;
    border-radius: 20px 20px 4px 20px;
    height: 42px;
    width: 70px;
    max-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(255 255 255);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#se-chat-panel.ha-reference-chat .se-chat-typing-dots,
.se-chat-panel-inline.ha-reference-chat .se-chat-typing-dots {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    padding: 0;
}

#se-chat-panel.ha-reference-chat .se-chat-typing-dots span,
.se-chat-panel-inline.ha-reference-chat .se-chat-typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00c1d4;
    border-radius: 50%;
    animation: ha-ref-dotBounce 1.4s infinite ease-in-out both;
    opacity: 0.5;
    margin: 0;
}
#se-chat-panel.ha-reference-chat .se-chat-typing-dots span:nth-child(1),
.se-chat-panel-inline.ha-reference-chat .se-chat-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
#se-chat-panel.ha-reference-chat .se-chat-typing-dots span:nth-child(2),
.se-chat-panel-inline.ha-reference-chat .se-chat-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
#se-chat-panel.ha-reference-chat .se-chat-typing-dots span:nth-child(3),
.se-chat-panel-inline.ha-reference-chat .se-chat-typing-dots span:nth-child(3) { animation-delay: 0s; }

/* ============================================================
   SUGGESTED PROMPTS = opt-btn
   ============================================================ */
#se-chat-panel.ha-reference-chat #se-suggested-prompts,
#se-chat-panel.ha-reference-chat #se-recent-prompts,
#se-chat-panel.ha-reference-chat #se-ai-suggestions {
    position: relative;
    z-index: 10;
    padding: 0.5rem 1.25rem 0.75rem;
    background: transparent;
    border: none;
    flex-shrink: 0;
}

#se-chat-panel.ha-reference-chat #se-suggested-prompts > div:first-child,
#se-chat-panel.ha-reference-chat #se-recent-prompts > div:first-child,
#se-chat-panel.ha-reference-chat #se-ai-suggestions > div:first-child {
    font-size: 0.6rem;
    font-weight: 500;
    color: #8a9bb5;
    margin-bottom: 0.5rem;
}

#se-chat-panel.ha-reference-chat #se-suggested-prompts > div:last-child,
#se-chat-panel.ha-reference-chat #se-recent-prompts > div:last-child,
#se-chat-panel.ha-reference-chat #se-ai-suggestions > div:last-child {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.375rem;
}

#se-chat-panel.ha-reference-chat #se-suggested-prompts button,
#se-chat-panel.ha-reference-chat #se-recent-prompts button,
#se-chat-panel.ha-reference-chat #se-ai-suggestions button,
#se-chat-panel.ha-reference-chat .se-followup-chip,
#se-chat-panel.ha-reference-chat .ha-opt-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0.5rem 0.9rem;
    color: #1a1a2e;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    text-align: start;
    box-shadow: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

#se-chat-panel.ha-reference-chat #se-suggested-prompts button::before,
#se-chat-panel.ha-reference-chat #se-recent-prompts button::before,
#se-chat-panel.ha-reference-chat #se-ai-suggestions button::before,
#se-chat-panel.ha-reference-chat .se-followup-chip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 193, 212, 0.06), rgba(0, 193, 212, 0.01));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#se-chat-panel.ha-reference-chat #se-suggested-prompts button:hover::before,
#se-chat-panel.ha-reference-chat #se-recent-prompts button:hover::before,
#se-chat-panel.ha-reference-chat #se-ai-suggestions button:hover::before,
#se-chat-panel.ha-reference-chat .se-followup-chip:hover::before {
    opacity: 1;
}

#se-chat-panel.ha-reference-chat #se-suggested-prompts button:hover,
#se-chat-panel.ha-reference-chat #se-recent-prompts button:hover,
#se-chat-panel.ha-reference-chat #se-ai-suggestions button:hover,
#se-chat-panel.ha-reference-chat .se-followup-chip:hover {
    border-color: rgba(0, 193, 212, 0.2);
    transform: translateX(-4px);
    box-shadow: 0 4px 20px -8px rgba(0, 193, 212, 0.04);
    background: rgba(255, 255, 255, 0.2);
    color: #1a1a2e;
}

#se-chat-panel.ha-reference-chat .ha-opt-arrow {
    color: #8a9bb5;
    font-size: 0.75rem;
    transition: color 0.3s;
    margin-inline-start: 0.5rem;
    flex-shrink: 0;
}
#se-chat-panel.ha-reference-chat button:hover .ha-opt-arrow {
    color: #00c1d4;
}

/* ============================================================
   INPUT — input-rotating-border + send-btn-glow
   ============================================================ */
#se-chat-panel.ha-reference-chat #se-chat-input-area,
.se-chat-panel-inline.ha-reference-chat #se-chat-input-area {
    padding: 14px 16px;
    border-top: 1px solid #00cae338;
    background: #ffffffba;
    flex-shrink: 0;
}

#se-chat-panel.ha-reference-chat .se-chat-input-wrap,
.se-chat-panel-inline.ha-reference-chat .se-chat-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 40px;
    background: rgb(255 255 255 / 67%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid #00cae380;
    background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15)), linear-gradient(90deg, rgb(0 193 212 / 0%) 0%, rgba(0, 193, 212, 0.12) 18%, transparent 25%, transparent 35%, rgba(0, 193, 212, 0.16) 42%, rgb(0 193 212 / 0%) 55%, transparent 62%, transparent 72%, rgba(0, 193, 212, 0.18) 78%, rgba(0, 193, 212, 0.12) 100%);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    background-size: 100% 100%, 400% 100%;
    animation: ha-ref-borderRotateSlow 20.16s ease-in-out infinite;
    transition: all 0.25s ease;
    box-shadow: none;
}

#se-chat-panel.ha-reference-chat .se-chat-input-wrap:focus-within,
.se-chat-panel-inline.ha-reference-chat .se-chat-input-wrap:focus-within {
    animation: none;
    background: rgb(255 255 255 / 90%);
    background-image: none;
    border-color: #00cae380;
    box-shadow: none;
}

#se-chat-panel.ha-reference-chat #se-chat-input,
.se-chat-panel-inline.ha-reference-chat #se-chat-input {
    flex: 1 1 auto;
    background: transparent;
    border: none;
    outline: none;
    color: #394049;
    caret-color: #394049;
    font-size: 0.9rem;
    line-height: 1.6;
    font-weight: 400;
    padding: 0.7rem 0.8rem;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    width: 100%;
    box-shadow: none;
    font-family: inherit;
}

#se-chat-panel.ha-reference-chat #se-chat-input::placeholder,
.se-chat-panel-inline.ha-reference-chat #se-chat-input::placeholder {
    color: rgb(57 64 73 / 55%);
    font-weight: 300;
    opacity: 1;
}

/* send — slow orbit border only */
#se-chat-panel.ha-reference-chat #se-chat-send,
.se-chat-panel-inline.ha-reference-chat #se-chat-send {
    position: relative;
    isolation: isolate;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-width: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid transparent;
    border-radius: 40px;
    padding: 0.6rem 1.2rem;
    font-weight: 400;
    font-size: 0.8rem;
    color: #1a1a2e;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

#se-chat-panel.ha-reference-chat #se-chat-send::before,
.se-chat-panel-inline.ha-reference-chat #se-chat-send::before {
    content: "";
    position: absolute;
    inset: -60%;
    z-index: -2;
    background: conic-gradient(
        from 0deg,
        #00c1d4 0deg,
        #ffffff 45deg,
        #4dd0e1 90deg,
        #0097a7 145deg,
        #ffffff 200deg,
        #00cae3 255deg,
        #ffffff 315deg,
        #00c1d4 360deg
    );
    animation: ha-send-border-orbit 28s linear infinite;
    pointer-events: none;
}

#se-chat-panel.ha-reference-chat #se-chat-send::after,
.se-chat-panel-inline.ha-reference-chat #se-chat-send::after {
    content: "";
    position: absolute;
    inset: 1.5px;
    z-index: -1;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.92);
    pointer-events: none;
}

#se-chat-panel.ha-reference-chat #se-chat-send > *,
.se-chat-panel-inline.ha-reference-chat #se-chat-send > * {
    position: relative;
    z-index: 1;
}

#se-chat-panel.ha-reference-chat #se-chat-send > i,
#se-chat-panel.ha-reference-chat #se-chat-send .fa-paper-plane,
.se-chat-panel-inline.ha-reference-chat #se-chat-send > i,
.se-chat-panel-inline.ha-reference-chat #se-chat-send .fa-paper-plane {
    color: #00c1d4;
    display: inline-block;
    will-change: transform, opacity;
    animation: ha-send-plane-cinematic 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes ha-send-plane-cinematic {
    0%,
    55%,
    100% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
    63% {
        transform: translate3d(-2px, 2px, 0);
        opacity: 1;
    }
    69% {
        transform: translate3d(-1px, 1px, 0);
        opacity: 1;
    }
    79% {
        transform: translate3d(9px, -9px, 0);
        opacity: 0.15;
    }
    80% {
        transform: translate3d(-5px, 6px, 0);
        opacity: 0;
    }
    91% {
        transform: translate3d(-1px, 2px, 0);
        opacity: 0.85;
    }
    97% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

#se-chat-panel.ha-reference-chat #se-chat-send:hover,
.se-chat-panel-inline.ha-reference-chat #se-chat-send:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 30px rgba(0, 193, 212, 0.04);
}

#se-chat-panel.ha-reference-chat #se-chat-send:active,
.se-chat-panel-inline.ha-reference-chat #se-chat-send:active {
    transform: scale(0.96);
}

#se-chat-panel.ha-reference-chat #se-chat-send .ha-send-label,
.se-chat-panel-inline.ha-reference-chat #se-chat-send .ha-send-label {
    display: inline;
    font-size: 0.8rem;
    font-weight: 400;
    color: #1a1a2e;
    animation: none;
    transform: none;
    opacity: 1;
}

#se-chat-panel.ha-reference-chat .se-chat-footer {
    display: flex;
    justify-content: center;
    margin-top: 0.625rem;
}

#se-chat-panel.ha-reference-chat .se-chat-footer-link,
.se-chat-panel-inline.ha-reference-chat .se-chat-footer-link {
    font-size: 0.77rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 300;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    padding: 0;
    background: transparent;
    border: none;
    color: #00c1d4;
}
#se-chat-panel.ha-reference-chat .se-chat-footer-link:hover,
.se-chat-panel-inline.ha-reference-chat .se-chat-footer-link:hover {
    color: #00c1d4;
    background: transparent;
}

.se-chat-fullpage-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #00cae33b;
}
#se-chat-panel.ha-reference-chat .se-chat-fullpage-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    border-radius: 9999px;
    padding: 0.45rem 0.9rem;
    background: transparent;
    border: none;
    color: #00cae3ad;
    font-size: 0.75rem;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
    box-shadow: none;
}
#se-chat-panel.ha-reference-chat .se-chat-fullpage-btn:hover {
    color: rgba(26, 26, 46, 0.7);
    background: rgba(255, 255, 255, 0.2);
}

#se-chat-panel.ha-reference-chat .se-chat-sources {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: transparent;
}
#se-chat-panel.ha-reference-chat .se-chat-source-link {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    color: #1a1a2e;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
}
#se-chat-panel.ha-reference-chat .se-chat-source-link:hover {
    border-color: rgba(0, 193, 212, 0.2);
}

#se-chat-panel.ha-reference-chat .se-gdpr-consent,
#se-chat-panel.ha-reference-chat .se-gdpr-declined,
#se-chat-panel.ha-reference-chat #se-gdpr-consent {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #1a1a2e;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ============================================================
   MOBILE — floating only
   ============================================================ */
@media (max-width: 640px) {
    #se-chat-panel.ha-reference-chat {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    #se-chat-panel.ha-reference-chat > .ha-chat-border,
    #se-chat-panel.ha-reference-chat > .ha-chat-glow {
        border-radius: 0;
    }

    #se-chat-panel.ha-reference-chat > .ha-chat-reflection {
        border-radius: 0;
    }

    #se-chat-panel.ha-reference-chat #se-chat-messages {
        padding: 0.75rem;
    }

    #se-chat-panel.ha-reference-chat .se-chat-input-wrap {
        border-radius: 28px;
    }

    #se-chat-panel.ha-reference-chat #se-chat-send {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    #se-chat-panel.ha-reference-chat #se-chat-send .ha-send-label {
        display: none;
    }

    #se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content,
    #se-chat-panel.ha-reference-chat .se-chat-msg-user .se-chat-msg-content {
        max-width: 88%;
    }
}

/* ============================================================
   BUBBLE — from current bot/1.html (.toggle-btn-dream)
   Full-bleed logo + dreamy purple/cyan/pink border + stars
   ============================================================ */
@keyframes ha-bubble-border-dream {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes ha-bubble-logo-breathe {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.03) translateY(-0.5px); }
}
@keyframes ha-bubble-star-pop {
    0% { opacity: 0; transform: scale(0.2) rotate(-30deg) translateY(0); }
    14% { opacity: 1; transform: scale(1.4) rotate(15deg) translateY(-6px); }
    30% { opacity: 1; transform: scale(1) rotate(0deg) translateY(0); }
    60% { opacity: 0.8; transform: scale(0.9) rotate(0deg) translateY(0); }
    85% { opacity: 0.2; transform: scale(0.4) rotate(15deg) translateY(4px); }
    100% { opacity: 0; transform: scale(0.2) rotate(-30deg) translateY(6px); }
}

#se-chat-bubble.ha-chat-bubble {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 8px 30px -8px rgba(0, 193, 212, 0.28);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    overflow: visible;
    padding: 0;
    color: transparent;
    font-size: 0;
    line-height: 0;
    z-index: 99998;
}

/* Animated HA-dominant border — 3.6px, no white stops */
#se-chat-bubble.ha-chat-bubble::before {
    content: "";
    position: absolute;
    inset: -3.6px;
    border-radius: 50%;
    padding: 3.6px;
    background: conic-gradient(
        from 0deg,
        #00c1d4 0deg,
        #00cae3 55deg,
        #51dbe7 105deg,
        #009caf 150deg,
        #00c1d4 180deg,
        #7c3aed 220deg,
        #a78bfa 260deg,
        #ec4899 300deg,
        #8b5cf6 335deg,
        #00c1d4 360deg
    );
    background-size: 300% 300%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: ha-bubble-border-dream 8s linear infinite;
    pointer-events: none;
    z-index: 5;
}

/* Soft inner glow — template ::after */
#se-chat-bubble.ha-chat-bubble::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(124, 58, 237, 0.06), transparent 70%);
    pointer-events: none;
    z-index: 1;
}

#se-chat-bubble.ha-chat-bubble > i,
#se-chat-bubble.ha-chat-bubble .fa-comments,
#se-chat-bubble.ha-chat-bubble .fa-solid,
#se-chat-bubble.ha-chat-bubble .ha-bubble-icon-hidden {
    display: none !important;
}

/* Full-bleed visual — logo 60×60; border hugs edge; outer stays visible for stars */
#se-chat-bubble.ha-chat-bubble .ha-bubble-logo-wrap {
    position: relative;
    z-index: 2;
    display: block;
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
    transition: transform 0.4s ease;
}

#se-chat-bubble.ha-chat-bubble .ha-bubble-logo {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    animation: ha-bubble-logo-breathe 3.6s ease-in-out infinite;
}

/* Stars / sparkles — must animate when bubble is closed/visible */
#se-chat-bubble.ha-chat-bubble .ha-bubble-star {
    position: absolute;
    display: block;
    opacity: 0;
    animation: ha-bubble-star-pop 4.8s ease-in-out infinite;
    font-size: 0.7rem;
    line-height: 1;
    z-index: 6;
    pointer-events: none;
    user-select: none;
}
#se-chat-bubble.ha-chat-bubble .ha-bubble-star--1 {
    top: -2px;
    right: 2px;
    animation-delay: 0s;
    font-size: 0.9rem;
    color: #ffffff;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.55));
}
#se-chat-bubble.ha-chat-bubble .ha-bubble-star--2 {
    top: 2px;
    left: 4px;
    animation-delay: 1.2s;
    font-size: 0.6rem;
    color: #00c1d4;
    filter: drop-shadow(0 0 8px rgba(0, 193, 212, 0.45));
}
#se-chat-bubble.ha-chat-bubble .ha-bubble-star--3 {
    bottom: 0;
    right: 0;
    animation-delay: 2.4s;
    font-size: 0.5rem;
    color: #51dbe7;
    filter: drop-shadow(0 0 8px rgba(81, 219, 231, 0.42));
}
#se-chat-bubble.ha-chat-bubble .ha-bubble-star--4 {
    bottom: 4px;
    left: 2px;
    animation-delay: 0.6s;
    font-size: 0.7rem;
    color: #00cae3;
    filter: drop-shadow(0 0 8px rgba(0, 202, 227, 0.45));
}

/* Stars only pause when panel-open hides the bubble */
#se-chat-bubble.ha-chat-bubble.se-chat-bubble-hidden .ha-bubble-star {
    animation: none;
    opacity: 0;
}

#se-chat-bubble.ha-chat-bubble:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 40px -8px rgba(124, 58, 237, 0.12);
}
#se-chat-bubble.ha-chat-bubble:hover .ha-bubble-logo-wrap {
    transform: scale(1.02);
}

#se-chat-bubble.ha-chat-bubble.se-chat-bubble-hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 480px) {
    #se-chat-bubble.ha-chat-bubble {
        width: 60px;
        height: 60px;
        bottom: 16px;
        right: 16px;
    }
    #se-chat-bubble.ha-chat-bubble .ha-bubble-star {
        font-size: 0.5rem;
    }
    #se-chat-bubble.ha-chat-bubble .ha-bubble-star--1 {
        font-size: 0.7rem;
    }
    #se-chat-bubble.ha-chat-bubble .ha-bubble-star--2 {
        font-size: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #se-chat-panel.ha-reference-chat > .ha-chat-border,
    #se-chat-panel.ha-reference-chat > .ha-chat-glow,
    .se-chat-panel-inline.ha-reference-chat > .ha-chat-border,
    .se-chat-panel-inline.ha-reference-chat > .ha-chat-glow,
    #se-chat-panel.ha-reference-chat > .ha-id-blob,
    .se-chat-panel-inline.ha-reference-chat > .ha-id-blob,
    #se-chat-panel.ha-reference-chat .se-chat-input-wrap,
    .se-chat-panel-inline.ha-reference-chat .se-chat-input-wrap,
    #se-chat-panel.ha-reference-chat #se-chat-send,
    #se-chat-panel.ha-reference-chat #se-chat-send::before,
    #se-chat-panel.ha-reference-chat #se-chat-send::after,
    #se-chat-panel.ha-reference-chat #se-chat-send > i,
    #se-chat-panel.ha-reference-chat #se-chat-send .fa-paper-plane,
    .se-chat-panel-inline.ha-reference-chat #se-chat-send,
    .se-chat-panel-inline.ha-reference-chat #se-chat-send::before,
    .se-chat-panel-inline.ha-reference-chat #se-chat-send::after,
    .se-chat-panel-inline.ha-reference-chat #se-chat-send > i,
    .se-chat-panel-inline.ha-reference-chat #se-chat-send .fa-paper-plane,
    #se-chat-panel.ha-reference-chat .se-chat-status-dot,
    #se-chat-panel.ha-reference-chat .se-chat-typing-dots span,
    #se-chat-panel.ha-reference-chat .se-chat-msg,
    #se-chat-panel.ha-reference-chat .se-chat-msg-assistant .se-chat-msg-content a,
    #se-chat-panel.ha-reference-chat #se-chat-close::before,
    #se-chat-panel.ha-reference-chat #se-chat-reset::before,
    .se-chat-panel-inline.ha-reference-chat #se-chat-close::before,
    .se-chat-panel-inline.ha-reference-chat #se-chat-reset::before,
    #se-chat-bubble.ha-chat-bubble::before,
    #se-chat-bubble.ha-chat-bubble .ha-bubble-logo,
    #se-chat-bubble.ha-chat-bubble .ha-bubble-star {
        animation: none !important;
    }
}
