/* Prends Studio. Tokens and pr- components come from the Prends design system;
   st- classes are the parts only the studio needs. */
@font-face { font-family: Geist; src: url("/assets/fonts/geist-sans-v1.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --accent: #6439ed; --accent-hover: #5028d6; --accent-soft: #efeafd; --accent-text: #6439ed; --on-accent: #ffffff;
  --ink: #222222; --muted: #6a6a6a; --placeholder: #767676; --surface: #ffffff; --soft: #f7f7f7;
  --line: #ebebeb; --line-strong: #8a8a8a; --focus: #6439ed;
  --success: #137333; --danger: #c13515; --danger-soft: #fdecee;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --font-sans: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 20px; --radius-pill: 999px;
  --tap-min: 44px; --control-h: 52px; --header-h: 56px; --measure: 560px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
h1, p { margin: 0; }
h1 { font-weight: 700; font-size: 28px; line-height: 34px; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.st-noscript { padding: var(--space-6); text-align: center; }

/* Button */
.pr-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-h); padding: 0 var(--space-6); border-radius: var(--radius-md); border: 1px solid transparent; font: 600 16px/1 var(--font-sans); cursor: pointer; text-decoration: none; }
.pr-btn--primary { background: var(--accent); color: var(--on-accent); }
.pr-btn--primary:hover { background: var(--accent-hover); }
.pr-btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.pr-btn--secondary:hover { background: var(--soft); }
.pr-btn--ghost { background: transparent; color: var(--accent-text); min-height: var(--tap-min); padding: 0 var(--space-3); }
.pr-btn--block { width: 100%; }
.st-settings { align-self: center; }
.st-gear { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.st-btn-sm { min-height: var(--tap-min); padding: 0 var(--space-4); font-size: 14px; flex: none; }

/* Field */
.pr-field { display: flex; flex-direction: column; gap: var(--space-2); }
.pr-field label, .st-label { font: 600 14px/20px var(--font-sans); color: var(--ink); }
.pr-input { width: 100%; height: var(--control-h); padding: 0 var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: 400 16px/24px var(--font-sans); }
.pr-input::placeholder { color: var(--placeholder); }
.pr-input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--accent); }
.pr-input--error { border-color: var(--danger); }
.pr-help { font: 400 14px/20px var(--font-sans); color: var(--muted); }
.pr-error { font: 500 14px/20px var(--font-sans); color: var(--danger); }

/* Chip: 32px visual pill inside a 44px hit area */
.pr-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.pr-chip { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap-min); min-height: var(--tap-min); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.pr-chip > span { display: inline-block; max-width: 300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 32px; height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-pill); background: var(--soft); color: var(--ink); font-family: var(--font-sans); font-size: 14px; font-weight: 500; }
.pr-chip[aria-pressed="true"] > span { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }

/* Header */
.pr-logo { display: inline-flex; align-items: center; min-height: var(--tap-min); gap: var(--space-2); font: 700 18px/1 var(--font-sans); color: var(--ink); text-decoration: none; }
.pr-logo img { width: 28px; height: 28px; }
.pr-nav { display: flex; gap: var(--space-1); margin-left: auto; }
.pr-nav a { display: inline-flex; align-items: center; min-height: var(--tap-min); padding: 0 var(--space-2); font: 600 14px/20px var(--font-sans); color: var(--muted); text-decoration: none; }
.pr-host { display: inline-flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-3) 0 var(--space-1); border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--ink); font: 600 14px/20px var(--font-sans); }
.pr-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 12px/1 var(--font-sans); }

/* Page frames */
.st-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.st-head { display: flex; align-items: center; gap: var(--space-4); min-height: var(--header-h); padding: 0 var(--space-6); border-bottom: 1px solid var(--line); }
.st-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.st-hero { gap: var(--space-8); padding: var(--space-16) var(--space-4); }
.st-hero-btn { min-width: 250px; }
.st-display { font-size: 40px; line-height: 44px; letter-spacing: -0.02em; }
.st-lead { max-width: 440px; }
.st-text-center { text-align: center; align-items: center; }
.st-task { flex: 1; width: 100%; max-width: var(--measure); margin: 0 auto; padding: var(--space-12) var(--space-4); display: flex; flex-direction: column; gap: var(--space-8); }
.st-task--center { justify-content: center; text-align: center; max-width: 440px; }
.st-stack-1, .st-stack-2, .st-stack-3, .st-stack-4, .st-stack-6 { display: flex; flex-direction: column; }
.st-stack-1 { gap: var(--space-1); } .st-stack-2 { gap: var(--space-2); } .st-stack-3 { gap: var(--space-3); } .st-stack-4 { gap: var(--space-4); } .st-stack-6 { gap: var(--space-6); }
.st-muted { color: var(--muted); }
.st-note { font: 400 14px/20px var(--font-sans); color: var(--muted); }
.st-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); }
.st-card .pr-help { flex: 1 1 220px; }

/* Guest check-in */
.st-checkin { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-12); padding: var(--space-8) var(--space-4); }
.st-checkin-preview { flex: 1 1 420px; max-width: 640px; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.st-checkin-form { flex: 1 1 320px; max-width: 360px; display: flex; flex-direction: column; gap: var(--space-6); }
.st-tile { position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--soft); }
.st-preview { aspect-ratio: 16 / 9; }
#preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.st-mic-row { display: flex; align-items: center; gap: var(--space-3); }
.st-meter { flex: 1; height: 8px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
#audio-meter-fill { width: 0; height: 100%; background: var(--success); transition: width 100ms linear; }
#greenroom-status.is-error { color: var(--danger); }

/* Studio */
.st-studio { height: 100vh; height: 100dvh; min-height: 480px; }
.st-mark { width: 28px; height: 28px; flex: none; }
.st-title { font: 600 16px/24px var(--font-sans); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.st-beta { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); font: 500 12px/16px var(--font-sans); flex: none; }
.st-spacer { flex: 1 1 auto; }
.st-stage { flex: 1; min-height: 0; margin: var(--space-4) var(--space-6) var(--space-3); border-radius: var(--radius-md); overflow: hidden; background: var(--soft); }
.st-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.st-rec, .st-idle { display: inline-flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-pill); font: 600 14px/20px var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.st-rec { background: var(--danger-soft); color: var(--danger); }
.st-rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-idle { background: var(--soft); color: var(--muted); }
.st-bar-wrap { display: flex; justify-content: center; padding: var(--space-1) var(--space-4) var(--space-4); }
.st-bar { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.st-ctl { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 72px; min-height: 56px; padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: 500 12px/16px var(--font-sans); cursor: pointer; }
.st-ctl:hover { background: var(--soft); }
.st-ctl[aria-pressed="true"], .st-ctl[aria-pressed="true"]:hover { color: var(--danger); background: var(--danger-soft); }
.st-ctl svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.st-rule { width: 1px; height: 36px; background: var(--line); margin: 0 var(--space-1); }
.st-record { min-width: 172px; }

@media (max-width: 640px) {
  .st-head { padding: 0 var(--space-4); }
  .st-display { font-size: 32px; line-height: 36px; }
  .st-stage { margin: var(--space-3) var(--space-4) var(--space-2); }
  .st-checkin { gap: var(--space-6); align-items: stretch; }
  .st-checkin-form { max-width: none; }
  .st-rule { display: none; }
  .st-ctl { min-width: 60px; }
  .st-record { order: -1; width: 100%; }
}
