/* Help Center virtual assistant — floating widget */

.help-assistant-root {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 500;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
}

.help-assistant-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.15rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f172a 0%, #4338ca 45%, #db2777 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(67, 56, 202, 0.38);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.help-assistant-fab-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.85rem;
}

.help-assistant-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(99, 102, 241, 0.42);
}

.help-assistant-root.is-open .help-assistant-fab {
    background: #334155;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}

.help-assistant-panel {
    position: relative;
    width: min(380px, calc(100% - 1.5rem));
    max-width: calc(100vw - 1.5rem);
    max-height: min(560px, calc(100vh - 6rem));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    box-sizing: border-box;
}

.help-assistant-panel[hidden] {
    display: none !important;
}

.help-assistant-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
    background: linear-gradient(135deg, #0f172a 0%, #312e81 50%, #4338ca 100%);
    color: #fff;
}

.help-assistant-head-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.help-assistant-avatar {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.help-assistant-online {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #312e81;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.help-assistant-head-copy {
    min-width: 0;
}

.help-assistant-head h2 {
    margin: 0.15rem 0 0;
    font-size: 1rem;
    color: #fff;
    line-height: 1.25;
}

.help-assistant-head p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    opacity: 0.88;
}

.help-assistant-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.9;
}

.help-assistant-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    position: relative;
    z-index: 2;
    font-size: 1rem;
}

.help-assistant-close:hover {
    background: rgba(255, 255, 255, 0.32);
}

.help-assistant-footer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #f1f5f9;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.help-assistant-footer-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.help-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #f8fafc;
    min-height: 280px;
}

.help-assistant-msg {
    max-width: 88%;
}

.help-assistant-msg-user {
    align-self: flex-end;
}

.help-assistant-msg-assistant {
    align-self: flex-start;
}

.help-assistant-bubble {
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    font-size: 0.86rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.help-assistant-msg-user .help-assistant-bubble {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.help-assistant-msg-assistant .help-assistant-bubble {
    background: #fff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.help-assistant-msg-assistant:not(.help-assistant-typing) .help-assistant-bubble::before {
    content: 'Agent';
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 0.2rem;
}

/* Category / step choice cards */
.help-assistant-choices {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
    align-self: stretch;
    padding: 0.15rem 0 0.5rem;
}

.help-assistant-choice-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.help-assistant-choice-card:hover:not(:disabled) {
    border-color: #a5b4fc;
    background: #fafaff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.help-assistant-choice-card:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.help-assistant-choice-card > i {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.85rem;
}

.help-assistant-choice-label {
    display: block;
    font-weight: 700;
    font-size: 0.84rem;
    line-height: 1.3;
}

.help-assistant-choice-hint {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.1rem;
    font-weight: 500;
}

.help-assistant-choice-skip {
    align-self: center;
    border: none;
    background: none;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    margin-top: 0.15rem;
}

.help-assistant-choice-skip:hover:not(:disabled) {
    color: #4338ca;
}

/* Completion actions — compact stack */
.help-assistant-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    align-self: stretch;
    padding: 0.15rem 0 0.75rem;
}

.help-assistant-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.help-assistant-action-link {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.help-assistant-action-link:hover {
    background: #e0e7ff;
}

.help-assistant-action-call {
    background: #059669;
    color: #fff;
    border-color: #047857;
}

.help-assistant-action-call:hover {
    background: #047857;
    color: #fff;
}

.help-assistant-action-email {
    background: #fff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.help-assistant-action-email:hover {
    background: #f5f3ff;
}

.help-assistant-compose {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}

.help-assistant-compose[hidden] {
    display: none !important;
}

.help-assistant-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: center;
}

.help-assistant-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    padding: 0.65rem 0.95rem;
    font-size: 0.86rem;
    box-sizing: border-box;
}

.help-assistant-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.help-assistant-send {
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex: 0 0 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #fff;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
}

.help-assistant-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.help-assistant-typing .help-assistant-bubble {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    min-height: 1.2rem;
}

.help-assistant-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: helpAssistantDot 1.2s infinite ease-in-out;
}

.help-assistant-typing span:nth-child(2) { animation-delay: 0.15s; }
.help-assistant-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes helpAssistantDot {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .help-assistant-root:not(.help-assistant-root--fullscreen) {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .help-assistant-root:not(.help-assistant-root--fullscreen) .help-assistant-panel {
        width: 100%;
        max-width: 100%;
    }

    .help-assistant-fab {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .help-assistant-fab-label {
        display: none;
    }

    .help-assistant-fab-icon-wrap {
        width: 100%;
        height: 100%;
        background: transparent;
        font-size: 1.15rem;
    }
}

/* ─── Full-page chat (/chat.php) — WhatsApp-style mobile experience ─── */

html.help-assistant-page,
html.help-assistant-chat-open {
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

html.help-assistant-chat-open body {
    overflow: hidden;
}

.help-assistant-page {
    margin: 0;
    padding: 0;
    overflow: hidden;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    height: 100%;
    height: -webkit-fill-available;
    height: 100dvh;
    background: #efeae2;
    -webkit-text-size-adjust: 100%;
    box-sizing: border-box;
}

.help-assistant-page *,
.help-assistant-root--fullscreen *,
.help-assistant-root--fullscreen *::before,
.help-assistant-root--fullscreen *::after {
    box-sizing: border-box;
}

.help-assistant-root--fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 600;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.help-assistant-root--fullscreen .help-assistant-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: none;
    height: 100%;
    min-height: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

.help-assistant-root--fullscreen .help-assistant-head {
    flex-shrink: 0;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    background: #075e54;
    gap: 0.5rem;
    overflow: hidden;
}

.help-assistant-back {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.help-assistant-back:active {
    background: rgba(255, 255, 255, 0.12);
}

.help-assistant-root--fullscreen .help-assistant-head-main {
    flex: 1;
    align-items: center;
    min-width: 0;
}

.help-assistant-root--fullscreen .help-assistant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1rem;
}

.help-assistant-root--fullscreen .help-assistant-online {
    border-color: #075e54;
}

.help-assistant-root--fullscreen .help-assistant-badge {
    display: none;
}

.help-assistant-root--fullscreen .help-assistant-head h2 {
    font-size: 1.05rem;
    margin: 0;
}

.help-assistant-root--fullscreen .help-assistant-head p {
    font-size: 0.75rem;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.help-assistant-root--fullscreen .help-assistant-messages {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: #efeae2;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cdc4' fill-opacity='0.35'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    padding: 0.75rem max(0.85rem, env(safe-area-inset-right)) 0.5rem max(0.85rem, env(safe-area-inset-left));
    gap: 0.35rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overflow-x: hidden;
    overflow-y: auto;
}

.help-assistant-root--fullscreen .help-assistant-msg {
    max-width: min(82%, calc(100% - 1rem));
}

.help-assistant-root--fullscreen .help-assistant-bubble {
    font-size: 0.95rem;
    line-height: 1.45;
    padding: 0.55rem 0.75rem 0.45rem;
    border-radius: 8px;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.help-assistant-root--fullscreen .help-assistant-msg-user .help-assistant-bubble {
    background: #d9fdd3;
    color: #111b21;
    border-bottom-right-radius: 2px;
}

.help-assistant-root--fullscreen .help-assistant-msg-assistant .help-assistant-bubble {
    background: #fff;
    color: #111b21;
    border: none;
    border-bottom-left-radius: 2px;
}

.help-assistant-root--fullscreen .help-assistant-msg-assistant:not(.help-assistant-typing) .help-assistant-bubble::before {
    color: #667781;
    font-size: 0.68rem;
    margin-bottom: 0.15rem;
}

.help-assistant-root--fullscreen .help-assistant-choices,
.help-assistant-root--fullscreen .help-assistant-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.help-assistant-root--fullscreen .help-assistant-choice-card {
    border-radius: 10px;
    padding: 0.85rem 0.9rem;
    font-size: 0.92rem;
    max-width: 100%;
    min-width: 0;
}

.help-assistant-root--fullscreen .help-assistant-choice-label,
.help-assistant-root--fullscreen .help-assistant-choice-hint {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.help-assistant-root--fullscreen .help-assistant-action-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 12px;
}

.help-assistant-root--fullscreen .help-assistant-compose {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-top: none;
    background: #f0f2f5;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
}

.help-assistant-root--fullscreen .help-assistant-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 0.45rem;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: 0.5rem max(0.65rem, env(safe-area-inset-right)) max(0.65rem, env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-left));
    margin: 0;
}

.help-assistant-root--fullscreen .help-assistant-input {
    grid-column: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
    border-radius: 24px;
    padding: 0.65rem 0.9rem;
    min-height: 44px;
    background: #fff;
    border: none;
    box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08);
}

.help-assistant-root--fullscreen .help-assistant-input:focus {
    box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08), 0 0 0 2px rgba(7, 94, 84, 0.2);
}

.help-assistant-root--fullscreen .help-assistant-send {
    grid-column: 2;
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex: none;
    background: #075e54;
}

.help-assistant-root--fullscreen .help-assistant-send:active:not(:disabled) {
    transform: scale(0.96);
}

/* Small phones — ensure floating panel also fits if opened inline */
@media (max-width: 1024px) {
    .help-assistant-root.is-open:not(.help-assistant-root--fullscreen) {
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
    }

    .help-assistant-root.is-open:not(.help-assistant-root--fullscreen) .help-assistant-panel {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .help-assistant-root.is-open:not(.help-assistant-root--fullscreen) .help-assistant-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .help-assistant-root.is-open:not(.help-assistant-root--fullscreen) .help-assistant-input {
        font-size: 16px;
        width: 100%;
        min-width: 0;
    }
}

/* Tablet: also use full-page when opened from widget on wider mobile/tablet */
@media (max-width: 1024px) and (min-width: 481px) {
    .help-assistant-fab {
        width: auto;
        min-height: 52px;
        padding: 0.85rem 1.1rem;
    }
}

