/* Nice Hosting — Nice Desk live chat (ticket-stub, not a messenger clone) */
.nh-lc:not(.is-available):not(.is-chatting),
.nh-lc[hidden] {
    display: none !important;
}
.nh-lc {
    --nh-ink: #1e4068;
    --nh-ink-2: #2d5a8a;
    --nh-paper: #fffaf3;
    --nh-paper-2: #f7efe2;
    --nh-gold: #d4a017;
    --nh-gold-2: #f0d078;
    --nh-orange: #c4a06a;
    --nh-teal: #0d6e68;
    --nh-text: #2c2438;
    --nh-muted: #6b6178;
    --nh-line: rgba(212, 160, 23, 0.38);
    --nh-shadow: 0 18px 50px rgba(20, 8, 38, 0.28);
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 11050;
    font-family: "Poppins", "Inter", system-ui, sans-serif;
    color: var(--nh-text);
    pointer-events: none;
}
.nh-lc *,
.nh-lc *::before,
.nh-lc *::after { box-sizing: border-box; }

.nh-lc__launcher,
.nh-lc__panel {
    pointer-events: auto;
}

.nh-lc__launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 8px 16px 8px 10px;
    border: 1px solid rgba(240, 208, 120, 0.45);
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(145deg, var(--nh-ink) 0%, var(--nh-ink-2) 58%, #c4a06a 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--nh-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.nh-lc__launcher:hover,
.nh-lc__launcher:focus-visible {
    transform: translateY(-2px);
    outline: none;
    box-shadow: 0 22px 48px rgba(255, 107, 53, 0.28), var(--nh-shadow);
}
.nh-lc.is-open .nh-lc__launcher { display: none; }

.nh-lc__launcher-notch {
    position: absolute;
    top: -8px;
    right: 22px;
    width: 16px;
    height: 16px;
    background: var(--nh-gold);
    transform: rotate(45deg);
    box-shadow: 0 0 0 3px var(--nh-ink);
}
.nh-lc__launcher-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--nh-orange), #ff8c5a);
    color: #fff;
    flex-shrink: 0;
}
.nh-lc__launcher-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    text-align: left;
}
.nh-lc__launcher-kicker {
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--nh-gold-2);
    font-weight: 700;
}
.nh-lc__launcher-label {
    font-size: 0.86rem;
    font-weight: 600;
}
.nh-lc__pulse {
    position: absolute;
    left: 36px;
    top: 12px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3ee0b1;
    box-shadow: 0 0 0 0 rgba(62, 224, 177, 0.7);
    animation: nhLcPulse 2.2s infinite;
}

.nh-lc__panel {
    width: min(420px, calc(100vw - 24px));
    max-height: min(640px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    background: var(--nh-paper);
    border-radius: 22px 22px 10px 22px;
    box-shadow: var(--nh-shadow);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(20, 8, 38, 0.12);
}
.nh-lc__panel[hidden] { display: none !important; }
.nh-lc__panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    background:
        radial-gradient(circle at 7px 18px, transparent 5px, var(--nh-ink) 5.5px) 0 0 / 14px 28px,
        linear-gradient(180deg, var(--nh-ink), var(--nh-ink-2));
    pointer-events: none;
}

.nh-lc__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 16px 14px 28px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 107, 53, 0.22), transparent 42%),
        linear-gradient(135deg, var(--nh-ink) 0%, var(--nh-ink-2) 55%, #c4a06a 100%);
    color: #fff;
    border-bottom: 3px solid var(--nh-gold);
}
.nh-lc__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nh-lc__logo {
    height: 36px;
    width: auto;
    max-width: 92px;
    object-fit: contain;
    background: rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 3px 6px;
}
.nh-lc__monogram {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: linear-gradient(135deg, var(--nh-gold), var(--nh-orange));
    color: var(--nh-ink);
}
.nh-lc__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
}
.nh-lc__status {
    margin: 3px 0 0;
    font-size: 0.72rem;
    color: rgba(255,255,255,.78);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nh-lc__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3ee0b1;
    box-shadow: 0 0 0 3px rgba(62, 224, 177, 0.18);
}
.nh-lc__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.nh-lc__close:hover,
.nh-lc__close:focus-visible {
    background: rgba(255,255,255,.18);
    outline: 2px solid var(--nh-gold);
    outline-offset: 1px;
}

.nh-lc__body {
    padding: 14px 14px 12px 28px;
    overflow: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background:
        repeating-linear-gradient(-12deg, transparent, transparent 10px, rgba(212,160,23,.05) 10px, rgba(212,160,23,.05) 11px),
        var(--nh-paper);
}

.nh-lc__thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-bottom: 4px;
}

.nh-lc__bubble {
    background: #fff;
    border: 1px solid var(--nh-line);
    border-radius: 4px 16px 16px 16px;
    padding: 12px 14px;
    box-shadow: 0 6px 16px rgba(20, 8, 38, 0.05);
}
.nh-lc__bubble p { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.nh-lc__bubble-sub {
    margin-top: 8px !important;
    color: var(--nh-muted);
    font-size: 0.78rem !important;
}
.nh-lc__bubble--user {
    margin: 0 0 0 auto;
    max-width: 90%;
    background: linear-gradient(135deg, #fff4ea, #ffe4d4);
    border-color: rgba(255, 107, 53, 0.25);
    border-radius: 16px 4px 16px 16px;
    font-size: 0.84rem;
}
.nh-lc__bubble--agent { max-width: 92%; }
.nh-lc__bubble-meta {
    margin: 6px 0 0 !important;
    font-size: 0.68rem !important;
    color: var(--nh-muted);
}

.nh-lc__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 4px;
}
.nh-lc__chip {
    border: 1px dashed rgba(212, 160, 23, 0.7);
    background: #fff;
    color: var(--nh-ink);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.nh-lc__chip:hover,
.nh-lc__chip:focus-visible,
.nh-lc__chip.is-active {
    background: var(--nh-ink);
    color: var(--nh-gold-2);
    border-style: solid;
    outline: none;
}

.nh-lc__form { margin-top: 10px; display: grid; gap: 8px; }
.nh-lc__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.nh-lc__field { display: grid; gap: 4px; font-size: 0.72rem; font-weight: 600; color: var(--nh-muted); }
.nh-lc__field input,
.nh-lc__field textarea { min-width: 0; }
.nh-lc__field input,
.nh-lc__field textarea {
    width: 100%;
    border: 1px solid #eadfce;
    background: #fff;
    border-radius: 10px;
    padding: 9px 10px;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--nh-text);
}
.nh-lc__field textarea { resize: vertical; min-height: 74px; }
.nh-lc__field input:focus,
.nh-lc__field textarea:focus {
    outline: 2px solid rgba(255, 107, 53, 0.35);
    border-color: var(--nh-orange);
}
.nh-lc__hint { margin: 0; font-size: 0.7rem; color: var(--nh-muted); }
.nh-lc__alert {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    background: #fde7e9;
    color: #8a1520;
}
.nh-lc__alert--ok { background: #e5f6ec; color: #146c3d; }
.nh-lc__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 11px 14px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--nh-orange) 0%, #ff8c5a 55%, #c9a227 140%);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.28);
}
.nh-lc__submit:hover { filter: brightness(1.05); }
.nh-lc__submit:focus-visible { outline: 2px solid var(--nh-ink); outline-offset: 2px; }
.nh-lc__submit:disabled { opacity: .65; cursor: wait; }

.nh-lc__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.nh-lc__success { margin-top: 6px; }
.nh-lc__ticket-stub {
    border: 1px dashed var(--nh-gold);
    background: linear-gradient(180deg, #fff, var(--nh-paper-2));
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.nh-lc__success-kicker {
    margin: 0;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--nh-teal);
}
.nh-lc__success-no {
    margin: 6px 0 8px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--nh-ink);
    letter-spacing: 0.04em;
}
.nh-lc__success-copy { margin: 0; font-size: 0.82rem; color: var(--nh-muted); }

.nh-lc__foot {
    padding: 8px 14px 12px 28px;
    background: var(--nh-paper-2);
    border-top: 1px dashed var(--nh-line);
}
.nh-lc__wa {
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--nh-teal);
    text-decoration: none;
}
.nh-lc__wa:hover { color: var(--nh-orange); text-decoration: underline; }

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

.nh-lc.is-chatting .nh-lc__panel {
    height: min(640px, calc(100vh - 32px));
}
.nh-lc.is-chatting .nh-lc__body { padding-bottom: 8px; }
.nh-lc.is-chatting .nh-lc__chips,
.nh-lc.is-chatting .nh-lc__form { display: none; }

.nh-lc__composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px 12px 28px;
    background: var(--nh-paper-2);
    border-top: 1px solid var(--nh-line);
}
.nh-lc__composer[hidden] { display: none !important; }
.nh-lc__composer .nh-lc__alert { flex: 1 1 100%; }
.nh-lc__composer-field { flex: 1; min-width: 0; }
.nh-lc__composer-field textarea {
    width: 100%;
    border: 1px solid #eadfce;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.86rem;
    resize: none;
    min-height: 42px;
    max-height: 96px;
    color: var(--nh-text);
}
.nh-lc__composer-field textarea:focus {
    outline: 2px solid rgba(255, 107, 53, 0.35);
    border-color: var(--nh-orange);
}
.nh-lc__composer-send {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--nh-orange), #ff8c5a);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.nh-lc__composer-send:hover { filter: brightness(1.06); }
.nh-lc__composer-send:disabled { opacity: .65; cursor: wait; }

.nh-lc__new {
    margin: 0 14px 12px 28px;
    border: 0;
    background: transparent;
    color: var(--nh-teal);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.nh-lc__new[hidden] { display: none !important; }

@keyframes nhLcPulse {
    0% { box-shadow: 0 0 0 0 rgba(62, 224, 177, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(62, 224, 177, 0); }
    100% { box-shadow: 0 0 0 0 rgba(62, 224, 177, 0); }
}

@media (max-width: 640px) {
    .nh-lc { right: 12px; bottom: 12px; }
    .nh-lc__launcher-copy { display: none; }
    .nh-lc__launcher { padding: 8px; min-height: 52px; border-radius: 16px; }
    .nh-lc__row { grid-template-columns: 1fr; }
    .nh-lc__panel { max-height: min(78vh, 620px); }
}

@media (prefers-reduced-motion: reduce) {
    .nh-lc__pulse { animation: none; }
    .nh-lc__launcher { transition: none; }
}

html[data-theme="dark"] .nh-lc__panel {
    background: #142422;
    color: #e8eee9;
    border-color: rgba(201, 162, 39, 0.28);
}
html[data-theme="dark"] .nh-lc__body {
    background: #142422;
}
html[data-theme="dark"] .nh-lc__bubble,
html[data-theme="dark"] .nh-lc__chip,
html[data-theme="dark"] .nh-lc__field input,
html[data-theme="dark"] .nh-lc__field textarea,
html[data-theme="dark"] .nh-lc__ticket-stub {
    background: #1b302d;
    color: #e8eee9;
    border-color: rgba(201, 162, 39, 0.28);
}
html[data-theme="dark"] .nh-lc__composer { background: #10201e; }
html[data-theme="dark"] .nh-lc__composer-field textarea {
    background: #1b302d;
    color: #e8eee9;
    border-color: rgba(201, 162, 39, 0.28);
}
html[data-theme="dark"] .nh-lc__field { color: #b9c7c3; }
