/* Podcast Studio design system (light). Tokens first; the older names below
   them alias the new ones so pages not yet restyled follow along. */
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/instrument-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/instrument-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/fonts/jetbrains-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --canvas: #f3f4f2;
  --surface: #ffffff;
  --sunken: #e9ebe8;
  --line: #d6dad6;
  --control-line: #7a837e;
  --ink: #161c1a;
  --ink-muted: #56615c;
  --accent: #0d6a64;
  --accent-hover: #09524d;
  --accent-soft: #dcece9;
  --on-accent: #ffffff;
  --live: #c42d1b;
  --live-soft: #fbe4df;
  --on-live: #ffffff;
  --ok: #1d7438;
  --ok-soft: #dcefe0;
  --warn: #8a5600;
  --warn-soft: #fbefd3;
  --danger: #b3261e;
  --danger-soft: #f8dedb;
  --stage: #0e100f;
  --meter-safe: #2f9a52;
  --meter-hot: #e3a21a;
  --meter-clip: var(--live);
  --scrim: rgba(14, 16, 15, .55);
  --shadow-overlay: 0 12px 32px rgba(14, 16, 15, .18), 0 2px 6px rgba(14, 16, 15, .08);
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --control-sm: 28px;
  --control-md: 32px;
  --control-lg: 40px;

  /* Older names, kept for the pages that still use them. */
  --fg: var(--ink);
  --bg: var(--canvas);
  --muted: var(--ink-muted);
  --link: var(--accent);
  --border: var(--line);
  --panel-bg: var(--surface);
  --success: var(--ok);
  --error: var(--danger);
}

html, body { margin: 0; padding: 0; color: var(--ink); background: var(--canvas); font: 400 15px/22px var(--font-ui); }
.container { width: 95%; margin: 0 auto; padding: 2rem 0 3rem; }
h1 { font-size: 1.75rem; line-height: 2.125rem; font-weight: 600; letter-spacing: -.01em; margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .75rem 2.5%; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-footer { margin-top: 2rem; padding: 1rem 2.5%; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: .8rem; line-height: 1rem; }
.site-footer p { margin: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1rem; color: var(--ink); text-decoration: none; }
.brand img { display: block; }
.brand:hover { color: var(--ink); }
.site-header nav { display: flex; align-items: center; gap: 4px; }
.site-header nav a { padding: 6px 10px; border-radius: var(--radius-md); font-size: .8125rem; line-height: 1.125rem; font-weight: 500; color: var(--ink-muted); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); background: var(--sunken); }
.site-header nav a[hidden] { display: none; }
.muted { color: var(--ink-muted); }
.error { color: var(--danger); }
.success { color: var(--ok); }
/* Section headings inside a page: the small uppercase label. */
.container > h2 { margin: 2rem 0 .5rem; font-size: .6875rem; line-height: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.page-intro { margin: -1rem 0 1.5rem; max-width: 75ch; font-size: .875rem; }
.container > p.muted { font-size: .8125rem; }
.container > .panel > p { margin: 0; }
.overline { margin: 0 0 .5rem; font-size: .6875rem; line-height: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }

.link-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; }

[hidden] { display: none !important; }

.create-scene-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin: 1.25rem 0; }
.create-scene-form .field { flex: 1 1 260px; }
.create-scene-form.panel { flex-direction: row; margin: 0 0 1.5rem; padding: 1rem; }
.new-scene-intro { flex: 1 1 100%; display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.new-scene-intro p { margin: 0; font-size: .8125rem; }
.panel.notice-panel { background: var(--accent-soft); border-color: var(--accent-soft); }
.notice-panel label { color: var(--ink); }

#create-message { font-size: .8125rem; }
#create-message:empty { display: none; }

/* A list of rows in one panel (scenes, workspaces, members, invites):
   1px gaps over a line-colored panel draw the dividers. */
.scene-groups { display: flex; flex-direction: column; gap: 1.5rem; }
.scene-groups h2.overline { margin-bottom: .5rem; }
.scene-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.scene-groups .scene-list { margin-bottom: 0; }
.scene-list:empty { display: none; }
.scene-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  background: var(--surface);
  padding: .75rem 1rem;
}
.scene-row a { font-weight: 600; color: var(--ink); text-decoration: none; }
.scene-row a:hover { color: var(--accent); }
.scene-row .scene-name { font-size: 1rem; line-height: 1.375rem; }
.scene-row .quiet-link { font-weight: 500; color: var(--accent); }
.scene-row .quiet-link:hover { color: var(--accent-hover); }
.scene-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
button.quiet.danger-text { color: var(--danger); }
button.quiet.danger-text:hover:not(:disabled) { background: var(--danger-soft); }

.inline-form { display: flex; align-items: center; gap: .5rem; flex: 1; flex-wrap: wrap; }
.inline-form input { flex: 1; }
.inline-error { width: 100%; font-size: .85rem; margin-top: .5rem; }

/* Page title row (Studio, Recordings, Layout editor). */
.studio-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.studio-heading .overline { margin-bottom: .25rem; }
.studio-heading-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 1rem; }
.studio-heading .studio-heading-links { margin-bottom: 0; }

/* Text-style action (the design system's quiet button), used for links in
   the title row. */
.nav-pill-link, .quiet-link {
  display: inline-flex;
  align-items: center;
  height: var(--control-md);
  box-sizing: border-box;
  padding: 0 8px;
  border-radius: var(--radius-md);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.nav-pill-link:hover, .quiet-link:hover { background: var(--accent-soft); color: var(--accent-hover); }

/* Panel: the one container. Hairline, no shadow. */
.panel, .settings-bar { display: flex; flex-direction: column; gap: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: .75rem 1rem; }
.settings-bar { margin-bottom: .75rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.panel-title { margin: 0; font-size: 1rem; line-height: 1.375rem; font-weight: 600; }
.well { background: var(--stage); border-radius: var(--radius-lg); aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .8125rem; line-height: 1.125rem; font-weight: 500; color: var(--ink-muted); }
.settings-form { display: flex; flex-direction: column; gap: 1rem; }
.settings-form > button[type="submit"] { align-self: flex-end; }
.settings-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.settings-group legend { padding: 0; margin-bottom: .5rem; font-size: .6875rem; line-height: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.settings-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; gap: .75rem 1rem; }
.settings-fields .field { min-width: 0; }
.clip-fields { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="file"], select, textarea {
  min-height: var(--control-md);
  box-sizing: border-box;
  padding: 0 10px;
  font: 400 .875rem/1.25rem var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-md);
}
input[type="file"] { padding: 4px 6px; }
textarea { padding: 6px 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[readonly] { background: var(--sunken); }
input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); }

.clip-field { display: flex; flex-direction: column; gap: 4px; font-size: .8125rem; color: var(--ink-muted); }
.clip-label { display: flex; align-items: center; gap: .375rem; }
.clip-controls { display: flex; gap: .5rem; }
.clip-controls input { flex: 1; min-width: 0; }

/* Info tip: a small "i" button whose explanation shows on hover or focus
   (keyboard and tap both focus it). */
.info-tip { position: relative; display: inline-flex; }
button.info-tip-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; min-height: 0; padding: 0;
  font: 600 .6875rem/1 var(--font-ui); font-style: italic;
  color: var(--ink-muted); background: var(--surface);
  border: 1px solid var(--control-line); border-radius: 50%; cursor: help;
}
button.info-tip-button:hover:not(:disabled), button.info-tip-button:focus-visible { color: var(--accent); background: var(--surface); border-color: var(--accent); }
.info-tip-text {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: -8px;
  width: max-content; max-width: min(280px, 80vw); padding: .5rem .625rem;
  font-size: .8125rem; line-height: 1.125rem; font-weight: 400; color: var(--surface);
  background: var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
  visibility: hidden; opacity: 0; transition: opacity .12s ease;
}
.info-tip:hover .info-tip-text, .info-tip:focus-within .info-tip-text { visibility: visible; opacity: 1; }

.settings-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.settings-meta .url-copy { margin-left: auto; }

input[type="color"] {
  border: 1px solid var(--control-line);
  border-radius: var(--radius-md);
  padding: 2px;
  width: 3rem;
  height: var(--control-md);
  background: var(--surface);
}

/* Button: primary by default; .secondary outlined, .quiet text-only,
   .danger outlined red, .record-button the one red fill. */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-md);
  box-sizing: border-box;
  padding: 0 14px;
  font: 500 .8125rem/1.125rem var(--font-ui);
  white-space: nowrap;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { color: var(--ink); background: var(--surface); border-color: var(--control-line); }
button.secondary:hover:not(:disabled) { background: var(--sunken); border-color: var(--control-line); }
button.quiet { color: var(--accent); background: transparent; border-color: transparent; padding: 0 8px; }
button.quiet:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; }
button.danger { color: var(--danger); background: var(--surface); border-color: var(--danger); }
button.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
button.large { min-height: var(--control-lg); padding: 0 20px; font-size: .9375rem; font-weight: 600; }

#message { font-size: .8125rem; }
#message:empty { display: none; }

.url-copy { display: flex; gap: .5rem; flex: 1 1 280px; min-width: 0; }
.url-copy input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: .75rem; }

.join-links { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.join-link-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.join-link-label { flex: 0 0 4.5rem; font-size: .8rem; color: var(--muted); }

.live-controls { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.live-controls-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.self-video { display: none; width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); background: var(--stage); }
.self-video.visible { display: block; }

/* Control chip: the meter and every label+control pair (gain/camera/mic)
   share one 32px bordered cell, so mismatched controls (a thin meter bar, a
   range input, a <select>) line up as same-sized items on one row. */
.audio-meter, .gain-control {
  height: var(--control-md);
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-md);
}

/* Zone stops sit on the meter's -60..0 dBFS scale (see audio-meter.js):
   -18 dBFS = 70%, -6 dBFS = 90%. The fill is always full-width and gets
   revealed via clip-path, so each zone keeps its own color. The
   ::after gaps mark the zone edges even when the meter is idle. */
.audio-meter { padding: 0 10px; display: flex; align-items: center; gap: 8px; }
.audio-meter-bar { position: relative; width: 180px; height: 10px; border-radius: var(--radius-sm); background: var(--sunken); overflow: hidden; }
.audio-meter-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, transparent calc(70% - 1px), var(--surface) calc(70% - 1px) 70%, transparent 70% calc(90% - 1px), var(--surface) calc(90% - 1px) 90%, transparent 90%); }
.audio-meter-fill { position: absolute; inset: 0; background: linear-gradient(to right, var(--meter-safe) 0 70%, var(--meter-hot) 70% 90%, var(--meter-clip) 90% 100%); clip-path: inset(0 100% 0 0); }
.audio-meter-peak { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--ink); z-index: 1; }
.audio-meter-db { width: 2.6rem; text-align: right; font: 500 .75rem/1rem var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.audio-meter .audio-meter-clip { min-height: 20px; height: 20px; padding: 0 6px; font: 600 .625rem/1 var(--font-ui); letter-spacing: .06em; border: 1px solid var(--control-line); border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); }
.audio-meter .audio-meter-clip:hover:not(:disabled) { background: var(--sunken); border-color: var(--control-line); }
.audio-meter .audio-meter-clip.clipped { background: var(--meter-clip); border-color: var(--meter-clip); color: var(--on-live); }

/* Studio guest rows: name, connection, meter (added as each guest's audio
   arrives - attachGuestMeter in studio.js), volume, join link. */
/* 1px gaps over a line-colored panel draw the dividers, and rows hidden
   for slots outside the layout leave no stray border. */
.guest-list { gap: 1px; padding: 0; overflow: hidden; background: var(--line); }
.guest-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--surface); }
.guest-row-head { display: flex; align-items: baseline; gap: 8px; }
.guest-row-name { font-weight: 600; }
.guest-row-slot { font-size: .75rem; line-height: 1rem; color: var(--ink-muted); }
.guest-meters { display: flex; flex-wrap: wrap; gap: .5rem; }
.guest-meters:empty { display: none; }
.guest-meter { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--ink-muted); }
.guest-meter .guest-meter-label:empty { display: none; }
.guest-meter .guest-volume { width: 100px; }

/* Status pill (take status, recording checks). */
.pill, .checklist-item { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; box-sizing: border-box; padding: 2px 10px; font-size: .75rem; line-height: 1rem; font-weight: 600; border-radius: 999px; background: var(--sunken); color: var(--ink-muted); }
.pill::before, .checklist-item::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill.ok, .checklist-item.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .checklist-item.warn { background: var(--warn-soft); color: var(--warn); }
.pill.fail, .checklist-item.bad { background: var(--danger-soft); color: var(--danger); }

/* Pre-recording checks (recording-checklist.js), in Studio's record panel. */
recording-checklist:not([hidden]) { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.checklist-heading { font-size: .8125rem; font-weight: 600; }
.checklist-heading.ok { color: var(--ok); }
.checklist-heading.warn, .checklist-warning { color: var(--warn); }
.checklist-rows { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.checklist-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.checklist-label { font-size: .8125rem; font-weight: 500; color: var(--ink-muted); }
.checklist-warning { font-size: .8125rem; font-weight: 600; }

/* Studio's left checklist slideout (checklist-drawer.js). Open: wide screens
   make room for it; narrow ones overlay it. */
.drawer-panel {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: 300px; box-sizing: border-box;
  overflow-y: auto; padding: 1rem; background: var(--surface); border-right: 1px solid var(--line);
}
@media (max-width: 899px) { .drawer-panel { box-shadow: var(--shadow-overlay); } }
/* Animated only once the initial (remembered) state is applied - see body.drawer-ready. */
body.drawer-ready .drawer-panel { transition: transform .2s ease; }
checklist-drawer.collapsed .drawer-panel { transform: translateX(-100%); box-shadow: none; }
.drawer-tab {
  position: fixed; top: 50%; left: 0; z-index: 49; transform: translateY(-50%);
  writing-mode: vertical-rl; rotate: 180deg; border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 14px 6px; min-height: 0;
}
checklist-drawer:not(.collapsed) .drawer-tab { display: none; }
@media (min-width: 900px) {
  body.drawer-ready { transition: padding-left .2s ease; }
  body.drawer-open { padding-left: 300px; }
}
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.drawer-header h2 { margin: 0; font-size: 1.25rem; line-height: 1.625rem; font-weight: 600; }
.drawer-panel section { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .625rem; }
.drawer-panel h3 { margin: 0; font-size: .6875rem; line-height: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.drawer-section-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.drawer-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.drawer-items li { display: flex; align-items: center; gap: .3rem; }
.drawer-items label { flex: 1; flex-direction: row; align-items: center; gap: 10px; padding: 6px 4px; border-radius: var(--radius-md); font-size: .9375rem; line-height: 1.375rem; font-weight: 400; color: var(--ink); cursor: pointer; }
.drawer-items label:hover { background: var(--sunken); }
.drawer-items li.done span { color: var(--ink-muted); text-decoration: line-through; }
.drawer-items input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
.drawer-items input[type="text"], .drawer-add input { flex: 1; min-width: 0; }
.drawer-add { display: flex; gap: .5rem; }
.drawer-add[hidden] { display: none; }
.icon-button { min-height: var(--control-sm); padding: 0 8px; }
.link-button { min-height: var(--control-sm); padding: 0 8px; color: var(--accent); background: transparent; border-color: transparent; font-weight: 500; }
.link-button:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; }
.drawer-panel > section > .link-button { align-self: flex-start; }
.drawer-error { font-size: .8rem; }

.gain-control { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 500; color: var(--ink-muted); padding: 0 10px; }
.gain-control input[type="range"] { width: 140px; }
.gain-control select { min-height: 0; max-width: 200px; border: 0; padding: 0; background: none; font-size: .8125rem; font-weight: 500; }
/* Video / Audio cards under the camera: side by side when there's room,
   stacked (Video first) when not. Each is a label | control grid, so rows
   line up; camera-effects.js adds its rows to the Video grid. */
.av-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: .75rem; align-items: start; }
.av-card { min-width: 0; padding: .75rem 1rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.av-card-title { margin: 0 0 .75rem; font-size: .6875rem; line-height: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.av-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .5rem .75rem; align-items: center; }
.av-label { font-size: .8125rem; font-weight: 500; color: var(--ink-muted); }
.av-rows select { width: 100%; min-width: 0; }
.av-rows .audio-meter { min-width: 0; }
.av-rows .audio-meter-bar { flex: 1; width: auto; min-width: 60px; }
.av-slider, .av-inline { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.av-slider input[type="range"] { flex: 1; min-width: 0; }
.av-inline select { flex: 1 1 auto; width: auto; }
.av-slider .gain-value { min-width: 4.2rem; } /* every readout one width, so the sliders end in line */
.av-rows input[type="color"] { width: 40px; height: 28px; padding: 2px; cursor: pointer; }
.av-rows .av-full { grid-column: 1 / -1; }
camera-effects { display: contents; }
.camera-effects-error { font-size: .8125rem; color: var(--danger); }
.camera-effects-error:empty { display: none; }
.gain-value { display: inline-block; min-width: 2.6rem; text-align: right; font: 500 .75rem/1rem var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.gain-value.gain-db { min-width: 4.2rem; } /* fits "+17.5 dB" without the row shifting */

/* On-air tally (recording indicator): the one place the host checks from
   across the desk. Grey "Standby" when idle; red "On air", pulsing, while a
   take is rolling (studio.js toggles .on-air). */
.recording-indicator { display: inline-flex; align-items: center; gap: 12px; height: var(--control-lg); box-sizing: border-box; padding: 0 14px 0 12px; border-radius: var(--radius-md); background: var(--sunken); color: var(--ink-muted); }
.recording-indicator .dot { width: 12px; height: 12px; border-radius: 999px; background: var(--control-line); }
.recording-indicator .tally-word { min-width: 5.6em; font-size: .6875rem; line-height: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
#recording-timer { font: 500 1.375rem/1.625rem var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.recording-indicator.on-air { background: var(--live-soft); color: var(--live); }
.recording-indicator.on-air .dot { background: var(--live); animation: tally-pulse 1.6s ease-in-out infinite; }
.recording-indicator.on-air #recording-timer { color: var(--live); }
@keyframes tally-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .recording-indicator .dot { animation: none; } }

.record-inline { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.record-inline a { font-weight: 600; font-size: .8125rem; }
button.record-button { min-height: var(--control-lg); padding: 0 20px; font-size: .9375rem; font-weight: 600; color: var(--on-live); background: var(--live); border-color: var(--live); }
button.record-button::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: currentColor; }
button.record-button:hover:not(:disabled) { background: var(--live); border-color: var(--live); filter: brightness(.92); }
#stop-recording-button, #go-live-button { min-height: var(--control-lg); padding: 0 20px; font-size: .9375rem; font-weight: 600; }

/* Segmented control: two joined buttons, the active one filled. */
.mode-toggle { display: inline-flex; margin-bottom: .75rem; }
.mode-button {
  background: var(--surface);
  border: 1px solid var(--control-line);
  color: var(--ink);
  font-weight: 600;
  padding: 0 1rem;
  border-radius: 0;
}
.mode-button:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.mode-button:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; margin-left: -1px; }
.mode-button:hover:not(:disabled) { background: var(--sunken); border-color: var(--control-line); }
.mode-button.active, .mode-button.active:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Layout editor: tabs + history/save on top, then three panes
   (add + layers | canvas | properties). Stacks below 1100px. */
.editor-topbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.editor-topbar .mode-toggle { margin-bottom: 0; }
.editor-actions { display: flex; align-items: center; gap: .5rem; }
#save-status { font-size: .8125rem; margin: 0 .25rem; }
#save-status.unsaved { color: var(--warn); font-weight: 600; }
.mode-button.dirty::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--meter-hot); }
/* Layout tabs: the scene's layouts (first = default), then screen share. */
.layout-switcher { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.layout-switcher .mode-toggle { flex-wrap: wrap; }
.mode-button + .mode-button { margin-left: -1px; }
.mode-button.share-tab { margin-left: .5rem; border-radius: var(--radius-md); }
.mode-button:has(+ .share-tab) { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.mode-button:first-child:has(+ .share-tab) { border-radius: var(--radius-md); }
.default-badge { margin-left: .375rem; font-size: .6875rem; font-weight: 500; opacity: .75; }
.tile-menu.layout-menu summary { font-size: .8125rem; font-weight: 600; color: var(--ink); }
.tile-menu.layout-menu .tile-menu-items { left: 0; right: auto; }
.editor-topbar + #message { margin-bottom: .75rem; }

.editor-shell { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr) minmax(220px, 280px); gap: 1rem; align-items: start; }
.editor-pane { gap: 1rem; min-width: 0; }
.editor-pane .overline { margin-bottom: .5rem; }
.editor-center { min-width: 0; }
@media (max-width: 1100px) {
  .editor-shell { grid-template-columns: minmax(0, 1fr); }
  .editor-center { order: -1; }
}

.add-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.layers-hint { margin-left: .25rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.layers-empty { margin: 0; font-size: .8125rem; }
.layers-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.layer-row { display: flex; align-items: center; border-radius: var(--radius-md); }
.layer-row:hover { background: var(--sunken); }
.layer-row.selected { background: var(--accent-soft); }
button.layer-name { flex: 1; min-width: 0; justify-content: flex-start; padding: 0 8px; color: var(--ink); background: transparent; border-color: transparent; font-weight: 500; }
button.layer-name:hover:not(:disabled) { background: transparent; border-color: transparent; }
.layer-row.is-hidden .layer-name { opacity: .5; }
.layer-type { flex: 0 0 3.5rem; font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); text-align: left; }
.layer-text { overflow: hidden; text-overflow: ellipsis; }
button.layer-toggle { min-height: var(--control-sm); padding: 0 6px; font-size: .75rem; }
button.layer-toggle[aria-pressed="true"] { color: var(--warn); }

/* Presets and copy-from-scene (left pane). Thumbnails draw a layout as
   boxes: cameras teal, screen share dashed, text and images muted. */
.preset-subhead { margin: 0 0 .375rem; font-size: .75rem; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; margin-bottom: .75rem; }
button.preset-tile { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 0; height: auto; padding: 6px; white-space: normal; text-align: left; color: var(--ink); background: var(--surface); border-color: var(--line); font-size: .75rem; line-height: 1rem; }
button.preset-tile:hover:not(:disabled) { background: var(--sunken); border-color: var(--control-line); }
.preset-thumb { position: relative; width: 100%; background: var(--stage); border-radius: var(--radius-sm); overflow: hidden; }
.preset-thumb span { position: absolute; box-sizing: border-box; }
.thumb-camera { background: var(--accent); border: 1px solid rgba(255, 255, 255, .5); border-radius: 2px; }
.thumb-screenshare { border: 1px dashed rgba(255, 255, 255, .7); }
.thumb-text { background: rgba(255, 255, 255, .45); }
.thumb-image { background: rgba(255, 255, 255, .25); }
.saved-presets { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.saved-preset { display: flex; align-items: flex-start; gap: 4px; }
.saved-preset .preset-tile { flex: 1; min-width: 0; display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto; column-gap: .5rem; align-items: center; }
.saved-preset .preset-thumb { grid-row: 1 / 3; }
.preset-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.preset-by { font-size: .6875rem; }
.preset-form { display: flex; gap: .5rem; }
.preset-form input { flex: 1; min-width: 0; }
.preset-form.stacked { flex-direction: column; }
.preset-form[hidden] { display: none; }

.share-status { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }

#layout-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--stage);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

/* Same font and element styling as scene.html, so the canvas previews
   what OBS shows. */
#layout-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  font-family: system-ui, -apple-system, sans-serif;
  --ui-scale: 1;
}

.bg-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
#editor-elements { position: absolute; inset: 0; }

.lt-el { position: absolute; box-sizing: border-box; cursor: move; }
.lt-el.locked { cursor: default; }
.lt-el:hover { outline: calc(1px * var(--ui-scale)) dashed rgba(255, 255, 255, .7); }
.lt-cam { border-radius: 8px; overflow: hidden; background: #1c2421; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; }
.lt-cam-name { color: rgba(255, 255, 255, .35); font-size: 40px; font-weight: 600; }
.lt-share { border: 3px dashed rgba(255, 255, 255, .5); border-radius: 8px; background: #000; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .6); font-size: 32px; font-weight: 600; }
.lt-text { display: flex; align-items: center; font-weight: 600; line-height: 1.1; white-space: pre-wrap; overflow: hidden; }
.lt-image img { display: block; width: 100%; height: 100%; }

#selection-box {
  position: absolute;
  box-sizing: border-box;
  outline: calc(2px * var(--ui-scale)) solid var(--meter-hot);
  pointer-events: none;
  z-index: 5;
}
#selection-box.locked { outline-style: dashed; }
#selection-box.locked .sel-handle { display: none; }
.sel-handle {
  position: absolute;
  width: calc(12px * var(--ui-scale));
  height: calc(12px * var(--ui-scale));
  margin: calc(-6px * var(--ui-scale)) 0 0 calc(-6px * var(--ui-scale));
  box-sizing: border-box;
  background: var(--surface);
  border: calc(2px * var(--ui-scale)) solid var(--meter-hot);
  border-radius: calc(2px * var(--ui-scale));
  pointer-events: auto;
}
.sel-handle[data-dir="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.sel-handle[data-dir="n"] { left: 50%; top: 0; cursor: ns-resize; }
.sel-handle[data-dir="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.sel-handle[data-dir="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.sel-handle[data-dir="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.sel-handle[data-dir="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.sel-handle[data-dir="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.sel-handle[data-dir="w"] { left: 0; top: 50%; cursor: ew-resize; }

.canvas-hint { margin: .5rem 0 0; font-size: .75rem; }

.snap-toolbar { display: flex; align-items: center; gap: .375rem .75rem; flex-wrap: wrap; margin-bottom: .5rem; font-size: .8125rem; }
.snap-toolbar input[type="number"] { width: 4.5rem; min-height: var(--control-sm); margin-right: -.5rem; }
.snap-toolbar .muted { margin-right: .5rem; }

/* Canvas overlays, all in canvas pixels; line widths divide out the scale. */
#grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .18) calc(1px * var(--ui-scale)), transparent 0),
    linear-gradient(to bottom, rgba(255, 255, 255, .18) calc(1px * var(--ui-scale)), transparent 0);
}
#margin-guide {
  position: absolute;
  pointer-events: none;
  outline: calc(1px * var(--ui-scale)) dashed rgba(255, 255, 255, .6);
  z-index: 4;
}
#snap-guides { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.snap-guide { position: absolute; background: #ff3ea5; }
.snap-guide.v { top: 0; bottom: 0; width: calc(1px * var(--ui-scale)); }
.snap-guide.h { left: 0; right: 0; height: calc(1px * var(--ui-scale)); }
#marquee {
  position: absolute;
  pointer-events: none;
  background: rgba(227, 162, 26, .12);
  outline: calc(1px * var(--ui-scale)) solid var(--meter-hot);
  z-index: 6;
}
#selection-outlines { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.sel-outline { position: absolute; box-sizing: border-box; outline: calc(2px * var(--ui-scale)) solid var(--meter-hot); }
.sel-outline.locked { outline-style: dashed; }

.coverage-warning {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid var(--warn-soft);
  border-radius: var(--radius-lg);
  padding: .5rem .75rem;
  margin: 0 0 .5rem;
  font-size: .85rem;
}

/* Matches scene.html's .name-label; position, font, colors and padding are
   set per label by layout-style.js. */
.name-label {
  position: absolute;
  border-radius: 12px;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}

.props-group { display: flex; flex-direction: column; gap: .75rem; }
.props-title { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geometry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.geometry-fields input { width: 100%; font-family: var(--font-mono); }
.props-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; }
.props-row input[type="number"], .props-row select { width: 100%; }
.props-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.props-subgroup { display: flex; flex-direction: column; gap: .75rem; padding-left: .75rem; border-left: 2px solid var(--line); }
.props-note { margin: 0; font-size: .75rem; }
label.check-field { flex-direction: row; align-items: center; gap: .5rem; color: var(--ink); }
.range-field { display: flex; align-items: center; gap: .5rem; }
.range-field input { flex: 1; }
.range-field output { min-width: 3em; font-family: var(--font-mono); font-size: .75rem; color: var(--ink); text-align: right; }
.arrange-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.align-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.align-buttons button { padding: 0 6px; }

details.obs-preview { display: block; margin-top: 1rem; }

.preview-wrap iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--stage);
}

.takes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 1rem; align-items: start; }

.take-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.take-thumbnail {
  box-sizing: border-box;
  flex: 0 0 220px;
  align-self: flex-start;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--stage);
}

.take-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }

.take-thumbnail.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
  padding: .5rem;
}

.take-info { flex: 1 1 260px; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }

.take-name-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.take-name { font-size: 1rem; line-height: 1.375rem; font-weight: 600; word-break: break-word; }
.rename-input { min-width: 0; flex: 1 1 14rem; }
.take-name-row .take-status { align-self: center; }

.take-meta { font-size: .75rem; line-height: 1rem; font-variant-numeric: tabular-nums; }

.take-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  line-height: 1rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink-muted);
}
.take-status::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.take-status.status-ready { background: var(--ok-soft); color: var(--ok); }
.take-status.status-failed { background: var(--danger-soft); color: var(--danger); }
.take-status.status-processing { background: var(--warn-soft); color: var(--warn); }

.take-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.take-actions .delete-button { margin-left: auto; }
.take-tracks { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding-top: .5rem; border-top: 1px solid var(--line); }
.take-tracks-label { margin-right: .5rem; font-size: .6875rem; line-height: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.take-tracks .quiet-link { height: var(--control-sm); }
@media (max-width: 600px) { .take-thumbnail { flex-basis: 100%; width: 100%; } }

/* A ready take's thumbnail doubles as its Preview button. */
button.take-thumbnail { display: block; min-height: 0; padding: 0; border: 0; border-radius: var(--radius-md); background: var(--stage); cursor: pointer; }
button.take-thumbnail:hover:not(:disabled) { background: var(--stage); border: 0; }
button.take-thumbnail img { transition: opacity .15s ease; }
button.take-thumbnail:hover img { opacity: .85; }

.download-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-md);
  box-sizing: border-box;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.download-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.download-button.secondary { background: var(--surface); color: var(--ink); border-color: var(--control-line); }
.download-button.secondary:hover { background: var(--sunken); color: var(--ink); }

dialog { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-overlay); }
dialog::backdrop { background: var(--scrim); }

#preview-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
  max-width: min(90vw, 960px);
  width: 100%;
}
#preview-video { width: 100%; display: block; border-radius: var(--radius-md); background: var(--stage); margin-bottom: .75rem; }
.preview-dialog-actions { display: flex; justify-content: flex-end; }

.settings-details summary { cursor: pointer; font-size: 1rem; line-height: 1.375rem; font-weight: 600; }
.settings-details summary .muted { margin-left: .5rem; font-size: .75rem; font-weight: 400; }
.settings-details[open] summary { margin-bottom: .75rem; }

.record-panel { flex-direction: row; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.record-panel.live { border-color: var(--live); }

#recordings-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: .75rem 1rem 1rem;
  width: min(95vw, 1200px);
  height: 85vh;
  box-sizing: border-box;
}
#recordings-dialog[open] { display: flex; flex-direction: column; gap: .5rem; }
.recordings-dialog-bar { display: flex; align-items: center; justify-content: space-between; font-size: 1.25rem; line-height: 1.625rem; }
#recordings-frame { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-md); }

/* Recordings page loaded inside Studio's popup (?embed) - Studio already
   provides the chrome and navigation. */
body.embedded .site-header,
body.embedded .site-footer,
body.embedded .studio-heading-links { display: none; }

#leave-dialog, #record-check-dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem; max-width: min(90vw, 440px); }
#leave-dialog p, #record-check-dialog p { margin: 0 0 1rem; }
#record-check-dialog p.muted { font-size: .8125rem; }
.dialog-title { margin: 0 0 .5rem; font-size: 1.25rem; line-height: 1.625rem; font-weight: 600; }
.record-check-list { margin: 0 0 .75rem; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 4px; font-size: .875rem; line-height: 1.25rem; max-height: 40vh; overflow-y: auto; }
.leave-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; }

/* Studio: record panel across the top, then preview + settings beside
   you + guests; one column on narrower windows. */
.studio-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.5rem; align-items: start; }
@media (max-width: 1100px) { .studio-grid { grid-template-columns: minmax(0, 1fr); } }
.studio-column { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.studio-column > section { min-width: 0; }
.record-panel .system-checks-hint { margin: 0; font-size: .8125rem; }
.record-panel .system-checks-hint[hidden] { display: none; }
/* Studio's layout switcher, under the preview: what OBS shows (the live one pressed). */
.layout-switcher-bar { margin: .75rem 0 1rem; }
.layout-switcher-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.layout-switcher-head .overline { margin: 0; }
.layouts-hint { margin-left: .375rem; text-transform: none; letter-spacing: 0; font-weight: 400; }
#layout-switch-note { font-size: .8125rem; }
.layout-switch-error { margin: .5rem 0 0; font-size: .8125rem; }
.live-layout-label { text-transform: none; letter-spacing: 0; color: var(--ink); }
.layout-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.layout-button { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 132px; min-height: 0; padding: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--control-line); border-radius: var(--radius-md); position: relative; text-align: left; }
.layout-button:hover:not(:disabled) { background: var(--sunken); border-color: var(--control-line); }
.layout-button[aria-pressed="true"], .layout-button[aria-pressed="true"]:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--surface); }
.layout-key { position: absolute; top: 4px; left: 6px; z-index: 1; font-size: .6875rem; font-weight: 700; color: var(--on-accent); background: rgba(0, 0, 0, .55); border-radius: 4px; padding: 0 4px; line-height: 1rem; }
.layout-key:empty { display: none; }
.layout-diagram { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; background: #1f2328; border-radius: 4px; overflow: hidden; }
.layout-diagram-part { position: absolute; border-radius: 2px; }
.layout-diagram-part.camera { background: var(--accent); }
.layout-diagram-part.share { background: #8a94a3; }
.layout-diagram-part.other { background: rgba(255, 255, 255, .28); }
.layout-name { font-size: .8125rem; font-weight: 600; line-height: 1.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-url-row { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.obs-url-row .field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 360px; min-width: 0; font-size: .8125rem; font-weight: 500; color: var(--ink-muted); }
.obs-url-hint { font-size: .75rem; line-height: 1rem; padding-bottom: 8px; }
.live-controls { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.you-top { display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.you-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; flex: 1 1 220px; min-width: 0; }
.guest-row .guest-meter-label { display: none; }
.obs-url-row .url-copy, .guest-list .url-copy { flex: none; }
.guest-list .guest-row { align-items: stretch; flex-wrap: nowrap; }
.guest-meter { flex-wrap: wrap; }
#live-status-text { font-size: .8125rem; line-height: 1.125rem; }
.pill[hidden] { display: none; }
/* Recordings card: a participant's part ends early (upload stopped, see takes.js). */
.take-incomplete { font-size: .8125rem; line-height: 1.125rem; color: var(--warn); }
.guest-row-head .guest-status { margin-left: auto; align-self: center; }

/* Empty-list messages ("No pending invites.") sit on the panel like a row. */
.scene-list > li:not(.scene-row) { padding: .75rem 1rem; background: var(--surface); font-size: .875rem; }
.record-panel .muted { font-size: .8125rem; line-height: 1.125rem; }

/* ============== Home dashboard (home.js) ==============
   Organization > show sections > a grid of scene tiles. */
.home-orgs { display: flex; flex-direction: column; gap: 2.5rem; }
.org-section { display: flex; flex-direction: column; gap: 1.5rem; }
.org-section-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.org-section-head .overline { margin: 0; font-size: .75rem; }
.show-section { display: flex; flex-direction: column; gap: .75rem; }
.show-section-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
/* Manage show / Manage organization: small, right beside the name they manage. */
.show-section-head button, .org-section-head button { min-height: var(--control-sm); padding: 0 10px; font-size: .75rem; }
.show-title { margin: 0; font-size: 1.25rem; line-height: 1.625rem; font-weight: 600; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.scene-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; min-height: 120px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.scene-tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.scene-tile-name { font-size: 1rem; line-height: 1.375rem; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.scene-tile-name:hover { color: var(--accent); }
.scene-tile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scene-tile-actions .button-link { flex: 1 1 auto; }
button.new-scene-tile { min-height: 120px; color: var(--accent); background: transparent; border: 1px dashed var(--control-line); border-radius: var(--radius-lg); font-size: .9375rem; font-weight: 600; }
button.new-scene-tile:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }

/* A link that looks like a button (primary, or .secondary outlined). */
a.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-md); box-sizing: border-box; padding: 0 14px; font: 500 .8125rem/1.125rem var(--font-ui); white-space: nowrap; text-decoration: none; color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-md); }
a.button-link:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
a.button-link.secondary { color: var(--ink); background: var(--surface); border-color: var(--control-line); }
a.button-link.secondary:hover { background: var(--sunken); }

/* The ⋯ menu on a scene tile: a <details> dropdown. */
.tile-menu { position: relative; }
.tile-menu summary { list-style: none; cursor: pointer; padding: 0 8px; min-height: var(--control-sm); display: flex; align-items: center; border-radius: var(--radius-md); color: var(--ink-muted); font-size: 1.125rem; }
.tile-menu summary::-webkit-details-marker { display: none; }
.tile-menu summary:hover, .tile-menu[open] summary { background: var(--sunken); color: var(--ink); }
.tile-menu-items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: flex; flex-direction: column; min-width: 160px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); }
.tile-menu-item, button.tile-menu-item { justify-content: flex-start; min-height: var(--control-md); padding: 0 10px; font: 500 .8125rem/1.125rem var(--font-ui); color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-sm); text-decoration: none; display: flex; align-items: center; }
.tile-menu-item:hover, button.tile-menu-item:hover:not(:disabled) { background: var(--sunken); }
button.tile-menu-item.danger-text { color: var(--danger); }
button.tile-menu-item.danger-text:hover:not(:disabled) { background: var(--danger-soft); }

/* ============== Side panel and dialogs (ui-kit.js) ============== */
dialog.side-panel { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(520px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0; border: 0; border-left: 1px solid var(--line); display: none; flex-direction: column; }
dialog.side-panel[open] { display: flex; }
.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.side-panel-head h2 { margin: 0; font-size: 1.25rem; line-height: 1.625rem; font-weight: 600; }
.side-panel-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1.5rem; }
.panel-section { display: flex; flex-direction: column; gap: .75rem; }
.panel-section h3 { margin: 0; font-size: .9375rem; line-height: 1.375rem; font-weight: 600; }
.panel-section p { margin: 0; }
.side-panel-body p.muted, .ui-dialog p.muted { font-size: .8125rem; line-height: 1.125rem; }
.panel-section > button, .show-settings button[type="submit"] { align-self: flex-start; }
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.person-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: 8px 12px; background: var(--surface); }
.person-name { flex: 1 1 140px; display: flex; flex-direction: column; font-weight: 500; overflow-wrap: anywhere; }
.person-email { font-size: .75rem; font-weight: 400; }
.add-person { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.add-person-label { font-size: .8125rem; color: var(--ink-muted); }
.danger-zone { padding-top: 1rem; border-top: 1px solid var(--line); align-items: flex-start; }
dialog.ui-dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem; width: min(90vw, 440px); }
.ui-dialog form { display: flex; flex-direction: column; gap: .75rem; }
.ui-dialog h2 { margin: 0; font-size: 1.125rem; line-height: 1.5rem; font-weight: 600; }
.ui-dialog p { margin: 0; }
.ui-dialog-actions { display: flex; flex-direction: row-reverse; gap: 8px; margin-top: .25rem; }
.person-shows { font-size: .75rem; font-weight: 400; }
.invite-form { display: flex; flex-direction: column; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.invite-form h4 { margin: 0; font-size: .8125rem; line-height: 1.125rem; font-weight: 600; }
.invite-form input[type="email"] { flex: 1 1 200px; }
.invite-result p { margin: 0 0 .5rem; font-size: .8125rem; }

/* ============== Site admin (admin.js): tabs and tables ============== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs [role="tab"] { min-height: var(--control-lg); padding: 0 16px; color: var(--ink-muted); background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: .875rem; font-weight: 600; }
.tabs [role="tab"]:hover:not(:disabled) { color: var(--ink); background: transparent; border-color: transparent; border-bottom-color: var(--line); }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: flex; flex-direction: column; gap: .75rem; }
.tab-panel[hidden] { display: none; }
.tab-panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tab-panel-bar p { margin: 0; font-size: .8125rem; line-height: 1.125rem; max-width: 60rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { text-align: left; padding: 10px 14px; font-size: .6875rem; line-height: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td:last-child { text-align: right; }
.cell-name { display: flex; flex-direction: column; min-width: 10rem; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: .75rem; line-height: 1rem; }
.cell-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.usage { display: flex; align-items: center; gap: .5rem; min-width: 12rem; }
.usage-bar { flex: 0 0 96px; height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.usage-fill { height: 100%; background: var(--accent); }
.usage-bar.high .usage-fill { background: var(--warn); }
.usage-bar.full .usage-fill { background: var(--danger); }
.usage-text { font: 500 .8125rem/1.125rem var(--font-mono); white-space: nowrap; }
.usage-note { font-size: .75rem; }

/* ---- Account pages (login, signup, forgot, reset, verify, invite): one
   centered card, like any site's sign-in. The only fixed max-width in the
   app: a full-width login form reads as broken, not fluid. ---- */
.auth-page { display: flex; justify-content: center; padding: 2rem 0 1rem; }
.auth-card { width: min(420px, 100%); box-sizing: border-box; display: flex; flex-direction: column; gap: 1.25rem; padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 1px 3px rgba(14, 16, 15, .06), 0 8px 24px rgba(14, 16, 15, .06); }
.auth-card.wide { width: min(480px, 100%); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; align-self: center; font-size: 1.25rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.auth-brand:hover { color: var(--ink); }
.auth-brand img { display: block; }
.auth-head { text-align: center; }
.auth-head h1 { font-size: 1.5rem; line-height: 2rem; }
.auth-head p { margin: .375rem 0 0; color: var(--ink-muted); font-size: .875rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form[hidden] { display: none; }
.auth-form input[type="text"], .auth-form input[type="password"], .auth-form input[type="email"] { width: 100%; }
.auth-form button[type="submit"] { width: 100%; min-height: 40px; font-size: .9375rem; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.auth-label-row a, .auth-links a { font-weight: 500; text-decoration: none; }
.auth-label-row a:hover, .auth-links a:hover { text-decoration: underline; }
.auth-form label.check-field { align-items: flex-start; font-weight: 400; font-size: .8125rem; color: var(--ink-muted); }
.auth-form label.check-field input { margin-top: 2px; }
.auth-card #message { text-align: center; }
.auth-links { margin: 0; text-align: center; font-size: .875rem; color: var(--ink-muted); }
.auth-links[hidden] { display: none; }
.auth-divider { border: 0; border-top: 1px solid var(--line); margin: 0; }
/* The card carries the logo; the header would only repeat it. */
body:has(.auth-page) .site-header { display: none; }
body:has(.auth-page) .container { padding-top: 3rem; }
