:root {
    --background: #f7f9ff;
    --surface: #ffffff;
    --surface-soft: #f1f5ff;
    --ink: #0b1b3f;
    --muted: #65718c;
    --border: #dfe6f4;
    --primary: #155cff;
    --primary-dark: #0d3db3;
    --primary-soft: #e8efff;
    --success-bg: #e9f8ef;
    --success-border: #bfe6cb;
    --success-text: #166534;
    --notice-bg: #fff7d6;
    --notice-border: #ead783;
    --notice-text: #6b5300;
    --danger: #c62828;
    --danger-soft: #fff0f0;
    --shadow: 0 18px 45px rgba(11, 27, 63, 0.1);
    --radius: 22px;
    --muted-text: #6b7280;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

.auth-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.logout-button,
.auth-link {
    min-height: 34px;
    margin: 0;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 900;
    white-space: nowrap;
}

.logout-button {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border: 1px solid rgba(21, 92, 255, 0.16);
    box-shadow: none;
}

.logout-button:hover {
    background: #dce7ff;
    box-shadow: none;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    background:
        radial-gradient(circle at top left, rgba(21, 92, 255, 0.18), transparent 32rem),
        radial-gradient(circle at top right, rgba(123, 92, 255, 0.13), transparent 28rem),
        var(--background);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 55%);
}

.site-frame {
    position: relative;
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.page-shell {
    width: 100%;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: clamp(40px, 5vw, 68px);
    padding-top: 10px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--ink);
    text-decoration: none;
    transition: transform 150ms ease;
}

.brand-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(54px, 4.8vw, 68px);
    height: clamp(54px, 4.8vw, 68px);
    flex: 0 0 auto;
    filter: drop-shadow(0 10px 18px rgba(21, 92, 255, 0.14));
}

.brand-mark-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.brand-mark-ring {
    stroke: var(--primary);
}

.brand-mark-check {
    stroke: var(--ink);
}

.brand-spark {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
}

.spark-green {
    stroke: #22c55e;
}

.spark-orange {
    stroke: #f59e0b;
}

.spark-purple {
    stroke: #8b5cf6;
}

.spark-blue {
    stroke: #0ea5e9;
}

.brand-wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--ink);
    font-size: clamp(2rem, 2.8vw, 3rem);
    font-weight: 950;
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.brand-one {
    color: var(--primary);
}

.site-tagline {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: -0.01em;
}

h1,
h2,
h3,
h4,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
    line-height: 1.08;
    margin: 0 0 14px;
    letter-spacing: -0.035em;
}

h1 {
    font-size: clamp(2.4rem, 6.2vw, 4.55rem);
}

h2 {
    font-size: clamp(1.45rem, 3vw, 2.2rem);
}

h3 {
    font-size: 1.15rem;
}

p {
    margin-top: 0;
}

a {
    color: var(--primary-dark);
    font-weight: 800;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.small {
    color: var(--muted);
    font-size: 0.92rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #34d399);
}

.hero-lede {
    max-width: 680px;
    color: #263757;
    font-size: clamp(1.08rem, 2vw, 1.28rem);
}

.card {
    border: 1px solid rgba(223, 230, 244, 0.95);
    border-radius: var(--radius);
    padding: clamp(18px, 3vw, 28px);
    margin-bottom: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    backdrop-filter: blur(12px);
}

.elevated-card {
    box-shadow: var(--shadow);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    display: block;
    width: 100%;
    min-height: 46px;
    margin: 7px 0 18px;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    font: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(21, 92, 255, 0.15);
}

label {
    display: block;
    font-weight: 850;
}

button,
.action-link,
.home-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 46px;
    margin: 8px 0 16px;
    padding: 12px 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(21, 92, 255, 0.22);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

button:hover,
.action-link:hover,
.home-action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(21, 92, 255, 0.28);
}

button:active,
.action-link:active,
.home-action-button:active {
    transform: translateY(0);
}

.secondary-button {
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: none;
}

.secondary-button:hover {
    background: var(--primary-soft);
    box-shadow: 0 8px 20px rgba(11, 27, 63, 0.08);
}

.small-button {
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.inline-button {
    margin-right: 10px;
}

.danger-button {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #ffd1d1;
    box-shadow: none;
}

.danger-button:hover {
    background: #ffe4e4;
    box-shadow: none;
}

.stacked-form {
    max-width: 520px;
}

.compact-form {
    max-width: 360px;
}

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

.error {
    color: #8f1d1d;
    background: #fff0f0;
    border: 1px solid #ffc9c9;
    font-weight: 800;
}

.notice {
    color: var(--notice-text);
    background: var(--notice-bg);
    border: 1px solid var(--notice-border);
}

.success {
    color: var(--success-text);
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.status-pill,
.tag,
.preview-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 0.9rem;
    font-weight: 900;
}

.muted-pill {
    color: var(--muted);
    background: #f5f7fc;
}

.metadata-row,
.tag-cloud,
.preview-chip-row,
.home-actions,
.host-button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.centered-metadata {
    justify-content: center;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    align-items: center;
    gap: clamp(26px, 5vw, 58px);
    min-height: min(590px, 66vh);
    padding: 8px 0 42px;
}

.home-hero-copy {
    max-width: 720px;
}

.home-actions {
    margin-top: 28px;
}

.home-action-button {
    min-height: 54px;
    padding: 14px 22px;
    font-size: 1rem;
}

.home-preview-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(223, 230, 244, 0.9);
    border-radius: 32px;
    padding: 28px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(232, 239, 255, 0.82)),
        #fff;
    box-shadow: var(--shadow);
}

.home-preview-card::after {
    content: "";
    position: absolute;
    right: -38px;
    top: -38px;
    width: 130px;
    height: 130px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(21, 92, 255, 0.24), rgba(52, 211, 153, 0.22));
}

.auth-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    max-width: min(100%, 520px);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 8px 7px 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(11, 27, 63, 0.06);
}

.auth-status strong {
    color: var(--ink);
    font-weight: 900;
}

.mini-room-header,
.section-heading-row,
.result-heading-row,
.room-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.preview-chip-row {
    margin: 22px 0;
}

.preview-chip {
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--border);
}

.preview-chip.selected {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-color: rgba(21, 92, 255, 0.2);
}

.preview-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 22px;
    padding: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #0f2c7a);
}

.preview-result span {
    font-weight: 750;
    opacity: 0.88;
}

.preview-result strong {
    font-size: 2rem;
}

.how-it-works {
    margin: 24px 0 48px;
}

.step-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.step-card {
    min-height: 210px;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.76);
}

.step-number,
.phase-number,
.result-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    font-weight: 950;
}

.page-intro,
.center-panel {
    margin: 18px 0 26px;
}

.center-panel {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.center-panel .card,
.center-panel .stacked-form {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
}

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

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

.phase-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
    font-weight: 900;
}

.phase-card.active {
    color: var(--ink);
    border-color: rgba(21, 92, 255, 0.42);
    background: #fff;
    box-shadow: 0 12px 30px rgba(21, 92, 255, 0.12);
}

.phase-card.done {
    color: var(--success-text);
    background: var(--success-bg);
    border-color: var(--success-border);
}

.room-hero {
    align-items: center;
}

.participant-note {
    max-width: 260px;
    margin: 0;
    text-align: right;
}

.share-card {
    background: rgba(255, 255, 255, 0.72);
}

.share-link-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-link-row input[type="text"] {
    flex: 1;
    min-width: 220px;
    margin: 0;
}

.share-link-row button {
    white-space: nowrap;
}

.phase-panel {
    margin-top: 4px;
}

.quick-decision-card {
    overflow: hidden;
}

.quick-decision-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
}

.quick-wheel-shell {
    position: relative;
    width: min(280px, 76vw);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

.quick-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    border: 6px solid var(--border);
    border-radius: 999px;
    background:
        conic-gradient(
            from 0deg,
            #ffffff 0deg 45deg,
            var(--primary-soft) 45deg 90deg,
            #ffffff 90deg 135deg,
            var(--primary-soft) 135deg 180deg,
            #ffffff 180deg 225deg,
            var(--primary-soft) 225deg 270deg,
            #ffffff 270deg 315deg,
            var(--primary-soft) 315deg 360deg
        );
    box-shadow: var(--shadow);
    transition: transform 3.2s cubic-bezier(0.12, 0.78, 0.18, 1);
}

.quick-wheel-pointer {
    position: absolute;
    top: -3px;
    left: 50%;
    z-index: 5;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 28px solid var(--primary-dark);
}

.quick-wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    transform: translate(-50%, -50%);
    border: 4px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary-dark);
    box-shadow: 0 8px 22px rgba(11, 27, 63, 0.12);
    font-size: 1.6rem;
    font-weight: 950;
}

.quick-wheel-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1rem;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    transform:
        rotate(calc((360deg / var(--item-count)) * var(--item-index)))
        translateY(-1px);
    pointer-events: none;
}

.quick-wheel-item::before {
    content: "";
    position: absolute;
    top: 0.72rem;
    width: min(82px, 26vw);
    height: 2.15rem;
    border: 1px solid rgba(223, 230, 244, 0.92);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 4px 12px rgba(11, 27, 63, 0.08);
}

.quick-wheel-item {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 1.2rem;
    color: var(--ink);
    font-size: 0.64rem;
    font-weight: 900;
    line-height: 1;
    text-align: left;
    transform:
        rotate(calc((360deg / var(--item-count)) * var(--item-index)));
    transform-origin: center;
    pointer-events: none;
}

.quick-wheel-item {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    max-height: 7.5rem;
    overflow: hidden;
}

.quick-wheel-item::before {
    display: none;
}

.quick-decision-controls {
    display: grid;
    gap: 0.85rem;
    justify-items: start;
}

.quick-decision-controls p {
    margin-bottom: 0;
}

.quick-decision-result {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    background: var(--surface-soft);
    color: var(--ink);
    font-weight: 900;
}

#quick-decision-spin-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

@media (max-width: 700px) {
    .quick-decision-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .quick-decision-controls {
        justify-items: stretch;
    }

    .quick-decision-controls .inline-button {
        width: 100%;
    }

    .quick-decision-result {
        text-align: center;
    }
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

.host-controls {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin-top: 18px;
    background: #f8fbff;
}

.host-controls h3,
.host-controls h4 {
    margin-top: 0;
}

.choice-list {
    max-width: 760px;
    margin: 22px 0;
}

.choice-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    cursor: pointer;
    background: #fff;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

.choice-row input[type="checkbox"],
.option-vote-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.choice-text {
    flex: 1;
    font-size: 1rem;
}

.choice-subtext {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.option-choice-list {
    max-width: 900px;
}

.option-vote-row {
    align-items: center;
    justify-content: space-between;
}

.option-vote-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.option-vote-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 900;
    white-space: nowrap;
}

.veto-control {
    color: var(--danger);
    background: var(--danger-soft);
}

.option-list,
.participant-list,
.result-list {
    padding-left: 0;
    list-style: none;
}

.option-list-item,
.participant-list li,
.result-item {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.option-list-item:last-child,
.participant-list li:last-child,
.result-item:last-child {
    border-bottom: none;
}

.option-list-main {
    margin-bottom: 10px;
}

.option-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
}

.inline-edit-form,
.delete-option-form {
    margin: 0;
}

.inline-edit-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.inline-edit-fields {
    flex-basis: 100%;
    width: 100%;
    margin-bottom: 2px;
}

.inline-edit-fields[hidden] {
    display: none;
}

.inline-edit-fields label {
    margin-bottom: 8px;
}

.inline-edit-fields input[type="text"] {
    margin: 0 0 10px;
}

.participant-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.participant-flags {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.participant-flags strong {
    color: var(--primary-dark);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.result-list {
    counter-reset: results;
    margin: 0;
}

.result-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.result-content {
    min-width: 0;
}

.agreement-percent {
    color: var(--primary-dark);
    font-size: 1.4rem;
}

.agreement-bar {
    overflow: hidden;
    width: 100%;
    height: 12px;
    margin: 12px 0 8px;
    border-radius: 999px;
    background: #e7ecf7;
}

.agreement-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #34d399);
}

.winner-card h2 {
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.compact-list {
    margin-bottom: 18px;
}

.realtime-banner {
    position: sticky;
    top: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--notice-border);
    border-radius: 18px;
    padding: 12px 14px;
    margin-bottom: 20px;
    color: var(--notice-text);
    background: rgba(255, 247, 214, 0.96);
    box-shadow: 0 10px 28px rgba(107, 83, 0, 0.12);
}

.realtime-banner[hidden] {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 42, 0.54);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal[hidden],
.modal-backdrop[hidden] {
    display: none;
}

.modal-content {
    width: min(100%, 540px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: white;
    border-radius: 26px;
    padding: clamp(20px, 3vw, 30px);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close-button {
    width: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    background: var(--surface-soft);
    color: var(--ink);
    box-shadow: none;
    font-size: 1.8rem;
    line-height: 1;
}

.modal-close-button:hover {
    background: var(--primary-soft);
    box-shadow: none;
}

@media (max-width: 900px) {
    .home-hero,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .home-hero {
        min-height: auto;
    }

    .step-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .participants-card {
        order: -1;
    }
}

@media (max-width: 700px) {
    .site-header-right {
        align-items: flex-start;
        text-align: left;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
    }

    .brand-wordmark {
        font-size: 1.9rem;
    }

    h1 {
        font-size: clamp(2.2rem, 12vw, 3.2rem);
    }

    .home-actions,
    .home-actions button,
    .home-action-button,
    .action-link,
    button:not(.small-button):not(.modal-close-button) {
        width: 100%;
    }

    .step-card-grid,
    .progress-stepper {
        grid-template-columns: 1fr;
    }

    .phase-card {
        min-height: 58px;
    }

    .room-hero,
    .mini-room-header,
    .section-heading-row,
    .result-heading-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .participant-note {
        max-width: none;
        text-align: left;
    }

    .share-link-row,
    .option-vote-row,
    .option-vote-actions,
    .host-button-row {
        align-items: stretch;
        flex-direction: column;
    }

    .share-link-row input[type="text"],
    .share-link-row button,
    .option-vote-control {
        width: 100%;
    }

    .realtime-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .realtime-banner .small-button {
        width: 100%;
    }

    .auth-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

.category-suggestion-wrapper {
    position: relative;
    width: 100%;
    margin: 7px 0 18px;
}

.category-suggestion-wrapper input[type="text"] {
    width: 100%;
    margin: 0;
}

.inline-edit-form .category-suggestion-wrapper {
    margin: 0;
}

.category-suggestion-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1200;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(11, 27, 63, 0.16);
}

.category-suggestion-menu[hidden] {
    display: none;
}

.category-suggestion-item {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    box-shadow: none;
    text-align: left;
    font-weight: 850;
}

.category-suggestion-item:last-child {
    border-bottom: 0;
}

.category-suggestion-item:hover {
    transform: none;
    background: var(--primary-soft);
    box-shadow: none;
}

.checkbox-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 18px;
    font-weight: 850;
}

.checkbox-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.site-header-right {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
    text-align: right;
}

.auth-status-label {
    color: var(--muted);
}

.logout-form {
    margin: 0;
}

.site-header .logout-button {
    min-height: 0;
    margin: 0;
    padding: 4px 10px;
    color: var(--primary-dark);
    background: transparent;
    border: 1px solid rgba(21, 92, 255, 0.25);
    border-radius: 999px;
    box-shadow: none;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.2;
}

.site-header .logout-button:hover {
    transform: none;
    background: var(--primary-soft);
    box-shadow: none;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0;
    padding: 5px 11px;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 1rem 2rem;
    text-align: center;
    color: var(--muted-text);
    font-size: 0.9rem;
}

.site-footer p {
    margin: 0;
}

.phase-primary-action {
    margin: 18px 0 8px;
}

.phase-primary-action form {
    margin: 0;
}

.host-settings-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    margin-top: 18px;
    background: #f8fbff;
}

.host-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.host-settings-header h3 {
    margin-bottom: 6px;
}

.host-settings-header .small {
    margin-bottom: 0;
}

.host-setting-section {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
}

.host-setting-section:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.host-setting-section h4 {
    margin-bottom: 6px;
    font-size: 1rem;
}

.host-setting-section-heading {
    margin-bottom: 10px;
}

.host-settings-form {
    max-width: none;
    margin: 0;
}

.host-setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(223, 230, 244, 0.92);
    border-radius: 16px;
    padding: 12px 14px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.78);
}

.setting-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.setting-text span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}

.host-setting-note {
    margin: 8px 0 12px;
}

.setting-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.switch-control {
    cursor: pointer;
}

.switch-control input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #d7deec;
    transition: background 150ms ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(11, 27, 63, 0.18);
    transition: transform 150ms ease;
}

.switch-control input[type="checkbox"]:checked + .switch-track {
    background: var(--primary);
}

.switch-control input[type="checkbox"]:checked + .switch-track::after {
    transform: translateX(20px);
}

.switch-control input[type="checkbox"]:focus-visible + .switch-track {
    box-shadow: 0 0 0 4px rgba(21, 92, 255, 0.18);
}

.switch-control input[type="checkbox"]:disabled + .switch-track {
    opacity: 0.55;
    cursor: not-allowed;
}

.compact-number-input {
    width: 96px;
    min-height: 40px;
    margin: 0;
    text-align: center;
}

.host-settings-details {
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 14px;
}

.host-settings-details summary {
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 900;
}

.host-settings-details summary:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.phase-primary-action {
    margin: 18px 0 8px;
}

.phase-primary-action form {
    margin: 0;
}

.host-settings-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    margin-top: 18px;
    background: #f8fbff;
}

.host-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.host-settings-header h3 {
    margin-bottom: 6px;
}

.host-settings-header .small {
    margin-bottom: 0;
}

.host-setting-section {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
}

.host-setting-section:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.host-setting-section h4 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.host-settings-form {
    max-width: none;
    margin: 0;
}

.host-setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(223, 230, 244, 0.92);
    border-radius: 16px;
    padding: 12px 14px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.78);
}

.setting-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.setting-text span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}

.host-setting-note {
    margin: 8px 0 12px;
}

.switch-control {
    cursor: pointer;
}

.switch-control input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #d7deec;
    transition: background 150ms ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(11, 27, 63, 0.18);
    transition: transform 150ms ease;
}

.switch-control input[type="checkbox"]:checked + .switch-track {
    background: var(--primary);
}

.switch-control input[type="checkbox"]:checked + .switch-track::after {
    transform: translateX(20px);
}

.switch-control input[type="checkbox"]:focus-visible + .switch-track {
    box-shadow: 0 0 0 4px rgba(21, 92, 255, 0.18);
}

.switch-control input[type="checkbox"]:disabled + .switch-track {
    opacity: 0.55;
    cursor: not-allowed;
}

.compact-number-input {
    width: 96px;
    min-height: 40px;
    margin: 0;
    text-align: center;
}

.host-settings-details {
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 14px;
}

.host-settings-details summary {
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 900;
}

.host-settings-details summary:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.host-settings-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 14px;
}

@media (max-width: 700px) {
    .site-frame {
        width: min(100% - 34px, 1100px);
        padding-top: 18px;
    }

    .site-header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 52px;
    }

    .brand-link {
        justify-self: start;
        gap: 12px;
    }

    .brand-mark {
        width: 54px;
        height: 54px;
    }

    .brand-wordmark {
        font-size: clamp(2.05rem, 9vw, 2.75rem);
        letter-spacing: -0.065em;
    }

    .site-header-right {
        display: block;
        width: 100%;
        text-align: left;
    }

    .site-tagline {
        margin: 0;
        color: var(--muted);
        font-size: clamp(1.05rem, 4.3vw, 1.35rem);
        font-weight: 900;
        line-height: 1.15;
    }

    .auth-status {
        display: inline-grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        width: min(100%, 390px);
        margin-top: 10px;
        padding: 7px 9px 7px 11px;
        gap: 8px;
        border-radius: 999px;
        font-size: 0.82rem;
        text-align: left;
        box-shadow: 0 8px 18px rgba(11, 27, 63, 0.06);
    }

    .auth-status-label {
        display: none;
    }

    .auth-status strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.84rem;
    }

    .site-header .logout-button {
        min-height: 28px;
        padding: 4px 9px;
        font-size: 0.74rem;
        white-space: nowrap;
    }

    .home-hero {
        padding-top: 8px;
    }

    .progress-stepper.three-step-stepper {
        grid-template-columns: 1fr;
    }

    .host-settings-header,
    .host-setting-row {
        grid-template-columns: 1fr;
    }

    .host-settings-header {
        flex-direction: column;
    }

    .host-setting-row {
        align-items: stretch;
    }

    .switch-control {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .compact-number-input {
        width: 100%;
    }

    .setting-save-row {
        justify-content: stretch;
    }

    .setting-save-row .small-button {
        width: 100%;
    }

    .host-settings-header,
    .host-setting-row {
        grid-template-columns: 1fr;
    }

    .host-settings-header {
        flex-direction: column;
    }

    .host-setting-row {
        align-items: stretch;
    }

    .switch-control {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .compact-number-input {
        width: 100%;
    }

    .host-settings-footer {
        justify-content: stretch;
    }

    .host-settings-footer button {
        width: 100%;
    }
}

.add-option-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.tmdb-search-panel {
    margin-top: 0.75rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 0.75rem;
    background: #ffffff;
}

.tmdb-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tmdb-search-input {
    flex: 1;
    min-width: 0;
}

.tmdb-linked-note {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--muted-text, #666);
}

.tmdb-search-results {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tmdb-result-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 0.65rem;
    background: #fff;
    cursor: pointer;
}

.tmdb-result-button:hover,
.tmdb-result-button:focus {
    border-color: currentColor;
}

.tmdb-result-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.85rem;
    color: var(--muted-text, #666);
}

.tmdb-result-overview {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted-text, #666);
}

.option-record {
    position: relative;
}

.option-title-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.tmdb-info-pill {
    border: 1px solid var(--border-color, #ddd);
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    background: transparent;
    cursor: pointer;
}

.tmdb-info-popover {
    display: none;
    position: absolute;
    z-index: 20;
    left: 0;
    top: calc(100% + 0.4rem);
    width: min(24rem, 90vw);
    padding: 0.85rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.15);
}

.has-tmdb-info:hover .tmdb-info-popover,
.has-tmdb-info:focus-within .tmdb-info-popover {
    display: block;
}

.tmdb-info-title {
    margin-top: 0;
}

@media (max-width: 700px) {
    .add-option-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tmdb-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tmdb-info-popover {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        box-shadow: none;
    }

    .has-tmdb-info:hover .tmdb-info-popover,
    .has-tmdb-info:focus-within .tmdb-info-popover {
        display: none;
    }

    .has-tmdb-info.tmdb-open .tmdb-info-popover {
        display: block;
    }
}

.tmdb-add-controls {
    position: relative;
    max-width: 100%;
}

.add-option-actions {
    position: relative;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.tmdb-search-panel {
    position: absolute;
    z-index: 50;
    left: 0;
    top: calc(100% + 0.75rem);
    width: min(34rem, calc(100vw - 3rem));
    padding: 0.9rem;
    border: 1px solid var(--border-color, #dbe4f0);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 1rem 2.5rem rgba(12, 28, 61, 0.18);
}

.tmdb-search-panel[hidden] {
    display: none;
}

.tmdb-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.tmdb-search-close {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border-color, #dbe4f0);
    border-radius: 999px;
    background: #ffffff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.tmdb-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tmdb-search-input {
    flex: 1;
    min-width: 14rem;
}

.tmdb-search-results {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
    max-height: 18rem;
    overflow-y: auto;
}

.tmdb-result-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color, #dbe4f0);
    border-radius: 0.75rem;
    background: #ffffff;
    cursor: pointer;
}

.tmdb-result-button:hover,
.tmdb-result-button:focus {
    border-color: currentColor;
}

.tmdb-result-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.85rem;
    color: var(--muted-text, #667085);
}

.tmdb-result-overview {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted-text, #667085);
}

.tmdb-linked-note {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--muted-text, #667085);
}

@media (max-width: 700px) {
    .add-option-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tmdb-search-panel {
        position: fixed;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        top: auto;
        width: auto;
        max-height: 70vh;
        overflow-y: auto;
    }

    .tmdb-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tmdb-search-input {
        min-width: 0;
        width: 100%;
    }
}

.content-grid,
.content-grid > div {
    overflow: visible;
}

.add-list-card {
    position: relative;
    z-index: 100;
    overflow: visible;
}

.tmdb-add-controls {
    position: relative;
    z-index: 110;
}

.tmdb-search-panel {
    z-index: 999;
}

/* TMDb search popover — polished site-matching version */

.tmdb-add-controls {
    position: relative;
    z-index: 110;
    width: fit-content;
    max-width: 100%;
}

.add-option-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.tmdb-search-panel {
    position: absolute;
    z-index: 999;
    left: 0;
    top: calc(100% + 0.9rem);
    width: min(38rem, calc(100vw - 4rem));
    padding: 1.25rem;
    border: 1px solid #dbe6f5;
    border-radius: 1.5rem;
    background: #ffffff;
    box-shadow: 0 1.25rem 3rem rgba(12, 28, 61, 0.18);
}

.tmdb-search-panel[hidden] {
    display: none;
}

.tmdb-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tmdb-search-header strong {
    color: #0b1b44;
    font-size: 1rem;
    font-weight: 800;
}

.tmdb-search-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    padding: 0;
    border: 1px solid #dbe6f5;
    border-radius: 999px;
    background: #ffffff;
    color: #0b1b44;
    box-shadow: none;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.tmdb-search-close:hover,
.tmdb-search-close:focus {
    background: #f5f8ff;
}

.tmdb-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.tmdb-search-input {
    flex: 1;
    min-width: 18rem;
    height: 3.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid #dbe6f5;
    border-radius: 1rem;
    background: #ffffff;
    color: #0b1b44;
    font: inherit;
    font-size: 1rem;
    outline: none;
}

.tmdb-search-input::placeholder {
    color: #7a7f8c;
}

.tmdb-search-input:focus {
    border-color: #1f5eff;
    box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
}

.tmdb-search-row .secondary-button {
    height: 3.25rem;
    white-space: nowrap;
}

.tmdb-search-results {
    display: grid;
    gap: 0.6rem;
    margin-top: 1rem;
    max-height: 18rem;
    overflow-y: auto;
}

.tmdb-result-button {
    display: block;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid #dbe6f5;
    border-radius: 1rem;
    background: #ffffff;
    color: #0b1b44;
    text-align: left;
    cursor: pointer;
}

.tmdb-result-button:hover,
.tmdb-result-button:focus {
    border-color: #1f5eff;
    background: #f8faff;
}

.tmdb-result-meta {
    display: block;
    margin-top: 0.2rem;
    color: #667085;
    font-size: 0.85rem;
}

.tmdb-result-overview {
    display: block;
    margin-top: 0.45rem;
    color: #667085;
    font-size: 0.9rem;
    line-height: 1.4;
}

.tmdb-linked-note {
    margin: 0.75rem 0 0;
    color: #667085;
    font-size: 0.95rem;
}

@media (max-width: 700px) {
    .tmdb-add-controls {
        width: 100%;
    }

    .add-option-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tmdb-search-panel {
        position: fixed;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        top: auto;
        width: auto;
        max-height: 75vh;
        overflow-y: auto;
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .tmdb-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tmdb-search-input {
        min-width: 0;
        width: 100%;
    }

    .tmdb-search-row .secondary-button {
        width: 100%;
    }
}

/* TMDb option info pill + hover card */

.option-record {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.option-title-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.option-title {
    color: #0b1b44;
}

.tmdb-info-pill {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0.25rem 0.6rem !important;
    border: 1px solid #dbe6f5;
    border-radius: 999px;
    background: #ffffff;
    color: #0b1b44 !important;
    box-shadow: none !important;
    font-size: 0.75rem !important;
    font-weight: 800;
    line-height: 1.2;
    text-indent: 0;
    cursor: pointer;
}

.tmdb-info-pill:hover,
.tmdb-info-pill:focus {
    border-color: #1f5eff;
    background: #f5f8ff;
    color: #0b1b44 !important;
}

.tmdb-info-popover {
    display: none;
    position: absolute;
    z-index: 1000;
    left: 0;
    top: calc(100% + 0.5rem);
    width: min(28rem, calc(100vw - 3rem));
    padding: 1rem;
    border: 1px solid #dbe6f5;
    border-radius: 1rem;
    background: #ffffff;
    color: #0b1b44;
    box-shadow: 0 1rem 2.5rem rgba(12, 28, 61, 0.18);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
}

.tmdb-info-popover p {
    margin: 0.6rem 0;
    color: #0b1b44;
}

.tmdb-info-popover .tmdb-info-title {
    margin-top: 0;
}

.tmdb-info-popover a {
    color: #1f5eff;
    font-weight: 800;
}

.has-tmdb-info:hover .tmdb-info-popover,
.has-tmdb-info:focus-within .tmdb-info-popover {
    display: block;
}

@media (max-width: 700px) {
    .option-record {
        display: block;
    }

    .tmdb-info-popover {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        box-shadow: none;
    }

    .has-tmdb-info:hover .tmdb-info-popover,
    .has-tmdb-info:focus-within .tmdb-info-popover {
        display: none;
    }

    .has-tmdb-info.tmdb-open .tmdb-info-popover {
        display: block;
    }
}

/* Keep TMDb info popup open long enough to interact with it */

.tmdb-info-popover {
    top: calc(100% + 0.35rem);
}

/* Invisible hover bridge between the Info pill and the popup */
.tmdb-info-popover::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.6rem;
    height: 0.6rem;
}

/* Allow click-to-pin on desktop and mobile */
.has-tmdb-info.tmdb-open .tmdb-info-popover {
    display: block;
}

.host-settings-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.danger-button:hover {
    background: #991b1b;
}

@media (max-width: 640px) {
    .host-settings-action-row {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

.danger-button:hover {
    background: #991b1b;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(185, 28, 28, 0.25);
}

.danger-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.host-settings-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.host-delete-button {
    background: #b91c1c;
    color: #ffffff;
}

.host-delete-button:hover {
    background: #991b1b;
}

@media (max-width: 640px) {
    .host-settings-action-row {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

.site-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.site-modal-backdrop[hidden] {
    display: none;
}

.site-modal-card {
    width: min(100%, 34rem);
    padding: 1.5rem;
}

.site-modal-card h2 {
    margin-top: 0.35rem;
}

.site-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .site-modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .site-modal-actions .inline-button {
        width: 100%;
    }
}

/* Guided room tour */

.tour-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 22px;
    padding: clamp(16px, 2.5vw, 22px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(11, 27, 63, 0.08);
    backdrop-filter: blur(12px);
}

.tour-prompt[hidden] {
    display: none;
}

.tour-prompt-copy {
    display: grid;
    gap: 0.25rem;
}

.tour-prompt-copy strong {
    color: var(--ink);
}

.tour-prompt-copy p {
    margin: 0;
    color: var(--muted);
}

.tour-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.tour-prompt-actions button {
    margin: 0;
}

.room-help-link {
    margin-top: 0.75rem;
}

.link-button {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
    color: var(--primary-dark);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font: inherit;
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover,
.link-button:focus {
    transform: none;
    box-shadow: none;
    color: var(--primary);
    background: transparent;
}

.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(8, 18, 42, 0.42);
    pointer-events: none;
}

.tour-highlight {
    position: relative;
    z-index: 1510;
    outline: 3px solid var(--primary);
    outline-offset: 6px;
    border-radius: var(--radius);
}

.tour-popover {
    position: absolute;
    z-index: 1520;
    width: min(350px, calc(100vw - 32px));
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(8, 18, 42, 0.28);
}

.tour-popover-progress {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tour-popover h2 {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}

.tour-popover p {
    margin: 0;
    color: var(--muted);
}

.tour-popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tour-popover-actions button {
    margin: 0;
}

@media (max-width: 700px) {
    .tour-prompt {
        align-items: stretch;
        flex-direction: column;
    }

    .tour-prompt-actions {
        justify-content: stretch;
    }

    .tour-prompt-actions button,
    .tour-popover-actions button {
        flex: 1;
    }

    .tour-highlight {
        outline-offset: 4px;
    }
}

.mobile-room-disclosure > summary .summary-count {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 850;
}

.mobile-room-disclosure > summary {
    flex-wrap: wrap;
}

/* Maintenance page */

.maintenance-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 68vh;
    padding: 24px 0;
}

.maintenance-card {
    width: min(100%, 680px);
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--border);
    border-radius: 32px;
    text-align: center;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(232, 239, 255, 0.84)),
        #fff;
    box-shadow: var(--shadow);
}

.maintenance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    margin-bottom: 18px;
    border-radius: 24px;
    background: var(--primary-soft);
    font-size: 2.2rem;
}

.maintenance-lead {
    max-width: 560px;
    margin: 0 auto 16px;
    color: #263757;
    font-size: 1.1rem;
    font-weight: 700;
}

.maintenance-copy {
    max-width: 520px;
    margin: 0 auto 26px;
    color: var(--muted);
}

@media (max-width: 700px) {
    .maintenance-card {
        border-radius: 24px;
        padding: 28px 22px;
    }

    .maintenance-icon {
        width: 70px;
        height: 70px;
        border-radius: 20px;
        font-size: 2rem;
    }
}

.host-settings-bottom {
    margin-top: 0;
    margin-bottom: 22px;
}

.host-settings-bottom > summary {
    margin-bottom: 12px;
}

/* Room header layout with host settings at the bottom of the card */

.room-hero-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.room-hero-host-settings {
    display: block;
    width: 100%;
    margin-top: 28px;
}

.room-hero-host-settings > summary {
    display: block;
    width: fit-content;
}

@media (max-width: 700px) {
    .room-hero-main {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Compact decision room header */

.room-hero.card.tour-room-header {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

.room-hero.card.tour-room-header .room-hero-main {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 18px !important;
}

.room-hero.card.tour-room-header h1 {
    margin-bottom: 12px;
    font-size: clamp(3.2rem, 7vw, 5.6rem);
}

.room-hero.card.tour-room-header .metadata-row {
    margin-bottom: 0;
}

.room-hero.card.tour-room-header .room-help-link {
    margin-top: 92px;
    flex: 0 0 auto;
}

.room-hero.card.tour-room-header .room-hero-host-settings {
    width: 100% !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
}

.room-hero.card.tour-room-header .room-hero-host-settings > summary {
    display: list-item !important;
    width: fit-content !important;
    margin: 0 !important;
}

.room-hero.card.tour-room-header .host-settings-card {
    margin-top: 14px;
}

@media (max-width: 700px) {
    .room-hero.card.tour-room-header {
        gap: 16px !important;
        padding-top: 22px !important;
        padding-bottom: 22px !important;
    }

    .room-hero.card.tour-room-header .room-hero-main {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .room-hero.card.tour-room-header .room-help-link {
        margin-top: 4px;
    }

    .room-hero.card.tour-room-header h1 {
        font-size: clamp(3rem, 18vw, 4.8rem);
    }
}

.quick-decision-slot-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
    gap: 1.5rem;
    align-items: center;
}

.quick-slot-machine {
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1rem;
    background:
        linear-gradient(180deg, #ffffff, var(--surface-soft));
    box-shadow: var(--shadow);
}

.quick-slot-window {
    position: relative;
    overflow: hidden;
    min-height: 96px;
    border: 2px solid rgba(21, 92, 255, 0.22);
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #ffffff;
}

.quick-slot-window::before,
.quick-slot-window::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    height: 28px;
    pointer-events: none;
}

.quick-slot-window::before {
    top: 0;
    background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0));
}

.quick-slot-window::after {
    bottom: 0;
    background: linear-gradient(0deg, #ffffff, rgba(255, 255, 255, 0));
}

.quick-slot-reel {
    position: relative;
    z-index: 1;
    padding: 1rem;
    color: var(--ink);
    font-size: clamp(1.35rem, 4vw, 2.4rem);
    font-weight: 950;
    line-height: 1.05;
    text-align: center;
    overflow-wrap: anywhere;
}

.quick-slot-reel.is-spinning {
    filter: blur(1px);
    transform: translateY(-2px);
}

@media (max-width: 700px) {
    .quick-decision-slot-layout {
        grid-template-columns: 1fr;
    }

    .quick-slot-window {
        min-height: 120px;
    }
}