/* ============================================ */
/* Neu Ink Chat Widget — Neu-Engine v4          */
/* Desktop: FAB + Panel                         */
/* Mobile: Bottom Bar → Fullscreen Chat         */
/* 前田 (Maeda) — Test Drive Experience         */
/* ============================================ */

/* ── CSS Variables ── */
:root {
    --chat-bg: var(--bg-card, #FFFFFF);
    --chat-bg-alt: var(--bg-base, #F5F5F7);
    --chat-text: var(--text-main, #1D1D1F);
    --chat-text-sub: var(--text-sub, #86868b);
    --chat-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --chat-radius: 20px;
    --chat-z: 10000;
    --chat-glass-bg: rgba(255, 255, 255, 0.2);
    --chat-glass-border: rgba(255, 255, 255, 0.3);
    --chat-glass-blur: 16px;
}

/* ============================= */
/* DESKTOP: FAB + Panel          */
/* ============================= */

/* ── FAB Button (Desktop only) ── */
.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--chat-z);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    animation: chatFabIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1s forwards;
    opacity: 0;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
}

.chat-fab svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.chat-fab.active svg {
    transform: rotate(45deg);
}

/* ── FAB CTA Label (Desktop — above FAB) ── */
.chat-fab-label {
    position: fixed;
    bottom: 88px;
    right: 14px;
    z-index: var(--chat-z);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--chat-text);
    font-family: 'Noto Sans JP', sans-serif;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    animation: fabLabelIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.5s forwards;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-fab-label::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 22px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.85);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transform: rotate(45deg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.chat-fab-label.hidden {
    opacity: 0 !important;
    transform: translateY(8px) !important;
}

@keyframes fabLabelIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes chatFabIn {
    from {
        opacity: 0;
        transform: scale(0) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Desktop Panel — Glassmorphism ── */
.chat-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: calc(var(--chat-z) + 1);
    width: 420px;
    max-height: 600px;
    border-radius: var(--chat-radius);
    background: var(--chat-glass-bg);
    backdrop-filter: blur(var(--chat-glass-blur));
    -webkit-backdrop-filter: blur(var(--chat-glass-blur));
    border: 1px solid var(--chat-glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Desktop Resize Handle ── */
.chat-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: nw-resize;
    font-size: 10px;
    color: var(--chat-text-sub);
    opacity: 0.4;
    transition: opacity 0.2s;
    z-index: 5;
    user-select: none;
    letter-spacing: 1px;
    line-height: 1;
    transform: rotate(45deg);
}

.chat-resize-handle:hover {
    opacity: 0.8;
}

/* ============================= */
/* MOBILE: Bottom Bar (Initial)  */
/* ============================= */

.chat-bottom-bar {
    display: none;
    /* shown only on mobile via media query */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--chat-z);
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--chat-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    animation: barSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1s forwards;
    opacity: 0;
    transform: translateY(100%);
}

@keyframes barSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-bottom-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.chat-bottom-bar .chat-bar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chat-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.chat-bottom-bar .chat-bar-input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: var(--chat-bg-alt);
    color: var(--chat-text);
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.chat-bottom-bar .chat-bar-input:focus {
    border-color: var(--chat-text);
}

.chat-bottom-bar .chat-bar-input::placeholder {
    color: var(--chat-text-sub);
    font-size: 13px;
}

.chat-bottom-bar .chat-bar-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.chat-bottom-bar .chat-bar-send:active {
    transform: scale(0.92);
}

.chat-bottom-bar .chat-bar-send svg {
    width: 16px;
    height: 16px;
}

/* ============================= */
/* MOBILE: Fullscreen Chat View  */
/* ============================= */

.chat-fullscreen {
    display: none;
    /* only on mobile */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--chat-z) + 2);
    background: var(--chat-bg-alt);
    flex-direction: column;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-fullscreen.open {
    opacity: 1;
    transform: translateY(0);
}

/* Fullscreen header */
.chat-fs-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    flex-shrink: 0;
}

.chat-fs-back {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-fs-back:active {
    background: rgba(255, 255, 255, 0.1);
}

.chat-fs-back svg {
    width: 22px;
    height: 22px;
}

.chat-fs-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chat-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.chat-fs-info {
    flex: 1;
}

.chat-fs-name {
    font-size: 14px;
    font-weight: 600;
}

.chat-fs-status {
    font-size: 11px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Fullscreen input area */
.chat-fs-input-area {
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--chat-bg);
    flex-shrink: 0;
}

.chat-fs-input-area textarea {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 15px;
    outline: none;
    background: var(--chat-bg-alt);
    color: var(--chat-text);
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.chat-fs-input-area textarea:focus {
    border-color: var(--chat-text);
}

.chat-fs-input-area textarea::placeholder {
    color: var(--chat-text-sub);
}

.chat-fs-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.chat-fs-send:active {
    transform: scale(0.92);
}

.chat-fs-send:disabled {
    opacity: 0.4;
}

.chat-fs-send svg {
    width: 18px;
    height: 18px;
}

/* ============================= */
/* SHARED: Header, Messages, etc */
/* ============================= */

.chat-header {
    padding: 16px 20px;
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--chat-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.chat-header-status {
    font-size: 11px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Status Dot (Pulsing Green) ── */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34D399;
    display: inline-block;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 4px rgba(52, 211, 153, 0);
    }
}

/* ── Neu-Engine Badge ── */
.neu-engine-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: rgba(255, 255, 255, 0.9);
    vertical-align: middle;
    margin-left: 6px;
}

.neu-engine-badge svg {
    width: 10px;
    height: 10px;
    opacity: 0.9;
}

/* Messages — Glassmorphism */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 380px;
    max-height: 500px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

/* Fullscreen messages override */
.chat-fs-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--chat-bg-alt);
    -webkit-overflow-scrolling: touch;
}

/* Message Bubbles */
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.7;
    animation: msgIn 0.3s ease forwards;
    word-break: break-word;
    font-family: 'Noto Sans JP', sans-serif;
    position: relative;
}

.chat-msg.bot {
    align-self: flex-start;
    background: var(--chat-bg-alt);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    border-bottom-right-radius: 4px;
}

/* ── Streaming State ── */
.chat-msg.streaming .chat-msg-text {
    display: inline;
}

.stream-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--chat-text);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ── Response Time Metadata ── */
.chat-msg-meta {
    display: block;
    font-size: 10px;
    color: var(--chat-text-sub);
    opacity: 0.5;
    margin-top: 4px;
    text-align: right;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 0.02em;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Indicator — Premium */
.chat-typing {
    display: flex;
    gap: 5px;
    padding: 10px 16px;
    align-items: center;
    align-self: flex-start;
    background: var(--chat-bg);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.02);
    animation: msgIn 0.3s ease forwards;
}

.thinking-text {
    font-size: 12px;
    color: var(--chat-text-sub);
    font-family: 'Noto Sans JP', sans-serif;
    margin-right: 4px;
    opacity: 0.7;
}

.chat-typing-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--chat-text-sub);
    animation: typingBounce 1.4s infinite both;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Desktop input area */
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--chat-bg);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13.5px;
    outline: none;
    background: var(--chat-bg-alt);
    color: var(--chat-text);
    resize: none;
    max-height: 80px;
    line-height: 1.4;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--chat-text);
}

.chat-input::placeholder {
    color: var(--chat-text-sub);
}

.chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.chat-send:hover {
    transform: scale(1.08);
}

.chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.chat-send svg {
    width: 16px;
    height: 16px;
}

/* Lead Form */
.chat-lead-form {
    padding: 12px 16px;
    background: var(--chat-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-lead-form p {
    font-size: 12px;
    color: var(--chat-text-sub);
    margin-bottom: 8px;
}

.chat-lead-form input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    background: var(--chat-bg-alt);
    color: var(--chat-text);
    outline: none;
    font-family: 'Noto Sans JP', sans-serif;
}

.chat-lead-form input:focus {
    border-color: var(--chat-text);
}

.chat-lead-submit {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
}

.chat-lead-submit:hover {
    opacity: 0.85;
}

/* ============================= */
/* INLINE REGISTRATION CARD      */
/* ============================= */

.chat-reg-card {
    align-self: stretch;
    animation: regCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes regCardIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reg-card-inner {
    background: var(--chat-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.reg-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: #fff;
}

.reg-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--chat-text);
    margin-bottom: 6px;
    font-family: 'Noto Sans JP', sans-serif;
}

.reg-card-desc {
    font-size: 12px;
    color: var(--chat-text-sub);
    margin-bottom: 16px;
    line-height: 1.6;
    font-family: 'Noto Sans JP', sans-serif;
}

.reg-card-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reg-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 13px;
    background: var(--chat-bg-alt);
    color: var(--chat-text);
    outline: none;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.reg-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.reg-input::placeholder {
    color: var(--chat-text-sub);
    opacity: 0.6;
}

.reg-submit {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
}

.reg-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.reg-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.reg-card-note {
    font-size: 11px;
    color: var(--chat-text-sub);
    margin-top: 10px;
    opacity: 0.7;
    font-family: 'Noto Sans JP', sans-serif;
}

.reg-card-dismiss {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--chat-text-sub);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
}

.reg-card-dismiss:hover {
    color: var(--chat-text);
}

/* Registration Success State */
.reg-success {
    text-align: center;
    padding: 8px 0;
    animation: regSuccessIn 0.5s ease forwards;
}

@keyframes regSuccessIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reg-success-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #34D399, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.reg-success-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--chat-text);
    margin-bottom: 4px;
    font-family: 'Noto Sans JP', sans-serif;
}

.reg-success-desc {
    font-size: 12px;
    color: var(--chat-text-sub);
    margin-bottom: 12px;
    font-family: 'Noto Sans JP', sans-serif;
}

.reg-success-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 100px;
    background: var(--chat-text);
    color: var(--chat-bg-alt);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
}

.reg-success-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* ============================= */
/* RESPONSIVE BREAKPOINT         */
/* ============================= */

@media (max-width: 768px) {

    /* Hide desktop FAB, label, and panel on mobile */
    .chat-fab {
        display: none !important;
    }

    .chat-fab-label {
        display: none !important;
    }

    .chat-panel {
        display: none !important;
    }

    /* Show mobile bottom bar */
    .chat-bottom-bar {
        display: block;
    }

    /* Show fullscreen when opened */
    .chat-fullscreen {
        display: flex;
    }

    /* Hide bottom bar when fullscreen is open */
    .chat-bottom-bar.hidden {
        display: none;
    }
}

@media (min-width: 769px) {

    /* Hide mobile elements on desktop */
    .chat-bottom-bar {
        display: none !important;
    }

    .chat-fullscreen {
        display: none !important;
    }
}

/* ============================= */
/* DARK MODE                     */
/* ============================= */

[data-theme="dark"] .chat-panel {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .chat-messages {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .chat-msg.bot {
    background: rgba(50, 50, 54, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .chat-fab-label {
    background: rgba(29, 29, 31, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--chat-bg-alt);
}

[data-theme="dark"] .chat-fab-label::after {
    background: rgba(29, 29, 31, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .chat-bottom-bar {
    border-top-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .chat-bottom-bar .chat-bar-input {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-bottom-bar .chat-bar-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .chat-input-area,
[data-theme="dark"] .chat-fs-input-area {
    border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .chat-input,
[data-theme="dark"] .chat-fs-input-area textarea {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-input:focus,
[data-theme="dark"] .chat-fs-input-area textarea:focus {
    border-color: rgba(255, 255, 255, 0.3);
}



[data-theme="dark"] .chat-lead-form {
    border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .chat-lead-form input {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb,
[data-theme="dark"] .chat-fs-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Hidden state ── */
.chat-widget-hidden {
    display: none !important;
}

/* ── Registration Card Dark Mode ── */
[data-theme="dark"] .reg-card-inner {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .reg-input {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .reg-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}