/**
 * LIMATS Ask Me - in-page AI chat UI
 */

.ms-ask-page {
    background: var(--limats-bg);
}

/* Ask Me page header */
.ms-ask-intro {
    position: relative;
    overflow: hidden;
    padding-top: 3.5rem;
    padding-bottom: 2.5rem;
    background:
        radial-gradient(ellipse 70% 80% at 0% 0%, rgba(239, 163, 73, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 60% 60% at 100% 100%, rgba(214, 125, 19, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, var(--limats-primary-light) 0%, var(--limats-secondary) 100%);
    border-bottom: 1px solid rgba(214, 125, 19, 0.15);
}

.ms-ask-intro__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(214, 125, 19, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(214, 125, 19, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 90%);
}

.ms-ask-header {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.5rem;
    align-items: center;
}

.ms-ask-header__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--limats-primary-dark);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(214, 125, 19, 0.28);
}

.ms-ask-header__pill i {
    font-size: 0.8rem;
    color: var(--limats-primary);
}

.ms-ask-header__title {
    font-family: var(--limats-font-title);
    font-size: clamp(2.1rem, 4.5vw, 3rem);
    font-weight: 700;
    line-height: 1.12;
    margin-bottom: 1rem;
    color: var(--limats-text);
}

.ms-ask-header__lead {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--limats-text-secondary);
    max-width: 520px;
    margin-bottom: 1.35rem;
}

.ms-ask-header__features {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.ms-ask-header__features li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--limats-text);
    background: #fff;
    border: 1px solid rgba(214, 125, 19, 0.2);
    box-shadow: 0 4px 14px rgba(214, 125, 19, 0.08);
}

.ms-ask-header__features i {
    color: var(--limats-primary-dark);
    font-size: 0.78rem;
}

.ms-ask-header__cta {
    box-shadow: 0 8px 24px rgba(214, 125, 19, 0.25);
}

.ms-ask-header__visual {
    position: relative;
}

.ms-ask-header__media {
    position: relative;
    border-radius: calc(var(--limats-radius) + 6px);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    box-shadow:
        0 24px 56px rgba(214, 125, 19, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(239, 163, 73, 0.3);
}

.ms-ask-header__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ms-ask-header__media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(239, 163, 73, 0.15) 0%, transparent 50%, rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
}

.ms-ask-header__media-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--limats-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(214, 125, 19, 0.35);
}

.ms-ask-header__float-card {
    position: absolute;
    left: 1.25rem;
    bottom: -1.25rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    background: #fff;
    border: 1px solid rgba(214, 125, 19, 0.22);
    border-radius: calc(var(--limats-radius) + 2px);
    box-shadow: 0 16px 40px rgba(214, 125, 19, 0.15);
    min-width: 220px;
}

.ms-ask-header__float-logo {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    background: var(--limats-primary-light);
    padding: 0.25rem;
}

.ms-ask-header__float-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ms-ask-header__float-card strong {
    display: block;
    font-family: var(--limats-font-title);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--limats-text);
    margin-bottom: 0.15rem;
}

.ms-ask-header__float-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--limats-text-secondary);
}

.ms-ask-header__float-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6ee7a0;
    box-shadow: 0 0 0 3px rgba(110, 231, 160, 0.3);
}

.ms-ask-section {
    padding-top: 0;
    padding-bottom: 4rem;
}

.ms-ask-layout {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.ms-ask-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 6.5rem;
}

.ms-ask-sidebar__card {
    padding: 1.35rem;
    background: #fff;
    border: 1px solid var(--limats-border);
    border-radius: calc(var(--limats-radius) + 2px);
    box-shadow: 0 8px 28px rgba(214, 125, 19, 0.06);
}

.ms-ask-sidebar__card h2,
.ms-ask-sidebar__card h3 {
    font-family: var(--limats-font-title);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ms-ask-sidebar__card > p {
    font-size: 0.88rem;
    color: var(--limats-text-secondary);
    margin-bottom: 1rem;
}

.ms-ask-suggestions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.ms-ask-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--limats-border);
    border-radius: var(--limats-radius);
    background: var(--limats-primary-light);
    color: var(--limats-text);
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.ms-ask-suggestion i {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--limats-primary-dark);
    font-size: 0.75rem;
}

.ms-ask-suggestion:hover {
    border-color: rgba(214, 125, 19, 0.45);
    background: #fff;
    transform: translateX(3px);
}

.ms-ask-sidebar__card--tips {
    background: linear-gradient(180deg, rgba(255, 245, 233, 0.55) 0%, #fff 72%);
    border-color: rgba(214, 125, 19, 0.18);
}

.ms-ask-tips__title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.85rem !important;
}

.ms-ask-tips__title-icon {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--limats-primary-dark) 0%, var(--limats-primary) 100%);
    color: #fff;
    font-size: 0.82rem;
}

.ms-ask-tips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.ms-ask-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--limats-radius);
    background: #fff;
    border: 1px solid rgba(214, 125, 19, 0.14);
    box-shadow: 0 4px 14px rgba(214, 125, 19, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ms-ask-tip:hover {
    border-color: rgba(214, 125, 19, 0.32);
    box-shadow: 0 6px 18px rgba(214, 125, 19, 0.1);
    transform: translateX(2px);
}

.ms-ask-tip__icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.45rem;
    background: var(--limats-primary-light);
    color: var(--limats-primary-dark);
    font-size: 0.78rem;
}

.ms-ask-tip__text {
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--limats-text-secondary);
    padding-top: 0.1rem;
}

/* Chat panel */
.ms-ai-chat {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 620px;
    max-height: calc(100vh - 12rem);
    background: #fff;
    border: 1px solid rgba(214, 125, 19, 0.22);
    border-radius: calc(var(--limats-radius) + 6px);
    box-shadow:
        0 24px 56px rgba(214, 125, 19, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-radius 0.3s ease;
}

.ms-ai-chat__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--limats-primary-dark) 0%, var(--limats-primary) 100%);
    color: #fff;
    flex-shrink: 0;
}

.ms-ai-chat__brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.ms-ai-chat__brand-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: #fff;
    padding: 0.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ms-ai-chat__brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ms-ai-chat__title {
    font-family: var(--limats-font-title);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: #fff;
}

.ms-ai-chat__status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.ms-ai-chat__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6ee7a0;
    box-shadow: 0 0 0 3px rgba(110, 231, 160, 0.35);
}

.ms-ai-chat__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.ms-ai-chat__action {
    width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ms-ai-chat__action:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
}

.ms-ai-chat__action--danger:hover {
    background: rgba(255, 81, 92, 0.35);
    border-color: rgba(255, 81, 92, 0.55);
}

.ms-ai-chat__action-divider {
    width: 1px;
    height: 1.25rem;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 0.15rem;
}

.ms-ai-chat__restore {
    display: none;
}

.ms-ai-chat.is-maximized .ms-ai-chat__restore,
.ms-ai-chat.is-minimized .ms-ai-chat__restore {
    display: inline-flex;
}

.ms-ai-chat.is-maximized .js-ai-chat-maximize,
.ms-ai-chat.is-minimized .js-ai-chat-minimize {
    display: none;
}

.ms-ai-chat__body {
    flex: 1;
    min-height: 0;
    background:
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(239, 163, 73, 0.06) 0%, transparent 55%),
        linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.ms-ai-chat__messages {
    height: 100%;
    min-height: 380px;
    max-height: 52vh;
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    scroll-behavior: smooth;
}

.ms-ai-chat.is-maximized .ms-ai-chat__messages {
    max-height: none;
    flex: 1;
}

.ms-ai-chat__message {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    max-width: 88%;
}

.ms-ai-chat__message--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ms-ai-chat__message--assistant {
    align-self: flex-start;
}

.ms-ai-chat__avatar {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
}

.ms-ai-chat__message--assistant .ms-ai-chat__avatar {
    background: #fff;
    border: 1px solid rgba(214, 125, 19, 0.2);
    overflow: hidden;
    padding: 0.15rem;
}

.ms-ai-chat__avatar-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ms-ai-chat__message--user .ms-ai-chat__avatar {
    background: var(--limats-secondary);
    color: var(--limats-text);
}

.ms-ai-chat__bubble {
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    position: relative;
}

.ms-ai-chat__message--assistant .ms-ai-chat__bubble {
    background: #fff;
    border: 1px solid var(--limats-border);
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.ms-ai-chat__message--user .ms-ai-chat__bubble {
    background: linear-gradient(135deg, var(--limats-primary-dark) 0%, var(--limats-primary) 100%);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
    box-shadow: 0 4px 16px rgba(214, 125, 19, 0.25);
}

.ms-ai-chat__sender {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    opacity: 0.75;
}

.ms-ai-chat__bubble p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
}

.ms-ai-chat__message--user .ms-ai-chat__bubble p {
    color: #fff;
}

.ms-ai-chat__message--user .ms-ai-chat__sender {
    display: none;
}

.ms-ai-chat__time {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.68rem;
    opacity: 0.6;
}

.ms-ai-chat__bubble--typing {
    padding: 1rem 1.25rem;
}

.ms-ai-chat__typing-dots {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
}

.ms-ai-chat__typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--limats-primary);
    animation: ms-ai-typing 1.2s ease-in-out infinite;
}

.ms-ai-chat__typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.ms-ai-chat__typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes ms-ai-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.ms-ai-chat__composer {
    flex-shrink: 0;
    padding: 1rem 1.25rem 1.15rem;
    border-top: 1px solid var(--limats-border);
    background: #fff;
}

.ms-ai-chat__attachments {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ms-ai-chat__attachments.is-visible {
    display: flex;
}

.ms-ai-chat__file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--limats-primary-light);
    border: 1px solid rgba(214, 125, 19, 0.25);
    font-size: 0.78rem;
    color: var(--limats-primary-dark);
    max-width: 200px;
}

.ms-ai-chat__file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-ai-chat__file-remove {
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: var(--limats-text-secondary);
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0;
}

.ms-ai-chat__file-remove:hover {
    background: var(--limats-error);
    color: #fff;
}

.ms-ai-chat__input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    padding: 0.45rem;
    border: 1px solid var(--limats-border);
    border-radius: calc(var(--limats-radius) + 4px);
    background: #fafafa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ms-ai-chat__input-row:focus-within {
    border-color: rgba(214, 125, 19, 0.55);
    box-shadow: 0 0 0 3px rgba(239, 163, 73, 0.15);
    background: #fff;
}

.ms-ai-chat__attach,
.ms-ai-chat__send {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.55rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.ms-ai-chat__attach {
    background: transparent;
    color: var(--limats-text-secondary);
}

.ms-ai-chat__attach:hover {
    background: var(--limats-primary-light);
    color: var(--limats-primary-dark);
}

.ms-ai-chat__send {
    background: var(--limats-primary);
    color: #fff;
}

.ms-ai-chat__send:hover {
    background: var(--limats-primary-dark);
    transform: scale(1.04);
}

.ms-ai-chat__input {
    flex: 1;
    min-height: 2.35rem;
    max-height: 140px;
    border: none;
    background: transparent;
    resize: none;
    padding: 0.5rem 0.25rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--limats-text);
    outline: none;
}

.ms-ai-chat__input::placeholder {
    color: var(--limats-text-muted);
}

.ms-ai-chat--compact-composer .ms-ai-chat__input-stack {
    border: 1px solid var(--limats-border);
    border-radius: calc(var(--limats-radius) + 4px);
    background: #fafafa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ms-ai-chat--compact-composer .ms-ai-chat__input-stack:focus-within {
    border-color: rgba(214, 125, 19, 0.55);
    box-shadow: 0 0 0 3px rgba(239, 163, 73, 0.15);
    background: #fff;
}

.ms-ai-chat--compact-composer .ms-ai-chat__input-row {
    border: none;
    box-shadow: none;
    padding: 0.45rem 0.65rem 0.25rem;
    background: transparent;
}

.ms-ai-chat--compact-composer .ms-ai-chat__input-row:focus-within {
    border-color: transparent;
    box-shadow: none;
}

.ms-ai-chat--compact-composer .ms-ai-chat__input {
    width: 100%;
    height: 2.35rem;
    max-height: 2.35rem;
    overflow: hidden;
    padding: 0.45rem 0.15rem;
}

.ms-ai-chat--compact-composer .ms-ai-chat__input-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.45rem 0.35rem;
    border-top: 1px solid var(--limats-border);
}

.ms-ai-chat--compact-composer .ms-ai-chat__input-actions .ms-ai-chat__attach,
.ms-ai-chat--compact-composer .ms-ai-chat__input-actions .ms-ai-chat__send {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.45rem;
    font-size: 0.82rem;
}

.ms-ai-chat--compact-composer .ms-ai-chat__attach--danger:hover {
    background: rgba(255, 81, 92, 0.12);
    color: var(--limats-error);
}

.ms-ai-chat--compact-composer .ms-ai-chat__send {
    margin-left: auto;
}

.ms-ai-chat--compact-composer .ms-ai-chat__sender {
    display: none;
}

.ms-ai-chat__disclaimer {
    margin: 0.65rem 0 0;
    font-size: 0.72rem;
    color: var(--limats-text-muted);
    text-align: center;
}

/* Lightbox (maximized) */
.ms-ai-chat-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    pointer-events: none;
}

.ms-ai-chat-lightbox.is-open {
    display: flex;
    pointer-events: auto;
}

.ms-ai-chat-lightbox__backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    cursor: pointer;
    animation: ms-ai-lightbox-fade-in 0.28s ease;
}

.ms-ai-chat-lightbox__stage {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 3rem);
    animation: ms-ai-lightbox-rise-in 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.ms-ai-chat.is-maximized {
    width: 100%;
    max-height: calc(100vh - 3rem);
    min-height: min(680px, calc(100vh - 3rem));
    border-radius: calc(var(--limats-radius) + 10px);
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(239, 163, 73, 0.25);
}

.ms-ai-chat.is-maximized .ms-ai-chat__messages {
    max-height: none;
    flex: 1;
    min-height: 360px;
}

@keyframes ms-ai-lightbox-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ms-ai-lightbox-rise-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ms-ask-no-scroll {
    overflow: hidden;
}

.ms-ai-chat-host {
    min-width: 0;
}

/* Floating chat widget */
.ms-float-chat {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1050;
}

.ms-float-chat__launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--limats-primary-dark) 0%, var(--limats-primary) 100%);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow:
        0 12px 32px rgba(214, 125, 19, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, padding 0.2s ease;
}

.ms-float-chat__launcher:hover,
.ms-float-chat.is-open .ms-float-chat__launcher {
    padding: 0.65rem 1.1rem;
    transform: translateY(-2px);
    box-shadow:
        0 16px 40px rgba(214, 125, 19, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.14);
}

.ms-float-chat__launcher-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}

.ms-float-chat__launcher-icon img {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    display: block;
}

.ms-float-chat__launcher-icon--close {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.1rem;
}

.ms-float-chat.is-open .ms-float-chat__launcher-icon--open {
    display: none;
}

.ms-float-chat.is-open .ms-float-chat__launcher-icon--close {
    display: inline-flex;
}

.ms-float-chat__launcher-label {
    display: none;
    white-space: nowrap;
}

.ms-float-chat__launcher:hover .ms-float-chat__launcher-label,
.ms-float-chat.is-open .ms-float-chat__launcher-label {
    display: inline;
}

.ms-float-chat__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.85rem);
    width: min(400px, calc(100vw - 2rem));
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.ms-float-chat__panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ms-float-chat__host .ms-ai-chat {
    min-height: 520px;
    max-height: min(72vh, 640px);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(239, 163, 73, 0.2);
}

.ms-float-chat__host .ms-ai-chat__messages {
    max-height: none;
    min-height: 0;
    flex: 1;
    height: auto;
    padding-bottom: 2rem;
}

.ms-ai-chat--compact-composer .ms-ai-chat__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ms-ai-chat--compact-composer .ms-ai-chat__messages {
    max-height: none;
    min-height: 0;
    flex: 1;
    gap: 0;
}

.ms-ai-chat--compact-composer .ms-ai-chat__message {
    margin-bottom: 0.85rem;
}

.ms-ai-chat--compact-composer .ms-ai-chat__message:last-child {
    margin-bottom: 1rem;
}

.ms-float-chat-open {
    overflow: hidden;
}

.ms-ai-chat-storage {
    display: none !important;
}

@media (max-width: 575px) {
    .ms-float-chat {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .ms-float-chat__panel {
        width: calc(100vw - 1.5rem);
        right: 0;
    }
}

/* Minimized */
.ms-ai-chat.is-minimized {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    left: auto;
    width: min(380px, calc(100vw - 2rem));
    min-height: auto;
    max-height: none;
    z-index: 1055;
    border-radius: calc(var(--limats-radius) + 4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.ms-ai-chat.is-minimized .ms-ai-chat__body,
.ms-ai-chat.is-minimized .ms-ai-chat__composer {
    display: none;
}

.ms-ai-chat.is-minimized .ms-ai-chat__toolbar {
    cursor: pointer;
    padding: 0.85rem 1rem;
}

@media (max-width: 991px) {
    .ms-ask-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .ms-ask-header__visual {
        max-width: 560px;
        margin-inline: auto;
    }

    .ms-ask-header__float-card {
        left: 1rem;
        bottom: -1rem;
    }

    .ms-ask-intro {
        padding-bottom: 3.5rem;
    }

    .ms-ask-layout {
        grid-template-columns: 1fr;
    }

    .ms-ask-sidebar {
        position: static;
        order: 2;
    }

    .ms-ai-chat {
        order: 1;
    }

    .ms-ai-chat__messages {
        max-height: 45vh;
    }
}

@media (max-width: 575px) {
    .ms-ai-chat__toolbar {
        flex-wrap: wrap;
        padding: 0.85rem 1rem;
    }

    .ms-ai-chat__message {
        max-width: 95%;
    }

    .ms-ai-chat.is-minimized {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}

/* Chat feedback panel (in-chat overlay) */
.ms-chat-feedback-panel {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    flex-direction: column;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.ms-chat-feedback-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ms-chat-feedback-panel__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.ms-chat-feedback-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem 0.75rem;
    border-bottom: 1px solid var(--limats-border);
    flex-shrink: 0;
}

.ms-chat-feedback-panel__title {
    font-family: var(--limats-font-title);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--limats-primary-dark);
    margin-bottom: 0.25rem;
}

.ms-chat-feedback-panel__lead {
    font-size: 0.86rem;
    color: var(--limats-text-secondary);
    line-height: 1.45;
}

.ms-chat-feedback-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.15rem;
}

.ms-chat-feedback-panel__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.15rem 1rem;
    border-top: 1px solid var(--limats-border);
    background: #fff;
    flex-shrink: 0;
}

.ms-chat-feedback-stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 0 0.25rem;
}

.ms-chat-feedback-star {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.65rem;
    background: var(--limats-primary-light);
    color: var(--limats-primary);
    font-size: 1.35rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.ms-chat-feedback-star:hover,
.ms-chat-feedback-star.is-active {
    background: var(--limats-primary);
    color: #fff;
    transform: translateY(-1px);
}
