@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --ink: #11110f;
    --panel: #1b1b18;
    --line: rgba(255,255,255,0.13);
    --muted: rgba(255,255,255,0.54);
    --coral: #e65b47;
    --lime: #d8ff62;
    --heading: 'Manrope', sans-serif;
    --body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html { max-width:100%; overflow-x:hidden; overscroll-behavior-x:none; -webkit-text-size-adjust:100%; }
body { width:100%; max-width:100%; margin:0; overflow-x:hidden; background:#080807; color:white; font-family:var(--body); }
@supports (overflow:clip) { html,body { overflow-x:clip; } }
img,video,svg,iframe { max-width:100%; }
input,select,textarea,button { touch-action:manipulation; }
@media (max-width:780px) { input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),select,textarea{font-size:16px!important} }
button { font: inherit; }
[hidden] { display: none !important; }

.live-header {
    height: 72px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--line);
    background: var(--ink);
}

.live-brand { display: inline-flex; }
.live-brand img { width: 155px; height: auto; }
.room-status { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.7rem; }
.room-status i { width: 8px; height: 8px; border-radius: 50%; background: #e59d43; }
.session-live .room-status i { background: #ff6653; box-shadow: 0 0 0 6px rgba(255,102,83,0.12); }
.live-header-meta { justify-self: end; display: flex; align-items: center; gap: 1rem; }
.live-header-meta span { color: var(--lime); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.15em; }
.live-header-meta a { color: white; font-size: 0.75rem; }

.live-shell {
    height: calc(100svh - 72px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
}

.video-stage { position: relative; min-width: 0; min-height: 0; background: #050504; overflow: hidden; }

.preflight {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
    overflow: auto;
}

.preflight-camera { position: relative; min-height: 580px; background: #252522; overflow: hidden; }
.preflight-camera video { width: 100%; height: 100%; display: block; object-fit: cover; transform: scaleX(-1); }
.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background:
        linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.72)),
        url('fitness-models.png') center/cover;
}
.camera-placeholder span { width: 70px; height: 70px; display: grid; place-items: center; margin-bottom: 1rem; border: 1px solid rgba(255,255,255,0.45); border-radius: 50%; font-size: 2rem; }
.camera-placeholder strong { font-family: var(--heading); font-size: 1.3rem; }
.camera-placeholder small { max-width: 340px; margin-top: 0.5rem; color: var(--muted); }
.camera-ready-label { position: absolute; top: 1rem; left: 1rem; padding: 0.55rem 0.75rem; border-radius: 999px; background: rgba(17,17,15,0.72); color: var(--lime); font-size: 0.7rem; font-weight: 800; }

.preflight-copy { align-self: center; padding: clamp(1.6rem, 3.5vw, 3.5rem); }
.preflight-copy > p:first-child { margin: 0 0 1rem; color: var(--lime); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.16em; }
.preflight-copy h1 { margin: 0; font-family: var(--heading); font-size: clamp(2.5rem, 4.1vw, 4.5rem); line-height: 0.92; letter-spacing: -0.06em; }

.session-with { display: flex; align-items: center; gap: 0.9rem; margin: 1.35rem 0; }
.preflight-avatar { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background-color: #3a3935; background-size: 180%; font-weight: 800; }
.session-with small,
.session-with strong { display: block; }
.session-with small { color: var(--muted); font-size: 0.6rem; letter-spacing: 0.12em; }

.setup-list { list-style: none; padding: 0; margin: 0 0 1.35rem; border-top: 1px solid var(--line); }
.setup-list li { display: grid; grid-template-columns: 36px 1fr; gap: 0.7rem; padding: 0.68rem 0; border-bottom: 1px solid var(--line); }
.setup-list li > span { color: var(--coral); font-size: 0.66rem; }
.setup-list strong,
.setup-list small { display: block; }
.setup-list strong { font-size: 0.83rem; }
.setup-list small { color: var(--muted); font-size: 0.7rem; }

.preflight-actions { display: flex; gap: 0.8rem; }
.primary-live-button,
.secondary-live-button { min-height: 50px; border-radius: 10px; padding: 0.75rem 1rem; font-weight: 800; cursor: pointer; }
.primary-live-button { flex: 1; display: flex; justify-content: space-between; border: 0; background: var(--lime); color: var(--ink); }
.secondary-live-button { border: 1px solid var(--line); background: transparent; color: white; }
.primary-live-button:disabled { opacity: 0.5; cursor: wait; }
.permission-note { color: var(--muted); font-size: 0.65rem; }

.meeting-frame { width: 100%; height: 100%; }
.meeting-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.meeting-error { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; padding: 2rem; }
.meeting-error strong { font-family: var(--heading); font-size: 2rem; }
.meeting-error p { color: var(--muted); }
.meeting-error a { color: var(--lime); }

.workout-rail { min-height: 0; overflow: auto; padding: 1.5rem; background: var(--panel); border-left: 1px solid var(--line); }
.rail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.rail-heading p { margin: 0 0 0.35rem; color: var(--coral); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.14em; }
.rail-heading h2 { margin: 0; font-family: var(--heading); font-size: 1.3rem; letter-spacing: -0.04em; }
.rail-heading > span { color: var(--muted); font-size: 0.62rem; }

.workout-clock { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.2rem 1rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.workout-clock small { grid-column: 1 / -1; color: var(--muted); font-size: 0.6rem; letter-spacing: 0.13em; }
.workout-clock strong { font-family: var(--heading); font-size: 2.1rem; letter-spacing: -0.05em; }
.workout-clock button { border: 1px solid var(--line); border-radius: 8px; background: transparent; color: white; padding: 0.55rem 0.7rem; cursor: pointer; }

.movement { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 0.7rem; min-height: 70px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: white; text-align: left; cursor: pointer; }
.movement > span { color: var(--muted); font-size: 0.65rem; }
.movement strong,
.movement small { display: block; }
.movement strong { font-size: 0.82rem; }
.movement small { color: var(--muted); font-size: 0.68rem; }
.movement i { color: var(--muted); font-style: normal; font-size: 0.65rem; }
.movement.active { margin: 0.6rem 0; padding: 0 0.8rem; border: 0; border-radius: 10px; background: var(--lime); color: var(--ink); }
.movement.active > span,
.movement.active small { color: rgba(17,17,15,0.56); }
.movement.active i { color: var(--coral); font-weight: 800; }

.form-cue { margin-top: 1.5rem; padding: 1rem; border-left: 3px solid var(--coral); background: rgba(255,255,255,0.05); }
.form-cue small { color: var(--coral); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em; }
.form-cue p { margin: 0.45rem 0 0; color: rgba(255,255,255,0.73); font-size: 0.75rem; }

@media (max-width: 1080px) {
    .live-shell { grid-template-columns: minmax(0, 1fr) 310px; }
    .preflight { grid-template-columns: 1fr; }
    .preflight-camera { min-height: 48svh; }
}

@media (max-width: 760px) {
    .live-header { grid-template-columns: 1fr auto; padding: 0 1rem; }
    .live-brand img { width: 125px; }
    .room-status { display: none; }
    .live-header-meta span { display: none; }
    .live-shell { height: auto; min-height: calc(100svh - 72px); grid-template-columns: 1fr; }
    .video-stage { min-height: calc(100svh - 72px); }
    .preflight { min-height: calc(100svh - 72px); }
    .preflight-camera { min-height: 42svh; }
    .preflight-copy { padding: 2.5rem 1rem; }
    .preflight-copy h1 { font-size: 2.8rem; }
    .preflight-actions { flex-direction: column; }
    .workout-rail { min-height: 560px; border-left: 0; border-top: 1px solid var(--line); }
    .session-live .workout-rail { display: none; }
}
