.create-room-wizard-modal {
    width: min(100%, 680px);
}

.create-room-wizard {
    max-width: none;
}

/* Safari keeps its native macOS select chrome unless appearance is reset.
   Use the same field surface as the rest of the wizard and draw a small
   CSS chevron so the decision-type control is consistent across browsers. */
.create-room-wizard select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.75rem;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 13px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.wizard-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 4px 0 22px;
}

.wizard-progress-step {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 950;
}

.wizard-progress-step.active {
    border-color: rgba(21, 92, 255, 0.42);
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: 0 10px 24px rgba(21, 92, 255, 0.12);
}

.wizard-progress-step.done {
    border-color: var(--success-border);
    background: var(--success-bg);
    color: var(--success-text);
}

.wizard-step {
    border: 1px solid rgba(223, 230, 244, 0.9);
    border-radius: 22px;
    padding: clamp(16px, 3vw, 22px);
    background: rgba(248, 251, 255, 0.78);
}

.wizard-step[hidden] {
    display: none;
}

.wizard-step h4 {
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.wizard-step-count {
    margin-bottom: 6px;
    color: var(--primary-dark);
    font-weight: 900;
}

.wizard-setting-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.wizard-setting-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.wizard-setting-card[hidden] {
    display: none;
}

.wizard-setting-card:hover {
    transform: translateY(-1px);
    border-color: rgba(21, 92, 255, 0.35);
    box-shadow: 0 10px 24px rgba(11, 27, 63, 0.08);
}

.wizard-setting-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.wizard-setting-card input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.wizard-setting-card strong,
.wizard-setting-card span span {
    display: block;
}

.wizard-setting-card strong {
    margin-bottom: 3px;
    color: var(--ink);
    font-weight: 950;
}

.wizard-setting-card span span {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 650;
}

.wizard-review-card {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
}

.wizard-review-card > div {
    display: grid;
    gap: 3px;
}

.wizard-review-card > div[hidden] {
    display: none;
}

.wizard-review-card strong {
    font-size: 1.05rem;
}

.wizard-review-card ul {
    display: grid;
    gap: 8px;
    margin: 6px 0 0;
    padding-left: 20px;
    color: var(--muted);
    font-weight: 750;
}

.wizard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.wizard-actions button {
    margin-bottom: 0;
}

/* In Theaters Now uses a one-step room-creation experiment. These rules live
   in the normal stylesheet rather than an injected <style> block so the
   production CSP applies them consistently. */
.create-room-wizard-modal:has([data-in-theaters-single-step="true"]) {
    width: min(100%, 800px);
}

[data-in-theaters-single-step="true"] .wizard-actions {
    justify-content: flex-end !important;
}

[data-in-theaters-single-step="true"] .in-theaters-inline-options {
    margin-top: 24px !important;
}

[data-in-theaters-single-step="true"] .in-theaters-inline-options-label {
    margin: 0 0 12px !important;
    color: var(--ink) !important;
    font-size: 1rem;
    font-weight: 950 !important;
}

[data-in-theaters-single-step="true"] .in-theaters-option-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle {
    position: relative;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 72px minmax(92px, 1fr) !important;
    gap: 10px !important;
    min-width: 0;
    min-height: 208px !important;
    align-items: center !important;
    justify-items: center;
    padding: 20px 14px 16px !important;
    border: 2px solid rgba(15, 35, 73, 0.16) !important;
    border-radius: 18px !important;
    background: #fff !important;
    color: var(--ink);
    text-align: center;
    cursor: pointer;
    box-shadow: none !important;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:hover {
    transform: translateY(-2px) !important;
    border-color: rgba(21, 92, 255, 0.45) !important;
    box-shadow: 0 12px 28px rgba(11, 27, 63, 0.09) !important;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:focus-within {
    outline: 3px solid rgba(21, 92, 255, 0.2);
    outline-offset: 3px;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input:checked) {
    border-color: var(--primary) !important;
    background: #fff !important;
    box-shadow: 0 0 0 1px rgba(21, 92, 255, 0.08) !important;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle::before {
    content: "";
    display: grid;
    grid-row: 1;
    width: 68px;
    height: 68px;
    place-items: center;
    align-self: center;
    border-radius: 999px;
    background: rgba(15, 35, 73, 0.055);
    color: #7d8799;
    font-size: 2rem;
    font-weight: 950;
    line-height: 1;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input:checked)::before {
    background: rgba(21, 92, 255, 0.08);
    color: var(--primary);
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input[name="requires_authentication"])::before {
    content: "⇥";
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input[name="category_voting_enabled"])::before {
    content: "▼\A│";
    white-space: pre;
    font-size: 1.35rem;
    line-height: 0.72;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input[name="quick_decision_enabled"])::before {
    content: "ϟ";
    font-size: 2.25rem;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle > span {
    display: grid !important;
    grid-row: 2;
    grid-template-rows: minmax(48px, 1fr) 32px;
    gap: 12px !important;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-items: center;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle strong {
    grid-row: 1;
    margin: 0 !important;
    color: var(--ink) !important;
    font-size: 0 !important;
    font-weight: 950 !important;
    line-height: 1.15;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle strong::after {
    display: block;
    font-size: 1.08rem;
    white-space: pre-line;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input[name="requires_authentication"]) strong::after {
    content: "Require sign-in\Ato join";
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input[name="category_voting_enabled"]) strong::after {
    content: "Vote on\Acategories";
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input[name="quick_decision_enabled"]) strong::after {
    content: "Enable quick\Adecision";
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle > span::before {
    content: "";
    display: grid !important;
    grid-row: 2;
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
    place-items: center;
    border: 2px solid #929cab !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #fff !important;
    font-size: 1rem !important;
    font-weight: 950 !important;
    line-height: 1;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:has(input:checked) > span::before {
    content: "✓";
    border-color: var(--primary) !important;
    background: var(--primary) !important;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle > span > span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle::after {
    content: attr(data-help);
    position: absolute;
    z-index: 40;
    left: 50%;
    bottom: calc(100% + 10px);
    width: min(250px, 72vw);
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.35;
    text-align: left;
    box-shadow: 0 10px 24px rgba(11, 27, 63, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

[data-in-theaters-single-step="true"] .in-theaters-option-toggle:hover::after,
[data-in-theaters-single-step="true"] .in-theaters-option-toggle:focus-within::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 700px) {
    .create-room-wizard-modal {
        width: min(100%, 540px);
    }

    .wizard-progress {
        gap: 8px;
    }

    .wizard-progress-step {
        min-height: 34px;
    }

    .wizard-actions {
        flex-direction: column-reverse;
    }

    .wizard-actions button {
        width: 100%;
    }

    .create-room-wizard-modal:has([data-in-theaters-single-step="true"]) {
        width: min(100%, 620px);
    }

    [data-in-theaters-single-step="true"] .in-theaters-option-row {
        display: flex !important;
        gap: 10px !important;
        overflow-x: auto;
        padding: 2px 2px 8px;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    [data-in-theaters-single-step="true"] .in-theaters-option-toggle {
        flex: 0 0 150px;
        min-height: 174px !important;
        padding: 16px 10px 14px !important;
        scroll-snap-align: start;
    }

    [data-in-theaters-single-step="true"] .wizard-actions {
        flex-direction: row;
        justify-content: flex-end !important;
    }

    [data-in-theaters-single-step="true"] .wizard-actions button {
        width: auto;
    }
}
