#lkc-chat {
    font: 15px/1.5 system-ui, sans-serif;
    color: var(--lkc-ink);
    --lkc-accent: #075b56;
    --lkc-on-accent: #fff;
    --lkc-ink: #172638;
    --lkc-panel-color: #fff;
    --lkc-chat-color: #edf4f3;
    --lkc-bubble: #fff;
    --lkc-line: #cddbd9;
    --lkc-field-line: #9caeac;
    --lkc-link: #075b56;
}
#lkc-chat[data-theme="dark"] {
    color-scheme: dark;
    --lkc-ink: #f1f5f9;
    --lkc-panel-color: #172331;
    --lkc-chat-color: #0f1824;
    --lkc-bubble: #26364a;
    --lkc-line: #3a4b60;
    --lkc-field-line: #718398;
    --lkc-link: #9befe1;
}
@media (prefers-color-scheme: dark) {
    #lkc-chat[data-theme="system"] {
        color-scheme: dark;
        --lkc-ink: #f1f5f9;
        --lkc-panel-color: #172331;
        --lkc-chat-color: #0f1824;
        --lkc-bubble: #26364a;
        --lkc-line: #3a4b60;
        --lkc-field-line: #718398;
        --lkc-link: #9befe1;
    }
}
#lkc-chat.lkc-floating {
    position: fixed;
    z-index: 99999;
    --lkc-edge-x: min(var(--lkc-offset-x, 16px), max(0px, calc(100vw - 160px)));
    --lkc-edge-y: min(var(--lkc-offset-y, 16px), max(0px, calc(100dvh - 180px)));
    right: var(--lkc-edge-x);
    bottom: var(--lkc-edge-y);
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: .5rem;
}
#lkc-chat.lkc-floating[data-position$="-left"] { left: var(--lkc-edge-x); right: auto; align-items: flex-start; }
#lkc-chat.lkc-floating[data-position^="top-"] { top: var(--lkc-edge-y); bottom: auto; flex-direction: column; }
body.admin-bar #lkc-chat.lkc-floating[data-position^="top-"] {
    top: calc(var(--lkc-edge-y) + var(--wp-admin--admin-bar--height, 32px));
}
#lkc-chat .lkc-launcher { display: flex; align-items: center; gap: .55rem; max-width: calc(100vw - 2rem); }
#lkc-chat[data-position$="-right"] .lkc-launcher { flex-direction: row-reverse; }
#lkc-chat .lkc-launcher .lkc-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .5rem;
    min-height: 46px;
    border-radius: 999px;
    box-shadow: 0 4px 14px #142a3533;
}
#lkc-chat[data-shape="circle"] .lkc-toggle, #lkc-chat[data-shape="rounded"] .lkc-toggle {
    width: 54px;
    height: 54px;
    justify-content: center;
    padding: 0;
}
#lkc-chat[data-shape="rounded"] .lkc-toggle { border-radius: 14px; }
#lkc-chat:not([data-shape="pill"]) .lkc-toggle-text { display: none; }
#lkc-chat .lkc-toggle-icon { position: relative; display: grid; place-items: center; width: 25px; height: 25px; }
#lkc-chat .lkc-toggle-icon:before {
    content: "";
    width: 18px;
    height: 15px;
    border-radius: 6px 6px 6px 2px;
    background: var(--lkc-on-accent);
}
#lkc-chat .lkc-toggle-icon img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}
#lkc-chat:not([data-shape="pill"]) .lkc-toggle-icon { width: 38px; height: 38px; }
#lkc-chat .lkc-highlight {
    margin: 0;
    max-width: 220px;
    padding: .48rem .7rem;
    border-radius: 12px;
    border: 1px solid var(--lkc-line);
    color: var(--lkc-ink);
    background: var(--lkc-panel-color);
    box-shadow: 0 4px 14px #142a3522;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
#lkc-chat .lkc-highlight[hidden] { display: none; }
#lkc-chat section {
    width: min(380px, calc(100vw - 2rem));
    box-sizing: border-box;
    max-height: min(700px, calc(100dvh - 5rem));
    overflow: auto;
    border: 1px solid var(--lkc-line);
    border-radius: 16px;
    background: var(--lkc-panel-color);
    padding: 1rem;
    box-shadow: 0 12px 32px #142a3522;
}
#lkc-chat.lkc-floating section {
    width: min(380px, calc(100vw - var(--lkc-edge-x) - 8px));
    max-height: min(700px, calc(100dvh - var(--lkc-edge-y) - 62px - var(--wp-admin--admin-bar--height, 0px)));
}
#lkc-chat.lkc-floating .lkc-launcher { max-width: calc(100vw - var(--lkc-edge-x) - 8px); }
#lkc-chat section[hidden] { display: none; }
#lkc-chat h2 { font: 700 1.15rem/1.3 system-ui, sans-serif; color: inherit; margin: 0 0 .6rem; }
#lkc-chat p { margin: 0 0 .5rem; }
#lkc-chat .lkc-log {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    background-color: var(--lkc-chat-color);
    background-position: center;
    background-size: cover;
    border: 1px solid var(--lkc-line);
    border-radius: 12px;
    padding: .8rem;
    min-height: 7rem;
    max-height: min(34vh, 270px);
    overflow-y: auto;
    overflow-wrap: anywhere;
}
#lkc-chat .lkc-log p { white-space: pre-wrap; }
#lkc-chat .lkc-log .lkc-user, #lkc-chat .lkc-log .lkc-reply {
    align-self: flex-start;
    max-width: 85%;
    box-sizing: border-box;
    margin: 0;
    padding: .55rem .75rem;
    border-radius: 14px 14px 14px 4px;
    background: var(--lkc-bubble);
    color: var(--lkc-ink);
    box-shadow: 0 2px 6px #0002;
}
#lkc-chat .lkc-log .lkc-user {
    align-self: flex-end;
    background: var(--lkc-accent);
    color: var(--lkc-on-accent);
    border-radius: 14px 14px 4px 14px;
}
#lkc-chat .lkc-log details, #lkc-chat .lkc-video {
    border-radius: 10px;
    background: var(--lkc-bubble);
    padding: .5rem .65rem;
}
#lkc-chat .lkc-video { margin: .55rem 0 .75rem; }
#lkc-chat .lkc-video figcaption { margin-bottom: .3rem; font-weight: 600; }
#lkc-chat .lkc-video video, #lkc-chat .lkc-video iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 8px;
    background: #172638;
}
#lkc-chat .lkc-log:has(.lkc-video) { max-height: min(48vh, 350px); }
#lkc-chat form { margin: .55rem 0; }
#lkc-chat label { display: block; margin: .45rem 0; }
#lkc-chat a { display: block; color: var(--lkc-link); text-decoration: underline; }
#lkc-chat summary { cursor: pointer; }
#lkc-chat audio { width: 100%; }
#lkc-chat .lkc-status:empty { display: none; }
#lkc-chat .lkc-status { margin-top: .5rem; }
#lkc-chat input:not([type=checkbox]), #lkc-chat select, #lkc-chat textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: .45rem;
    border: 1px solid var(--lkc-field-line);
    border-radius: 6px;
    background: var(--lkc-panel-color);
    color: inherit;
    font: inherit;
}
#lkc-chat button {
    padding: .45rem .8rem;
    border: 0;
    border-radius: 8px;
    background: var(--lkc-accent);
    color: var(--lkc-on-accent);
    font: 600 .9rem/1.5 system-ui, sans-serif;
    cursor: pointer;
}
#lkc-chat button:disabled { opacity: .6; cursor: wait; }
#lkc-chat .lkc-composer { position: relative; }
#lkc-chat .lkc-composer textarea {
    min-height: 56px;
    padding: 15px 60px 15px 60px;
    border-radius: 22px;
    line-height: 24px;
    resize: vertical;
}
#lkc-chat .lkc-composer .lkc-send {
    position: absolute;
    right: 6px;
    bottom: 6px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}
#lkc-chat .lkc-composer .lkc-send::before {
    content: "";
    width: 12px;
    height: 16px;
    background: currentColor;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}
#lkc-chat .lkc-composer textarea::placeholder { color: inherit; opacity: .75; }
#lkc-chat .lkc-composer .lkc-mic {
    position: absolute;
    left: 6px;
    bottom: 6px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--lkc-line);
    border-radius: 50%;
    background: #fff;
    color: var(--lkc-accent);
}
#lkc-chat .lkc-composer .lkc-mic[aria-pressed="true"] { outline: 2px solid var(--lkc-accent); }
#lkc-chat .lkc-mic-icon { position: relative; width: 14px; height: 19px; }
#lkc-chat .lkc-mic-icon::before {
    content: "";
    position: absolute;
    width: 6px;
    height: 11px;
    left: 4px;
    top: 0;
    background: currentColor;
    border-radius: 5px;
}
#lkc-chat .lkc-mic-icon::after {
    content: "";
    position: absolute;
    inset: 6px 0 4px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 0 -3px currentColor;
}
#lkc-chat :focus-visible { outline: 2px solid #004a94; outline-offset: 2px; }

#lkc-chat .lkc-listen {
    align-self: flex-start;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: .85rem;
    padding: .2rem .65rem;
}
