.assistant-shell {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.assistant-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #f3b176 0%, #ea8a5b 100%);
    color: #23150e;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    font-weight: 700;
}

.assistant-panel {
    width: min(34rem, calc(100vw - 1.5rem));
    max-height: min(48rem, calc(100vh - 4.5rem));
    max-height: min(48rem, calc(100dvh - 4.5rem));
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem;
    border-radius: 1.4rem;
    background: linear-gradient(180deg, rgba(12, 16, 22, 0.98) 0%, rgba(17, 22, 29, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(16px);
}

.assistant-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.assistant-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f3b176;
    margin-bottom: 0.25rem;
}

.assistant-title {
    font-size: 1rem;
    margin: 0;
    color: #f6f8fc;
}

.assistant-close {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #d8e0ef;
}

.assistant-thread {
    flex: 1 1 auto;
    min-height: 20rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-right: 0.2rem;
}

.assistant-card {
    border-radius: 1rem;
    padding: 0.75rem 0.85rem;
    max-width: 100%;
}

.assistant-card-question {
    align-self: flex-end;
    max-width: 76%;
    background: rgba(243, 177, 118, 0.18);
    border: 1px solid rgba(243, 177, 118, 0.28);
    color: #fff4eb;
}

.assistant-card-response {
    max-width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e8eef9;
}

.assistant-card-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
    opacity: 0.9;
}

.assistant-card-question .assistant-card-label {
    color: #ffd8b8;
}

.assistant-card-response .assistant-card-label {
    color: #9eb2cf;
}

.assistant-card-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.assistant-card-text {
    margin: 0;
    line-height: 1.4;
    color: inherit;
}

.assistant-card-list {
    margin: 0.55rem 0 0;
    padding-left: 1.1rem;
}

.assistant-card-list li + li {
    margin-top: 0.3rem;
}

.assistant-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.assistant-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(243, 177, 118, 0.16);
    color: #ffd8b8;
    text-decoration: none;
    font-size: 0.92rem;
}

.assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.assistant-chip {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #dbe4f4;
    padding: 0.35rem 0.62rem;
    font-size: 0.8rem;
}

.assistant-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
}

.assistant-consent {
    padding: 0.8rem 0.9rem;
    border-radius: 1rem;
    background: rgba(243, 177, 118, 0.12);
    border: 1px solid rgba(243, 177, 118, 0.2);
    color: #f6e6d7;
}

.assistant-consent-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.assistant-consent-text {
    margin: 0 0 0.65rem;
    line-height: 1.45;
}

.assistant-consent-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.94rem;
    line-height: 1.45;
}

.assistant-consent-check input {
    margin-top: 0.2rem;
}

.assistant-consent-check a {
    color: #ffd8b8;
}

.assistant-consent-button {
    margin-top: 0.75rem;
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 0.9rem;
    background: #f3b176;
    color: #23150e;
    font-weight: 700;
}

.assistant-consent-button:disabled {
    opacity: 0.55;
}

.assistant-input {
    width: 100%;
    resize: none;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #f6f8fc;
    padding: 0.7rem 0.8rem;
}

.assistant-submit {
    align-self: end;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 0.88rem;
    background: #f3b176;
    color: #23150e;
    font-weight: 700;
}

.assistant-loading {
    opacity: 0.75;
}

.assistant-typing {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
}

.assistant-typing-text {
    display: inline-block;
    min-width: 1.2em;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: currentColor;
    animation: assistant-typing-ellipsis 1.15s infinite steps(4, end);
}

@keyframes assistant-typing-ellipsis {
    0%,
    24% {
        clip-path: inset(0 100% 0 0);
        opacity: 0.35;
    }

    25%,
    49% {
        clip-path: inset(0 66% 0 0);
        opacity: 0.6;
    }

    50%,
    74% {
        clip-path: inset(0 33% 0 0);
        opacity: 0.82;
    }

    75%,
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

html[data-theme="light"] .assistant-panel {
    background: linear-gradient(180deg, rgba(252, 254, 255, 0.98) 0%, rgba(241, 247, 255, 0.98) 100%);
    border-color: #d4dfeb;
    box-shadow: 0 22px 56px rgba(24, 48, 73, 0.18);
}

html[data-theme="light"] .assistant-title,
html[data-theme="light"] .assistant-card-response,
html[data-theme="light"] .assistant-input,
html[data-theme="light"] .assistant-chip,
html[data-theme="light"] .assistant-close {
    color: #17324b;
}

html[data-theme="light"] .assistant-consent {
    background: rgba(243, 177, 118, 0.18);
    border-color: rgba(234, 138, 91, 0.22);
    color: #5a341c;
}

html[data-theme="light"] .assistant-consent-check a {
    color: #8f4e1c;
}

html[data-theme="light"] .assistant-card-response,
html[data-theme="light"] .assistant-input,
html[data-theme="light"] .assistant-chip,
html[data-theme="light"] .assistant-close {
    background: rgba(255, 255, 255, 0.82);
    border-color: #d4dfeb;
}

html[data-theme="light"] .assistant-card-question {
    background: rgba(243, 177, 118, 0.28);
    border-color: rgba(192, 114, 57, 0.24);
    color: #5b2f12;
}

html[data-theme="light"] .assistant-card-question .assistant-card-label {
    color: #8f4f20;
}

html[data-theme="light"] .assistant-card-response .assistant-card-label {
    color: #59728d;
}

html[data-theme="light"] .assistant-link {
    color: #8f4f20;
    background: rgba(243, 177, 118, 0.22);
}

@media (max-width: 767.98px) {
    .assistant-shell {
        right: 0.75rem;
        left: 0.75rem;
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        align-items: stretch;
    }

    .assistant-panel {
        width: 100%;
        max-height: calc(100vh - 5rem - env(safe-area-inset-bottom));
        max-height: calc(100dvh - 5rem - env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .assistant-thread {
        min-height: 0;
    }

    .assistant-toggle {
        align-self: flex-end;
    }
}
