/* Customize Room — v2 visual re-skin matching prejoin.
   Same v2 tokens as prejoin.css, with finer polish:
   - Subtle radial gradient on the page background for depth
   - Surface-1 panels use a top-light linear gradient (lift, not flat)
   - Form sections sit on surface-2 (embedded look) so the preview
     and side panels read as the focal elements
   - Gauge ring has an inner glow + animated dashed track
   - Health rows get colored status dots (ok / warn / bad)
   - Smooth micro-interactions on every interactive element
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    height: 100%;
}

/* ---- Cr-page aliases: same v2 token layer the rest of v2 uses ---- */
body.cr-page {
    --cr-bg: var(--v2-bg);
    --cr-panel: var(--v2-surface);
    --cr-card: var(--v2-surface-2);
    --cr-border: rgba(236, 236, 243, 0.06);
    --cr-border-strong: rgba(236, 236, 243, 0.14);
    --cr-text: var(--v2-text);
    --cr-muted: var(--v2-text-dim);
    --cr-dim: var(--v2-text-mute);
    --cr-accent: var(--v2-accent);
    --cr-accent-soft: #7c3aed;
    --cr-good: var(--v2-ok);
    --cr-live: var(--v2-live);
    --cr-warn: var(--v2-warn);
    --cr-radius: var(--v2-radius-lg);
    --cr-radius-sm: var(--v2-radius-md);
    --cr-gap: var(--v2-space-5);

    margin: 0;
    height: 100dvh;
    font-family: var(--v2-font-body);
    background-color: var(--cr-bg);
    /* Radial highlight + soft top wash so the page isn't a flat slab. */
    background-image:
        radial-gradient(
            1200px 600px at 20% -10%,
            rgba(91, 91, 247, 0.08) 0%,
            transparent 60%
        ),
        radial-gradient(
            900px 500px at 90% 10%,
            rgba(124, 92, 255, 0.05) 0%,
            transparent 55%
        );
    background-attachment: fixed;
    color: var(--cr-text);
    line-height: 1.5;
    letter-spacing: -0.005em;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ---- Header: hairline bottom, brand uses Manrope display (matches prejoin) ---- */
.pj-header {
    padding: 14px clamp(20px, 4vw, 40px);
    border-bottom: 1px solid rgba(236, 236, 243, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.pj-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--cr-text);
    text-decoration: none;
    font-family: var(--v2-font-display);
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: -0.015em;
    transition: opacity 0.2s ease;
}

.pj-brand:hover {
    opacity: 0.85;
}

/* ---- Layout shell: header (prejoin-style brand) + main grid ---- */
.cr-layout {
    padding: 18px clamp(20px, 4vw, 40px) 20px;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.cr-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr) minmax(0, 0.82fr);
    gap: var(--cr-gap);
    align-items: stretch;
}

.cr-col {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

/* ---- Focal panels (preview + side): surface lift with top-light gradient ---- */
.cr-block {
    position: relative;
    background:
        linear-gradient(180deg, rgba(236, 236, 243, 0.025) 0%, transparent 35%),
        var(--cr-panel);
    border: 1px solid var(--cr-border);
    border-radius: var(--cr-radius);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.02) inset,
        0 12px 32px rgba(0, 0, 0, 0.35);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cr-col-preview .cr-block {
    flex: 1;
    min-height: 0;
}

.cr-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.cr-block-label {
    margin: 0;
    font-family: var(--v2-font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--cr-text);
}

.cr-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--v2-font-display);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--cr-good);
    padding: 4px 10px;
    border-radius: var(--v2-radius-pill);
    background: color-mix(in srgb, var(--cr-good) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--cr-good) 28%, transparent);
}

.cr-active-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cr-good);
    box-shadow: 0 0 8px var(--cr-good);
    animation: cr-active-pulse 2s ease-in-out infinite;
}

@keyframes cr-active-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

.cr-kicker {
    display: block;
    font-family: var(--v2-font-display);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cr-dim);
    margin-bottom: 8px;
}

/* ---- Preview frame: surface-2 with hairline border + glow ring ---- */
.cr-video-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.cr-video-main {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: var(--cr-radius-sm);
    overflow: hidden;
    background:
        radial-gradient(ellipse at center, rgba(91, 91, 247, 0.06) 0%, transparent 70%),
        var(--cr-bg);
    border: 1px solid var(--cr-border);
    isolation: isolate;
}

.cr-video-main::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 96px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.cr-video-el {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.cr-video-el.mirror {
    transform: scaleX(-1);
}

.cr-video-placeholder {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 11, 20, 0.2) 0%, rgba(10, 11, 20, 0.75) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 240'%3E%3Ccircle cx='100' cy='72' r='36' fill='%23334155'/%3E%3Cellipse cx='100' cy='200' rx='56' ry='48' fill='%23334155'/%3E%3C/svg%3E")
            center 42% / 38% no-repeat;
}

.cr-host-tag {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 12px;
    border-radius: var(--v2-radius-pill);
    background: rgba(8, 11, 20, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(236, 236, 243, 0.12);
    color: var(--cr-text);
    font-family: var(--v2-font-display);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cr-host-tag i {
    font-size: 0.6875rem;
    color: var(--cr-muted);
}

.cr-video-row {
    display: none;
}

.cr-video-mini {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    background: #0c1220;
    border: 1px solid var(--cr-border);
    display: flex;
    align-items: flex-end;
    padding: 8px;
}

.cr-mini-avatar {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, #1a2236 0%, #0f1524 100%);
}

.cr-video-mini em {
    position: relative;
    z-index: 1;
    font-style: normal;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #e2e8f0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ---- Media toolbar (v2 round controls with refined hover) ---- */
.cr-media-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 0;
    flex-shrink: 0;
}

.cr-media-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--cr-border-strong);
    background: rgba(15, 23, 42, 0.6);
    color: var(--cr-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.cr-media-btn:hover {
    border-color: rgba(236, 236, 243, 0.22);
    color: var(--cr-text);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.cr-media-btn.is-on {
    background: color-mix(in srgb, var(--cr-accent) 22%, transparent);
    border-color: var(--cr-accent);
    color: var(--cr-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cr-accent) 12%, transparent);
}

.cr-media-btn.is-on:hover {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cr-accent) 18%, transparent);
}

.cr-media-btn.is-alert {
    background: var(--cr-live);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cr-live) 18%, transparent);
}

.cr-media-btn:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* ---- Background picker (mirrors prejoin's pj-background-* but with cr- namespace) ---- */
.cr-background-section {
    margin-top: 14px;
    flex-shrink: 0;
}

.cr-background-section[hidden] {
    display: none !important;
}

.cr-background-label {
    margin: 0 0 10px;
    color: var(--cr-text);
    font-family: var(--v2-font-display);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: -0.01em;
}

.cr-background-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
    max-width: 100%;
}

.cr-background-option {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--cr-radius-sm);
    background: var(--cr-card);
    cursor: pointer;
    overflow: hidden;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.cr-background-option:hover {
    border-color: rgba(236, 236, 243, 0.18);
}

.cr-background-option.is-selected {
    border-color: var(--cr-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cr-accent) 25%, transparent);
}

.cr-background-option img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cr-background-option.is-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    background: var(--cr-card);
    color: var(--cr-muted);
}

.cr-background-option.is-checkerboard {
    background-color: #1a2233;
    background-image:
        linear-gradient(45deg, #2a3344 25%, transparent 25%),
        linear-gradient(-45deg, #2a3344 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a3344 75%),
        linear-gradient(-45deg, transparent 75%, #2a3344 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}

.cr-background-icon {
    font-size: 0.875rem;
    color: var(--cr-muted);
    line-height: 1;
    pointer-events: none;
}

.cr-background-action-label {
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cr-dim);
    font-family: var(--v2-font-display);
    line-height: 1;
    pointer-events: none;
}

.cr-background-option.is-action:hover .cr-background-icon,
.cr-background-option.is-action.is-selected .cr-background-icon,
.cr-background-option.is-action:hover .cr-background-action-label,
.cr-background-option.is-action.is-selected .cr-background-action-label {
    color: var(--cr-accent);
}

.cr-background-custom {
    position: relative;
}

.cr-background-custom .cr-background-option {
    display: block;
}

.cr-background-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    line-height: 1;
    opacity: 0;
    transition:
        opacity 0.2s ease,
        background-color 0.2s ease;
}

.cr-background-custom:hover .cr-background-delete {
    opacity: 1;
}

.cr-background-delete:hover {
    background: var(--cr-live);
}

.cr-background-unsupported {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--cr-dim);
}

.cr-background-error {
    margin: 10px 0 0;
    font-size: 0.8125rem;
    color: var(--cr-live);
}

/* ---- Center column: embedded form sections (surface-2, lighter shadow) ---- */
.cr-col-main {
    padding-top: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.cr-hero {
    margin: 0 4px 6px;
    flex-shrink: 0;
}

.cr-hero-title {
    margin: 0;
    font-family: var(--v2-font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--cr-text);
    line-height: 1.2;
}

.cr-hero-sub {
    margin: 3px 0 0;
    font-size: 0.75rem;
    color: var(--cr-muted);
}

/* Embedded card: sits inside the column with a quieter lift than focal panels. */
.cr-section {
    background:
        linear-gradient(180deg, rgba(236, 236, 243, 0.018) 0%, transparent 30%),
        var(--cr-card);
    border: 1px solid var(--cr-border);
    border-radius: var(--cr-radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    padding: 10px 14px 12px;
    /* No shrink — keep the section at its natural height so content
       doesn't overflow into the next section. */
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cr-section-title {
    margin: 0;
    font-family: var(--v2-font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cr-text);
    letter-spacing: -0.005em;
}

.cr-section-title i {
    color: var(--cr-accent);
    font-size: 0.8125rem;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--cr-accent) 14%, transparent);
}

/* When a section lives in the side column, promote it to a focal panel
   (surface-1 lift, stronger shadow) so it matches Readiness + Health. */
.cr-collab-section {
    background:
        linear-gradient(180deg, rgba(236, 236, 243, 0.025) 0%, transparent 35%),
        var(--cr-panel);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.02) inset,
        0 12px 32px rgba(0, 0, 0, 0.35);
}

.cr-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cr-duration-custom {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
}

.cr-duration-custom[hidden] {
    display: none;
}

.cr-field-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cr-field-duo .cr-field {
    margin-bottom: 0;
}

.cr-field-label {
    font-family: var(--v2-font-display);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cr-dim);
}

.cr-field-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--cr-radius-sm);
    border: 1px solid var(--cr-border);
    background: var(--cr-bg);
    color: var(--cr-text);
    font-size: 0.8125rem;
    font-family: var(--v2-font-body);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.cr-field-input::placeholder {
    color: var(--cr-dim);
}

.cr-field-input:hover:not(:focus) {
    border-color: var(--cr-border-strong);
}

.cr-field-input-light {
    background: color-mix(in srgb, var(--cr-text) 4%, transparent);
    border-color: var(--cr-border-strong);
}

.cr-field-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%239b9db0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3.5 5.5l3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 46px;
    text-overflow: ellipsis;
}

.cr-select-wrap {
    position: relative;
}

.cr-field-input:focus {
    outline: none;
    border-color: var(--cr-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cr-accent) 22%, transparent);
    background-color: color-mix(in srgb, var(--cr-accent) 4%, transparent);
}

.cr-field-select option {
    background-color: var(--cr-panel);
    color: var(--cr-text);
}

/* ---- Access toggles (refined surface-2 rows, animated switch) ---- */
.cr-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 12px;
    border-radius: var(--cr-radius-sm);
    border: 1px solid var(--cr-border);
    background: rgba(28, 31, 42, 0.5);
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.15s ease;
}

.cr-setting-row + .cr-setting-row {
    margin-top: 5px;
}

.cr-setting-row:hover {
    border-color: var(--cr-border-strong);
    background: color-mix(in srgb, var(--cr-card) 80%, var(--cr-text) 6%);
}

.cr-setting-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cr-setting-copy strong {
    display: block;
    font-family: var(--v2-font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cr-text);
    letter-spacing: -0.005em;
}

.cr-setting-copy span {
    font-size: 0.75rem;
    color: var(--cr-dim);
}

.cr-switch {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.cr-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cr-switch-track {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--cr-dim) 70%, transparent);
    border-radius: var(--v2-radius-pill);
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

.cr-switch-track::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.cr-switch input:checked + .cr-switch-track {
    background: var(--cr-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cr-accent) 18%, transparent);
}

.cr-switch input:checked + .cr-switch-track::before {
    transform: translateX(18px);
}

.cr-switch input:disabled + .cr-switch-track {
    opacity: 0.85;
    cursor: not-allowed;
}

/* ---- Link / copy row ---- */
.cr-link-field {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 4px;
}

.cr-link-input {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    color: var(--cr-muted);
    font-family: var(--v2-font-mono, 'JetBrains Mono', ui-monospace, monospace);
}

.cr-link-copy {
    width: 42px;
    flex-shrink: 0;
    border-radius: var(--cr-radius-sm);
    border: 1px solid var(--cr-border);
    background: rgba(28, 31, 42, 0.5);
    color: var(--cr-muted);
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.15s ease;
}

.cr-link-copy:hover {
    color: var(--cr-text);
    border-color: var(--cr-accent);
    background-color: color-mix(in srgb, var(--cr-accent) 10%, transparent);
}

.cr-link-copy:active {
    transform: scale(0.96);
}

/* ---- Collaboration tiles (refined hover + lift) ---- */
.cr-collab-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.cr-collab-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: var(--cr-radius-sm);
    border: 1px solid var(--cr-border);
    background: rgba(28, 31, 42, 0.5);
    cursor: pointer;
    min-height: 0;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.cr-collab-btn:hover {
    border-color: var(--cr-border-strong);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.cr-collab-btn.is-checked {
    border-color: color-mix(in srgb, var(--cr-accent) 55%, transparent);
    background: color-mix(in srgb, var(--cr-accent) 10%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--cr-accent) 25%, transparent) inset;
}

.cr-collab-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cr-collab-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--cr-accent) 14%, transparent);
    color: var(--cr-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cr-collab-btn.is-checked .cr-collab-btn-icon {
    background: color-mix(in srgb, var(--cr-accent) 28%, transparent);
    color: #fff;
}

.cr-collab-btn-text {
    flex: 1;
    font-family: var(--v2-font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cr-text);
    letter-spacing: -0.005em;
}

.cr-collab-btn-mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--cr-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: transparent;
    flex-shrink: 0;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.cr-collab-btn:hover .cr-collab-btn-mark {
    transform: scale(1.05);
}

.cr-collab-btn.is-checked .cr-collab-btn-mark {
    background: var(--cr-accent);
    border-color: var(--cr-accent);
    color: #fff;
}

/* ---- Primary CTA (refined gradient + arrow nudge on hover) ---- */
.cr-launch-btn {
    width: 100%;
    height: 42px;
    margin-top: auto;
    border: none;
    border-radius: var(--cr-radius-sm);
    background: linear-gradient(135deg, var(--cr-accent) 0%, var(--cr-accent-soft) 100%);
    color: #fff;
    font-family: var(--v2-font-display);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--cr-accent) 60%, transparent) inset,
        0 8px 20px color-mix(in srgb, var(--cr-accent) 32%, transparent);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    flex-shrink: 0;
}

.cr-launch-btn::after {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.cr-launch-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--cr-accent) 80%, transparent) inset,
        0 14px 32px color-mix(in srgb, var(--cr-accent) 45%, transparent);
    filter: brightness(1.05);
}

.cr-launch-btn:hover::after {
    transform: translateX(3px);
}

.cr-launch-btn:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

.cr-message {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--cr-muted);
    flex-shrink: 0;
}

.cr-message:empty,
.cr-message[hidden] {
    display: none;
    margin: 0;
}

.cr-message-error {
    padding: 10px 14px;
    border-radius: var(--cr-radius-sm);
    background: color-mix(in srgb, var(--cr-live) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--cr-live) 28%, transparent);
    color: var(--cr-live);
}

/* ---- Right column: readiness + system health (focal panels) ---- */
.cr-col-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    justify-content: flex-start;
}

.cr-readiness-block {
    text-align: center;
    padding-bottom: 4px;
    flex-shrink: 0;
}

.cr-gauge-wrap {
    display: flex;
    justify-content: center;
    margin: 4px 0 10px;
}

.cr-gauge {
    --cr-pct: 90;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background:
        conic-gradient(
            var(--cr-accent) 0 calc(var(--cr-pct) * 1%),
            rgba(98, 100, 122, 0.18) calc(var(--cr-pct) * 1%) 100%
        );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--cr-accent) 35%, transparent));
    transition: filter 0.3s ease;
}

.cr-gauge::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--cr-panel);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.cr-gauge-core {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.cr-gauge-pct {
    font-family: var(--v2-font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cr-text);
    letter-spacing: -0.02em;
}

.cr-gauge-status {
    margin-top: 5px;
    font-family: var(--v2-font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--cr-good);
}

.cr-readiness-desc {
    margin: 0;
    font-size: 0.75rem;
    color: var(--cr-muted);
    line-height: 1.5;
    padding: 0 6px;
}

/* ---- Health rows: with status dots, refined hover ---- */
.cr-health-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
}

.cr-health-rows li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 11px;
    border-radius: var(--cr-radius-sm);
    border: 1px solid var(--cr-border);
    background: rgba(28, 31, 42, 0.5);
    font-size: 0.75rem;
    color: var(--cr-muted);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cr-health-rows li:hover {
    border-color: var(--cr-border-strong);
    background: color-mix(in srgb, var(--cr-card) 70%, var(--cr-text) 5%);
}

.cr-health-rows li > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Status dots — set by JS via txt-* classes on the <strong> sibling */
.txt-green,
.txt-blue,
.txt-red,
.txt-muted {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.txt-green::before,
.txt-blue::before,
.txt-red::before,
.txt-muted::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.txt-green {
    color: var(--cr-good);
}
.txt-green::before { background: var(--cr-good); }

.txt-blue {
    color: var(--cr-accent);
}
.txt-blue::before { background: var(--cr-accent); }

.txt-red {
    color: var(--cr-live);
}
.txt-red::before { background: var(--cr-live); }

.txt-muted {
    color: var(--cr-muted);
}
.txt-muted::before {
    background: var(--cr-dim);
    box-shadow: none;
    animation: cr-status-pulse 1.6s ease-in-out infinite;
}

@keyframes cr-status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.cr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}

.cr-qr-block {
    display: none;
}

/* ---- Responsive: allow scrolling when viewport can't fit 3 columns ---- */
@media (max-width: 1100px) {
    html,
    body.cr-page {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .cr-layout {
        height: auto;
    }

    .cr-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cr-col {
        overflow: visible;
    }

    .cr-col-preview {
        grid-column: 1 / -1;
    }

    .cr-col-preview .cr-block {
        min-height: 280px;
    }

    .cr-video-main {
        min-height: 220px;
    }

    .cr-col-side {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--cr-gap);
        justify-content: start;
    }

    .cr-launch-btn {
        margin-top: 8px;
    }
}

@media (max-width: 720px) {
    html,
    body.cr-page {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .cr-grid,
    .cr-col-side {
        grid-template-columns: 1fr;
    }

    .cr-field-duo,
    .cr-collab-row {
        grid-template-columns: 1fr;
    }
}
