:host {
    all: initial;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

:host([data-mode="inline"]) {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

:host([data-mode="inline"]) .nl-chat-root {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

:host([data-mode="inline"]) .nl-chat-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

:host([data-mode="inline"]) .nl-chat-header {
    display: none;
}

.nl-chat-root {
    font-size: 14px;
    line-height: 1.4;
    color: #1e293b;
}

:host([data-mode="floating"]) .nl-chat-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483000;
}

.nl-chat-toggle {
    position: relative;
    display: flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: #a90000;
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
    cursor: pointer;
    font-size: 22px;
}

.nl-chat-toggle:hover {
    background: #8b0000;
}

.nl-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: none;
    min-width: 22px;
    height: 22px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.nl-chat-badge.visible {
    display: flex;
}

.nl-chat-panel {
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
}

:host([data-mode="floating"]) .nl-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 400px;
    max-width: calc(100vw - 24px);
    max-height: min(680px, calc(100dvh - 96px));
    border-radius: 18px;
    box-shadow: 0 20px 55px rgba(15, 23, 42, .22);
}

.nl-chat-panel.open {
    display: flex;
}

.nl-chat-header {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
}

.nl-chat-header-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.nl-chat-avatar {
    position: relative;
    display: grid;
    width: 40px;
    min-width: 40px;
    height: 40px;
    place-items: center;
    overflow: visible;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #0f172a;
    color: #34d399;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -.04em;
}


.nl-chat-header-copy {
    min-width: 0;
}

.nl-chat-header-title-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

.nl-chat-header h3 {
    overflow: hidden;
    margin: 0;
    color: #1e293b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nl-chat-header-status {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    margin: 3px 0 0;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.nl-chat-header-status.is-open {
    background: #eaf6f2;
    color: #1f765e;
}

.nl-chat-header-status.is-closed {
    background: #f2f0ed;
    color: #57534e;
}

.nl-chat-header-close {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.nl-chat-header-close:hover {
    background: #f1f5f9;
}

.nl-chat-header-close::before,
.nl-chat-header-close::after {
    content: '';
    position: absolute;
    top: 21px;
    left: 13px;
    width: 18px;
    height: 1.75px;
    border-radius: 999px;
    background: currentColor;
}

.nl-chat-header-close::before { transform: rotate(45deg); }
.nl-chat-header-close::after { transform: rotate(-45deg); }

.nl-chat-hours-banner {
    padding: 7px 12px;
    border-bottom: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    font-size: 11px;
    line-height: 1.4;
}

.nl-chat-hours-banner.hidden {
    display: none;
}

.nl-chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 10px 12px;
    background: #f8fafc;
    scrollbar-color: #94a3b8 transparent;
    scrollbar-width: thin;
    min-height: 0;
}

.nl-chat-messages::-webkit-scrollbar { width: 7px; }
.nl-chat-messages::-webkit-scrollbar-track { background: transparent; }
.nl-chat-messages::-webkit-scrollbar-thumb { border-radius: 999px; background: #94a3b8; }

.nl-chat-msg {
    position: relative;
    max-width: 82%;
    box-sizing: border-box;
    padding: 6px 9px 5px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
}

.nl-chat-msg-body {
    white-space: pre-wrap;
}

.nl-chat-msg-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.nl-chat-msg.visitor {
    align-self: flex-end;
    border-top-right-radius: 4px;
    background: #10a37f;
    color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}


/* Nieprzeczytana odpowiedź nie ma oznaczenia na dymku: sygnałem jest licznik na przycisku czatu,
   a po otwarciu widok ustawia się na jej początku (klasa --unread służy tylko do tego). */

.nl-chat-msg.agent {
    align-self: flex-start;
    border: 1px solid #e2e8f0;
    border-top-left-radius: 4px;
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.nl-chat-msg-author {
    position: absolute;
    top: -10px;
    left: 7px;
    color: #64748b;
    font-size: 9px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.nl-chat-msg.agent.nl-chat-msg--with-author {
    margin-top: 10px;
}

.nl-chat-msg.agent.nl-chat-msg--with-author.nl-chat-msg--author-overlap {
    margin-top: 0;
}

.nl-chat-msg.agent + .nl-chat-msg.visitor {
    margin-top: 4px;
}

.nl-chat-msg.system {
    align-self: flex-start;
    border: 1px solid #e2e8f0;
    border-top-left-radius: 4px;
    background: #fff;
    color: #1e293b;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.nl-chat-messages > .nl-chat-msg.system:first-child,
.nl-chat-ticket-divider + .nl-chat-msg.system {
    background: #fff;
    border-color: #e2e8f0;
    color: #1e293b;
    font-size: 13px;
}

/* Godzina nie jest stałym elementem dymka (szum). Pojawia się jako nakładka pod wiadomością:
   po najechaniu myszą albo gdy wiadomość ma otwarte menu (dotknięcie na telefonie). */
.nl-chat-msg-time {
    display: none;
    position: absolute;
    bottom: -15px;
    left: 6px;
    z-index: 6;
    padding: 2px 6px;
    border-radius: 999px;
    background: #334155;
    color: #fff;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}

.nl-chat-msg.visitor .nl-chat-msg-time {
    right: 6px;
    left: auto;
}

.nl-chat-msg:has([data-message-menu-trigger][aria-expanded="true"]) .nl-chat-msg-time {
    display: block;
}

@media (hover: hover) and (pointer: fine) {
    .nl-chat-msg:hover .nl-chat-msg-time {
        display: block;
    }
}

.nl-chat-msg.system .nl-chat-msg-time {
    display: none;
}

/* Pilot „Zgłoś nieobecność": przyciski zajęć pod treścią wiadomości automatu. Cały przycisk jest celem dotyku;
   pierwsza linia to dzień, data, godzina i zajęcia, druga – status zgłoszenia policzony przez Panel Kursanta. */
.nl-chat-offer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 7px 0 2px;
}

.nl-chat-offer-option {
    display: flex;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    padding: 7px 10px;
    border: 1px solid #a90000;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    font: inherit;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.nl-chat-offer-option strong { color: #1e293b; font-weight: 650; }
.nl-chat-offer-option .nl-chat-offer-option-action {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 4px;
    padding: 4px 9px;
    border-radius: 7px;
    background: #a90000;
    color: #fff;
    font-size: 12px;
    font-weight: 650;
}
.nl-chat-offer-option span { color: #475569; font-size: 12px; }
.nl-chat-offer-option em { color: #047857; font-size: 12px; font-style: normal; font-weight: 600; }
.nl-chat-offer-option:hover:not(:disabled),
.nl-chat-offer-option:focus-visible { background: #fff5f5; outline: none; box-shadow: 0 0 0 2px rgba(169, 0, 0, .18); }
.nl-chat-offer-option:disabled { border-color: #e2e8f0; background: #f8fafc; cursor: default; }
.nl-chat-offer-option:disabled strong { color: #475569; }
.nl-chat-offer-option:not([data-state="reported"]) em { color: #b45309; }
.nl-chat-offer-option.is-busy { opacity: .6; cursor: progress; }
.nl-chat-offer-note { display: block; margin-top: 4px; color: #64748b; font-size: 12px; }
.nl-chat-offer-link {
    display: inline-flex;
    min-height: 36px;
    box-sizing: border-box;
    align-items: center;
    margin: 7px 0 2px;
    padding: 6px 12px;
    border: 1px solid #a90000;
    border-radius: 10px;
    color: #a90000;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}
.nl-chat-offer-link:hover, .nl-chat-offer-link:focus-visible { background: #fff5f5; outline: none; }

.nl-chat-ticket-divider {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 7px;
    margin: 20px 0 16px;
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
}

.nl-chat-ticket-divider-line {
    height: 1px;
    flex: 1 1 auto;
    background: #e2e8f0;
}

.nl-chat-ticket-divider-label {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}


.nl-chat-input-wrap {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 11px 12px 8px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.nl-chat-composer {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
}

.nl-chat-input {
    width: 100%;
    min-height: 40px;
    max-height: 100px;
    box-sizing: border-box;
    resize: none;
    padding: 10px 39px 10px 14px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    outline: none;
    background: #f8fafc;
    color: #1e293b;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

/* Drobne teksty informacyjne: #64748b daje 4,8:1 na białym (poprzednie #94a3b8 miało 2,5:1). */
.nl-chat-input::placeholder { color: #64748b; }

.nl-chat-input:focus {
    border-color: #10a37f;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, .08);
}

.nl-chat-emoji {
    position: absolute;
    right: 2px;
    bottom: 1px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.nl-chat-emoji:hover,
.nl-chat-emoji[aria-expanded="true"] {
    background: #eef2f7;
    color: #64748b;
}

.nl-chat-emoji-picker {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 44px);
    gap: 3px;
    padding: 7px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}

.nl-chat-emoji-picker.hidden { display: none; }

.nl-chat-emoji-picker button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
}

.nl-chat-emoji-picker button:hover { background: #f1f5f9; }

.nl-chat-send {
    display: grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #a90000;
    color: #fff;
    box-shadow: 0 5px 14px rgba(127, 29, 29, .2);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.nl-chat-send span {
    display: block;
    transform: rotate(-12deg) translateX(1px);
}

.nl-chat-send:hover { transform: translateY(-1px); }
.nl-chat-send:active { transform: translateY(0) scale(.97); }

.nl-chat-send:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.nl-chat-footer {
    padding: 0 12px 9px;
    background: #fff;
    color: #64748b;
    font-size: 10px;
    text-align: center;
}

.nl-chat-notify-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 3px 0 0;
    color: #64748b;
    cursor: pointer;
    font-size: 10px;
}

.nl-chat-notify-label input {
    margin: 0;
}

.nl-chat-footer-note {
    display: none;
}

.nl-chat-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px 4px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    color: #b45309;
    font-size: 11px;
    font-style: italic;
    font-weight: 600;
}

.nl-chat-typing.hidden {
    display: none;
}

.nl-chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.nl-chat-typing-dots i {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
    animation: nl-chat-typing-dot 1.1s infinite ease-in-out;
    opacity: .45;
}

.nl-chat-typing-dots i:nth-child(2) { animation-delay: .15s; }
.nl-chat-typing-dots i:nth-child(3) { animation-delay: .3s; }

@keyframes nl-chat-typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-2px); opacity: 1; }
}

.nl-chat-waiting {
    padding: 6px 14px 2px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-style: italic;
    text-align: center;
}

.nl-chat-notice {
    margin: 0;
    padding: 8px 14px;
    border-top: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
}

.nl-chat-notice.hidden,
.nl-chat-waiting.hidden,
.nl-chat-identify.hidden {
    display: none;
}

.nl-chat-identify {
    padding: 0 12px 8px;
    background: #f8fafc;
    animation: nl-chat-slide-up 200ms ease-out;
}

@keyframes nl-chat-slide-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.nl-chat-identify-inner {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.nl-chat-identify-heading {
    margin: 0 0 10px;
    color: #334155;
    font-size: 12px;
    line-height: 1.45;
}

.nl-chat-identify-label {
    display: block;
    margin: 8px 0 4px;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
}

.nl-chat-identify-label:first-of-type { margin-top: 0; }

.nl-chat-identify-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
}

.nl-chat-identify-input:focus { border-color: #10a37f; }

.nl-chat-identify-error {
    margin: 8px 0 0;
    color: #dc2626;
    font-size: 11px;
}

.nl-chat-identify-error.hidden { display: none; }

.nl-chat-identify-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
}

.nl-chat-identify-skip {
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
}

.nl-chat-identify-skip:hover { color: #334155; }

.nl-chat-identify-save {
    padding: 8px 16px;
    border: 0;
    border-radius: 9px;
    background: #10a37f;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.nl-chat-identify-save:disabled { opacity: .5; cursor: not-allowed; }

.nl-chat-identify-rodo {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1.35;
}

@media (max-width: 480px) {
    :host([data-mode="floating"]) .nl-chat-root {
        right: 12px;
        bottom: 12px;
    }

    :host([data-mode="floating"]) .nl-chat-panel {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 88px);
    }

    .nl-chat-msg { max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
    .nl-chat-typing-dots i { animation: none; }
}

/* Native live-chat message interactions. Messenger keeps provider-specific semantics. */
.nl-chat-input-wrap { flex-wrap: wrap; }
.nl-chat-reply-preview {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid #dbeafe;
    border-radius: 11px;
    background: #f0f9ff;
    color: #334155;
}
.nl-chat-reply-preview.hidden { display: none; }
.nl-chat-reply-preview-copy { min-width: 0; flex: 1 1 auto; }
.nl-chat-reply-preview strong {
    display: block;
    color: #0369a1;
    font-size: 10px;
    line-height: 1.2;
}
.nl-chat-reply-preview span {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 2px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 11px;
    line-height: 1.25;
}
.nl-chat-reply-preview button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.nl-chat-reply-preview button:hover { background: #e0f2fe; }
.nl-chat-input {
    min-height: 56px;
    max-height: 172px;
    border-radius: 16px;
    overflow-y: hidden;
}
.nl-chat-reply-quote {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: -1px 0 6px;
    padding: 5px 7px;
    border: 0;
    border-left: 3px solid rgba(15, 118, 110, .65);
    border-radius: 7px;
    background: rgba(15, 118, 110, .08);
    color: inherit;
    cursor: pointer;
    text-align: left;
}
.nl-chat-msg.visitor .nl-chat-reply-quote {
    border-left-color: rgba(255, 255, 255, .7);
    background: rgba(255, 255, 255, .14);
}
.nl-chat-reply-quote:disabled { cursor: default; }
.nl-chat-reply-quote strong {
    display: block;
    margin-bottom: 1px;
    font-size: 9px;
    line-height: 1.2;
}
.nl-chat-reply-quote span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 10px;
    line-height: 1.25;
    opacity: .8;
}
.nl-chat-msg-edited {
    display: block;
    margin-top: 3px;
    font-size: 9px;
    font-style: italic;
    opacity: .58;
}
.nl-chat-msg--deleted .nl-chat-msg-body {
    font-style: italic;
    opacity: .72;
}
.nl-chat-msg-menu-trigger {
    position: absolute;
    top: 3px;
    right: -24px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 140ms ease;
    z-index: 10;
}
.nl-chat-msg.visitor .nl-chat-msg-menu-trigger { left: -24px; right: auto; }
.nl-chat-msg:hover .nl-chat-msg-menu-trigger,
.nl-chat-msg-menu-trigger:focus-visible,
.nl-chat-msg-menu-trigger[aria-expanded="true"] { opacity: 1; }
.nl-chat-msg-menu {
    position: absolute;
    top: 28px;
    right: -8px;
    z-index: 30;
    width: 142px;
    box-sizing: border-box;
    padding: 4px;
    border: 1px solid #dbe3ee;
    border-radius: 11px;
    background: #fff;
    color: #334155;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
}
.nl-chat-msg.agent .nl-chat-msg-menu { left: -8px; right: auto; }
.nl-chat-msg.visitor .nl-chat-msg-menu { right: -8px; left: auto; }
.nl-chat-msg-menu.hidden, .nl-chat-reaction-palette.hidden { display: none; }
.nl-chat-msg-menu > button[data-message-action] {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    text-align: left;
}
.nl-chat-msg-menu > button[data-message-action]:hover { background: #f1f5f9; }
.nl-chat-reaction-palette {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding-top: 4px;
    border-top: 1px solid #eef2f7;
}
.nl-chat-reaction-palette button {
    display: grid;
    min-width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
}
.nl-chat-reaction-palette button:hover { background: #f1f5f9; }
.nl-chat-msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
}
.nl-chat-msg-reactions button {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
}
.nl-chat-msg.visitor .nl-chat-msg-reactions button { color: #334155; }
.nl-chat-msg-reactions button.is-mine { border-color: #38bdf8; background: #e0f2fe; }
@keyframes nl-chat-message-highlight {
    0% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0); }
    50% { box-shadow: 0 0 0 5px rgba(16, 163, 127, .28); }
    100% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0); }
}
.nl-chat-msg--highlight { animation: nl-chat-message-highlight 1s ease-in-out; }
.nl-chat-new-messages {
    align-self: center;
    min-height: 36px;
    margin: -46px 0 10px;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .14);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    z-index: 18;
}
.nl-chat-new-messages.hidden { display: none; }

@media (hover: none), (pointer: coarse), (max-width: 720px) {
    .nl-chat-msg-menu-trigger { display: none; }
    .nl-chat-msg-menu {
        width: 150px;
        max-width: calc(100vw - 20px);
        padding: 3px;
        border-radius: 10px;
    }
    .nl-chat-msg-menu > button[data-message-action] {
        min-height: 36px;
        padding: 6px 9px;
        font-size: 11px;
    }
    .nl-chat-reaction-palette button { min-width: 36px; height: 36px; }
    .nl-chat-msg-menu--viewport { z-index: 2147483200; }
    .nl-chat-new-messages { min-height: 44px; }
}

/* Shared chat attachments: the same composer behavior is used by WWW and Panel Kursanta. */
.nl-chat-attach {
    display: grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
}
.nl-chat-attach:hover { background: #e2e8f0; color: #334155; }
.nl-chat-attach:disabled { opacity: .45; cursor: wait; }
.nl-chat-input-wrap.is-dragging-file { box-shadow: inset 0 0 0 2px #818cf8; background: #eef2ff; }
.nl-chat-attachments { display: grid; gap: 7px; margin: 2px 0 5px; max-width: 280px; }
.nl-chat-attachment-image,
.nl-chat-attachment-video { display: block; max-width: 100%; max-height: 280px; border-radius: 11px; object-fit: contain; background: rgba(15,23,42,.06); }
.nl-chat-attachment-audio { display: block; width: min(260px, 100%); }
.nl-chat-attachment-file {
    display: flex; min-width: 180px; max-width: 260px; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.14); color: inherit; text-decoration: none;
}
.nl-chat-msg.agent .nl-chat-attachment-file { background: rgba(255,255,255,.16); }
.nl-chat-msg.visitor .nl-chat-attachment-file { background: rgba(15,23,42,.06); }
.nl-chat-attachment-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.nl-chat-attachment-file span { flex: 0 0 auto; font-size: 9px; opacity: .7; }
@media (max-width: 480px) {
    .nl-chat-attach { width: 42px; min-width: 42px; height: 42px; }
    .nl-chat-attachments { max-width: min(72vw, 260px); }
}

/* Miejsce na nakładkę z godziną pod ostatnią wiadomością. */
.nl-chat-messages > :last-child { margin-bottom: 10px; }

/* Puste okno czatu: informacja, kiedy odpowiadamy, i gotowe pytania na start. */
.nl-chat-starters {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 2px 12px 12px;
    background: #f8fafc;
}
.nl-chat-starters.hidden { display: none; }
.nl-chat-starters-hint {
    margin: 0 0 2px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}
.nl-chat-starter {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    line-height: 1.25;
    text-align: left;
}
.nl-chat-starter:hover { border-color: #94a3b8; background: #f1f5f9; }
.nl-chat-starter:focus-visible { outline: 2px solid #64748b; outline-offset: 2px; }
