:root {
    --vmr-bg: #08111f;
    --vmr-panel: #111c2d;
    --vmr-panel-alt: #0d1727;
    --vmr-line: #203148;
    --vmr-text: #ecf3ff;
    --vmr-muted: #8ca2c0;
    --vmr-accent: #17c3b2;
    --vmr-danger: #ef4444;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "Aptos", sans-serif;
    background: radial-gradient(circle at top left, rgba(23, 195, 178, 0.12), transparent 24%), #08111f;
    color: var(--vmr-text);
}

body {
    overflow: hidden;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

#blazor-error-ui {
    background: #fff4d6;
    bottom: 0;
    color: #111827;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    right: 0;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.landing-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.landing-panel {
    max-width: 720px;
    margin: 7vh auto 0;
    padding: 32px;
    display: grid;
    gap: 28px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #d7e0ec;
    border-radius: 24px;
    color: #152235;
}

.landing-kicker,
.meeting-stage__eyebrow {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--vmr-accent);
}

.landing-copy h1 {
    margin: 10px 0 8px;
    font-size: clamp(2rem, 3vw, 3.3rem);
    line-height: 1;
    display: block;
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
    appearance: none;
}

.landing-copy p {
    margin: 0;
    color: #60748a;
    line-height: 1.6;
}

.landing-form,
.meeting-join-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
}

.field-stack {
    flex: 1 1 260px;
    display: grid;
    gap: 10px;
}

.field-stack label {
    font-size: 0.9rem;
    font-weight: 600;
}

.room-input {
    width: 100%;
    border: 1px solid #314155;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    padding: 0.95rem 1rem;
}

.room-input:focus {
    outline: 2px solid rgba(23, 195, 178, 0.28);
    border-color: var(--vmr-accent);
}

.primary-action {
    padding: 0.9rem 1.1rem;
    border: 0;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.18s ease, opacity 0.18s ease;
    background: linear-gradient(135deg, var(--vmr-accent) 0%, #2563eb 100%);
    color: white;
}

.primary-action:disabled {
    opacity: 0.7;
}

.landing-hint {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    color: #60748a;
}

.landing-hint a {
    font-weight: 700;
    color: #0f766e;
}

.meeting-room-screen {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: #08111f;
}

.meeting-rail {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    padding: 12px 10px;
    background: #09111d;
    border-right: 1px solid var(--vmr-line);
}

.meeting-rail__brand {
    display: grid;
    place-items: center;
}

.meeting-rail__brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(23, 195, 178, 0.9), rgba(37, 99, 235, 0.95));
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.meeting-rail__controls,
.meeting-rail__nav {
    display: grid;
    gap: 10px;
    align-content: start;
}

.meeting-rail__button {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid var(--vmr-line);
    background: #101a2a;
    color: var(--vmr-text);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.meeting-rail__button svg {
    width: 20px;
    height: 20px;
}

.meeting-rail__button:hover:not(:disabled) {
    background: #16263d;
}

.meeting-rail__button:disabled {
    opacity: 0.65;
}

.meeting-rail__button--active {
    border-color: rgba(23, 195, 178, 0.55);
    background: rgba(23, 195, 178, 0.12);
    color: #d1fae5;
}

.meeting-rail__button--off {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(61, 17, 21, 0.92);
    color: #fecaca;
}

.meeting-rail__button--danger {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(91, 15, 19, 0.96);
    color: #fecaca;
}

.meeting-rail__button--nav {
    background: #0d1727;
    color: var(--vmr-muted);
}

.meeting-stage {
    position: relative;
    overflow: hidden;
    padding: 0;
    display: grid;
    grid-template-rows: auto auto 1fr;
}

.meeting-stage__topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--vmr-line);
    background: rgba(10, 20, 35, 0.94);
}

.meeting-stage__room {
    display: grid;
    gap: 4px;
}

.meeting-stage__room strong {
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.meeting-stage__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--vmr-muted);
    font-size: 0.88rem;
}

.meeting-banner {
    padding: 12px 18px;
    border-bottom: 1px solid var(--vmr-line);
    background: rgba(17, 28, 45, 0.92);
    color: var(--vmr-text);
}

.meeting-banner--error {
    background: rgba(69, 10, 10, 0.92);
    color: #fecaca;
}

.meeting-join-shell,
.meeting-empty-wall {
    display: grid;
    place-items: center;
    min-height: 100%;
    padding: 32px;
}

.meeting-join-shell__content,
.meeting-empty-wall {
    width: min(720px, 100%);
    padding: 32px;
    background: rgba(13, 23, 39, 0.96);
    border: 1px solid var(--vmr-line);
}

.meeting-join-shell__content h1,
.meeting-empty-wall strong {
    margin: 10px 0;
    font-size: clamp(2.1rem, 4vw, 3.5rem);
}

.meeting-join-shell__content h1 {
    display: block;
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
    appearance: none;
}

.meeting-join-shell__content p,
.meeting-empty-wall p {
    margin: 0;
    color: var(--vmr-muted);
    line-height: 1.6;
}

.meeting-empty-wall {
    text-align: center;
    align-content: center;
}

.video-wall {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: clamp(180px, 24vh, 320px);
    gap: 2px;
    padding: 2px;
    min-height: 0;
    height: 100%;
    background: #050b15;
    align-content: start;
    overflow-y: auto;
}

.video-wall__tile {
    position: relative;
    overflow: hidden;
    background: #0d1727;
    border: 1px solid rgba(255, 255, 255, 0.04);
    grid-column: span 4;
    min-height: 0;
    max-height: clamp(180px, 24vh, 320px);
}

.video-wall__tile--active {
    grid-column: span 8;
    grid-row: span 2;
    max-height: clamp(360px, 48vh, 640px);
}

.video-wall__tile video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #050b15;
}

.video-wall__tile--self video {
    transform: scaleX(-1);
}

.video-wall__meta {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    padding: 16px;
    color: white;
    background: linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.82));
}

.video-wall__meta strong {
    display: block;
    font-size: 1rem;
}

.video-wall__meta span {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.82rem;
}

.video-wall__meta-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 8px;
}

.video-wall__tag,
.video-wall__badge {
    padding: 0.4rem 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
}

.video-wall__tag {
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.video-wall__badge {
    background: rgba(23, 195, 178, 0.24);
    color: #d1fae5;
}

@media (max-width: 1100px) {
    .video-wall__tile {
        grid-column: span 6;
    }

    .video-wall__tile--active {
        grid-column: span 12;
    }
}

@media (max-width: 920px) {
    body {
        overflow: auto;
    }

    .meeting-room-screen {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .meeting-rail {
        grid-template-rows: auto;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        padding: 10px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--vmr-line);
    }

    .meeting-rail__controls,
    .meeting-rail__nav {
        display: flex;
        gap: 10px;
    }

    .meeting-rail__button {
        width: 52px;
        aspect-ratio: 1;
    }
}

@media (max-width: 720px) {
    .meeting-stage__topbar {
        flex-direction: column;
        align-items: start;
    }

    .meeting-stage__stats {
        gap: 10px;
        flex-direction: column;
    }

    .meeting-stage {
        min-height: calc(100vh - 88px);
        min-height: calc(100dvh - 88px);
    }

    .video-wall__tile,
    .video-wall__tile--active {
        grid-column: span 12;
        grid-row: span 1;
        max-height: clamp(180px, 32vh, 280px);
    }
}
