:root {
  --bg: #0a0e12;
  --bg-soft: #10161d;
  --panel: #141c25;
  --panel-2: #1a242f;
  --line: #243240;
  --text: #eef4f8;
  --muted: #8da3b3;
  --muted-2: #5f7585;
  --accent: #7fb2cf;
  --accent-soft: rgba(127, 178, 207, 0.14);
  --good: #6fcf97;
  --warn: #e8c275;
  --unknown: #9aa7b2;
  --danger: #e07a6f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(127, 178, 207, 0.16), transparent 60%),
    radial-gradient(900px 600px at 90% 110%, rgba(127, 178, 207, 0.08), transparent 55%),
    var(--bg);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .logo {
  width: 38px;
  height: 38px;
}

.brand .name {
  font-family: var(--serif);
  letter-spacing: 4px;
  font-size: 20px;
  color: var(--text);
}

.brand .sub {
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a,
.btn-ghost {
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.15s ease;
}

.nav-links a:hover,
.btn-ghost:hover {
  color: var(--text);
  background: var(--panel);
}

.nav-links a.nav-active {
  color: var(--text);
  background: var(--panel);
}

.nav-user {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--accent);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: var(--shadow);
}

.auth-card .brand {
  justify-content: center;
  margin-bottom: 6px;
}

.auth-card h1 {
  font-family: var(--serif);
  font-weight: 500;
  text-align: center;
  font-size: 24px;
  margin: 10px 0 4px;
}

.auth-card .auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}

.auth-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px;
  border-radius: 999px;
  font-size: 14px;
}

.auth-tabs button.active {
  background: var(--accent);
  color: #07121a;
  font-weight: 600;
}

.auth-card .btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 13px;
}

.auth-error {
  background: rgba(224, 122, 111, 0.12);
  border: 1px solid rgba(224, 122, 111, 0.4);
  color: #f0b3ab;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.auth-error.show {
  display: block;
}

.auth-foot {
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 20px;
  line-height: 1.5;
}

/* ---------- Admin ---------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--panel-2);
}

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge.admin {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(127, 178, 207, 0.4);
}

.role-badge.user {
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

.status-pill {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.status-pill.active::before,
.status-pill.disabled::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-pill.active::before { background: var(--good); }
.status-pill.disabled::before { background: var(--muted-2); }

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.btn-sm:hover {
  border-color: var(--accent);
}

.btn-sm.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.admin-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  min-width: 120px;
}

.stat .num {
  font-size: 26px;
  font-weight: 600;
}

.stat .lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.table-scroll {
  overflow-x: auto;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 28px 80px;
}

.hero {
  text-align: center;
  padding: 38px 0 30px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: 0.5px;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 38px 4px 16px;
}

.section-title h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted-2);
  font-weight: 600;
  margin: 0;
}

/* ---------- Profile cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.profile-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.profile-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.portrait {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  background: var(--panel-2);
}

.profile-card .who {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-card .who .name {
  font-size: 20px;
  font-weight: 600;
}

.profile-card .who .rel {
  font-size: 13px;
  color: var(--muted);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(111, 207, 151, 0.18);
}

.last-memory {
  font-size: 13px;
  color: var(--muted-2);
}

.last-memory b {
  color: var(--muted);
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #07121a;
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-call {
  flex: 1;
}

/* ---------- Quick tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  color: var(--muted);
  transition: all 0.15s ease;
}

.tile:hover {
  color: var(--text);
  border-color: var(--accent);
}

.tile .t-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

.tile .t-title {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.tile .t-sub {
  font-size: 12px;
  margin-top: 3px;
}

/* ---------- Banner ---------- */
.banner {
  background: var(--accent-soft);
  border: 1px solid rgba(127, 178, 207, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

.banner b {
  color: var(--text);
}

/* ---------- Call screen ---------- */
.call-screen {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.call-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  z-index: 5;
}

.call-id {
  display: flex;
  align-items: center;
  gap: 12px;
}

.call-id .name {
  font-size: 17px;
  font-weight: 600;
}

.call-id .meta {
  font-size: 12px;
  color: var(--muted);
}

.mode-switch {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.mode-switch button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  transition: all 0.15s ease;
}

.mode-switch button.active {
  background: var(--accent);
  color: #07121a;
  font-weight: 600;
}

.stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

#avatarVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #05080b;
}

.avatar-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 30px;
}

.avatar-placeholder img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid var(--line);
  object-fit: cover;
}

.avatar-placeholder .ph-name {
  font-family: var(--serif);
  font-size: 26px;
}

.avatar-placeholder .ph-status {
  color: var(--muted);
  font-size: 14px;
  max-width: 360px;
  line-height: 1.55;
}

.pulse {
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.99); }
  50% { opacity: 1; transform: scale(1.01); }
}

/* Captions + source cards over the video */
.overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.caption {
  max-width: 720px;
  background: rgba(8, 12, 16, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  pointer-events: auto;
}

.caption:empty {
  display: none;
}

.source-card {
  max-width: 720px;
  width: 100%;
  background: rgba(8, 12, 16, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  pointer-events: auto;
}

.source-card .conf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.conf.direct { color: var(--good); }
.conf.inferred { color: var(--warn); }
.conf.unknown { color: var(--unknown); }

.conf::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-pill {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

.self-view {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 120px;
  height: 160px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #05080b;
  z-index: 4;
}

/* Call controls */
.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px 0 28px;
  z-index: 5;
}

.ctrl {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--panel-2);
  color: var(--text);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  border: 1px solid var(--line);
}

.ctrl:hover {
  transform: translateY(-2px);
}

.ctrl.mic {
  width: 76px;
  height: 76px;
  background: var(--accent);
  color: #07121a;
  font-size: 26px;
}

.ctrl.mic.recording {
  background: var(--danger);
  color: #fff;
  animation: rec 1.2s ease-in-out infinite;
}

@keyframes rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 122, 111, 0.5); }
  50% { box-shadow: 0 0 0 14px rgba(224, 122, 111, 0); }
}

.ctrl.end {
  background: var(--danger);
  color: #fff;
}

/* Text input row */
.text-row {
  display: flex;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  padding: 0 18px;
}

.text-row input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 18px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.text-row input:focus {
  border-color: var(--accent);
}

/* Suggested prompts */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px 0;
  max-width: 760px;
  margin: 0 auto;
}

.suggestions button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  transition: all 0.15s ease;
}

.suggestions button:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ---------- Builder ---------- */
.builder {
  max-width: 720px;
  margin: 0 auto;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}

.field .hint {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 5px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
}

.card-block h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.card-block .blurb {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
  line-height: 1.5;
}

.builder-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel-2);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer-note {
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 48px;
  line-height: 1.6;
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
  .self-view {
    width: 92px;
    height: 124px;
  }
}

/* ---------- Landing page ---------- */
.landing-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  padding: 56px 24px 48px;
}
.lh-copy h1 {
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1.08;
  margin: 14px 0 16px;
  letter-spacing: -0.01em;
}
.lh-copy p {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 540px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
}
.lh-fineprint {
  font-size: 13px !important;
  color: var(--muted-2) !important;
  margin-top: 22px !important;
}
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
  border-radius: 999px;
}
.lh-art {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lh-art .orb {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(127, 178, 207, 0.55), transparent 60%),
    radial-gradient(circle at 70% 75%, rgba(127, 178, 207, 0.25), transparent 55%),
    var(--panel-2);
  box-shadow: var(--shadow), inset 0 0 60px rgba(127, 178, 207, 0.25);
  animation: float 6s ease-in-out infinite;
}
.lh-card {
  position: absolute;
  bottom: 30px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  max-width: 250px;
}
.lh-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--good);
  flex: none;
  box-shadow: 0 0 0 4px rgba(111, 207, 151, 0.18);
}
.lh-card-text { font-size: 14px; color: var(--text); font-style: italic; }
@keyframes float {
  50% { transform: translateY(-12px); }
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 18px; }
.step p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }

.cta-band {
  text-align: center;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  margin: 28px 0;
}
.cta-band h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; }
.cta-band p { color: var(--muted); margin: 0 0 6px; }
.cta-band .cta-row { justify-content: center; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 22px 0;
}
.sf-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted-2);
  font-size: 13px;
}
.sf-links { display: flex; gap: 18px; }
.sf-links a:hover { color: var(--accent); }

.prose .card-block p { color: var(--muted); line-height: 1.65; }
.about-list { color: var(--muted); line-height: 1.7; margin: 8px 0 0; padding-left: 18px; }
.about-list li { margin-bottom: 6px; }

@media (max-width: 760px) {
  .landing-hero { grid-template-columns: 1fr; padding: 36px 20px; }
  .lh-copy h1 { font-size: 36px; }
  .lh-art { min-height: 240px; order: -1; }
  .steps { grid-template-columns: 1fr; }
}

/* ---------- Avatar picker (builder) ---------- */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.avatar-picker .picker-group {
  grid-column: 1 / -1;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 8px 0 -2px;
}
.picker-loading {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}
.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  background: var(--panel-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s;
}
.avatar-option:hover { transform: translateY(-2px); }
.avatar-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.avatar-option img,
.avatar-option .avatar-fallback {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel);
}
.avatar-option .avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
}
.avatar-option .avatar-name {
  font-size: 12px;
  text-align: center;
  color: var(--muted);
  line-height: 1.2;
}
details.advanced {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
details.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Segmented control ---------- */
.seg {
  display: inline-flex;
  gap: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  flex-wrap: wrap;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.seg-btn.active {
  background: var(--accent);
  color: #06121a;
  font-weight: 600;
}

/* ---------- Recorder ---------- */
.recorder-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.recorder-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.teleprompter {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  text-align: center;
}
.tp-phase { font-size: 18px; font-weight: 600; color: #fff; }
.tp-timer { font-size: 13px; color: var(--accent); margin: 2px 0 4px; }
.tp-hint { font-size: 14px; color: #d9e6ee; }
.rec-dot {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(224, 122, 111, 0.9);
  padding: 4px 10px;
  border-radius: 999px;
  animation: blink 1.2s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }
.recorder-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.rec-or { color: var(--muted-2); font-size: 13px; }
.file-btn { position: relative; overflow: hidden; }
.btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; }
.capture-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.playback {
  width: 100%;
  max-width: 360px;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.consent-script {
  margin: 12px 0;
  padding: 14px 16px;
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-style: italic;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.check-row input { margin-top: 3px; }

/* ---------- Status pills (extra variants) ---------- */
.status-pill.warn { background: rgba(232, 194, 117, 0.16); color: var(--warn); }
.status-pill.info { background: rgba(127, 178, 207, 0.16); color: var(--accent); }
.status-pill.good { background: rgba(111, 207, 151, 0.16); color: var(--good); }
.status-pill.danger { background: rgba(224, 122, 111, 0.16); color: var(--danger); }

/* ---------- Requests (studio + admin) ---------- */
.request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.req-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.req-meta { font-size: 12px; color: var(--muted-2); margin-top: 3px; }
.requests-grid { display: grid; gap: 14px; margin-top: 8px; }
.request-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.rc-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rc-dl { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.rc-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  align-items: center;
}
.rc-form input,
.rc-form select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
}
.rc-form .ra-avatar { flex: 1 1 220px; }
.rc-form .ra-voice { flex: 1 1 160px; }
