/* Unified KENSO site header — identical on every page, glass on scroll */
.site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 45px !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    z-index: 1000999 !important;
    background: #000000b6 !important;
    border-bottom: 1px solid #24262e !important;
    backdrop-filter: none;
    transition: background .28s ease, backdrop-filter .28s ease, border-color .28s ease;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #303030;
}

.site-header.ksh-scrolled {
    /* background: #000000b6;
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom-color: rgba(255, 255, 255, .1) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35); */
}

.site-header * {
    box-sizing: border-box;
}

.header-container {
    position: relative;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    display: flex !important;
    align-items: center !important;
}

/* Brand (normalized identical) */
.ksh-brand {
    display: flex !important;
    align-items: center;
    gap: 9px;
    z-index: 1000;
    text-decoration: none;
    flex-direction: row !important;
}

.ksh-logo {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    border: 1px solid #ffffff17;
    object-fit: cover;
    background: #14161c;
    flex: 0 0 auto;
}

.ksh-titles {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.ksh-title {
    color: #d7fe7b;
    font-size: 17px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(215, 254, 123, .3);
    white-space: nowrap;
}

.ksh-sub {
    color: #ff7777;
    font-size: 10px;
    min-height: 12px;
    /* height: 30px; */
    width: 0px;
    white-space: nowrap;
}

/* Centered section menu */
.nav-bar.kh-sections {
    /* display: flex;
    align-items: center;
    gap: 5px;
    height: 30px !important;
    padding: 0 12px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    color: #c2c2c2;
    text-decoration: none;
    transition: color .18s, background .18s, border-color .18s;
    white-space: nowrap; */
    /* position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: flex; gap: 3px; align-items: center; z-index: 1; */
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.nav-bar.kh-sections > a:hover {
    color: #d7fe7b;
    background: rgba(215, 254, 123, .08);
    border-color: rgba(215, 254, 123, .35);
}

.nav-bar.kh-sections > a.active {
    color: #d7fe7b;
    background: rgba(215, 254, 123, .12);
    border-color: #d7fe7b;
}

/* Profile / auth */
.kh-profile {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0px;
}

.kh-login {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 14px;
    background: #d7fe7b;
    color: #0e0e0e;
    border: 0;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.kh-login:hover {
    filter: brightness(1.06);
}

.kh-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 8px 0 3px;
    background: #ffffff0d;
    border: 1px solid #ffffff26;
    border-radius: 3px;
    cursor: pointer;
    color: #e6e8ee;
    font-family: inherit;
}

.kh-user-btn:hover {
    border-color: #ffffff45;
}

.kh-ava {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
    background: #181818;
}

.kh-ava-fb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d7fe7b;
    font-size: 11px;
    font-weight: 700;
}

.kh-uname {
    font-size: 10px;
    line-height: 10px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kh-caret {
    color: #9aa0ad;
    font-size: 20px;
    display: none;
}

.kh-menu {
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    min-width: 236px;
    max-width: 300px;
    background: #000000;
    border: 1px solid #23252d;
    /* background: #000000b6; */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #303030;
    border-radius: 5px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
    padding: 6px;
    display: none;
    z-index: 1001000;
}

.kh-menu.open {
    display: block;
}

.kh-mrole {
    color: #c7ccd6;
    font-weight: 600;
    font-size: 11.5px;
    padding: 6px 8px 9px;
    border-bottom: 1px solid #22242b;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kh-mi {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    border-radius: 3px;
    color: #dfe2e9;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
}

.kh-mi:hover {
    background: #191b21;
}

.kh-mi.admin {
    color: #d7fe7b;
}

.kh-mi.logout {
    color: #ff7c7c;
}

.kh-mi.logout:hover {
    background: #241618;
}

.kh-mi svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .site-header {
        height: auto !important;
        padding: 8px 12px !important;
    }

    .header-container {
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-bar.kh-sections {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .ksh-sub {
        display: none;
    }
}

/* Правый блок действий — поиск + профиль, всегда прижат вправо на любой странице */
.kh-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 1000;
    flex: 0 0 auto;
}

.header-nav .kh-actions {
    margin-left: 8px;
}

/* Поиск профилей в шапке */
.kh-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.kh-search-btn {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: inline-flex;
    background: #ffffff0d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c2c2c2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
    border: 1px solid #ffffff26;
    border-radius: 3px;
    cursor: pointer;
    transition: border-color .16s, background-color .16s;
}

.kh-search-btn:hover {
    border-color: rgba(215, 254, 123, .35);
    background-color: rgba(215, 254, 123, .08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d7fe7b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

.kh-search-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-width: 78vw;
    background: #0f1013;
    border: 1px solid #23252d;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
    padding: 8px;
    display: none;
    z-index: 1001200;
}

.kh-search.open .kh-search-pop {
    display: block;
    animation: khSearchIn .16s ease;
}

@keyframes khSearchIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}



.kh-search-in {
    width: 100%;
    box-sizing: border-box;
    background: #17181d;
    border: 1px solid #2a2c34;
    border-radius: 8px;
    color: #e6e8ee;
    font-size: 13px;
    padding: 9px 11px;
    font-family: inherit;
}

.kh-search-in:focus {
    outline: none;
    border-color: #d7fe7b;
}

.kh-search-res {
    margin-top: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.kh-search-empty {
    color: #8b90a0;
    font-size: 12px;
    padding: 10px 6px;
}

.kh-search-row {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
}

.kh-search-row:hover {
    background: #191b21;
}

.kh-search-name {
    color: #e6e8ee;
    font-size: 13px;
    font-weight: 600;
}

.kh-search-meta {
    color: #8b90a0;
    font-size: 11px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer */
.kh-footer {
    /* margin-top: 56px; */
    /* border-top: 1px solid #1e2027; */
    max-width: 1600px;
    margin: 0 auto;
    background: rgba(14, 14, 14, .7);
}

.kh-foot-in {
    max-width: 1600px;
    margin: 0 auto;
    padding: 5px 20px 5px;
    display: flex;
    border-radius: 5px;
    border: #303030 solid 1px;
    background: #000000;
    flex-wrap: wrap;
    gap: 15px 15px;
}

.kh-foot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
}

.kh-foot-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.kh-foot-bt {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kh-foot-name {
    color: #e6e8ee;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
}

.kh-foot-tag {
    color: #7d8494;
    font-size: 12px;
}

.kh-foot-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 120px;
}

.kh-foot-h {
    color: #6b7180;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 2px;
}

.kh-foot-col a {
    color: #9aa0ad;
    font-size: 13px;
    text-decoration: none;
    transition: color .15s ease;
}

.kh-foot-col a:hover {
    color: #d7fe7b;
}

.kh-foot-soc {
    display: flex;
    gap: 10px;
}

.kh-foot-soc a {
    display: inline-flex;
    opacity: .82;
    transition: opacity .15s ease, transform .15s ease;
}

.kh-foot-soc a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.kh-foot-soc img {
    width: 20px;
    height: 20px;
    display: block;
}

.kh-foot-bottom {
    max-width: 1600px;
    margin: 0 auto;
    padding: 5px 10px;
    /* border-top: 1px solid #17191f; */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.kh-foot-copy {
    color: #7d8494;
    font-size: 12px;
}

.kh-foot-made {
    color: #5c626f;
    font-size: 12px;
}

@media (max-width: 640px) {
    .kh-foot-in {
        gap: 24px 40px;
        padding: 26px 18px 20px;
    }

    .kh-foot-brand {
        flex: 1 1 100%;
        margin-right: 0;
    }

    .kh-foot-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

.kh-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    overflow: hidden;
}

.kh-ico svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px;
    max-height: 14px;
    display: block;
}

.nav-bar.kh-sections > a {
    max-width: 260px;
    overflow: hidden;
}

/* Kills-чип в кнопке профиля */
.kh-kills {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #ff7d8a;
    white-space: nowrap;
}

.kh-kills .kh-dot {
    color: #6b7180;
    margin: 0 1px;
}

.kh-heart {
    color: #ff4d5e;
    font-size: 11px;
}

/* Мини-профиль в выпадашке (shadcn-стиль) */
.kh-mini {
    padding: 4px 6px 10px;
    margin: 0 0 6px;
    border-bottom: 1px solid #22242b;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.kh-mini-empty {
    color: #8b90a0;
    font-size: 11.5px;
    padding: 8px 6px;
}

.kh-mini-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    min-height: 20px;
}

.kh-mini-row >  :last-child {
    flex: 0 1 auto;
    min-width: 0;
}

.kh-mini-k {
    color: #71767f;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    /* width: 54px; */
    flex: 0 0 auto;
}

.kh-mini-v {
    color: #dfe2e9;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}

.kh-mini-v.mono {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: #c7ccd6;
}

/* компактные чипы — как badge в shadcn: rounded-md, тонкие */
.kh-role-badge {
    display: inline-block;
    max-width: 100%;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.55;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.kh-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.55;
    border: 1px solid transparent;
    background: transparent;
    white-space: nowrap;
}

.kh-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.kh-status.active {
    color: #4ade80;
    border-color: rgba(74, 222, 128, .5);
}

.kh-status.expired {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, .5);
}

.kh-status.banned {
    color: #f87171;
    border-color: rgba(248, 113, 113, .5);
}

.kh-status.none {
    color: #9aa0ad;
    border-color: #3a3f4b;
}