:root {
    --kbui-purple: #7b3fe4;
    --kbui-pink: #df27ce;
    --kbui-orange: #ff7a00;
    --kbui-bg: rgba(255,255,255,.97);
    --kbui-text: #777;
    --kbui-border: rgba(20,20,30,.10);
    --kbui-shadow: 0 -6px 24px rgba(24,18,38,.10);
    --kbui-height: 68px;
    --kbui-profile-surface: #fff;
    --kbui-profile-surface-2: #f6f6f8;
    --kbui-profile-text: #15151a;
    --kbui-profile-muted: #777782;
    --kbui-profile-border: rgba(30,30,40,.10);
}

/* =========================================================
   MENU INFERIOR
========================================================= */
body.kbui-bottom-nav-active {
    padding-bottom: calc(var(--kbui-height) + env(safe-area-inset-bottom, 0px)) !important;
}

.kbui-bottom-nav,
.kbui-bottom-nav * { box-sizing: border-box; }

.kbui-bottom-nav {
    position: fixed;
    z-index: 2147483000;
    left: 50%;
    bottom: 0;
    width: min(100%, 560px);
    transform: translateX(-50%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--kbui-bg);
    border: 1px solid var(--kbui-border);
    border-bottom: 0;
    box-shadow: var(--kbui-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.kbui-bottom-nav-inner {
    height: var(--kbui-height);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
}

.kbui-nav-item,
.kbui-nav-item:visited,
.kbui-nav-item:hover,
.kbui-nav-item:focus {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px 5px;
    color: var(--kbui-text);
    text-decoration: none !important;
    border: 0;
    outline: 0;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

.kbui-icon,
.kbui-avatar-wrap {
    position: relative;
    width: 27px;
    height: 27px;
    display: inline-grid;
    place-items: center;
}

.kbui-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kbui-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -.1px;
}

.kbui-nav-item.is-active { color: var(--kbui-purple); }
.kbui-nav-item.is-active::after {
    content: "";
    position: absolute;
    bottom: 2px;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.kbui-create { overflow: visible !important; }
.kbui-create-button {
    width: 54px;
    height: 54px;
    margin-top: -24px;
    margin-bottom: 1px;
    display: grid;
    place-items: center;
    border-radius: 19px;
    background: linear-gradient(135deg, var(--kbui-purple), var(--kbui-orange));
    box-shadow: 0 8px 20px rgba(123,63,228,.30);
    color: #fff;
    border: 4px solid var(--kbui-bg);
}
.kbui-create-button svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
}
.kbui-create:active .kbui-create-button { transform: scale(.95); }

.kbui-avatar-wrap { border-radius: 50%; padding: 2px; background: transparent; }
.kbui-profile.is-active .kbui-avatar-wrap { background: linear-gradient(135deg, var(--kbui-purple), var(--kbui-orange)); }
.kbui-avatar {
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
    max-width: 27px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid var(--kbui-bg) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.kbui-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--kbui-orange);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    border: 2px solid var(--kbui-bg);
}


/* =========================================================
   CADA ÁREA COMO UM APP: KOLLEBOO / MUSIC / TALK
========================================================= */
body.kbui-app-music #kbui-bottom-nav,
body.kbui-app-talk #kbui-bottom-nav,
body.kbui-app-music .kolleboo-app-menu,
body.kbui-app-talk .kolleboo-app-menu {
    display: none !important;
}
body.kbui-app-music,
body.kbui-app-talk {
    padding-bottom: 0 !important;
}

/* =========================================================
   REMOVE O SANDUÍCHE DO BUDDYX DE VERDADE DA INTERFACE
========================================================= */
body.kbui-no-hamburger #menu-toggle,
body.kbui-no-hamburger button.menu-toggle,
body.kbui-no-hamburger .menu-toggle,
body.kbui-no-hamburger .main-navigation .menu-toggle,
body.kbui-no-hamburger .primary-menu-container.buddyx-mobile-menu {
    display: none !important;
}

/* =========================================================
   PERFIL NOVO
========================================================= */
body.kbui-profile-home #buddypress #item-header,
body.kbui-profile-home #buddypress #item-nav,
body.kbui-profile-home #buddypress #object-nav,
body.kbui-profile-home #buddypress .bp-navs.main-navs,
body.kbui-profile-home #buddypress .bp-navs.users-nav,
body.kbui-profile-home #buddypress .item-list-tabs#object-nav {
    display: none !important;
}

/* O stream antigo continua no banco, mas não é desenhado na home do perfil. */
body.kbui-profile-home #buddypress #item-body #activity-stream,
body.kbui-profile-home #buddypress #item-body .activity-list,
body.kbui-profile-home #buddypress #item-body .activity-update-form,
body.kbui-profile-home #buddypress #item-body #whats-new-form,
body.kbui-profile-home #buddypress #item-body .activity-type-tabs,
body.kbui-profile-home #buddypress #item-body #subnav,
body.kbui-profile-home #buddypress #item-body .subnav-filters,
body.kbui-profile-home #buddypress #item-body .activity-search {
    display: none !important;
}

.kbui-profile,
.kbui-profile * { box-sizing: border-box; }

.kbui-profile {
    width: min(100%, 760px);
    margin: 10px auto 26px;
    color: var(--kbui-profile-text);
}

.kbui-profile-card {
    background: var(--kbui-profile-surface);
    border: 1px solid var(--kbui-profile-border);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 10px 32px rgba(0,0,0,.06);
}

.kbui-profile-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kbui-profile-avatar-photo {
    width: 92px;
    height: 92px;
    flex: 0 0 92px;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
}

.kbui-profile-avatar-photo img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover;
    border-radius: 50% !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.kbui-profile-identity { min-width: 0; flex: 1; }
.kbui-profile-identity h1 {
    margin: 0 !important;
    color: var(--kbui-profile-text) !important;
    font-size: clamp(24px, 5.6vw, 34px) !important;
    line-height: 1.08 !important;
    letter-spacing: -.7px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kbui-profile-name {
    margin-top: 5px;
    color: var(--kbui-profile-muted);
    font-size: 14px;
    font-weight: 650;
}
.kbui-profile-status {
    margin-top: 4px;
    color: var(--kbui-profile-muted);
    font-size: 13px;
}

.kbui-profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
    margin-top: 18px;
    padding: 13px 0;
    border-top: 1px solid var(--kbui-profile-border);
    border-bottom: 1px solid var(--kbui-profile-border);
}
.kbui-profile-stats > div { text-align: center; }
.kbui-profile-stats strong {
    display: block;
    color: var(--kbui-profile-text);
    font-size: 18px;
    line-height: 1.1;
}
.kbui-profile-stats span {
    display: block;
    margin-top: 3px;
    color: var(--kbui-profile-muted);
    font-size: 11px;
    text-transform: lowercase;
}

.kbui-profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.kbui-profile-actions::-webkit-scrollbar { display:none; }
.kbui-profile-actions a,
.kbui-profile-actions a:visited,
.kbui-profile-actions button {
    flex: 1 0 auto;
    min-width: 104px;
    min-height: 42px;
    padding: 10px 13px;
    border-radius: 12px;
    border: 1px solid rgba(123,63,228,.24) !important;
    background: var(--kbui-profile-surface-2) !important;
    color: var(--kbui-profile-text) !important;
    text-align: center;
    font: inherit;
    font-size: 12px;
    line-height: 1.1;
    font-weight: 750;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer;
}
.kbui-profile-actions a:first-child {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--kbui-purple), var(--kbui-pink)) !important;
}
.kbui-profile-more-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.kbui-more-button-chevron {
    display: inline-grid;
    width: 16px;
    height: 16px;
    color: var(--kbui-purple);
    transition: transform .18s ease;
}
.kbui-more-button-chevron svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
.kbui-profile-more-button[aria-expanded="true"] .kbui-more-button-chevron { transform: rotate(180deg); }

.kbui-profile-more-sheet {
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--kbui-profile-border);
    border-radius: 14px;
    background: var(--kbui-profile-surface-2);
}
.kbui-more-group + .kbui-more-group { border-top: 1px solid var(--kbui-profile-border); }
.kbui-more-heading {
    padding: 12px 14px 8px;
    color: var(--kbui-profile-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.kbui-more-link,
.kbui-more-link:visited {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    color: var(--kbui-profile-text) !important;
    border-top: 1px solid var(--kbui-profile-border);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 650;
}
.kbui-more-link > span:last-child { color: var(--kbui-profile-muted); font-size: 20px; font-weight: 400; }

.kbui-profile-posts {
    margin-top: 14px;
    background: var(--kbui-profile-surface);
    border: 1px solid var(--kbui-profile-border);
    border-radius: 20px;
    overflow: hidden;
}

.kbui-profile-section-title {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 15px;
    border-bottom: 1px solid var(--kbui-profile-border);
    color: var(--kbui-profile-text);
    font-size: 14px;
}
.kbui-title-icon { display: inline-grid; color: var(--kbui-purple); }
.kbui-title-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.kbui-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 3px;
    padding: 3px;
    background: var(--kbui-profile-border);
}

.kbui-grid-item,
.kbui-grid-item:visited,
.kbui-grid-item:hover,
.kbui-grid-item:focus {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    min-width: 0;
    overflow: hidden;
    background: #181820;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

.kbui-grid-media {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.kbui-grid-video-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at center, rgba(123,63,228,.30), transparent 48%), #111116;
    color: #fff;
}
.kbui-grid-video-placeholder svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
    stroke: currentColor;
}

.kbui-grid-item.is-text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background:
        radial-gradient(circle at 18% 14%, rgba(123,63,228,.55), transparent 42%),
        radial-gradient(circle at 90% 82%, rgba(255,122,0,.32), transparent 42%),
        #15151a;
}
.kbui-grid-text {
    position: relative;
    z-index: 2;
    max-height: 7.2em;
    overflow: hidden;
    color: #fff;
    text-align: center;
    font-size: clamp(10px, 2.5vw, 14px);
    line-height: 1.35;
    font-weight: 700;
}
.kbui-grid-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,.22));
}

.kbui-grid-type {
    position: absolute;
    z-index: 3;
    top: 7px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(0,0,0,.42);
    color: #fff;
    backdrop-filter: blur(5px);
}
.kbui-grid-type svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.kbui-grid-video { right: 7px; }
.kbui-grid-layers { right: 7px; }
.kbui-grid-video + .kbui-grid-layers { right: 36px; }
.kbui-grid-music { left: 7px; }

.kbui-grid-empty {
    padding: 34px 16px;
    color: var(--kbui-profile-muted);
    text-align: center;
    font-size: 13px;
}

.kbui-grid-loader {
    height: 54px;
    display: grid;
    place-items: center;
}
.kbui-grid-loader span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid rgba(123,63,228,.16);
    border-top-color: var(--kbui-purple);
    animation: kbui-spin .75s linear infinite;
}
.kbui-grid-sentinel { height: 1px; }
@keyframes kbui-spin { to { transform: rotate(360deg); } }

.kbui-profile-menus { margin-top: 14px; }
.kbui-accordion {
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--kbui-profile-surface);
    border: 1px solid var(--kbui-profile-border);
    border-radius: 16px;
}
.kbui-accordion-toggle {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    border: 0 !important;
    background: transparent !important;
    color: var(--kbui-profile-text) !important;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    box-shadow: none !important;
}
.kbui-accordion-chevron {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: var(--kbui-purple);
    transition: transform .18s ease;
}
.kbui-accordion-chevron svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.kbui-accordion-toggle[aria-expanded="true"] .kbui-accordion-chevron { transform: rotate(180deg); }
.kbui-accordion-panel { border-top: 1px solid var(--kbui-profile-border); }
.kbui-account-link,
.kbui-account-link:visited {
    min-height: 49px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    color: var(--kbui-profile-text) !important;
    border-bottom: 1px solid var(--kbui-profile-border);
    font-size: 13px;
    font-weight: 620;
    text-decoration: none !important;
}
.kbui-account-link:last-child { border-bottom: 0; }
.kbui-account-link > span:last-child { color: var(--kbui-profile-muted); font-size: 22px; font-weight: 400; }

/* =========================================================
   VISUALIZADOR DA PUBLICAÇÃO NO PRÓPRIO PERFIL
========================================================= */
body.kbui-viewer-open { overflow: hidden !important; }
.kbui-viewer {
    position: fixed;
    z-index: 2147483500;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
.kbui-viewer[hidden] { display: none !important; }
.kbui-viewer-card {
    position: relative;
    width: min(100%, 720px);
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: #111114;
    box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.kbui-viewer-close {
    position: absolute;
    z-index: 8;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0 !important;
    border-radius: 999px;
    background: rgba(0,0,0,.58) !important;
    color: #fff !important;
    font-size: 24px;
    line-height: 1;
    box-shadow: none !important;
    cursor: pointer;
}
.kbui-viewer-stage {
    position: relative;
    min-height: 240px;
    max-height: 70vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #000;
}
.kbui-viewer-stage img,
.kbui-viewer-stage video {
    display: block;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 70vh !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #000;
}
.kbui-viewer-video-cover {
    position: relative;
    width: 100%;
    min-height: 320px;
    max-height: 70vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #000;
}
.kbui-viewer-video-cover img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    opacity: .86;
}
.kbui-viewer-play {
    position: relative;
    z-index: 2;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 0 !important;
    border-radius: 999px;
    background: rgba(123,63,228,.92) !important;
    color: #fff !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.35) !important;
    cursor: pointer;
}
.kbui-viewer-play svg { width: 30px; height: 30px; fill: currentColor; stroke: currentColor; }
.kbui-viewer-arrow {
    position: absolute;
    z-index: 6;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 48px;
    border: 0 !important;
    background: rgba(0,0,0,.48) !important;
    color: #fff !important;
    font-size: 28px;
    box-shadow: none !important;
    cursor: pointer;
}
.kbui-viewer-prev { left: 6px; }
.kbui-viewer-next { right: 6px; }
.kbui-viewer-text {
    max-height: 22vh;
    overflow: auto;
    padding: 14px 16px 16px;
    color: #f5f5f7;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}
.kbui-viewer-loading {
    min-height: 320px;
    display: grid;
    place-items: center;
    color: #ddd;
    font-size: 13px;
}

/* Dark mode: BuddyX / plugins / sistema */
body.dark-mode,
body.buddyx-dark-mode,
body.dracula-dark-mode,
html[data-theme="dark"] body,
body[data-theme="dark"] {
    --kbui-bg: rgba(19,19,23,.97);
    --kbui-text: #aaa;
    --kbui-border: rgba(255,255,255,.10);
    --kbui-shadow: 0 -8px 26px rgba(0,0,0,.28);
    --kbui-profile-surface: #151515;
    --kbui-profile-surface-2: #1d1d20;
    --kbui-profile-text: #f4f4f6;
    --kbui-profile-muted: #aaa6b1;
    --kbui-profile-border: rgba(255,255,255,.10);
}

@media (prefers-color-scheme: dark) {
    body.kbui-profile-home {
        --kbui-profile-surface: #151515;
        --kbui-profile-surface-2: #1d1d20;
        --kbui-profile-text: #f4f4f6;
        --kbui-profile-muted: #aaa6b1;
        --kbui-profile-border: rgba(255,255,255,.10);
    }
}

@media (max-width: 699px) {
    .kbui-bottom-nav { border-left: 0; border-right: 0; }
    .kbui-profile { margin-top: 6px; padding: 0 8px; }
    .kbui-profile-card { padding: 16px; border-radius: 18px; }
    .kbui-profile-avatar-photo { width: 80px; height: 80px; flex-basis: 80px; }
    .kbui-profile-posts { border-radius: 16px; }
    .kbui-profile-grid { gap: 2px; padding: 2px; }
    .kbui-grid-item { border-radius: 5px; }
}

@media (min-width: 700px) {
    .kbui-bottom-nav {
        bottom: 12px;
        border-radius: 22px;
        border-bottom: 1px solid var(--kbui-border);
        overflow: visible;
    }
    body.kbui-bottom-nav-active { padding-bottom: 92px !important; }
    .kbui-profile { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .kbui-create-button,
    .kbui-accordion-chevron { transition: none; }
    .kbui-grid-loader span { animation-duration: 1.5s; }
}

/* =========================================================
   v0.3.1 — ações do perfil e cabeçalho dos apps
========================================================= */
.kbui-profile-card,
.kbui-profile-actions,
.kbui-profile-more-sheet {
    position: relative;
    z-index: 20;
}

.kbui-profile-actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    overflow: visible !important;
}

.kbui-profile-actions:not(.is-own-profile) {
    grid-template-columns: minmax(0, 1fr);
}

.kbui-profile-actions a,
.kbui-profile-actions a:visited,
.kbui-profile-actions button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px;
    padding: 9px 5px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15 !important;
    font-size: 11px !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 30;
}

.kbui-profile-more-button {
    appearance: none;
    -webkit-appearance: none;
}

/* BuddyX: ocultação reforçada sem depender da ordem do CSS do tema. */
body.kbui-no-hamburger #menu-toggle,
body.kbui-no-hamburger button#menu-toggle,
body.kbui-no-hamburger button.menu-toggle,
body.kbui-no-hamburger .site-header .menu-toggle,
body.kbui-no-hamburger button[aria-controls="primary-menu"],
body.kbui-no-hamburger .primary-menu-container.buddyx-mobile-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Dentro do Music o cabeçalho social do KolleBoo desaparece inteiro;
   preservamos apenas .site-branding (logo). */
body.kbui-app-music #masthead > :not(.site-branding),
body.kbui-app-music .site-header > :not(.site-branding),
body.kbui-app-music #site-navigation,
body.kbui-app-music nav#site-navigation,
body.kbui-app-music .site-header .main-navigation,
body.kbui-app-music .buddypress-icons-wrapper,
body.kbui-app-music .buddyx-mobile-icon,
body.kbui-app-music .user-notifications,
body.kbui-app-music .menu-icons-wrapper,
body.kbui-app-music .user-link-wrap,
body.kbui-app-music #menu-toggle,
body.kbui-app-music .menu-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 430px) {
    .kbui-profile-actions {
        gap: 5px;
    }
    .kbui-profile-actions a,
    .kbui-profile-actions a:visited,
    .kbui-profile-actions button {
        padding: 8px 4px !important;
        font-size: 10px !important;
        border-radius: 11px;
    }
}


/* v0.3.2 — o sanduíche do BuddyX foi aposentado de vez. */
html body #menu-toggle,
html body button#menu-toggle,
html body button.menu-toggle,
html body .site-header-wrapper #menu-toggle,
html body .site-header-wrapper button.menu-toggle,
html body .site-header-wrapper button[aria-controls="primary-menu"],
html body #masthead button[aria-controls="primary-menu"],
html body #masthead button:has(.fa-bars),
html body #masthead a:has(.fa-bars),
html body .site-header button:has(.fa-bars),
html body .site-header a:has(.fa-bars),
html body .primary-menu-container.buddyx-mobile-menu{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
    width:0!important;
    min-width:0!important;
    max-width:0!important;
    height:0!important;
    min-height:0!important;
    max-height:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    overflow:hidden!important;
}


/* =========================================================
   v0.3.3 — TOPO LIMPO + HUB TALK
========================================================= */
html body #masthead .user-notifications,
html body #masthead .bp-msg,
html body .site-header .user-notifications,
html body .site-header .bp-msg,
html body #masthead a[href*="/notifications"],
html body .site-header a[href*="/notifications"],
html body #masthead button[aria-label*="menu" i],
html body #masthead a[aria-label*="menu" i],
html body #site-navigation > button,
html body #site-navigation > .menu-toggle,
html body #masthead .fa-bars,
html body #masthead [data-icon="bars"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.kbui-talk-wrap {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}
.kbui-talk-wrap > .kbui-nav-item {
    width: 100%;
    min-width: 0;
    font-family: inherit;
    cursor: pointer;
}
.kbui-talk-popover[hidden] { display: none !important; }
.kbui-talk-popover {
    position: absolute;
    z-index: 2147483600;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%);
    width: 208px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(18,18,22,.98);
    border: 1px solid rgba(139,92,246,.28);
    box-shadow: 0 18px 48px rgba(0,0,0,.34), 0 0 26px rgba(123,63,228,.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.kbui-talk-popover::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 14px;
    height: 14px;
    transform: translateX(-50%) rotate(45deg);
    background: rgba(18,18,22,.98);
    border-right: 1px solid rgba(139,92,246,.28);
    border-bottom: 1px solid rgba(139,92,246,.28);
}
.kbui-talk-choice,
.kbui-talk-choice:visited,
.kbui-talk-choice:hover,
.kbui-talk-choice:focus {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) auto;
    gap: 9px;
    align-items: center;
    min-height: 48px;
    padding: 7px 9px;
    border-radius: 13px;
    color: #fff;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}
.kbui-talk-choice + .kbui-talk-choice { margin-top: 4px; }
.kbui-talk-choice:hover,
.kbui-talk-choice:focus { background: rgba(123,63,228,.14); }
.kbui-talk-choice-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(123,63,228,.18);
    color: #a875ff;
}
.kbui-talk-choice-heart {
    background: rgba(255,72,126,.14);
    color: #ff527f;
}
.kbui-talk-choice-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.kbui-talk-choice-label {
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.kbui-talk-choice-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--kbui-purple), var(--kbui-orange));
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}
.kbui-talk-choice-badge[hidden],
.kbui-total-badge[hidden] { display:none !important; }

@media (prefers-color-scheme: light) {
    .kbui-talk-popover,
    .kbui-talk-popover::after {
        background: rgba(255,255,255,.98);
    }
    .kbui-talk-popover { border-color: rgba(40,30,60,.12); }
    .kbui-talk-popover::after { border-color: rgba(40,30,60,.12); }
    .kbui-talk-choice,
    .kbui-talk-choice:visited,
    .kbui-talk-choice:hover,
    .kbui-talk-choice:focus { color: #23232b; }
}


/* =========================================================
   v0.3.4 — TALK MAIS LEVE + CONTADORES ALINHADOS
========================================================= */
/* O Talk deve seguir o mesmo padrão visual do Explorar:
   nada de círculo/bloco roxo grande; só cor no ícone/texto
   e uma pequena linha inferior quando aberto/ativo. */
.kbui-talk,
.kbui-talk:visited,
.kbui-talk:hover,
.kbui-talk:focus,
.kbui-talk:active,
.kbui-talk[aria-expanded="true"] {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
    outline: 0 !important;
}
.kbui-talk[aria-expanded="true"] {
    color: var(--kbui-purple) !important;
}
.kbui-talk[aria-expanded="true"]::after {
    content: "";
    position: absolute;
    bottom: 2px;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--kbui-purple);
}
/* Evita que regras globais do tema pintem o botão inteiro. */
#kbui-bottom-nav button.kbui-talk,
#kbui-bottom-nav button.kbui-talk:hover,
#kbui-bottom-nav button.kbui-talk:focus,
#kbui-bottom-nav button.kbui-talk:active {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 7px 2px 5px !important;
    border: 0 !important;
}

/* Colunas fixas para os dois números ficarem exatamente alinhados. */
.kbui-talk-choice,
.kbui-talk-choice:visited,
.kbui-talk-choice:hover,
.kbui-talk-choice:focus {
    grid-template-columns: 38px minmax(0, 1fr) 34px !important;
    column-gap: 10px !important;
}
.kbui-talk-choice-badge {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
    min-width: 24px !important;
    height: 24px !important;
    padding: 0 6px !important;
    line-height: 24px !important;
    text-align: center !important;
}


/* =========================================================
   v0.3.5 — TALK VISÍVEL SEMPRE + BADGES EM COLUNA
========================================================= */
/* O tema aplica cor clara em <button>; força o Talk a ter o mesmo
   estado neutro do Explorar antes de abrir o balão. */
#kbui-bottom-nav button.kbui-talk,
#kbui-bottom-nav button.kbui-talk:visited,
#kbui-bottom-nav button.kbui-talk:hover,
#kbui-bottom-nav button.kbui-talk:focus {
    color: var(--kbui-text) !important;
    opacity: 1 !important;
}
#kbui-bottom-nav button.kbui-talk[aria-expanded="true"],
#kbui-bottom-nav button.kbui-talk.is-active {
    color: var(--kbui-purple) !important;
}

/* A terceira coluna é fixa para Notificações e Mensagens. */
#kbui-talk-popover .kbui-talk-choice {
    grid-template-columns: 38px minmax(0, 1fr) 38px !important;
}
#kbui-talk-popover .kbui-talk-choice-badge {
    width: auto !important;
    min-width: 24px !important;
    max-width: 38px !important;
    justify-self: center !important;
    align-self: center !important;
}


/* =========================================================
   v0.3.6 — TALK: 1 CONTADOR SÓ + ALINHAMENTO RESPONSIVO
========================================================= */
/* O KolleBoo Talk injeta seu próprio badge global em links que apontam
   para /talk/. Dentro do KolleBoo UI os contadores já são próprios,
   então o badge global antigo não deve aparecer aqui. */
#kbui-bottom-nav .kb-talk-global-badge,
#kbui-talk-popover .kb-talk-global-badge,
#kbui-bottom-nav .kb-talk-message-link > .kb-talk-global-badge {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Balão um pouco mais largo para manter ícone, texto e número em uma linha. */
#kbui-talk-popover.kbui-talk-popover {
    width: 238px !important;
    max-width: calc(100vw - 24px) !important;
}

/* Três colunas previsíveis: ícone | texto | contador. */
#kbui-talk-popover .kbui-talk-choice,
#kbui-talk-popover .kbui-talk-choice:visited,
#kbui-talk-popover .kbui-talk-choice:hover,
#kbui-talk-popover .kbui-talk-choice:focus {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 30px !important;
    column-gap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
}

#kbui-talk-popover .kbui-talk-choice-label {
    min-width: 0 !important;
    justify-self: start !important;
    text-align: left !important;
}

#kbui-talk-popover .kbui-talk-choice-badge {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-self: end !important;
    align-self: center !important;
    display: inline-grid !important;
    place-items: center !important;
    line-height: 1 !important;
    text-align: center !important;
}

#kbui-talk-popover .kbui-talk-choice-badge[hidden] {
    display: none !important;
}

/* O total fica somente no ícone Talk, sem segundo badge do plugin Talk. */
#kbui-bottom-nav .kbui-talk-icon {
    overflow: visible !important;
}
#kbui-bottom-nav .kbui-total-badge {
    z-index: 3 !important;
}

/* No computador mantém o menu e o balão centralizados e estáveis. */
@media (min-width: 769px) {
    #kbui-bottom-nav.kbui-bottom-nav {
        width: min(620px, calc(100vw - 32px)) !important;
        border-radius: 22px 22px 0 0 !important;
    }
    #kbui-talk-popover.kbui-talk-popover {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }
}
