
.kg-msg-panel[hidden],
.kg-msg-empty[hidden],
.kg-chat-blocked-notice[hidden],
.kg-chat-mod-notice[hidden],
.kg-chan-slow-row[hidden],
.kg-chat-level[hidden],
.kg-chat-placeholder[hidden],
.kg-chat-selbar[hidden],
.kg-chat-composer-bar[hidden],
.kg-chat-footer[hidden],
.kg-chat-down[hidden],
.kg-chat-down-badge[hidden],
.kg-chat-offline[hidden],
.kg-chat-back[hidden],
.kg-chat-close[hidden],
.kg-chat-selbar-btn[hidden] { display: none !important; }

:root {
    --kg-top: 74px;
    --kg-bottom: 0px;
    --kg-kb: 0px;

    --kg-msg-gap: 4px;
    --kg-group-gap: 16px;
    --kg-day-gap: 18px;
}

.messages-page {
    max-width: 1480px;
    margin: 0 auto;

    padding: calc(var(--kg-top) + 16px) 16px 24px;
    min-height: 100vh;
    box-sizing: border-box;
}

.kg-messages-wrap {
    position: relative;
    display: flex;
    gap: 18px;
    height: calc(100vh - var(--kg-top) - 40px);
    height: calc(100dvh - var(--kg-top) - 40px);
    min-height: 420px;
}

.kg-msg-panel {
    background: var(--card, #1c0e12);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kg-msg-list-panel {
    flex: 0 0 clamp(320px, 27vw, 380px);
    padding: 18px 0 0;
}

.kg-msg-chat-panel {
    position: relative;
    flex: 1;
    min-width: 0;
}

.kg-msg-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 0.03em;
    padding: 0 18px 14px;
    margin: 0;
    color: var(--cream);
}

.kg-msg-listhead {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 18px 14px 12px;
}

.kg-msg-listhead .kg-msg-title {
    flex: 1 1 auto;
    font-size: 24px;
    min-width: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kg-msg-exit {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
    min-height: 36px;
    padding: 0 14px 0 8px;
    border: 1px solid rgba(243, 237, 226, 0.4);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--cream);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.kg-msg-exit:active {
    background: rgba(212, 175, 55, 0.14);
}

.kg-msg-exit:hover {
    border-color: var(--gold-dim);
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold);
}

.kg-msg-exit:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

@media (pointer: coarse) {
    .kg-msg-exit { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .kg-msg-exit { transition: none; }
}

.kg-msg-conversations {
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
    min-height: 0;
    padding: 6px 0 10px;
    border-top: 1px solid var(--line);
}

.kg-msg-item {
    width: calc(100% - 16px);
    margin: 2px 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: 12px;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.kg-msg-item:hover { background: rgba(255, 255, 255, 0.04); }
.kg-msg-item.is-active { background: rgba(212, 175, 55, 0.09); border-color: rgba(212, 175, 55, 0.32); }
.kg-msg-item.is-active .kg-msg-item-name { color: var(--gold); }
.kg-msg-item.has-unread .kg-msg-item-preview { color: var(--cream); }
.kg-msg-item.has-unread .kg-msg-item-time { color: var(--gold); font-weight: 600; }

.kg-msg-item-avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--burgundy, #2a0e14);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    color: var(--gold);
}

.kg-msg-item-body { flex: 1; min-width: 0; }

.kg-msg-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.kg-msg-item-name {
    font-weight: 600;
    color: var(--cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kg-msg-item-time { flex: 0 0 auto; font-size: 11px; color: var(--cream-dim); }

.kg-msg-item-preview {
    font-size: 13px;
    color: var(--cream-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kg-msg-item-draft { color: var(--crimson-bright, #e0485f); font-weight: 600; }

.kg-msg-item-unread {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--crimson, #d61f3c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.kg-msg-empty { padding: 40px 24px; text-align: center; color: var(--cream-dim); }
.kg-msg-empty .kg-empty-icon { font-size: 34px; margin-bottom: 10px; }
.kg-msg-empty h2 { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--cream); margin: 0 0 6px; }
.kg-msg-empty p { font-size: 13px; margin: 0; }



.kg-chat-placeholder {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--cream-dim);
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(200, 32, 58, 0.14), transparent 70%),
        radial-gradient(ellipse 40% 30% at 50% 44%, rgba(212, 175, 55, 0.06), transparent 70%),
        var(--card, #1c0e12);
}
.kg-chat-placeholder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 380px;
    text-align: center;
}
.kg-chat-placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 6px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: radial-gradient(circle at 35% 30%, rgba(212, 175, 55, 0.16), rgba(42, 14, 20, 0.9) 70%);
    color: var(--gold);
    box-shadow: 0 0 0 8px rgba(212, 175, 55, 0.04), 0 18px 40px -18px rgba(200, 32, 58, 0.6);
}
.kg-chat-placeholder-title {
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 30px;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--cream);
}
.kg-chat-placeholder-text { margin: 0; font-size: 14px; line-height: 1.5; }
.kg-chat-placeholder-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}
.kg-chat-placeholder-btn {
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--cream);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.kg-chat-placeholder-btn:hover { border-color: rgba(243, 237, 226, 0.3); background: rgba(255, 255, 255, 0.07); }
.kg-chat-placeholder-btn.is-primary { border-color: var(--gold-dim); background: rgba(212, 175, 55, 0.1); color: var(--gold); }
.kg-chat-placeholder-btn.is-primary:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.18); }
.kg-chat-placeholder-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.kg-msg-chat-panel.is-empty > :not(.kg-chat-placeholder) { visibility: hidden; }

.kg-chat-header,
.kg-chat-selbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    min-height: 62px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}

.kg-chat-back {
    background: none;
    border: none;
    color: var(--cream);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: -8px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.kg-chat-back:hover { background: rgba(255, 255, 255, 0.05); }

.kg-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--burgundy, #2a0e14);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    color: var(--gold);
    flex: 0 0 auto;
}

.kg-chat-headline {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.kg-chat-username {
    font-weight: 600;
    color: var(--cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kg-chat-level {
    font-size: 11px;
    color: var(--gold-dim);
    white-space: nowrap;
}

.kg-chat-block-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--line);
    color: var(--cream-dim);
    border-radius: 8px;
    padding: 0 10px;
    min-height: 36px;
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}
.kg-chat-block-btn:hover { border-color: #d97070; color: #d97070; }

.kg-chat-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-right: -4px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.kg-chat-close:hover { background: rgba(255, 255, 255, 0.07); color: var(--cream); }
.kg-chat-close:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }


.kg-chat-selbar { gap: 6px; }
.kg-chat-selbar-count { flex: 1; min-width: 0; font-weight: 700; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-chat-selbar-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--cream);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kg-chat-selbar-btn:hover { background: rgba(255, 255, 255, 0.06); }
.kg-chat-selbar-btn.is-danger { color: #e0485f; }
.kg-msg-chat-panel.is-selecting .kg-chat-header { display: none; }
.kg-msg-chat-panel.is-selecting .kg-chat-footer { display: none; }


.kg-chat-body {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.kg-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
}

.kg-chat-day {
    align-self: center;
    margin: var(--kg-day-gap) 0 0;
    pointer-events: none;
}
.kg-chat-day:first-child { margin-top: 4px; }
.kg-chat-day > span,
.kg-chat-sticky-day {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(12, 10, 16, 0.72);
    border: 1px solid var(--line);
    color: var(--cream);
    font-size: 12px;
    font-weight: 600;
}

.kg-chat-sticky-day {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 4;
    transform: translate(-50%, -6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.kg-chat-sticky-day.is-visible { opacity: 1; transform: translate(-50%, 0); }


.kg-msg-row {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: var(--kg-msg-gap);
    flex: 0 0 auto;
}
.kg-msg-row.is-group-start { margin-top: var(--kg-group-gap); }
.kg-msg-row.is-mine { justify-content: flex-end; }
.kg-msg-row.is-removing {
    overflow: hidden;
    transition: height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.kg-chat-bubble {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    max-width: 75%;
    min-width: 0;
    padding: 8px 12px 6px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.kg-chat-bubble--mine {
    background: linear-gradient(135deg, var(--crimson, #c8203a), var(--crimson-bright, #d61f3c));
    color: #fff;
}

.kg-chat-bubble--theirs {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line);
    color: var(--cream);
}


.kg-msg-row.is-mine.is-group-end .kg-chat-bubble { border-bottom-right-radius: 6px; }
.kg-msg-row.is-theirs.is-group-end .kg-chat-bubble { border-bottom-left-radius: 6px; }

.kg-chat-bubble-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    min-width: 0;
}


.kg-chat-meta {
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 6px 0 -2px 8px;
    font-size: 11px;
    line-height: 1;
    opacity: 0.7;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}
.kg-chat-edited { font-style: italic; }
.kg-chat-status { display: inline-flex; }
.kg-chat-status.is-read { opacity: 1; }
.kg-chat-status.is-failed { color: #ffd166; opacity: 1; }

.kg-msg-row.is-pending .kg-chat-bubble { opacity: 0.6; }
.kg-msg-row.is-failed .kg-chat-bubble { opacity: 0.85; outline: 1px solid rgba(255, 209, 102, 0.6); }

.kg-chat-retry {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    min-height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 209, 102, 0.6);
    background: rgba(255, 209, 102, 0.1);
    color: #ffd166;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    order: -1;
}

.kg-chat-quote {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
    max-width: 100%;
    margin: 0 0 6px;
    padding: 4px 8px;
    border: none;
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.kg-chat-bubble--mine .kg-chat-quote { border-left-color: #fff; background: rgba(0, 0, 0, 0.16); }
.kg-chat-quote-name { font-size: 12px; font-weight: 700; color: var(--gold); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-chat-bubble--mine .kg-chat-quote-name { color: #fff; }
.kg-chat-quote-text { font-size: 12px; opacity: 0.85; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-chat-quote-text.is-deleted { font-style: italic; opacity: 0.7; }


@keyframes kgMsgHighlight {
    0%, 60% { background: rgba(212, 175, 55, 0.22); }
    100% { background: transparent; }
}
.kg-msg-row.is-highlight { animation: kgMsgHighlight 1.2s ease-out; border-radius: 10px; }


.kg-msg-check {
    order: -2;
    align-self: center;
    flex: 0 0 auto;
    width: 0;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    overflow: hidden;
    transform: scale(0.6);
    opacity: 0;
    transition: width 0.18s, transform 0.18s, opacity 0.18s, background 0.15s;
}
.kg-msg-check svg { width: 14px; height: 14px; }
.kg-msg-chat-panel.is-selecting .kg-msg-check {
    width: 22px;
    border-color: var(--cream-dim);
    transform: scale(1);
    opacity: 1;
}
.kg-msg-chat-panel.is-selecting .kg-msg-row { cursor: pointer; }
.kg-msg-chat-panel.is-selecting .kg-msg-row.is-mine .kg-msg-check { margin-right: auto; }
.kg-msg-row.is-selected .kg-msg-check { background: var(--gold); border-color: var(--gold); color: #1b0d10; }
.kg-msg-row.is-selected { background: rgba(212, 175, 55, 0.08); border-radius: 10px; }

.kg-swipe-icon {
    position: absolute;
    right: 4px;
    top: 50%;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-50%) scale(0.5);
    pointer-events: none;
}


.kg-msg-hover {
    display: none;
    align-self: center;
    gap: 2px;
}
.kg-msg-row.is-mine .kg-msg-hover { order: -1; }
.kg-msg-hover-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kg-msg-hover-btn:hover { color: var(--cream); background: rgba(255, 255, 255, 0.12); }

@media (hover: hover) and (pointer: fine) {
    .kg-msg-row:hover .kg-msg-hover,
    .kg-msg-row:focus-within .kg-msg-hover { display: inline-flex; }
    .kg-msg-chat-panel.is-selecting .kg-msg-row .kg-msg-hover { display: none; }
}

@media (pointer: coarse) {
    .kg-msg-row,
    .kg-chat-bubble {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
}


.kg-chat-down {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 4;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(28, 14, 18, 0.92);
    color: var(--cream);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.6);
}
.kg-chat-down-label { display: none; white-space: nowrap; }
.kg-chat-down.has-new .kg-chat-down-label { display: inline; }
.kg-chat-down-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--crimson, #d61f3c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kg-chat-offline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 6px 12px;
    text-align: center;
    font-size: 12px;
    color: #1b0d10;
    background: #ffd166;
}

.kg-chat-blocked-notice {
    padding: 8px 16px;
    font-size: 12px;
    text-align: center;
    color: var(--cream-dim);
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--line);
}

.kg-chat-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    flex: 0 0 auto;
    background: var(--card, #1c0e12);
}

.kg-chat-footer-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.kg-chat-composer-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 2px 0 2px 4px;
}
.kg-composer-bar-icon { flex: 0 0 auto; color: var(--gold); display: inline-flex; }
.kg-composer-bar-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 2px 0 2px 10px;
    border: none;
    border-left: 3px solid var(--gold);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.kg-composer-bar-title { font-size: 12px; font-weight: 700; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-composer-bar-text { font-size: 13px; color: var(--cream-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-composer-bar-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kg-composer-bar-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--cream); }

.kg-chat-input {
    flex: 1;
    min-width: 0;
    resize: none;
    min-height: 42px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 21px;
    color: var(--cream);
    padding: 10px 14px;
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
    overflow-y: hidden;
}
.kg-chat-input::placeholder { color: var(--cream-dim); opacity: 0.8; }
.kg-chat-input:focus { outline: none; border-color: var(--gold-dim); }
.kg-chat-input:disabled { opacity: 0.6; }

.kg-chat-send-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--crimson, #d61f3c);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.kg-chat-send-btn.is-edit { background: var(--gold, #d4af37); color: #1b0d10; }
.kg-chat-send-btn:disabled { opacity: 0.5; cursor: default; }


.kg-menu {
    position: fixed;
    z-index: 260;
    min-width: 190px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(28, 14, 18, 0.97);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.18s, transform 0.18s;
}
.kg-menu--context { transform-origin: top left; }
.kg-menu--context.is-open,
.kg-lp-overlay.is-open .kg-menu--sheet { opacity: 1; transform: scale(1); }

.kg-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--cream);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}
.kg-menu-item:hover,
.kg-menu-item:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
.kg-menu-item.is-danger { color: #e0485f; }
.kg-menu--sheet .kg-menu-item { min-height: 46px; font-size: 15px; }

.kg-lp-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(6, 4, 8, 0.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.18s;
    touch-action: none;
}
.kg-lp-overlay.is-open { opacity: 1; }

.kg-lp-clone {
    position: fixed;
    margin: 0;
    max-width: none;
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.7);
    transform: scale(1);
    transition: transform 0.18s;
    pointer-events: none;
}
.kg-lp-overlay.is-open .kg-lp-clone { transform: scale(1.02); }

.kg-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 270;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 4, 8, 0.6);
    opacity: 0;
    transition: opacity 0.16s;
}
.kg-dialog-overlay.is-open { opacity: 1; }
.kg-dialog {
    width: 100%;
    max-width: 360px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--card, #1c0e12);
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.8);
}
.kg-dialog-title { margin: 0 0 14px; font-size: 17px; color: var(--cream); }
.kg-dialog-check { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--cream-dim); font-size: 14px; cursor: pointer; }
.kg-dialog-check input { width: 18px; height: 18px; accent-color: var(--crimson, #d61f3c); }
.kg-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.kg-dialog-btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: none;
    color: var(--cream);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.kg-dialog-btn.is-danger { border-color: transparent; background: var(--crimson, #d61f3c); color: #fff; }



@media (min-width: 900px) {
    .kg-chat-back { display: none !important; }
}

@media (max-width: 899px) {
    .kg-chat-close { display: none !important; }
}

@media (min-width: 900px) and (max-width: 1100px) {
    .kg-msg-list-panel { flex-basis: 300px; }
    .kg-msg-listhead .kg-msg-title { font-size: 22px; }
}

@media (min-width: 1600px) {
    .kg-chat-bubble { max-width: 60%; }
    :root { --kg-msg-gap: 6px; --kg-group-gap: 20px; --kg-day-gap: 22px; }
}

@media (min-width: 2200px) {
    :root { --kg-msg-gap: 8px; --kg-group-gap: 24px; --kg-day-gap: 26px; }
}


@media (min-width: 480px) and (max-width: 899px) {
    :root { --kg-msg-gap: 4px; --kg-group-gap: 14px; --kg-day-gap: 16px; }
}


@media (max-width: 479px) {
    :root { --kg-msg-gap: 3px; --kg-group-gap: 12px; --kg-day-gap: 14px; }
}

@media (max-width: 359px) {
    :root { --kg-msg-gap: 3px; --kg-group-gap: 10px; --kg-day-gap: 12px; }
}

@media (max-width: 899px) {

    html.kg-messages-lock,
    html.kg-messages-lock body.kg-messages-body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }
    html.kg-messages-lock body.kg-messages-body { padding-bottom: 0; }

    .messages-page {
        padding: var(--kg-top) 0 0;
        min-height: 0;
    }

    .kg-messages-wrap {
        height: calc(100vh - var(--kg-top) - var(--kg-bottom) - var(--kg-kb));
        height: calc(100dvh - var(--kg-top) - var(--kg-bottom) - var(--kg-kb));
        min-height: 0;
        gap: 0;
        overflow: hidden;
    }

    .kg-msg-panel { flex: 1 1 auto; width: 100%; border-radius: 0; border-left: none; border-right: none; border-top: none; }
    .kg-msg-list-panel { padding-top: 14px; }
    .kg-msg-title { font-size: 22px; padding: 0 16px 10px; }
    .kg-msg-listhead { padding: 0 16px 10px 10px; }

    .kg-messages-wrap:not(.is-chat-open) .kg-msg-chat-panel { display: none; }
    .kg-messages-wrap.is-chat-open .kg-msg-list-panel { display: none; }

    .kg-chat-bubble { max-width: 85%; }
    .kg-chat-input { font-size: 16px; }
    .kg-chat-footer { padding: 8px 10px; }

    .kg-messages-wrap.is-edge-swiping .kg-msg-list-panel {
        display: flex;
        position: absolute;
        inset: 0;
        z-index: 1;
        transform: translateX(calc(-30% + 30% * var(--kg-edge-p, 0)));
    }
    .kg-messages-wrap.is-edge-swiping .kg-msg-list-panel::after {
        content: '';
        position: absolute;
        inset: 0;
        background: #000;
        opacity: calc(0.45 * (1 - var(--kg-edge-p, 0)));
        pointer-events: none;
    }
    .kg-messages-wrap.is-edge-swiping .kg-msg-chat-panel {
        position: absolute;
        inset: 0;
        z-index: 2;
        transform: translateX(var(--kg-edge-x, 0px));
        box-shadow: -12px 0 30px -12px rgba(0, 0, 0, 0.7);
    }
    .kg-messages-wrap.is-edge-settling .kg-msg-chat-panel,
    .kg-messages-wrap.is-edge-settling .kg-msg-list-panel { transition: transform 0.2s cubic-bezier(.2, .8, .2, 1); }
    .kg-messages-wrap.is-edge-settling .kg-msg-list-panel::after { transition: opacity 0.2s; }
}

@media (min-width: 768px) and (max-width: 899px) {
    .kg-chat-footer { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}
body.kg-kb-open .kg-chat-footer { padding-bottom: 8px; }
body.kg-kb-open .mobile-bottom-nav { visibility: hidden; }

@media (max-width: 479px) {
    .kg-chat-block-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
    .kg-chat-block-label { display: none; }
    .kg-chat-header { gap: 10px; padding: 8px 10px; }
    .kg-chat-messages { padding: 10px 8px 12px; }
}

@media (max-width: 899px) and (orientation: landscape) and (max-height: 500px) {
    .kg-chat-header, .kg-chat-selbar { min-height: 50px; padding-top: 4px; padding-bottom: 4px; }
    .kg-chat-avatar { width: 34px; height: 34px; }
    body:not(.kg-kb-open) .kg-chat-messages { min-height: 180px; }
    :root { --kg-msg-gap: 2px; --kg-group-gap: 8px; --kg-day-gap: 10px; }
    .kg-msg-list-panel { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .kg-msg-row.is-removing,
    .kg-msg-check,
    .kg-chat-sticky-day,
    .kg-menu,
    .kg-lp-overlay,
    .kg-lp-clone,
    .kg-dialog-overlay,
    .kg-chat-send-btn,
    .kg-messages-wrap.is-edge-settling .kg-msg-chat-panel,
    .kg-messages-wrap.is-edge-settling .kg-msg-list-panel { transition: none !important; }
    .kg-msg-row.is-highlight { animation: none; background: rgba(212, 175, 55, 0.18); }
    .kg-lp-overlay.is-open .kg-lp-clone { transform: none; }
}
.kg-msg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.kg-msg-search-results[hidden],
.kg-msg-skeleton[hidden],
.kg-msg-list-error[hidden],
.kg-msg-search-clear[hidden],
.kg-chat-searchbar[hidden],
.kg-chat-search-results[hidden] { display: none !important; }

.kg-msg-search {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 14px 12px;
    flex: 0 0 auto;
}

.kg-msg-search-icon {
    position: absolute;
    left: 12px;
    color: var(--cream);
    opacity: 0.75;
    pointer-events: none;
}

.kg-msg-search-input,
.kg-chat-search-input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 40px 8px 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--cream);
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.kg-msg-search-input::-webkit-search-cancel-button,
.kg-chat-search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.kg-msg-search-input::placeholder,
.kg-chat-search-input::placeholder { color: var(--cream-dim); opacity: 0.8; }
.kg-msg-search-input:focus,
.kg-chat-search-input:focus { outline: none; border-color: var(--gold-dim); background: rgba(255, 255, 255, 0.06); }
.kg-msg-search-input:focus-visible,
.kg-chat-search-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.kg-msg-search-clear {
    position: absolute;
    right: 2px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}
.kg-msg-search-clear:hover { color: var(--cream); background: rgba(255, 255, 255, 0.06); }
.kg-msg-search-clear:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.kg-msg-list-panel.is-searching .kg-msg-conversations,
.kg-msg-list-panel.is-searching .kg-msg-empty,
.kg-msg-list-panel.is-searching .kg-msg-skeleton { display: none !important; }

.kg-msg-search-results {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.kg-search-section + .kg-search-section { margin-top: 6px; }

.kg-msg-section { margin-top: 6px; padding-top: 2px; border-top: 1px solid var(--line); }

.kg-search-heading {
    margin: 0;
    padding: 10px 18px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}

.kg-search-list { list-style: none; margin: 0; padding: 0; }

.kg-search-item .kg-msg-item-name,
.kg-search-item .kg-msg-item-preview { display: block; }
.kg-search-item .kg-msg-item-top .kg-msg-item-name { min-width: 0; }
.kg-search-item[disabled] { opacity: 0.6; cursor: progress; }

.kg-msg-item:focus-visible,
.kg-csr-item:focus-visible,
.kg-csr-more:focus-visible,
.kg-msg-retry-btn:focus-visible,
.kg-react-chip:focus-visible,
.kg-chat-search-btn:focus-visible,
.kg-chat-search-close:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.kg-search-mark {
    background: rgba(212, 175, 55, 0.24);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
}

.kg-search-action {
    flex: 0 0 auto;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cream-dim);
    white-space: nowrap;
}
.kg-search-action.is-message { border-color: var(--gold-dim); color: var(--gold); }

.kg-search-note {
    margin: 0;
    padding: 18px;
    font-size: 13px;
    color: var(--cream-dim);
}

.kg-search-empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--cream-dim);
    font-size: 13px;
    overflow-wrap: anywhere;
}
.kg-search-empty p { margin: 0 0 6px; }
.kg-search-empty-title { color: var(--cream); font-weight: 600; font-size: 14px; }

.kg-msg-retry-btn {
    margin-top: 12px;
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid var(--gold-dim);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}
.kg-msg-retry-btn:hover { background: rgba(212, 175, 55, 0.16); }

.kg-msg-list-error p { color: var(--cream); margin: 0; }

.kg-msg-skeleton { display: flex; flex-direction: column; }
.kg-msg-skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}
.kg-msg-skeleton-avatar,
.kg-msg-skeleton-lines > span {
    background: rgba(243, 237, 226, 0.06);
    animation: kg-msg-skeleton-pulse 1.4s ease-in-out infinite;
}
.kg-msg-skeleton-avatar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; }
.kg-msg-skeleton-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.kg-msg-skeleton-lines > span { display: block; height: 10px; border-radius: 5px; max-width: 100%; }
@keyframes kg-msg-skeleton-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.kg-chat-search-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, color 0.15s;
}
.kg-chat-search-btn:hover,
.kg-chat-search-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.06); color: var(--cream); }

.kg-chat-searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 14px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}
.kg-chat-search-input { padding: 8px 14px; }
.kg-chat-search-count {
    flex: 0 0 auto;
    max-width: 40%;
    font-size: 12px;
    color: var(--cream-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kg-chat-search-count:empty { display: none; }
.kg-chat-search-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kg-chat-search-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--cream); }
.kg-msg-chat-panel.is-selecting .kg-chat-searchbar,
.kg-msg-chat-panel.is-selecting .kg-chat-search-results { display: none !important; }

.kg-chat-search-results {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    max-height: min(60%, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--card, #1c0e12);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.8);
}

.kg-csr-list { list-style: none; margin: 0; padding: 0; }
.kg-csr-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 16px;
    min-height: 48px;
    border: none;
    border-bottom: 1px solid var(--line);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.kg-csr-item:hover { background: rgba(255, 255, 255, 0.04); }
.kg-csr-meta { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.kg-csr-name { font-size: 12px; font-weight: 700; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-csr-meta time { flex: 0 0 auto; font-size: 11px; color: var(--cream-dim); }
.kg-csr-text { font-size: 13px; line-height: 1.45; color: var(--cream); overflow-wrap: anywhere; }
.kg-csr-more {
    display: block;
    width: 100%;
    min-height: 44px;
    border: none;
    background: none;
    color: var(--gold);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.kg-csr-more:disabled { opacity: 0.6; cursor: progress; }

.kg-chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.kg-react-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 1px 8px;
    border: 1px solid rgba(243, 237, 226, 0.18);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    color: inherit;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.kg-react-chip:hover { border-color: var(--gold-dim); }
.kg-react-chip:active { transform: scale(0.95); }
.kg-react-chip.is-mine { border-color: var(--gold); background: rgba(212, 175, 55, 0.2); }
.kg-react-chip:disabled { cursor: default; opacity: 0.7; }
.kg-react-emoji { font-size: 14px; }
.kg-react-count { font-variant-numeric: tabular-nums; font-weight: 600; }

.kg-menu-reacts {
    display: flex;
    justify-content: space-between;
    gap: 2px;
    padding: 2px 2px 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
}
.kg-menu-react {
    flex: 1 1 0;
    min-width: 32px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s, transform 0.12s;
}
.kg-menu-react:hover,
.kg-menu-react:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; transform: scale(1.08); }
.kg-menu-react:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
.kg-menu-react.is-on { background: rgba(212, 175, 55, 0.22); }
.kg-menu--sheet .kg-menu-react { height: 44px; }

@media (pointer: coarse) {
    .kg-react-chip { min-height: 32px; padding: 2px 10px; }
    .kg-msg-search-input, .kg-chat-search-input { min-height: 44px; }
    .kg-msg-search-clear, .kg-chat-search-btn, .kg-chat-search-close { width: 44px; height: 44px; }
}

@media (max-width: 899px) {
    .kg-msg-search { margin: 0 12px 10px; }
    .kg-msg-search-input, .kg-chat-search-input { font-size: 16px; }
}

@media (max-width: 479px) {
    .kg-chat-searchbar { padding: 6px 6px 6px 10px; }
    .kg-search-action { padding: 3px 8px; font-size: 11px; }
    .kg-chat-header .kg-chat-search-btn { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .kg-msg-skeleton-avatar,
    .kg-msg-skeleton-lines > span { animation: none; }
    .kg-react-chip,
    .kg-menu-react,
    .kg-msg-search-input,
    .kg-chat-search-input,
    .kg-chat-search-btn { transition: none; }
    .kg-react-chip:active,
    .kg-menu-react:hover,
    .kg-menu-react:focus-visible { transform: none; }
}

.kg-group-info[hidden],
.kg-gc-overlay[hidden],
.kg-gc-pane[hidden],
.kg-gc-chips[hidden],
.kg-gc-step[hidden],
.kg-gc-icon-btn[hidden],
.kg-chat-subtitle[hidden],
.kg-chat-block-btn[hidden] { display: none !important; }

.kg-msg-new-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: 1px solid var(--gold-dim);
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, border-color 0.15s;
}
.kg-msg-new-btn:hover { background: rgba(212, 175, 55, 0.16); border-color: var(--gold); }
.kg-msg-new-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.kg-chat-title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px;
    margin: -4px -6px;
    border: none;
    border-radius: 12px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.kg-chat-title:disabled { cursor: default; }
.kg-chat-title:not(:disabled):hover { background: rgba(255, 255, 255, 0.04); }
.kg-chat-title:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; }
.kg-chat-subtitle { font-size: 12px; color: var(--cream-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kg-group-avatar {
    background: radial-gradient(circle at 30% 25%, rgba(212, 175, 55, 0.22), transparent 60%), var(--burgundy, #2a0e14);
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.45);
    color: var(--gold);
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.kg-chat-avatar.kg-group-avatar { border-radius: 14px; }
.kg-msg-item-avatar.kg-group-avatar { border-radius: 14px; font-size: 17px; }

.kg-chat-sender {
    display: none;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kg-msg-row.is-group-start .kg-chat-sender { display: block; }

.kg-msg-chat-panel.is-info-open > :not(.kg-group-info) { visibility: hidden; }
.kg-group-info {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    flex-direction: column;
    background: var(--card, #1c0e12);
}
.kg-group-info-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    box-sizing: border-box;
    flex: 0 0 auto;
}
.kg-group-info-back { display: flex !important; }
.kg-group-info-heading {
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.03em;
    color: var(--cream);
}
.kg-group-info-heading:focus { outline: none; }
.kg-group-info-heading:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kg-group-info-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 0 24px;
}
.kg-group-info-body > * { max-width: 640px; margin-left: auto; margin-right: auto; }

.kg-gi-hero { text-align: center; padding: 24px 20px 12px; overflow-wrap: anywhere; }
.kg-gi-avatar { width: 84px; height: 84px; border-radius: 26px; font-size: 34px; }
.kg-gi-name { margin: 12px 0 2px; font-size: 20px; color: var(--cream); line-height: 1.3; }
.kg-gi-count { margin: 0; font-size: 13px; color: var(--cream-dim); }
.kg-gi-desc { margin: 12px auto 0; max-width: 46ch; font-size: 14px; line-height: 1.55; color: var(--cream); white-space: pre-wrap; }

.kg-gi-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px 12px;
    justify-content: center;
}
.kg-gi-btn,
.kg-gi-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--cream);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}
.kg-gi-btn:hover,
.kg-gi-switch:hover { border-color: var(--gold-dim); }
.kg-gi-btn:focus-visible,
.kg-gi-switch:focus-visible,
.kg-gi-more:focus-visible,
.kg-gi-leave:focus-visible,
.kg-gc-chip:focus-visible,
.kg-gc-icon-btn:focus-visible,
.kg-gc-primary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kg-gi-switch:disabled { opacity: 0.6; cursor: progress; }
.kg-gi-switch-track {
    position: relative;
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: rgba(243, 237, 226, 0.18);
    transition: background 0.15s;
}
.kg-gi-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cream);
    transition: transform 0.15s;
}
.kg-gi-switch[aria-checked="true"] .kg-gi-switch-track { background: var(--gold-dim); }
.kg-gi-switch[aria-checked="true"] .kg-gi-switch-thumb { transform: translateX(14px); background: var(--gold); }

.kg-gi-section {
    margin: 8px 0 0;
    padding: 12px 18px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}
.kg-gi-members { list-style: none; margin: 0; padding: 0; }
.kg-gi-member {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 10px 8px 18px;
    border-bottom: 1px solid var(--line);
}
.kg-gi-member-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kg-gi-member-name { display: flex; gap: 4px; min-width: 0; font-weight: 600; color: var(--cream); }
.kg-gi-member-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-gi-you { flex: 0 0 auto; font-weight: 400; color: var(--cream-dim); }
.kg-gi-member-user { font-size: 12px; color: var(--cream-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-gi-role {
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--cream-dim);
}
.kg-gi-role.is-owner { border-color: var(--gold); color: var(--gold); background: rgba(212, 175, 55, 0.1); }
.kg-gi-role.is-admin { border-color: var(--gold-dim); color: var(--cream); }
.kg-gi-more {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kg-gi-more:hover { background: rgba(255, 255, 255, 0.06); color: var(--cream); }

.kg-gi-danger { padding: 20px 18px 0; text-align: center; }
.kg-gi-leave {
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid rgba(224, 72, 95, 0.55);
    border-radius: 999px;
    background: rgba(224, 72, 95, 0.08);
    color: #f06a80;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.kg-gi-leave:hover { background: rgba(224, 72, 95, 0.16); }
.kg-gi-leave:disabled { opacity: 0.55; cursor: not-allowed; }

.kg-gi-edit { display: flex; flex-direction: column; gap: 6px; padding: 20px 18px 8px; }
.kg-gi-edit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

html.kg-gc-lock,
html.kg-gc-lock body { overflow: hidden; }

.kg-gc-overlay {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 4, 8, 0.66);
    opacity: 0;
    transition: opacity 0.18s;
}
.kg-gc-overlay.is-open { opacity: 1; }
.kg-gc {
    width: 100%;
    max-width: 460px;
    height: min(640px, calc(var(--kg-gc-vh, 100vh) - 40px));
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card, #1c0e12);
    box-shadow: 0 28px 60px -20px rgba(0, 0, 0, 0.85);
    overflow: hidden;
    transform: translateY(8px);
    transition: transform 0.2s cubic-bezier(.2, .8, .2, 1);
}
.kg-gc-overlay.is-open .kg-gc { transform: none; }
.kg-gc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 10px 10px 16px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}
.kg-gc-titles { flex: 1; min-width: 0; }
.kg-gc-title { margin: 0; font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 0.03em; color: var(--cream); }
.kg-gc-step { margin: 0; font-size: 12px; color: var(--cream-dim); }
.kg-gc-icon-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--cream);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kg-gc-icon-btn:hover { background: rgba(255, 255, 255, 0.06); }
.kg-gc-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kg-gc-search { margin: 12px 14px 8px; }
.kg-gc-hint { margin: 0 16px 8px; font-size: 12px; color: var(--cream-dim); line-height: 1.45; }
.kg-gc-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 14px 8px;
    padding: 0;
    max-height: 72px;
    overflow-y: auto;
    flex: 0 0 auto;
}
.kg-gc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 180px;
    min-height: 32px;
    padding: 0 6px 0 12px;
    border: 1px solid var(--gold-dim);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.1);
    color: var(--cream);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.kg-gc-chip-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-gc-chip svg { flex: 0 0 auto; width: 14px; height: 14px; }
.kg-gc-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.kg-gc-people { list-style: none; margin: 0; padding: 0; }
.kg-gc-person {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.kg-gc-person:hover { background: rgba(255, 255, 255, 0.03); }
.kg-gc-person.is-checked { background: rgba(212, 175, 55, 0.08); }
.kg-gc-check { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.kg-gc-person:focus-within { outline: 2px solid var(--gold); outline-offset: -2px; }
.kg-gc-person-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kg-gc-person-name { font-weight: 600; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-gc-person-user { font-size: 12px; color: var(--cream-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-gc-tick {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(243, 237, 226, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}
.kg-gc-tick svg { width: 14px; height: 14px; }
.kg-gc-person.is-checked .kg-gc-tick { background: var(--gold); border-color: var(--gold); color: #1b0d10; }

.kg-gc-details { padding: 16px; gap: 4px; overflow-y: auto; }
.kg-gc-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.kg-gc-preview .kg-gc-hint { margin: 0; }
.kg-gc-preview-avatar { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 18px; font-size: 24px; }
.kg-gc-label { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--cream); }
.kg-gc-optional { font-weight: 400; color: var(--cream-dim); }
.kg-gc-field {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--cream);
    font: inherit;
    font-size: 15px;
    box-sizing: border-box;
}
.kg-gc-field:focus { outline: none; border-color: var(--gold-dim); }
.kg-gc-field:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.kg-gc-field[aria-invalid="true"] { border-color: #e0485f; }
.kg-gc-textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.kg-gc-field-meta { display: flex; justify-content: space-between; gap: 8px; min-height: 18px; }
.kg-gc-count { font-size: 11px; color: var(--cream-dim); font-variant-numeric: tabular-nums; }
.kg-gc-error { font-size: 12px; color: #f06a80; }
.kg-gc-form-error { margin: 8px 0 0; }
.kg-gc-form-error:empty { display: none; }
.kg-gc-foot {
    flex: 0 0 auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
}
.kg-gc-primary {
    width: 100%;
    min-height: 46px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--crimson, #c8203a), var(--crimson-bright, #d61f3c));
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.kg-gc-primary:disabled { opacity: 0.5; cursor: default; }
.kg-gi-edit .kg-gc-primary { width: auto; padding: 0 22px; min-height: 40px; }

@media (max-width: 899px) {
    .kg-gc-overlay { padding: 0; align-items: stretch; top: var(--kg-gc-top, 0px); bottom: auto; height: var(--kg-gc-vh, 100dvh); }
    .kg-gc { max-width: none; height: 100%; border-radius: 0; border: none; }
    .kg-gc-field { font-size: 16px; }
    .kg-group-info-head { min-height: 56px; padding: 6px 10px; }
}

@media (pointer: coarse) {
    .kg-msg-new-btn, .kg-gc-icon-btn, .kg-gi-more { width: 44px; height: 44px; }
    .kg-gi-btn, .kg-gi-switch { min-height: 44px; }
    .kg-gc-chip { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .kg-gc-overlay,
    .kg-gc,
    .kg-gi-switch-track,
    .kg-gi-switch-thumb,
    .kg-msg-new-btn { transition: none; }
    .kg-gc { transform: none; }
}

.kg-gc-person,
.kg-gc-chip,
.kg-chat-title,
.kg-gi-btn,
.kg-gi-switch,
.kg-gi-more,
.kg-msg-new-btn { -webkit-tap-highlight-color: transparent; }
.kg-gc-person:active,
.kg-gi-btn:active,
.kg-gi-switch:active,
.kg-chat-title:not(:disabled):active { background: rgba(212, 175, 55, 0.12); }

.kg-chat-live {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 5;
    max-width: calc(100% - 32px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(28, 14, 18, 0.94);
    color: var(--cream);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.kg-chat-live.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}
.kg-chat-live-text {
    overflow: hidden;
    text-overflow: ellipsis;
}
.kg-chat-live-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd166;
}
.kg-chat-live.is-restored .kg-chat-live-dot { background: #5fd38d; }
.kg-chat-offline:not([hidden]) ~ .kg-chat-live { display: none; }

.kg-chat-typing {
    position: absolute;
    left: 14px;
    bottom: 8px;
    z-index: 3;
    max-width: calc(100% - 96px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    background: rgba(28, 14, 18, 0.88);
    border: 1px solid var(--line);
    color: var(--cream-dim);
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.kg-chat-typing.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.18s ease, visibility 0s;
}
.kg-chat-typing-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kg-chat-typing-dots {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 12px;
}
.kg-chat-typing-dots > span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.35;
    animation: kg-typing-dot 1.2s ease-in-out infinite;
}
.kg-chat-typing-dots > span:nth-child(2) { animation-delay: 0.15s; }
.kg-chat-typing-dots > span:nth-child(3) { animation-delay: 0.3s; }
.kg-chat-typing:not(.is-visible) .kg-chat-typing-dots > span { animation: none; }
.kg-chat-body.is-typing .kg-chat-messages { padding-bottom: 38px; }

@keyframes kg-typing-dot {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 380px) {
    .kg-chat-typing { left: 10px; max-width: calc(100% - 76px); }
}

@media (prefers-reduced-motion: reduce) {
    .kg-chat-live,
    .kg-chat-live.is-visible,
    .kg-chat-typing,
    .kg-chat-typing.is-visible { transition: none; }
    .kg-chat-live,
    .kg-chat-live.is-visible { transform: translate(-50%, 0); }
    .kg-chat-typing-dots > span { animation: none; opacity: 0.8; }
}

@media (forced-colors: active) {
    .kg-chat-live,
    .kg-chat-typing { border: 1px solid CanvasText; }
    .kg-chat-typing-dots > span,
    .kg-chat-live-dot { background: CanvasText; }
}
.kg-chat-body.has-live-notice .kg-chat-sticky-day { visibility: hidden; }

.kg-msg-search .kg-msg-search-input {
    min-height: 42px;
    border-color: rgba(243, 237, 226, 0.16);
    background: rgba(255, 255, 255, 0.06);
}
.kg-msg-search .kg-msg-search-input:hover { border-color: rgba(243, 237, 226, 0.26); }
.kg-msg-search .kg-msg-search-input:focus { border-color: var(--gold-dim); background: rgba(255, 255, 255, 0.08); }
.kg-msg-new-btn svg { display: block; }

@media (pointer: coarse) {
    .kg-chat-placeholder-btn { min-height: 44px; }
    .kg-chat-back { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .kg-msg-item,
    .kg-chat-placeholder-btn { transition: none; }
}

@media (forced-colors: active) {
    .kg-msg-item.is-active { border-color: Highlight; }
    .kg-chat-placeholder-icon { border-color: CanvasText; }
}

.kg-msg-chat-panel .kg-chat-body {
    background: radial-gradient(ellipse 80% 55% at 50% 0%, rgba(200, 32, 58, 0.05), transparent 70%);
}

@media (max-width: 899px) {
    .kg-msg-listhead .kg-msg-title { font-size: 22px; }
}

.kg-community[hidden],
.kg-community-close[hidden],
.kg-community-back[hidden] { display: none !important; }

.kg-community {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    background: var(--card, #1c0e12);
}
.kg-msg-chat-panel.is-empty > .kg-community { visibility: visible; }

.kg-community-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 56px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.kg-community-heading {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 0.03em;
    color: var(--cream);
}
.kg-community-heading:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.kg-community-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 0 24px;
}

.kg-cm-hero {
    position: relative;
    padding: 84px 18px 18px;
    text-align: center;
}

.kg-cm-cover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    border-bottom: 1px solid var(--line);
}
.kg-cm-cover-0 { background: radial-gradient(ellipse at 20% 120%, rgba(200, 32, 58, 0.55), transparent 60%), linear-gradient(120deg, #2a0e14, #14090c); }
.kg-cm-cover-1 { background: radial-gradient(ellipse at 80% 120%, rgba(212, 175, 55, 0.35), transparent 60%), linear-gradient(120deg, #24121a, #14090c); }
.kg-cm-cover-2 { background: radial-gradient(ellipse at 50% 130%, rgba(75, 58, 110, 0.6), transparent 62%), linear-gradient(120deg, #1d1226, #14090c); }
.kg-cm-cover-3 { background: radial-gradient(ellipse at 30% 130%, rgba(200, 32, 58, 0.35), transparent 55%), linear-gradient(200deg, #2a0e14, #1b1020); }
.kg-cm-cover-4 { background: radial-gradient(ellipse at 70% 120%, rgba(138, 114, 40, 0.45), transparent 60%), linear-gradient(160deg, #221017, #14090c); }

.kg-cm-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 24px;
    border: 2px solid var(--card, #1c0e12);
    background: var(--burgundy, #2a0e14);
    background-size: cover;
    background-position: center;
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.8);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 30px;
    color: var(--gold);
}
.kg-cm-avatar-sm {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: none;
    box-shadow: none;
    font-size: 17px;
    flex: 0 0 auto;
}

.kg-cm-name {
    margin: 10px 0 2px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--cream);
    overflow-wrap: anywhere;
}

.kg-cm-slug { margin: 0; font-size: 13px; color: var(--cream-dim); overflow-wrap: anywhere; }

.kg-cm-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 10px 0 0;
}

.kg-cm-badge {
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.kg-cm-badge.is-soft { border-color: var(--line); background: rgba(255, 255, 255, 0.05); color: var(--cream-dim); }
.kg-cm-badge.is-private { border-color: rgba(200, 32, 58, 0.45); background: rgba(200, 32, 58, 0.14); color: #f0a3b0; }
.kg-cm-badge.is-mini { align-self: center; font-size: 10px; padding: 2px 8px; }

.kg-cm-desc {
    margin: 12px auto 0;
    max-width: 520px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cream-dim);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.kg-cm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.kg-cm-cta {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--gold-dim);
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.kg-cm-cta:hover { background: rgba(212, 175, 55, 0.22); border-color: var(--gold); }
.kg-cm-cta.is-ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.04); color: var(--cream); }
.kg-cm-cta.is-ghost:hover { border-color: rgba(243, 237, 226, 0.3); background: rgba(255, 255, 255, 0.07); }
.kg-cm-cta:disabled { opacity: 0.6; cursor: progress; }
.kg-cm-cta:focus-visible,
.kg-cm-mini:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.kg-cm-state { font-size: 13px; color: var(--cream-dim); }

.kg-cm-mini {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--gold-dim);
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.kg-cm-mini.is-ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.04); color: var(--cream-dim); }
.kg-cm-mini:disabled { opacity: 0.6; cursor: default; }
.kg-cm-mini.is-done { border-color: var(--line); background: none; color: var(--cream-dim); }

.kg-cm-request { gap: 8px; }
.kg-cm-person { cursor: default; }
.kg-cm-preview-note { margin: 18px 18px 0; text-align: center; font-size: 13px; color: var(--cream-dim); }
.kg-cm-more { margin: 10px 18px 0; }
.kg-cm-edit { padding: 18px; }

.kg-cm-skeleton { display: block; padding: 0 18px 18px; }
.kg-cm-skeleton-cover,
.kg-cm-skeleton-avatar,
.kg-cm-skeleton-line {
    display: block;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
    background-size: 200% 100%;
    animation: kg-cm-shimmer 1.4s linear infinite;
}
.kg-cm-skeleton-cover { height: 120px; margin: 0 -18px 0; }
.kg-cm-skeleton-avatar { width: 84px; height: 84px; border-radius: 24px; margin: -42px auto 12px; }
.kg-cm-skeleton-line { height: 12px; border-radius: 6px; margin: 0 auto 10px; }

@keyframes kg-cm-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.kg-search-item.is-community { align-items: center; }

@media (pointer: coarse) {
    .kg-cm-cta { min-height: 44px; }
    .kg-cm-mini { min-height: 36px; }
    .kg-community-back { width: 44px; height: 44px; }
}

@media (max-width: 899px) {
    .kg-cm-hero { padding: 76px 14px 16px; }
    .kg-cm-desc { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .kg-cm-cta,
    .kg-cm-skeleton-cover,
    .kg-cm-skeleton-avatar,
    .kg-cm-skeleton-line { transition: none; animation: none; }
}

@media (forced-colors: active) {
    .kg-cm-badge,
    .kg-cm-cta,
    .kg-cm-mini { border: 1px solid CanvasText; }
}

.kg-chan-rail[hidden],
.kg-chan-add[hidden] { display: none !important; }

.kg-chan-rail {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 5;
    width: 232px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(42, 14, 20, 0.55), rgba(20, 9, 12, 0.35));
}
.kg-msg-chat-panel.has-rail .kg-chat-header,
.kg-msg-chat-panel.has-rail .kg-chat-selbar,
.kg-msg-chat-panel.has-rail .kg-chat-searchbar,
.kg-msg-chat-panel.has-rail .kg-chat-body,
.kg-msg-chat-panel.has-rail .kg-chat-blocked-notice,
.kg-msg-chat-panel.has-rail .kg-chat-footer { margin-left: 232px; }

.kg-chan-rail-head { flex: 0 0 auto; padding: 10px 10px 6px; border-bottom: 1px solid var(--line); }

.kg-chan-community {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.kg-chan-community:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--line); }
.kg-chan-community:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kg-chan-community-body { min-width: 0; display: flex; flex-direction: column; }
.kg-chan-community-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kg-chan-community-meta { font-size: 11px; color: var(--cream-dim); }

.kg-chan-rail-title {
    flex: 0 0 auto;
    margin: 12px 14px 6px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cream-dim);
}

.kg-chan-rail-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 6px 6px;
}

.kg-chan-list { list-style: none; margin: 0; padding: 0; }

.kg-chan-item {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 10px;
}
.kg-chan-item.is-active { background: rgba(212, 175, 55, 0.12); }
.kg-chan-item.is-active .kg-chan-name { color: var(--gold); }
.kg-chan-item.is-active .kg-chan-hash { color: var(--gold); }

.kg-chan-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 8px;
    border: none;
    border-radius: 10px;
    background: none;
    color: var(--cream);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.kg-chan-link:hover { background: rgba(255, 255, 255, 0.05); }
.kg-chan-link:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.kg-chan-hash { flex: 0 0 auto; color: var(--cream-dim); font-weight: 700; }
.kg-chan-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kg-chan-unread {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--crimson, #d61f3c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kg-chan-more { flex: 0 0 auto; }

.kg-chan-add {
    flex: 0 0 auto;
    margin: 6px 10px 12px;
    min-height: 36px;
    border: 1px dashed var(--gold-dim);
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.06);
    color: var(--gold);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.kg-chan-add:hover { background: rgba(212, 175, 55, 0.14); }
.kg-chan-add:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.kg-cm-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-right: 18px;
}
.kg-cm-section-head .kg-gi-section { flex: 1; }

.kg-gc--compact { max-width: 420px; }

@media (max-width: 1199px) {
    .kg-chan-rail { display: none !important; }
    .kg-msg-chat-panel.has-rail .kg-chat-header,
    .kg-msg-chat-panel.has-rail .kg-chat-selbar,
    .kg-msg-chat-panel.has-rail .kg-chat-searchbar,
    .kg-msg-chat-panel.has-rail .kg-chat-body,
    .kg-msg-chat-panel.has-rail .kg-chat-blocked-notice,
    .kg-msg-chat-panel.has-rail .kg-chat-footer { margin-left: 0; }
}

@media (pointer: coarse) {
    .kg-chan-link { min-height: 44px; }
    .kg-chan-add { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .kg-chan-link,
    .kg-chan-community { transition: none; }
}

@media (forced-colors: active) {
    .kg-chan-item.is-active { border: 1px solid Highlight; }
    .kg-chan-unread { border: 1px solid CanvasText; }
}

.kg-chat-empty {
    margin: auto;
    padding: 24px 18px;
    text-align: center;
    color: var(--cream-dim);
    font-size: 13px;
}
.kg-chat-empty-title {
    margin: 0 0 4px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 0.03em;
    color: var(--cream);
}
.kg-chat-empty p { margin: 0; }


.kg-chat-mod-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 32px;
    padding: 8px 16px;
    font-size: 12px;
    text-align: center;
    color: var(--cream-dim);
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--line);
}
.kg-chat-mod-notice.is-strong {
    color: var(--cream, #f4e7d8);
    background: rgba(214, 122, 88, 0.14);
    font-weight: 600;
}

.kg-mod { max-width: 520px; }
.kg-mod-tabs {
    display: flex;
    gap: 4px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
}
.kg-mod-tabs::-webkit-scrollbar { display: none; }
.kg-mod-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 10px;
    min-height: 40px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--cream-dim);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.kg-mod-tab:hover { color: var(--cream, #f4e7d8); }
.kg-mod-tab.is-active {
    color: var(--cream, #f4e7d8);
    border-bottom-color: var(--accent, #d67a58);
}
.kg-mod-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--accent, #d67a58);
    color: #1b0d10;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.kg-mod-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 14px 16px;
}
.kg-mod-body:focus-visible { outline: 2px solid var(--accent, #d67a58); outline-offset: -2px; }
.kg-mod-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.kg-mod-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}
.kg-mod-item.is-compact { gap: 4px; padding: 10px 12px; }
.kg-mod-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.kg-mod-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(214, 122, 88, 0.12);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--cream, #f4e7d8);
}
.kg-mod-name { font-size: 14px; font-weight: 600; color: var(--cream, #f4e7d8); }
.kg-mod-time { font-size: 11px; color: var(--cream-dim); white-space: nowrap; }
.kg-mod-meta { margin: 0; font-size: 12px; color: var(--cream-dim); }
.kg-mod-meta.is-soft { opacity: 0.8; }
.kg-mod-line { margin: 0; font-size: 13px; color: var(--cream, #f4e7d8); }
.kg-mod-preview {
    margin: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
    color: var(--cream, #f4e7d8);
    overflow-wrap: anywhere;
}
.kg-mod-preview.is-muted { color: var(--cream-dim); font-style: italic; }
.kg-mod-details { margin: 0; font-size: 12px; color: var(--cream-dim); overflow-wrap: anywhere; }
.kg-mod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}
.kg-mod-btn {
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--cream, #f4e7d8);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.kg-mod-btn:hover { background: rgba(255, 255, 255, 0.07); }
.kg-mod-btn.is-primary { border-color: var(--accent, #d67a58); background: rgba(214, 122, 88, 0.16); }
.kg-mod-btn.is-danger { border-color: rgba(214, 88, 88, 0.6); color: #f2b8b0; }
.kg-mod-btn:focus-visible { outline: 2px solid var(--accent, #d67a58); outline-offset: 2px; }
.kg-mod-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 10px;
}
.kg-mod-choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 13px;
    cursor: pointer;
}
.kg-mod-choice input { accent-color: var(--accent, #d67a58); }
.kg-mod-choice:has(input:checked) {
    border-color: var(--accent, #d67a58);
    background: rgba(214, 122, 88, 0.14);
}
.kg-mod-choice:focus-within { outline: 2px solid var(--accent, #d67a58); outline-offset: 2px; }
.kg-mod-target { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--cream, #f4e7d8); }
.kg-mod-warning {
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid rgba(214, 88, 88, 0.45);
    border-radius: 12px;
    background: rgba(214, 88, 88, 0.1);
    font-size: 13px;
    color: var(--cream, #f4e7d8);
}
.kg-gc-primary.is-danger { border-color: rgba(214, 88, 88, 0.7); background: rgba(214, 88, 88, 0.22); }
.kg-chan-slow-row { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

@media (max-width: 640px) {
    .kg-mod-actions .kg-mod-btn { flex: 1 1 auto; }
    .kg-mod-tab { padding: 10px 8px; font-size: 12px; }
}

@media (pointer: coarse) {
    .kg-mod-btn { min-height: 44px; padding: 10px 14px; }
    .kg-mod-tab { min-height: 44px; }
    .kg-mod-choice { min-height: 44px; padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .kg-mod-tab, .kg-mod-btn { transition: none; }
}

@media (forced-colors: active) {
    .kg-mod-item, .kg-mod-btn, .kg-mod-choice, .kg-mod-badge { border: 1px solid CanvasText; }
    .kg-mod-tab.is-active { border-bottom-color: CanvasText; }
    .kg-mod-count { background: CanvasText; color: Canvas; }
}

.kg-chat-bubble--media {
    width: min(360px, 75%);
    max-width: 75%;
}

.kg-chat-bubble-text--meta {
    min-height: 0;
}

.kg-media-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
    margin: 2px 0 6px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(12, 10, 16, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.22);
    color: var(--cream);
}

.kg-chat-bubble--mine .kg-media-card {
    background: rgba(20, 9, 12, 0.42);
    border-color: rgba(255, 255, 255, 0.28);
}

.kg-media-card-poster {
    flex: 0 0 auto;
    width: 72px;
    height: 108px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--burgundy, #2a0e14);
    display: block;
}

.kg-media-card-poster.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-dim, #8a7228);
    border: 1px solid var(--line);
}

.kg-media-card-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}

.kg-media-card-type {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold, #d4af37);
}

.kg-chat-bubble--mine .kg-media-card-type {
    color: #ffe9a8;
}

.kg-media-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--cream);
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-media-card-meta {
    margin: 0;
    font-size: 12px;
    color: var(--cream-dim);
    font-variant-numeric: tabular-nums;
}

.kg-media-card-rating {
    color: var(--gold, #d4af37);
    font-weight: 700;
}

.kg-chat-bubble--mine .kg-media-card-rating {
    color: #ffe9a8;
}

.kg-media-card-overview {
    margin: 2px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--cream-dim);
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-media-card-open {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin-top: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--gold, #d4af37);
    color: var(--gold, #d4af37);
    background: rgba(212, 175, 55, 0.08);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    touch-action: manipulation;
    transition: background-color 0.18s ease;
}

.kg-media-card-open:hover {
    background: rgba(212, 175, 55, 0.18);
}

.kg-chat-bubble--mine .kg-media-card-open {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
}

.kg-media-card-open:focus-visible {
    outline: 2px solid var(--gold, #d4af37);
    outline-offset: 2px;
}

.kg-media-card.is-unavailable .kg-media-card-title {
    font-style: italic;
    color: var(--cream-dim);
}

@media (max-width: 430px) {
    .kg-chat-bubble--media {
        width: 86%;
        max-width: 86%;
    }

    .kg-media-card {
        gap: 10px;
        padding: 8px;
    }

    .kg-media-card-poster {
        width: 60px;
        height: 90px;
    }

    .kg-media-card-open {
        min-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kg-media-card-open {
        transition: none;
    }
}

@media (forced-colors: active) {
    .kg-media-card,
    .kg-media-card-open {
        border: 1px solid CanvasText;
    }

    .kg-media-card-open:focus-visible {
        outline: 2px solid Highlight;
    }
}

.kg-msg-avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: color-mix(in srgb, var(--kg-sender, #d4af37) 26%, #1b1016);
    background-size: cover;
    background-position: center;
    color: var(--kg-sender, #f0c46a);
    font: 700 14px/1 Manrope, system-ui, sans-serif;
    display: grid;
    place-items: center;
    cursor: pointer;
    visibility: hidden;
    align-self: flex-end;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kg-msg-avatar.has-image { color: transparent; }
.kg-msg-row.is-group-end .kg-msg-avatar { visibility: visible; }
.kg-msg-avatar:hover { transform: scale(1.06); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.45); }
.kg-msg-avatar:focus-visible { visibility: visible; outline: 2px solid var(--gold); outline-offset: 2px; }
.kg-msg-row.is-theirs.is-sticker .kg-msg-avatar { margin-bottom: 18px; }

button.kg-chat-sender {
    border: 0;
    padding: 0;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    color: var(--kg-sender, var(--gold));
}
button.kg-chat-sender:hover { text-decoration: underline; text-underline-offset: 3px; }
button.kg-chat-sender:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.kg-user-card {
    position: fixed;
    z-index: 1000;
    width: 260px;
    padding: 14px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 16px;
    background: #1d1117;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    color: var(--cream, #f3ede2);
    font-family: Manrope, system-ui, sans-serif;
    animation: kgUserCardIn 0.16s ease-out;
}
.kg-user-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-width: 0; }
.kg-user-card-avatar {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--kg-sender, #d4af37) 26%, #1b1016);
    background-size: cover;
    background-position: center;
    color: var(--kg-sender, #f0c46a);
    font-weight: 700;
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.kg-user-card-avatar.has-image { color: transparent; }
.kg-user-card-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}
.kg-user-card-actions { display: flex; flex-direction: column; gap: 6px; }
.kg-user-card-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font: 600 13px/1.3 Manrope, system-ui, sans-serif;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.kg-user-card-btn svg { flex: 0 0 auto; color: var(--gold, #d4af37); }
.kg-user-card-btn:hover:not(:disabled) { background: rgba(212, 175, 55, 0.1); border-color: rgba(212, 175, 55, 0.35); }
.kg-user-card-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kg-user-card-btn[hidden] { display: none; }
.kg-user-card-btn--friend:not(:disabled) { background: rgba(200, 32, 58, 0.22); border-color: rgba(229, 52, 74, 0.5); }
.kg-user-card-btn--friend:not(:disabled):hover { background: rgba(200, 32, 58, 0.34); border-color: rgba(229, 52, 74, 0.7); }
.kg-user-card-btn:disabled { cursor: default; opacity: 0.7; }
.kg-user-card-btn.is-done { opacity: 1; color: var(--cream-dim, #c9c0ae); }

.kg-user-card.is-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    animation: kgUserSheetIn 0.2s ease-out;
}
.kg-user-card.is-sheet .kg-user-card-btn { min-height: 48px; font-size: 14px; }

@keyframes kgUserCardIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes kgUserSheetIn { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .kg-user-card, .kg-user-card.is-sheet { animation: none; }
    .kg-msg-avatar { transition: none; }
}

.kg-chat-prem {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding: 1px 7px 1px 6px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold, #d4af37);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
    vertical-align: middle;
}

.kg-chat-prem.is-compact {
    width: 18px;
    height: 18px;
    padding: 0;
    justify-content: center;
    align-self: center;
}

.kg-msg-item-top .kg-chat-prem {
    margin-right: auto;
}

.kg-chat-headline > .kg-chat-prem {
    align-self: flex-start;
    margin-top: 2px;
}

.kg-gi-member-name .kg-chat-prem {
    align-self: center;
}

