:root {
  color-scheme: light;
  --ink: #17263a;
  --muted: #6d7a89;
  --line: #dfe5eb;
  --soft: #f3f6f8;
  --panel: #ffffff;
  --nav: #102438;
  --nav-soft: #183149;
  --cyan: #21a8d8;
  --coral: #f07f61;
  --good: #29a36a;
  --warning: #e3a62f;
  --bad: #cf4f55;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #edf1f4; }
body[data-page="studio"] [data-interview-only],
body[data-page="interview"] [data-studio-only] { display: none !important; }
button, input { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; color: #eef6fb; background: var(--nav); display: flex; flex-direction: column; }
.sidebar-toggle { position: absolute; z-index: 3; top: 18px; right: -14px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0 0 2px; border: 1px solid #cbd7df; border-radius: 50%; color: #31536b; background: #f8fbfc; box-shadow: 0 4px 12px rgba(11,31,47,.18); font-size: 20px; line-height: 1; cursor: pointer; }
.sidebar-toggle:hover { color: #102438; border-color: #91adbd; background: white; }
.sidebar-toggle:focus-visible { outline: 3px solid rgba(117,200,229,.4); outline-offset: 2px; }
.brand { width: 100%; display: grid; justify-items: center; gap: 12px; color: inherit; text-align: center; text-decoration: none; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.11); }
.brand img { width: 132px; height: auto; }
.brand span { display: grid; justify-items: center; gap: 3px; }
.brand strong { font-size: 14px; white-space: nowrap; }
.brand small { color: #91a8ba; font-size: 10px; white-space: nowrap; }
.sidebar nav { display: grid; gap: 6px; margin-top: 28px; }
.nav-item { display: flex; gap: 12px; align-items: center; min-height: 42px; padding: 0 12px; color: #aebdca; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-item:hover, .nav-item.is-active { color: white; background: var(--nav-soft); }
.nav-icon { width: 20px; color: #75c8e5; text-align: center; }
.nav-section-group { display: grid; gap: 2px; margin: -2px 0 5px 22px; padding: 2px 0 2px 10px; border-left: 1px solid rgba(117,200,229,.25); }
.nav-subitem { min-height: 32px; gap: 7px; padding: 0 8px; border-radius: 6px; color: #89a0b2; font-size: 12px; font-weight: 600; }
.nav-subitem .nav-icon { width: 12px; font-size: 10px; }
.nav-subitem:hover { background: rgba(255,255,255,.045); }
.nav-subitem.is-current { color: #f4fbff; background: rgba(117,200,229,.1); }
.nav-subitem.is-current .nav-icon { color: #9de6f8; }
.sidebar-foot { margin-top: auto; display: grid; gap: 16px; }
.account-mini { padding: 11px 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(255,255,255,.035); }
.account-mini span { display: grid; gap: 3px; min-width: 0; }
.account-mini strong { overflow: hidden; color: #eef6fb; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-mini small { color: #8fa5b7; font-size: 10px; }
.connection-mini { display: flex; gap: 10px; align-items: center; padding: 14px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; }
.connection-mini span:last-child { display: grid; gap: 2px; }
.connection-mini strong { font-size: 12px; }
.connection-mini small { color: #8ea5b8; font-size: 10px; }
.status-dot, .status-light { display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #82909c; }
.status-dot { width: 8px; height: 8px; }
.status-light { width: 10px; height: 10px; box-shadow: 0 0 0 4px rgba(130,144,156,.12); }
.is-good, .status-light.is-good { background: var(--good); box-shadow: 0 0 0 4px rgba(41,163,106,.13); }
.is-warning, .status-light.is-warning { background: var(--warning); box-shadow: 0 0 0 4px rgba(227,166,47,.13); }
.is-bad, .status-light.is-bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(207,79,85,.13); }
.is-neutral, .status-light.is-neutral { background: #82909c; }
.quiet-button { min-height: 38px; border: 0; border-radius: 7px; color: #9eb0bf; background: transparent; cursor: pointer; text-align: left; padding: 0 12px; }
.quiet-button:hover { color: white; background: rgba(255,255,255,.06); }

.workspace { min-width: 0; padding: 30px clamp(22px, 3vw, 48px) 64px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 24px; }
body[data-page="interview"] .topbar { display: none; }
.eyebrow { margin: 0 0 6px; color: #718092; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.02em; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.save-state { color: #778391; font-size: 12px; margin-right: 4px; }
.save-state.has-changes { color: #a56614; }
.primary-button, .secondary-button { min-height: 40px; border-radius: 7px; padding: 0 16px; border: 1px solid transparent; font-size: 13px; font-weight: 750; cursor: pointer; }
.primary-button { color: white; background: var(--nav); }
.primary-button:hover:not(:disabled) { background: #193851; }
.secondary-button { color: #33475a; border-color: #cbd4dc; background: white; }
.secondary-button:hover:not(:disabled) { border-color: #91a2b1; }
button:disabled { opacity: .45; cursor: not-allowed; }

.status-strip { display: grid; grid-template-columns: 150px 170px 175px minmax(240px,1fr) 170px; min-height: 72px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.status-item { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-right: 1px solid var(--line); }
.status-item:last-child { border-right: 0; }
.status-item span:last-child { min-width: 0; display: grid; gap: 3px; }
.status-item small { color: #7a8693; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.status-item strong { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.status-item-right { justify-content: flex-end; text-align: right; }

.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.preview-panel { min-width: 0; padding: 24px; }
.settings-panel { padding: 24px; border-left: 1px solid var(--line); background: #fafbfc; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 18px; }
.section-heading.compact { margin-bottom: 22px; }
.section-note { max-width: 430px; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
.segmented { display: flex; padding: 3px; border: 1px solid #d7dee4; border-radius: 8px; background: var(--soft); }
.segmented button { min-height: 30px; padding: 0 11px; border: 0; border-radius: 5px; color: #6b7885; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.segmented button.is-active { color: var(--ink); background: white; box-shadow: 0 1px 3px rgba(25,42,57,.12); }
.video-stage { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 8px; background: #0b111a; box-shadow: 0 10px 28px rgba(22,37,51,.16); }
.video-stage iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; border: 0; display: block; transform: scale(var(--output-scale, 1)); transform-origin: 0 0; }
.preview-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 14px; color: #7c8793; font-size: 11px; }
.preview-foot p { margin-bottom: 0; }
.preview-foot strong { color: #4f5d6a; }
.preview-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #e3a62f; }

.broadcast-switch { position: relative; display: grid; grid-template-columns: 1fr 42px; gap: 16px; align-items: center; cursor: pointer; }
.broadcast-switch > span:first-child, .check-row > span { display: grid; gap: 3px; }
.broadcast-switch strong, .check-row strong { font-size: 13px; }
.broadcast-switch small, .check-row small { color: #7b8792; font-size: 11px; line-height: 1.4; }
.broadcast-switch input { position: absolute; opacity: 0; }
.switch-track { width: 42px; height: 24px; padding: 3px; border-radius: 20px; background: #b8c2cb; transition: background .18s; }
.switch-track::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.broadcast-switch input:checked + .switch-track { background: var(--good); }
.broadcast-switch input:checked + .switch-track::after { transform: translateX(18px); }
.settings-divider { height: 1px; margin: 22px 0; background: var(--line); }
.field-stack { display: grid; gap: 7px; margin-bottom: 15px; }
.field-stack label { color: #566473; font-size: 11px; font-weight: 750; }
.field-stack input { width: 100%; min-height: 38px; padding: 0 11px; border: 1px solid #cfd8df; border-radius: 6px; color: var(--ink); background: white; font-size: 12px; outline: none; }
.field-stack input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(33,168,216,.13); }
.check-row { display: grid; grid-template-columns: 17px 1fr; gap: 10px; align-items: start; margin-bottom: 15px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--nav); }
.security-note { display: flex; gap: 10px; margin-top: 24px; padding: 13px; border-radius: 8px; color: #506273; background: #edf3f6; }
.security-note > span { color: var(--cyan); font-size: 9px; margin-top: 3px; }
.security-note p { margin-bottom: 0; font-size: 10px; line-height: 1.45; }

.interview-console { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
body[data-page="interview"] .interview-console { margin-bottom: 0; }
.interview-heading { align-items: center; }
.interview-heading .section-note { margin-top: 7px; }
.interview-status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border: 1px solid #cfd9e1; border-radius: 999px; color: #526476; background: #f6f8fa; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.interview-status::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #8c99a5; }
.interview-status.is-open::before { background: var(--good); box-shadow: 0 0 0 3px rgba(41,163,106,.12); }
.interview-status.is-ready::before { background: var(--cyan); box-shadow: 0 0 0 3px rgba(33,168,216,.13); }
.interview-status.is-live::before { background: var(--coral); box-shadow: 0 0 0 3px rgba(240,127,97,.14); }
.interview-grid { display: grid; grid-template-columns: 288px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.session-browser { min-width: 0; padding: 18px; border-right: 1px solid var(--line); background: #f7f9fa; }
.session-create-form { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.session-create-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.session-create-heading label, .session-delete-link { color: #566473; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.session-delete-link { padding: 0; border: 0; color: #a7353e; background: transparent; cursor: pointer; }
.session-delete-link:hover { color: #7f1f27; text-decoration: underline; text-underline-offset: 2px; }
.session-delete-link:focus-visible { border-radius: 2px; outline: 2px solid rgba(167,53,62,.3); outline-offset: 3px; }
.session-create-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.session-create-form > .session-create-heading { display: flex; }
.session-create-form input, .invitation-form select { min-width: 0; min-height: 40px; padding: 0 11px; border: 1px solid #ccd6de; border-radius: 7px; color: var(--ink); background: white; outline: none; }
.session-create-form input:focus, .invitation-form select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(33,168,216,.13); }
.session-list { display: grid; gap: 7px; max-height: 330px; margin-top: 14px; overflow: auto; }
.session-list-button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 8px 10px; align-items: center; padding: 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.session-list-button:hover { border-color: #d6dfe6; background: white; }
.session-list-button.is-selected { border-color: #b7d9e6; background: #eef8fb; }
.session-list-button > span:first-child { display: contents; }
.session-list-button strong { min-width: 0; grid-column: 1 / -1; grid-row: 1; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.session-list-button small { grid-column: 1; grid-row: 2; color: #7b8996; font-size: 10px; }
.session-state-mark { grid-column: 2; grid-row: 2; justify-self: end; padding: 4px 6px; border-radius: 4px; color: #536576; background: #e7edf1; font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.session-workspace { min-width: 0; min-height: 300px; padding: 22px; }
.interview-empty, .interview-empty-state p { margin: 0; color: #7d8995; font-size: 11px; line-height: 1.5; }
.interview-empty-state { min-height: 255px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 30px; text-align: center; }
.interview-empty-state > span { color: #65b8d7; font-size: 30px; }
.interview-empty-state strong { font-size: 14px; }
.session-detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.session-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.session-detail-head small { color: #7b8995; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.session-detail-head h3 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.02em; }
.lobby-safety-note { display: flex; gap: 10px; margin-top: 17px; padding: 12px 13px; border-radius: 8px; color: #4b6172; background: #edf5f8; }
.lobby-safety-note > span { margin-top: 3px; color: var(--cyan); font-size: 8px; }
.lobby-safety-note p { margin: 0; font-size: 10px; line-height: 1.5; }
.invitation-form { display: grid; gap: 9px; align-items: end; margin-top: 15px; }
.invitation-form .field-stack { margin: 0; }
.invitation-form select { width: 100%; font-size: 12px; }
.invite-result { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 12px; padding: 12px; border: 1px solid #b9dac8; border-radius: 8px; background: #f0f8f3; }
.invite-result > div { min-width: 0; display: grid; gap: 4px; }
.invite-result small { color: #527363; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.invite-result strong { overflow: hidden; color: #24583b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.invitation-history { display: grid; gap: 6px; margin-top: 12px; }
.invitation-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 38px; padding: 7px 10px; border: 1px solid #e0e6eb; border-radius: 7px; }
.invitation-row > span { min-width: 0; display: grid; gap: 2px; }
.invitation-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.invitation-row small { color: #7b8894; font-size: 9px; text-transform: capitalize; }
.invitation-row button, .participant-row button { min-height: 28px; padding: 0 8px; border: 1px solid #d4dde4; border-radius: 5px; color: #6b4b50; background: white; font-size: 9px; font-weight: 750; cursor: pointer; }
.invitation-row button:hover, .participant-row button:hover { border-color: #cf8a8e; color: #9d343c; }
.roster-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.roster-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.roster-heading h3 { margin: 0; font-size: 12px; }
.roster-heading span { color: #7c8994; font-size: 10px; }
.participant-list { display: grid; gap: 7px; }
.participant-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 42px; padding: 8px 10px; border: 1px solid #e0e6eb; border-radius: 7px; }
.participant-row > span:first-child { display: grid; gap: 2px; }
.participant-row strong { font-size: 11px; }
.participant-row small { color: #7c8995; font-size: 9px; }
.participant-lifecycle { color: #486173; font-size: 9px; font-weight: 800; text-transform: capitalize; }
.producer-zones { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(390px, 1.5fr) minmax(205px, .72fr); gap: 12px; margin-top: 16px; }
.producer-zone { min-width: 0; overflow: hidden; border: 1px solid #dce4ea; border-radius: 10px; background: #fbfcfd; }
.zone-heading { min-height: 58px; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #e1e7ec; background: white; }
.zone-heading small { display: block; margin-bottom: 3px; color: #7e8c98; font-size: 8px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.zone-heading h3 { margin: 0; font-size: 13px; }
.zone-heading > span { color: #6f7e8b; font-size: 9px; font-weight: 750; }
.roster-zone { padding-bottom: 12px; }
.roster-zone .invitation-form, .roster-zone .invite-result, .roster-zone .invitation-history, .roster-zone .participant-list { margin-right: 12px; margin-left: 12px; }
.roster-zone .invitation-form button { width: 100%; }
.roster-zone .invitation-history { max-height: 120px; overflow: auto; }
.roster-zone .participant-list { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.participant-row { position: relative; flex-wrap: wrap; }
.participant-row > span:first-child { min-width: 0; flex: 1 1 95px; }
.participant-device-state { display: flex; gap: 5px; width: 100%; color: #748391; font-size: 8px; }
.participant-device-state span { padding: 3px 5px; border-radius: 4px; background: #edf1f4; }
.participant-device-state .is-ready { color: #246e4b; background: #e7f5ed; }
.participant-device-state .is-locked { color: #8b353b; background: #fff0f1; }
.participant-stage-button { flex: 1 1 auto; color: #315c70 !important; }
.participant-stage-button.is-included { color: #69411b !important; border-color: #e6bd81 !important; background: #fff8ec !important; }
.participant-microphone-button { flex: 1 1 auto; color: #315c70 !important; }
.participant-microphone-button.is-locked { color: #9d343c !important; border-color: #e2a4a8 !important; background: #fff0f1 !important; }
.participant-screen-button { flex: 1 1 auto; color: #12677e !important; border-color: #9bd0dc !important; background: #eefbfe !important; }
.participant-screen-button.is-selected { color: #fff !important; border-color: #167b96 !important; background: #167b96 !important; }
.preview-zone { background: #f7f9fb; }
.preview-zone-heading { display: grid; grid-template-columns: minmax(95px,1fr) auto minmax(130px,1fr); }
.preview-quality-control { display: grid; gap: 4px; justify-items: center; }
.preview-quality-control > span { color: #7a8995; font-size: 7px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.preview-quality-picker { display: inline-flex; overflow: hidden; border: 1px solid #d2dbe2; border-radius: 5px; background: #f5f8fa; }
.preview-quality-picker button { min-width: 39px; min-height: 24px; padding: 0 7px; border: 0; border-right: 1px solid #d2dbe2; color: #657584; background: transparent; font-size: 8px; font-weight: 800; cursor: pointer; }
.preview-quality-picker button:last-child { border-right: 0; }
.preview-quality-picker button:hover { color: #174e64; background: #edf7fa; }
.preview-quality-picker button:focus-visible { position: relative; z-index: 1; outline: 2px solid #56b8d7; outline-offset: -2px; }
.preview-quality-picker button.is-active { color: #124b61; background: #dff3f9; box-shadow: inset 0 -2px 0 #42a9cc; }
.preview-connection { position: relative; padding-left: 12px; }
.preview-zone-heading .preview-connection { justify-self: end; }
.preview-connection::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: #87939e; transform: translateY(-50%); }
.preview-connection.is-connected::before { background: var(--good); box-shadow: 0 0 0 3px rgba(41,163,106,.12); }
.interview-preview-stage { position: relative; aspect-ratio: 16/9; margin: 13px; overflow: hidden; border-radius: 8px; background: #0d2234; box-shadow: 0 10px 25px rgba(16,36,56,.17); }
.preview-safety-label { position: absolute; z-index: 5; top: 9px; left: 9px; display: flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; color: white; background: rgba(7,18,29,.82); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.preview-safety-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.interview-video-grid { width: 100%; height: 100%; display: grid; gap: 3px; place-items: stretch; }
.interview-video-grid.layout-solo, .interview-video-grid.layout-auto:has(.interview-video-tile:only-child) { grid-template-columns: 1fr; }
.interview-video-grid.layout-side_by_side { grid-template-columns: repeat(2, 1fr); }
.interview-video-grid.layout-grid, .interview-video-grid.layout-auto { grid-template-columns: repeat(2, 1fr); }
.interview-video-grid.layout-presentation { grid-template-columns: minmax(0, 78%) repeat(2, minmax(46px, 11%)); grid-template-rows: repeat(var(--camera-rows, 1), minmax(0, 1fr)); }
.interview-video-tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #18384f; }
.interview-video-tile video { width: 100%; height: 100%; display: block; object-fit: contain; background: #050d14; }
.interview-video-grid.is-mirrored .interview-video-tile:not(.screen-share-tile) video { transform: scaleX(-1); }
.interview-video-grid.layout-presentation .screen-share-tile { grid-column: 1; grid-row: 1 / -1; background: #020609; }
.screen-share-tile > span { right: 9px; bottom: 8px; padding: 5px 7px; font-weight: 750; }
.interview-video-tile > span { position: absolute; right: 8px; bottom: 8px; max-width: calc(100% - 16px); overflow: hidden; padding: 4px 6px; border-radius: 4px; color: white; background: rgba(7,18,29,.75); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.preview-studio-logo { position: absolute; z-index: 4; top: 42px; right: 13px; width: 74px; height: auto; opacity: .86; filter: drop-shadow(0 2px 6px rgba(0,0,0,.32)); }
.preview-placeholder { grid-column: 1 / -1; display: grid; place-content: center; justify-items: center; gap: 5px; padding: 30px; color: #9fb7c7; text-align: center; }
.preview-placeholder > span { color: #5c8da8; font-size: 24px; }
.preview-placeholder strong { color: #d7e5ec; font-size: 11px; }
.preview-placeholder p { margin: 0; font-size: 9px; }
.preview-lower-third { position: absolute; z-index: 4; left: 18px; bottom: 17px; max-width: 66%; display: grid; gap: 2px; padding: 8px 12px; border-left: 4px solid #59c5e8; color: white; background: rgba(7,25,39,.88); box-shadow: 0 5px 18px rgba(0,0,0,.22); }
.preview-lower-third strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.preview-lower-third span { overflow: hidden; color: #bcd4e0; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.preview-holding { position: absolute; z-index: 6; inset: 0; display: grid; place-content: center; gap: 5px; color: white; background: linear-gradient(135deg, #102438, #1c4b65); text-align: center; }
.preview-holding strong { font-size: 18px; }
.preview-holding span { color: #b8d1de; font-size: 9px; }
.preview-toolbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 0 13px 12px; }
.layout-picker { display: flex; flex-wrap: wrap; gap: 4px; }
.layout-picker button { min-height: 28px; padding: 0 8px; border: 1px solid #d2dbe2; border-radius: 5px; color: #657584; background: white; font-size: 8px; font-weight: 750; cursor: pointer; }
.layout-picker button.is-active { color: #124b61; border-color: #8dc9dd; background: #eaf7fb; }
.monitor-toggle { color: #667582; font-size: 8px; white-space: nowrap; }
.monitor-toggle input { vertical-align: middle; accent-color: var(--nav); }
.composition-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; padding: 12px 13px; border-top: 1px solid #e0e6eb; background: white; }
.composition-fields label:not(.compact-check) { display: grid; gap: 5px; color: #647380; font-size: 8px; font-weight: 750; }
.composition-fields input[type="text"], .composition-fields input:not([type]) { min-width: 0; min-height: 32px; padding: 0 8px; border: 1px solid #d1d9e0; border-radius: 5px; color: var(--ink); font-size: 9px; }
.compact-check { display: flex; gap: 6px; align-items: center; color: #526575; font-size: 8px; }
.compact-check input { accent-color: var(--nav); }
.programme-zone { padding-bottom: 12px; background: #f8fafb; }
.programme-source-card { display: grid; gap: 5px; margin: 12px; padding: 13px; border: 1px solid #c9dce5; border-radius: 8px; background: #edf7fa; }
.programme-source-card small { color: #607987; font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.programme-source-card strong { font-size: 14px; text-transform: capitalize; }
.programme-source-card span { color: #687b87; font-size: 8px; line-height: 1.4; }
.programme-facts { display: grid; gap: 8px; margin: 0 12px 12px; }
.programme-facts div { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid #e0e6eb; }
.programme-facts dt { color: #778590; font-size: 8px; }
.programme-facts dd { margin: 0; color: #304557; font-size: 8px; font-weight: 800; text-align: right; text-transform: capitalize; }
.readiness-card { margin: 12px; padding: 12px; border: 1px solid #dfe5ea; border-radius: 8px; background: white; }
.readiness-card > strong { font-size: 9px; }
.readiness-card ul { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.readiness-card li { position: relative; padding-left: 18px; color: #7a8792; font-size: 8px; }
.readiness-card li::before { content: ""; position: absolute; left: 0; top: 0; width: 10px; height: 10px; border: 1px solid #bfc9d1; border-radius: 50%; }
.readiness-card li.is-ready { color: #2d6448; }
.readiness-card li.is-ready::before { content: "✓"; display: grid; place-items: center; color: white; border-color: var(--good); background: var(--good); font-size: 7px; }
.phase-boundary-note { display: grid; gap: 4px; margin: 12px; padding: 11px; border-left: 3px solid var(--warning); color: #6b5836; background: #fff7e9; }
.phase-boundary-note strong { font-size: 9px; }
.phase-boundary-note span { font-size: 8px; line-height: 1.45; }
.handoff-operation { display: grid; gap: 7px; margin: 12px; padding: 12px; border: 1px solid #acd4e2; border-radius: 8px; background: #eef9fc; }
.handoff-operation[hidden] { display: none; }
.handoff-operation[data-status="failed_safe"] { border-color: #b7d8c6; background: #f1faf5; }
.handoff-operation[data-status="failed_unsafe"] { border-color: #e4a1a6; background: #fff2f3; }
.handoff-operation-heading { display: flex; align-items: center; gap: 7px; }
.handoff-operation-heading strong { font-size: 9px; }
.handoff-operation-light { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(33,168,216,.11); }
.handoff-operation[data-status="completed"] .handoff-operation-light,
.handoff-operation[data-status="failed_safe"] .handoff-operation-light { background: var(--good); box-shadow: 0 0 0 4px rgba(52,171,116,.11); }
.handoff-operation[data-status="failed_unsafe"] .handoff-operation-light { background: var(--bad); box-shadow: 0 0 0 4px rgba(181,65,74,.11); }
.handoff-operation p { margin: 0; color: #58717f; font-size: 8px; line-height: 1.45; }
.handoff-progress { display: grid; gap: 5px; margin: 2px 0 0; padding: 0; list-style: none; }
.handoff-progress li { position: relative; padding-left: 17px; color: #84919a; font-size: 8px; }
.handoff-progress li::before { content: ""; position: absolute; left: 1px; top: 2px; width: 7px; height: 7px; border: 1px solid #b8c5cd; border-radius: 50%; }
.handoff-progress li.is-current { color: #176985; font-weight: 800; }
.handoff-progress li.is-current::before { border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 0 3px rgba(33,168,216,.12); }
.handoff-progress li.is-complete { color: #347252; }
.handoff-progress li.is-complete::before { border-color: var(--good); background: var(--good); }
.handoff-history { margin: 12px; border-top: 1px solid #dfe6eb; }
.handoff-history summary { padding: 10px 0 5px; color: #496272; font-size: 8px; font-weight: 850; cursor: pointer; list-style-position: inside; }
.handoff-history ol { display: grid; gap: 7px; max-height: 190px; margin: 6px 0 0; padding: 0 0 2px; overflow-y: auto; list-style: none; }
.handoff-history li { display: grid; gap: 2px; padding: 7px 8px; border-left: 2px solid #aac6d2; border-radius: 0 5px 5px 0; background: #f1f6f8; }
.handoff-history li[data-status="warning"], .handoff-history li[data-status="failed_safe"] { border-left-color: var(--warning); background: #fff8eb; }
.handoff-history li[data-status="error"], .handoff-history li[data-status="failed_unsafe"] { border-left-color: var(--bad); background: #fff2f3; }
.handoff-history strong { color: #314b5c; font-size: 8px; }
.handoff-history span { color: #74838e; font-size: 7px; line-height: 1.35; }
.handoff-history-empty { border-left-color: #d9e1e6 !important; color: #7f8d96; background: transparent !important; }
.handoff-actions { display: grid; gap: 7px; margin: 12px; }
.handoff-actions .handoff-primary { width: 100%; min-height: 34px; font-size: 9px; }
.handoff-emergency { min-height: 30px; border: 1px solid #dba5a8; border-radius: 6px; color: #9d343c; background: white; font-size: 8px; font-weight: 800; cursor: pointer; }
.handoff-emergency:hover:not(:disabled) { border-color: #b5414a; background: #fff2f3; }
.handoff-emergency:disabled { cursor: not-allowed; opacity: .5; }
.handoff-actions p { margin: 0; color: #74838e; font-size: 8px; line-height: 1.45; }

.visual-library { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.visual-library-group { padding-top: 4px; }
.visual-library-group + .visual-library-group { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.library-group-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 13px; }
.library-group-heading h3 { margin: 0 0 4px; font-size: 14px; letter-spacing: -.01em; }
.library-group-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.library-group-heading a { flex: 0 0 auto; color: #167da3; font-size: 11px; font-weight: 750; text-decoration: none; }
.library-group-heading a:hover { text-decoration: underline; }
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.theme-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid #d9e0e6; border-radius: 9px; background: white; cursor: pointer; text-align: left; transition: transform .16s, border-color .16s, box-shadow .16s; }
.theme-card:hover { transform: translateY(-2px); border-color: #aebdca; box-shadow: 0 7px 20px rgba(31,51,68,.09); }
.theme-card.is-selected { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(33,168,216,.16); }
.theme-preview { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: #dfe7ec; pointer-events: none; }
.theme-preview iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; border: 0; transform: scale(var(--thumbnail-scale, .2)); transform-origin: 0 0; }
.live-template-badge { position: absolute; z-index: 2; top: 8px; left: 8px; min-height: 20px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 4px; color: white; background: rgba(16,36,56,.9); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 2px 8px rgba(0,0,0,.22); }
.live-template-badge::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--coral); }
.template-library-state { grid-column: 1 / -1; margin: 0; padding: 22px; border: 1px dashed #ccd7df; border-radius: 8px; color: #71808d; background: #f8fafb; font-size: 11px; text-align: center; }
.theme-meta { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 13px; }
.theme-meta > span:first-child { min-width: 0; display: grid; gap: 3px; }
.theme-meta strong { font-size: 12px; }
.theme-meta small { overflow: hidden; color: #7b8793; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.selection-mark { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #cdd6dd; border-radius: 50%; color: transparent; font-size: 11px; }
.theme-card.is-selected .selection-mark { color: white; border-color: var(--cyan); background: var(--cyan); }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 10; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: 8px; color: white; background: var(--nav); box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 12px; font-weight: 650; }
.toast.is-bad { background: #9d343c; }
.has-app-confirmation { overflow: hidden; }
.app-confirmation { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(10,27,42,.58); backdrop-filter: blur(3px); }
.app-confirmation[hidden] { display: none; }
.app-confirmation-dialog { width: min(440px, 100%); padding: 26px; border: 1px solid #cbd8df; border-radius: 12px; background: white; box-shadow: 0 24px 70px rgba(5,20,33,.28); }
.app-confirmation-kicker { display: block; margin-bottom: 8px; color: #1682aa; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.app-confirmation-dialog h2 { margin: 0 0 10px; font-size: 21px; letter-spacing: -.025em; }
.app-confirmation-dialog > p { margin: 0; color: #526675; font-size: 12px; line-height: 1.55; }
.app-confirmation-safety { margin-top: 14px !important; padding: 10px 12px; border-left: 3px solid var(--cyan); background: #eff8fb; }
.app-confirmation-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.app-confirmation-actions .primary-button, .app-confirmation-actions .secondary-button { min-height: 38px; padding: 0 16px; }
#app-confirmation-submit.is-danger { border-color: #a83d46; background: #a83d46; }

.login-page { min-height: 100vh; background: #e9eef2; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .9fr) minmax(480px, 1.1fr); }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(50px, 8vw, 110px); color: white; background: #102438; }
.login-brand::after { content: ""; position: absolute; width: 520px; height: 520px; right: -240px; bottom: -260px; border: 82px solid rgba(33,168,216,.16); border-radius: 50%; }
.login-brand img { width: 135px; margin-bottom: 54px; }
.login-brand .eyebrow { color: #7ecae5; }
.login-brand h1 { max-width: 520px; margin-bottom: 18px; font-size: clamp(42px, 5vw, 72px); line-height: .98; letter-spacing: -.06em; }
.login-brand > p:not(.eyebrow) { max-width: 500px; color: #b7c6d2; line-height: 1.6; }
.login-signal { display: flex; align-items: center; gap: 5px; height: 44px; margin-top: 55px; }
.login-signal i { width: 4px; height: 16px; border-radius: 3px; background: #5ac5e9; }
.login-signal i:nth-child(3n) { height: 38px; }.login-signal i:nth-child(4n) { height: 26px; }.login-signal i:nth-child(5n) { height: 32px; }
.login-form-wrap { display: grid; place-items: center; padding: 48px; }
.login-form { width: min(400px, 100%); padding: 36px; border: 1px solid #d7dfe5; border-radius: 12px; background: white; box-shadow: 0 20px 50px rgba(32,51,68,.08); }
.login-form h2 { margin-bottom: 10px; font-size: 24px; }
.login-intro { margin-bottom: 28px; color: var(--muted); font-size: 13px; }
.login-form label { display: grid; gap: 8px; margin-bottom: 17px; color: #4f5d6b; font-size: 12px; font-weight: 700; }
.login-form input { min-height: 44px; padding: 0 12px; border: 1px solid #cbd5dc; border-radius: 7px; outline: none; }
.login-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(33,168,216,.13); }
.login-submit { width: 100%; min-height: 44px; margin-top: 4px; }
.form-error { min-height: 18px; margin-bottom: 7px; color: var(--bad); font-size: 11px; }
.login-security { margin: 20px 0 0; color: #87929d; font-size: 10px; text-align: center; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 210px minmax(0,1fr); }
  .status-strip { grid-template-columns: repeat(3, 1fr); }
  .status-item-wide, .status-item-right { display: none; }
  .studio-grid { grid-template-columns: 1fr; }
  .interview-grid { grid-template-columns: 1fr; }
  .producer-zones { grid-template-columns: minmax(210px,.7fr) minmax(390px,1.3fr); }
  .programme-zone { grid-column: 1 / -1; display: grid; grid-template-columns: 180px 1fr 1fr; align-items: start; }
  .programme-zone .zone-heading { grid-column: 1 / -1; }
  .session-browser { border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-panel { border-top: 1px solid var(--line); border-left: 0; }
  .theme-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (min-width: 761px) {
  html.is-sidebar-collapsed .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  html.is-sidebar-collapsed .sidebar { padding: 18px 12px 16px; }
  html.is-sidebar-collapsed .brand { gap: 0; padding: 4px 0 18px; }
  html.is-sidebar-collapsed .brand img { width: 44px; }
  html.is-sidebar-collapsed .brand span { display: none; }
  html.is-sidebar-collapsed .sidebar nav { margin-top: 20px; }
  html.is-sidebar-collapsed .nav-item { justify-content: center; gap: 0; padding: 0; font-size: 0; }
  html.is-sidebar-collapsed .nav-icon { width: 20px; font-size: 14px; }
  html.is-sidebar-collapsed .nav-section-group { display: none; }
  html.is-sidebar-collapsed .sidebar-foot { gap: 10px; }
  html.is-sidebar-collapsed .account-mini { display: none; }
  html.is-sidebar-collapsed .connection-mini { justify-content: center; padding: 12px 0; }
  html.is-sidebar-collapsed .connection-mini span:last-child { display: none; }
  html.is-sidebar-collapsed .quiet-button { padding: 0; text-align: center; font-size: 0; }
  html.is-sidebar-collapsed .quiet-button::before { content: "↪"; font-size: 16px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; padding: 16px; flex-direction: row; align-items: center; gap: 16px; }
  .sidebar-toggle { display: none; }
  .brand { padding: 0 16px 0 0; border: 0; }
  .brand img { width: 70px; }.brand span { display: none; }
  .sidebar nav { min-width: 0; margin: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav > .nav-item { flex: 0 0 auto; padding: 0 9px; }
  .nav-section-group, .sidebar-foot { display: none; }
  .workspace { padding: 22px 14px 48px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; flex-wrap: wrap; }.save-state { width: 100%; }
  .status-strip { grid-template-columns: 1fr; }.status-item { border-right: 0; border-bottom: 1px solid var(--line); }.status-item:last-child { border-bottom: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .library-group-heading { align-items: flex-start; flex-direction: column; }
  .segmented { max-width: 100%; }.segmented button { padding: 0 7px; }
  .preview-panel, .settings-panel, .visual-library, .interview-console { padding: 16px; }
  .invitation-form { grid-template-columns: 1fr; }
  .producer-zones { grid-template-columns: 1fr; }
  .preview-zone-heading { grid-template-columns: 1fr auto; row-gap: 9px; }
  .preview-quality-control { grid-column: 1 / -1; grid-row: 2; justify-self: start; justify-items: start; }
  .programme-zone { grid-column: auto; display: block; }
  .invite-result { align-items: stretch; flex-direction: column; }
  .session-create-form > div { grid-template-columns: 1fr; }
  .session-detail-head { align-items: flex-start; flex-direction: column; }
  .session-detail-actions { width: 100%; justify-content: flex-start; }
  .preview-foot { display: none; }
  .theme-grid { grid-template-columns: 1fr; }
  .login-shell { display: block; }.login-brand { min-height: 44vh; padding: 40px 28px; }.login-brand img { margin-bottom: 34px; }.login-brand h1 { font-size: 43px; }.login-signal { display: none; }.login-form-wrap { padding: 28px 16px; }.login-form { padding: 26px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
