/* UVEYO Connect. Three panels on wide screens, one panel at a time on phones. Theme colors come
   from the shared tokens, so light and dark modes follow the workspace; logical properties keep
   Arabic RTL and English LTR correct. */
.cx-page-heading {
  margin-block-end: 12px;
}
.cx-root {
  --cx-height: calc(100dvh - 210px);
  min-height: 520px;
}
.cx-shell {
  display: grid;
  grid-template-columns: 220px minmax(260px, 340px) minmax(0, 1fr);
  height: max(520px, var(--cx-height));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cx-shell:has(.cx-side:not([hidden])) {
  grid-template-columns: 220px minmax(240px, 300px) minmax(0, 1fr) 320px;
}
.cx-nav,
.cx-list,
.cx-side {
  min-height: 0;
  overflow-y: auto;
  border-inline-end: 1px solid var(--line);
}
.cx-side {
  border-inline-end: 0;
  border-inline-start: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.cx-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  background: var(--surface-subtle);
}
.cx-brand {
  display: grid;
  gap: 2px;
  padding: 4px 10px 12px;
}
.cx-brand strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}
.cx-brand span {
  color: var(--muted);
  font-size: 12px;
}
.cx-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  text-align: start;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.cx-filter span {
  flex: 1;
}
.cx-filter:hover {
  background: var(--surface-hover);
}
.cx-filter.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-weight: 600;
}
.cx-filter b,
.cx-unread,
.cx-nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
}
.nav-item .cx-nav-badge {
  margin-inline-start: auto;
}
.cx-nav-actions {
  display: grid;
  gap: 6px;
  margin-block-start: auto;
  padding-block-start: 12px;
}
.cx-nav-actions .btn {
  justify-content: flex-start;
}

/* Conversation list */
.cx-list-head {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 14px 14px 10px;
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}
.cx-list-head h2 {
  margin: 0;
  font-size: 17px;
}
.cx-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cx-search input {
  flex: 1;
  min-width: 0;
  height: 36px;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  outline: 0;
}
.cx-search:focus-within {
  border-color: var(--accent);
}
.cx-items {
  margin: 0;
  padding: 6px;
  list-style: none;
}
.cx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  font: inherit;
  color: var(--ink);
  text-align: start;
  background: none;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.cx-item:hover {
  background: var(--surface-hover);
}
.cx-item.is-active {
  background: var(--accent-soft);
}
.cx-item-body {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
.cx-item-top {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: baseline;
}
.cx-item-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-item-top time {
  flex: none;
  font-size: 11px;
  color: var(--muted);
}
.cx-item.is-unread .cx-item-top time {
  color: var(--accent-ink);
  font-weight: 600;
}
.cx-item-preview {
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-item.is-unread .cx-item-preview {
  color: var(--ink);
}
.cx-item-preview em {
  color: var(--accent-ink);
}
.cx-item-flags {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}
.cx-item-flags .icon {
  width: 14px;
  height: 14px;
}
.cx-at {
  color: var(--accent-ink);
}
.cx-draft {
  color: var(--error-ink);
  font-weight: 600;
}
.cx-none,
.cx-loading {
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

/* Avatars and presence */
.cx-avatar {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  font-weight: 700;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-radius: 50%;
}
.cx-avatar.group {
  border-radius: 12px;
}
.cx-avatar.channel {
  color: var(--accent-ink);
  border-radius: 12px;
}
.cx-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.cx-avatar.sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}
.cx-avatar.xl {
  width: 88px;
  height: 88px;
  font-size: 34px;
}
.cx-dot {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  width: 11px;
  height: 11px;
  background: var(--line);
  border: 2px solid var(--surface);
  border-radius: 50%;
}
.cx-dot.on {
  background: var(--positive, #16a34a);
}

/* Active conversation */
.cx-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface-subtle);
}
.cx-main.is-dropping::after {
  position: absolute;
  inset: 8px;
  content: '';
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  pointer-events: none;
}
.cx-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  height: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.cx-empty .icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
}
.cx-empty h2 {
  margin: 0;
  color: var(--ink);
}
.cx-empty.small {
  height: auto;
  padding-block: 48px;
}
.cx-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}
.cx-head-title {
  display: grid;
  flex: 1;
  min-width: 0;
}
.cx-head-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-head-title small {
  color: var(--muted);
}
.cx-head-actions {
  display: flex;
  gap: 4px;
}
.cx-back {
  display: none;
}
.cx-pinned button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  text-align: start;
  background: var(--surface);
  border: 0;
  border-block-end: 1px solid var(--line);
  cursor: pointer;
}
.cx-pinned span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-pinned .icon {
  color: var(--accent);
}
.cx-messages {
  flex: 1;
  min-height: 0;
  padding: 14px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cx-messages:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.cx-older {
  display: block;
  margin: 0 auto 12px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.cx-day {
  display: flex;
  justify-content: center;
  margin: 14px 0 8px;
}
.cx-day span,
.cx-system span {
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.cx-system {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}
.cx-call-log .icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* Messages */
.cx-msg {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-block-start: 10px;
  max-width: 100%;
}
.cx-msg.is-grouped {
  margin-block-start: 2px;
  padding-inline-start: 38px;
}
.cx-msg.is-mine {
  flex-direction: row-reverse;
  padding-inline-start: 0;
}
.cx-bubble {
  position: relative;
  max-width: min(72%, 560px);
  padding: 8px 12px 6px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  border-end-start-radius: 4px;
  overflow-wrap: anywhere;
}
.cx-msg.is-mine .cx-bubble {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  border-end-start-radius: 16px;
  border-end-end-radius: 4px;
}
.cx-msg.is-mention .cx-bubble {
  box-shadow: inset 3px 0 0 var(--accent);
}
.cx-msg.is-flash .cx-bubble {
  outline: 2px solid var(--accent);
}
.cx-sender {
  display: block;
  margin-block-end: 2px;
  font-size: 12px;
  color: var(--accent-ink);
}
.cx-text {
  margin: 0;
  line-height: 1.6;
  white-space: normal;
}
.cx-text a {
  color: var(--accent-ink);
}
.cx-mention {
  padding: 0 3px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 4px;
}
.cx-deleted {
  margin: 0;
  font-style: italic;
  color: var(--muted);
}
.cx-deleted .icon {
  width: 14px;
  height: 14px;
}
.cx-forwarded {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}
.cx-forwarded .icon {
  width: 14px;
  height: 14px;
}
.cx-quote {
  display: grid;
  width: 100%;
  margin-block-end: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  text-align: start;
  background: var(--surface-subtle);
  border: 0;
  border-inline-start: 3px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
}
.cx-quote span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-block-start: 2px;
  font-size: 11px;
  color: var(--muted);
}
.cx-meta .icon {
  width: 13px;
  height: 13px;
}
.cx-edited,
.cx-retry {
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}
.cx-retry {
  color: var(--error-ink);
}
.cx-tick {
  display: inline-flex;
}
.cx-tick .icon + .icon {
  margin-inline-start: -8px;
}
.cx-tick.is-read {
  color: var(--accent);
}
.cx-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-block-start: 4px;
}
.cx-reactions button {
  padding: 1px 8px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.cx-reactions .is-mine {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.cx-thread-link {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-block-start: 4px;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.cx-thread-link .icon {
  width: 14px;
  height: 14px;
}
.cx-actions {
  position: absolute;
  inset-block-start: -18px;
  inset-inline-end: 8px;
  z-index: 2;
  display: none;
  gap: 2px;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px #17171718;
}
.cx-msg.is-mine .cx-actions {
  inset-inline-end: auto;
  inset-inline-start: 8px;
}
.cx-msg:hover .cx-actions,
.cx-msg:focus-within .cx-actions {
  display: flex;
}
.cx-actions button,
.cx-menu button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.cx-actions button:hover,
.cx-menu button:hover {
  background: var(--surface-hover);
}
.cx-actions .icon,
.cx-menu .icon {
  width: 16px;
  height: 16px;
}
.cx-menu {
  position: absolute;
  inset-block-start: 16px;
  inset-inline-end: 8px;
  z-index: 5;
  display: grid;
  min-width: 190px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px #17171726;
}
.cx-msg.is-mine .cx-menu {
  inset-inline-end: auto;
  inset-inline-start: 8px;
}
.cx-menu button {
  justify-content: flex-start;
  height: 36px;
  padding: 0 10px;
}

/* Attachments, voice notes, polls and references */
.cx-image img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin-block-end: 4px;
  border-radius: 10px;
}
.cx-video {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
}
.cx-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 4px;
  padding: 8px 10px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cx-doc span {
  display: grid;
  min-width: 0;
}
.cx-doc strong,
.cx-doc bdi {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-doc small {
  color: var(--muted);
}
.cx-doc .icon {
  flex: none;
  color: var(--accent);
}
.cx-voice-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 230px;
}
.cx-play {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.cx-play .icon {
  width: 16px;
  height: 16px;
}
.cx-wave {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 2px;
  height: 30px;
}
.cx-wave i {
  flex: 1;
  min-width: 2px;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
  border-radius: 2px;
}
.cx-wave i.is-played {
  background: var(--accent);
}
.cx-voice-time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cx-speed {
  padding: 2px 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.cx-poll {
  display: grid;
  gap: 6px;
  min-width: 240px;
  margin-block-end: 4px;
}
.cx-poll strong {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cx-poll small {
  color: var(--muted);
}
.cx-poll-option {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  overflow: hidden;
  font: inherit;
  color: var(--ink);
  text-align: start;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.cx-poll-option.is-mine {
  border-color: var(--accent);
}
.cx-poll-option span,
.cx-poll-option b {
  position: relative;
}
.cx-poll-bar {
  position: absolute !important;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  background: var(--accent-soft);
  transition: width 0.3s;
}
.cx-ref {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  margin-block-end: 4px;
  padding: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 10px;
}
.cx-ref > span {
  display: grid;
  flex: 1;
  min-width: 0;
}
.cx-ref small {
  color: var(--muted);
}
.cx-ref .icon {
  flex: none;
  color: var(--accent);
}

/* Composer */
.cx-composer {
  position: relative;
  padding: 10px 14px;
  background: var(--surface);
  border-block-start: 1px solid var(--line);
}
.cx-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.cx-compose-row textarea {
  flex: 1;
  min-height: 40px;
  max-height: 160px;
  padding: 9px 12px;
  font: inherit;
  line-height: 1.5;
  color: var(--ink);
  resize: none;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cx-compose-row textarea:focus {
  border-color: var(--accent);
  outline: 0;
}
.cx-send {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
[dir='rtl'] .cx-send .icon,
[dir='rtl'] .cx-actions [data-cx-reply] .icon,
[dir='rtl'] .cx-forwarded .icon {
  transform: scaleX(-1);
}
.cx-send:focus-visible,
.cx-play:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.cx-compose-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: 8px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--surface-subtle);
  border-inline-start: 3px solid var(--accent);
  border-radius: 8px;
}
.cx-compose-context span {
  display: grid;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cx-compose-context strong {
  color: var(--ink);
}
.cx-picker,
.cx-mentions {
  position: absolute;
  inset-block-end: calc(100% + 4px);
  inset-inline-start: 14px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(10, 34px);
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px #17171726;
}
.cx-picker[hidden],
.cx-mentions[hidden],
.cx-voice[hidden],
.cx-uploads[hidden],
.cx-compose-context[hidden] {
  display: none;
}
.cx-picker button {
  height: 34px;
  font-size: 20px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.cx-picker button:hover {
  background: var(--surface-hover);
}
.cx-mentions {
  grid-template-columns: 1fr;
  min-width: 220px;
}
.cx-mentions button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  text-align: start;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.cx-mentions button:hover,
.cx-mentions button:focus {
  background: var(--accent-soft);
}
.cx-uploads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 8px;
}
.cx-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 6px 8px;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cx-upload img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
}
.cx-upload > span:not(.cx-progress) {
  display: grid;
  min-width: 0;
  font-size: 12px;
}
.cx-upload bdi {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-upload small {
  color: var(--muted);
}
.cx-upload.is-error {
  border-color: var(--error);
}
.cx-upload.is-error small {
  color: var(--error-ink);
}
.cx-progress {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 3px;
}
.cx-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.cx-upload.is-done .cx-progress {
  display: none;
}
.cx-voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block-start: 8px;
  padding: 8px 10px;
  background: var(--surface-subtle);
  border-radius: 12px;
}
.cx-voice .cx-voice-player {
  flex: 1;
}
.cx-rec-dot {
  width: 12px;
  height: 12px;
  background: var(--error, #dc2626);
  border-radius: 50%;
  transition: transform 0.08s;
}
.cx-readonly {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
  border-block-start: 1px solid var(--line);
}

/* Side panel: thread, search and details */
.cx-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-block-end: 1px solid var(--line);
}
.cx-side-body {
  flex: 1;
  min-height: 0;
  padding: 12px 14px;
  overflow-y: auto;
}
.cx-side-body h3 {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.cx-side .cx-bubble {
  max-width: 100%;
}
.cx-side .cx-msg.is-grouped {
  padding-inline-start: 0;
}
.cx-thread-replies {
  margin-block-start: 8px;
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--line);
}
.cx-thread-form,
.cx-find {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-block-start: 1px solid var(--line);
}
.cx-find {
  border-block: 0 1px solid var(--line);
}
.cx-thread-form textarea,
.cx-find input {
  flex: 1;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  resize: none;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cx-desc {
  color: var(--muted);
  font-size: 13px;
}
.cx-toggles {
  display: grid;
  gap: 4px;
}
.cx-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  text-align: start;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.cx-toggle:hover {
  background: var(--surface-hover);
}
.cx-toggle[aria-pressed='true'] {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.cx-members {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.cx-members li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cx-members li > span:nth-child(2) {
  display: grid;
  flex: 1;
  min-width: 0;
}
.cx-members small {
  color: var(--muted);
}
.cx-members select {
  max-width: 110px;
  font: inherit;
  font-size: 12px;
}
.cx-side-body > .btn {
  margin: 0 6px 6px 0;
}
.cx-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cx-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}
.cx-gallery .cx-doc {
  grid-column: 1 / -1;
}
.cx-results {
  padding: 8px 12px;
}
.cx-results h3 {
  margin: 12px 4px 4px;
  font-size: 13px;
  color: var(--muted);
}

/* Dialogs */
.cx-dialog .cx-modal {
  width: min(560px, calc(100vw - 32px));
}
.cx-field {
  display: grid;
  gap: 4px;
  margin-block-end: 12px;
  border: 0;
  padding: 0;
}
.cx-field > span,
.cx-field legend {
  font-size: 13px;
  font-weight: 600;
}
.cx-field input,
.cx-field select,
.cx-field textarea {
  min-height: 38px;
  padding: 6px 10px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cx-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: 10px;
}
.cx-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cx-people {
  display: grid;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cx-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
}
.cx-person:hover {
  background: var(--surface-hover);
}
.cx-person:has(input:checked) {
  background: var(--accent-soft);
}
.cx-person[hidden] {
  display: none;
}
.cx-person > span:last-child {
  display: grid;
}
.cx-person small {
  color: var(--muted);
}
.cx-history,
.cx-reports {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cx-history time,
.cx-reports small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.cx-history p {
  margin: 2px 0 0;
}

/* Calls */
#cx-call[hidden] {
  display: none;
}
.cx-call {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  color: #fff;
}
.cx-call.is-incoming {
  place-items: center;
  background: #0d0d0db8;
  backdrop-filter: blur(6px);
}
.cx-call-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(340px, calc(100vw - 32px));
  padding: 28px 24px;
  color: var(--ink);
  text-align: center;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 24px 64px #0006;
}
.cx-call-card h2 {
  margin: 4px 0 0;
}
.cx-call-card p {
  margin: 0;
  color: var(--muted);
}
.cx-call-actions {
  display: flex;
  gap: 40px;
  margin-block-start: 12px;
}
.cx-call-card .cx-avatar.xl {
  animation: cx-ring 1.4s ease-in-out infinite;
}
@keyframes cx-ring {
  50% {
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 25%, transparent);
  }
}
.cx-call.is-active {
  grid-template-rows: 1fr auto;
  background: #111;
}
.cx-call-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  padding: 16px;
}
.cx-call-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-block-end: 12px;
  font-variant-numeric: tabular-nums;
}
.cx-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-height: 0;
}
.cx-grid[data-count='2'] {
  grid-template-columns: repeat(2, 1fr);
}
.cx-grid[data-count='3'],
.cx-grid[data-count='4'] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}
.cx-grid:not([data-count='1']):not([data-count='2']):not([data-count='3']):not([data-count='4']) {
  grid-template-columns: repeat(3, 1fr);
}
.cx-tile {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  background: #1f1f1f;
  border: 2px solid transparent;
  border-radius: 16px;
  transition: border-color 0.2s;
}
.cx-tile.is-speaking {
  border-color: var(--accent);
}
.cx-tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.cx-tile.has-video video {
  opacity: 1;
}
.cx-tile.has-video .cx-avatar {
  visibility: hidden;
}
.cx-tile-name {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-start: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 13px;
  background: #0009;
  border-radius: 999px;
}
.cx-tile-name i {
  width: 8px;
  height: 8px;
  background: #888;
  border-radius: 50%;
}
.cx-tile-name i[data-quality='good'] {
  background: #22c55e;
}
.cx-tile-name i[data-quality='fair'] {
  background: #f59e0b;
}
.cx-tile-name i[data-quality='poor'] {
  background: #ef4444;
}
.cx-self {
  position: absolute;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  width: min(220px, 30vw);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #000;
  border: 2px solid #fff3;
  border-radius: 12px;
  transform: scaleX(-1);
}
.cx-self[hidden] {
  display: none;
}
.cx-call-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: #0b0b0b;
}
.cx-call-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  background: #2a2a2a;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.cx-call-btn:hover {
  background: #3a3a3a;
}
.cx-call-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cx-call-btn.is-on {
  color: #111;
  background: #fff;
}
.cx-call-btn.is-danger {
  background: #dc2626;
}
.cx-call-btn.is-accept {
  background: #16a34a;
}
.cx-call-btn.big {
  width: 64px;
  height: 64px;
}
.cx-devices {
  position: fixed;
  inset-block-end: 96px;
  inset-inline: 0;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  margin-inline: auto;
  padding: 14px;
  color: var(--ink);
  background: var(--surface);
  border-radius: 16px;
}
.cx-devices[hidden] {
  display: none;
}
.cx-devices label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.cx-devices select {
  min-height: 36px;
  font: inherit;
}

/* Phones and narrow tablets: one panel at a time. */
@media (max-width: 1100px) {
  .cx-shell,
  .cx-shell:has(.cx-side:not([hidden])) {
    grid-template-columns: 64px minmax(240px, 300px) minmax(0, 1fr);
  }
  .cx-shell:has(.cx-side:not([hidden])) .cx-side {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 6;
    width: min(340px, 100%);
    background: var(--surface);
    box-shadow: -8px 0 32px #17171722;
  }
  .cx-shell {
    position: relative;
  }
  .cx-nav {
    align-items: center;
    padding-inline: 6px;
  }
  .cx-brand,
  .cx-filter span,
  .cx-nav-actions .btn span {
    display: none;
  }
  .cx-filter {
    position: relative;
    justify-content: center;
    width: 48px;
  }
  .cx-filter b {
    position: absolute;
    inset-block-start: 2px;
    inset-inline-end: 0;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
  }
  .cx-nav-actions .btn {
    justify-content: center;
    width: 48px;
    padding: 0;
  }
}
@media (max-width: 760px) {
  .cx-root {
    --cx-height: calc(100dvh - 170px);
  }
  .cx-page-heading p {
    display: none;
  }
  .cx-shell,
  .cx-shell:has(.cx-side:not([hidden])) {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .cx-nav {
    flex-direction: row;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    border-inline-end: 0;
    border-block-end: 1px solid var(--line);
  }
  .cx-nav-actions {
    display: flex;
    margin: 0;
    padding: 0;
  }
  .cx-filter,
  .cx-nav-actions .btn {
    flex: none;
    width: 44px;
  }
  .cx-list {
    border-inline-end: 0;
  }
  .cx-main {
    display: none;
  }
  .cx-shell.cx-open .cx-nav,
  .cx-shell.cx-open .cx-list {
    display: none;
  }
  .cx-shell.cx-open {
    grid-template-rows: minmax(0, 1fr);
  }
  .cx-shell.cx-open .cx-main {
    display: flex;
  }
  .cx-back {
    display: inline-grid;
  }
  .cx-bubble {
    max-width: 86%;
  }
  .cx-messages {
    padding: 10px;
  }
  .cx-head-actions [data-cx='find'] {
    display: none;
  }
  .cx-picker {
    grid-template-columns: repeat(6, 38px);
  }
  .cx-self {
    width: 110px;
    inset-block-end: 12px;
    inset-inline-end: 12px;
  }
  .cx-call-btn {
    width: 46px;
    height: 46px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cx-call-card .cx-avatar.xl {
    animation: none;
  }
  .cx-poll-bar,
  .cx-tile {
    transition: none;
  }
}
.cx-compose-row textarea:placeholder-shown {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
