/* ============ TOKENS ============ */
:root {
  --bg-light: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e5e6ea;
  --border-2: #d8dadf;
  --text: #16181d;
  --text-2: #5b6270;
  --text-3: #8a909c;
  --accent: #3056ff;
  --accent-2: #1f3fd9;
  --accent-soft: #eaeefe;
  --success: #1aa667;
  --success-soft: #d6f5e6;
  --danger: #d8413c;

  --bg-dark: #0f0f12;
  --surface-dark: #1a1a1f;
  --surface-dark-2: #232328;
  --border-dark: #2c2c33;
  --text-dark: #ececef;
  --text-dark-2: #a5a8b0;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-card: 0 1px 2px rgba(20,20,40,.04), 0 8px 24px rgba(20,20,40,.05);
  --shadow-pop: 0 10px 30px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font-family: inherit; }

.app { height: 100%; display: flex; flex-direction: column; }

/* ============ HOME ============ */
.home { min-height: 100%; background: var(--bg-light); }

.home-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: auto; height: 38px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--text-3); }
.home-header-right { display: flex; align-items: center; gap: 14px; }
.avatar-dot {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #3056ff, #6b8aff);
  color: #fff; font-size: 12px; font-weight: 600;
  display: grid; place-items: center; letter-spacing: 0.5px;
}
.avatar-btn {
  width: 36px; height: 36px; padding: 0;
  border-radius: 50%; overflow: hidden;
  background: transparent;
  transition: box-shadow .15s, transform .1s;
}
.avatar-btn:hover { box-shadow: 0 0 0 3px rgba(48,86,255,.2); }
.avatar-btn:active { transform: scale(0.96); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn .avatar-dot { width: 100%; height: 100%; }

.home-main {
  max-width: 1080px; margin: 0 auto; padding: 56px 36px 80px;
  display: flex; flex-direction: column; gap: 36px;
}
.home-hero { display: flex; flex-direction: column; gap: 8px; }
.home-title { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.home-sub { color: var(--text-2); font-size: 16px; margin: 0; }

.action-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
}
.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 180px;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: var(--shadow-card);
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(20,20,40,.08); border-color: var(--border-2); }
.action-icon-wrap {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft);
  display: grid; place-items: center; color: var(--accent);
}
.action-card.primary .action-icon-wrap { background: var(--accent); color: #fff; }
.action-icon { width: 22px; height: 22px; }
.action-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.action-title { font-size: 18px; font-weight: 600; }
.action-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.action-arrow { position: absolute; right: 20px; bottom: 18px; color: var(--text-3); font-size: 22px; transition: transform .15s; }
.action-card:hover .action-arrow { transform: translateX(4px); color: var(--accent); }

.action-card.disabled,
.action-card[disabled] {
  cursor: not-allowed;
  opacity: .55;
  background: var(--surface);
  filter: grayscale(0.35);
}
.action-card.disabled:hover,
.action-card[disabled]:hover {
  transform: none;
  box-shadow: var(--shadow-card);
  border-color: var(--border);
}
.action-card.disabled:hover .action-arrow,
.action-card[disabled]:hover .action-arrow {
  transform: none;
  color: var(--text-3);
}
.action-card.primary.disabled .action-icon-wrap,
.action-card.primary[disabled] .action-icon-wrap {
  background: var(--text-3);
  color: #fff;
}

.upcoming {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 0;
}
.upcoming-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px 8px;
  gap: 12px;
}
.upcoming-nav {
  display: flex; align-items: center; gap: 4px;
}
.nav-arrow {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: background .15s, color .15s, opacity .15s;
}
.nav-arrow:hover:not(:disabled) { background: rgba(0,0,0,.05); color: var(--text); }
.nav-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.nav-label {
  display: flex; flex-direction: column;
  background: transparent;
  padding: 4px 12px;
  border-radius: 10px;
  font-weight: 600; font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  color: var(--text);
  transition: background .15s;
  min-width: 140px;
}
.nav-label:hover { background: rgba(0,0,0,.04); }
.nav-label.today { color: var(--accent); }
.nav-sub {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 400;
  margin-top: 1px;
  text-transform: lowercase;
}

.upcoming-day-empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.upcoming-row.ended { opacity: 0.78; }
.upcoming-row.ended .upcoming-time b { color: var(--text-3); }
.ended-pill {
  display: inline-block;
  margin-left: 8px;
  background: rgba(0,0,0,.05);
  color: var(--text-3);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.upcoming-summary {
  background: linear-gradient(135deg, rgba(48,86,255,.08), rgba(122,109,255,.08));
  border: 1px solid rgba(48,86,255,.2);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s;
}
.upcoming-summary:hover {
  background: linear-gradient(135deg, rgba(48,86,255,.15), rgba(122,109,255,.15));
  border-color: rgba(48,86,255,.4);
}
.ai-spark {
  display: inline-block;
  font-size: 14px;
  background: linear-gradient(135deg, #6c8cff, #c25b8a);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Summary modal */
.modal.summary-modal {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  padding: 0;
}
.summary-head {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
}
.summary-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, rgba(48,86,255,.08), rgba(194,91,138,.08));
  border: 1px solid rgba(48,86,255,.18);
  color: var(--accent);
  font-size: 12px; font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.summary-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
}
.summary-side {
  border-right: 1px solid var(--border);
  padding: 18px 18px 22px;
  background: var(--surface-2);
  overflow-y: auto;
  max-height: 60vh;
}
.summary-side-title {
  font-size: 12px; color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.summary-side-title em {
  font-style: normal;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.summary-attendees { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.summary-attendees li {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text);
}
.sum-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.summary-main {
  padding: 20px 28px 24px;
  display: flex; flex-direction: column;
  min-height: 0;
}
.summary-main-title {
  font-size: 12px; color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.summary-text {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  padding-right: 8px;
  max-height: 50vh;
}
.summary-text::-webkit-scrollbar { width: 6px; }
.summary-text::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }
.summary-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}
.upcoming-list { list-style: none; margin: 0; padding: 0; }
.upcoming-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.upcoming-time { display: flex; flex-direction: column; }
.upcoming-time b { font-size: 17px; font-weight: 600; }
.upcoming-time span { font-size: 12px; color: var(--text-3); }
.upcoming-name { font-weight: 500; font-size: 15px; }
.upcoming-meta { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.upcoming-join {
  background: var(--accent-soft); color: var(--accent);
  padding: 8px 16px; border-radius: 10px;
  font-weight: 500; font-size: 13.5px;
  transition: background .15s;
}
.upcoming-join:hover { background: #dde3fd; }

.ghost-btn {
  padding: 8px 14px; border-radius: 8px;
  color: var(--text-2); font-size: 14px;
  transition: background .15s;
}
.ghost-btn:hover { background: rgba(0,0,0,.04); }
.ghost-btn.small { font-size: 13px; padding: 6px 10px; }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,15,20,.5);
  display: grid; place-items: center;
  z-index: 50;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-pop);
  animation: pop .2s cubic-bezier(.2,.8,.2,1);
}
.modal.wide { width: min(520px, calc(100vw - 32px)); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--text-3);
}
.modal-close:hover { background: rgba(0,0,0,.05); color: var(--text); }
.modal-title { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.modal-sub { color: var(--text-2); font-size: 14px; margin: 0 0 20px; }
.modal-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s, background .15s;
}
.modal-input:focus { border-color: var(--accent); background: #fff; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.primary-btn {
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 10px;
  font-weight: 500; font-size: 14px;
  transition: background .15s, opacity .15s;
}
.primary-btn:hover { background: var(--accent-2); }
.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.primary-btn.flex { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }

.created-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.created-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 8px;
}
.created-link span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ ROOM ============ */
.room {
  height: 100vh;
  background: var(--bg-dark);
  color: var(--text-dark);
  display: flex; flex-direction: column;
}
.room-stage {
  flex: 1;
  display: flex;
  padding: 20px;
  gap: 14px;
  min-height: 0;
  position: relative;
}
.stage-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 0;
}
.stage-grid.stage-shared {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
}

/* Tile */
.tile {
  background: var(--surface-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 0;
  border: 2px solid transparent;
  transition: border-color .2s;
}
.tile.tile-talking { border-color: #1aa667; }
.tile-big { grid-column: span 1; }
.tile-inner { width: 100%; height: 100%; position: relative; display: grid; place-items: center; }
.tile-avatar-wrap { display: grid; place-items: center; padding: 12px; }
.tile-avatar {
  width: clamp(80px, 22vh, 200px);
  height: clamp(80px, 22vh, 200px);
  border-radius: 50%;
  display: grid; place-items: center;
  color: #2a2a2e;
  font-size: clamp(40px, 10vh, 110px);
  font-weight: 600;
}
.tile-video { width: 100%; height: 100%; position: absolute; inset: 0; display: grid; place-items: center; }
.tile-video-fake { color: #fff; font-size: 60px; font-weight: 600; opacity: .3; }
.tile-name-chip {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  padding: 5px 12px;
  border-radius: 14px;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
}
.tile-mic { opacity: .85; }
.tile-mic.muted { color: #ff6b6b; opacity: 1; }

.tile-hand { box-shadow: inset 0 0 0 2px #f6b94a; border-radius: var(--radius-lg); }
.tile-hand-badge {
  position: absolute; top: 12px; left: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #f6b94a;
  color: #2a1a04;
  display: grid; place-items: center;
  animation: handwave 1.4s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(246,185,74,.35);
}
@keyframes handwave {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

/* Invite panel (single-user state) */
.invite-panel {
  background: transparent;
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  padding: 32px;
  text-align: center;
}
.invite-title { font-size: 20px; font-weight: 600; max-width: 360px; line-height: 1.3; }
.invite-sub { color: var(--text-dark-2); font-size: 14px; margin-top: -8px; }

.invite-link {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 10px 10px 10px 16px;
  margin-top: 10px;
  max-width: 100%;
  min-width: 320px;
  color: var(--text-dark);
  font-size: 14px;
  transition: background .35s ease, border-color .35s ease, color .35s ease;
}
.invite-link:hover { background: #232328; }
.invite-link-url {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-dark-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: left;
  transition: color .35s ease;
}
.invite-link-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--surface-dark-2);
  color: var(--text-dark);
  font-size: 13px; font-weight: 500;
  transition: background .35s ease, color .35s ease;
}
.invite-link.flash {
  background: rgba(43,212,127,.12);
  border-color: rgba(43,212,127,.55);
}
.invite-link.flash .invite-link-url { color: #4adb91; }
.invite-link.flash .invite-link-action {
  background: #2bd47f;
  color: #0e2a1a;
}

.meeting-no {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  color: var(--text-dark-2); font-size: 13px;
}
.copy-tiny {
  width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center;
  color: var(--text-dark-2);
  transition: background .35s ease, color .35s ease;
}
.copy-tiny:hover { background: rgba(255,255,255,.06); }
.copy-tiny.flash {
  background: rgba(43,212,127,.18);
  color: #4adb91;
}

/* Share screen */
.share-area { min-height: 0; display: flex; align-items: stretch; }
.share-screen {
  flex: 1;
  background: linear-gradient(180deg, #1d1d22, #181818);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--border-dark);
}
.share-mock-toolbar {
  background: #2a2a30;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border-dark);
}
.share-mock-dots { display: flex; gap: 6px; }
.share-mock-dots span { width: 11px; height: 11px; border-radius: 50%; background: #4a4a52; }
.share-mock-dots span:nth-child(1) { background: #ff5f57; }
.share-mock-dots span:nth-child(2) { background: #febc2e; }
.share-mock-dots span:nth-child(3) { background: #28c840; }
.share-mock-url {
  background: #1c1c20; border: 1px solid var(--border-dark);
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
  color: var(--text-dark-2); font-family: 'JetBrains Mono', monospace;
}
.share-mock-body {
  padding: 22px 28px; display: flex; flex-direction: column; gap: 18px;
  flex: 1; min-height: 0;
  background: #f5f6f9; color: #1a1a1f;
}
.share-mock-title { font-size: 18px; font-weight: 600; }
.share-mock-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.stat {
  background: #fff; border: 1px solid #e7e8ec;
  border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat span { font-size: 11.5px; color: #7a808c; text-transform: uppercase; letter-spacing: 0.04em; }
.stat b { font-size: 22px; font-weight: 600; }
.stat em { font-size: 11px; font-style: normal; }
.stat em.up { color: #1aa667; }
.stat em.dn { color: #d8413c; }
.share-mock-chart {
  flex: 1; min-height: 100px;
  background: #fff; border: 1px solid #e7e8ec;
  border-radius: 10px; padding: 12px;
}
.share-mock-foot { display: flex; gap: 16px; font-size: 12px; color: #555a66; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .dot1 { background: #6c8cff; }
.legend .dot2 { background: #2bd47f; }
.legend .dot3 { background: #f6b94a; }

.share-strip {
  display: flex; gap: 10px; padding: 4px 0; align-items: center;
  max-height: 100px;
}
.strip-tile {
  background: var(--surface-dark);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  min-width: 140px;
}
.strip-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  color: #2a2a2e; font-weight: 600;
  display: grid; place-items: center; font-size: 14px;
}
.strip-name { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* Side panel (chat / people) */
.side-panel {
  width: 340px; flex-shrink: 0;
  background: var(--surface-dark);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  border: 1px solid var(--border-dark);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 12px;
}
.panel-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.title-badge {
  background: #2bd47f; color: #0e2a1a;
  font-size: 11px; font-weight: 600; font-style: normal;
  padding: 1px 7px; border-radius: 10px;
}
.panel-close {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; color: var(--text-dark-2);
}
.panel-close:hover { background: rgba(255,255,255,.06); color: var(--text-dark); }

/* People */
.people-search {
  margin: 6px 18px 14px;
  background: var(--surface-dark-2);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-dark-2);
}
.people-search input {
  background: transparent; border: 0; outline: none;
  color: var(--text-dark); font-size: 14px; flex: 1;
}
.people-list { flex: 1; overflow-y: auto; padding: 0 8px; }
.person-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 10px;
}
.person-row:hover { background: var(--surface-dark-2); }
.person-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  color: #2a2a2e; font-weight: 600;
  display: grid; place-items: center; font-size: 15px;
}
.person-info { flex: 1; min-width: 0; }
.person-name { font-size: 14px; font-weight: 500; }
.person-role { font-size: 12px; color: var(--text-dark-2); margin-top: 1px; }
.person-mic { color: var(--text-dark-2); }
.people-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border-dark);
  display: flex; gap: 8px;
  position: relative;
}
.copy-flash {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .35s ease, color .35s ease;
}
.copy-flash.flash {
  background: #2bd47f;
  color: #0e2a1a;
}
.copy-flash.flash:hover { background: #2bd47f; }

.people-more-wrap { position: relative; }
.people-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  padding: 8px;
  min-width: 240px;
  box-shadow: var(--shadow-pop);
  animation: pop .15s ease;
  z-index: 10;
}
.people-menu-note {
  padding: 6px 10px 10px;
  font-size: 11.5px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-dark);
  margin-bottom: 6px;
}
.people-menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dark);
  font-size: 14px;
  text-align: left;
  transition: background .12s, color .12s;
}
.people-menu-item:hover:not(.disabled) { background: var(--surface-dark-2); }
.people-menu-item.disabled {
  color: var(--text-3);
  cursor: not-allowed;
}
.people-menu-item.disabled svg { opacity: 0.5; }
.people-menu-item svg { flex-shrink: 0; color: var(--text-dark-2); }
.people-menu-item.disabled svg { color: var(--text-3); }

.person-mic .muted { color: #ff6b6b; }
.hand-pill { margin-left: 6px; font-size: 14px; }
.ghost-btn.icon-only {
  background: var(--surface-dark-2);
  width: 40px; height: 40px; padding: 0;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-dark-2);
}
.ghost-btn.icon-only:hover { background: #2e2e35; color: var(--text-dark); }

/* Chat */
.chat-list { flex: 1; overflow-y: auto; padding: 6px 18px 14px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-msg.other { align-self: flex-start; align-items: flex-start; }
.chat-from { font-size: 11.5px; color: var(--text-dark-2); margin-bottom: 4px; padding: 0 4px; }
.chat-bubble {
  background: var(--surface-dark-2);
  padding: 8px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.chat-msg.me .chat-bubble {
  background: var(--accent); color: #fff;
  border-radius: 14px; border-bottom-right-radius: 4px;
}
.chat-text { font-size: 14px; line-height: 1.4; word-break: break-word; }
.chat-time { font-size: 10.5px; opacity: 0.6; align-self: flex-end; }

.chat-file {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  min-width: 200px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.chat-file:hover { background: rgba(255,255,255,.12); }
.chat-msg.me .chat-file { background: rgba(255,255,255,.18); }
.chat-msg.me .chat-file:hover { background: rgba(255,255,255,.26); }
.chat-file-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: inherit;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.chat-file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-file-name {
  font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 160px;
}
.chat-file-size { font-size: 11px; opacity: 0.7; }
.chat-file-dl {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.12);
  display: grid; place-items: center;
  color: inherit;
  flex-shrink: 0;
  transition: background .15s;
}
.chat-file:hover .chat-file-dl { background: rgba(255,255,255,.24); }

/* Emoji popover */
.emoji-wrap { position: relative; flex-shrink: 0; }
.composer-icon.active { background: var(--surface-dark-2); color: var(--text-dark); }
.emoji-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 10px;
  width: 260px;
  box-shadow: var(--shadow-pop);
  animation: pop .15s ease;
  z-index: 10;
}
.emoji-pop-head {
  font-size: 11px; color: var(--text-dark-2);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 6px; padding: 0 4px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
}
.emoji-btn {
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 18px;
  background: transparent;
  transition: background .12s, transform .1s;
}
.emoji-btn:hover { background: rgba(255,255,255,.08); }
.emoji-btn:active { transform: scale(0.92); }

.chat-composer {
  border-top: 1px solid var(--border-dark);
  padding: 12px 12px;
  display: flex; align-items: center; gap: 6px;
}
.composer-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-dark-2);
  flex-shrink: 0;
}
.composer-icon:hover { background: var(--surface-dark-2); color: var(--text-dark); }
.composer-input {
  flex: 1; min-width: 0;
  background: var(--surface-dark-2);
  border: 0; outline: none;
  padding: 9px 14px; border-radius: 999px;
  color: var(--text-dark); font-size: 14px;
}
.composer-send {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-dark-2); color: var(--text-dark-2);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.composer-send.ready { background: var(--accent); color: #fff; }
.composer-send.ready:hover { background: var(--accent-2); }

/* Control bar */
.control-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 18px;
  gap: 16px;
  position: relative;
}
.ctrl-left, .ctrl-right { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.ctrl-right { justify-content: flex-end; }
.ctrl-center { display: flex; align-items: center; gap: 8px; }

.ctrl-icon, .ctrl-pill {
  background: var(--surface-dark);
  color: var(--text-dark);
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, transform .1s;
}
.ctrl-icon { width: 44px; height: 44px; }
.ctrl-icon:hover { background: var(--surface-dark-2); }
.ctrl-icon.danger { background: rgba(216,65,60,.18); color: #ff6b6b; }
.ctrl-icon.danger:hover { background: rgba(216,65,60,.28); }

.ctrl-pill {
  height: 44px; padding: 0 14px;
}
.ctrl-pill.labeled { padding: 0 18px; gap: 8px; font-size: 14px; }
.ctrl-pill:not(.labeled) { width: 44px; }
.ctrl-pill:hover { background: var(--surface-dark-2); }
.ctrl-pill.active { background: var(--surface-dark-2); outline: 2px solid #2bd47f; outline-offset: -2px; }
.ctrl-pill.sharing { background: rgba(43,212,127,.18); color: #4adb91; outline: 2px solid #2bd47f; outline-offset: -2px; }
.ctrl-pill.hand-on { background: rgba(246,185,74,.22); color: #f6b94a; outline: 2px solid #f6b94a; outline-offset: -2px; }
.ctrl-pill.hand-on svg { animation: handwave 1.4s ease-in-out infinite; }
.ctrl-pill .badge {
  background: #2bd47f; color: #0e2a1a;
  font-size: 11px; font-weight: 600; font-style: normal;
  padding: 1px 7px; border-radius: 10px;
}

.ctrl-hangup {
  height: 44px; padding: 0 22px;
  border-radius: 999px;
  background: #d8413c; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  transition: background .15s;
}
.ctrl-hangup:hover { background: #c1322e; }

/* Share link popover */
.share-link-wrap { position: relative; }
.share-link-pop {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  padding: 14px;
  width: 280px;
  box-shadow: var(--shadow-pop);
  animation: pop .15s ease;
  z-index: 10;
}
.share-link-pop::after {
  content: '';
  position: absolute;
  bottom: -7px; left: 18px;
  width: 12px; height: 12px;
  background: var(--surface-dark);
  border-right: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
  transform: rotate(45deg);
}
.share-link-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.share-link-no {
  font-size: 13px; color: var(--text-dark-2);
  font-family: 'JetBrains Mono', monospace;
}
.share-link-copy {
  width: 100%; padding: 10px;
  background: var(--surface-dark-2);
  border-radius: 10px; color: var(--text-dark);
  font-size: 13.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .35s ease, color .35s ease;
}
.share-link-copy:hover { background: #2e2e35; }
.share-link-copy svg { color: var(--text-dark-2); transition: color .35s ease; }
.share-link-copy.flash { background: #2bd47f; color: #0e2a1a; }
.share-link-copy.flash svg { color: #0e2a1a; }
.share-link-close {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-dark-2);
  background: transparent;
  border: 0;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.share-link-close:hover { background: rgba(255,255,255,.08); color: var(--text-dark); }

/* More menu */
.more-wrap { position: relative; }
.more-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 6px;
  min-width: 200px;
  box-shadow: var(--shadow-pop);
  animation: pop .15s ease;
  z-index: 10;
}
.more-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-dark);
  font-size: 14px;
  text-align: left;
  transition: background .15s;
}
.more-item:hover { background: var(--surface-dark-2); }
.more-item svg { color: var(--text-dark-2); }

/* Settings modal (dark) */
.modal-backdrop.dark { background: rgba(0,0,0,.55); }
.settings-modal {
  background: #1c1c20;
  border: 1px solid var(--border-dark);
  border-radius: 18px;
  width: min(820px, calc(100vw - 40px));
  height: min(580px, calc(100vh - 60px));
  color: var(--text-dark);
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-pop);
  animation: pop .2s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.settings-close {
  position: absolute; top: 20px; right: 20px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid #2bd47f; color: #2bd47f;
  background: transparent;
  z-index: 2;
}
.settings-close:hover { background: rgba(43,212,127,.12); }
.settings-head {
  padding: 24px 28px 18px;
  font-size: 22px; font-weight: 600;
}
.settings-body { flex: 1; display: flex; min-height: 0; }

.settings-nav {
  width: 220px;
  flex-shrink: 0;
  padding: 4px 12px 20px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-dark-2);
  font-size: 14.5px;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text-dark); }
.nav-item.active { background: var(--surface-dark-2); color: var(--text-dark); }
.nav-item svg { flex-shrink: 0; }

.settings-content {
  flex: 1;
  min-width: 0;
  padding: 0 24px 24px;
  overflow: hidden;
}
.settings-scroll {
  height: 100%;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding-right: 4px;
}
.settings-scroll::-webkit-scrollbar { width: 6px; }
.settings-scroll::-webkit-scrollbar-thumb { background: #38383f; border-radius: 6px; }

.set-card {
  background: var(--surface-dark-2);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.set-card-head { display: flex; align-items: center; justify-content: space-between; }
.set-card-title { font-size: 15px; font-weight: 600; }
.set-level { display: flex; gap: 3px; align-items: center; }
.lvl-bar {
  width: 4px; height: 12px; border-radius: 2px;
  background: #3a3a42;
  transition: background .15s, height .15s;
}
.lvl-bar.on { background: #2bd47f; }
.lvl-bar.on:nth-child(3) { height: 14px; }
.lvl-bar.on:nth-child(4) { height: 10px; }

.set-row { display: flex; gap: 10px; align-items: stretch; }
.set-row.spaced { justify-content: space-between; align-items: center; }
.set-label { color: var(--text-dark-2); font-size: 14px; }

.check-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px;
  background: #2e2e35;
  border-radius: 10px;
  color: var(--text-dark);
  font-size: 13.5px;
  flex-shrink: 0;
  transition: background .15s;
}
.check-btn:hover { background: #38383f; }

.set-toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--text-dark);
}

/* Toggle */
.toggle {
  width: 40px; height: 22px; border-radius: 999px;
  background: #3a3a42;
  position: relative;
  transition: background .15s;
  flex-shrink: 0;
}
.toggle.on { background: #2bd47f; }
.toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s cubic-bezier(.4,.2,.2,1);
}
.toggle.on .toggle-knob { transform: translateX(18px); }

/* Select */
.select {
  position: relative;
  flex: 1;
  min-width: 0;
}
.select-trigger {
  width: 100%;
  background: #2e2e35;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  color: var(--text-dark);
  font-size: 13.5px;
  text-align: left;
}
.select-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger:hover { background: #38383f; }
.select.open .select-trigger { background: #38383f; }
.select-menu {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: #2a2a30;
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  padding: 4px;
  z-index: 5;
  box-shadow: var(--shadow-pop);
  max-height: 200px;
  overflow-y: auto;
}
.select-opt {
  display: block; width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
  color: var(--text-dark);
  transition: background .12s;
}
.select-opt:hover { background: rgba(255,255,255,.06); }
.select-opt.active { background: rgba(43,212,127,.14); color: #4adb91; }

/* Camera preview */
.cam-preview {
  height: 180px;
  background: #0e0e12;
  border-radius: 10px;
  display: grid; place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-dark);
}
.cam-fake { color: var(--text-dark-2); font-size: 13px; }
.cam-off { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-dark-2); font-size: 13px; }

/* ============ AUTH / PROFILE / PREJOIN ============ */
.input-wrap { position: relative; }
.input-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; color: var(--text-3);
  font-size: 12px; padding: 4px 8px; border-radius: 6px;
}
.input-eye:hover { background: rgba(0,0,0,.05); color: var(--text); }

.modal-foot-row {
  display: flex; justify-content: flex-end;
  margin-top: -6px; margin-bottom: 4px;
}
.text-link {
  color: var(--accent); font-size: 13px; text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

.profile-avatar-row {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 18px;
}
.profile-avatar-big {
  width: 84px; height: 84px; border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #3056ff, #6b8aff);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.profile-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-fallback {
  color: #fff; font-size: 32px; font-weight: 600;
}
.profile-avatar-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ghost-btn.dark {
  background: var(--surface-2);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text);
}
.ghost-btn.dark:hover { background: var(--border); }

.modal-input:disabled { color: var(--text-3); background: var(--bg-light); cursor: not-allowed; }

/* PRE-JOIN */
.prejoin {
  background: #1c1c20;
  border: 1px solid var(--border-dark);
  border-radius: 18px;
  width: min(720px, calc(100vw - 40px));
  color: var(--text-dark);
  padding: 18px 18px 22px;
  position: relative;
  box-shadow: var(--shadow-pop);
  animation: pop .2s cubic-bezier(.2,.8,.2,1);
}
.prejoin-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--text-dark);
  display: grid; place-items: center;
  z-index: 3;
  transition: background .15s;
}
.prejoin-close:hover { background: rgba(255,255,255,.16); }

.prejoin-stage {
  position: relative;
  background: #0e0e12;
  border-radius: 14px;
  height: 320px;
  display: grid; place-items: center;
  overflow: hidden;
}
.prejoin-avatar-big {
  width: 160px; height: 160px; border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #3056ff, #6b8aff);
  display: grid; place-items: center;
  z-index: 1;
}
.prejoin-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.prejoin-avatar-fallback { color: #fff; font-size: 64px; font-weight: 600; }
.prejoin-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 80px;
  background: linear-gradient(180deg, transparent, #1c1c20);
  pointer-events: none;
  z-index: 2;
}
.prejoin-camera {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, #2a3a55 0%, #161922 70%);
  display: grid; place-items: center;
}
.prejoin-camera-fake {
  color: rgba(255,255,255,.7); font-size: 15px;
  font-family: 'JetBrains Mono', monospace;
}
.prejoin-camera-badge {
  position: absolute; top: 14px; left: 14px;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
  backdrop-filter: blur(6px);
}
.rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2bd47f;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.prejoin-identity {
  text-align: center; padding: 18px 0 6px;
}
.prejoin-name { font-size: 22px; font-weight: 600; }
.prejoin-login { font-size: 13px; color: var(--text-dark-2); margin-top: 4px; }

.prejoin-level {
  display: flex; gap: 3px; justify-content: center;
  margin: 6px 0 0;
}
.plvl-bar {
  width: 4px; height: 14px; border-radius: 2px;
  background: #2c2c33;
  transition: background .12s, height .12s;
}
.plvl-bar.on { background: #2bd47f; height: 18px; }

.prejoin-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.prejoin-side { display: flex; gap: 10px; }
.prejoin-side.end { justify-content: flex-end; }
.prejoin-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: #2a2a30;
  color: var(--text-dark);
  display: grid; place-items: center;
  transition: background .15s, color .15s, box-shadow .15s;
}
.prejoin-icon:hover { background: #33333a; }
.prejoin-icon.off { color: var(--text-dark-2); }
.prejoin-icon.on { background: rgba(43,212,127,.18); color: #4adb91; box-shadow: inset 0 0 0 1.5px rgba(43,212,127,.5); }

.prejoin-join {
  background: #2bd47f; color: #0e2a1a;
  font-weight: 600; font-size: 15px;
  padding: 12px 36px;
  border-radius: 999px;
  transition: background .15s, transform .1s;
}
.prejoin-join:hover { background: #46df93; }
.prejoin-join:active { transform: translateY(1px); }

/* Tile avatar img variant */
.tile-avatar-img {
  background: #2a2a2e;
  object-fit: cover;
  padding: 0;
  border-radius: 50%;
}

/* PreJoin name input */
.prejoin-name-field {
  display: flex; justify-content: center;
}
.prejoin-name-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dark);
  font-size: 22px; font-weight: 600;
  text-align: center;
  padding: 4px 12px;
  border-radius: 8px;
  outline: none;
  width: clamp(160px, 60%, 360px);
  transition: background .15s, border-color .15s;
}
.prejoin-name-input:hover { background: rgba(255,255,255,.04); }
.prejoin-name-input:focus { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); }
.prejoin-login.subtle { color: var(--text-3); font-style: italic; }

/* Upcoming empty (signed out) */
.upcoming-empty {
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.upcoming-empty-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.upcoming-empty-title { font-size: 16px; font-weight: 600; }
.upcoming-empty-sub { color: var(--text-2); font-size: 14px; margin-bottom: 6px; }

.upcoming-list.expanded {
  max-height: 320px;
  overflow-y: auto;
}
.upcoming-list.expanded::-webkit-scrollbar { width: 6px; }
.upcoming-list.expanded::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }

/* ============ SCHEDULE MODAL: with picker ============ */
.schedule-modal {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
}
.schedule-body {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 22px;
  flex: 1;
  min-height: 0;
}
.schedule-left { display: flex; flex-direction: column; }
.schedule-right {
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
  padding-left: 22px;
  min-height: 0;
}
.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-2); font-weight: 500;
  margin-bottom: 8px;
}
.field-count {
  color: var(--accent); font-style: normal; font-weight: 500; font-size: 12px;
  background: var(--accent-soft); padding: 2px 8px; border-radius: 999px;
}

/* People picker */
.picker {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0; flex: 1;
}
.picker-search {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-2);
}
.picker-search input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 14px; color: var(--text);
}
.picker-clear {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-3);
}
.picker-clear:hover { background: rgba(0,0,0,.06); color: var(--text); }

.picker-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 92px; overflow-y: auto;
  padding: 4px 0;
}
.picker-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 4px 3px 3px;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
}
.chip-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  color: #fff; font-size: 10px; font-weight: 600;
  display: grid; place-items: center;
}
.chip-name { padding: 0 2px 0 0; }
.chip-x {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2);
}
.chip-x:hover { background: rgba(0,0,0,.08); color: var(--text); }

.picker-list {
  flex: 1; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 6px;
  min-height: 200px;
}
.picker-list::-webkit-scrollbar { width: 6px; }
.picker-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }

.picker-dept-head, .picker-team-head {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background .12s;
}
.picker-dept-head:hover, .picker-team-head:hover { background: rgba(0,0,0,.04); }
.picker-team-head {
  font-weight: 500;
  color: var(--text-2);
  padding-left: 28px;
  font-size: 13.5px;
}
.picker-chev {
  transition: transform .15s;
  color: var(--text-3);
  flex-shrink: 0;
}
.picker-dept-head.open .picker-chev, .picker-team-head.open .picker-chev { transform: rotate(0deg); }
.picker-dept-head:not(.open) .picker-chev, .picker-team-head:not(.open) .picker-chev { transform: rotate(-90deg); }
.picker-dept-name { flex: 1; }
.picker-team-head > span:not(.picker-count):not(.picker-sel-count) { flex: 1; }
.picker-count {
  background: rgba(0,0,0,.06); color: var(--text-2);
  font-size: 11px; padding: 1px 7px; border-radius: 10px;
  font-weight: 500;
}
.picker-sel-count {
  background: var(--accent); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 10px;
  font-weight: 500;
}
.picker-team-people { padding-left: 12px; }

.person-pick {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 6px 8px 6px 8px;
  background: transparent; border-radius: 8px;
  text-align: left;
  transition: background .12s;
}
.person-pick:hover { background: rgba(0,0,0,.04); }
.person-pick.selected { background: var(--accent-soft); }
.person-pick-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.person-pick-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-pick-name { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-pick-meta { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-pick-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border-2);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.person-pick-check.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.picker-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

/* Responsive: very narrow */
@media (max-width: 920px) {
  .stage-grid { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .side-panel { width: 280px; }
  .ctrl-pill.labeled span { display: none; }
  .ctrl-pill.labeled { padding: 0; width: 44px; }
}
