/*
 * RelayHalo — workspace stylesheet (/app, account and billing panes).
 *
 * Loaded after site.css on every page that loads the base stylesheet; the
 * marketing pages never download it. Tokens and shared components live in
 * site.css.
 */

/* ── Workspace shell ──────────────────────────────────────────────────── */
/* Stream-manager layout: a dark sidebar (dark in both themes, like Twitch
   and YouTube Studio), the content on the page background. */
.rh--app { background: var(--rh-bg); }
.rh-app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.rh-app__sidebar { display: none; }
.rh-app__topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rh-s2);
    min-height: 56px;
    padding-inline: var(--rh-gutter);
    border-bottom: 1px solid var(--rh-border);
    background: var(--rh-overlay);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.rh-app__topbar > .rh-brand { margin-right: auto; }
.rh-app__main { min-width: 0; padding: var(--rh-s5) var(--rh-gutter) var(--rh-s8); }
.rh-app__main:focus { outline: none; }
/* The sidebar keeps the dark palette whatever the theme. */
.rh-app__sidebar,
:root[data-theme-choice="light"] .rh-app__sidebar {
    --rh-surface: #111113;
    --rh-surface-2: #1b1b1f;
    --rh-surface-3: #26262b;
    --rh-border: #232327;
    --rh-border-strong: #34343a;
    --rh-text: #fafafa;
    --rh-text-2: #d4d4d8;
    --rh-muted: #a1a1aa;
    --rh-faint: #8c8c95;
    --rh-bg: #09090b;
    --rh-accent-text: #93abff;
    --rh-accent-soft: #161d38;
    --rh-accent-border: #34437f;
    --rh-focus: #7593ff;
    color-scheme: dark;
    color: var(--rh-text);
}
@media (min-width: 1024px) {
    .rh-app { grid-template-columns: 15rem minmax(0, 1fr); }
    .rh-app__topbar { display: none; }
    .rh-app__sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        gap: var(--rh-s5);
        height: 100vh;
        overflow-y: auto;
        padding: var(--rh-s4) var(--rh-s3);
        border-right: 1px solid var(--rh-border);
        background: var(--rh-surface);
        scrollbar-width: thin;
    }
    .rh-app__main { padding: var(--rh-s5) var(--rh-s6) var(--rh-s8); }
}
.rh-app__brandrow { display: flex; align-items: center; justify-content: space-between; gap: var(--rh-s2); padding: 0 0 0 var(--rh-s2); }
.rh-app__brandrow .rh-brand { font-size: var(--rh-fs-base); }
.rh-app__brandrow .rh-brand__mark { width: 1.5rem; height: 1.5rem; }
.rh-app__toptheme .rh-theme__btn { width: 34px; height: 34px; }
.rh-app__nav { display: grid; gap: 1px; }
.rh-app__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--rh-s3);
    width: 100%;
    min-height: 36px;
    padding: 0.4375rem var(--rh-s3);
    border: 0;
    border-radius: var(--rh-r-sm);
    background: transparent;
    color: var(--rh-muted);
    font: inherit;
    font-size: var(--rh-fs-md);
    font-weight: var(--rh-fw-medium);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.rh-app__link .rh-icon { width: 1.125rem; height: 1.125rem; }
.rh-app__link:hover { background: var(--rh-surface-2); color: var(--rh-text); text-decoration: none; }
.rh-app__link[aria-current="page"] { background: var(--rh-surface-3); color: var(--rh-text); }
.rh-app__link[aria-current="page"] .rh-icon { color: var(--rh-accent-text); }
.rh-app__sidebar .rh-app__link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: -0.75rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--rh-accent);
}
.rh-app__nav-meta {
    margin-left: auto;
    padding: 0 0.375rem;
    border-radius: var(--rh-r-xs);
    background: var(--rh-surface-3);
    color: var(--rh-text-2);
    font-family: var(--rh-mono);
    font-size: var(--rh-fs-xs);
    font-weight: var(--rh-fw-medium);
}
/* "Choose a plan": always in the navigation for accounts without a plan. */
.rh-planlink { margin-top: var(--rh-s3); border: 1px solid var(--rh-accent-border); background: var(--rh-accent-soft); color: var(--rh-text); }
.rh-planlink .rh-icon { color: var(--rh-accent-text); }
.rh-planlink:hover { border-color: var(--rh-accent); background: var(--rh-accent-soft); }
.rh-planlink__text { display: grid; line-height: 1.3; }
.rh-planlink__text > span { font-weight: var(--rh-fw-strong); }
.rh-planlink__text small { color: var(--rh-muted); font-size: var(--rh-fs-sm); font-weight: var(--rh-fw-regular); }
.rh-menu__link.rh-planlink { margin: 0 0 var(--rh-s2); }
.rh-app__topplan { margin-left: auto; }
@media (max-width: 379px) {
    .rh-app__topbar:has(.rh-app__topplan) .rh-brand > span {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
}
@media (max-width: 419px) {
    .rh-app__topplan ~ .rh-menu .rh-menu__toggle > span {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
}
.rh-app__aside-footer { display: grid; gap: 1px; margin-top: auto; padding-top: var(--rh-s3); border-top: 1px solid var(--rh-border); }
.rh-app__aside-footer form { margin: 0; }
.rh-app__user { overflow: hidden; margin: var(--rh-s2) var(--rh-s3) 0; color: var(--rh-faint); font-size: var(--rh-fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.rh-page { display: grid; gap: var(--rh-s5); width: 100%; max-width: 68rem; margin-inline: auto; }
.rh-page > * { min-width: 0; }
/* Live regions that render nothing must not add an empty grid gap. */
.rh-page > [data-live-region]:not(:has(*)) { display: none; }
.rh-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--rh-s4);
}
.rh-page-head h1 { font-size: clamp(1.5rem, 1.25rem + 0.9vw, 1.875rem); }
.rh-page-head .rh-lead { font-size: var(--rh-fs-base); }
.rh-page-head .rh-lead + .rh-hint { margin-top: var(--rh-s2); }
.rh-page-head__actions { display: flex; flex-wrap: wrap; gap: var(--rh-s2); }
.rh-page-head__actions form { margin: 0; }
/* Platform views shown inside the shell keep their own markup; their
   "back to account" link points at a page that now redirects to the studio,
   so the shell's own tabs replace it. */
.rh-page--base { max-width: 68rem; }
.rh-page--base > .settings-pane, .rh-page--base > section { max-width: 52rem; }
.rh-page--base > * { margin: 0; }
.rh-page--base .settings-pane-back { display: none; }
.rh-page--base .settings-pane { display: grid; gap: var(--rh-s4); margin: 0; padding: 0; max-width: none; }
.rh-page--base .settings-pane > * { margin: 0; }
.rh-page--base .settings-pane > h1 { font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem); line-height: 1.2; }
.rh-page--base .settings-pane-intro { margin-top: calc(-1 * var(--rh-s2)); color: var(--rh-muted); font-size: var(--rh-fs-base); }
.rh-page--base .settings-pane-card { margin: 0; padding: var(--rh-s5) var(--rh-s4); border: 1px solid var(--rh-border); border-radius: var(--rh-r-lg); background: var(--rh-surface); }
.rh-page--base .settings-pane-card > * + * { margin-top: var(--rh-s3); }
.rh-page--base .settings-pane-card h2 { font-size: var(--rh-fs-xl); line-height: 1.25; }
.rh-page--base .settings-pane-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--rh-s2) var(--rh-s4); margin: 0 0 var(--rh-s3); }
.rh-page--base .settings-pane-card-head p { color: var(--rh-muted); font-size: var(--rh-fs-md); }
.rh-page--base .settings-form-actions { display: flex; flex-wrap: wrap; gap: var(--rh-s2); margin-top: var(--rh-s4); }
.rh-page--base .settings-form { display: grid; gap: var(--rh-s4); margin: 0; }
.rh-page--base .form-field { display: grid; gap: 0.375rem; margin: 0; }
.rh-page--base .form-field-label { margin: 0; color: var(--rh-text); font-size: var(--rh-fs-sm); font-weight: 600; }
.rh-page--base .form-field-hint { margin: 0; color: var(--rh-muted); font-size: var(--rh-fs-sm); font-weight: 400; }
.rh-page--base .billing-summary { display: grid; grid-template-columns: minmax(7rem, 12rem) 1fr; gap: var(--rh-s2) var(--rh-s4); margin: 0; }
.rh-page--base .billing-summary dt { color: var(--rh-muted); font-size: var(--rh-fs-md); }
.rh-page--base .billing-summary dd { margin: 0; color: var(--rh-text); font-weight: 600; }
.rh-page--base .settings-status-badge { padding: 0.125rem 0.625rem; border-radius: var(--rh-r-pill); background: var(--rh-accent-soft); color: var(--rh-accent-text); font-size: var(--rh-fs-sm); font-weight: 600; }
.rh-page--base .button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 1rem;
    border: 1px solid var(--rh-border-strong); border-radius: var(--rh-r-md); background: var(--rh-surface-2);
    color: var(--rh-text); font: inherit; font-size: var(--rh-fs-md); font-weight: 600; text-decoration: none; cursor: pointer;
}
.rh-page--base .button:hover { background: var(--rh-surface-3); color: var(--rh-text); }
.rh-page--base .button.primary { border-color: var(--rh-primary-bg); background: var(--rh-primary-bg); color: var(--rh-primary-fg); }
.rh-page--base .button.primary:hover { background: var(--rh-primary-hover); color: var(--rh-primary-fg); }
.rh-page--base .button.danger { border-color: var(--rh-danger); background: transparent; color: var(--rh-danger); }
.rh-page--base .button.danger:hover { background: var(--rh-danger-soft); }
.rh-page--base .settings-form-actions form { margin: 0; }
@media (min-width: 640px) {
    .rh-page--base .settings-pane-card { padding: var(--rh-s5); }
}
.rh-tabs { display: flex; gap: var(--rh-s1); overflow-x: auto; scrollbar-width: thin; padding-bottom: var(--rh-s2); border-bottom: 1px solid var(--rh-border); }
.rh-tabs__link {
    flex-shrink: 0;
    white-space: nowrap;
    padding: var(--rh-s2) var(--rh-s3);
    border-radius: var(--rh-r-sm);
    color: var(--rh-muted);
    font-size: var(--rh-fs-md);
    font-weight: 600;
    text-decoration: none;
}
.rh-tabs__link:hover { background: var(--rh-surface-2); color: var(--rh-text); }
.rh-tabs__link[aria-current="page"] { background: var(--rh-surface-3); color: var(--rh-text); }
.rh-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: var(--rh-s3);
    margin: var(--rh-s5) 0 0;
}
.rh-metric { padding: var(--rh-s3) var(--rh-s4); border-radius: var(--rh-r-md); background: var(--rh-surface-2); }
.rh-metric dt { color: var(--rh-muted); font-size: var(--rh-fs-sm); }
.rh-metric dd { margin: var(--rh-s1) 0 0; color: var(--rh-text); font-size: var(--rh-fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.rh-metric dd .rh-muted { font-size: var(--rh-fs-sm); font-weight: 400; }
@media (max-width: 479px) {
    .rh-metric { padding: var(--rh-s3); }
    .rh-metric dd { font-size: var(--rh-fs-base); }
}
.rh-card > .rh-metrics:first-child,
.rh-card > h2 + .rh-metrics { margin-top: 0; }
.rh-card > .rh-metrics + p { margin-top: var(--rh-s4); }
.rh-obs { display: grid; gap: var(--rh-s4); margin-bottom: var(--rh-s4); }
/* Destinations */
.rh-dest-list { margin: 0; padding: 0; list-style: none; }
.rh-dest {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "icon name toggle"
        "icon state state"
        "actions actions actions";
    gap: var(--rh-s1) var(--rh-s3);
    align-items: center;
    padding: var(--rh-s3) 0;
    border-top: 1px solid var(--rh-border);
}
.rh-dest:first-child { border-top: 0; padding-top: 0; }
.rh-dest > .rh-platform { grid-area: icon; align-self: start; }
.rh-dest__name { grid-area: name; display: grid; min-width: 0; }
.rh-dest__name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-dest__name .rh-muted { font-size: var(--rh-fs-sm); }
.rh-dest__state { grid-area: state; display: flex; flex-wrap: wrap; align-items: center; gap: var(--rh-s2); }
.rh-dest__meta { color: var(--rh-muted); font-size: var(--rh-fs-sm); }
.rh-dest__toggle { grid-area: toggle; margin: 0; }
.rh-dest__error { grid-column: 1 / -1; color: var(--rh-danger); font-size: var(--rh-fs-sm); }
@media (min-width: 720px) {
    .rh-dest {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        grid-template-areas:
            "icon name state toggle"
            "actions actions actions actions";
        gap: var(--rh-s2) var(--rh-s4);
    }
    .rh-dest > .rh-platform { align-self: center; }
    .rh-dest__state { justify-content: flex-end; }
}
.rh-switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.75rem;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid var(--rh-border-strong);
    border-radius: var(--rh-r-pill);
    background: var(--rh-surface-3);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.rh-switch__thumb {
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--rh-muted);
    transition: transform 0.15s ease, background-color 0.15s ease;
}
.rh-switch[aria-checked="true"],
.rh-switch--static[data-on="true"] { border-color: var(--rh-control); background: var(--rh-control); }
.rh-switch[aria-checked="true"] .rh-switch__thumb,
.rh-switch--static[data-on="true"] .rh-switch__thumb { background: var(--rh-on-control); transform: translateX(1.25rem); }
.rh-switch[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.rh-switch--static { cursor: default; }
.rh-toggle-error { grid-column: 1 / -1; color: var(--rh-danger); font-size: var(--rh-fs-sm); }
/* Stepper */
.rh-progress-text { margin-bottom: var(--rh-s4); color: var(--rh-muted); font-size: var(--rh-fs-md); }
.rh-stepper { display: grid; margin: 0; padding: 0; list-style: none; }
.rh-step { position: relative; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: var(--rh-s4); padding-bottom: var(--rh-s6); }
.rh-step:last-child { padding-bottom: 0; }
.rh-step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 2.5rem;
    bottom: 0.25rem;
    left: calc(1.125rem - 1px);
    width: 2px;
    background: var(--rh-border);
}
.rh-step--done:not(:last-child)::before { background: var(--rh-accent-border); }
.rh-step__marker {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 2px solid var(--rh-border-strong);
    border-radius: 50%;
    background: var(--rh-bg);
    color: var(--rh-muted);
    font-weight: 600;
}
.rh-step--current .rh-step__marker { border-color: var(--rh-accent); color: var(--rh-accent-text); box-shadow: 0 0 0 4px var(--rh-accent-soft); }
.rh-step--done .rh-step__marker { border-color: var(--rh-success); background: var(--rh-success-soft); color: var(--rh-success); }
.rh-step__body { display: grid; gap: var(--rh-s3); align-content: start; min-width: 0; padding-top: 0.3rem; }
/* A span, not a heading: <summary> is a button, headings inside it are flattened. */
.rh-step__title { display: block; color: var(--rh-text); font-size: var(--rh-fs-lg); font-weight: var(--rh-fw-strong); line-height: 1.2; letter-spacing: var(--rh-track-heading); }
.rh-step--todo .rh-step__title { color: var(--rh-muted); }
.rh-step--current .rh-step__body > :is(.rh-form, .rh-obs, .rh-test, .rh-explain, .rh-howto) { max-width: 40rem; }
.rh-howto { margin: 0; padding-left: 1.25em; color: var(--rh-text-2); font-size: var(--rh-fs-md); }
.rh-howto li + li { margin-top: var(--rh-s1); }
.rh-test { display: grid; gap: var(--rh-s3); padding: var(--rh-s4); border-radius: var(--rh-r-md); background: var(--rh-surface-2); }
@media (max-width: 479px) {
    .rh-step { gap: var(--rh-s3); }
    .rh-stepbox .rh-card { padding: var(--rh-s4) var(--rh-s3); }
    .rh-stepbox .rh-test { padding: var(--rh-s3); }
    .rh-stepbox .rh-plan { padding: var(--rh-s4); }
}
/* Get started: collapsible steps, OBS screenshots, big copy fields */
.rh-stepbox.rh-step__body { display: block; }
.rh-stepbox > summary { display: grid; gap: var(--rh-s1); list-style: none; cursor: pointer; }
.rh-stepbox > summary::-webkit-details-marker { display: none; }
.rh-stepbox > summary:hover .rh-step__title { color: var(--rh-text); }
.rh-stepbox > summary .rh-muted { font-size: var(--rh-fs-md); }
.rh-stepbox > * + * { margin-top: var(--rh-s4); }
.rh-stepbox > :not(summary) { max-width: 46rem; }
.rh-stepbox > summary { border-radius: var(--rh-r-sm); }
.rh-test > form { margin: 0; }
.rh-countdown { font-variant-numeric: tabular-nums; font-weight: 600; }
/* Free live countdown and inline plans */
.rh-freelive {
    display: grid;
    gap: var(--rh-s3);
    padding: var(--rh-s4) var(--rh-s5);
    border: 1px solid var(--rh-accent-border);
    border-radius: var(--rh-r-lg);
    background: var(--rh-accent-soft);
}
.rh-freelive h2 { font-size: var(--rh-fs-xl); }
.rh-freelive .rh-countdown { color: var(--rh-accent-text); }
.rh-freelive--urgent { border-color: var(--rh-warn); background: var(--rh-warn-soft); box-shadow: 0 0 0 4px var(--rh-warn-soft); }
.rh-freelive--urgent .rh-countdown { color: var(--rh-warn); }
.rh-freelive .rh-btn { justify-self: start; }
.rh-paywall { scroll-margin-top: var(--rh-s6); }
/* Plan status for accounts without a plan (Studio, Get started) */
.rh-plancard {
    display: grid;
    gap: var(--rh-s4);
    padding: var(--rh-s4);
    border: 1px solid var(--rh-accent-border);
    border-radius: var(--rh-r-lg);
    background: linear-gradient(135deg, var(--rh-accent-soft), transparent 70%), var(--rh-surface);
}
.rh-plancard h2 { margin-bottom: var(--rh-s1); font-size: var(--rh-fs-lg); }
.rh-plancard p { color: var(--rh-text-2); font-size: var(--rh-fs-md); }
.rh-plancard .rh-plancard__left { margin-top: var(--rh-s2); color: var(--rh-muted); font-size: var(--rh-fs-sm); }
.rh-plancard__left strong { color: var(--rh-text); font-variant-numeric: tabular-nums; }
.rh-plancard__action { display: grid; gap: var(--rh-s2); justify-items: start; }
.rh-plancard__action .rh-hint { max-width: 22rem; }
.rh-plancard--used { border-color: var(--rh-warn); background: linear-gradient(135deg, var(--rh-warn-soft), transparent 70%), var(--rh-surface); }
@media (min-width: 720px) {
    .rh-plancard { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: var(--rh-s4) var(--rh-s5); }
    .rh-plancard__action { justify-items: end; text-align: right; }
}
/* Reassurance points above the workspace plan cards */
.rh-points { display: grid; gap: var(--rh-s2); margin: 0; padding: 0; list-style: none; }
.rh-points li { display: flex; gap: var(--rh-s3); align-items: flex-start; color: var(--rh-text-2); font-size: var(--rh-fs-md); }
.rh-points .rh-icon { margin-top: 0.15rem; color: var(--rh-accent-text); }
.rh-badge--plain::before { content: none; }
.rh-paywall .rh-pricing { margin-top: var(--rh-s5); }
.rh-paywall > .rh-hint { margin-top: var(--rh-s4); text-align: center; }
/* Relay actions outside the studio (arm-control: Get started, signal test) */
.rh-btn--stop { background: var(--rh-danger-soft); border-color: var(--rh-danger); color: var(--rh-danger); }
.rh-btn--stop:hover { background: var(--rh-danger); color: var(--rh-on-strong); }
/* Free minutes clock: ticks only with a signal */
.rh-freeclock { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--rh-s2); }
.rh-freeclock .rh-countdown { color: var(--rh-accent-text); }
.rh-freeclock--paused .rh-countdown { color: var(--rh-text-2); }
.rh-freeclock__state { color: var(--rh-warn); font-size: var(--rh-fs-sm); font-weight: 600; }
/* Preview + health (signal partial) */
.rh-signal { display: grid; gap: var(--rh-s3); min-width: 0; }
.rh-health { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--rh-s2); margin: 0; }
.rh-health__item { min-width: 0; padding: var(--rh-s2) var(--rh-s3); border-radius: var(--rh-r-md); background: var(--rh-surface-2); }
.rh-health__item dt { color: var(--rh-muted); font-size: var(--rh-fs-sm); }
.rh-health__item dd { margin: var(--rh-s1) 0 0; overflow: hidden; color: var(--rh-text); font-weight: 600; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.rh-health__item dd .rh-muted { font-size: var(--rh-fs-sm); font-weight: 400; }
.rh-health__item--graph { grid-column: 1 / -1; }
.rh-health__item--graph dd { display: flex; align-items: center; gap: var(--rh-s3); }
.rh-health__graph { flex: 1 1 auto; min-width: 0; height: 1.75rem; }
.rh-health__graph polyline { fill: none; stroke: var(--rh-accent-text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
@media (min-width: 560px) {
    .rh-health { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
}
.rh-dest__retry { margin: 0; }
/* ── Studio: a stream manager (Twitch / YouTube Studio conventions). The
   status bar on top (state, clock, Test / Live switch, plan and drop
   protection), the player big on the left with LIVE / uptime / bitrate
   chips, the stat cards under it; on the right, the outputs panel and the
   activity feed. Below 1200 px everything stacks. ───────────────────── */
.rh-page--studio { max-width: 92rem; }
.rh-studio { display: grid; gap: var(--rh-s4); min-width: 0; }
.rh-studio > * { min-width: 0; }
@media (min-width: 1200px) {
    .rh-studio {
        grid-template-columns: minmax(0, 1fr) 21rem;
        grid-template-rows: auto auto 1fr auto;
        align-items: start;
    }
    .rh-studio-strip { grid-column: 1 / -1; }
    .rh-studio__stage { grid-column: 1; grid-row: 2 / span 2; }
    .rh-studio > .rh-tiles { grid-column: 1; grid-row: 4; }
    .rh-studio > .rh-dest-bar { grid-column: 2; grid-row: 2; }
    .rh-studio > .rh-activity { grid-column: 2; grid-row: 3 / span 2; }
}
.rh-console__strip.rh-studio-strip { gap: var(--rh-s3) var(--rh-s5); padding: var(--rh-s3) var(--rh-s4); }
.rh-studio-strip form { margin: 0; }
/* As wide as its column, but never taller than the screen under the strip. */
.rh-studio__stage { justify-self: center; width: min(100%, max(22rem, calc((100dvh - 15rem) * 16 / 9))); }
.rh-studio .rh-tiles { grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr)); gap: var(--rh-s3); }
.rh-studio .rh-tile__value { font-size: 1.0625rem; }
.rh-studio-strip__controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rh-s2) var(--rh-s3); min-width: 0; }
.rh-console__status--onair .rh-console__dot { background: var(--rh-live); animation: rh-blink 1.4s ease-in-out infinite; }
.rh-console__status--onair .rh-ring__fill { stroke: var(--rh-live); }
.rh-console__status--onair strong { color: var(--rh-text); }
.rh-console__status--onair .rh-console__clock { color: var(--rh-text-2); }
.rh-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    width: 100%;
    padding: 3px;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-md);
    background: var(--rh-bg);
}
.rh-mode__seg { display: grid; min-width: 0; margin: 0; }
.rh-mode__btn {
    display: grid;
    align-content: center;
    justify-items: start;
    min-width: 0;
    min-height: 42px;
    padding: 0.25rem 0.75rem;
    border: 0;
    border-radius: var(--rh-r-sm);
    background: transparent;
    color: var(--rh-text-2);
    font: inherit;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.rh-mode__btn:hover { text-decoration: none; }
.rh-mode__btn strong { display: inline-flex; align-items: center; gap: var(--rh-s2); color: inherit; font-size: var(--rh-fs-md); font-weight: var(--rh-fw-strong); }
.rh-mode__btn small { max-width: 100%; overflow: hidden; color: var(--rh-muted); font-size: var(--rh-fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.rh-mode__btn--on { background: var(--rh-surface-3); color: var(--rh-text); cursor: default; }
.rh-mode__btn--on strong::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--rh-info); }
.rh-mode__btn--live strong::before { background: var(--rh-live); animation: rh-blink 1.4s ease-in-out infinite; }
.rh-mode__btn--go { background: var(--rh-primary-bg); color: var(--rh-primary-fg); }
.rh-mode__btn--go small { color: color-mix(in srgb, var(--rh-primary-fg) 72%, transparent); }
.rh-mode__btn--go:hover { background: var(--rh-primary-hover); color: var(--rh-primary-fg); }
.rh-mode__btn--stop strong { color: var(--rh-danger); }
.rh-mode__btn--stop:hover { background: var(--rh-danger-soft); }
.rh-mode__btn:disabled { opacity: 0.55; cursor: progress; }
.rh-mode__btn:focus-visible { outline: 2px solid var(--rh-focus); outline-offset: 1px; }
.rh-studio-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rh-s2); }
.rh-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--rh-s2);
    min-height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-sm);
    background: var(--rh-surface-2);
    color: var(--rh-text-2);
    font-size: var(--rh-fs-sm);
    font-weight: var(--rh-fw-medium);
    text-decoration: none;
    white-space: nowrap;
}
.rh-pill:hover { border-color: var(--rh-border-strong); color: var(--rh-text); text-decoration: none; }
.rh-pill .rh-icon { width: 1rem; height: 1rem; color: var(--rh-muted); }
.rh-pill--warn { border-color: color-mix(in srgb, var(--rh-warn) 45%, transparent); color: var(--rh-warn); }
.rh-pill--locked { gap: 0.125rem; color: var(--rh-faint); }
.rh-pill--locked .rh-icon + .rh-icon { width: 0.75rem; height: 0.75rem; }
.rh-guard { position: relative; display: flex; margin: 0; }
.rh-guard__btn { padding: 0 0.5rem 0 0.625rem; font: inherit; font-size: var(--rh-fs-sm); cursor: pointer; }
.rh-guard__btn[aria-checked="true"] { border-color: color-mix(in srgb, var(--rh-success) 40%, transparent); }
.rh-guard__btn[aria-checked="true"] > .rh-icon { color: var(--rh-success); }
.rh-guard__btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.rh-guard__btn:focus-visible { outline: 2px solid var(--rh-focus); outline-offset: 2px; }
.rh-guard__btn .rh-switch { pointer-events: none; }
.rh-guard .rh-toggle-error { position: absolute; top: calc(100% + 2px); right: 0; z-index: 2; width: max-content; max-width: min(22rem, 90vw); white-space: normal; }
/* Chips over the player (signal partial): LIVE, uptime, bitrate. */
.rh-preview__chips { position: absolute; inset: 0.625rem 0.625rem auto; z-index: 2; display: flex; justify-content: space-between; gap: var(--rh-s2); pointer-events: none; }
.rh-preview__tl { display: inline-flex; gap: 0.375rem; }
.rh-preview__tr { display: inline-flex; gap: 0.375rem; margin-left: auto; }
.rh-vchip--viewers { pointer-events: auto; cursor: default; }
.rh-vchip--viewers .rh-icon { color: var(--rh-live); }
.rh-vchip--vertical { pointer-events: auto; cursor: default; }
.rh-vchip--vertical::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: color-mix(in srgb, var(--rh-on-screen) 45%, transparent); }
.rh-vchip--vertical.is-on::before { background: var(--rh-success); }
/* Outputs panel: the destinations as rows (stacked chips). */
.rh-dest-bar {
    display: grid;
    gap: var(--rh-s2);
    padding: var(--rh-s3);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-lg);
    background: var(--rh-surface);
}
.rh-dest-bar__title { display: inline-flex; align-items: center; justify-self: start; gap: var(--rh-s2); padding: 0 0.125rem; color: var(--rh-text); font-size: var(--rh-fs-sm); font-weight: var(--rh-fw-strong); text-decoration: none; }
.rh-dest-bar__title:hover { color: var(--rh-text); text-decoration: underline; }
.rh-dest-bar__title .rh-icon { width: 1rem; height: 1rem; color: var(--rh-muted); }
.rh-dest-bar .rh-chips { gap: var(--rh-s2); }
.rh-dchip { position: relative; max-width: 100%; padding-right: 0.5rem; }
.rh-dchip form { display: flex; margin: 0; }
.rh-dchip__name { min-width: 0; max-width: 12rem; overflow: hidden; color: var(--rh-text); text-overflow: ellipsis; white-space: nowrap; }
.rh-dchip__dot { width: 0.5rem; height: 0.5rem; flex-shrink: 0; border-radius: 50%; background: var(--rh-faint); }
.rh-dchip__note { max-width: 14rem; overflow: hidden; color: var(--rh-danger); font-size: var(--rh-fs-xs); font-weight: var(--rh-fw-medium); text-overflow: ellipsis; white-space: nowrap; }
a.rh-dchip__retry { padding: 0.125rem 0.5rem; border-radius: var(--rh-r-xs); background: var(--rh-warn-soft); color: var(--rh-warn); text-decoration: none; white-space: nowrap; }
a.rh-dchip__retry:hover { text-decoration: underline; }
.rh-dchip__retry { padding: 0 0.25rem; border: 0; background: transparent; color: var(--rh-accent-text); font: inherit; font-size: var(--rh-fs-xs); font-weight: var(--rh-fw-strong); text-decoration: underline; cursor: pointer; }
.rh-dchip--live { border-color: color-mix(in srgb, var(--rh-success) 40%, transparent); }
.rh-dchip--live .rh-dchip__dot { background: var(--rh-success); animation: rh-pulse 2s infinite; }
.rh-dchip--starting .rh-dchip__dot { background: var(--rh-info); }
.rh-dchip--retrying { border-color: color-mix(in srgb, var(--rh-warn) 45%, transparent); }
.rh-dchip--retrying .rh-dchip__dot { background: var(--rh-warn); }
.rh-dchip--retrying .rh-dchip__note { color: var(--rh-warn); }
.rh-dchip--error { border-color: color-mix(in srgb, var(--rh-danger) 50%, transparent); }
.rh-dchip--error .rh-dchip__dot { background: var(--rh-danger); }
.rh-dchip--off .rh-platform,
.rh-dchip--off .rh-dchip__name { opacity: 0.55; }
.rh-dchip--off .rh-dchip__dot { background: var(--rh-surface-3); }
.rh-dchip--add { justify-content: center; min-width: 2.25rem; padding: 0 0.625rem; color: var(--rh-muted); text-decoration: none; }
.rh-dchip--add:hover { border-color: var(--rh-border-strong); color: var(--rh-text); text-decoration: none; }
.rh-dchip .rh-toggle-error { position: absolute; top: calc(100% + 2px); left: 0; z-index: 2; width: max-content; max-width: min(22rem, 90vw); white-space: normal; }
@media (min-width: 1200px) {
    /* In the side column the chips become full-width output rows. */
    .rh-studio .rh-dest-bar .rh-chips { flex-direction: column; flex-wrap: nowrap; }
    .rh-studio .rh-dest-bar .rh-chips > li:not(.rh-dchip) { display: block; }
    .rh-studio .rh-dchip {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto auto auto;
        align-items: center;
        min-height: 3rem;
        padding: 0.375rem 0.625rem 0.375rem 0.375rem;
        border-radius: var(--rh-r-md);
        background: var(--rh-bg);
    }
    .rh-studio .rh-dchip .rh-platform { width: 2rem; height: 2rem; border-radius: 7px; }
    .rh-studio .rh-dchip > * { grid-area: auto; grid-row: 1; }
    .rh-studio .rh-dchip > .rh-dchip__note { grid-column: 2 / -1; grid-row: 2; }
    .rh-studio .rh-dchip__name { max-width: none; font-size: var(--rh-fs-md); }
    .rh-studio .rh-dchip__note { grid-column: 2 / -1; grid-row: 2; max-width: none; }
    .rh-studio .rh-dchip--add { display: flex; width: 100%; min-height: 2.5rem; border-style: dashed; background: transparent; }
}
.rh-switch--sm { width: 2.25rem; height: 1.25rem; }
.rh-switch--sm .rh-switch__thumb { top: 0.125rem; left: 0.125rem; width: 0.875rem; height: 0.875rem; }
.rh-switch--sm[aria-checked="true"] .rh-switch__thumb,
.rh-switch--sm[data-on="true"] .rh-switch__thumb { transform: translateX(1rem); }
/* Activity feed (partials/activity-feed): newest first, one line each. */
.rh-activity {
    display: grid;
    gap: var(--rh-s2);
    align-content: start;
    padding: var(--rh-s3);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-lg);
    background: var(--rh-surface);
}
.rh-activity__title { padding: 0 0.125rem; font-size: var(--rh-fs-sm); font-weight: var(--rh-fw-strong); letter-spacing: 0; }
.rh-activity__empty { padding: var(--rh-s2) 0.125rem; font-size: var(--rh-fs-sm); }
.rh-activity__list { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.rh-activity__item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.125rem var(--rh-s3);
    padding: 0.5rem 0.5rem 0.5rem 1.375rem;
    border-radius: var(--rh-r-sm);
    font-size: var(--rh-fs-sm);
    line-height: 1.4;
}
.rh-activity__item:hover { background: var(--rh-surface-2); }
.rh-activity__item::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 0.875rem;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: var(--rh-faint);
}
.rh-activity__item--ok::before,
.rh-activity__item--success::before,
.rh-activity__item--live::before { background: var(--rh-success); }
.rh-activity__item--info::before { background: var(--rh-info); }
.rh-activity__item--warn::before,
.rh-activity__item--warning::before { background: var(--rh-warn); }
.rh-activity__item--bad::before,
.rh-activity__item--danger::before,
.rh-activity__item--error::before { background: var(--rh-danger); }
.rh-activity__label { grid-column: 1; color: var(--rh-text); font-weight: var(--rh-fw-medium); }
.rh-activity__time { grid-column: 2; grid-row: 1; color: var(--rh-faint); font-family: var(--rh-mono); font-size: var(--rh-fs-xs); white-space: nowrap; }
.rh-activity__detail { grid-column: 1 / -1; font-size: var(--rh-fs-xs); }
@media (min-width: 900px) {
    .rh-studio-strip { align-items: center; }
    .rh-studio-strip__controls { justify-content: flex-end; }
    .rh-mode { width: auto; grid-template-columns: repeat(2, minmax(9rem, auto)); }
}
@media (prefers-reduced-motion: reduce) {
    .rh-console__status--onair .rh-console__dot,
    .rh-mode__btn--live strong::before,
    .rh-dchip--live .rh-dchip__dot { animation: none; }
}
/* Signal test console (/app/preflight, /tools/stream-test, /app/reports/{id}):
   one screen. Status + OBS values on top, preview and metric tiles, verdict.
   Tones: pending (grey), ok (green), warn (amber), bad (red). */
.rh-page--console { gap: var(--rh-s4); }
.rh-app__main:has(.rh-page--console) { padding-bottom: var(--rh-s5); }
.rh-console-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--rh-s2) var(--rh-s4); }
.rh-console-head h1 { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); }
.rh-console-head p { margin-top: var(--rh-s1); font-size: var(--rh-fs-md); }
.rh-console { display: grid; gap: var(--rh-s3); min-width: 0; }
.rh-console__strip {
    display: grid;
    gap: var(--rh-s3) var(--rh-s5);
    align-items: end;
    padding: var(--rh-s3) var(--rh-s4);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-lg);
    background: var(--rh-surface);
    box-shadow: var(--rh-shadow-1);
}
.rh-console__status { position: relative; display: flex; align-items: center; gap: var(--rh-s3); min-width: 0; align-self: center; }
.rh-ring { width: 2.75rem; height: 2.75rem; flex-shrink: 0; transform: rotate(-90deg); }
.rh-ring circle { fill: none; stroke-width: 4; }
.rh-ring__track { stroke: var(--rh-surface-3); }
.rh-ring__fill { stroke: var(--rh-info); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.rh-console__dot {
    position: absolute;
    left: 1.375rem;
    top: 50%;
    display: grid;
    place-items: center;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background: var(--rh-faint);
    transform: translate(-50%, -50%);
}
.rh-console__state { display: grid; min-width: 0; }
.rh-console__state strong { color: var(--rh-text); font-size: var(--rh-fs-lg); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.rh-console__clock { color: var(--rh-muted); font-family: var(--rh-mono); font-size: var(--rh-fs-xs); font-variant-numeric: tabular-nums; }
.rh-console__status--waiting .rh-console__dot { background: var(--rh-info); animation: rh-pulse-info 1.8s infinite; }
.rh-console__status--receiving .rh-console__dot,
.rh-console__status--analyzing .rh-console__dot { background: var(--rh-success); animation: rh-pulse 1.8s infinite; }
.rh-console__status--receiving .rh-ring__fill,
.rh-console__status--analyzing .rh-ring__fill,
.rh-console__status--done .rh-ring__fill { stroke: var(--rh-success); }
.rh-console__status--done .rh-console__dot { width: 1.75rem; height: 1.75rem; background: var(--rh-success-soft); color: var(--rh-success); }
.rh-console__status--done .rh-console__dot .rh-icon { width: 1rem; height: 1rem; }
.rh-console__status--done strong { color: var(--rh-success); }
.rh-console__status--lost .rh-ring__fill { stroke: var(--rh-warn); }
.rh-console__status--lost .rh-console__dot { background: var(--rh-warn); }
.rh-console__status--lost strong { color: var(--rh-warn); }
@media (min-width: 900px) {
    .rh-console__strip { grid-template-columns: minmax(13rem, auto) minmax(0, 1fr); }
}
/* Metric tiles */
.rh-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--rh-s2); min-width: 0; }
@media (min-width: 640px) {
    .rh-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.rh-tile {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.125rem;
    min-width: 0;
    min-height: 5.25rem;
    padding: var(--rh-s3);
    overflow: hidden;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-lg);
    background: var(--rh-surface);
}
.rh-tile__label { display: flex; align-items: center; gap: var(--rh-s2); color: var(--rh-muted); font-size: var(--rh-fs-xs); }
.rh-tile__label::after { content: ""; width: 0.5rem; height: 0.5rem; margin-left: auto; border-radius: 50%; background: var(--rh-surface-3); }
.rh-tile__value { overflow: hidden; color: var(--rh-text); font-family: var(--rh-mono); font-size: 1.25rem; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.rh-tile__value small { color: var(--rh-muted); font-size: var(--rh-fs-sm); font-weight: 500; }
.rh-tile__none { color: var(--rh-faint); font-weight: 500; }
.rh-tile__sub { overflow: hidden; color: var(--rh-muted); font-size: var(--rh-fs-sm); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.rh-tile__graph { position: absolute; right: var(--rh-s3); bottom: var(--rh-s2); width: 45%; height: 1.75rem; pointer-events: none; }
.rh-tile__graph polyline { fill: none; stroke: var(--rh-accent-text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.rh-tile--ok .rh-tile__label::after { background: var(--rh-success); }
.rh-tile--warn .rh-tile__label::after { background: var(--rh-warn); }
.rh-tile--bad .rh-tile__label::after { background: var(--rh-danger); }
.rh-tile--warn { border-color: color-mix(in srgb, var(--rh-warn) 35%, transparent); }
.rh-tile--bad { border-color: color-mix(in srgb, var(--rh-danger) 40%, transparent); }
.rh-tile--warn .rh-tile__graph polyline { stroke: var(--rh-warn); }
.rh-tile--bad .rh-tile__graph polyline { stroke: var(--rh-danger); }
/* Verdict: grade, platform chips, problems as "issue -> OBS setting" rows */
.rh-verdict { display: grid; gap: var(--rh-s2); padding: var(--rh-s3) var(--rh-s4); border: 1px solid var(--rh-border); border-radius: var(--rh-r-lg); background: var(--rh-surface); }
.rh-verdict__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rh-s3) var(--rh-s5); }
.rh-verdict__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rh-s2); margin-left: auto; }
.rh-verdict__actions form { margin: 0; }
.rh-grade { display: flex; align-items: center; gap: var(--rh-s3); }
.rh-grade__score {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--rh-surface-3);
    border-radius: 50%;
    color: var(--rh-faint);
    font-size: var(--rh-fs-lg);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.rh-grade__label { color: var(--rh-muted); font-size: var(--rh-fs-lg); font-weight: 600; }
.rh-grade--ok .rh-grade__score { border-color: var(--rh-success); color: var(--rh-success); }
.rh-grade--ok .rh-grade__label { color: var(--rh-success); }
.rh-grade--warn .rh-grade__score { border-color: var(--rh-warn); color: var(--rh-warn); }
.rh-grade--warn .rh-grade__label { color: var(--rh-warn); }
.rh-grade--bad .rh-grade__score { border-color: var(--rh-danger); color: var(--rh-danger); }
.rh-grade--bad .rh-grade__label { color: var(--rh-danger); }
.rh-dest-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rh-s2) var(--rh-s3); }
.rh-chips { display: flex; flex-wrap: wrap; gap: var(--rh-s2); margin: 0; padding: 0; list-style: none; }
.rh-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--rh-s2);
    min-height: 2.25rem;
    padding: 0.25rem 0.75rem 0.25rem 0.375rem;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-pill);
    background: var(--rh-surface-2);
    color: var(--rh-text-2);
    font-size: var(--rh-fs-sm);
    font-weight: 600;
}
.rh-chip .rh-icon { width: 1rem; height: 1rem; }
.rh-chip--pending { color: var(--rh-faint); }
.rh-chip--pending .rh-platform { filter: grayscale(1); opacity: 0.45; }
.rh-chip--ok { border-color: color-mix(in srgb, var(--rh-success) 40%, transparent); }
.rh-chip--ok .rh-icon { color: var(--rh-success); }
.rh-chip--warn { border-color: color-mix(in srgb, var(--rh-warn) 45%, transparent); }
.rh-chip--warn .rh-icon { color: var(--rh-warn); }
.rh-chip--bad { border-color: color-mix(in srgb, var(--rh-danger) 50%, transparent); }
.rh-chip--bad .rh-icon { color: var(--rh-danger); }
.rh-fixes { display: grid; margin: 0; padding: 0; list-style: none; }
.rh-fixes > li { border-top: 1px solid var(--rh-border); }
.rh-fix { position: relative; padding-left: var(--rh-s4); font-size: var(--rh-fs-sm); }
.rh-fix::before { content: ""; position: absolute; left: 0; top: 0.9rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--rh-info); }
.rh-fix--warn::before { background: var(--rh-warn); }
.rh-fix--bad::before { background: var(--rh-danger); }
.rh-fix > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem var(--rh-s3);
    align-items: baseline;
    padding: var(--rh-s2) 0;
    border-radius: var(--rh-r-sm);
    list-style: none;
    cursor: pointer;
}
.rh-fix > summary::-webkit-details-marker { display: none; }
.rh-fix > summary:hover .rh-fix__setting { color: var(--rh-text); }
.rh-fix__issue { color: var(--rh-text); font-weight: 600; }
.rh-fix summary > .rh-icon { display: none; width: 1rem; height: 1rem; color: var(--rh-faint); align-self: center; }
.rh-fix__setting { color: var(--rh-text-2); }
.rh-fix:not([open]) .rh-fix__setting { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-fix__why { margin: 0 0 var(--rh-s2); color: var(--rh-muted); }
@media (min-width: 720px) {
    .rh-fix > summary { grid-template-columns: minmax(10rem, 15rem) auto minmax(0, 1fr); }
    .rh-fix summary > .rh-icon { display: block; }
}
@media (prefers-reduced-motion: reduce) {
    .rh-console__dot { animation: none; }
    .rh-ring__fill { transition: none; }
}
/* Options page: one "Drop protection" card. The switch sits in the head;
   when on, the wait time, then one tile per visual (slate / image / video). */
.rh-protect { display: grid; gap: var(--rh-s4); }
.rh-protect > * { margin: 0; }
.rh-protect__head { margin-bottom: 0; flex-wrap: nowrap; align-items: center; }
.rh-protect__head h2 { font-size: var(--rh-fs-lg); }
.rh-protect__head p { margin: 0; }
.rh-protect__head .rh-dest__toggle { flex-shrink: 0; }
.rh-protect__wait {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--rh-s1) var(--rh-s4);
    align-items: center;
    margin: 0;
    padding-top: var(--rh-s4);
    border-top: 1px solid var(--rh-border);
}
.rh-protect__wait .rh-hint { grid-column: 1 / -1; }
.rh-protect__seconds { display: flex; align-items: center; gap: var(--rh-s2); }
.rh-protect__seconds .rh-input { width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.rh-protect__visual { display: grid; gap: var(--rh-s2); min-width: 0; margin: 0; padding: 0; border: 0; }
.rh-protect__visual > legend { float: left; margin-bottom: var(--rh-s2); padding: 0; }
.rh-protect__visual > legend + * { clear: both; }
.rh-protect__save { align-items: center; }
.rh-visuals { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--rh-s3); }
.rh-visual {
    position: relative;
    display: grid;
    align-content: start;
    gap: var(--rh-s2);
    min-width: 0;
    padding: var(--rh-s2);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-md);
    background: var(--rh-surface-2);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rh-visual:has(.rh-visual__radio:checked) { border-color: var(--rh-control); box-shadow: 0 0 0 1px var(--rh-control); }
.rh-visual:has(.rh-visual__radio:focus-visible) { outline: 2px solid var(--rh-focus); outline-offset: 2px; }
.rh-visual:has(.rh-visual__radio:not(:disabled)):hover { border-color: var(--rh-accent-border); }
.rh-visual__pick { display: grid; gap: var(--rh-s2); margin: 0; cursor: pointer; }
.rh-visual__radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rh-visual__radio:disabled + .rh-visual__thumb,
.rh-visual__radio:disabled ~ .rh-visual__name { cursor: default; }
.rh-visual--locked .rh-visual__thumb,
.rh-visual--locked .rh-visual__name { opacity: 0.6; }
.rh-visual__thumb {
    display: grid;
    place-items: center;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--rh-r-sm);
    background: var(--rh-bg);
    color: var(--rh-faint);
}
.rh-visual__thumb img,
.rh-visual__thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.rh-visual__thumb .rh-icon { width: 1.75rem; height: 1.75rem; }
.rh-visual__slate {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: var(--rh-s2);
    background: linear-gradient(135deg, var(--rh-surface-3), var(--rh-bg));
    color: var(--rh-text-2);
    font-size: var(--rh-fs-sm);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}
.rh-visual__name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rh-s1) var(--rh-s2); color: var(--rh-text); font-size: var(--rh-fs-md); font-weight: 600; }
.rh-visual__badge { font-size: 0.75rem; padding: 0 0.5rem; }
.rh-visual__actions { display: flex; flex-wrap: wrap; gap: var(--rh-s2); }
.rh-visual__actions form { margin: 0; }
/* A file input dressed as a button: the label is the button. */
.rh-upload { position: relative; cursor: pointer; }
.rh-upload__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.rh-upload:focus-within { outline: 2px solid var(--rh-focus); outline-offset: 2px; }
.rh-lock { display: inline-flex; align-items: center; gap: var(--rh-s1); flex-shrink: 0; color: var(--rh-muted); font-size: var(--rh-fs-sm); font-weight: 600; text-decoration: none; }
.rh-lock:hover { color: var(--rh-text); }
.rh-lock .rh-icon { width: 1rem; height: 1rem; }
/* Destinations page: rows with a switch and an actions menu. */
.rh-card__head--row { flex-wrap: nowrap; align-items: center; }
.rh-card__head--row h2 { margin: 0; font-size: var(--rh-fs-lg); }
.rh-dest-list--manage .rh-dest {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
        "icon name toggle more"
        "icon state state state";
    gap: var(--rh-s1) var(--rh-s3);
}
.rh-dest-list--manage .rh-dest__state { justify-content: flex-start; }
.rh-dest-list--manage .rh-dest > .rh-modal { grid-column: 1 / -1; }
@media (min-width: 720px) {
    .rh-dest-list--manage .rh-dest {
        grid-template-columns: auto minmax(0, 1fr) auto auto auto;
        grid-template-areas: "icon name state toggle more";
        gap: var(--rh-s2) var(--rh-s4);
    }
    .rh-dest-list--manage .rh-dest__state { justify-content: flex-end; }
}
.rh-dest-limit { margin-top: var(--rh-s4); padding-top: var(--rh-s3); border-top: 1px solid var(--rh-border); }
.rh-more { grid-area: more; position: relative; }
.rh-more__toggle { width: 36px; padding: 0; list-style: none; }
.rh-more__toggle::-webkit-details-marker { display: none; }
.rh-more[open] .rh-more__toggle { background: var(--rh-surface-2); color: var(--rh-text); }
.rh-more__panel {
    position: absolute;
    top: calc(100% + var(--rh-s1));
    right: 0;
    z-index: 30;
    display: grid;
    min-width: 12rem;
    padding: var(--rh-s1);
    border: 1px solid var(--rh-border-strong);
    border-radius: var(--rh-r-md);
    background: var(--rh-surface-2);
    box-shadow: var(--rh-shadow-2);
}
.rh-more__panel form { margin: 0; }
.rh-more__item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding: 0 var(--rh-s3);
    border: 0;
    border-radius: var(--rh-r-sm);
    background: transparent;
    color: var(--rh-text-2);
    font: inherit;
    font-size: var(--rh-fs-md);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.rh-more__item:hover { background: var(--rh-surface-3); color: var(--rh-text); }
.rh-more__item--danger { color: var(--rh-danger); }
.rh-more__item--danger:hover { background: var(--rh-danger-soft); color: var(--rh-danger); }
.rh-empty--center { justify-items: center; padding: var(--rh-s7) var(--rh-s5); text-align: center; }
.rh-empty--center p { max-width: 34rem; }
.rh-empty__icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--rh-accent-soft); color: var(--rh-accent-text); }
/* Modal dialog (native <dialog>, opened by streamer.js; without JS it opens
   as the anchor target and sits in the page flow). */
.rh-modal {
    width: min(34rem, calc(100vw - 2 * var(--rh-gutter)));
    max-width: none;
    max-height: calc(100dvh - 2 * var(--rh-s4));
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid var(--rh-border-strong);
    border-radius: var(--rh-r-lg);
    background: var(--rh-surface);
    color: var(--rh-text);
    box-shadow: var(--rh-shadow-2);
    overscroll-behavior: contain;
}
.rh-modal::backdrop { background: var(--rh-backdrop); backdrop-filter: blur(2px); }
.rh-modal:target:not([open]),
.rh-modal:has(:target):not([open]) { display: block; position: static; width: 100%; max-height: none; }
.rh-modal__box { display: grid; gap: var(--rh-s4); padding: var(--rh-s5) var(--rh-s4); }
@media (min-width: 640px) {
    .rh-modal__box { padding: var(--rh-s5); }
}
.rh-modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--rh-s3); }
.rh-modal__head h2 { margin: 0; font-size: var(--rh-fs-xl); }
.rh-modal__close {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: var(--rh-r-sm);
    background: none;
    color: var(--rh-muted);
    font: inherit;
    cursor: pointer;
}
.rh-modal__close:hover { background: var(--rh-surface-2); color: var(--rh-text); }
/* A script-driven button: the no-JS :target view (not [open]) has nothing to close. */
.rh-modal:not([open]) .rh-modal__close { display: none; }
.rh-modal__step { display: grid; gap: var(--rh-s4); }
.rh-modal__step > * { margin: 0; }
.rh-modal__step[hidden] { display: none; }
.rh-modal__stephead { display: grid; gap: var(--rh-s2); }
.rh-modal__stephead h3 { display: flex; align-items: center; gap: var(--rh-s2); margin: 0; font-size: var(--rh-fs-lg); }
.rh-modal__back { display: inline-flex; align-items: center; gap: var(--rh-s1); width: max-content; color: var(--rh-muted); font-size: var(--rh-fs-sm); font-weight: 600; text-decoration: none; }
.rh-modal__back:hover { color: var(--rh-text); }
.rh-modal__back .rh-icon { width: 1rem; height: 1rem; }
.rh-modal .rh-explain { margin: 0; }
.rh-modal .rh-explain > .rh-form,
.rh-modal .rh-explain > .rh-field { margin-top: var(--rh-s3); }
.rh-modal .rh-btn--block { width: 100%; }
.rh-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--rh-s2); margin: 0; padding: 0; list-style: none; }
.rh-pick__item {
    position: relative;
    display: grid;
    justify-items: center;
    gap: var(--rh-s2);
    padding: var(--rh-s4) var(--rh-s2) var(--rh-s3);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-r-md);
    background: var(--rh-surface-2);
    color: var(--rh-text);
    text-align: center;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.rh-pick__item:hover { border-color: var(--rh-accent-border); background: var(--rh-surface-3); color: var(--rh-text); }
.rh-pick__name { font-size: var(--rh-fs-md); font-weight: 600; line-height: 1.25; }
.rh-pick__tag { position: absolute; top: var(--rh-s1); right: var(--rh-s1); padding: 0 0.375rem; border-radius: var(--rh-r-pill); background: var(--rh-accent-soft); color: var(--rh-accent-text); font-size: 0.75rem; font-weight: 600; }
@media (max-width: 379px) {
    .rh-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
