#btn-toggle-chat-visibility { display:none; }
/* Only decoded portrait live video (or a declared YouTube shorts broadcast) on mobile. */
@media (max-width:900px) {
    body.channel-page.mobile-portrait-live { overflow:hidden; background:#000; }
    body.channel-page.mobile-portrait-live .lobby-navbar {
        visibility:visible; position:fixed; top:var(--portrait-viewport-top,0px); left:0; right:0; z-index:1002;
        border:0; box-shadow:none;
        pointer-events:none;
    }
    body.channel-page.mobile-portrait-live .lobby-navbar > * { pointer-events:auto; }
    body.channel-page.mobile-portrait-live .lobby-navbar,
    body.channel-page.mobile-portrait-live #gif-popover {
        background:color-mix(in srgb, var(--theme-surface,#151412) 33.5%, transparent);
        -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
    }
    body.channel-page.mobile-portrait-live .lobby-brand { filter:drop-shadow(0 1px 3px #0009); }
    body.channel-page.mobile-portrait-live .container {
        position:fixed; top:0; left:0; right:0;
        height:var(--portrait-layout-height,100dvh) !important;
        min-height:0; margin:0; padding:0; overflow:hidden;
    }
    body.channel-page.mobile-portrait-live #main-video-sec {
        position:absolute; inset:0 auto auto 0; width:var(--portrait-player-width); height:var(--portrait-layout-height);
        min-height:0; padding:0; overflow:hidden; background:#000; z-index:auto;
    }
    body.channel-page.mobile-portrait-live #main-video-sec > :not(#video-wrapper) { display:none !important; }
    body.channel-page.mobile-portrait-live #video-wrapper {
        position:absolute; inset:0; margin:0; width:100%; height:100%; max-height:none; aspect-ratio:auto; z-index:auto;
    }
    body.channel-page.mobile-portrait-live #video-wrapper > #v,
    body.channel-page.mobile-portrait-live #youtube-live-frame.youtube-shorts {
        position:absolute; inset:50% 0 auto; width:100%; max-width:none; height:var(--portrait-player-height);
        transform:translateY(-50%); object-fit:contain; object-position:center;
    }
    body.channel-page.mobile-portrait-live #main-chat-sec {
        position:absolute; inset:var(--portrait-viewport-top,0px) 0 auto; width:100%; min-width:0; max-width:none; height:var(--portrait-viewport-height,100dvh); min-height:0;
        display:flex !important; justify-content:flex-end; background:transparent !important;
        border:0; overflow:visible; pointer-events:none; z-index:10;
    }
    body.channel-page.mobile-portrait-live #main-chat-sec > :not(#messages):not(#chat-form):not(#chat-send-status):not(#btn-vote-manage):not(#btn-clear-float):not(#vote-overlay):not(#notice-bar):not(#btn-toggle-chat-visibility) { display:none !important; }
    body.channel-page.mobile-portrait-live #messages {
        position:relative; z-index:1;
        display:flex !important; flex-direction:column; flex:0 1 auto; width:var(--portrait-player-width); box-sizing:border-box; height:auto; min-height:0;
        max-height:42%; margin:0 0 8px; padding:24px 12px 8px !important;
        overflow-y:auto; background:transparent; pointer-events:auto;
        mask-image:linear-gradient(transparent,#000 24px); scrollbar-width:none;
    }
    body.channel-page.mobile-portrait-live .mobile-only-tabs,
    body.channel-page.mobile-portrait-live #mobile-panel { display:none !important; }
    body.channel-page.mobile-portrait-live :is(#btn-vote-manage, #btn-clear-float, #btn-toggle-chat-visibility) {
        display:none; right:0; width:44px; height:44px; padding:0; border:0; border-radius:0;
        background:none; color:#fff; box-shadow:none; backdrop-filter:none; pointer-events:auto; z-index:3;
        opacity:.5; text-shadow:0 1px 4px #000; transition:opacity .24s ease, visibility .24s ease;
    }
    body.channel-page.mobile-portrait-live #btn-vote-manage { bottom:calc(var(--portrait-input-height,62px) + 116px); }
    body.channel-page.mobile-portrait-live #btn-clear-float { bottom:calc(var(--portrait-input-height,62px) + 64px); }
    body.channel-page.mobile-portrait-live #btn-toggle-chat-visibility {
        position:absolute; display:flex; align-items:center; justify-content:center;
        bottom:calc(var(--portrait-input-height,62px) + 12px); cursor:pointer; font-size:18px;
    }
    body.channel-page.mobile-portrait-live.portrait-chat-hidden #messages { visibility:hidden; opacity:0; pointer-events:none; }
    body.channel-page.mobile-portrait-live.portrait-keyboard :is(#btn-vote-manage, #btn-clear-float, #btn-toggle-chat-visibility) {
        opacity:0; visibility:hidden; pointer-events:none;
    }
    body.channel-page.mobile-portrait-live #notice-bar {
        position:absolute; top:calc(var(--portrait-header-height,56px) + 8px); left:12px; right:12px;
        width:auto; margin:0; max-height:calc(100% - var(--portrait-header-height,56px) - var(--portrait-input-height,62px) - 24px);
        box-sizing:border-box; overflow-y:auto; pointer-events:auto; z-index:3;
    }
    body.channel-page.mobile-portrait-live #notice-bar.collapsed { left:auto; width:36px; height:36px; padding:0; }
    body.channel-page.mobile-portrait-live #vote-overlay {
        position:absolute; top:calc(var(--portrait-header-height,56px) + 8px); left:12px; right:56px;
        width:auto; margin:0; max-height:calc(100% - var(--portrait-header-height,56px) - var(--portrait-input-height,62px) - 24px);
        overflow-y:auto; pointer-events:auto; z-index:2;
    }
    body.channel-page.mobile-portrait-live #modal-vote-create {
        top:calc(var(--portrait-viewport-top,0px) + var(--portrait-header-height,56px));
        height:calc(var(--portrait-viewport-height,100dvh) - var(--portrait-header-height,56px));
        box-sizing:border-box; padding:12px; overflow-y:auto;
    }
    body.channel-page.mobile-portrait-live #modal-vote-create .modal-content {
        margin:0 auto; width:min(420px, 100%) !important; max-width:100%;
    }
    body.channel-page.mobile-portrait-live #messages > :first-child { margin-top:auto; }
    body.channel-page.mobile-portrait-live #messages .msg-row { align-self:flex-start; align-items:flex-start; max-width:88%; }
    body.channel-page.mobile-portrait-live #messages .msg-row.mine {
        align-self:flex-end; align-items:flex-end; margin-right:44px; max-width:min(88%, calc(100% - 44px));
    }
    body.channel-page.mobile-portrait-live #messages .nick-title { color:#fff; text-shadow:0 1px 3px #000; }
    body.channel-page.mobile-portrait-live #messages .bubble { background:rgba(15,15,15,.62); color:#fff; border:1px solid #ffffff20; border-radius:16px; box-shadow:none; }
    body.channel-page.mobile-portrait-live #messages .system-msg { color:#fff; background:#0008; border-radius:12px; padding:5px 10px; }
    body.channel-page.mobile-portrait-live #messages .msg-animate { animation:portrait-chat-rise .28s ease-out both; }
    body.channel-page.mobile-portrait-live #chat-form { display:flex !important; width:100%; pointer-events:auto; flex:0 0 auto; z-index:11;
        border-top:0; background:transparent; -webkit-backdrop-filter:none; backdrop-filter:none;
    }
    body.channel-page.mobile-portrait-live #m { background:rgba(0,0,0,.5); font-size:16px; }
    body.channel-page.mobile-portrait-live #chat-form .btn-gif { background:rgba(0,0,0,.5); }
    body.channel-page.mobile-portrait-live #gif-popover .gif-search-row :is(input, button) {
        background:color-mix(in srgb, var(--theme-input,#333) 40%, transparent);
    }
    body.channel-page.mobile-portrait-live #login-warning { background:transparent; }
    body.channel-page.mobile-portrait-live #login-warning::before,
    body.channel-page.mobile-portrait-live #login-warning::after { display:none; }
    body.channel-page.mobile-portrait-live #chat-send-status:not([hidden]) { color:#fff; background:#000b; margin:0; padding:6px 12px; }
    body.channel-page.mobile-portrait-live #player-overlay { top:calc(var(--portrait-header-height,56px) + 8px); bottom:auto; background:none; z-index:20; }
    body.channel-page.mobile-portrait-live #center-mute-overlay {
        z-index:20; min-width:44px; min-height:44px; pointer-events:auto; touch-action:manipulation;
    }
    body.channel-page.mobile-portrait-live #player-overlay .btn-control[onclick="toggleMute()"] {
        flex-basis:44px; min-width:44px; min-height:44px; pointer-events:auto; touch-action:manipulation;
    }
    body.channel-page.mobile-portrait-live #broadcast-notice { display:none; }
}
@keyframes portrait-chat-rise { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion:reduce) {
    body.channel-page.mobile-portrait-live #messages .msg-animate { animation:none; }
    body.channel-page.mobile-portrait-live :is(#btn-vote-manage, #btn-clear-float, #btn-toggle-chat-visibility) { transition:none; }
}
