.kg-notif-bell {
    position: relative;
}

.kg-notif-bell[hidden] {
    display: none;
}

.kg-notif-bell svg {
    width: 18px;
    height: 18px;
}

.kg-notif-bell[aria-expanded="true"] {
    border-color: var(--gold-dim, #8a7228);
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold, #d4af37);
}

.kg-notif-bell:focus-visible,
.kg-notif-panel button:focus-visible {
    outline: 2px solid var(--gold, #d4af37);
    outline-offset: 2px;
}

.kg-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid var(--void, #0c0a10);
    border-radius: 9px;
    background: var(--crimson-bright, #d61f3c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.kg-notif-badge[hidden] {
    display: none;
}

.kg-notif-panel {
    position: fixed;
    top: var(--kg-notif-top, 68px);
    right: var(--kg-notif-right, 12px);
    z-index: 95;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: min(400px, calc(100vw - 16px));
    max-height: calc(100vh - var(--kg-notif-top, 68px) - 12px);
    max-height: calc(100dvh - var(--kg-notif-top, 68px) - 12px);
    overflow: hidden;
    border: 1px solid var(--border, rgba(243, 237, 226, 0.12));
    border-radius: 14px;
    background: var(--card, #1c0e12);
    color: var(--cream, #f3ede2);
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.75);
}

.kg-notif-panel[hidden] {
    display: none;
}

.kg-notif-panel:focus {
    outline: none;
}

@media (max-width: 520px) {
    .kg-notif-panel {
        left: 8px;
        right: 8px;
        width: auto;
    }
}

.kg-notif-head {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 10px 8px 10px 16px;
    border-bottom: 1px solid var(--line, rgba(243, 237, 226, 0.1));
}

.kg-notif-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.1;
    overflow-wrap: break-word;
}

.kg-notif-markall {
    flex-shrink: 0;
    max-width: 55%;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--gold, #d4af37);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: right;
    transition: background 0.2s ease;
}

.kg-notif-markall:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.1);
}

.kg-notif-markall:disabled {
    opacity: 0.4;
    cursor: default;
}

.kg-notif-close {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--cream-dim, #c9c0ae);
    transition: background 0.2s ease, color 0.2s ease;
}

.kg-notif-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--cream, #f3ede2);
}

.kg-notif-close svg {
    width: 16px;
    height: 16px;
}

.kg-notif-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

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

.kg-notif-item {
    position: relative;
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--line, rgba(243, 237, 226, 0.1));
}

.kg-notif-item.is-unread::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--gold, #d4af37);
}

.kg-notif-main {
    display: flex;
    flex: 1;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    min-height: 64px;
    padding: 12px 8px 12px 16px;
    border: 0;
    background: transparent;
    color: var(--cream-dim, #c9c0ae);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.kg-notif-main:hover {
    background: rgba(243, 237, 226, 0.04);
}

.kg-notif-item.is-unread {
    background: rgba(212, 175, 55, 0.06);
}

.kg-notif-item.is-unread:hover {
    background: rgba(212, 175, 55, 0.1);
}

.kg-notif-item.is-unread .kg-notif-main {
    color: var(--cream, #f3ede2);
}

.kg-notif-item.is-unread .kg-notif-main:hover {
    background: transparent;
}

.kg-notif-avatar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    font-size: 18px;
    line-height: 1;
}

.kg-notif-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-notif-initial {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 1.2rem;
    color: var(--gold, #d4af37);
}

.kg-notif-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kg-notif-text {
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.kg-notif-text strong {
    color: var(--cream, #f3ede2);
    font-weight: 700;
}

.kg-notif-coin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: var(--gold, #d4af37);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

.kg-notif-time {
    color: var(--muted, #a89ba0);
    font-size: 0.75rem;
}

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

.kg-notif-mark {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 40px;
    height: 40px;
    margin-right: 6px;
    border-radius: 50%;
    color: var(--gold, #d4af37);
    transition: background 0.2s ease;
}

.kg-notif-mark:hover {
    background: rgba(212, 175, 55, 0.12);
}

.kg-notif-mark svg {
    width: 16px;
    height: 16px;
}

.kg-notif-state {
    padding: 28px 20px;
    color: var(--muted, #a89ba0);
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
}

.kg-notif-state[hidden] {
    display: none;
}

.kg-notif-state svg {
    display: block;
    width: 28px;
    height: 28px;
    margin: 0 auto 10px;
    opacity: 0.6;
}

.kg-notif-state--skeleton {
    padding: 0;
}

.kg-notif-skel {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line, rgba(243, 237, 226, 0.1));
}

.kg-notif-skel i,
.kg-notif-skel b {
    display: block;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
    background-size: 200% 100%;
    animation: kg-notif-shimmer 1.4s ease-in-out infinite;
}

.kg-notif-skel i {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.kg-notif-skel span {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.kg-notif-skel b {
    height: 10px;
    border-radius: 5px;
}

.kg-notif-skel b:last-child {
    width: 40%;
}

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

@media (prefers-reduced-motion: reduce) {
    .kg-notif-skel i,
    .kg-notif-skel b {
        animation: none;
    }
}

.kg-notif-retry,
.kg-notif-more {
    color: var(--gold, #d4af37);
    font-size: 0.85rem;
    font-weight: 600;
}

.kg-notif-retry {
    margin-top: 12px;
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid var(--gold-dim, #8a7228);
    border-radius: 999px;
    transition: background 0.2s ease;
}

.kg-notif-retry:hover {
    background: rgba(212, 175, 55, 0.1);
}

.kg-notif-more {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px;
    transition: background 0.2s ease;
}

.kg-notif-more:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.08);
}

.kg-notif-more:disabled {
    opacity: 0.6;
    cursor: default;
}

.kg-notif-more[hidden] {
    display: none;
}

@media (pointer: coarse) {
    .kg-notif-markall,
    .kg-notif-close {
        min-height: 44px;
    }

    .kg-notif-close {
        width: 44px;
        height: 44px;
    }

    .kg-notif-mark {
        width: 44px;
        height: 44px;
    }
}
