.step-label-mobile {
    display: none;
}

@media (max-width: 700px) {

    .site-frame {
        width: min(100% - 24px, 1100px);
        padding-top: 10px;
        padding-bottom: 36px;
    }

    .site-header {
        margin-bottom: 24px;
    }

    body[data-room-code] .site-header {
        margin-bottom: 14px;
        padding-top: 2px;
    }

    body[data-room-code] .brand-link {
        gap: 9px;
    }

    body[data-room-code] .brand-mark {
        width: 42px;
        height: 42px;
    }

    body[data-room-code] .brand-wordmark {
        gap: 5px;
        font-size: 1.7rem;
    }

    body[data-room-code] .site-tagline {
        display: none;
    }

    .card {
        border-radius: 20px;
        padding: 18px;
        margin-bottom: 16px;
    }

    /* Compact room identity. Keep the controls out of the document flow while
       closed so Safari cannot turn the room title into a giant grid cell. */

    .room-hero {
        position: relative;
        display: block;
        padding: 11px 13px;
        margin-bottom: 10px;
        border-radius: 17px;
    }

    .room-hero-main {
        display: block;
        width: 100%;
    }

    .room-hero-main > div:first-child {
        min-width: 0;
        padding-right: 156px;
    }

    .room-hero .eyebrow {
        display: none;
    }

    .room-hero h1 {
        display: block;
        overflow: hidden;
        margin: 0;
        font-size: 1.4rem;
        line-height: 1.05;
        letter-spacing: -0.04em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .metadata-row {
        gap: 5px;
        flex-wrap: nowrap;
        margin-top: 7px;
    }

    .metadata-prefix {
        display: none;
    }

    .status-pill,
    .tag,
    .preview-chip {
        min-height: 24px;
        padding: 3px 7px;
        font-size: 0.7rem;
    }

    .metadata-row .status-pill {
        min-width: 0;
        white-space: nowrap;
    }

    .metadata-row .muted-pill {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .participant-note {
        font-size: 0.88rem;
    }

    .room-help-link,
    .room-hero .room-help-link {
        position: absolute;
        top: 9px;
        right: 92px;
        width: auto;
        margin: 0;
        text-align: right;
    }

    .room-hero .room-help-link .link-button {
        width: auto;
        min-height: 29px;
        margin: 0;
        padding: 4px 8px;
        justify-content: center;
        color: var(--primary-dark);
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid var(--border);
        border-radius: 999px;
        box-shadow: none;
        font-size: 0.7rem;
        font-weight: 900;
        white-space: nowrap;
        text-align: center;
        text-decoration: none;
    }

    .room-hero .room-help-link .link-button:hover,
    .room-hero .room-help-link .link-button:focus {
        background: var(--primary-soft);
        box-shadow: none;
        transform: none;
    }

    .room-hero-host-settings {
        margin: 0;
        min-width: 0;
    }

    .room-hero-host-settings:not([open]) {
        position: absolute;
        top: 9px;
        right: 12px;
    }

    .room-hero-host-settings > summary {
        min-height: 29px;
        padding: 4px 8px;
        border-radius: 999px;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .room-hero-host-settings > summary::after {
        font-size: 0.9rem;
    }

    .room-hero-host-settings[open] {
        position: static;
        width: 100%;
        margin-top: 9px;
    }

    .room-hero-host-settings[open] > summary {
        width: max-content;
        margin-left: auto;
    }

    .room-hero-host-settings[open] > .host-settings-card {
        width: 100%;
    }

    @media (max-width: 380px) {
        .room-hero-main > div:first-child {
            padding-right: 140px;
        }

        .room-help-link,
        .room-hero .room-help-link {
            right: 82px;
        }

        .room-hero .room-help-link .link-button,
        .room-hero-host-settings > summary {
            padding-left: 6px;
            padding-right: 6px;
            font-size: 0.66rem;
        }
    }

    /* Compact progress stepper: show every step at once */

    .progress-stepper,
    .progress-stepper.three-step-stepper {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
        overflow: visible;
        margin-bottom: 12px;
        padding-bottom: 0;
    }

    .progress-stepper.three-step-stepper {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .phase-card {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        min-height: 54px;
        gap: 3px;
        padding: 6px 3px;
        border-radius: 14px;
        font-size: 0.68rem;
        line-height: 1.05;
        text-align: center;
    }

    .phase-number {
        width: 24px;
        height: 24px;
        border-radius: 9px;
        font-size: 0.75rem;
    }

    .step-label-desktop {
        display: none;
    }

    .step-label-mobile {
        display: inline;
    }

    .step-label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Participants + invite */

    .mobile-room-disclosure {
        margin-bottom: 12px;
    }

    .mobile-room-disclosure > summary {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        min-height: 46px;
        border: 1px solid var(--border);
        border-radius: 15px;
        padding: 10px 13px;
        background: rgba(255, 255, 255, 0.86);
        color: var(--ink);
        cursor: pointer;
        font-size: 0.92rem;
        font-weight: 950;
        list-style: none;
    }

    .mobile-room-disclosure > summary::-webkit-details-marker {
        display: none;
    }

    .mobile-room-disclosure > summary .summary-count {
        margin-left: auto;
        color: var(--muted);
        font-size: 0.8rem;
        font-weight: 800;
        white-space: nowrap;
    }

    .mobile-room-disclosure > summary::after {
        content: "+";
        color: var(--primary-dark);
        font-size: 1.2rem;
        font-weight: 950;
        white-space: nowrap;
    }

    .mobile-room-disclosure[open] > summary::after {
        content: "−";
    }

    .mobile-room-disclosure:not(.room-hero-host-settings) > summary::after {
        content: "Invite +";
        font-size: 0.8rem;
    }

    .mobile-room-disclosure:not(.room-hero-host-settings)[open] > summary::after {
        content: "Close −";
    }

    .mobile-room-disclosure > .card,
    .mobile-room-disclosure > .host-settings-card {
        margin-top: 8px;
        margin-bottom: 0;
    }

    /* Invite section */

    .share-card {
        padding: 14px 16px;
    }

    .share-card h2 {
        margin-bottom: 14px;
        font-size: 1.35rem;
    }

    .share-card .small:not(#copy-share-message) {
        margin-bottom: 12px;
    }

    .share-card .share-link-row {
        margin-bottom: 10px;
    }

    .share-link-row input[type="text"] {
        display: none;
    }

    .share-link-row button {
        width: 100%;
        margin: 0;
    }

    /* Remove the duplicate current-phase card shell on mobile */

    .phase-panel:not(.quick-decision-card) {
        border: 0;
        border-radius: 0;
        padding: 2px 2px 0;
        margin: 0 0 14px;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .phase-panel:not(.quick-decision-card) > .eyebrow,
    .phase-panel:not(.quick-decision-card) > h2 {
        display: none;
    }

    .phase-panel:not(.quick-decision-card) > p:not(.eyebrow) {
        margin-bottom: 10px;
        font-size: 0.94rem;
        line-height: 1.4;
    }

    .phase-panel:not(.quick-decision-card) .phase-primary-action {
        margin-top: 8px;
    }

    .phase-panel:not(.quick-decision-card) .phase-primary-action .inline-button {
        width: 100%;
        margin: 0 0 4px;
    }

    /* Main headings */

    .phase-panel h2,
    .add-list-card h2,
    .tour-current-list h2,
    .participants-card h2 {
        font-size: clamp(1.55rem, 7vw, 2rem);
    }

    /* Smaller notices */

    .notice,
    .success,
    .error {
        border-radius: 16px;
        padding: 12px 14px;
        margin-bottom: 16px;
    }

    /* Add form */

    .add-list-card {
        padding: 20px;
    }

    .stacked-form {
        max-width: none;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        min-height: 44px;
        margin-bottom: 14px;
    }

    /* TMDb search button */

    #tmdb-search-toggle {
        width: 100%;
        min-height: 54px;
        margin: 8px 0 0;
        padding: 14px 16px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.86);
        color: var(--ink);
        box-shadow: none;
        font-size: 1rem;
        font-weight: 950;
        text-decoration: none;
    }

    #tmdb-search-toggle:hover,
    #tmdb-search-toggle:focus {
        background: rgba(255, 255, 255, 0.96);
        box-shadow: none;
        transform: none;
    }

    /* Host settings */

    .host-settings-card {
        padding: 14px;
    }

    .host-settings-header .small {
        display: none;
    }

    .host-setting-row {
        padding: 10px 12px;
        margin: 8px 0;
    }

    .host-settings-footer {
        padding-top: 12px;
    }

    /* Footer */

    .site-footer {
        margin-top: 2rem;
        padding: 1rem 0 1.5rem;
        font-size: 0.8rem;
    }

    .site-footer p {
        display: grid;
        justify-items: center;
        gap: 0.35rem;
    }

    .site-footer .footer-rights,
    .site-footer .footer-copyright-separator {
        display: none;
    }

    .site-footer .footer-links {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
}

.content-grid {
    grid-template-columns: minmax(0, 1fr);
}

.content-grid > div {
    width: 100%;
}

.mobile-room-disclosure .share-card {
    margin-top: 10px;
    margin-bottom: 10px;
}
