:root {
  --paper: #e9ecf2;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --ink: #15181f;
  --mist: #666e80;
  --line: #d6dbe6;
  --accent: #2f56cf;
  --accent-soft: #e6ecfd;
  --live: #128a5c;
  --warn: #a8500b;
  --radius: 10px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--body);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- buttons & fields ---------- */

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 500;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #2648ad; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--mist); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }
.btn--icon { padding: 8px; display: grid; place-items: center; color: var(--mist); }
.btn--icon:hover:not(:disabled) { color: var(--accent); }

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}
.field:focus { border-color: var(--accent); outline: none; }
.field--sm { padding: 6px 9px; font-size: 13px; }

/* ---------- sign in ---------- */

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate__card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
}
.gate__eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 12px;
}
.gate__title {
  font-family: var(--display);
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 8px;
}
.gate__hint { color: var(--mist); margin: 0 0 20px; }
.gate__row { display: flex; gap: 8px; }
.gate__row .field { flex: 1; }
.gate__go { width: 100%; margin-top: 4px; }
.gate__error { color: #b3261e; min-height: 20px; margin: 10px 0 0; font-size: 13px; }
.gate__error:empty { display: none; }
/* the moment between opening and being signed in */
.booting { position: fixed; inset: 0; display: grid; place-items: center; color: var(--mist); font-size: 14px; }

/* ---------- shell ---------- */

.app {
  height: 100%;
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 12px;
  padding: 12px;
}

.rail, .pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 0;
}

/* ---------- rail ---------- */

.rail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rail__me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.rail__name {
  font-family: var(--display);
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Name and status stay put; everything between them scrolls as one. */
.rail__scroll { flex: 1; min-height: 0; overflow-y: auto; }
.rail__block { padding: 14px 12px 10px; }
.rail__block + .rail__block { border-top: 1px solid var(--line); }
.rail__block--rooms { padding-bottom: 2px; }
.rail__title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tally {
  background: var(--surface-2);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 10.5px;
  letter-spacing: 0;
  white-space: nowrap;
}
.rail__empty { color: var(--mist); font-size: 13px; padding: 0 4px 6px; margin: 0; }
.rail__new { display: flex; gap: 6px; padding: 8px 4px 12px; }
.rail__new .field { flex: 1; }
.rail__foot { border-top: 1px solid var(--line); padding: 6px 8px; }
.rail__settings {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.rail__settings:hover { background: var(--surface-2); }
.rail__settings svg { color: var(--mist); }

/* the connection, only while it's down or coming back */
.netbar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid #f1d19b;
  border-radius: 999px;
  background: #fff4e0;
  color: #7a4a00;
  font-size: 13px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.netbar.is-down { padding-right: 6px; border-color: #f3c1bc; background: #fdecea; color: #8f1e18; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { margin-bottom: 2px; }
.entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}
.entry:hover { background: var(--surface-2); }
.entry.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.entry__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry__hash { font-family: var(--mono); color: var(--mist); }
.entry.is-active .entry__hash { color: var(--accent); }
.entry__meta { font-family: var(--mono); font-size: 10.5px; color: var(--mist); }
.badge {
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 10.5px;
  border-radius: 20px;
  padding: 1px 6px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.dot--live { background: var(--live); }

/* ---------- pane ---------- */

.pane {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.pane__title {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: -.01em;
  margin: 0;
}
.pane__sub { margin: 2px 0 0; color: var(--mist); font-size: 12.5px; }

.log {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.log__empty {
  margin: auto;
  text-align: center;
  color: var(--mist);
}
.log__empty p { font-family: var(--display); font-size: 15px; margin: 0 0 4px; color: var(--ink); }
.log__empty span { font-size: 13px; }
.log__more { align-self: center; }

.msg { max-width: min(560px, 82%); }
/* Your messages keep a narrow column on their right for the "seen" eye, as in Teams. */
.msg--mine { align-self: flex-end; margin-right: 22px; }
/* Bubbles fit what they say; the box around them is wide enough for the toolbar. */
.msg:not(.msg--mine) { align-self: flex-start; min-width: min(300px, 100%); }
.msg__meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mist);
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
}
.msg--mine .msg__meta { justify-content: flex-end; }
.msg__body {
  position: relative;
  width: fit-content;
  max-width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg--mine .msg__body { margin-left: auto; }
.msg--mine .msg__body {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
/*
 * The toolbar over a message's top corner, as in Teams: quick reactions, more, edit, "⋯".
 * It shows on hover, from the keyboard, and on a tap on touch screens (messages take focus).
 */
.msg { position: relative; }
.msg:focus { outline: none; }
.msg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.msg__tools {
  position: absolute;
  top: -18px;
  right: 0;
  z-index: 3;
  display: none;
  align-items: center;
  gap: 1px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16, 19, 25, .13);
}
.msg:hover > .msg__tools,
.msg:focus-visible > .msg__tools,
.msg__tools:has(:focus-visible),
.msg__tools.is-open { display: flex; }
@media (hover: none) { .msg:focus-within > .msg__tools { display: flex; } }
.msg__tool {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--mist);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.msg__tool:hover, .msg__tool:focus-visible { background: var(--surface-2); color: var(--accent); }
.msg__tool--emoji { transition: transform .1s ease; }
.msg__tool--emoji:hover { transform: scale(1.18); background: transparent; }
.msg__tools-sep { width: 1px; height: 20px; margin: 0 3px; background: var(--line); }
.msg__edited { font-style: italic; }

.msg--deleted .msg__body,
.msg--mine.msg--deleted .msg__body {
  background: transparent;
  border-style: dashed;
  border-color: var(--line);
  color: var(--mist);
  font-style: italic;
}

.msg__quote {
  display: block;
  border-left: 3px solid var(--accent);
  background: rgba(47, 86, 207, .06);
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 12.5px;
  white-space: normal;
}
.msg--mine .msg__quote { border-left-color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .14); }
.msg__quote-who { display: block; font-weight: 600; font-size: 11.5px; }
.msg__quote-text { display: block; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.is-flash .msg__body { box-shadow: 0 0 0 3px rgba(47, 86, 207, .35); }

.msg__edit { display: flex; flex-direction: column; gap: 6px; min-width: min(320px, 70vw); }
.msg__edit .composer__input { width: 100%; }
.msg__edit-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* the eye beside the bubble's last line, in the column .msg--mine leaves free */
.msg__seen {
  position: absolute;
  right: -21px;
  bottom: 1px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--accent);
  white-space: normal;
}

/* A message's own time, beside the bubble on hover (or a tap); the centered line above says the day. */
.msg__time {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 400;
  color: var(--mist);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .12s ease;
}
.msg__time::after { content: attr(data-time); }
.msg--mine .msg__time { left: auto; right: calc(100% + 8px); }
.msg:hover .msg__time,
.msg:focus-within .msg__time { opacity: 1; }
.log, .thread__log { overflow-x: hidden; }

/* Messages that go together (regroup() in chat.js): the name and photo once, and closer. */
.msg--cont { margin-top: -8px; }
.thread__log .msg--cont { margin-top: -6px; }
.msg--cont > .avatar,
.msg--cont .msg__meta > :not(.msg__edited) { display: none; }
.msg--cont .msg__meta:not(:has(.msg__edited)) { display: none; }
/* With no name line above the bubble, the toolbar sits higher, off the message's text. */
.msg--bare > .msg__tools,
.msg--cont > .msg__tools { top: -30px; }

/* Where a conversation picks up — a new day, or after a pause: "Yesterday 12:34 PM". */
.log__when {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mist);
  white-space: nowrap;
}
.log__when::before,
.log__when::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.msg__notice {
  align-self: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mist);
  background: var(--surface-2);
  border-radius: 20px;
  padding: 3px 12px;
}

/* a file: its card (open or download; ⋯ → Download too) */
.file {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: min(260px, 100%);
}
.file__open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.file__info { min-width: 0; display: flex; flex-direction: column; }
.file__icon {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  background: var(--surface);
  color: var(--accent);
  border-radius: 6px;
  padding: 7px 8px;
  min-width: 42px;
  text-align: center;
  text-transform: uppercase;
}
.msg--mine .file__icon { background: rgba(255,255,255,.18); color: #fff; }
.file__name { font-weight: 500; overflow-wrap: anywhere; }
.file__size { font-family: var(--mono); font-size: 11px; opacity: .75; }
.file__thumb {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  margin-top: 8px;
  cursor: zoom-in;
}

/* "Shourya is typing…" over the message box, with Teams' three dots */
.typing {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin: 0;
  padding: 0 18px 4px;
  font-size: 12.5px;
  color: var(--mist);
}
.typing__dots { display: inline-flex; align-items: center; gap: 3px; }
.typing__dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing-dot 1.2s ease-in-out infinite;
}
.typing__dots i:nth-child(2) { animation-delay: .15s; }
.typing__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) { .typing__dots i { animation: none; } }
/* …and "typing…" beside the conversation in the list */
.entry.is-typing .entry__label::after {
  content: "typing…";
  margin-left: 6px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--accent);
}

/* ---------- upload progress ---------- */

.upload {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 18px 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12.5px;
}
.upload__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload__bar {
  width: 120px; height: 5px;
  background: var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.upload__bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.upload__pct { font-family: var(--mono); font-size: 11px; color: var(--mist); }

/* ---------- reply bar ---------- */

.replybar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 18px 8px;
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 12.5px;
}
.replybar__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.replybar__snippet { color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- composer ---------- */

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}
.composer__input {
  flex: 1;
  resize: none;
  max-height: 140px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  font-family: inherit;
}
.composer__input:focus { border-color: var(--accent); outline: none; }

/* ---------- drop target & toast ---------- */

.drop {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(47, 86, 207, .07);
  border: 2px dashed var(--accent);
  border-radius: 14px;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 500;
}
.drop.is-on { display: grid; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-width: 90vw;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
/* with an action ("Undo"), it takes clicks */
.toast.has-action { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast__action {
  border: 0;
  background: transparent;
  color: #9db5ff;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.toast__action:hover, .toast__action:focus-visible { background: rgba(255, 255, 255, .12); }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 34vh) 1fr;
  }
  .msg { max-width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ================================================================ calls */

.btn--danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.btn--danger:hover:not(:disabled) { background: #8f1e18; }

.pane__actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
/* The icons stay on one line; a long subtitle (someone's status, say) wraps instead. */
.pane__actions { flex-shrink: 0; max-width: 70%; }
.pane__actions .btn { white-space: nowrap; }
/* 👥 and how many (people.js opens the list) */
.pane__people { display: inline-flex; align-items: center; gap: 5px; color: var(--mist); font-weight: 600; }
.pane__people:hover, .pane__people[aria-expanded="true"] { color: var(--accent); }
.pane__head > div:first-child { min-width: 0; }

/* ongoing-call banner */

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 18px 0;
  padding: 9px 14px;
  background: #eef7f1;
  border: 1px solid #bfe3ce;
  border-radius: var(--radius);
  font-size: 13px;
}
.banner__pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
  flex: none;
}
.banner span:nth-child(2) { flex: 1; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}

/* the jitsi stage */

.stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #101319;
  border-radius: 14px;
  overflow: hidden;
  z-index: 5;
}
.stage.is-min {
  inset: auto 16px 88px auto;   /* above the message box, so you can still type during a call */
  width: min(360px, 70vw);
  height: 220px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32);
}
.stage__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #171b24;
  color: #eef0f4;
  border-bottom: 1px solid #262c38;
}
.stage__live {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff5f56;
  animation: pulse 1.6s ease-in-out infinite;
  flex: none;
}
.stage__title {
  font-family: var(--display);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stage__timer { font-family: var(--mono); font-size: 12px; color: #9aa2b4; }
.stage__head .btn { background: #232936; border-color: #333b4b; color: #eef0f4; }
.stage__head .btn:hover { background: #2c3342; }
.stage__head .btn--danger { background: #b3261e; border-color: #b3261e; }
.stage__frame { flex: 1; min-height: 0; }
.stage__frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* a direct call, browser to browser (rtc.js) */
.rtc { position: relative; width: 100%; height: 100%; background: #0b0d12; overflow: hidden; }
.rtc__remote { width: 100%; height: 100%; display: block; object-fit: cover; background: #0b0d12; }
.rtc__remote.is-screen { object-fit: contain; }
.rtc__remote.is-off { opacity: 0; }   /* still plays their voice */
.rtc__peer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #eef0f4;
  pointer-events: none;
}
.rtc__peer .avatar { width: 112px; height: 112px; border-radius: 50%; font-size: 40px; }
.rtc__name { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 500; }
.rtc__status { margin: 0; min-height: 18px; font-size: 13px; color: #9aa2b4; }
.rtc.is-reconnecting .rtc__status { color: #f5c26b; }
.rtc__muted {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(16, 19, 25, .72);
  color: #eef0f4;
  font-size: 12.5px;
}
.rtc__muted svg { width: 16px; height: 16px; }
.rtc__self {
  position: absolute;
  right: 16px;
  bottom: 84px;
  width: min(24%, 240px);
  min-width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: #1c2130;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  transform: scaleX(-1);   /* a camera preview reads like a mirror */
}
.rtc__self.is-screen { transform: none; object-fit: contain; }
.rtc__bar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(23, 27, 36, .86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.rtc__btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #2c3342;
  color: #eef0f4;
  cursor: pointer;
}
.rtc__btn:hover { background: #394154; }
.rtc__btn.is-off { background: #eef0f4; color: #171b24; }
.rtc__btn.is-on { background: var(--accent); color: #fff; }
.stage.is-min .rtc__self,
.stage.is-min .rtc__name { display: none; }
.stage.is-min .rtc__peer .avatar { width: 56px; height: 56px; font-size: 20px; }
.stage.is-min .rtc__bar { bottom: 8px; padding: 4px 6px; gap: 6px; }
.stage.is-min .rtc__btn { width: 32px; height: 32px; }
.stage.is-min .rtc__btn svg { width: 16px; height: 16px; }

/* a group call or meeting on LiveKit (sfu.js): a grid of people, or a shared screen and a strip */
.sfu {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0b0d12;
  overflow: hidden;
}
.sfu__main {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
  padding: 10px 10px 84px;   /* the controls float over the bottom */
}
.sfu__spot {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  background: #000;
  overflow: hidden;
}
.sfu__spot .sfu__video { object-fit: contain; }
/* rows of --cols tiles filling the space, a short last row centred, as Teams lays them out */
.sfu__grid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 8px;
}
.sfu__grid > .sfu__tile {
  width: calc((100% - (var(--cols, 1) - 1) * 8px) / var(--cols, 1));
  height: calc((100% - (var(--rows, 1) - 1) * 8px) / var(--rows, 1));
}
.sfu.is-sharing .sfu__grid {
  flex: none;
  width: 200px;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-y: auto;
}
.sfu.is-sharing .sfu__grid > .sfu__tile { flex: none; width: 100%; height: 112px; }
.sfu__tile {
  position: relative;
  min-height: 0;
  border-radius: 10px;
  background: #1c2130;
  overflow: hidden;
}
.sfu__tile.is-speaking { box-shadow: inset 0 0 0 3px #8b9cff; }
.sfu__video { width: 100%; height: 100%; display: block; object-fit: cover; }
.sfu__tile:not(.has-video) .sfu__video { display: none; }
.sfu__tile.is-local .sfu__video { transform: scaleX(-1); }   /* a camera preview reads like a mirror */
.sfu__who { position: absolute; inset: 0; display: grid; place-items: center; }
.sfu__tile.has-video .sfu__who { display: none; }
.sfu__who .avatar { width: 88px; height: 88px; border-radius: 50%; font-size: 32px; }
.sfu.is-sharing .sfu__who .avatar { width: 48px; height: 48px; font-size: 18px; }
.sfu__label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 19, 25, .72);
  color: #eef0f4;
  font-size: 12.5px;
}
.sfu__label:empty { display: none; }
.sfu__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfu__mic { display: inline-flex; color: #ff8a80; }
.sfu__mic svg { width: 14px; height: 14px; }
.sfu__more { display: grid; place-items: center; color: #eef0f4; font-family: var(--display); font-size: 22px; }
.sfu__note {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(23, 27, 36, .86);
  color: #eef0f4;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}
.sfu__note:empty { display: none; }
.sfu.is-reconnecting .sfu__note { color: #f5c26b; }
.sfu__sounds { display: none; }
.sfu__btn--sound { background: #f5c26b; color: #171b24; }
.stage.is-min .sfu__main { padding: 4px 4px 48px; }
.stage.is-min .sfu__grid > .sfu__tile { width: 100%; height: 100%; }
.stage.is-min .sfu__tile:not(.is-featured),
.stage.is-min .sfu.is-sharing .sfu__grid,
.stage.is-min .sfu__note { display: none; }
.stage.is-min .sfu__who .avatar { width: 56px; height: 56px; font-size: 20px; }
@media (max-width: 640px) {
  .sfu.is-sharing .sfu__main { flex-direction: column; }
  .sfu.is-sharing .sfu__grid {
    width: auto;
    height: 96px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sfu.is-sharing .sfu__grid > .sfu__tile { width: 128px; height: 100%; }
}

/* incoming / outgoing ring */

.ring {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(16, 19, 25, .55);
  z-index: 20;
  padding: 20px;
}
.ring__card {
  width: min(340px, 100%);
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 24px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.ring__pulse {
  display: block;
  width: 54px; height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  animation: ripple 1.5s ease-out infinite;
}
@keyframes ripple {
  0% { box-shadow: 0 0 0 0 rgba(47, 86, 207, .35); }
  70% { box-shadow: 0 0 0 18px rgba(47, 86, 207, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 86, 207, 0); }
}
.ring__kind {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 6px;
}
.ring__who {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -.01em;
  margin: 0;
  overflow-wrap: anywhere;
}
.ring__where { color: var(--mist); font-size: 13px; margin: 4px 0 20px; }
.ring__actions { display: flex; gap: 8px; justify-content: center; }
.ring__actions .btn { flex: 1; }

/* ============================================================= meetings */

.rail__wide { width: calc(100% - 8px); margin: 6px 4px 0; }

/* A client of the company keeps to their chats and calls: no teams or rooms, nothing to create. */
.is-client .rail__block--teams,
.is-client .rail__block--rooms,
.is-client #newGroupBtn,
.is-client #groupEmpty,
.is-client #newMeetingBtn { display: none !important; }

/* meeting card in the chat log */

.meetcard {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 240px;
}
.msg--mine .meetcard { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); }
.meetcard__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.meetcard__badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 8px;
}
.msg--mine .meetcard__badge { background: rgba(255, 255, 255, .22); color: #fff; }
.meetcard__title { font-family: var(--display); font-weight: 500; overflow-wrap: anywhere; }
.meetcard__meta { font-size: 12px; opacity: .8; margin-bottom: 10px; }
.meetcard__actions { display: flex; gap: 6px; }
.meetcard__actions .btn { text-decoration: none; }
.msg--mine .meetcard__actions .btn:not(.btn--primary) {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}

/* modal */

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(16, 19, 25, .5);
  z-index: 25;
  padding: 20px;
}
.modal__card {
  position: relative;
  width: min(400px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 26px 24px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
textarea.field { resize: vertical; min-height: 44px; }
.modal__x {
  position: absolute;
  top: 10px; right: 12px;
  border: 0; background: transparent;
  font-size: 22px; line-height: 1;
  color: var(--mist);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.modal__x:hover { background: var(--surface-2); color: var(--ink); }
.modal__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 8px;
}
.modal__title {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -.01em;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.modal__hint { color: var(--mist); font-size: 13px; margin: 0 0 12px; }
.modal__go { width: 100%; margin-top: 6px; }
.modal__actions { display: flex; gap: 8px; margin-top: 14px; }
.modal__actions .btn { flex: 1; }

.lbl {
  display: block;
  font-size: 12.5px;
  color: var(--mist);
  margin-bottom: 12px;
}
.lbl .field { margin-top: 5px; }

.seg {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 12px;
}
.seg__btn {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--mist);
}
.seg__btn.is-on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ==================================================== mentions & notifications */

/* unread where the conversation only notifies about @mentions */
.badge--quiet { background: var(--surface-2); color: var(--mist); border: 1px solid var(--line); }
/* Notifications off for it (⋯ → Notifications → Off): a crossed-out bell, as in Teams. */
.entry__muted { flex: none; display: grid; place-items: center; color: var(--mist); }
.entry__marks { flex: none; display: inline-flex; align-items: center; gap: 4px; }

.rail__bell, .rail__icon { position: relative; padding: 6px; }
.rail__count {
  position: absolute;
  top: -3px;
  right: -5px;
  font-size: 10px;
  padding: 0 5px;
  line-height: 16px;
  min-width: 16px;
  text-align: center;
}

.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 8px 10px;
  background: var(--accent-soft);
  border-radius: 9px;
  font-size: 12.5px;
}
.notice__text { flex: 1; }
.notice__x {
  border: 0;
  background: transparent;
  color: var(--mist);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.notice__x:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }

.pane__head { position: relative; }

.menu {
  position: absolute;
  top: calc(100% - 6px);
  right: 18px;
  z-index: 6;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.menu__item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 10px 7px 28px;
  border-radius: 7px;
  cursor: pointer;
  position: relative;
}
.menu__item:hover { background: var(--surface-2); }

/* @suggestions above the message box */
.composer { position: relative; }
.mentionlist {
  position: absolute;
  left: 18px;
  bottom: calc(100% + 4px);
  z-index: 4;
  width: min(360px, calc(100% - 36px));
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.mentionlist__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.mentionlist__item.is-on { background: var(--accent-soft); }
.mentionlist__name { font-weight: 500; }
.mentionlist__email {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mist);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* mentions in messages */
.mention { color: var(--accent); font-weight: 600; }
.mention--me { background: rgba(168, 80, 11, .12); color: var(--warn); border-radius: 4px; padding: 0 2px; }
.msg--mine .mention { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.msg--mentioned .msg__body { border-left: 3px solid var(--warn); }

/* Activity */
.modal__card--wide { width: min(520px, 100%); }

/* Settings: the sections on the left, the chosen one on the right (settings.js) */
.modal__card.settings {
  width: min(780px, 100%);
  height: min(600px, calc(100vh - 40px));
  padding: 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  overflow: hidden;
}
.settings__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 10px;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}
.settings__title { font-family: var(--display); font-size: 19px; margin: 0 10px 14px; }
.settings__tab {
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.settings__tab:hover { background: var(--line); }
.settings__tab.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* Sign out, at the bottom of the sections */
.settings__signout {
  margin-top: auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b3261e;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.settings__signout:hover { background: var(--line); }
:root[data-theme="dark"] .settings__signout { color: #f28b82; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .settings__signout { color: #f28b82; }
}
/* Settings → Profile: the title box beside its Save, the photo buttons side by side */
.settings__inline { display: flex; align-items: center; gap: 8px; }
.settings__inline .field { flex: 1; }
.setting .photorow__actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
.settings__body { padding: 24px 26px; overflow-y: auto; }
.settings__heading { font-family: var(--display); font-size: 18px; margin: 0 0 6px; }
.settings__foot { margin-top: 14px; }
.setting { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting--block { flex-direction: column; align-items: stretch; gap: 10px; }
.setting__text { flex: 1; min-width: 0; }
.setting > select.field { flex: none; width: auto; max-width: 220px; }
.setting__name { margin: 0; font-size: 13.5px; font-weight: 600; }
.setting__hint { margin: 2px 0 0; font-size: 12.5px; color: var(--mist); }
.setting .field { max-width: 360px; }
.choices { display: flex; flex-direction: column; gap: 6px; }
.choice { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.shortcuts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.shortcuts li { display: flex; gap: 10px; align-items: center; }
.shortcuts kbd {
  min-width: 120px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mist);
}
.settings__me { display: flex; align-items: center; gap: 14px; }
.devicepick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.devicepick .field { flex: 1; min-width: 200px; }
.devicepick--camera { align-items: flex-start; }
.meter { width: 140px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter__level { display: block; height: 100%; width: 0; background: var(--live); transition: width .08s linear; }
.devicepreview { width: 220px; aspect-ratio: 16 / 9; border-radius: 10px; background: #1c2130; object-fit: cover; transform: scaleX(-1); }
.devicepreview.is-off { opacity: .4; }

/* an on/off switch around a checkbox */
.switch { position: relative; flex: none; width: 38px; height: 22px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line);
  transition: background .15s;
  pointer-events: none;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 640px) {
  .modal__card.settings { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: calc(100vh - 40px); }
  .settings__nav { flex-direction: row; overflow-x: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings__title { display: none; }
  .settings__tab { white-space: nowrap; }
  .settings__signout { margin: 0 0 0 auto; white-space: nowrap; }
  .settings__body { padding: 18px 16px; }
}
.activity__state:empty { display: none; }
.activity__state .btn { margin-left: 4px; }
.activity {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.activity li + li { border-top: 1px solid var(--line); }
.activity__item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 10px 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}
.activity__item:hover { background: var(--surface-2); }
.activity__item.is-unread::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.activity__top { display: flex; gap: 8px; align-items: baseline; }
.activity__head { flex: 1; min-width: 0; font-size: 13px; }
.activity__item.is-unread .activity__head { font-weight: 600; }
.activity__time { font-family: var(--mono); font-size: 10.5px; color: var(--mist); white-space: nowrap; }
.activity__text {
  color: var(--mist);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================ formatting, reactions, threads */

/* formatting inside a message (the body keeps line breaks: white-space: pre-wrap) */
.msg__body strong { font-weight: 700; }
.msg__body del { opacity: .75; }
.fmt-code {
  font-family: var(--mono);
  font-size: .9em;
  background: rgba(21, 24, 31, .07);
  border: 1px solid rgba(21, 24, 31, .1);
  border-radius: 4px;
  padding: 0 4px;
}
.fmt-pre {
  margin: 4px 0;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  background: rgba(21, 24, 31, .06);
  border: 1px solid rgba(21, 24, 31, .1);
  border-radius: 7px;
  overflow-x: auto;
  white-space: pre;
}
.fmt-quote {
  margin: 2px 0;
  padding: 0 0 0 10px;
  border-left: 3px solid var(--line);
  color: var(--mist);
}
.fmt-list { margin: 2px 0; padding-left: 20px; white-space: normal; }
.fmt-list li { white-space: pre-wrap; }
.fmt-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.msg--mine .fmt-link,
.msg--mine .fmt-quote { color: #fff; }
.msg--mine .fmt-quote { border-left-color: rgba(255, 255, 255, .5); }
.msg--mine .fmt-code,
.msg--mine .fmt-pre { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .25); }

/* reactions under a message */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg--mine .reactions { justify-content: flex-end; }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}
.reaction:hover { border-color: var(--accent); }
.reaction.is-mine { background: var(--accent-soft); border-color: var(--accent); }
.reaction__count { font-family: var(--mono); font-size: 11px; color: var(--mist); }
.reaction.is-mine .reaction__count { color: var(--accent); }

.picker {
  position: fixed;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(8, 32px);
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}
.picker__emoji {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}
.picker__emoji:hover, .picker__emoji:focus-visible { background: var(--surface-2); }

/* "3 replies · last reply 10:42" under a message that started a thread */
.msg__thread {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  margin-top: 4px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 12.5px;
  cursor: pointer;
}
.msg__thread:hover { background: var(--surface); border-color: var(--line); }
.msg__thread-count { color: var(--accent); font-weight: 600; }
.msg__thread-when { color: var(--mist); font-size: 11.5px; }
.msg--mine .msg__thread { display: flex; width: fit-content; margin-left: auto; }

/* the thread panel, beside the conversation (over it on narrow screens) */
.pane.has-thread { padding-right: min(400px, 45%); }
.thread {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: min(400px, 45%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.thread__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.thread__heading { min-width: 0; }
.thread__title { margin: 0; font-family: var(--display); font-size: 15px; }
.thread__sub { margin: 2px 0 0; font-size: 12px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread__close { position: static; }
.thread__log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thread__log .msg { max-width: 92%; }
.thread__divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mist);
}
.thread__divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.thread__composer { padding: 10px 12px 12px; }

@media (max-width: 900px) {
  .pane.has-thread { padding-right: 0; }
  .thread { width: 100%; border-left: 0; }
}

/* Find in chat (find.js): in the thread panel's place — a search box and what it found */
.pane.has-find { padding-right: min(400px, 45%); }
.pane__find[aria-expanded="true"] { color: var(--accent); }
.find__bar { padding: 12px 14px 6px; }
.find__body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; }
.find__status { margin: 0; padding: 6px 8px 8px; font-size: 12px; color: var(--mist); }
.find__list { max-height: none; overflow: visible; }
.find__item { flex-direction: row; align-items: flex-start; gap: 10px; padding-left: 10px; }
.find__item.is-current { background: var(--accent-soft); }
.find__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 900px) {
  .pane.has-find { padding-right: 0; }
}

/* ======================================================== search & jump to */

.railsearch {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 24px);
  margin: 10px 12px 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--mist);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.railsearch:hover { border-color: var(--accent); color: var(--ink); }
.railsearch__text { flex: 1; }
kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mist);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  white-space: nowrap;
}

.rail__add {
  margin-left: auto;
  flex: none;
  width: 20px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mist);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.rail__add:hover { background: var(--surface-2); color: var(--accent); }
.rail__more {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  padding: 4px 10px;
  cursor: pointer;
}
.rail__more:hover { text-decoration: underline; }

.modal--top { place-items: start center; padding-top: 12vh; }

.switcher { width: min(560px, 100%); padding: 12px; }
.switcher .field { font-size: 15px; padding: 11px 12px; }
.switcher__list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.switcher__group {
  padding: 6px 10px 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mist);
}
.switcher__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.switcher__item.is-on, .switcher__item:hover { background: var(--accent-soft); }
.switcher__icon { flex: none; width: 18px; text-align: center; color: var(--mist); font-family: var(--mono); }
.switcher__label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher__sub {
  margin-left: auto;
  max-width: 45%;
  font-size: 12px;
  color: var(--mist);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.switcher__empty { padding: 14px 10px; color: var(--mist); }
.switcher__hint { margin: 8px 4px 0; font-family: var(--mono); font-size: 10.5px; color: var(--mist); }

.search { width: min(640px, 100%); }
.search__bar { display: flex; gap: 8px; margin-bottom: 10px; }
.search__bar .field { flex: 1; }
.search__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.search__filters .seg { margin: 0; }
.search__filters .field { width: auto; max-width: 190px; }
.search__text { font-size: 13px; color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.search__text mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.search__more { display: block; margin: 10px auto 0; }

/* ================================================================ teams */

.rail__pair { display: flex; gap: 6px; padding: 6px 4px 0; }
.rail__pair .btn { flex: 1; }

.team { margin-bottom: 6px; }
.team__head { display: flex; align-items: center; gap: 2px; }
.team__toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  text-align: left;
}
.team__toggle:hover { background: var(--surface-2); }
.team__caret { font-size: 10px; color: var(--mist); width: 10px; }
.team__name {
  flex: 1;
  font-family: var(--display);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team__more {
  border: 0;
  background: transparent;
  color: var(--mist);
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.team__more:hover { background: var(--surface-2); color: var(--ink); }
.team__channels { padding-left: 14px; }
.team__channels .entry { padding: 6px 10px; }
.entry--add { color: var(--mist); font-size: 12.5px; }
.entry--add:hover { color: var(--accent); }
.team__leave { margin-top: 16px; }

/* a channel's topic under its name, as in Slack — "Add a topic" while there's none */
.pane__topic {
  display: block;
  max-width: 100%;
  margin: 3px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pane__topic:hover { text-decoration: underline; text-underline-offset: 3px; }
.pane__topic.is-empty { color: var(--mist); }
.pane__title.is-channel { cursor: pointer; }
.pane__title.is-channel:hover { text-decoration: underline; text-underline-offset: 3px; }

/* the "⋯" on an entry in the list: on hover or focus, where the badge was, as in Teams */
.list li.has-more { position: relative; }
.entry__more {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mist);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}
.list li.has-more:hover .entry__more,
.entry__more:focus-visible,
.entry__more[aria-expanded="true"] { opacity: 1; pointer-events: auto; }
.entry__more:hover, .entry__more[aria-expanded="true"] { background: var(--line); color: var(--ink); }
.list li.has-more:hover > .entry { padding-right: 34px; }
.list li.has-more:hover > .entry .badge,
.list li.has-more:hover > .entry .entry__meta { visibility: hidden; }
/* in Favourites, a channel says which team it's in */
.entry__team { color: var(--mist); font-weight: 400; font-size: 12px; }
/* "2 hidden channels" under a team's channels, and the hidden ones, greyed, when it's open */
.entry--hidden { color: var(--mist); font-size: 12.5px; }
.entry--hidden:hover { color: var(--ink); }
.entry.is-hidden:not(.is-active) { color: var(--mist); }

/* members in the manage dialog, teams in "Browse teams" */

.roster {
  list-style: none;
  margin: 0 0 12px;
  padding: 4px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.roster__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
}
.roster__row:hover { background: var(--surface-2); }
.roster__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.roster__name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster__sub { font-size: 12px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster__role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 8px;
}
.roster__act {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.roster__act:hover { text-decoration: underline; }
.roster__act--danger { color: #b3261e; }

/* people picker in the group dialog */

.picklist {
  list-style: none;
  margin: 0 0 12px;
  padding: 4px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.picklist__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
}
.picklist__item:hover { background: var(--surface-2); }
.picklist__name { font-weight: 500; }
.picklist__email { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--mist); }

.linkrow { display: flex; gap: 6px; }
.linkrow .field { flex: 1; }
.field--mono { font-family: var(--mono); font-size: 12px; }

/* standalone /meet page */

.meetbody { min-height: 100%; }
.lobby__who { margin: 0 0 12px; color: var(--mist); }
.lobby__who strong { color: var(--ink); font-weight: 600; }
.lobby__actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.lobby__actions .btn { margin-left: auto; text-decoration: none; }
.lobby__foot {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mist);
  margin: 18px 0 0;
}
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mist); }

.meet {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #101319;
}
.meet__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #171b24;
  color: #eef0f4;
  border-bottom: 1px solid #262c38;
}
.meet__title { font-family: var(--display); font-weight: 500; flex: 1; }
.meet__warn:not(:empty) {
  font-size: 12px;
  color: #ffd7d4;
  background: #6b1f1a;
  border-radius: 6px;
  padding: 4px 8px;
}
.meet__frame { flex: 1; min-height: 0; }
.meet__frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ============================================= people: photos, status, pins, saved */

/* a photo, or initials on a colour until one loads */
.avatar {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .02em;
}
button.avatar { cursor: pointer; }
button.avatar:hover { filter: brightness(1.08); }
.avatar--xs { width: 20px; height: 20px; border-radius: 6px; font-size: 8.5px; }
.avatar--md { width: 32px; height: 32px; border-radius: 9px; font-size: 12.5px; }
.avatar--lg { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: none;
}
.avatar.has-photo .avatar__img { display: block; }
.avatar.has-photo .avatar__initials { visibility: hidden; }

/* presence: green available · red busy · red with a bar do not disturb (or notifications
   paused) · amber clock away and be right back · grey ✕ offline */
.avatar__presence {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.avatar--xs .avatar__presence { width: 9px; height: 9px; right: -3px; bottom: -3px; }
.avatar--lg .avatar__presence { width: 16px; height: 16px; border-width: 3px; right: -4px; bottom: -4px; }
.avatar__presence svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.avatar__presence.is-available { background: #13a10e; box-shadow: none; }
.avatar__presence.is-busy, .avatar__presence.is-dnd { background: #c4314b; box-shadow: none; }
.avatar__presence.is-away, .avatar__presence.is-brb { background: #e39400; box-shadow: none; }
.avatar__presence.is-offline { background: var(--surface); box-shadow: inset 0 0 0 1.5px #8a8886; }
.avatar__presence.is-offline svg { stroke: #8a8886; }
/* a presence's dot in a menu: your card, and the statuses beside it */
.popmenu__item .avatar__presence, .mecard__row .avatar__presence { position: static; flex: none; width: 13px; height: 13px; border: 0; margin: 0 2px; }
.popmenu__item.is-on .popmenu__label { font-weight: 600; }
.popmenu__note { font-size: 11.5px; color: var(--mist); }
.entry.is-active .avatar__presence { border-color: var(--accent-soft); }

.status-emoji { font-size: 12px; line-height: 1; font-family: var(--body); }
.status-emoji:empty { display: none; }

/* your photo, name and status at the top of the rail */
.rail__me { position: relative; }
.me {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -5px 0 -5px -6px;
  padding: 5px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.me:hover, .me[aria-expanded="true"] { background: var(--surface-2); }
.me__avatar { display: grid; flex: none; }
.me__text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.me__status { font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me__status.is-empty { color: var(--mist); }
/* as wide as the rail allows: the rail clips what goes past it */
.menu--me { left: 10px; right: 10px; top: calc(100% - 4px); min-width: 0; padding: 8px; }
.menu--me .menu__item { padding-left: 10px; }
.menu__sep { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* your card (profile.js): who you are, what you show as, your status message */
.mecard__head { display: flex; align-items: center; gap: 12px; padding: 6px 6px 8px; }
.mecard__who { min-width: 0; }
.mecard__name { margin: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mecard__email, .mecard__title { margin: 1px 0 0; font-size: 12px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu--me .mecard__row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink); font: inherit; font-size: 13.5px; }
.mecard__row svg { flex: none; color: var(--mist); }
.mecard__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mecard__more { flex: none; color: var(--mist); font-size: 17px; line-height: 1; }
.mecard__status[aria-expanded="true"] { background: var(--surface-2); }
.mecard__emoji { flex: none; width: 17px; text-align: center; }
.mecard__line { display: flex; align-items: center; gap: 2px; }
.mecard__line .mecard__row { flex: 1; min-width: 0; }
.mecard__clear { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--mist); cursor: pointer; }
.mecard__clear:hover { background: var(--surface-2); color: var(--ink); }
.mecard__paused { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.mecard__paused svg { flex: none; color: var(--mist); }
.mecard__paused .mecard__label { white-space: normal; line-height: 1.35; }   /* until when matters: it wraps, not cut */

/* people in the sidebar */
.entry__label--person { display: flex; align-items: center; gap: 5px; min-width: 0; }
.entry__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* messages: the sender's photo beside, their name opens their card */
.msg--with-avatar { position: relative; padding-left: 40px; }
.msg--with-avatar > .avatar { position: absolute; left: 0; top: 0; }
.msg__who {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.msg__who:hover { color: var(--accent); text-decoration: underline; }
.msg__meta { align-items: center; flex-wrap: wrap; }
.msg__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--warn);
}
.msg__flag--saved { color: var(--accent); }
.msg--mine .msg__flags { justify-content: flex-end; }

.pane__title.is-person { cursor: pointer; }
.pane__title.is-person:hover { text-decoration: underline; text-underline-offset: 3px; }

/* someone's card */
.card {
  position: fixed;
  z-index: 30;
  width: min(300px, calc(100vw - 16px));
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
}
.card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.card__who { min-width: 0; }
.card__name { margin: 0; font-family: var(--display); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.card__title { margin: 1px 0 0; font-size: 12.5px; overflow-wrap: anywhere; }
.card__presence { margin: 3px 0 0; font-size: 12px; color: var(--mist); }
.card__status {
  margin: 0 0 8px;
  padding: 7px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.card__email { margin: 0 0 12px; font-family: var(--mono); font-size: 11.5px; color: var(--mist); overflow-wrap: anywhere; }
.card__actions { display: flex; gap: 6px; }
.card__actions .btn { flex: 1; }

/* set a status, edit your profile */
.statusrow { display: flex; gap: 6px; margin-bottom: 10px; }
.statusrow .field { flex: 1; }
.emojibtn {
  flex: none;
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 18px;
  cursor: pointer;
}
.emojibtn:hover { border-color: var(--accent); }
.emojigrid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  margin-bottom: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.emojigrid button {
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}
.emojigrid button:hover, .emojigrid button.is-on { background: var(--accent-soft); }
.presets { list-style: none; margin: 0 0 12px; padding: 0; }
.preset {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.preset:hover { background: var(--surface-2); }
.preset__when { margin-left: auto; font-size: 12px; color: var(--mist); white-space: nowrap; }
.photorow { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.photorow__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

/* saved for later */
.saved__remove {
  flex: none;
  border: 0;
  background: none;
  padding: 10px 8px;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}
.saved__remove:hover { text-decoration: underline; }
.saved { display: flex; align-items: flex-start; }
.threads__meta { font-size: 11.5px; color: var(--mist); }
.activity__item.is-unread .threads__meta { color: var(--accent); font-weight: 600; }
.saved .activity__item { flex: 1; min-width: 0; }
/* ============================================================ Teams-style bits */

/* the "⋯" menu on a message (menu.js) */
.popmenu {
  position: fixed;
  z-index: 35;
  min-width: 230px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(16, 19, 25, .18);
}
.popmenu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.popmenu__item svg { flex: none; color: var(--mist); }
.popmenu__item:hover, .popmenu__item:focus { background: var(--surface-2); outline: none; }

/* Who's in a conversation: the list under 👥 in its header, as in Teams (people.js). */
.people {
  position: fixed;
  z-index: 35;
  width: 290px;
  max-height: min(480px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(16, 19, 25, .18);
}
.people__head { margin: 4px 8px 6px; font-size: 12px; color: var(--mist); }
.people__list { list-style: none; margin: 0; padding: 0; min-height: 0; overflow-y: auto; }
.people__row { display: flex; align-items: center; border-radius: 7px; }
.people__row:hover { background: var(--surface-2); }
.people__who,
.people__action {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.people__who { flex: 1; min-width: 0; padding: 6px 8px; }
.people__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.people__role { font-size: 11px; color: var(--mist); }
.people__remove {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--mist);
  cursor: pointer;
  opacity: 0;
}
.people__row:hover .people__remove,
.people__remove:focus-visible { opacity: 1; }
.people__remove:hover { color: #b3261e; background: var(--surface); }
@media (hover: none) { .people__remove { opacity: 1; } }
.people__foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.people__action { width: 100%; padding: 8px 10px; }
.people__action svg { flex: none; color: var(--mist); }
.people__who:focus-visible,
.people__action:hover,
.people__action:focus-visible { background: var(--surface-2); outline: none; }
.popmenu__item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.popmenu__label { flex: 1; }
.popmenu__hint { font-family: var(--mono); font-size: 11px; color: var(--mist); }
.popmenu__item--danger, .popmenu__item--danger svg { color: #b3261e; }
.popmenu__blank { flex: none; width: 17px; }
.popmenu__sep { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* the message box: the icons sit inside it */
.composer__box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 3px 5px 3px 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.composer__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 86, 207, .12); }
.composer__box .composer__input { border: 0; background: transparent; padding: 9px 9px; }
.composer__tools { display: flex; align-items: center; gap: 1px; padding-bottom: 2px; }
.composer__tool, .composer__send {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mist);
  cursor: pointer;
}
.composer__tool:hover, .composer__tool:focus-visible { background: var(--surface-2); color: var(--accent); }
.composer__tools-sep { width: 1px; height: 22px; margin: 0 3px; background: var(--line); }
.composer__send.is-ready { color: var(--accent); }
.composer__send:hover:not(:disabled), .composer__send:focus-visible { background: var(--accent-soft); color: var(--accent); }
.composer__send:disabled { color: var(--line); cursor: not-allowed; }
/* ================================================ forward, unread, undo */

/* a forwarded message: "↪ Forwarded", who first said it and when, then what they said */
.msg__fwd {
  padding: 2px 0 2px 10px;
  border-left: 3px solid var(--line);
}
.msg--mine .msg__fwd { border-left-color: rgba(255, 255, 255, .55); }
.msg__fwd-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-style: italic;
  opacity: .8;
  white-space: normal;
}
.msg__fwd-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 1px 0 3px;
  font-size: 12.5px;
  white-space: normal;
}
.msg__fwd-head span { font-family: var(--mono); font-size: 10.5px; opacity: .75; }

/* "This message was deleted. Undo" */
.msg__undo {
  border: 0;
  background: none;
  padding: 0 2px;
  font: inherit;
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.msg__undo:hover { text-decoration: underline; }
.msg__undo:disabled { opacity: .5; cursor: default; }

/* marked unread, with nothing new to count */
.badge--dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; }

/* the forward dialog */
.fwdpreview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 13px;
}
.fwdpreview span { color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwdlist { margin-top: 8px; }
.fwdlist__item.is-on { background: var(--accent-soft); }
.fwdlist__item.is-on .picklist__name { color: var(--accent); }
.fwdlist__empty { padding: 8px; color: var(--mist); font-size: 13px; }
/* ⋯ → Translate: "Translated from Hindi · See original" under the translation */
.msg__translated {
  margin-top: 6px;
  font-size: 11.5px;
  font-style: italic;
  opacity: .8;
  white-space: normal;
}
.msg__translated-toggle {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-style: normal;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ================================================== compliance console (/admin) */

.console__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 28px 16px;
}
.console__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 4px;
}
.console__title { font-family: var(--display); font-size: 24px; letter-spacing: -.01em; margin: 0; }
.console__who { display: flex; align-items: center; gap: 12px; color: var(--mist); font-size: 13px; }
.console__who a { text-decoration: none; color: var(--ink); }
.console__notice {
  max-width: 620px;
  margin: 48px auto;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.console__notice a { color: var(--accent); font-weight: 500; }
.console__main { max-width: 1320px; margin: 0 auto; padding: 0 28px 48px; }
.console__tabs { max-width: 560px; margin-bottom: 16px; }
.console__status { color: var(--mist); font-size: 13px; margin: 10px 2px; min-height: 20px; }
.console__more { display: block; margin: 12px auto 0; }
.console__heading { font-family: var(--display); font-size: 16px; margin: 24px 2px 10px; }

/* the filters above a table */
.cfilters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cfilters__item { display: flex; flex-direction: column; gap: 4px; min-width: 150px; font-size: 12px; color: var(--mist); }
.cfilters__item--wide { flex: 1 1 240px; }
.cfilters__check { display: flex; align-items: center; gap: 6px; padding-bottom: 7px; font-size: 13px; }
.cfilters__go { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.cfilters select.field { min-width: 170px; }

/* a search box that picks one person or conversation */
.cpick { position: relative; min-width: 200px; }
.cpick__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(440px, 90vw);
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16, 19, 25, .16);
}
.cpick__item { display: flex; flex-direction: column; padding: 6px 9px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.cpick__item.is-active { background: var(--accent-soft); }
.cpick__name { font-size: 13px; }
.cpick__sub { font-size: 11.5px; color: var(--mist); }
.cpick__none { padding: 8px 10px; font-size: 13px; color: var(--mist); }
.cpick__chip {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 320px;
  min-height: 32px;
  padding: 3px 4px 3px 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
}
.cpick__chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick__clear {
  border: 0;
  background: transparent;
  color: var(--mist);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.cpick__clear:hover { background: var(--surface); color: var(--ink); }

/* tables */
.ctable__wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ctable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctable th {
  position: sticky;
  top: 0;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--mist);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.ctable td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ctable tbody tr:last-child td { border-bottom: 0; }
.ctable--click tbody tr { cursor: pointer; }
.ctable--click tbody tr:hover, .ctable tbody tr.is-open { background: var(--accent-soft); }
.ctable__time { white-space: nowrap; color: var(--mist); }
.ctable__conv { min-width: 140px; max-width: 260px; overflow-wrap: anywhere; }
.ctable__mono { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.ctable__details {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mist);
  cursor: pointer;
}
.ctable__details.is-open { white-space: pre-wrap; overflow-wrap: anywhere; }
.ctable__text { min-width: 240px; }
.ctable__clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ctable tr.is-deleted .ctable__clamp { text-decoration: line-through; color: #8a2a24; }
.ctable__sub { font-size: 12px; color: var(--mist); }
.ctable__reason { overflow-wrap: anywhere; }
.ctable__act { text-align: right; white-space: nowrap; }
.ctable__empty { padding: 18px; text-align: center; color: var(--mist); }
.ctable tr.is-released td { color: var(--mist); }
.ctags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ctag {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}
.ctag--danger { border-color: #e7b3af; background: #fdf0ef; color: #b3261e; }
.ctag--live { border-color: #a9d8c5; background: #ebf7f1; color: var(--live); }

/* retention and holds */
.ccard { max-width: 640px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ccard + .ccard { margin-top: 16px; }
.ccard__title { font-family: var(--display); font-size: 17px; margin: 0 0 6px; }
.ccard__hint { margin: 0 0 14px; font-size: 13px; color: var(--mist); }
.ccard__seg, .ccard .lbl { max-width: 400px; }
.ccard__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ccard__result { min-height: 20px; margin: 12px 0; font-size: 13px; }

/* one message, as it stands and as it was */
.console__drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  width: min(480px, 100%);
  overflow-y: auto;
  padding: 22px 22px 28px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(16, 19, 25, .12);
}
.drawer__title { font-family: var(--display); font-size: 18px; margin: 0 28px 14px 0; overflow-wrap: anywhere; }
.drawer__heading {
  margin: 18px 0 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mist);
}
.drawer__text {
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.drawer__text.is-deleted { text-decoration: line-through; color: #8a2a24; }
.drawer__versions { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.drawer__meta { margin-bottom: 4px; font-size: 12px; color: var(--mist); }
.drawer__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
body.console .toast { z-index: 30; }   /* over the drawer */
/* Where there's room, the page moves over for the drawer instead of going under it. */
@media (min-width: 1100px) {
  body.console.has-drawer { padding-right: 480px; }
}
.cfacts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.cfacts dt { color: var(--mist); }
.cfacts dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .console__top, .console__main { padding-left: 16px; padding-right: 16px; }
  .console__tabs .seg__btn { flex: 1 1 auto; padding: 7px 8px; white-space: nowrap; }
  .cfilters__item { flex: 1 1 140px; min-width: 0; }
  .cfilters select.field { min-width: 0; }
  .cfilters__go { margin-left: 0; }
  .cpick { min-width: 0; }
}

/* ============================================ archived channels, renaming, holds */

/* An archived channel, opened to read: a note where the message box would be. */
.archived-note {
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--mist);
  font-size: 13px;
  text-align: center;
}

.archived-note .btn {
  margin-left: 8px;
  vertical-align: middle;
}
/* A name and its Rename button side by side (Manage team). */
.rename-row { display: flex; align-items: flex-end; gap: 8px; }
.rename-row .lbl { flex: 1; }
.rename-row .btn { margin-bottom: 12px; }
/* The console: a file in a message, and what a hold covers. */
.drawer__preview { display: block; max-width: 100%; max-height: 320px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); }
.ccard__row { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.ccard__row .lbl { flex: 1 1 140px; }

/* ================================================================ dark theme */
/* Picked in Settings (data-theme="dark"), or "Same as the computer" when the computer is dark. */

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e1117;
  --surface: #171b24;
  --surface-2: #212736;
  --ink: #e6e9f0;
  --mist: #9aa3b5;
  --line: #2c3344;
  --accent: #5479ec;
  --accent-soft: #233056;
  --live: #3cc58a;
  --warn: #f0a44f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0e1117;
    --surface: #171b24;
    --surface-2: #212736;
    --ink: #e6e9f0;
    --mist: #9aa3b5;
    --line: #2c3344;
    --accent: #5479ec;
    --accent-soft: #233056;
    --live: #3cc58a;
    --warn: #f0a44f;
  }
}
:root[data-theme="dark"] .banner { background: #13261d; border-color: #24543d; }
:root[data-theme="dark"] .search__text mark { background: #5b4b12; }
:root[data-theme="dark"] .mention--me { background: rgba(240, 164, 79, .18); }
:root[data-theme="dark"] .btn--primary:hover:not(:disabled) { background: #6a8cf2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .banner { background: #13261d; border-color: #24543d; }
  :root:not([data-theme="light"]) .search__text mark { background: #5b4b12; }
  :root:not([data-theme="light"]) .mention--me { background: rgba(240, 164, 79, .18); }
  :root:not([data-theme="light"]) .btn--primary:hover:not(:disabled) { background: #6a8cf2; }
}

/* ================================================================ our own "Are you sure?" */

.dialog { z-index: 70; }
.dialog__card { width: min(420px, 100%); }
.dialog__title { font-size: 18px; margin: 0 0 8px; padding-right: 0; }
.dialog__text { margin: 0 0 18px; color: var(--mist); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ================================================================ link previews */

.linkcard {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  white-space: normal;
}
.linkcard:hover { background: var(--surface-2); }
.linkcard__img { flex: none; width: 96px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.linkcard__text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.linkcard__site { font-size: 11.5px; color: var(--mist); text-transform: uppercase; letter-spacing: .04em; }
.linkcard__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.linkcard__desc { font-size: 12.5px; color: var(--mist); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg--mine .linkcard { color: var(--ink); }

/* a thread reply also sent to the conversation, and videos (recordings) that play in place */
.msg__also {
  display: block;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mist);
  font-size: 12px;
  cursor: pointer;
}
.msg__also:hover:not(:disabled) { color: var(--accent); text-decoration: underline; }
.msg__also:disabled { cursor: default; }
.msg--mine .msg__also { color: rgba(255, 255, 255, .8); }
.file__play { margin-top: 6px; }
.file__video { display: block; width: min(480px, 100%); margin-top: 6px; border-radius: 8px; background: #000; }

/* @suggestions while editing a message */
.msg__edit { position: relative; }
.msg__edit .mentionlist { left: 0; width: min(320px, 100%); }

/* ================================================================ threads: follow, also send */

.thread__follow { margin-left: auto; flex: none; }
.thread__follow.is-on { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.thread__composer { flex-wrap: wrap; }
.thread__also { display: flex; align-items: center; gap: 6px; flex-basis: 100%; padding-left: 4px; font-size: 12.5px; color: var(--mist); cursor: pointer; }

/* ================================================================ calls: chat beside it, devices, hands, recording */

.stage.is-side { inset: 0 380px 0 0; border-radius: 14px 0 0 14px; }
.pane.has-side-call > :not(.stage) { margin-left: calc(100% - 380px); }
.pane.has-side-call .pane__actions { display: none; }
.stage__head .btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 900px) {
  .stage.is-side { inset: 0 0 52% 0; border-radius: 14px 14px 0 0; }
  .pane.has-side-call > :not(.stage) { margin-left: 0; }
  .pane.has-side-call .pane__head { margin-top: 48vh; }
}

.rtc__pair { display: flex; align-items: center; }
.rtc__pair .rtc__btn:first-child { border-radius: 50% 0 0 50%; }
.rtc__btn--more { width: 24px; border-radius: 0 50% 50% 0; background: #252b39; }
.rtc__btn--more svg { width: 14px; height: 14px; }
.rtc__btn.is-rec { background: #b3261e; color: #fff; }
.stage.is-min .rtc__btn--more { width: 18px; }

.sfu__hand {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f5c26b;
  color: #171b24;
  font-size: 12.5px;
  font-weight: 600;
}
.sfu__tile.has-hand { box-shadow: inset 0 0 0 3px #f5c26b; }
.sfu__rec {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(179, 38, 30, .92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: none;
}
.stage.is-min .sfu__rec { top: 6px; right: 6px; padding: 2px 8px; font-size: 11px; }

/* ================================================================ the meeting page's chat */

.meet__body { flex: 1; min-height: 0; display: flex; }
.meet__body .meet__frame { flex: 1; min-width: 0; }
.meetchat {
  flex: none;
  width: 340px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  color: var(--ink);
}
.meetchat__log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.meetchat__notice { margin: 0; text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--mist); }
.meetchat__msg { display: flex; flex-direction: column; }
.meetchat__head { margin: 0; display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.meetchat__time { font-family: var(--mono); font-size: 10.5px; color: var(--mist); }
.meetchat__text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.meetchat__form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.meet__head .btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 760px) {
  .meet__body { flex-direction: column; }
  .meetchat { width: auto; height: 45%; border-left: 0; border-top: 1px solid var(--line); }
}
.meet__head .btn:not(.btn--danger):not(.is-on) { background: #232936; border-color: #333b4b; color: #eef0f4; }
