/* Values copied from the dashboard's theme tokens (projects/dashboard/src/index.css and src/ui/tokens.css), not imported. */

@font-face {
    font-family: "main-font";
    src: url("/fonts/ClashGrotesk-Variable.woff2") format("woff2");
    font-weight: 200 700;
    font-display: swap;
}

:root {
    color-scheme: light dark;
    --base-100: oklch(100% 0 0);
    --base-content: oklch(0.1 0 0);
    --primary: oklch(0.702 0.191 41.6);
    --primary-content: oklch(1 0 0);
    --success: oklch(0.6 0.19 142);
    --error: oklch(0.63 0.26 25);
    --muted: oklch(0.42 0 0);
    --surface: var(--base-100);
    --canvas: color-mix(in oklab, var(--base-content) 6%, var(--base-100));
    --well: oklch(from var(--base-content) l c h / 0.035);
    --fill: oklch(from var(--base-content) l c h / 0.06);
    --hover: oklch(from var(--base-content) l c h / 0.04);
    --edge: oklch(from var(--base-content) l c h / 0.07);
    --strong-edge: oklch(from var(--base-content) l c h / 0.14);
    --dim: oklch(0.1 0 0 / 0.38);
    --shadow-md: 0 2px 4px oklch(0 0 0 / 0.04), 0 6px 20px oklch(0 0 0 / 0.06);
    --shadow-lg: 0 4px 8px oklch(0 0 0 / 0.04), 0 12px 40px oklch(0 0 0 / 0.08);
    --radius-control: 8px;
    --radius-container: 10px;
    --radius-dialog: 12px;
    --font-ui:
        "main-font", -apple-system, BlinkMacSystemFont, "avenir next", avenir, "segoe ui", "helvetica neue", helvetica, Ubuntu, roboto, noto, arial, sans-serif;
    --font-answer:
        ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --base-100: oklch(0.14 0.012 260);
        --base-content: oklch(0.96 0.008 250);
        --success: oklch(0.72 0.22 142);
        --muted: oklch(0.72 0.02 250);
        --canvas: color-mix(in oklab, var(--base-content) 3%, var(--base-100));
        --strong-edge: oklch(from var(--base-content) l c h / 0.18);
        --dim: oklch(0 0 0 / 0.55);
        --shadow-md: 0 1px 3px oklch(0 0 0 / 0.4), 0 1px 2px oklch(0 0 0 / 0.2);
        --shadow-lg: 0 8px 30px oklch(0 0 0 / 0.5);
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--canvas);
    color: var(--base-content);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    line-height: 1.25rem;
    -webkit-font-smoothing: antialiased;
}

#app {
    height: 100%;
}

h1,
h2,
p {
    margin: 0;
}

button,
input,
a.button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.tabs[hidden] {
    display: none;
}

.muted {
    color: var(--muted);
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.row.center {
    justify-content: center;
}

/* ── Buttons ── */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--strong-edge);
    border-radius: var(--radius-control);
    background: var(--surface);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.button:hover:not(:disabled) {
    background: var(--hover);
}

.button.primary {
    border-color: transparent;
    background: var(--primary);
    color: var(--primary-content);
}

.button.primary:hover:not(:disabled) {
    background: oklch(from var(--primary) calc(l - 0.05) c h);
}

.button:disabled {
    cursor: default;
    opacity: 0.55;
}

.button.small {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.8125rem;
}

.button.wide {
    width: 100%;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover:not(:disabled) {
    background: var(--hover);
    color: var(--base-content);
}

.icon-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--base-content);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--strong-edge);
    cursor: pointer;
}

.link.quiet {
    color: var(--muted);
    font-weight: 400;
    align-self: flex-start;
}

/* ── Join ── */

.join {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 24px;
}

.join-card {
    display: grid;
    gap: 10px;
    width: min(360px, 100%);
    padding: 32px;
    border-radius: var(--radius-dialog);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.join-title {
    margin-bottom: 14px;
    font-size: 1.75rem;
    line-height: 2.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.field-label {
    color: var(--muted);
    font-size: 0.8125rem;
}

.code-input {
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--strong-edge);
    border-radius: var(--radius-control);
    background: var(--surface);
    font-size: 1.25rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.code-input:focus-visible {
    outline-offset: 0;
}

.join-card .button {
    min-height: 44px;
}

.join-message {
    min-height: 1.25rem;
    color: var(--muted);
}

.join-message.error,
.error-text {
    color: var(--error);
}

/* ── Session layout ── */

.shell {
    position: relative;
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    height: 100%;
}

.shell.collapsed {
    grid-template-columns: 44px minmax(0, 1fr);
}

.rail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--canvas);
    border-right: 1px solid var(--edge);
}

.collapsed .rail {
    align-items: center;
    padding-top: 10px;
}

.strip-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border: 0;
    border-radius: var(--radius-control);
    background: none;
    color: var(--muted);
    writing-mode: vertical-rl;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.strip-button:hover {
    background: var(--hover);
    color: var(--base-content);
}

.rail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 16px 12px 20px;
}

.session-title {
    font-size: 0.9375rem;
    line-height: 1.375rem;
    font-weight: 500;
}

.step-count {
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.125rem;
    font-variant-numeric: tabular-nums;
}

.rail-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 16px 8px 20px;
    padding: 10px 12px;
    border-radius: var(--radius-container);
    background: var(--fill);
    font-size: 0.8125rem;
    line-height: 1.125rem;
}

.sign-in {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-container);
    background: var(--surface);
}

.sign-in-title {
    font-weight: 500;
}

.sign-in-steps {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.125rem;
}

.sign-in-steps li + li {
    margin-top: 4px;
}

.sign-in .muted {
    font-size: 0.8125rem;
    line-height: 1.125rem;
}

/* ── Step ── */

.step {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 500;
}

.body-text,
.body-list {
    font-family: var(--font-answer);
    font-size: 0.9375rem;
    line-height: 1.5rem;
}

.body-list {
    margin: 0;
    padding-left: 1.25rem;
}

.body-list li + li {
    margin-top: 4px;
}

.step-image {
    width: 100%;
    border-radius: var(--radius-container);
    border: 1px solid var(--edge);
}

.action {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.prompt-label {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.prompt {
    max-height: 220px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: var(--radius-container);
    background: var(--well);
    border: 1px solid var(--edge);
    font-family: var(--font-answer);
    font-size: 0.875rem;
    line-height: 1.375rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: text;
}

.links {
    gap: 12px;
}

.links .muted {
    font-size: 0.8125rem;
}

.countdown {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.done-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    color: var(--success);
    font-weight: 500;
}

/* ── Footer ── */

.rail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--edge);
}

.follow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

/* ── Host ── */

.stats {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 3px;
    border: 0;
    border-radius: var(--radius-control);
    background: none;
    color: var(--base-content);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.toggle:hover {
    background: var(--hover);
}

.toggle-track {
    flex: none;
    position: relative;
    width: 22px;
    height: 12px;
    border-radius: 6px;
    background: var(--strong-edge);
    transition: background 0.15s;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: oklch(1 0 0);
    box-shadow: 0 1px 2px oklch(0 0 0 / 0.3);
    transition: transform 0.15s;
}

.toggle.on .toggle-track {
    background: var(--primary);
}

.toggle.on .toggle-thumb {
    transform: translateX(10px);
}

.toggle-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 2px;
}

.step-link {
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--radius-control);
    background: none;
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.125rem;
    cursor: pointer;
}

.step-link:hover {
    background: var(--hover);
}

.step-link.current {
    background: var(--fill);
    font-weight: 500;
}

/* ── Stage: tabs, frames, overlays ── */

.stage {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--surface);
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--edge);
    background: var(--canvas);
}

.tab {
    padding: 5px 12px;
    border: 0;
    border-radius: var(--radius-control);
    background: none;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.tab:hover {
    background: var(--hover);
    color: var(--base-content);
}

.tab[aria-selected="true"] {
    background: var(--surface);
    color: var(--base-content);
    box-shadow: var(--shadow-md);
}

.frames {
    position: relative;
    flex: 1;
    min-height: 0;
}

/* Hidden frames stay laid out and running; only visibility changes. */
.frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--surface);
}

.frame.behind {
    visibility: hidden;
    pointer-events: none;
}

.overlay-host {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.overlay-host > * {
    pointer-events: auto;
}

.stage-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.stage-slide-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 56px 64px;
}

.stage-slide-title {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.stage-slide-text {
    margin: 0;
    font-family: var(--font-answer);
    font-size: 1.75rem;
    line-height: 1.45;
    color: oklch(from var(--base-content) l c h / 0.82);
}

ul.stage-slide-text {
    padding-left: 1.6em;
}

ul.stage-slide-text li + li {
    margin-top: 10px;
}

.stage-slide-image {
    max-width: 100%;
    max-height: 40vh;
    align-self: flex-start;
    border-radius: var(--radius-dialog);
    border: 1px solid var(--edge);
}

.peek {
    position: absolute;
    right: 20px;
    bottom: 16px;
}

.listen {
    color: var(--muted);
    font-family: var(--font-answer);
    font-size: 0.9375rem;
    line-height: 1.5rem;
}

.room {
    display: grid;
    gap: 6px;
    font-size: 0.8125rem;
    line-height: 1.125rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.room-bar {
    appearance: none;
    width: 100%;
    height: 4px;
    border: 0;
    border-radius: 2px;
    background: var(--fill);
    overflow: hidden;
}

.room-bar::-webkit-progress-bar {
    background: var(--fill);
}

.room-bar::-webkit-progress-value {
    background: var(--success);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.room-bar::-moz-progress-bar {
    background: var(--success);
    border-radius: 2px;
}

.fade {
    animation: fade-in 150ms ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fade {
        animation: none;
    }
    .room-bar::-webkit-progress-value {
        transition: none;
    }
}

.recording {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px 20px;
    background: var(--canvas);
}

.recording-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recording-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.9375rem;
}

.tag {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--base-content);
    color: var(--base-100);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

.recording-media {
    flex: 1;
    min-height: 0;
    display: flex;
}

.slideshow {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slideshow-frame {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recording-image,
.recording-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-container);
    box-shadow: var(--shadow-lg);
    background: var(--surface);
}

.recording-video {
    width: 100%;
}

.recording-caption {
    color: var(--muted);
    text-align: center;
}

.slide-large-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    max-width: 760px;
    margin: 0 auto;
}

.slide-large-title {
    font-size: 1.75rem;
    line-height: 2.25rem;
    font-weight: 500;
}

.slide-large-body .body-text,
.slide-large-body .body-list {
    font-size: 1.25rem;
    line-height: 2rem;
}

/* ── Polish: top progress, host bar, tab status ── */

.top-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    appearance: none;
    width: 100%;
    height: 3px;
    border: 0;
    background: transparent;
}

.top-progress::-webkit-progress-bar {
    background: transparent;
}

.top-progress::-webkit-progress-value {
    background: var(--primary);
    transition: width 0.3s ease;
}

.top-progress::-moz-progress-bar {
    background: var(--primary);
}

.host-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 8px 16px 6px 20px;
    border-top: 1px solid var(--edge);
    background: var(--canvas);
}

.host-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.host-row.between {
    justify-content: space-between;
    min-height: 30px;
}

/* Small switches in one row; the first starts flush with the buttons above. They wrap rather than widen the rail. */
.host-row.switches {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0;
    margin: 0 -3px;
}

.host-row .button:first-child {
    flex: none;
}

.button.next {
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    gap: 8px;
}

.next-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    opacity: 0.85;
}

.countdown.small {
    font-size: 0.9375rem;
    line-height: 1.375rem;
    margin-left: auto;
}

.all-steps summary {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.all-steps[open] summary {
    margin-bottom: 6px;
}

.working-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--primary);
    vertical-align: 1px;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    50% {
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .working-dot,
    .top-progress::-webkit-progress-value {
        animation: none;
        transition: none;
    }
}

/* ── Workshop seat ── */

.seat {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    background: var(--surface);
    text-align: center;
}

.seat-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 500;
}

.seat-notice {
    max-width: 440px;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.125rem;
}

.workshop-note {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1rem;
}
