/* Barra fixa estilo VK — duplicidade; desktop/tablet largo (≥769px). */

:root {
    --bip-vk-bar-height: 52px;
}

@media (min-width: 769px) {
    body.bip-vk-bar-on {
        padding-top: var(--bip-vk-bar-height);
    }

    body.bip-vk-bar-on .sidebar {
        top: var(--bip-vk-bar-height);
        height: calc(100vh - var(--bip-vk-bar-height));
        /* Mesma régua do rail (`--rail-stack-gap` + padding do `.feed-rail`). */
        padding-top: var(--rail-stack-gap, 16px);
    }

    /* Shell travado (home etc.): o corpo não rola — sticky 52px empurrava o menu
       para baixo e sobrava o vão da logo antiga. */
    body.bip-vk-bar-on.bip-layout-with-rail .sidebar {
        top: 0;
        padding-top: var(--rail-stack-gap, 16px);
        height: 100%;
        max-height: calc(100dvh - var(--bip-vk-bar-height));
    }

    body.bip-vk-bar-on .app-topbar {
        top: var(--bip-vk-bar-height);
    }

    /* O sino do visitante mora na barra branca. O da faixa de baixo só vale no celular, onde esta barra some. */
    body.bip-vk-bar-on .app-topbar__guest-sino {
        display: none;
    }

    body.bip-vk-bar-on:has(.app-topbar) {
        --feed-rail-offset-y: calc(var(--app-topbar-height) + var(--bip-vk-bar-height) + 6px);
    }

    body.bip-vk-bar-on:not(:has(.app-topbar)) {
        --feed-rail-offset-y: calc(var(--bip-vk-bar-height) + 6px);
    }

    /* DENTRO DO PALCO VALE O MESMO (02/10/26): a barra existe, mas um andar acima
       (a moldura do tocador). O que ela carrega segue duplicado aqui dentro. */
    body.bip-vk-bar-on .sidebar-footer__mobile-only,
    body.bip-dentro .sidebar-footer__mobile-only {
        display: none;
    }

    body.bip-vk-bar-on .rail-topo-row,
    body.bip-dentro .rail-topo-row {
        display: none !important;
    }

    /* Marca só no topo (29/09/26): some a segunda logo da barra lateral. */
    body.bip-vk-bar-on .sidebar-head,
    body.bip-dentro .sidebar-head {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* ══ A BARRA ESTAVA COMENDO O PÉ DE TODA PÁGINA (01/10/26) ══════════════════
   Dono: *"no site desktop se eu pegar o perfil de uma pessoa e ir até o final
   ele trava e não tem respiro, não tem nem como ver os ícones sociais da
   última postagem"*.

   A conta que faltava: a barra é FIXA e quem abre espaço para ela é o
   `padding-top` do body. No layout travado (`bip-layout-with-rail`) o body não
   rola e o `.app-shell` pede `height: 100dvh` — a janela INTEIRA — mas nasce
   52px abaixo do topo por causa desse padding. Os últimos 52px ficavam fora da
   janela e o `overflow: hidden` do body os engolia: a coluna rolava até o fim
   do seu scroll e ainda assim o fim do conteúdo (os ícones do último BiP)
   estava além. No feed não aparecia porque ele nunca acaba; no perfil, acaba.

   A barra lateral já descontava a barra (regra acima); o shell e a coluna que
   rola, não. Aqui descontam. */
@media (min-width: 1101px) {
    body.bip-vk-bar-on.bip-layout-with-rail .app-shell,
    body.bip-vk-bar-on.bip-layout-with-rail .main-wrapper {
        height: calc(100dvh - var(--bip-vk-bar-height));
        max-height: calc(100dvh - var(--bip-vk-bar-height));
    }

    /* O rail da direita se media pela janela cheia pelo mesmo motivo: o fim da
       pilha (futebol, sugestões) ficava fora de alcance. */
    body.bip-vk-bar-on.bip-layout-with-rail .feed-rail {
        max-height: calc(100dvh - var(--app-topbar-height, 72px) - var(--rail-stack-gap) - var(--bip-vk-bar-height));
    }

    body.bip-vk-bar-on.bip-layout-with-rail:not(:has(.app-topbar)) .feed-rail {
        max-height: calc(100dvh - var(--rail-stack-gap) - var(--bip-vk-bar-height));
    }
}

/* Ocultação temporária (29/09/26): abas Novo / Amigos / Em alta do feed. */
body.bip-vk-bar-on .feed-pills-row {
    display: none !important;
}

@media (max-width: 768px) {
    .sidebar-footer__mobile-only {
        width: 100%;
    }
}

.bip-vk-bar {
    display: none;
}

@media (min-width: 769px) {
    .bip-vk-bar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1200;
        height: var(--bip-vk-bar-height);
        background: var(--surface, #fafafa);
        border-bottom: 1px solid var(--border, #e3e6ea);
        box-sizing: border-box;
    }

    :root:not([data-theme="light"]) .bip-vk-bar {
        background: #19191a;
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .bip-vk-bar__inner {
        display: flex;
        align-items: center;
        gap: 12px;
        max-width: min(var(--app-shell-width, 1280px), 100%);
        margin: 0 auto;
        padding: 0 var(--shell-pad-x, 16px);
        height: 100%;
        min-width: 0;
    }

    .bip-vk-bar__logo {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        text-decoration: none;
        padding: 4px 0;
    }

    .bip-vk-bar__logo-img {
        height: 32px;
        width: auto;
        /* A logo-bipfan é mais deitada (1210×300): com 32px de altura ela pede 129px (16/10/26). */
        max-width: 136px;
        object-fit: contain;
    }

    .bip-vk-bar__search {
        flex: 0 1 280px;
        /* À direita, junto do clima (16/10/26): com a rádio no ar, ela já empurra; sem a rádio, é esta margem. */
        margin-left: auto;
        min-width: 140px;
        max-width: 360px;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px;
        height: 36px;
        border-radius: 10px;
        background: #FAFAFA;
        border: 1px solid transparent;
        transition: border-color 0.15s, background 0.15s;
    }

    :root:not([data-theme="light"]) .bip-vk-bar__search {
        background: rgba(255, 255, 255, 0.06);
    }

    .bip-vk-bar__search:focus-within {
        border-color: var(--accent, #2688eb);
        background: #FAFAFA;
    }

    :root:not([data-theme="light"]) .bip-vk-bar__search:focus-within {
        background: rgba(255, 255, 255, 0.1);
    }

    .bip-vk-bar__search-ico {
        font-size: 1.15rem;
        color: var(--text-muted, #65676b);
        flex-shrink: 0;
    }

    .bip-vk-bar__search-input {
        flex: 1;
        min-width: 0;
        border: 0;
        background: transparent;
        font: inherit;
        font-size: 0.875rem;
        color: var(--text, #1c1e21);
        outline: none;
    }

    :root:not([data-theme="light"]) .bip-vk-bar__search-input {
        color: #e8e8ea;
    }

    .bip-vk-bar__search-input::placeholder {
        color: var(--text-muted, #8a8d91);
    }

    .bip-vk-bar__player {
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: var(--bip-radio-summary-gap, 10px);
        min-width: 0;
        padding: 0 8px;
    }

    .bip-vk-bar__player[hidden] {
        display: none;
    }

    .bip-vk-bar__station {
        /* Uma linha só desde 16/10/26 (animação, Ouvir, Pausada, nome): o bloco mede o que mostra e encolhe o nome
           quando falta espaço, deixando o volume logo ao lado. */
        flex: 0 1 auto;
        max-width: calc(100% - var(--bip-radio-summary-gap, 10px) - var(--bip-radio-summary-volume, 108px));
        min-width: 136px;
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .bip-vk-bar__on-air {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        flex: 0 0 auto;
        height: 24px;
    }

    .bip-vk-bar__play {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex-shrink: 0;
        height: 24px;
        padding: 0 7px;
        border: 0;
        border-radius: 6px;
        background: color-mix(in srgb, var(--accent, #2688eb) 8%, transparent);
        color: var(--accent, #2688eb);
        font: 600 11px/1 var(--font, system-ui, sans-serif);
        cursor: pointer;
        transition: background 180ms;
    }

    .bip-vk-bar__play:hover {
        background: color-mix(in srgb, var(--accent, #2688eb) 16%, transparent);
    }

    .bip-vk-bar__play:focus-visible {
        outline: 2px solid var(--accent, #2688eb);
        outline-offset: 2px;
    }

    .bip-vk-bar__play svg {
        width: 13px;
        height: 13px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .bip-vk-bar__play svg.is-loading { animation: bip-vk-radio-loading 1s linear infinite; }

    @keyframes bip-vk-radio-loading { to { transform: rotate(360deg); } }

    .bip-vk-bar__live {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        /* Depois do nome (16/10/26): quem encolhe quando falta espaço é o nome, não o Ao vivo. */
        flex-shrink: 0;
        min-width: 0;
        padding: 3px 7px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--text-muted, #8a8d91) 8%, transparent);
        color: var(--text-muted, #65676b);
        font-size: 10px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
    }

    .bip-vk-bar__live::before {
        content: "";
        width: 5px;
        height: 5px;
        flex-shrink: 0;
        border-radius: 50%;
        background: currentColor;
    }

    .bip-vk-bar__live[data-state="playing"] {
        background: rgba(26, 157, 103, .1);
        color: #148052;
    }

    :root:not([data-theme="light"]) .bip-vk-bar__live[data-state="playing"] {
        background: rgba(88, 217, 153, .12);
        color: #79eab5;
    }

    .bip-vk-bar__live[data-state="loading"] { color: var(--accent, #2688eb); }
    .bip-vk-bar__live[data-state="error"] { color: #d84d63; }

    .bip-vk-bar__track {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        height: 24px;
    }

    .bip-vk-bar__equalizer {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        gap: 2px;
        width: 18px;
        height: 16px;
        flex: 0 0 18px;
        color: var(--text-muted, #8a8d91);
    }

    .bip-vk-bar__equalizer > span {
        width: 3px;
        height: 12px;
        border-radius: 2px;
        background: currentColor;
        transform: scaleY(0.35);
        transform-origin: center bottom;
        opacity: 0.55;
    }

    .bip-vk-bar__equalizer > span:nth-child(2) { height: 16px; }
    .bip-vk-bar__equalizer > span:nth-child(3) { height: 14px; }
    .bip-vk-bar__equalizer > span:nth-child(4) { height: 10px; }

    .bip-vk-bar__player.is-playing:not(.is-muted) .bip-vk-bar__equalizer {
        color: var(--accent, #2688eb);
    }

    .bip-vk-bar__player.is-playing:not(.is-muted) .bip-vk-bar__equalizer > span {
        opacity: 0.9;
        animation: bip-vk-radio-wave 0.9s ease-in-out infinite;
    }

    .bip-vk-bar__player.is-playing:not(.is-muted) .bip-vk-bar__equalizer > span:nth-child(2) { animation-delay: -0.65s; }
    .bip-vk-bar__player.is-playing:not(.is-muted) .bip-vk-bar__equalizer > span:nth-child(3) { animation-delay: -0.35s; }
    .bip-vk-bar__player.is-playing:not(.is-muted) .bip-vk-bar__equalizer > span:nth-child(4) { animation-delay: -0.8s; }

    .bip-vk-bar__equalizer--end { transform: scaleX(-1); }
    .bip-vk-bar__player.is-playing:not(.is-muted) .bip-vk-bar__equalizer--end > span { animation-delay: -0.45s; }

    @keyframes bip-vk-radio-wave {
        0%, 100% { transform: scaleY(0.3); }
        50% { transform: scaleY(1); }
    }

    .bip-vk-bar__controls {
        display: flex;
        align-items: center;
        gap: 2px;
        flex-shrink: 0;
    }

    .bip-vk-bar__ctl {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--text, #1c1e21);
        cursor: pointer;
        font-size: 1.35rem;
        line-height: 1;
        transition: background 0.15s, color 0.15s;
    }

    :root:not([data-theme="light"]) .bip-vk-bar__ctl {
        color: #e8e8ea;
    }

    .bip-vk-bar__ctl:hover,
    .bip-vk-bar__ctl:focus-visible {
        background: var(--surface-3, rgba(0, 0, 0, 0.06));
        outline: none;
    }

    .bip-vk-bar__ctl--play {
        font-size: 1.5rem;
    }

    .bip-vk-bar__ctl:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

    .bip-vk-bar__titulo {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 6px;
        background: transparent;
        font-family: inherit;
        font-size: 0.8125rem;
        font-weight: 500;
        line-height: 18px;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--text, #1c1e21);
        cursor: pointer;
        transition: color 180ms;
    }

    .bip-vk-bar__titulo:hover,
    .bip-vk-bar__titulo[aria-expanded="true"] {
        color: var(--accent, #2688eb);
    }

    .bip-vk-bar__titulo:focus-visible {
        outline: 2px solid var(--accent, #2688eb);
        outline-offset: 4px;
    }

    :root:not([data-theme="light"]) .bip-vk-bar__titulo {
        color: #e8e8ea;
    }

    :root:not([data-theme="light"]) .bip-vk-bar__titulo:hover,
    :root:not([data-theme="light"]) .bip-vk-bar__titulo[aria-expanded="true"] {
        color: var(--accent, #2688eb);
    }

    .bip-vk-bar__vol {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 0 0 auto;
        max-width: 120px;
        cursor: pointer;
    }

    .bip-vk-bar__vol-ico {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
        color: var(--text-muted, #65676b);
        flex-shrink: 0;
    }

    .bip-vk-bar__vol-range {
        width: 72px;
        height: 4px;
        accent-color: var(--accent, #2688eb);
        cursor: pointer;
    }

    .bip-vk-bar__vol-range:focus-visible,
    .bip-vk-bar__vol .bip-vk-bar__ctl:focus-visible {
        outline: 2px solid var(--accent, #2688eb);
        outline-offset: 3px;
    }

    .bip-vk-bar__end {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

    .bip-vk-bar__notif {
        flex: 0 0 auto;
        position: relative;
    }

    .bip-vk-bar__notif .notif-wrap {
        position: relative;
        z-index: 1305;
    }

    .bip-vk-bar__notif .notif-bell {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        border-radius: 50%;
        border: 1px solid var(--border, #e3e6ea);
        background: var(--surface, #fff);
    }

    :root:not([data-theme="light"]) .bip-vk-bar__notif .notif-bell {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e8e8ea;
    }

    .bip-vk-bar__notif .notif-bell:hover,
    .bip-vk-bar__notif .notif-bell:focus-visible {
        background: var(--surface-3, #f0f2f5);
        outline: none;
    }

    .bip-vk-bar__notif .notif-dropdown {
        position: fixed;
        top: calc(var(--bip-vk-bar-height) + 8px);
        right: max(12px, calc((100vw - min(var(--app-shell-width, 1280px), 100%)) / 2 + 12px));
        z-index: 1310;
    }

    .bip-vk-bar__bell {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid var(--border, #e3e6ea);
        border-radius: 50%;
        background: var(--surface, #fff);
        color: var(--text, #1c1e21);
        cursor: pointer;
        font-size: 1.25rem;
        transition: background 0.15s, border-color 0.15s;
    }

    :root:not([data-theme="light"]) .bip-vk-bar__bell {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e8e8ea;
    }

    .bip-vk-bar__bell:hover,
    .bip-vk-bar__bell:focus-visible {
        background: var(--surface-3, #f0f2f5);
        outline: none;
    }

    .bip-vk-bar__bell-badge {
        position: absolute;
        top: 2px;
        right: 2px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        background: #e5484d;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
        box-sizing: border-box;
    }

    .bip-vk-bar__bell-badge[hidden] {
        display: none;
    }

    .bip-vk-bar__clima.clima-mini {
        width: auto;
        max-width: 168px;
        margin-bottom: 0;
        padding: 4px 8px;
        /* Sem a borda na barra de cima (16/10/26, ordem do dono: "tirar a borda do clima"). */
        border: 0;
        border-radius: 10px;
        column-gap: 6px;
        flex-shrink: 1;
        min-width: 0;
    }

    .bip-vk-bar__clima .clima-mini__i {
        font-size: 20px;
    }

    .bip-vk-bar__clima .clima-mini__cidade {
        font-size: 0.72rem;
    }

    .bip-vk-bar__clima .clima-mini__data {
        display: none;
    }

    .bip-vk-bar__clima .clima-mini__temp {
        font-size: 1rem;
    }

    .bip-vk-bar__clima .clima-mini__mm {
        font-size: 0.65rem;
    }

    .bip-vk-bar__user {
        flex-shrink: 0;
        min-width: 0;
        max-width: 200px;
    }

    .bip-vk-bar__user .sidebar-user-wrap {
        width: auto;
    }

    .bip-vk-bar__user .sidebar-user {
        width: auto;
        max-width: 200px;
        padding: 4px 8px 4px 4px;
        gap: 8px;
        border: 1px solid var(--border, #e3e6ea);
        border-radius: 10px;
        background: var(--surface, #fff);
    }

    :root:not([data-theme="light"]) .bip-vk-bar__user .sidebar-user {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .bip-vk-bar__user .sidebar-user__avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .bip-vk-bar__user .sidebar-user__name {
        font-size: 0.78rem;
        color: var(--text, #1c1e21);
    }

    :root:not([data-theme="light"]) .bip-vk-bar__user .sidebar-user__name {
        color: #e8e8ea;
    }

    .bip-vk-bar__user .sidebar-user__nick {
        font-size: 0.7rem;
    }

    .bip-vk-bar__user .sidebar-user__more {
        font-size: 1.1rem;
    }

    .bip-vk-bar__user .sidebar-user-menu {
        left: auto;
        right: 0;
        min-width: 260px;
        z-index: 1300;
    }

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

@media (min-width: 769px) and (max-width: 1100px) {
    .bip-vk-bar__inner { gap: 8px; }
    .bip-vk-bar__search { flex-basis: 180px; }
    .bip-vk-bar__player { padding: 0; --bip-radio-summary-gap: 8px; --bip-radio-summary-volume: 90px; }
    .bip-vk-bar__vol-range { width: 54px; }
}

@media (min-width: 769px) and (max-width: 900px) {
    .bip-vk-bar__station { min-width: 96px; }
    .bip-vk-bar__play { width: 24px; padding: 0; }
    .bip-vk-bar__play [data-vk-radio-summary-play-label] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .bip-vk-bar__play svg.is-loading { animation: none; }
    .bip-vk-bar__player.is-playing:not(.is-muted) .bip-vk-bar__equalizer > span {
        animation: none;
        transform: scaleY(0.7);
    }
}
