/* SafeBot.Chat — Meet/Zoom-style app shell with a privacy identity. */

:root {
  /* Light surfaces (landing / docs) */
  --bg:        #F6F7FB;
  --bg-2:      #EEF0F6;
  --surface:   #FFFFFF;
  --surface-2: #F9FAFD;
  --border:    #E4E7EF;
  --border-2:  #CFD4E0;
  --text:      #0D1020;
  --text-2:    #4B5266;
  --text-3:    #7B8196;

  /* Dark surfaces (room) */
  --d-bg:       #0B0D14;
  --d-bg-2:     #11141D;
  --d-surface:  #161A24;
  --d-surface-2:#1D2230;
  --d-border:   #262B39;
  --d-border-2: #2F3647;
  --d-text:     #F2F4FA;
  --d-text-2:   #AFB6CA;
  --d-text-3:   #7B8299;

  /* Accents */
  --primary:    #6D7CFF;  /* indigo */
  --primary-2:  #8A96FF;
  --primary-d:  #4D5AE0;
  --ok:         #22C55E;  /* encrypted green */
  --ok-2:       #16A34A;
  --warn:       #F59E0B;
  --danger:     #EF4444;
  --danger-2:   #DC2626;

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-sm: 0 1px 2px rgba(10,12,24,.06), 0 1px 1px rgba(10,12,24,.04);
  --shadow:    0 10px 30px -18px rgba(10,12,24,.25), 0 2px 4px rgba(10,12,24,.05);
  --shadow-lg: 0 40px 80px -40px rgba(10,12,24,.35), 0 6px 12px rgba(10,12,24,.06);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01" 1, "cv11" 1;
  overflow-x: hidden;
}
a { color: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; position: relative; }

/* ---- Top bar (landing / docs) ------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 600; padding: 4px 6px; margin-left: -6px; border-radius: 8px; }
.wordmark__logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #9A66FF 100%);
  display: inline-flex; align-items: center; justify-content: center; color: white;
  box-shadow: 0 8px 20px -8px rgba(109,124,255,0.55);
}
.wordmark__name { font-size: 19px; letter-spacing: -0.01em; }

.nav-links { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.nav-link { color: var(--text-2); padding: 8px 12px; text-decoration: none; font-weight: 500; font-size: 14px; border-radius: 8px; transition: background .15s ease, color .15s ease; white-space: nowrap; }
.nav-link:hover { background: var(--bg-2); color: var(--text); }

/* On narrow viewports, collapse the landing nav to just the CTA. */
@media (max-width: 680px) {
  .nav-links .nav-link { display: none; }
  .topbar-inner { height: 60px; }
}

/* ---- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background .14s ease, color .14s ease, border-color .14s ease, transform .1s ease, box-shadow .14s ease;
  line-height: 1; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 10px 24px -12px rgba(109,124,255,.6); }
.btn--primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-2); border-color: var(--border-2); }
.btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover { background: var(--danger-2); border-color: var(--danger-2); }
.btn--square { border-radius: 12px; }
.btn--lg { padding: 14px 22px; font-size: 15px; }
.btn--sm { padding: 7px 12px; font-size: 13px; }

/* ---- Landing hero ------------------------------------------------- */
.hero { padding: 88px 0 40px; position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } }

.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, white);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--primary-d);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.eyebrow-pill .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 24%, transparent); }

.hero h1 {
  font-size: clamp(36px, 5.6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 700;
  margin: 20px 0 20px;
}
.hero h1 .grad {
  background: linear-gradient(92deg, var(--primary) 0%, #9A66FF 55%, #D06EFF 100%);
  background-clip: text; -webkit-background-clip: text; color: transparent;
}
.hero .deck { color: var(--text-2); font-size: clamp(16.5px, 1.3vw, 18.5px); max-width: 540px; margin: 0 0 28px; line-height: 1.55; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .trust { display: inline-flex; align-items: center; gap: 14px; margin-top: 26px; color: var(--text-3); font-size: 13px; }
.hero .trust .sep { width: 4px; height: 4px; border-radius: 999px; background: var(--border-2); }

/* ---- Room mockup (landing visual) -------------------------------- */
.mockup {
  background: var(--d-bg);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
  min-height: 420px;
}
.mockup::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(800px 300px at 0% 0%, rgba(109,124,255,.18), transparent 60%),
    radial-gradient(600px 300px at 100% 100%, rgba(208,110,255,.14), transparent 60%);
  pointer-events: none;
}
.mockup__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 12px; color: var(--d-text-2); font-size: 12px; position: relative; z-index: 1;
}
.mockup__dots { display: inline-flex; gap: 6px; }
.mockup__dots span { width: 10px; height: 10px; border-radius: 999px; background: #2A2F3D; }
.mockup__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; position: relative; z-index: 1; }
.mockup__tile {
  aspect-ratio: 4/3; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: rgba(255,255,255,0.92); font-size: 28px; letter-spacing: .02em;
  position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.mockup__tile--speaking { box-shadow: inset 0 0 0 2px var(--primary), 0 0 0 3px rgba(109,124,255,.25); }
.mockup__tile span.who { position: absolute; bottom: 8px; left: 10px; right: 10px; font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.85); display: flex; justify-content: space-between; align-items: center; }
.mockup__tile span.who .mic { color: rgba(255,255,255,0.7); }
.mockup__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(34,197,94,0.14); color: #5DE08B;
  font-size: 11px; font-weight: 600;
}
.mockup__chip .d { width: 6px; height: 6px; background: currentColor; border-radius: 999px; }
.mockup__toolbar {
  display: flex; justify-content: center; gap: 10px; margin-top: 14px;
  padding: 10px; border-radius: 999px; background: #0F1220; width: max-content; margin-left: auto; margin-right: auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  position: relative; z-index: 1;
}
.mockup__icon { width: 34px; height: 34px; border-radius: 999px; background: #1A1E2C; display: inline-flex; align-items: center; justify-content: center; color: var(--d-text-2); }
.mockup__icon.leave { background: var(--danger); color: #fff; }

/* ---- Sections ----------------------------------------------------- */
section { padding: 80px 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head .eyebrow-pill { margin: 0 auto 14px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.02em; font-weight: 700; }
.section-head p { color: var(--text-2); margin: 0 auto; font-size: 17px; max-width: 580px; }

/* Feature / step cards */
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 880px) { .cards-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.card__icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary-d); margin-bottom: 16px; }
.card__num { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.card h3 { font-size: 19px; margin: 8px 0 8px; font-weight: 600; letter-spacing: -0.01em; }
.card p { color: var(--text-2); margin: 0; font-size: 15px; line-height: 1.55; }

/* Code card (SDK section) */
.sdk-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
@media (max-width: 920px) { .sdk-grid { grid-template-columns: 1fr; } }
.sdk-copy h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.15; margin: 14px 0 14px; letter-spacing: -0.02em; font-weight: 700; }
.sdk-copy p { color: var(--text-2); font-size: 16.5px; margin: 0 0 22px; max-width: 460px; }

.code-card {
  background: #0E111A;
  border-radius: var(--radius-lg);
  border: 1px solid #1C2030;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  color: #E6E9F4;
}
.code-card__chrome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #1C2030;
  background: #0B0E17;
}
.code-card__dots { display: inline-flex; gap: 6px; }
.code-card__dots span { width: 10px; height: 10px; border-radius: 999px; background: #252A3B; }
.code-card__label { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: #8791B0; }
.code-card pre { margin: 0; padding: 20px 22px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13.5px; line-height: 1.75; white-space: pre; overflow-x: auto; }
.tok-kw  { color: #D06EFF; }
.tok-str { color: #5DE0A0; }
.tok-com { color: #636C85; font-style: italic; }
.tok-fn  { color: #6D7CFF; }
.tok-num { color: #F59E0B; }

.copy-btn {
  font-family: inherit; font-size: 12px; font-weight: 600;
  background: transparent; border: 1px solid #252A3B; color: #8791B0;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: all .14s ease;
}
.copy-btn:hover { border-color: #343B54; color: #D4D8E8; }
.copy-btn.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

/* Testimonials */
.tt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 920px) { .tt { grid-template-columns: 1fr; } }
.tt__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.tt__quote { font-size: 16.5px; color: var(--text); margin: 0 0 18px; line-height: 1.5; }
.tt__attr { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.tt__avatar { width: 32px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; }
.tt__name { font-size: 13px; font-weight: 600; color: var(--text); }
.tt__role { font-size: 12px; color: var(--text-3); }

/* Privacy band */
.privacy-band { background: linear-gradient(180deg, #0E111B 0%, #13172A 100%); color: var(--d-text); padding: 96px 0; }
.privacy-band h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.02em; font-weight: 700; margin: 14px 0 14px; max-width: 700px; }
.privacy-band h2 .grad { background: linear-gradient(92deg, #8FA4FF 0%, #D06EFF 100%); background-clip: text; -webkit-background-clip: text; color: transparent; }
.privacy-band p { color: var(--d-text-2); font-size: 17px; max-width: 600px; }
.privacy-band .eyebrow-pill { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: var(--d-text); }
.privacy-band .eyebrow-pill .dot { background: var(--ok); }

/* Footer */
.footer { padding: 48px 0 28px; border-top: 1px solid var(--border); background: var(--surface-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; align-items: start; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; }
.footer a { display: block; color: var(--text-2); text-decoration: none; padding: 4px 0; font-size: 14.5px; }
.footer a:hover { color: var(--primary-d); }
.footer-bottom { padding-top: 28px; border-top: 1px solid var(--border); margin-top: 28px; display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 13px; }

/* --- ROOM PAGE ----------------------------------------------------- */

.room-body {
  background: var(--d-bg);
  color: var(--d-text);
  height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
}

.room-top {
  height: 56px; min-height: 56px;
  background: var(--d-bg-2);
  border-bottom: 1px solid var(--d-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  position: relative; z-index: 5;
}
.room-top__left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.room-top__title { display: flex; flex-direction: column; min-width: 0; }
.room-top__title .meeting { font-size: 14px; font-weight: 600; color: var(--d-text); line-height: 1.2; letter-spacing: -0.005em; }
.room-top__title .meta { font-size: 12px; color: var(--d-text-3); display: flex; gap: 10px; align-items: center; }
.room-top__title .meta .sep { width: 3px; height: 3px; border-radius: 999px; background: var(--d-border-2); }
.room-top__right { display: flex; align-items: center; gap: 8px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(34,197,94,0.12); color: #66E08E;
  border: 1px solid rgba(34,197,94,0.25);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; box-shadow: 0 0 0 3px rgba(34,197,94,0.18); animation: pulse-soft 2.2s ease-in-out infinite; }
@keyframes pulse-soft { 0%,100%{opacity:1} 50%{opacity:.55} }
.status-pill.is-offline { background: rgba(239,68,68,0.12); color: #FCA5A5; border-color: rgba(239,68,68,0.3); }
.status-pill.is-retry a { color: inherit; margin-left: 4px; border-bottom: 1px solid currentColor; text-decoration: none; }

.ghost-btn {
  background: transparent; color: var(--d-text-2);
  border: 1px solid var(--d-border); border-radius: 999px;
  padding: 7px 12px; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  text-decoration: none;
}
.ghost-btn:hover { background: var(--d-surface); color: var(--d-text); border-color: var(--d-border-2); }
.ghost-btn.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: rgba(34,197,94,0.08); }
.ghost-btn--primary {
  color: #fff; background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}
.ghost-btn--primary:hover { background: color-mix(in srgb, var(--primary) 32%, transparent); color: #fff; border-color: var(--primary); }
.ghost-btn--primary svg { color: #fff; }

/* Top-bar leave — red, small */
.topbar-leave {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--danger); color: #fff; text-decoration: none;
  padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--danger);
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.topbar-leave:hover { background: var(--danger-2); border-color: var(--danger-2); }
.topbar-leave:active { transform: translateY(1px); }

.topbar-people-btn { display: none; }
@media (max-width: 820px) { .topbar-people-btn { display: inline-flex; } }

/* Tablet / laptop squeeze — drop text labels on the topbar copy buttons */
@media (max-width: 820px) {
  .label-desktop { display: none; }
  .room-top__left > div[style*="width:1px"] { display: none; }
  .room-top__title .meta { font-size: 11px; }
}

/* Phone — hide the meeting info and the "encrypted" status label text,
   keep the shield icon + dot so users still see the security state. */
@media (max-width: 560px) {
  .room-top { padding: 0 10px; height: 52px; }
  .room-top__left { gap: 10px; }
  .room-top__right { gap: 6px; }
  .wordmark__name { font-size: 0; }              /* hide text */
  .wordmark__name .wordmark__logo { font-size: 19px; } /* keep logo size */
  .room-top__title { display: none; }             /* hide "Meeting · XXX" */
  .status-pill { padding: 6px 8px; }
  .status-pill #status-label { display: none; }   /* icon-only */
  .ghost-btn { padding: 7px 9px; }
  .topbar-leave { padding: 7px 10px; }
}

/* Ultra-narrow (<=340) — drop one more button label */
@media (max-width: 360px) {
  .topbar-leave span { display: none; }
  .room-top { padding: 0 8px; }
}

.room-main {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr 280px;
  background: var(--d-bg);
  position: relative;
}
/* iPad-portrait-friendly: rail visible down to 820px. Below that, collapse. */
@media (max-width: 820px) {
  .room-main { grid-template-columns: 1fr; }
  .room-main.people-open { grid-template-columns: 1fr 280px; }
}
/* On very narrow phones, the opened rail should cover the chat instead of
   squeezing it to nothing. */
@media (max-width: 520px) {
  .room-main.people-open { grid-template-columns: 1fr; }
  .room-main.people-open .stage { display: none; }
}

/* People rail — on the RIGHT, always visible on desktop. On mobile, when
   collapsed it's removed from layout entirely (no phantom off-screen nodes). */
.rail-people {
  background: var(--d-bg-2);
  border-left: 1px solid var(--d-border);
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}
@media (max-width: 820px) {
  .rail-people { display: none; }
  .room-main.people-open .rail-people { display: flex; }
}

.rail-people__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--d-border);
}
.rail-people__head h4 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.rail-people__head .muted { color: var(--d-text-3); font-size: 12px; margin-top: 2px; }
.rail-people__toggle { display: none; }
@media (max-width: 980px) { .rail-people__toggle { display: inline-flex; } }

.rail-people__list { flex: 1; overflow-y: auto; padding: 8px; }

.rail-people__list .people__row,
.people__row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  transition: background .15s ease;
}
.rail-people__list .people__row:hover { background: var(--d-surface-2); }
.rail-people__list .people__row.is-stale { opacity: .45; }

.rail-people__foot {
  padding: 14px 16px; border-top: 1px solid var(--d-border);
  background: var(--d-bg-2);
}
.rail-people__foot .eyebrow-foot {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--d-text-3); margin-bottom: 6px;
}
.rail-people__foot .code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; color: var(--d-text-2); letter-spacing: 0.04em;
  word-break: break-all;
}
.rail-people__foot-help {
  font-size: 11.5px; color: var(--d-text-3); margin-top: 6px; line-height: 1.45;
}

.dock__btn--mobile-only { display: none; }
@media (max-width: 980px) { .dock__btn--mobile-only { display: inline-flex; } }

/* Stage — chat transcript + composer (the main surface).
   Reset padding explicitly: the landing page's `section { padding: 80px 0 }`
   rule otherwise bleeds into this <section class="stage">. */
.stage {
  padding: 0;
  position: relative; min-width: 0; min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;   /* chat fills, composer shrinks to content */
}

.chat-list {
  min-height: 0; overflow-y: auto;
  padding: 22px 24px 16px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
@media (max-width: 620px) { .chat-list { padding: 16px 14px 12px; } }

/* Main composer sits inside the stage — opaque and above chat-list visually */
.composer-main {
  position: relative; z-index: 5;
  border-top: 1px solid var(--d-border);
  background: var(--d-bg-2);
  padding: 14px 20px 16px;
}
.composer-main__inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.composer-main__row { display: flex; gap: 10px; align-items: flex-end; }
.composer-main textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 160px;
  background: var(--d-surface); color: var(--d-text);
  border: 1px solid var(--d-border); border-radius: 14px;
  padding: 11px 14px; font: inherit; font-size: 14.5px; line-height: 1.5; outline: none;
}
.composer-main textarea::placeholder { color: var(--d-text-3); }
.composer-main textarea:focus { border-color: var(--primary); }

/* Stage empty state = prominent invite card.
   Centered when there's extra vertical space, but allows the card to grow
   and the parent .chat-list to scroll when the card is taller than the pane
   (e.g. the "Advanced" accordion is open on a short viewport). */
.stage-empty {
  flex: 1; min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  color: var(--d-text-2);
  padding: 20px 0;
}

.invite-card {
  pointer-events: auto;
  width: min(620px, 100%);
  padding: 30px 36px 24px;
  background: linear-gradient(180deg, rgba(109,124,255,0.06), rgba(138,102,255,0.03) 60%, transparent), var(--d-surface);
  border: 1px solid var(--d-border-2);
  border-radius: var(--radius-xl);
  box-shadow:
    0 48px 80px -48px rgba(0,0,0,0.55),
    0 0 0 1px rgba(109,124,255,0.08),
    0 0 80px -40px rgba(109,124,255,0.35);
  animation: inviteIn .6s cubic-bezier(.2,.7,.25,1);
}
@keyframes inviteIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.invite-card__head { margin-bottom: 22px; }
.invite-card__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(34,197,94,0.1); color: #66E08E;
  border: 1px solid rgba(34,197,94,0.25);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.invite-card h3 {
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 700;
  color: var(--d-text); margin: 0 0 10px; letter-spacing: -0.015em;
}
.invite-card p { color: var(--d-text-2); font-size: 14.5px; margin: 0; max-width: 440px; margin-inline: auto; line-height: 1.55; }

.invite-url {
  display: flex; align-items: center; gap: 10px;
  background: var(--d-bg); border: 1px solid var(--d-border);
  padding: 12px 14px; border-radius: 12px;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
  margin: 0 0 18px;
  text-align: left;
}
.invite-url:hover, .invite-url:focus-visible { border-color: var(--primary); background: rgba(109,124,255,0.05); outline: none; }
.invite-url__ico { color: var(--d-text-3); flex: 0 0 auto; }
.invite-url__text {
  flex: 1; min-width: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px; color: var(--d-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  user-select: all;
}
.invite-url__hint {
  flex: 0 0 auto; font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--d-text-3);
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--d-border);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.invite-url.ok .invite-url__hint { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: rgba(34,197,94,0.1); }

.invite-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 22px;
}
.invite-actions .btn--primary {
  padding: 13px 24px; font-size: 15px;
  box-shadow: 0 16px 30px -14px rgba(109,124,255,0.6);
}

.invite-foot {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding-top: 18px; border-top: 1px dashed var(--d-border);
}
.invite-foot__chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--d-text-3);
}
.invite-foot__chip .code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--d-text-2); letter-spacing: 0.04em;
}

.invite-advanced {
  margin: 0 0 18px;
  border-top: 1px dashed var(--d-border);
  padding-top: 14px;
}
.invite-advanced summary {
  cursor: pointer; list-style: none; color: var(--d-text-3);
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 6px;
  user-select: none;
}
.invite-advanced summary::-webkit-details-marker { display: none; }
.invite-advanced summary::before {
  content: "▸"; display: inline-block; color: var(--d-text-3);
  transition: transform .15s ease;
}
.invite-advanced[open] summary::before { transform: rotate(90deg); }
.invite-advanced summary:hover { color: var(--d-text-2); }
.invite-advanced__body { margin-top: 12px; text-align: left; }
.invite-advanced__body p { color: var(--d-text-3); font-size: 13px; margin: 0 0 8px; }
.invite-advanced__body pre {
  background: var(--d-bg); border: 1px solid var(--d-border);
  padding: 10px 12px; border-radius: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px; color: var(--d-text-2); line-height: 1.55;
  white-space: pre-wrap; word-break: break-all; margin: 0 0 10px;
}

@media (max-width: 620px) {
  .invite-card { padding: 28px 22px 22px; }
}

/* ---- Chat side panel --------------------------------------------- */
.chat {
  min-width: 0; overflow: hidden;
  background: var(--d-bg-2);
  border-left: 1px solid var(--d-border);
  display: flex; flex-direction: column;
}
.chat__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--d-border); }
.chat__head h4 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.chat__head .muted { color: var(--d-text-3); font-size: 12px; }
.chat__close { background: transparent; border: 0; color: var(--d-text-2); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chat__close:hover { background: var(--d-surface); color: var(--d-text); }

.chat__list { flex: 1; overflow-y: auto; padding: 14px 14px 4px; display: flex; flex-direction: column; gap: 8px; }

.bubble {
  max-width: min(640px, 78%);
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px; border-radius: 14px;
  font-size: 14.5px; line-height: 1.5;
  word-wrap: break-word; overflow-wrap: anywhere;
  animation: bubbleIn .22s ease-out;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.bubble__meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 500; color: var(--d-text-3); }
.bubble__meta .sender { color: var(--d-text-2); }
.bubble__ava {
  width: 20px; height: 20px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 9.5px;
  flex: 0 0 auto;
}
.bubble__body { color: var(--d-text); white-space: pre-wrap; }
.bubble--self { align-self: flex-end; background: color-mix(in srgb, var(--primary) 28%, #1A1F33); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.bubble--self .bubble__body { color: #F1F3FC; }
.bubble--other { align-self: flex-start; background: var(--d-surface); border: 1px solid var(--d-border); }

.chat__empty { color: var(--d-text-3); font-size: 13px; text-align: center; padding: 40px 20px; }

.chat__compose { padding: 12px 14px 14px; border-top: 1px solid var(--d-border); background: var(--d-bg-2); }
.chat__compose form { display: flex; flex-direction: column; gap: 8px; }
.namechip {
  background: var(--d-surface); color: var(--d-text);
  border: 1px solid var(--d-border); border-radius: 10px;
  padding: 8px 12px; font-size: 12px; width: 100%; outline: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.namechip:focus { border-color: var(--primary); }
.chat__row { display: flex; gap: 8px; align-items: flex-end; }
.chat__row textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 140px;
  background: var(--d-surface); color: var(--d-text);
  border: 1px solid var(--d-border); border-radius: 14px;
  padding: 10px 14px; font: inherit; font-size: 14.5px; line-height: 1.45; outline: none;
}
.chat__row textarea::placeholder { color: var(--d-text-3); }
.chat__row textarea:focus { border-color: var(--primary); }
.chat__send {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary); color: #fff; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .1s ease;
}
.chat__send:hover { background: var(--primary-d); }
.chat__send:active { transform: translateY(1px); }
.chat__hint { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; color: var(--d-text-3); text-align: center; }
.chat__hint.warn { color: #FDBA74; }

/* (Bottom dock removed — Copy / Leave moved to the topbar.) */

/* ---- Participant row primitives (used in left rail) -------------- */
.people__ava { width: 28px; height: 28px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.people__name { flex: 1; font-size: 13.5px; color: var(--d-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people__tag { color: var(--d-text-3); font-size: 11.5px; }

/* ---- Link copy toast --------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(10px);
  background: var(--d-surface); color: var(--d-text);
  border: 1px solid var(--d-border); border-radius: 999px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; z-index: 100;
  transition: opacity .18s ease, transform .18s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .d { width: 6px; height: 6px; border-radius: 999px; background: var(--ok); }

/* ---- Docs page --------------------------------------------------- */
.doc-body { max-width: 800px; margin: 0 auto; padding: 64px 28px 120px; }
.doc-body h1 { font-size: clamp(36px, 5vw, 48px); margin: 14px 0 12px; letter-spacing: -0.02em; line-height: 1.05; font-weight: 700; }
.doc-body h2 { font-size: 24px; margin: 56px 0 12px; letter-spacing: -0.01em; font-weight: 650; }
.doc-body h3 { font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-d); margin: 28px 0 8px; font-weight: 600; }
.doc-body p { color: var(--text-2); font-size: 16px; line-height: 1.68; }
.doc-body p.doc-lead { font-size: 18.5px; color: var(--text); max-width: 700px; margin: 0 0 34px; }
.doc-body code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--text); }
.doc-body pre { background: #0E111A; color: #E6E9F4; border: 1px solid #1C2030; padding: 16px 20px; margin: 16px 0 24px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; line-height: 1.7; overflow-x: auto; border-radius: var(--radius); }
.doc-body pre code { background: none; padding: 0; border: 0; color: inherit; }
.doc-body ul { padding-left: 22px; color: var(--text-2); }
.doc-body li { margin: 6px 0; }
.doc-toc { display: flex; flex-wrap: wrap; gap: 8px 6px; padding: 10px 14px; margin: 22px 0 36px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); align-items: center; }
.doc-toc .eyebrow-pill { margin: 0 6px 0 0; }
.doc-toc a { color: var(--text-2); text-decoration: none; font-size: 13.5px; padding: 8px 10px; border-radius: 8px; min-height: 32px; display: inline-flex; align-items: center; }
.doc-toc a:hover { background: var(--bg-2); color: var(--text); }
.link-u { color: var(--text); border-bottom: 1px solid var(--primary); text-decoration: none; padding: 6px 2px; display: inline-block; }
.link-u:hover { color: var(--primary-d); }

/* Utility */
.stack-y-sm > * + * { margin-top: 10px; }
