/* ============================================================
   KHASAKH Help Assistant — chat widget styles
   ============================================================ */
.khc-launcher {
    position: fixed; right: 140px; bottom: 24px; z-index: 990;
    height: 48px; padding: 0 1.15rem 0 .95rem; border: 0; border-radius: 999px;
    display: inline-flex; align-items: center; gap: .55rem; cursor: pointer;
    background: var(--navy, #071d36); color: var(--gold-lt, #e8c46a);
    font: 800 .78rem/1 var(--font-sans, system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase;
    box-shadow: 0 14px 30px rgba(7, 29, 54, .28);
    border: 1px solid rgba(200, 155, 60, .45);
    transition: transform .2s, background .2s;
}
.khc-launcher:hover { transform: translateY(-2px); background: var(--navy-mid, #0c2d52); }
.khc-launcher .khc-ico-close { display: none; }
.khc-launcher.is-open .khc-ico-chat { display: none; }
.khc-launcher.is-open .khc-ico-close { display: block; }
.khc-launcher.is-open .khc-launcher-label::after { content: ''; }

.khc-panel {
    position: fixed; right: 24px; bottom: 88px; z-index: 1000; padding: 0; margin: 0;
    width: 380px; height: min(620px, calc(100vh - 120px));
    display: flex; flex-direction: column;
    background: var(--canvas, #f4f1eb); border-radius: 22px; overflow: hidden;
    box-shadow: 0 30px 70px rgba(7, 29, 54, .3);
    border: 1px solid rgba(7, 29, 54, .08);
    font-family: var(--font-sans, system-ui, sans-serif);
    animation: khcIn .22s ease;
}
.khc-panel[hidden] { display: none; }
@keyframes khcIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.khc-head {
    display: flex; align-items: center; gap: .75rem;
    background: var(--navy, #071d36); color: #fff; padding: .9rem 1rem;
    border-bottom: 3px solid var(--gold, #c89b3c);
}
.khc-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--gold, #c89b3c); color: var(--navy, #071d36);
    font: 700 1.1rem/1 var(--font-serif, Georgia, serif);
    display: flex; align-items: center; justify-content: center;
}
.khc-head-text { flex: 1; line-height: 1.2; }
.khc-head-text strong { display: block; font-size: 1rem; color: var(--gold-lt, #e8c46a); }
.khc-head-text small { font-size: .74rem; color: rgba(255, 255, 255, .65); }
.khc-close {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2);
    background: transparent; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.khc-close:hover { border-color: var(--gold, #c89b3c); color: var(--gold-lt, #e8c46a); }

.khc-notice {
    margin: 0; padding: .5rem 1rem; font-size: .74rem; font-weight: 600;
    background: var(--gold-pale, #f6ead0); color: var(--navy, #071d36);
    border-bottom: 1px solid rgba(200, 155, 60, .35);
}

.khc-log {
    flex: 1; overflow-y: auto; padding: 1rem .9rem .6rem;
    display: flex; flex-direction: column; gap: .55rem;
    scroll-behavior: smooth;
}
.khc-msg {
    max-width: 88%; padding: .7rem .9rem; border-radius: 16px;
    font-size: .9rem; line-height: 1.5; word-wrap: break-word;
}
.khc-bot {
    align-self: flex-start; background: #fff; color: var(--ink, #122033);
    border-bottom-left-radius: 6px; box-shadow: 0 4px 14px rgba(7, 29, 54, .06);
}
.khc-user {
    align-self: flex-end; background: var(--navy, #071d36); color: #fff;
    border-bottom-right-radius: 6px;
}
.khc-text b { color: var(--navy, #071d36); }
.khc-text ul { margin: .4rem 0 .2rem 1.1rem; padding: 0; }
.khc-text li { margin-bottom: .25rem; }

.khc-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.khc-link {
    display: inline-block; text-decoration: none;
    background: var(--navy, #071d36); color: var(--gold-lt, #e8c46a);
    font-size: .74rem; font-weight: 800; letter-spacing: .03em;
    padding: .42rem .75rem; border-radius: 999px;
}
.khc-link:hover { background: var(--navy-mid, #0c2d52); }

.khc-chip-row { align-self: flex-start; max-width: 100%; }
.khc-chip-label {
    display: block; margin: .1rem 0 .3rem .2rem;
    font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--gold, #c89b3c);
}
.khc-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.khc-chip {
    border: 1.5px solid var(--gold, #c89b3c); background: #fff; color: var(--navy, #071d36);
    font: 700 .8rem/1.2 var(--font-sans, system-ui, sans-serif);
    padding: .45rem .75rem; border-radius: 999px; cursor: pointer; text-align: left;
}
.khc-chip:hover { background: var(--gold-pale, #f6ead0); }
.khc-bot .khc-chip { margin-top: .2rem; }

.khc-typing { display: flex; gap: 4px; padding: .8rem .9rem; }
.khc-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--slate, #5a6a7a);
    animation: khcDot 1s infinite ease-in-out;
}
.khc-typing span:nth-child(2) { animation-delay: .15s; }
.khc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes khcDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.khc-form {
    display: flex; gap: .5rem; padding: .7rem; background: #fff;
    border-top: 1px solid rgba(7, 29, 54, .08);
}
.khc-input {
    flex: 1; min-width: 0; border: 1px solid rgba(7, 29, 54, .14); border-radius: 999px;
    padding: .7rem 1rem; font: 500 .92rem var(--font-sans, system-ui, sans-serif);
    background: var(--canvas, #f4f1eb); outline: none; color: var(--ink, #122033);
}
.khc-input:focus { border-color: var(--gold, #c89b3c); background: #fff; }
.khc-send {
    width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--gold, #c89b3c); color: var(--navy, #071d36);
    display: flex; align-items: center; justify-content: center;
}
.khc-send:hover { background: var(--gold-lt, #e8c46a); }
.khc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 560px) {
    .khc-launcher { right: 22px; bottom: 136px; width: 48px; padding: 0; justify-content: center; }
    .khc-launcher-label { display: none; }
    .khc-panel {
        right: 8px; left: 8px; bottom: 8px; width: auto;
        height: calc(100vh - 16px); height: calc(100dvh - 16px);
        border-radius: 18px;
    }
    .khc-launcher.is-open { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .khc-panel { animation: none; }
    .khc-typing span { animation: none; opacity: .6; }
}
