/* =========================================================
   RANI — DIGITAL ASSISTANT
   MANOLAN-RAN

   PREMIUM UI — V3
   FULL JS ALIGNMENT
========================================================= */

:root {
    --rani-blue: #38bdf8;
    --rani-blue-light: #7ddcff;
    --rani-blue-bright: #a9ecff;

    --rani-blue-soft: rgba(56, 189, 248, .12);
    --rani-blue-soft-2: rgba(56, 189, 248, .06);
    --rani-blue-border: rgba(56, 189, 248, .22);
    --rani-blue-border-soft: rgba(56, 189, 248, .12);
    --rani-blue-glow: rgba(56, 189, 248, .10);

    --rani-cyan: #9cecff;

    --rani-text: #d5e8ef;
    --rani-text-strong: #effbff;

    --rani-muted: #607985;
    --rani-muted-2: #4d6874;

    --rani-dark: #06141d;
    --rani-panel: #07151f;
    --rani-panel-2: #081b27;
    --rani-panel-3: #0a202d;

    --rani-danger: #f87171;
    --rani-success: #34d399;

    --rani-shadow:
        0 45px 130px rgba(0, 0, 0, .58),
        0 0 80px rgba(56, 189, 248, .07);

    --rani-soft-shadow:
        0 14px 35px rgba(0, 0, 0, .18);

    --rani-radius-sm: 9px;
    --rani-radius: 14px;
    --rani-radius-lg: 20px;

    --rani-ease:
        cubic-bezier(.2, .8, .2, 1);
}

/* =========================================================
   RESET / ROOT
========================================================= */

#ai-chat-root {
    position: relative;
    z-index: 2147482000;
    isolation: isolate;
}

#ai-chat-root,
#ai-chat-root * {
    box-sizing: border-box;
}

#ai-chat-root button,
#ai-chat-root input,
#ai-chat-root textarea {
    font-family: inherit;
}

#ai-chat-root button,
#ai-chat-root a {
    -webkit-tap-highlight-color: transparent;
}

#ai-chat-root [hidden] {
    display: none !important;
}

#ai-chat-root button {
    appearance: none;
    -webkit-appearance: none;
}

/* =========================================================
   ACCESSIBILITY / FOCUS
========================================================= */

#ai-chat-root button:focus-visible,
#ai-chat-root a:focus-visible,
#ai-chat-root textarea:focus-visible,
#ai-chat-root input:focus-visible {
    outline: 2px solid rgba(56, 189, 248, .85);
    outline-offset: 2px;
}

/* =========================================================
   LAUNCHER SHELL & MINIMIZE CONTROLS
========================================================= */

.ai-launcher-shell {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2147482001;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-launcher-shell .ai-chat-launcher {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
}

.ai-launcher-collapse-btn {
    width: 26px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 0.76rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}

/* Dark Theme (Default) */
body:not(.light-theme) .ai-launcher-collapse-btn {
    background: #07151f !important;
    border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
    color: #38bdf8 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(56, 189, 248, 0.15) !important;
}

body:not(.light-theme) .ai-launcher-collapse-btn i {
    color: #38bdf8 !important;
}

body:not(.light-theme) .ai-launcher-collapse-btn:hover {
    background: #0d2838 !important;
    border-color: #38bdf8 !important;
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.3) !important;
}

body:not(.light-theme) .ai-launcher-collapse-btn:hover i {
    color: #7ddcff !important;
}

/* Light Theme */
body.light-theme .ai-launcher-collapse-btn {
    background: #ffffff !important;
    border: 1.5px solid #bae6fd !important;
    color: #0284c7 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(2, 132, 199, 0.1) !important;
}

body.light-theme .ai-launcher-collapse-btn i {
    color: #0284c7 !important;
}

body.light-theme .ai-launcher-collapse-btn:hover {
    background: #f0f9ff !important;
    border-color: #0284c7 !important;
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.2) !important;
}

body.light-theme .ai-launcher-collapse-btn:hover i {
    color: #0369a1 !important;
}

.ai-launcher-collapse-btn:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

/* Minimized State */
.ai-launcher-shell.is-minimized {
    transform: translateX(calc(100% - 32px));
}

.ai-launcher-shell.is-minimized .ai-chat-launcher {
    opacity: 0.45;
}

.ai-launcher-shell.is-minimized:hover {
    transform: translateX(calc(100% - 42px));
}

.ai-launcher-shell.is-minimized:hover .ai-chat-launcher {
    opacity: 0.8;
}

.ai-launcher-shell.is-minimized .ai-launcher-collapse-btn {
    width: 30px;
    height: 40px;
    border-radius: 12px 0 0 12px;
}

body:not(.light-theme) .ai-launcher-shell.is-minimized .ai-launcher-collapse-btn {
    background: #07151f !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(56, 189, 248, 0.3) !important;
}

body:not(.light-theme) .ai-launcher-shell.is-minimized .ai-launcher-collapse-btn i {
    color: #38bdf8 !important;
}

body.light-theme .ai-launcher-shell.is-minimized .ai-launcher-collapse-btn {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 12px rgba(2, 132, 199, 0.2) !important;
}

body.light-theme .ai-launcher-shell.is-minimized .ai-launcher-collapse-btn i {
    color: #0284c7 !important;
}

@media (max-width: 768px) {
    .ai-launcher-shell {
        right: 12px;
        bottom: 14px;
        gap: 4px;
    }

    .ai-launcher-collapse-btn {
        width: 22px;
        height: 32px;
        font-size: 0.65rem;
    }

    .ai-launcher-shell.is-minimized {
        transform: translateX(calc(100% - 28px));
    }
}

.ai-chat-launcher {
    position: fixed;

    right: 24px;
    bottom: 24px;

    width: auto;
    min-width: 116px;
    height: 50px;

    padding: 0 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid rgba(56, 189, 248, .28);
    border-radius: 16px;

    color: #eafaff;

    background:
        linear-gradient(
            135deg,
            rgba(7, 28, 43, .98),
            rgba(3, 12, 19, .985)
        );

    box-shadow:
        0 18px 50px rgba(0, 0, 0, .42),
        0 0 40px rgba(56, 189, 248, .07),
        inset 0 1px 0 rgba(255, 255, 255, .055);

    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);

    cursor: pointer;

    z-index: 2147482001;

    overflow: hidden;

    transition:
        transform .3s var(--rani-ease),
        box-shadow .3s ease,
        border-color .3s ease,
        background .3s ease;
}

.ai-chat-launcher::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            120deg,
            transparent 15%,
            rgba(255, 255, 255, .045) 45%,
            transparent 75%
        );

    transform: translateX(-120%);

    pointer-events: none;

    transition:
        transform .7s var(--rani-ease);
}

.ai-chat-launcher:hover::before {
    transform: translateX(120%);
}

.ai-chat-launcher:hover {
    transform: translateY(-4px);

    border-color: rgba(56, 189, 248, .52);

    box-shadow:
        0 24px 65px rgba(0, 0, 0, .48),
        0 0 50px rgba(56, 189, 248, .12),
        inset 0 1px 0 rgba(255, 255, 255, .065);
}

.ai-chat-launcher:active {
    transform: translateY(-1px) scale(.985);
}

.ai-launcher-spark {
    position: relative;
    z-index: 3;

    color: var(--rani-blue-light);

    font-size: .96rem;

    text-shadow:
        0 0 14px rgba(56, 189, 248, .5);

    transition:
        transform .3s ease;
}

.ai-chat-launcher:hover .ai-launcher-spark {
    transform:
        rotate(18deg)
        scale(1.12);
}

.ai-launcher-text {
    position: relative;
    z-index: 3;

    display: inline-flex;
    align-items: baseline;

    gap: 6px;
}

.ai-launcher-text strong {
    color: #ecfbff;

    font-size: .88rem;
    font-weight: 900;
}

.ai-launcher-text small {
    color: var(--rani-blue);

    font-size: .40rem;
    font-weight: 900;

    letter-spacing: .10em;
}

.ai-launcher-arrow {
    position: relative;
    z-index: 3;

    width: 22px;
    height: 22px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    color: #38bdf8;

    background:
        rgba(56, 189, 248, .12);

    font-size: .52rem;

    transition: .25s ease;
}

body.light-theme .ai-launcher-arrow {
    color: #0284c7 !important;
    background: rgba(2, 132, 199, .08) !important;
}

body:not(.light-theme) .ai-launcher-arrow {
    color: #7ddcff !important;
    background: rgba(56, 189, 248, .14) !important;
}

.ai-chat-launcher:hover .ai-launcher-arrow {
    color: #ffffff !important;

    background:
        var(--rani-blue);
}

.ai-launcher-status {
    position: absolute;

    top: 7px;
    right: 7px;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--rani-blue);

    box-shadow:
        0 0 10px rgba(56, 189, 248, .85);
}

.ai-chat-launcher-glow {
    position: absolute;

    width: 115px;
    height: 115px;

    left: -32px;
    top: -38px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(56, 189, 248, .13),
            transparent 68%
        );

    filter: blur(15px);

    pointer-events: none;
}

.ai-launcher-orbit,
.ai-launcher-orbit-2 {
    position: absolute;

    pointer-events: none;

    border-radius: 50%;

    border: 1px solid rgba(56, 189, 248, .05);

    opacity: .72;
}

.ai-launcher-orbit {
    width: 76px;
    height: 76px;

    animation:
        aiOrbit 10s linear infinite;
}

.ai-launcher-orbit-2 {
    width: 96px;
    height: 96px;

    border-color:
        rgba(56, 189, 248, .032);

    animation:
        aiOrbit 14s linear infinite reverse;
}

@keyframes aiOrbit {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ai-chat-launcher[aria-expanded="true"] {
    width: 50px;
    min-width: 50px;
    height: 50px;

    padding: 0;
    border-radius: 16px;
}

.ai-chat-launcher[aria-expanded="true"] .ai-launcher-text,
.ai-chat-launcher[aria-expanded="true"] .ai-launcher-arrow {
    display: none;
}

/* =========================================================
   BACKDROP
========================================================= */

.ai-chat-backdrop {
    position: fixed;
    inset: 0;

    z-index: 2147482000;

    background: rgba(3, 8, 14, .5);

    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .28s ease,
        visibility .28s ease;
}

.ai-chat-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =========================================================
   PANEL
========================================================= */

.ai-chat-panel {
    position: fixed;

    right: 24px;
    bottom: 98px;

    width:
        min(
            440px,
            calc(100vw - 30px)
        );

    height:
        min(
            720px,
            calc(100vh - 125px)
        );

    z-index: 2147482001;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border:
        1px solid rgba(56, 189, 248, .18);

    border-radius: 29px;

    background:
        linear-gradient(
            145deg,
            rgba(8, 20, 30, .985),
            rgba(3, 10, 16, .995)
        );

    box-shadow:
        var(--rani-shadow);

    -webkit-backdrop-filter:
        blur(28px)
        saturate(120%);

    backdrop-filter:
        blur(28px)
        saturate(120%);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform:
        translateY(22px)
        scale(.955);

    transform-origin:
        bottom right;

    transition:
        opacity .28s ease,
        transform .32s var(--rani-ease),
        visibility .28s ease;
}

.ai-chat-panel.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform:
        translateY(0)
        scale(1);
}

/* =========================================================
   CONSENT
========================================================= */

.ai-consent-overlay {
    position: absolute;
    inset: 0;

    z-index: 80;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(56, 189, 248, .11),
            transparent 42%
        ),
        rgba(2, 8, 13, .92);

    -webkit-backdrop-filter:
        blur(18px)
        saturate(120%);

    backdrop-filter:
        blur(18px)
        saturate(120%);

    opacity: 1;
    visibility: visible;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.ai-consent-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ai-consent-card {
    width:
        min(
            100%,
            340px
        );

    padding: 23px;

    border:
        1px solid rgba(56, 189, 248, .16);

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            rgba(9, 24, 35, .99),
            rgba(3, 12, 19, .995)
        );

    box-shadow:
        0 35px 90px rgba(0, 0, 0, .56),
        0 0 45px rgba(56, 189, 248, .06),
        inset 0 1px 0 rgba(255, 255, 255, .04);
}

.ai-consent-icon {
    width: 55px;
    height: 55px;

    display: grid;
    place-items: center;

    margin-bottom: 14px;

    border-radius: 16px;

    color: var(--rani-blue-light);

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .15),
            rgba(56, 189, 248, .045)
        );

    border:
        1px solid rgba(56, 189, 248, .17);

    font-size: 1.15rem;
}

.ai-consent-card h2 {
    margin: 0;

    color: #f0fbff;

    font-size: 1rem;
    font-weight: 900;
}

.ai-consent-card p {
    margin-top: 9px;

    color: #708894;

    font-size: .61rem;
    line-height: 1.9;
}

.ai-consent-actions {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-top: 16px;
}

.ai-consent-confirm {
    min-height: 44px;

    border: 0;
    border-radius: 12px;

    color: #03151d;

    background:
        linear-gradient(
            135deg,
            #baf2ff,
            #38bdf8
        );

    font-family: inherit;
    font-size: .64rem;
    font-weight: 900;

    cursor: pointer;

    box-shadow:
        0 12px 32px rgba(56, 189, 248, .13);

    transition: .25s ease;
}

.ai-consent-confirm:hover {
    transform: translateY(-2px);

    box-shadow:
        0 16px 40px rgba(56, 189, 248, .21);
}

.ai-consent-terms {
    color: #536d79;

    text-align: center;

    font-size: .44rem;
    line-height: 1.6;
}

.ai-consent-terms a {
    color: #7ddcff;
    text-decoration: none;
    font-weight: 800;
}

.ai-consent-terms a:hover {
    text-decoration: underline;
}

/* =========================================================
   HEADER
========================================================= */

.ai-chat-header {
    position: relative;
    z-index: 30;

    min-height: 82px;

    padding: 12px 13px;

    display: flex;
    align-items: center;

    gap: 8px;

    border-bottom:
        1px solid rgba(255, 255, 255, .06);

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .032),
            rgba(255, 255, 255, .008)
        );
}

.ai-chat-identity {
    min-width: 0;
    flex: 1;

    display: flex;
    align-items: center;

    gap: 10px;
}

.ai-chat-avatar {
    position: relative;

    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(56, 189, 248, .19);

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .12),
            rgba(56, 189, 248, .035)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .03);
}

.ai-avatar-robot {
    color: #83cfe5;

    font-size: 1.05rem;

    text-shadow:
        0 0 12px rgba(56, 189, 248, .27);
}

.ai-avatar-lock {
    position: absolute;

    right: -2px;
    bottom: -2px;

    width: 17px;
    height: 17px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(56, 189, 248, .22);

    border-radius: 5px;

    color: #7ddcff;

    background: #07171f;

    font-size: .45rem;
}

.ai-avatar-ring {
    position: absolute;
    inset: -4px;

    border:
        1px solid rgba(56, 189, 248, .07);

    border-radius: 18px;

    animation:
        avatarPulse 3.5s ease-in-out infinite;
}

.ai-chat-online {
    position: absolute;

    right: -2px;
    top: -2px;

    width: 9px;
    height: 9px;

    border: 2px solid #07141d;

    border-radius: 50%;

    background: #38bdf8;

    box-shadow:
        0 0 15px rgba(56, 189, 248, .78);
}

@keyframes avatarPulse {
    0%, 100% {
        opacity: .42;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.035);
    }
}

/* =========================================================
   TITLE
========================================================= */

.ai-chat-title {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.ai-chat-name-row {
    display: flex;
    align-items: center;

    gap: 7px;

    flex-wrap: wrap;
}

.ai-chat-title strong {
    color: #effbff;

    font-size: .84rem;
    font-weight: 900;
}

.ai-chat-title > span {
    max-width: 175px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: #607985;

    font-size: .51rem;
}

.ai-live-badge {
    display: inline-flex;
    align-items: center;

    gap: 4px;

    height: 17px;

    padding: 0 6px;

    border:
        1px solid rgba(56, 189, 248, .14);

    border-radius: 7px;

    color: #7ddcff;

    background:
        rgba(56, 189, 248, .04);

    font-size: .40rem;
    font-weight: 900;
}

.ai-live-badge i {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #38bdf8;

    box-shadow:
        0 0 6px rgba(56, 189, 248, .6);
}

/* =========================================================
   MODEL
========================================================= */

.ai-header-model {
    position: relative;
    z-index: 200;
}

.ai-model-button {
    width: 88px;
    height: 37px;

    padding: 0 8px;

    display: flex;
    align-items: center;

    justify-content: space-between;

    gap: 6px;

    border:
        1px solid rgba(255, 255, 255, .06);

    border-radius: 10px;

    color: #dff8ff;

    background:
        rgba(255, 255, 255, .018);

    font-family: inherit;

    cursor: pointer;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.ai-model-button:hover {
    border-color:
        rgba(56, 189, 248, .15);

    background:
        rgba(56, 189, 248, .025);
}

.ai-model-button > span {
    min-width: 0;

    display: flex;
    flex-direction: column;

    align-items: flex-start;

    gap: 1px;
}

.ai-model-button strong {
    color: #dff8ff;

    font-size: .51rem;
    font-weight: 900;
}

.ai-model-button small {
    color: #4f6a77;

    font-size: .37rem;
}

.ai-model-button > i {
    color: #607985;

    font-size: .42rem;

    transition:
        transform .2s ease;
}

.ai-model-button[aria-expanded="true"] > i {
    transform: rotate(180deg);
}

.ai-model-menu {
    position: absolute;

    top: calc(100% + 8px);
    left: 50%;

    width: 190px;
    max-width: calc(100vw - 40px);

    padding: 6px;

    border:
        1px solid rgba(56, 189, 248, .15);

    border-radius: 13px;

    background:
        rgba(4, 13, 20, .995);

    box-shadow:
        0 22px 55px rgba(0, 0, 0, .55);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform:
        translateX(-50%)
        translateY(-6px)
        scale(.98);

    transition:
        opacity .2s ease,
        transform .2s ease,
        visibility .2s ease;

    z-index: 9999;
}

.ai-model-menu.open {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;

    transform:
        translateX(-50%)
        translateY(0)
        scale(1);
}

.ai-model-option {
    width: 100%;
    min-height: 51px;

    padding: 7px;

    display: flex;
    align-items: center;

    gap: 8px;

    border:
        1px solid transparent;

    border-radius: 9px;

    color: #6d8794;

    background: transparent;

    font-family: inherit;

    text-align: right;

    cursor: pointer;

    transition: .2s ease;
}

.ai-model-option:hover,
.ai-model-option.active {
    color: #e8faff;

    background:
        rgba(56, 189, 248, .05);

    border-color:
        rgba(56, 189, 248, .12);
}

.ai-model-option > span:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 2px;
}

.ai-model-option > span:last-child strong {
    color: inherit;

    font-size: .53rem;
    font-weight: 900;
}

.ai-model-option > span:last-child small {
    color: #4f6976;

    font-size: .42rem;
}

.ai-model-icon {
    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    color: #7ddcff;

    background:
        rgba(56, 189, 248, .06);
}

/* =========================================================
   HEADER ACTIONS
========================================================= */

.ai-chat-header-actions {
    display: flex;
    align-items: center;

    gap: 4px;
}

.ai-chat-icon-btn {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(255, 255, 255, .05);

    border-radius: 9px;

    color: #617985;

    background:
        rgba(255, 255, 255, .015);

    cursor: pointer;

    transition: .2s ease;
}

.ai-chat-icon-btn:hover {
    color: #dff8ff;

    border-color:
        rgba(56, 189, 248, .18);

    background:
        rgba(56, 189, 248, .04);

    transform:
        translateY(-1px);
}

.ai-chat-icon-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

#aiChatHistory[aria-expanded="true"] {
    color: #dff8ff;

    border-color:
        rgba(56, 189, 248, .4);

    background:
        rgba(56, 189, 248, .12);
}

/* =========================================================
   HISTORY
========================================================= */

.ai-history-panel {
    display: none;

    flex: 1;

    min-height: 0;

    flex-direction: column;

    gap: 10px;

    padding: 14px 16px 16px;

    overflow-y: auto;

    scrollbar-width: thin;

    scrollbar-color:
        rgba(56, 189, 248, .22)
        transparent;

    animation:
        raniHistoryIn .22s ease;
}

.ai-chat-panel.history-open .ai-history-panel {
    display: flex;
}

.ai-chat-panel.history-open .ai-chat-messages,
.ai-chat-panel.history-open .ai-chat-form,
.ai-chat-panel.history-open .ai-chat-status-bar {
    display: none !important;
}

@keyframes raniHistoryIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.ai-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding-bottom: 8px;

    border-bottom:
        1px solid rgba(56, 189, 248, .14);
}

.ai-history-head h3 {
    display: flex;
    align-items: center;

    gap: 8px;

    margin: 0;

    color: #eaf9ff;

    font-size: .82rem;
    font-weight: 900;
}

.ai-history-head h3 i {
    color: #38bdf8;

    font-size: .78rem;
}

.ai-history-new {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 7px 12px;

    border:
        1px solid rgba(56, 189, 248, .3);

    border-radius: 11px;

    color: #dff8ff;

    background:
        rgba(56, 189, 248, .1);

    font-size: .68rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .18s ease,
        transform .18s ease,
        border-color .18s ease;
}

.ai-history-new:hover {
    background:
        rgba(56, 189, 248, .2);

    border-color:
        rgba(56, 189, 248, .4);

    transform:
        translateY(-1px);
}

.ai-history-list {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.ai-history-item {
    display: flex;
    align-items: stretch;

    gap: 6px;

    border:
        1px solid rgba(255, 255, 255, .06);

    border-radius: 13px;

    background:
        rgba(255, 255, 255, .02);

    overflow: hidden;

    transition:
        border-color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.ai-history-item:hover {
    border-color:
        rgba(56, 189, 248, .25);

    background:
        rgba(56, 189, 248, .04);

    transform:
        translateY(-1px);
}

.ai-history-item.active {
    border-color:
        rgba(56, 189, 248, .5);

    background:
        rgba(56, 189, 248, .08);
}

.ai-history-item-main {
    flex: 1;

    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;

    padding: 10px 12px;

    border: 0;

    background: transparent;

    color: inherit;

    text-align: right;

    cursor: pointer;
}

.ai-history-item-title {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: #eaf9ff;

    font-size: .74rem;
    font-weight: 900;
}

.ai-history-item-preview {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color:
        rgba(220, 240, 250, .55);

    font-size: .63rem;
}

.ai-history-item-date {
    color:
        rgba(220, 240, 250, .35);

    font-size: .56rem;
}

.ai-history-item-delete {
    width: 38px;

    flex: 0 0 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    border-right:
        1px solid rgba(255, 255, 255, .06);

    background: transparent;

    color:
        rgba(248, 113, 113, .7);

    cursor: pointer;

    transition:
        background .18s ease,
        color .18s ease;
}

.ai-history-item-delete:hover {
    color: #f87171;

    background:
        rgba(248, 113, 113, .12);
}

.ai-history-empty {
    margin: 18px 4px;

    color:
        rgba(220, 240, 250, .5);

    font-size: .7rem;
    line-height: 1.7;

    text-align: center;
}

/* =========================================================
   STATUS
========================================================= */

.ai-chat-status-bar {
    min-height: 29px;

    padding: 0 14px;

    display: flex;
    align-items: center;

    gap: 6px;

    border-bottom:
        1px solid rgba(255, 255, 255, .03);

    color: #516d79;

    font-size: .44rem;
    font-weight: 800;
}

.ai-status-light {
    width: 6px;
    height: 6px;

    flex: 0 0 6px;

    border-radius: 50%;

    background: #38bdf8;

    box-shadow:
        0 0 9px rgba(56, 189, 248, .75);

    transition:
        transform .2s ease,
        opacity .2s ease;
}

.ai-chat-panel.is-thinking .ai-status-light {
    animation:
        thinkingPulse .9s infinite;
}

.ai-status-separator {
    width: 3px;
    height: 3px;

    flex: 0 0 3px;

    border-radius: 50%;

    background: #304854;
}

#aiStatusLatency {
    min-width: 28px;

    color: #58727e;

    font-size: .41rem;

    font-variant-numeric:
        tabular-nums;

    direction: ltr;

    text-align: center;
}

.ai-chat-panel.is-thinking #aiStatusLatency {
    color: #7ddcff;
}

/* =========================================================
   MESSAGES
========================================================= */

.ai-chat-messages {
    flex: 1;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 15px 13px 10px;

    display: flex;
    flex-direction: column;

    gap: 11px;

    scrollbar-width: thin;

    scrollbar-color:
        rgba(56, 189, 248, .22)
        transparent;

    overscroll-behavior: contain;

    scroll-behavior: smooth;
}

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

.ai-chat-messages::-webkit-scrollbar-thumb {
    background:
        rgba(56, 189, 248, .22);

    border-radius: 20px;
}

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

.ai-message {
    width: 100%;

    display: flex;
    align-items: flex-end;

    gap: 7px;

    animation:
        aiMessageIn .25s ease;
}

.ai-message.assistant {
    justify-content: flex-start;
}

.ai-message.user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.ai-message-avatar {
    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border:
        1px solid rgba(56, 189, 248, .10);

    border-radius: 9px;

    background:
        rgba(56, 189, 248, .04);
}

.ai-robot-avatar,
.ai-user-avatar {
    width: 100%;
    height: 100%;

    display: grid;
    place-items: center;
}

.ai-robot-avatar {
    color: #7ddcff;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(56, 189, 248, .14),
            transparent 68%
        );
}

.ai-robot-avatar i {
    font-size: .64rem;
}

.ai-user-avatar {
    color: #87c7dd;
}

.ai-message-content {
    min-width: 0;

    max-width:
        calc(100% - 35px);

    display: flex;
    flex-direction: column;

    align-items: flex-start;

    gap: 3px;
}

.ai-message.user .ai-message-content {
    align-items: flex-end;
}

/* =========================================================
   MESSAGE BUBBLE
========================================================= */

.ai-message-bubble {
    position: relative;

    max-width: 100%;

    padding: 10px 12px;

    border:
        1px solid rgba(255, 255, 255, .055);

    border-radius: 15px;

    color: var(--rani-text);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .03),
            rgba(255, 255, 255, .014)
        );

    font-size: .69rem;

    line-height: 1.8;

    overflow-wrap: anywhere;

    word-break: break-word;
}

.ai-message.assistant .ai-message-bubble {
    box-shadow:
        0 8px 28px rgba(0, 0, 0, .08);
}

.ai-message.user .ai-message-bubble {
    color: #e8faff;

    border-color:
        rgba(56, 189, 248, .12);

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .09),
            rgba(56, 189, 248, .045)
        );
}

.ai-message-bubble p {
    margin: 0;
}

.ai-message-bubble p + p {
    margin-top: 8px;
}

.ai-message-bubble h3,
.ai-message-bubble h4 {
    margin: 4px 0 8px;

    color: #eafbff;

    font-weight: 900;
}

.ai-message-bubble h3 {
    font-size: .80rem;
}

.ai-message-bubble h4 {
    font-size: .75rem;
}

.ai-message-bubble strong {
    color: #eafcff;

    font-weight: 900;
}

.ai-message-bubble em {
    color: #a8cad5;
}

.ai-message-bubble code {
    padding: 2px 5px;

    border:
        1px solid rgba(56, 189, 248, .12);

    border-radius: 6px;

    color: #8edfff;

    background:
        rgba(56, 189, 248, .05);

    font-family:
        Consolas,
        Monaco,
        monospace;

    font-size: .62rem;
}

.ai-message-bubble ul {
    margin: 6px 0 0;

    padding-right: 18px;
}

.ai-message-bubble li {
    margin-top: 4px;
}

.ai-message-bubble li::marker {
    color: var(--rani-blue);
}

.ai-message-bubble hr {
    height: 1px;

    margin: 11px 0;

    border: 0;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(56, 189, 248, .34),
            transparent
        );
}

.ai-message-bubble a {
    position: relative;

    color: var(--rani-blue-light);

    text-decoration: none;

    font-weight: 800;
}

.ai-message-bubble a::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: -2px;

    height: 1px;

    background: currentColor;

    opacity: .45;

    transform-origin: right;

    transform: scaleX(.6);

    transition:
        transform .22s ease,
        opacity .22s ease;
}

.ai-message-bubble a:hover::after {
    opacity: .95;

    transform: scaleX(1);
}

.ai-message-meta {
    padding: 0 4px;

    color: #3f5964;

    font-size: .44rem;

    user-select: none;
}

/* =========================================================
   MESSAGE ACTIONS
========================================================= */

.ai-message-actions {
    display: flex;
    align-items: center;

    gap: 4px;

    margin-top: 2px;

    opacity: .72;

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.ai-message:hover .ai-message-actions {
    opacity: 1;
}

.ai-message-action {
    position: relative;

    width: 27px;
    height: 25px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(255, 255, 255, .055);

    border-radius: 8px;

    color: #57717d;

    background:
        rgba(255, 255, 255, .014);

    cursor: pointer;

    font-size: .47rem;

    transition:
        transform .2s ease,
        color .2s ease,
        background .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.ai-message-action:hover {
    color: #b9efff;

    border-color:
        rgba(56, 189, 248, .17);

    background:
        rgba(56, 189, 248, .045);

    transform:
        translateY(-1px);
}

.ai-message-action.speaking {
    color: #7ddcff;

    border-color:
        rgba(56, 189, 248, .25);

    background:
        rgba(56, 189, 248, .055);

    box-shadow:
        0 0 18px rgba(56, 189, 248, .07);
}

.ai-message-action.speaking i {
    animation:
        raniSpeakPulse 1s ease-in-out infinite;
}

@keyframes raniSpeakPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

/* =========================================================
   REPLY PREVIEW
========================================================= */

.ai-reply-preview {
    position: relative;

    display: flex;
    align-items: center;

    gap: 9px;

    min-height: 49px;

    margin-bottom: 7px;

    padding: 7px 8px;

    border:
        1px solid rgba(56, 189, 248, .17);

    border-radius: 13px;

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .065),
            rgba(255, 255, 255, .014)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .03);

    animation:
        raniReplyIn .22s ease;
}

.ai-reply-preview::before {
    content: "";

    position: absolute;

    right: 0;
    top: 7px;
    bottom: 7px;

    width: 2px;

    border-radius: 2px;

    background:
        linear-gradient(
            180deg,
            #7ddcff,
            #38bdf8
        );
}

.ai-reply-preview[hidden] {
    display: none !important;
}

.ai-reply-preview-icon {
    width: 29px;
    height: 29px;

    flex: 0 0 29px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    color: #7ddcff;

    background:
        rgba(56, 189, 248, .07);

    font-size: .52rem;
}

.ai-reply-preview-content {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 2px;
}

.ai-reply-preview-label {
    color: #8edfff;

    font-size: .47rem;
    font-weight: 900;
}

.ai-reply-preview-label strong {
    color: #dff8ff;
}

.ai-reply-preview-text {
    max-width: 100%;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: #607985;

    font-size: .45rem;
}

.ai-reply-preview-close {
    width: 26px;
    height: 26px;

    flex: 0 0 26px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(255, 255, 255, .05);

    border-radius: 8px;

    color: #607985;

    background:
        rgba(255, 255, 255, .014);

    cursor: pointer;

    transition: .2s ease;
}

.ai-reply-preview-close:hover {
    color: #ffb7b7;

    border-color:
        rgba(248, 113, 113, .18);

    background:
        rgba(248, 113, 113, .04);
}

@keyframes raniReplyIn {
    from {
        opacity: 0;
        transform:
            translateY(5px)
            scale(.985);
    }

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

/* =========================================================
   WELCOME
========================================================= */

.ai-welcome-card {
    position: relative;

    width: 100%;

    padding: 16px;

    border:
        1px solid rgba(56, 189, 248, .09);

    border-radius: 19px;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .045),
            rgba(255, 255, 255, .012)
        );

    animation:
        aiWelcomeIn .4s ease;
}

.ai-welcome-card::after {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -100px;
    top: -100px;

    border-radius: 50%;

    background:
        rgba(56, 189, 248, .06);

    filter: blur(35px);

    pointer-events: none;
}

.ai-welcome-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.ai-welcome-brand {
    display: flex;
    align-items: center;

    gap: 8px;
}

.ai-welcome-avatar {
    width: 39px;
    height: 39px;

    flex: 0 0 39px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(56, 189, 248, .12);

    border-radius: 11px;

    color: #7ddcff;

    background:
        radial-gradient(
            circle,
            rgba(56, 189, 248, .15),
            rgba(56, 189, 248, .025)
        );
}

.ai-welcome-brand > div:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 1px;
}

.ai-welcome-brand strong {
    color: #eafbff;

    font-size: .64rem;
    font-weight: 900;
}

.ai-welcome-brand span {
    max-width: 190px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: #506c79;

    font-size: .43rem;
}

.ai-welcome-badge {
    padding: 5px 7px;

    border:
        1px solid rgba(56, 189, 248, .09);

    border-radius: 7px;

    color: #7ddcff;

    background:
        rgba(56, 189, 248, .025);

    font-size: .43rem;

    font-weight: 900;
}

.ai-welcome-card h3 {
    margin: 15px 0 0;

    color: #eafbff;

    font-size: .94rem;
    font-weight: 900;
}

.ai-welcome-card p {
    margin: 6px 0 0;

    color: #6f8894;

    font-size: .64rem;

    line-height: 1.8;
}

.ai-welcome-question {
    margin-top: 10px;

    display: flex;
    align-items: center;

    gap: 6px;

    color: #7ddcff;

    font-size: .56rem;
    font-weight: 800;
}

.ai-quick-prompts {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 6px;

    margin-top: 11px;
}

.ai-quick-prompt {
    min-height: 34px;

    display: flex;
    align-items: center;

    gap: 6px;

    padding: 6px 8px;

    border:
        1px solid rgba(56, 189, 248, .08);

    border-radius: 9px;

    color: #6d8794;

    background:
        rgba(255, 255, 255, .014);

    font-family: inherit;

    font-size: .46rem;
    font-weight: 800;

    text-align: right;

    cursor: pointer;

    transition:
        .2s ease;
}

.ai-quick-prompt:hover {
    color: #d8f7ff;

    border-color:
        rgba(56, 189, 248, .17);

    background:
        rgba(56, 189, 248, .035);

    transform:
        translateY(-1px);
}

.ai-quick-prompt i {
    flex: 0 0 auto;

    color: var(--rani-blue);
}

/* =========================================================
   QUICK ACTIONS
========================================================= */

.ai-quick-actions {
    width: 100%;

    margin-top: 8px;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 6px;

    animation:
        raniQuickActionsIn .25s ease;
}

.ai-quick-action {
    position: relative;

    min-height: 52px;

    padding: 7px 8px;

    display: flex;
    align-items: center;

    gap: 8px;

    border:
        1px solid rgba(56, 189, 248, .11);

    border-radius: 12px;

    color: #cfeef8;

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .042),
            rgba(255, 255, 255, .012)
        );

    font-family: inherit;

    text-align: right;

    cursor: pointer;

    overflow: hidden;

    transition:
        transform .22s ease,
        border-color .22s ease,
        background .22s ease,
        box-shadow .22s ease;
}

.ai-quick-action::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            120deg,
            transparent 25%,
            rgba(255, 255, 255, .04),
            transparent 75%
        );

    transform:
        translateX(-100%);

    transition:
        transform .55s ease;

    pointer-events: none;
}

.ai-quick-action:hover {
    transform:
        translateY(-2px);

    border-color:
        rgba(56, 189, 248, .22);

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .075),
            rgba(255, 255, 255, .018)
        );

    box-shadow:
        0 10px 28px rgba(0, 0, 0, .12),
        0 0 22px rgba(56, 189, 248, .035);
}

.ai-quick-action:hover::before {
    transform:
        translateX(100%);
}

.ai-quick-action-icon {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    color: #7ddcff;

    background:
        rgba(56, 189, 248, .06);

    border:
        1px solid rgba(56, 189, 248, .10);

    font-size: .50rem;
}

.ai-quick-action-copy {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 2px;
}

.ai-quick-action-copy strong {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: #dff8ff;

    font-size: .48rem;
    font-weight: 900;

    line-height: 1.4;
}

.ai-quick-action-copy small {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: #55727e;

    font-size: .40rem;

    line-height: 1.4;
}

.ai-quick-action-arrow {
    flex: 0 0 auto;

    color: #4b6875;

    font-size: .40rem;

    transition:
        transform .2s ease,
        color .2s ease;
}

.ai-quick-action:hover .ai-quick-action-arrow {
    color: #7ddcff;

    transform:
        translateX(-2px);
}

@keyframes raniQuickActionsIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

/* =========================================================
   FOLLOWUPS
========================================================= */

.ai-followups {
    width: 100%;

    margin-top: 8px;

    padding-top: 2px;

    display: flex;
    flex-wrap: wrap;

    gap: 5px;

    max-width: 100%;

    animation:
        raniFollowupsIn .28s ease;
}

.ai-followups-title {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 5px;

    margin-bottom: 1px;

    color: #62808c;

    font-size: .46rem;
    font-weight: 900;
}

.ai-followups-title i {
    color: #38bdf8;

    font-size: .43rem;
}

.ai-followup {
    min-height: 28px;

    max-width: 100%;

    padding: 0 8px;

    display: inline-flex;
    align-items: center;

    gap: 6px;

    border:
        1px solid rgba(56, 189, 248, .09);

    border-radius: 8px;

    color: #6d8894;

    background:
        rgba(56, 189, 248, .016);

    font-family: inherit;

    font-size: .47rem;
    font-weight: 800;

    cursor: pointer;

    transition: .2s ease;
}

.ai-followup span {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.ai-followup i {
    flex: 0 0 auto;

    color: #4b6875;

    font-size: .38rem;
}

.ai-followup:hover {
    color: #d1f4ff;

    border-color:
        rgba(56, 189, 248, .18);

    background:
        rgba(56, 189, 248, .045);

    transform:
        translateY(-1px);
}

.ai-followup:hover i {
    color: #7ddcff;
}

@keyframes raniFollowupsIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* =========================================================
   HOLIDAY MEDIA
========================================================= */

.ai-holiday-media {
    width: 100%;

    margin-top: 10px;

    overflow: hidden;

    border:
        1px solid rgba(56, 189, 248, .15);

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .045),
            rgba(255, 255, 255, .012)
        );

    box-shadow:
        0 12px 34px rgba(0, 0, 0, .16),
        inset 0 1px 0 rgba(255, 255, 255, .03);

    animation:
        raniHolidayIn .3s ease;
}

.ai-holiday-media-link {
    position: relative;

    display: block;

    width: 100%;

    background:
        rgba(0, 0, 0, .16);

    text-decoration: none;
}

.ai-holiday-media-image {
    display: block;

    width: 100%;
    height: auto;

    max-height: 360px;

    object-fit: cover;

    transition:
        transform .35s var(--rani-ease),
        filter .35s ease;
}

.ai-holiday-media-link:hover .ai-holiday-media-image {
    transform: scale(1.015);

    filter:
        brightness(1.04)
        saturate(1.04);
}

.ai-holiday-media-caption {
    min-height: 34px;

    padding: 7px 9px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    border-top:
        1px solid rgba(255, 255, 255, .04);

    color: #71919d;

    background:
        rgba(255, 255, 255, .012);

    font-size: .47rem;
    font-weight: 800;
}

.ai-holiday-media-caption > span:first-child {
    display: inline-flex;
    align-items: center;

    gap: 5px;
}

.ai-holiday-media-caption i {
    color: #38bdf8;
}

.ai-holiday-media-open {
    color: #587784;

    transition:
        color .2s ease,
        transform .2s ease;
}

.ai-holiday-media:hover .ai-holiday-media-open {
    color: #8edfff;

    transform:
        translateY(-1px);
}

@keyframes raniHolidayIn {
    from {
        opacity: 0;
        transform:
            translateY(8px)
            scale(.99);
    }

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

/* =========================================================
   SERVICE DRAFT
========================================================= */

.ai-service-draft {
    width: 100%;

    margin-top: 9px;

    padding: 10px;

    border:
        1px solid rgba(56, 189, 248, .12);

    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .045),
            rgba(255, 255, 255, .012)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .025);

    animation:
        raniDraftIn .25s ease;
}

.ai-service-draft-header {
    display: flex;
    align-items: center;

    gap: 8px;

    padding-bottom: 8px;

    border-bottom:
        1px solid rgba(255, 255, 255, .045);
}

.ai-service-draft-icon {
    width: 29px;
    height: 29px;

    flex: 0 0 29px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(56, 189, 248, .12);

    border-radius: 8px;

    color: #7ddcff;

    background:
        rgba(56, 189, 248, .05);

    font-size: .54rem;
}

.ai-service-draft-header > div:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 2px;
}

.ai-service-draft-header strong {
    color: #dff8ff;

    font-size: .51rem;
    font-weight: 900;
}

.ai-service-draft-header small {
    color: #55727e;

    font-size: .40rem;
}

.ai-service-draft-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 5px;

    margin-top: 8px;
}

.ai-service-draft-item {
    min-width: 0;

    padding: 7px 8px;

    border:
        1px solid rgba(255, 255, 255, .045);

    border-radius: 8px;

    background:
        rgba(255, 255, 255, .012);
}

.ai-service-draft-item span,
.ai-service-draft-message > span {
    display: block;

    margin-bottom: 2px;

    color: #506b77;

    font-size: .37rem;
    font-weight: 800;
}

.ai-service-draft-item strong {
    display: block;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: #badde7;

    font-size: .44rem;
    font-weight: 800;
}

.ai-service-draft-message {
    margin-top: 6px;

    padding: 7px 8px;

    border:
        1px solid rgba(255, 255, 255, .045);

    border-radius: 8px;

    background:
        rgba(255, 255, 255, .012);
}

.ai-service-draft-message p {
    margin: 0;

    color: #9dbdc8;

    font-size: .44rem;

    line-height: 1.6;

    white-space: pre-wrap;

    overflow-wrap: anywhere;
}

.ai-service-draft-footer {
    margin-top: 8px;

    padding-top: 7px;

    border-top:
        1px solid rgba(255, 255, 255, .04);
}

.ai-service-draft-status {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    color: #62dcbf;

    font-size: .40rem;
    font-weight: 800;
}

.ai-service-draft-status i {
    color: #38bdf8;
}

.ai-service-draft-actions {
    display: grid;

    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(0, .9fr);

    gap: 6px;

    margin-top: 9px;
}

.ai-service-draft-send,
.ai-service-draft-edit {
    min-height: 38px;

    padding: 0 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    border-radius: 10px;

    font-family: inherit;

    font-size: .46rem;
    font-weight: 900;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        filter .2s ease,
        background .2s ease,
        border-color .2s ease,
        color .2s ease;
}

.ai-service-draft-send {
    color: #031820;

    border: 0;

    background:
        linear-gradient(
            135deg,
            #bdf2ff,
            #38bdf8
        );

    box-shadow:
        0 10px 28px rgba(56, 189, 248, .12);
}

.ai-service-draft-send:hover {
    transform:
        translateY(-1px);

    box-shadow:
        0 14px 34px rgba(56, 189, 248, .18);

    filter:
        brightness(1.03);
}

.ai-service-draft-edit {
    color: #7c98a4;

    border:
        1px solid rgba(255, 255, 255, .07);

    background:
        rgba(255, 255, 255, .018);
}

.ai-service-draft-edit:hover {
    color: #dff8ff;

    border-color:
        rgba(56, 189, 248, .15);

    background:
        rgba(56, 189, 248, .035);

    transform:
        translateY(-1px);
}

.ai-service-draft-send:disabled,
.ai-service-draft-edit:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

@keyframes raniDraftIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* =========================================================
   THINKING
========================================================= */

.ai-message.assistant:has([data-thinking-time]) .ai-message-bubble {
    min-width: 145px;

    padding: 9px 11px !important;

    border:
        1px solid rgba(56, 189, 248, .12);

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .045),
            rgba(255, 255, 255, .018)
        );
}

.ai-thinking-content {
    display: flex;
    flex-direction: column;

    gap: 6px;

    min-width: 120px;
}

.ai-thinking-top,
.ai-thinking-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.ai-typing-label {
    color: #bfeeff;

    font-size: .52rem;
    font-weight: 900;
}

.ai-thinking-time {
    color: #7ddcff;

    font-size: .46rem;
    font-weight: 900;

    font-variant-numeric:
        tabular-nums;

    direction: ltr;
}

.ai-thinking-status {
    color: #688491;

    font-size: .43rem;
}

.ai-typing {
    display: inline-flex;
    align-items: center;

    gap: 3px;
}

.ai-typing i {
    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: #7ddcff;

    box-shadow:
        0 0 8px rgba(125, 220, 255, .45);

    animation:
        aiTyping 1s infinite;
}

.ai-typing i:nth-child(2) {
    animation-delay: .15s;
}

.ai-typing i:nth-child(3) {
    animation-delay: .30s;
}

@keyframes aiTyping {
    0%, 60%, 100% {
        opacity: .25;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* =========================================================
   VOICE
========================================================= */

.ai-voice-button {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(255, 255, 255, .05);

    border-radius: 11px;

    color: #66808b;

    background:
        rgba(255, 255, 255, .01);

    cursor: pointer;

    transition: .2s ease;
}

.ai-voice-button:hover {
    color: #bfeeff;

    border-color:
        rgba(56, 189, 248, .18);

    background:
        rgba(56, 189, 248, .045);

    transform:
        translateY(-1px);
}

.ai-voice-button.listening,
.ai-voice-button.is-listening {
    color: #7ddcff;

    border-color:
        rgba(56, 189, 248, .35);

    background:
        rgba(56, 189, 248, .06);

    box-shadow:
        0 0 0 3px rgba(56, 189, 248, .05),
        0 0 25px rgba(56, 189, 248, .08);

    animation:
        raniVoicePulse 1.1s ease-in-out infinite;
}

.ai-voice-button:disabled {
    opacity: .45;

    cursor: not-allowed;
}

@keyframes raniVoicePulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

/* =========================================================
   INPUT
========================================================= */

.ai-chat-form {
    position: relative;
    z-index: 10;

    padding: 9px 12px 11px;

    border-top:
        1px solid rgba(255, 255, 255, .05);

    background:
        rgba(255, 255, 255, .012);
}

.ai-chat-input-shell {
    display: flex;
    align-items: center;

    gap: 6px;

    min-height: 53px;

    padding: 7px;

    border:
        1px solid rgba(255, 255, 255, .07);

    border-radius: 16px;

    background:
        rgba(255, 255, 255, .022);

    transition: .25s ease;
}

.ai-chat-input-shell:focus-within {
    border-color:
        rgba(56, 189, 248, .26);

    background:
        rgba(56, 189, 248, .025);

    box-shadow:
        0 0 0 3px rgba(56, 189, 248, .025);
}

.ai-chat-input-shell textarea {
    flex: 1;

    min-width: 0;
    min-height: 36px;
    max-height: 120px;

    padding: 8px;

    border: 0;
    outline: 0;

    resize: none;

    color: #e8f6fb;

    background: transparent;

    font-family: inherit;
    font-size: .68rem;
    line-height: 1.65;
}

.ai-chat-input-shell textarea::placeholder {
    color: #4e6976;
}

.ai-chat-input-shell textarea:disabled {
    opacity: .55;
}

.ai-chat-input-shell > button:last-child {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: grid;
    place-items: center;

    border: 0;

    border-radius: 11px;

    color: #061b25;

    background:
        linear-gradient(
            135deg,
            #b9efff,
            #38bdf8
        );

    cursor: pointer;

    transition: .2s ease;
}

.ai-chat-input-shell > button:last-child:hover {
    transform:
        translateY(-2px);
}

.ai-chat-input-shell > button:last-child:disabled {
    opacity: .5;

    cursor: wait;

    transform: none;
}

#aiChatSend.loading i {
    animation:
        aiSendSpin .8s linear infinite;
}

@keyframes aiSendSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   DISCLAIMER
========================================================= */

.ai-chat-disclaimer {
    margin-top: 10px;

    border:
        1px solid rgba(56, 189, 248, .10);

    border-radius: 13px;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(56, 189, 248, .03),
            rgba(255, 255, 255, .01)
        );
}

.ai-disclaimer-toggle {
    width: 100%;
    min-height: 56px;

    padding: 10px 12px;

    display: flex;
    align-items: center;

    justify-content: space-between;

    gap: 9px;

    border: 0;

    color: inherit;

    background: transparent;

    font-family: inherit;

    cursor: pointer;

    text-align: right;
}

.ai-disclaimer-main {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 9px;
}

.ai-disclaimer-icon {
    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(56, 189, 248, .12);

    border-radius: 9px;

    color: #7ddcff;

    background:
        rgba(56, 189, 248, .05);

    font-size: .68rem;
}

.ai-disclaimer-summary {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.ai-disclaimer-summary strong {
    color: #c9edf7;

    font-size: .70rem;

    line-height: 1.35;

    font-weight: 900;
}

.ai-disclaimer-summary small {
    color: #7c96a1;

    font-size: .62rem;

    line-height: 1.5;
}

.ai-disclaimer-chevron {
    width: 27px;
    height: 27px;

    flex: 0 0 27px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    color: #5c7885;

    background:
        rgba(255, 255, 255, .02);

    font-size: .54rem;

    transition:
        transform .25s ease,
        color .25s ease;
}

.ai-chat-disclaimer:not(.collapsed) .ai-disclaimer-chevron {
    transform:
        rotate(180deg);

    color: #7ddcff;
}

.ai-disclaimer-details {
    padding: 2px 13px 14px;

    display: flex;
    flex-direction: column;

    gap: 8px;
}

.ai-disclaimer-details p {
    margin: 0;

    color: #86a0ab;

    font-size: .66rem;

    line-height: 1.85;
}

.ai-disclaimer-link {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    margin-top: 4px;

    color: #8edff5;

    text-decoration: none;

    font-size: .64rem;
    font-weight: 900;
}

.ai-disclaimer-link:hover {
    color: #baf2ff;

    text-decoration:
        underline;
}

.ai-disclaimer-link i {
    font-size: .54rem;
}

/* =========================================================
   FOOTER
========================================================= */

.ai-chat-form-footer {
    margin-top: 6px;

    display: flex;
    align-items: center;

    justify-content: space-between;

    gap: 10px;

    color: #3f5965;

    font-size: .44rem;
}

.ai-chat-form-footer span {
    display: inline-flex;
    align-items: center;

    gap: 4px;
}

.ai-chat-form-footer i {
    color: #4e6e7b;
}

/* =========================================================
   TOAST
========================================================= */

.ai-chat-toast {
    position: fixed;

    right: 24px;
    bottom: 98px;

    z-index: 2147483000;

    min-height: 41px;

    max-width:
        min(
            360px,
            calc(100vw - 40px)
        );

    padding: 8px 13px;

    display: flex;
    align-items: center;

    gap: 7px;

    border:
        1px solid rgba(56, 189, 248, .17);

    border-radius: 11px;

    color: #dff8ff;

    background:
        rgba(5, 17, 24, .97);

    box-shadow:
        0 20px 55px rgba(0, 0, 0, .35);

    font-size: .58rem;
    font-weight: 800;

    opacity: 0;

    transform:
        translateY(10px);

    pointer-events: none;

    transition: .3s ease;
}

.ai-chat-toast.show {
    opacity: 1;

    transform:
        translateY(0);
}

.ai-chat-toast i {
    color: #38bdf8;
}

/* =========================================================
   SYSTEM NOTICE
========================================================= */

.ai-chat-system-notice {
    display: flex;
    align-items: center;

    gap: 7px;

    padding: 9px 11px;

    border:
        1px solid rgba(248, 113, 113, .12);

    border-radius: 11px;

    color: #dda9a9;

    background:
        rgba(248, 113, 113, .035);

    font-size: .58rem;
    line-height: 1.7;
}

.ai-chat-system-notice i {
    color: #f48787;
}

/* =========================================================
   QUICK COLLECT
========================================================= */

.ai-quick-collect {
    position: fixed;
    inset: 0;

    z-index: 2147483500;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;

    background:
        rgba(2, 8, 13, .74);

    -webkit-backdrop-filter:
        blur(14px)
        saturate(120%);

    backdrop-filter:
        blur(14px)
        saturate(120%);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .22s ease,
        visibility .22s ease;
}

.ai-quick-collect.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ai-quick-collect-card {
    width:
        min(
            100%,
            420px
        );

    max-height:
        min(
            650px,
            calc(100vh - 36px)
        );

    overflow: auto;

    padding: 18px;

    border:
        1px solid rgba(56, 189, 248, .19);

    border-radius: 21px;

    background:
        linear-gradient(
            145deg,
            rgba(7, 22, 32, .995),
            rgba(3, 11, 17, .998)
        );

    box-shadow:
        0 35px 100px rgba(0, 0, 0, .62),
        0 0 55px rgba(56, 189, 248, .06),
        inset 0 1px 0 rgba(255, 255, 255, .04);

    transform:
        translateY(9px)
        scale(.985);

    opacity: 0;

    transition:
        transform .25s var(--rani-ease),
        opacity .22s ease;
}

.ai-quick-collect.open .ai-quick-collect-card {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);
}

.ai-quick-collect-header {
    display: flex;
    align-items: center;

    gap: 10px;

    padding-bottom: 12px;

    border-bottom:
        1px solid rgba(255, 255, 255, .05);
}

.ai-quick-collect-header > div {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 2px;
}

.ai-quick-collect-icon {
    width: 37px;
    height: 37px;

    flex: 0 0 37px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(56, 189, 248, .14);

    border-radius: 11px;

    color: #7ddcff;

    background:
        rgba(56, 189, 248, .06);

    font-size: .65rem;
}

.ai-quick-collect-header strong {
    color: #eafbff;

    font-size: .66rem;
    font-weight: 900;
}

.ai-quick-collect-header span {
    color: #5d7783;

    font-size: .43rem;
    line-height: 1.5;
}

.ai-quick-collect-close {
    width: 29px;
    height: 29px;

    flex: 0 0 29px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(255, 255, 255, .05);

    border-radius: 8px;

    color: #617c88;

    background:
        rgba(255, 255, 255, .015);

    cursor: pointer;

    transition: .2s ease;
}

.ai-quick-collect-close:hover {
    color: #ffb7b7;

    border-color:
        rgba(248, 113, 113, .17);

    background:
        rgba(248, 113, 113, .04);
}

.ai-quick-collect-fields {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-top: 12px;
}

.ai-quick-collect-field {
    display: flex;
    flex-direction: column;

    gap: 5px;
}

.ai-quick-collect-field > span {
    color: #7895a1;

    font-size: .45rem;
    font-weight: 800;
}

.ai-quick-collect-field input,
.ai-quick-collect textarea {
    width: 100%;

    min-height: 41px;

    padding: 0 11px;

    border:
        1px solid rgba(255, 255, 255, .07);

    border-radius: 10px;

    outline: none;

    color: #e8f6fb;

    background: #0a1c27;

    font-family: inherit;
    font-size: .56rem;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.ai-quick-collect textarea {
    min-height: 85px;

    padding: 10px 11px;

    resize: vertical;

    line-height: 1.7;
}

.ai-quick-collect-field input::placeholder,
.ai-quick-collect textarea::placeholder {
    color: #4d6875;

    opacity: 1;
}

.ai-quick-collect-field input:focus,
.ai-quick-collect textarea:focus {
    border-color:
        rgba(56, 189, 248, .40);

    background: #0b2330;

    box-shadow:
        0 0 0 3px rgba(56, 189, 248, .035);
}

.ai-quick-collect-field input.invalid,
.ai-quick-collect textarea.invalid {
    border-color:
        rgba(248, 113, 113, .32);

    background:
        rgba(89, 25, 25, .18);
}

.ai-quick-collect-actions {
    display: flex;
    align-items: center;

    justify-content: flex-end;

    gap: 7px;

    margin-top: 14px;

    padding-top: 12px;

    border-top:
        1px solid rgba(255, 255, 255, .05);
}

.ai-quick-collect-cancel,
.ai-quick-collect-submit {
    min-height: 39px;

    padding: 0 12px;

    border-radius: 10px;

    font-family: inherit;

    font-size: .48rem;
    font-weight: 900;

    cursor: pointer;

    transition: .2s ease;
}

.ai-quick-collect-cancel {
    color: #69828d;

    border:
        1px solid rgba(255, 255, 255, .06);

    background:
        rgba(255, 255, 255, .018);
}

.ai-quick-collect-submit {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    color: #041820;

    border: 0;

    background:
        linear-gradient(
            135deg,
            #b9efff,
            #38bdf8
        );

    box-shadow:
        0 10px 28px rgba(56, 189, 248, .10);
}

/* =========================================================
   THINKING PANEL
========================================================= */

.ai-chat-panel.is-thinking .ai-chat-avatar {
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, .06),
        0 0 32px rgba(56, 189, 248, .08);
}

.ai-chat-panel.is-thinking .ai-robot-avatar i {
    animation:
        robotPulse 1.2s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%, 100% {
        opacity: .35;

        transform:
            scale(.8);
    }

    50% {
        opacity: 1;

        transform:
            scale(1.25);
    }
}

@keyframes robotPulse {
    0%, 100% {
        transform:
            scale(1);

        opacity: .7;
    }

    50% {
        transform:
            scale(1.12);

        opacity: 1;
    }
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes aiMessageIn {
    from {
        opacity: 0;

        transform:
            translateY(6px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes aiWelcomeIn {
    from {
        opacity: 0;

        transform:
            translateY(8px)
            scale(.99);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

/* =========================================================
   LIGHT THEME
========================================================= */

body.light-theme .ai-chat-launcher {
    color: #1c4352 !important;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, .98),
            rgba(235, 246, 250, .98)
        ) !important;

    border-color:
        rgba(14, 165, 233, .20) !important;

    box-shadow:
        0 16px 45px rgba(25, 63, 79, .14),
        0 0 35px rgba(14, 165, 233, .06),
        inset 0 1px 0 rgba(255, 255, 255, .95) !important;
}

body.light-theme .ai-launcher-spark,
body.light-theme .ai-launcher-text small {
    color: #0b92cb !important;
}

body.light-theme .ai-launcher-text strong {
    color: #183c4b !important;
}

body.light-theme .ai-chat-panel {
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .995),
            rgba(241, 248, 251, .995)
        ) !important;

    border-color:
        rgba(15, 49, 66, .11) !important;

    box-shadow:
        0 45px 120px rgba(27, 63, 79, .19),
        0 0 70px rgba(14, 165, 233, .055),
        inset 0 1px 0 rgba(255, 255, 255, .95) !important;
}

body.light-theme .ai-consent-overlay {
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(14, 165, 233, .08),
            transparent 40%
        ),
        rgba(239, 248, 251, .88);
}

body.light-theme .ai-consent-card,
body.light-theme .ai-quick-collect-card {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f1f8fa
        );

    border-color:
        rgba(14, 165, 233, .16);

    box-shadow:
        0 35px 90px rgba(27, 63, 79, .16);
}

body.light-theme .ai-consent-card h2,
body.light-theme .ai-quick-collect-header strong {
    color: #173846;
}

body.light-theme .ai-consent-card p,
body.light-theme .ai-quick-collect-header span {
    color: #667f8b;
}

body.light-theme .ai-chat-header {
    border-bottom-color:
        rgba(15, 49, 66, .08);

    background:
        rgba(255, 255, 255, .72);
}

body.light-theme .ai-chat-title strong {
    color: #183c4b;
}

body.light-theme .ai-chat-title > span {
    color: #708792;
}

body.light-theme .ai-model-button {
    color: #294956;

    background:
        rgba(255, 255, 255, .78);

    border-color:
        rgba(15, 49, 66, .09);
}

body.light-theme .ai-model-button strong {
    color: #294956;
}

body.light-theme .ai-model-button small {
    color: #78909b;
}

body.light-theme .ai-model-menu {
    background:
        rgba(255, 255, 255, .99);

    border-color:
        rgba(15, 49, 66, .10);

    box-shadow:
        0 22px 55px rgba(27, 63, 79, .16);
}

body.light-theme .ai-model-option {
    color: #5a7480;
}

body.light-theme .ai-model-option:hover,
body.light-theme .ai-model-option.active {
    color: #173b4a;

    background:
        rgba(14, 165, 233, .055);

    border-color:
        rgba(14, 165, 233, .15);
}

body.light-theme .ai-message-bubble {
    color: #37535f;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .96),
            rgba(245, 250, 252, .92)
        );

    border-color:
        rgba(15, 49, 66, .08);
}

body.light-theme .ai-message-bubble h3,
body.light-theme .ai-message-bubble h4,
body.light-theme .ai-message-bubble strong {
    color: #1f4150;
}

body.light-theme .ai-message-bubble a {
    color: #0b87bc;
}

body.light-theme .ai-message.user .ai-message-bubble {
    color: #234754;

    background:
        linear-gradient(
            145deg,
            rgba(14, 165, 233, .10),
            rgba(14, 165, 233, .045)
        );

    border-color:
        rgba(14, 165, 233, .13);
}

body.light-theme .ai-message-meta {
    color: #78909a;
}

body.light-theme .ai-message-action,
body.light-theme .ai-reply-preview-close {
    color: #5e7985;

    background:
        rgba(255, 255, 255, .62);

    border-color:
        rgba(15, 49, 66, .08);
}

body.light-theme .ai-welcome-card,
body.light-theme .ai-quick-action,
body.light-theme .ai-service-draft,
body.light-theme .ai-holiday-media {
    background:
        linear-gradient(
            145deg,
            rgba(14, 165, 233, .055),
            rgba(255, 255, 255, .83)
        );

    border-color:
        rgba(14, 165, 233, .11);
}

body.light-theme .ai-welcome-brand strong,
body.light-theme .ai-welcome-card h3,
body.light-theme .ai-quick-action-copy strong,
body.light-theme .ai-service-draft-header strong,
body.light-theme .ai-history-item-title {
    color: #1b3d4b;
}

body.light-theme .ai-welcome-brand span,
body.light-theme .ai-welcome-card p,
body.light-theme .ai-quick-action-copy small,
body.light-theme .ai-service-draft-header small,
body.light-theme .ai-service-draft-item strong,
body.light-theme .ai-service-draft-message p {
    color: #708791;
}

body.light-theme .ai-quick-prompt,
body.light-theme .ai-followup {
    color: #5c7782;

    background:
        rgba(255, 255, 255, .70);

    border-color:
        rgba(15, 49, 66, .08);
}

body.light-theme .ai-chat-form {
    border-top-color:
        rgba(15, 49, 66, .07);

    background:
        rgba(255, 255, 255, .55);
}

body.light-theme .ai-chat-input-shell {
    background:
        rgba(255, 255, 255, .86);

    border-color:
        rgba(15, 49, 66, .10);
}

body.light-theme .ai-chat-input-shell textarea {
    color: #294a57;
}

body.light-theme .ai-chat-input-shell textarea::placeholder {
    color: #8398a1;
}

body.light-theme .ai-quick-collect {
    background:
        rgba(229, 242, 247, .76);
}

body.light-theme .ai-quick-collect-field input,
body.light-theme .ai-quick-collect textarea {
    color: #294a57;

    background: #f9fcfd;

    border-color:
        rgba(15, 49, 66, .11);
}

body.light-theme .ai-history-item {
    border-color:
        rgba(15, 49, 66, .1);

    background:
        rgba(233, 246, 250, .6);
}

body.light-theme .ai-history-item:hover {
    border-color:
        rgba(14, 165, 233, .35);

    background:
        rgba(14, 165, 233, .08);
}

body.light-theme .ai-history-item.active {
    border-color:
        rgba(14, 165, 233, .5);

    background:
        rgba(14, 165, 233, .12);
}

body.light-theme .ai-history-head h3 {
    color: #183c4b;
}

body.light-theme .ai-history-item-preview,
body.light-theme .ai-history-empty {
    color:
        rgba(28, 67, 82, .6);
}

body.light-theme .ai-history-item-date {
    color:
        rgba(28, 67, 82, .4);
}

body.light-theme .ai-history-new {
    color: #0b6a94;

    background:
        rgba(14, 165, 233, .1);

    border-color:
        rgba(14, 165, 233, .3);
}

body.light-theme .ai-history-item-delete {
    border-color:
        rgba(15, 49, 66, .08);
}

body.light-theme .ai-chat-toast {
    color: #224957;

    background:
        rgba(255, 255, 255, .97);

    border-color:
        rgba(14, 165, 233, .17);

    box-shadow:
        0 20px 55px rgba(27, 63, 79, .16);
}

body.light-theme .ai-disclaimer-summary strong {
    color: #284d5d;
}

body.light-theme .ai-disclaimer-summary small,
body.light-theme .ai-disclaimer-details p {
    color: #6e8792;
}

body.light-theme .ai-chat-form-footer {
    color: #79919b;
}

body.light-theme .ai-service-draft-item,
body.light-theme .ai-service-draft-message {
    background:
        rgba(255, 255, 255, .52);

    border-color:
        rgba(15, 49, 66, .07);
}

/* =========================================================
   DESKTOP
========================================================= */

@media (min-width: 701px) {

    .ai-chat-panel {
        width:
            min(
                520px,
                100vw
            ) !important;

        height:
            100dvh !important;

        max-height:
            100dvh !important;

        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;

        border-radius: 0 !important;

        border-top: none !important;
        border-bottom: none !important;
        border-right: none !important;

        border-left:
            1px solid rgba(56, 189, 248, .18) !important;

        transform-origin:
            right center !important;

        transform:
            translateX(28px) !important;

        box-shadow:
            -22px 0 70px rgba(0, 0, 0, .5) !important;
    }

    .ai-chat-panel.open {
        transform:
            translateX(0) !important;
    }

    .ai-chat-header {
        min-height:
            92px !important;

        padding:
            15px 16px !important;
    }

    .ai-chat-avatar {
        width: 54px !important;
        height: 54px !important;

        flex-basis: 54px !important;

        border-radius: 17px !important;
    }

    .ai-avatar-robot {
        font-size: 1.15rem !important;
    }

    .ai-chat-title strong {
        font-size: .96rem !important;
    }

    .ai-chat-title > span {
        max-width: 220px !important;

        font-size: .57rem !important;
    }

    .ai-model-button {
        width: 100px !important;
        height: 40px !important;
    }

    .ai-chat-icon-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .ai-chat-status-bar {
        min-height: 34px !important;

        padding: 0 17px !important;

        font-size: .48rem !important;
    }

    .ai-chat-messages {
        padding:
            22px 22px 16px !important;

        gap:
            16px !important;
    }

    .ai-message {
        gap:
            10px !important;
    }

    .ai-message-avatar {
        width: 36px !important;
        height: 36px !important;

        flex-basis: 36px !important;
    }

    .ai-message-content {
        max-width:
            calc(
                100% - 48px
            ) !important;
    }

    .ai-message-bubble {
        padding:
            14px 16px !important;

        border-radius:
            18px !important;

        font-size: .84rem !important;

        line-height: 1.9 !important;
    }

    .ai-message-bubble h3 {
        font-size: .96rem !important;
    }

    .ai-message-bubble h4 {
        font-size: .89rem !important;
    }

    .ai-welcome-card {
        padding:
            20px !important;

        border-radius:
            21px !important;
    }

    .ai-chat-disclaimer {
        margin-top:
            12px !important;

        border-radius:
            15px !important;
    }

    .ai-disclaimer-toggle {
        min-height:
            62px !important;

        padding:
            12px 14px !important;
    }

    .ai-disclaimer-icon {
        width:
            36px !important;

        height:
            36px !important;

        flex-basis:
            36px !important;

        font-size:
            .76rem !important;
    }

    .ai-disclaimer-summary strong {
        font-size:
            .78rem !important;
    }

    .ai-disclaimer-summary small {
        font-size:
            .68rem !important;
    }

    .ai-disclaimer-details {
        padding:
            2px 15px 16px !important;

        gap:
            9px !important;
    }

    .ai-disclaimer-details p {
        font-size:
            .73rem !important;

        line-height:
            1.9 !important;
    }

    .ai-disclaimer-link {
        font-size:
            .70rem !important;
    }

    .ai-quick-action {
        min-height:
            58px !important;
    }

    .ai-service-draft {
        padding:
            11px !important;
    }

    .ai-holiday-media-image {
        max-height:
            430px;
    }

    .ai-chat-form {
        padding:
            11px 14px 13px !important;
    }

    .ai-chat-input-shell {
        min-height:
            60px !important;

        padding:
            8px !important;

        border-radius:
            17px !important;
    }

    .ai-voice-button {
        width:
            43px !important;

        height:
            43px !important;

        flex-basis:
            43px !important;
    }

    .ai-chat-input-shell textarea {
        min-height:
            40px !important;

        font-size:
            .78rem !important;
    }

    .ai-chat-input-shell > button:last-child {
        width:
            43px !important;

        height:
            43px !important;

        flex-basis:
            43px !important;
    }

    .ai-chat-launcher {
        min-width:
            122px !important;

        height:
            52px !important;
    }

    .ai-chat-launcher[aria-expanded="true"] {
        width:
            52px !important;

        min-width:
            52px !important;

        height:
            52px !important;
    }

    .ai-model-button strong {
        font-size:
            .60rem !important;
    }

    .ai-model-button small {
        font-size:
            .46rem !important;
    }

    #aiStatusLatency {
        font-size:
            .50rem !important;
    }

    .ai-message-meta {
        font-size:
            .53rem !important;
    }

    .ai-welcome-brand strong {
        font-size:
            .76rem !important;
    }

    .ai-welcome-brand span {
        font-size:
            .53rem !important;
    }

    .ai-welcome-card h3 {
        font-size:
            1.08rem !important;
    }

    .ai-welcome-card p {
        font-size:
            .76rem !important;

        line-height:
            1.85 !important;
    }

    .ai-welcome-question {
        font-size:
            .66rem !important;
    }

    .ai-quick-prompt {
        min-height:
            40px !important;

        font-size:
            .56rem !important;
    }

    .ai-quick-action-copy strong {
        font-size:
            .58rem !important;
    }

    .ai-quick-action-copy small {
        font-size:
            .49rem !important;
    }

    .ai-followup {
        min-height:
            32px !important;

        font-size:
            .56rem !important;
    }

    .ai-followups-title {
        font-size:
            .53rem !important;
    }

    .ai-holiday-media-caption {
        min-height:
            38px !important;

        padding:
            8px 10px !important;

        font-size:
            .53rem !important;
    }

    .ai-service-draft-header strong {
        font-size:
            .56rem !important;
    }

    .ai-service-draft-header small {
        font-size:
            .44rem !important;
    }

    .ai-service-draft-item span,
    .ai-service-draft-message > span {
        font-size:
            .40rem !important;
    }

    .ai-service-draft-item strong,
    .ai-service-draft-message p {
        font-size:
            .49rem !important;
    }

    .ai-service-draft-status {
        font-size:
            .43rem !important;
    }

    .ai-chat-form-footer {
        font-size:
            .53rem !important;
    }

    .ai-chat-toast {
        font-size:
            .68rem !important;
    }

    .ai-live-badge {
        height:
            20px !important;

        font-size:
            .48rem !important;
    }

    .ai-history-panel {
        padding:
            20px 22px 22px !important;
    }

    .ai-history-head h3 {
        font-size:
            .92rem !important;
    }

    .ai-history-item-title {
        font-size:
            .79rem !important;
    }

    .ai-history-item-preview {
        font-size:
            .66rem !important;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .ai-chat-launcher {
        right:
            15px !important;

        bottom:
            15px !important;

        min-width:
            92px !important;

        width:
            92px !important;

        height:
            43px !important;

        padding:
            0 9px !important;

        border-radius:
            13px !important;
    }

    .ai-chat-launcher[aria-expanded="true"] {
        width:
            43px !important;

        min-width:
            43px !important;

        height:
            43px !important;
    }

    .ai-chat-panel {
        right:
            12px !important;

        left:
            auto !important;

        bottom:
            67px !important;

        width:
            calc(100vw - 24px) !important;

        max-width:
            410px !important;

        margin-inline:
            0 !important;

        height:
            min(
                580px,
                calc(100dvh - 92px)
            ) !important;

        max-height:
            calc(100dvh - 92px) !important;

        border-radius:
            24px !important;

        box-shadow:
            0 20px 60px rgba(0, 0, 0, .45) !important;
    }

    .ai-chat-header {
        min-height:
            68px !important;

        padding:
            8px 9px !important;

        gap:
            6px !important;
    }

    .ai-chat-avatar {
        width:
            39px !important;

        height:
            39px !important;

        flex-basis:
            39px !important;
    }

    .ai-chat-title strong {
        font-size:
            .72rem !important;
    }

    .ai-chat-title > span {
        max-width:
            115px !important;

        font-size:
            .42rem !important;
    }

    .ai-live-badge {
        display:
            none !important;
    }

    .ai-model-button {
        width:
            67px !important;

        height:
            32px !important;
    }

    .ai-model-menu {
        width:
            148px !important;

        max-width:
            148px !important;
    }

    .ai-chat-icon-btn {
        width:
            29px !important;

        height:
            29px !important;
    }

    .ai-chat-messages {
        padding:
            11px 10px 8px !important;

        gap:
            8px !important;
    }

    .ai-message {
        gap:
            5px !important;
    }

    .ai-message-avatar {
        width:
            24px !important;

        height:
            24px !important;

        flex-basis:
            24px !important;
    }

    .ai-message-bubble {
        padding:
            8px 9px !important;

        border-radius:
            12px !important;

        font-size:
            .61rem !important;

        line-height:
            1.7 !important;
    }

    .ai-message-actions {
        opacity:
            .82 !important;
    }

    .ai-message-action {
        width:
            26px !important;

        height:
            24px !important;
    }

    .ai-quick-prompts,
    .ai-quick-actions {
        grid-template-columns:
            1fr !important;
    }

    .ai-quick-action {
        min-height:
            49px !important;
    }

    .ai-quick-action-copy strong {
        font-size:
            .52rem !important;
    }

    .ai-quick-action-copy small {
        font-size:
            .42rem !important;
    }

    .ai-followups {
        gap:
            4px !important;
    }

    .ai-followup {
        max-width:
            100% !important;
    }

    .ai-service-draft-grid {
        grid-template-columns:
            1fr 1fr !important;
    }

    .ai-service-draft-actions {
        grid-template-columns:
            1fr !important;
    }

    .ai-service-draft-send,
    .ai-service-draft-edit {
        width:
            100% !important;
    }

    .ai-holiday-media-image {
        max-height:
            250px !important;
    }

    .ai-holiday-media-caption {
        font-size:
            .43rem !important;
    }

    .ai-chat-disclaimer {
        margin-top:
            8px !important;
    }

    .ai-chat-form {
        padding:
            7px 9px 9px !important;
    }

    .ai-chat-input-shell {
        min-height:
            46px !important;

        padding:
            5px !important;
    }

    .ai-chat-input-shell textarea {
        min-height:
            31px !important;

        max-height:
            95px !important;

        font-size:
            .61rem !important;
    }

    .ai-chat-input-shell > button:last-child,
    .ai-voice-button {
        width:
            34px !important;

        height:
            34px !important;

        flex-basis:
            34px !important;
    }

    .ai-chat-form-footer span:last-child {
        display:
            none;
    }

    .ai-chat-toast {
        right:
            14px !important;

        left:
            14px !important;

        bottom:
            70px !important;

        justify-content:
            center;

        max-width:
            none !important;

        text-align:
            center;
    }

    .ai-history-panel {
        padding:
            12px 10px 12px !important;
    }

    .ai-history-head {
        gap:
            6px !important;
    }

    .ai-history-head h3 {
        font-size:
            .72rem !important;
    }

    .ai-history-new {
        padding:
            6px 9px !important;

        font-size:
            .55rem !important;
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .ai-chat-panel {
        right:
            10px !important;

        bottom:
            60px !important;

        width:
            calc(100vw - 20px) !important;

        height:
            min(
                600px,
                calc(100dvh - 78px)
            ) !important;

        border-radius:
            19px !important;
    }

    .ai-chat-title > span {
        max-width:
            95px !important;
    }

    .ai-model-button {
        width:
            61px !important;
    }

    .ai-model-menu {
        width:
            140px !important;

        max-width:
            140px !important;
    }

    .ai-service-draft-grid {
        grid-template-columns:
            1fr !important;
    }

    .ai-holiday-media-image {
        max-height:
            205px !important;
    }

    .ai-welcome-card {
        padding:
            13px !important;
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .ai-chat-launcher,
    .ai-chat-panel,
    .ai-message,
    .ai-model-menu,
    .ai-followup,
    .ai-chat-toast,
    .ai-consent-overlay,
    .ai-quick-prompt,
    .ai-message-action,
    .ai-reply-preview,
    .ai-quick-action,
    .ai-quick-collect,
    .ai-quick-collect-card,
    .ai-service-draft,
    .ai-holiday-media,
    .ai-welcome-card {
        animation:
            none !important;

        transition:
            none !important;
    }

    .ai-launcher-orbit,
    .ai-launcher-orbit-2,
    .ai-avatar-ring,
    .ai-message-action.speaking i,
    .ai-typing i,
    .ai-chat-panel.is-thinking .ai-status-light {
        animation:
            none !important;
    }

    .ai-chat-messages {
        scroll-behavior:
            auto !important;
    }
}