/* Nomad FAQ chat widget styles */
#nomad-chat-root [v-cloak] { display: none !important; }

.nomad-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    background: #0066cc;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    z-index: 9998;
    transition: transform .15s ease;
}
.nomad-chat-launcher:hover { transform: scale(1.05); }
[dir="rtl"] .nomad-chat-launcher,
#nomad-chat-root[data-dir="rtl"] .nomad-chat-launcher { right: auto; left: 24px; }

.nomad-chat-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'UbuntuMedium', 'Ubuntu', sans-serif;
}
#nomad-chat-root[data-dir="rtl"] .nomad-chat-panel { right: auto; left: 24px; }

.nomad-chat-panel__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #0066cc;
    color: #fff;
    font-weight: 600;
}
.nomad-chat-panel__title { flex: 1; font-size: 15px; }
.nomad-chat-panel__close {
    background: transparent !important;
    border: 0 !important;
    color: #0f0d0d !important;
    font-size: 18px !important;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    opacity: 1;
}
.nomad-chat-panel__close:hover { opacity: 0.7 !important; }

.nomad-chat-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f9fb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nomad-chat-empty {
    color: #888;
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.nomad-chat-msg { display: flex; }
.nomad-chat-msg--user { justify-content: flex-end; }
.nomad-chat-msg--assistant { justify-content: flex-start; }

.nomad-chat-msg__bubble {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-size: 14px;
    line-height: 1.45;
}
.nomad-chat-msg--user .nomad-chat-msg__bubble {
    background: #0066cc;
    color: #fff;
}
.nomad-chat-msg__text { white-space: pre-wrap; word-wrap: break-word; }

/* ── Bullet cards ── */
.nomad-chat-msg__bullets {
    list-style: none;
    padding: 6px 0 0;
    margin: 6px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nomad-chat-bullet-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #f0f4ff;
    border-left: 3px solid #0066cc;
    border-radius: 0 8px 8px 0;
    padding: 8px 10px;
    transition: background .15s;
}
.nomad-chat-bullet-card:hover { background: #e6eeff; }
.nomad-chat-bullet-card__title {
    font-family: 'UbuntuBold', 'Ubuntu', sans-serif;
    font-size: 13px;
    color: #243748;
    line-height: 1.3;
}
.nomad-chat-bullet-card__body {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.45;
}

/* ── Step list (solution_step) ── */
.nomad-chat-msg__steps {
    list-style: none;
    padding: 6px 0 0;
    margin: 6px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: step-counter;
}
.nomad-chat-step {
    counter-increment: step-counter;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f0f4ff;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.5;
}
.nomad-chat-step::before {
    content: counter(step-counter);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0066cc;
    color: #fff;
    font-size: 11px;
    font-family: 'UbuntuBold', 'Ubuntu', sans-serif;
    font-weight: 700;
    margin-top: 1px;
}

/* ── Source badge chips ── */
.nomad-chat-msg__sources {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.07);
}
.nomad-chat-sources-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    margin-right: 2px;
    font-family: 'UbuntuMedium', 'Ubuntu', sans-serif;
}
.nomad-chat-source-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #0066cc;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nomad-chat-source-badge:hover {
    background: #0066cc;
    color: #fff;
}
/* CSS tooltip */
.nomad-chat-source-badge::after {
    content: attr(title);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2a3a;
    color: #fff;
    white-space: normal;
    max-width: 220px;
    min-width: 100px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.35;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 10000;
    text-align: center;
    word-break: break-word;
}
.nomad-chat-source-badge:hover::after { opacity: 1; }
/* arrow */
.nomad-chat-source-badge::before {
    content: '';
    position: absolute;
    bottom: calc(130% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1a2a3a;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 10000;
}
.nomad-chat-source-badge:hover::before { opacity: 1; }
.nomad-chat-msg--user .nomad-chat-msg__sources { border-top-color: rgba(255,255,255,0.2); }

.nomad-chat-typing { display: inline-flex; gap: 3px; }
.nomad-chat-typing i {
    width: 6px; height: 6px; border-radius: 50%;
    background: #aaa;
    animation: nomad-chat-blink 1.2s infinite ease-in-out;
}
.nomad-chat-typing i:nth-child(2) { animation-delay: 0.2s; }
.nomad-chat-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes nomad-chat-blink { 0%,100%{opacity:0.3} 50%{opacity:1} }

.nomad-chat-error {
    color: #c00;
    font-size: 13px;
    background: #fff3f3;
    padding: 8px 12px;
    border-radius: 6px;
}

.nomad-chat-panel__input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e5e9ee;
    background: #fff;
}
.nomad-chat-panel__input textarea {
    flex: 1;
    border: 1px solid #d0d7e0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    resize: none;
    font-family: 'UbuntuMedium', 'Ubuntu', sans-serif;
    max-height: 120px;
}
.nomad-chat-panel__input button {
    background: #0066cc;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    cursor: pointer;
    font-size: 16px;
}
.nomad-chat-panel__input button[disabled] { opacity: 0.5; cursor: not-allowed; }

.nomad-chat-fade-enter-active, .nomad-chat-fade-leave-active { transition: opacity .15s ease, transform .15s ease; }
.nomad-chat-fade-enter-from, .nomad-chat-fade-leave-to { opacity: 0; transform: translateY(8px); }

@media (max-width: 480px) {
    .nomad-chat-panel {
        right: 0; left: 0; bottom: 0;
        width: 100%; max-width: 100%;
        height: 80vh; max-height: 80vh;
        border-radius: 12px 12px 0 0;
    }
    #nomad-chat-root[data-dir="rtl"] .nomad-chat-panel { right: 0; left: 0; }
}

/* ── Greeting card ── */
.nomad-chat-greeting-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nomad-chat-greeting-card__title {
    font-family: 'UbuntuBold', 'Ubuntu', sans-serif;
    font-size: 15px;
    color: #1a2a3a;
    margin: 0 0 2px;
}
.nomad-chat-greeting-card__text {
    font-size: 13px;
    color: #4a5568;
    margin: 0;
    line-height: 1.5;
}
.nomad-chat-greeting-card__prompt {
    font-size: 14px;
    color: #0066cc;
    font-family: 'UbuntuMedium', 'Ubuntu', sans-serif;
    margin: 6px 0 0;
    padding-top: 8px;
    border-top: 1px solid rgba(0,102,204,0.15);
}

/* ── Contact-center refusal card ── */
.nomad-chat-refusal-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
}
.nomad-chat-refusal-card__intro {
    font-size: 13px;
    color: #4a5568;
    margin: 0;
    line-height: 1.55;
}
.nomad-chat-refusal-card__list {
    list-style: none;
    padding: 4px 0 0;
    margin: 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-top: 1px solid rgba(0,0,0,0.07);
}
.nomad-chat-refusal-card__list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.45;
}
.nomad-chat-refusal-card__label {
    font-family: 'UbuntuMedium', 'Ubuntu', sans-serif;
    font-size: 12px;
    color: #6b7280;
}
.nomad-chat-refusal-link {
    color: #0066cc;
    text-decoration: underline;
    font-family: 'UbuntuMedium', 'Ubuntu', sans-serif;
    font-size: 13px;
    word-break: break-all;
}
.nomad-chat-refusal-link:hover { color: #004fa3; }
.nomad-chat-refusal-card__footer {
    font-size: 13px;
    color: #374151;
    margin: 4px 0 0;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.07);
    font-family: 'UbuntuMedium', 'Ubuntu', sans-serif;
    line-height: 1.45;
}
/* Give the refusal/greeting bubbles full available width */
.nomad-chat-msg--assistant .nomad-chat-msg__bubble:has(.nomad-chat-refusal-card),
.nomad-chat-msg--assistant .nomad-chat-msg__bubble:has(.nomad-chat-greeting-card) {
    max-width: 90%;
}
