/* ==========================================================================
   Floating knowledge chat. Answers come only from approved knowledge records.
   ========================================================================== */

.np-chat { position: fixed; right: 1rem; bottom: 1rem; z-index: 95; }
@media (min-width: 768px) { .np-chat { right: 1.5rem; bottom: 1.5rem; } }

.np-chat__launcher {
    display: inline-flex; align-items: center; gap: .5rem;
    min-height: 52px; padding: 0 1.125rem;
    border: 0; border-radius: 999px;
    background: var(--np-blue); color: #fff;
    font: inherit; font-weight: 600; font-size: var(--np-text-sm);
    box-shadow: var(--np-shadow-lg); cursor: pointer;
}
.np-chat__launcher:hover { background: var(--np-blue-dark); }
.np-chat__launcher[aria-expanded="true"] { display: none; }

.np-chat__panel {
    width: min(380px, calc(100vw - 2rem));
    height: min(560px, calc(100vh - 6rem));
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius-lg);
    box-shadow: var(--np-shadow-lg);
    overflow: hidden;
}
.np-chat__panel[hidden] { display: none; }

.np-chat__head {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .875rem 1rem;
    background: var(--np-navy); color: #fff;
}
.np-chat__head h2 { margin: 0; font-size: var(--np-text-sm); color: #fff; }
.np-chat__head-actions { margin-left: auto; display: flex; gap: .25rem; flex: 0 0 auto; }
.np-chat__help, .np-chat__close {
    background: none; border: 0; color: #fff;
    cursor: pointer; font-size: 1.25rem; line-height: 1;
    width: 32px; height: 32px; border-radius: var(--np-radius-sm);
}
.np-chat__help { font-size: var(--np-text-sm); font-weight: 700; border: 1px solid rgba(255,255,255,.4); }
.np-chat__help:hover, .np-chat__close:hover { background: rgba(255,255,255,.14); }
.np-chat__help[aria-expanded="true"] { background: rgba(255,255,255,.2); }
.np-chat__intro {
    margin: 0; padding: .625rem 1rem; font-size: var(--np-text-xs);
    color: var(--np-muted); background: var(--np-surface-alt);
    border-bottom: 1px solid var(--np-line);
}
.np-chat__intro[hidden] { display: none; }

.np-chat__log {
    flex: 1; overflow-y: auto;
    padding: 1rem; display: flex; flex-direction: column; gap: .75rem;
    background: var(--np-surface-alt);
}

.np-chat__msg { max-width: 88%; padding: .625rem .75rem; border-radius: var(--np-radius); font-size: var(--np-text-sm); line-height: 1.55; }
.np-chat__msg--bot { background: #fff; border: 1px solid var(--np-line); color: var(--np-ink); align-self: flex-start; }
.np-chat__msg--user { background: var(--np-blue); color: #fff; align-self: flex-end; }
.np-chat__msg p { margin: 0 0 .5rem; max-width: none; }
.np-chat__msg p:last-child { margin-bottom: 0; }
.np-chat__msg a { color: inherit; }
.np-chat__msg--bot a { color: var(--np-blue-dark); }

.np-chat__links { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .25rem; }
.np-chat__links a { font-size: var(--np-text-xs); font-weight: 600; }

.np-chat__suggestions { display: flex; flex-wrap: wrap; gap: .375rem; padding: 0 1rem .75rem; background: var(--np-surface-alt); }
.np-chat__chip {
    background: #fff; border: 1px solid var(--np-line); border-radius: 999px;
    padding: .3125rem .625rem; font: inherit; font-size: var(--np-text-xs);
    color: var(--np-navy); cursor: pointer;
}
.np-chat__chip:hover { border-color: var(--np-blue); color: var(--np-blue-dark); }

.np-chat__form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--np-line); background: #fff; }
.np-chat__input {
    flex: 1; min-height: 42px; padding: .5rem .75rem;
    font: inherit; font-size: var(--np-text-sm);
    border: 1px solid #c9d4e0; border-radius: var(--np-radius);
}
.np-chat__send {
    min-width: 42px; min-height: 42px; border: 0; border-radius: var(--np-radius);
    background: var(--np-blue); color: #fff; cursor: pointer; font-weight: 700;
}
.np-chat__send:disabled { opacity: .5; cursor: not-allowed; }

.np-chat__typing { font-size: var(--np-text-xs); color: var(--np-muted); padding: 0 1rem .5rem; background: var(--np-surface-alt); }
.np-chat__typing[hidden] { display: none; }

.np-chat__escalation { margin-top: .5rem; display: grid; gap: .5rem; }
.np-chat__lead-form { display: grid; gap: .5rem; margin-top: .5rem; }
.np-chat__lead-form input { width: 100%; min-height: 38px; padding: .375rem .5rem; font: inherit; font-size: var(--np-text-xs); border: 1px solid #c9d4e0; border-radius: var(--np-radius-sm); }
.np-chat__lead-form label { font-size: var(--np-text-xs); font-weight: 600; color: var(--np-ink); }
.np-chat__consent { display: flex; gap: .5rem; align-items: flex-start; font-size: var(--np-text-xs); color: var(--np-muted); }

.np-chat__disclaimer { font-size: 11px; color: var(--np-muted); padding: 0 1rem .625rem; background: #fff; }
