/* Guest = same app chrome; account-only controls are grayed or hidden. */

@keyframes guest-stripe-shift {
    from { background-position: 0 0; }
    to { background-position: 24px 0; }
}

.guest-banner {
    --guest-stripe:
        repeating-linear-gradient(
            -45deg,
            transparent 0,
            transparent 5px,
            color-mix(in srgb, var(--text-primary) 5%, transparent) 5px,
            color-mix(in srgb, var(--text-primary) 5%, transparent) 10px
        );
    position: relative;
    display: none;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.25rem 0.5rem;
    min-height: 0;
    margin: 0 0 0 4px;
    padding: 5px 10px;
    overflow: hidden;
    background-color: var(--surface);
    background-image: var(--guest-stripe);
    background-size: 24px 24px;
    animation: guest-stripe-shift 22s linear infinite;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    line-height: 1.3;
    max-width: min(420px, 46vw);
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.guest-mode .guest-banner {
    display: flex;
}

.guest-banner p {
    position: relative;
    z-index: 1;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-banner a {
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.guest-banner a:hover {
    color: var(--text-primary);
    opacity: 0.82;
}

/* Bottom bar only on narrower viewports (~phone / small tablet) */
@media (max-width: 880px) {
    body.guest-mode .guest-banner {
        --guest-stripe:
            repeating-linear-gradient(
                -45deg,
                transparent 0,
                transparent 4px,
                color-mix(in srgb, var(--accent) 14%, transparent) 4px,
                color-mix(in srgb, var(--accent) 14%, transparent) 9px
            );
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 300;
        max-width: none;
        width: 100%;
        min-height: 42px;
        padding: 9px 16px;
        padding-bottom: max(9px, env(safe-area-inset-bottom));
        justify-content: center;
        text-align: center;
        margin: 0;
        background-color: color-mix(in srgb, var(--accent) 16%, var(--surface));
        background-image: var(--guest-stripe);
        background-size: 20px 20px;
        animation: guest-stripe-shift 12s linear infinite;
        border: none;
        border-radius: 0;
        border-top: 2px solid color-mix(in srgb, var(--accent) 42%, var(--border));
        box-shadow: 0 -6px 22px color-mix(in srgb, var(--text-primary) 10%, transparent);
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--text-primary);
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    body.guest-mode .guest-banner p {
        overflow: visible;
        text-overflow: unset;
        text-align: center;
        width: 100%;
    }

    body.guest-mode .guest-banner a {
        color: var(--accent-dark, var(--accent));
    }

    body.guest-mode .guest-banner a:hover {
        color: var(--accent);
        opacity: 1;
    }

    body.guest-mode {
        padding-bottom: calc(42px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .guest-banner {
        animation: none;
    }
}

body.guest-mode .guest-disabled {
    opacity: 0.38 !important;
    cursor: not-allowed !important;
    pointer-events: auto;
    filter: grayscale(0.25);
}

/* Tab rail (desktop) and bottom/tablet tab bars — guests only have Songs. */
body.guest-mode .left-small-sidebar,
body.guest-mode .sidebar-tab-bar {
    display: none !important;
}

body.guest-mode #logout-btn-mobile,
body.guest-mode #save-btn,
body.guest-mode #overflow-save,
body.guest-mode #overflow-suggest,
body.guest-mode #overflow-edit-song,
body.guest-mode #edit-song-btn,
body.guest-mode .navigation-bar-right > .divider:has(+ #edit-song-btn),
body.guest-mode #edit-context-menu,
body.guest-mode #edit-ctx-edit,
body.guest-mode #edit-ctx-suggest,
body.guest-mode #settings-header-btn,
body.guest-mode .song-menu-btn {
    display: none !important;
}

@media (max-width: 600px) {
    body.guest-mode .main-container {
        padding-bottom: env(safe-area-inset-bottom);
    }

    body.guest-mode .main-sidebar {
        bottom: 0;
    }

    body.guest-mode .main-container.sidebars-hidden .left-small-sidebar {
        display: none !important;
    }

    body.guest-mode .overflow-menu {
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
}

.access-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    min-height: 40px;
    padding: 8px 16px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    z-index: 90;
    position: relative;
}

.access-banner[hidden] {
    display: none !important;
}

.access-banner p {
    margin: 0;
}

.access-banner button {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-dark, var(--accent));
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.access-banner button:hover {
    color: var(--accent);
}

.access-banner button:disabled {
    opacity: 0.7;
    cursor: default;
    text-decoration: none;
}

.access-banner__hint {
    width: 100%;
    font-weight: 400;
    color: var(--text-secondary);
}

#access-request-panel .panel-lead {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

#access-request-panel textarea.panel-input {
    resize: vertical;
    min-height: 110px;
    width: 100%;
    box-sizing: border-box;
}

.access-request-counter {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: right;
}

/* Legacy sticky banners removed — use showAppLabel() */
.access-banner {
    display: none !important;
}

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