:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--maxq-text);
  background: var(--maxq-black);
  --maxq-black: #0a0a0a;
  --maxq-page: #050505;
  --maxq-panel: #101014;
  --maxq-panel-soft: #16161a;
  --maxq-border: rgba(255, 255, 255, 0.1);
  --maxq-border-strong: rgba(245, 196, 0, 0.28);
  --maxq-gold: #f5c400;
  --maxq-gold-hover: #f5c400;
  --maxq-text: #f5f5f5;
  --maxq-muted: #a1a1aa;
  --maxq-muted-strong: #d4d4d8;
  /* Previous message combo: received bg var(--maxq-panel), received border var(--maxq-border), sent bg rgba(245, 196, 0, 0.12), sent border rgba(245, 196, 0, 0.34). */
  --message-received-bg: var(--maxq-gold);
  --message-received-border: rgba(245, 196, 0, 0.72);
  --message-received-text: #0a0a0a;
  --message-sent-bg: #111111;
  --message-sent-border: rgba(255, 255, 255, 0.08);
  --message-sent-text: #f5f5f5;
  --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --maxq-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  --maxq-shadow-soft: 0 7px 22px rgba(0, 0, 0, 0.14);
  --maxq-focus: 0 0 0 3px rgba(245, 196, 0, 0.18);
  --maxq-popup-bg: #f8f8f6;
  --maxq-popup-soft: #ffffff;
  --maxq-popup-hover: #f2f2ee;
  --maxq-popup-border: rgba(10, 10, 10, 0.11);
  --maxq-popup-text: #171717;
  --maxq-popup-muted: #6f6f76;
  --maxq-popup-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
}

/* Enterprise call surface refresh */
.call-audio-sink {
  display: none;
}

.call-surface {
  z-index: 120;
}

.incoming-call,
.call-panel {
  backdrop-filter: none;
  background: #f6f5ef;
}

.call-panel.call-panel-stage {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f3f2ec !important;
  color: #111111 !important;
  box-shadow: none !important;
}

.call-panel.call-panel-stage .call-panel-head {
  min-height: 76px;
  padding: 18px 24px 14px;
  align-items: flex-start;
  background: #faf9f4;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.04);
}

.call-panel-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.call-panel.call-panel-stage .call-panel-head strong {
  font-size: 20px;
  font-weight: 900;
}

.call-panel.call-panel-stage .call-panel-head span {
  font-size: 14px;
}

.call-session-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.call-session-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  background: #f2eed6;
  color: #383838 !important;
  padding: 0 10px;
  font-size: 12px !important;
  font-weight: 800;
}

.call-window-actions {
  gap: 10px;
}

.call-window-button,
.call-end-button,
.call-tile-action {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 12px;
  background: #f6eed0;
  color: #111111;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.08);
}

.call-window-button svg,
.call-tile-action svg {
  width: 18px;
  height: 18px;
}

.call-stage-body {
  padding: 18px 24px 96px !important;
  gap: 18px !important;
}

.call-panel.call-panel-stage .call-video-grid {
  gap: 14px;
}

.call-panel.call-panel-stage.is-screen-share .call-video-grid {
  grid-template-columns: minmax(0, 1fr) clamp(170px, 16vw, 240px);
  grid-template-rows: repeat(4, minmax(96px, 1fr));
  gap: 12px;
}

.call-panel.call-panel-stage.is-screen-share .call-video-featured {
  grid-column: 1;
  grid-row: 1 / -1;
}

.call-panel.call-panel-stage.is-screen-share .call-video-tile:not(.call-video-featured) {
  grid-column: 2;
  min-height: 0;
}

.call-video-tile,
.call-video-empty,
.call-panel.call-panel-stage .call-video-tile,
.call-panel.call-panel-stage .call-video-empty {
  border-radius: 18px;
  background: #121317 !important;
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.08);
}

.call-video-tile span {
  left: 12px;
  bottom: 12px;
  background: rgba(12, 12, 14, 0.72);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.call-video-identity {
  top: 12px;
  left: 12px;
  max-width: calc(100% - 74px);
  background: rgba(14, 14, 18, 0.72);
  backdrop-filter: none;
}

.call-video-identity strong {
  font-size: 12px;
}

.call-participant-avatar {
  background: linear-gradient(180deg, #ffcc0f, #d9a700);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.16);
}

.call-muted-badge,
.call-live-badge {
  top: 12px;
  right: 12px;
  padding: 5px 9px;
  font-size: 11px;
}

.call-tile-action {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
}

.call-chat-panel {
  border-radius: 18px;
}

.call-panel.call-panel-stage .call-chat-panel {
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(17, 17, 17, 0.12);
}

.call-panel.call-panel-stage .call-chat-messages {
  padding: 18px 16px;
}

.call-panel.call-panel-stage .call-chat-message p {
  max-width: min(100%, 38ch);
  font-size: 14px;
  line-height: 1.45;
}

.call-panel.call-panel-stage .call-chat-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.call-panel.call-panel-stage .call-chat-form input {
  min-height: 48px;
}

.call-panel.call-panel-stage .call-chat-form button {
  min-width: 92px;
  min-height: 48px;
  font-size: 14px;
}

.call-controls {
  gap: 10px;
}

.call-panel.call-panel-stage .call-controls {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  width: auto;
  max-width: calc(100vw - 48px);
  padding: 8px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 18px;
  background: rgba(20, 20, 24, 0.84);
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.18);
  transform: translateX(-50%);
}

.call-control-button {
  min-width: 0;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f4efd1;
  color: #131313;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.call-control-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
}

.call-control-icon svg {
  width: 16px;
  height: 16px;
}

.call-control-label {
  line-height: 1;
  white-space: nowrap;
}

.call-control-button.is-off {
  background: #fbfbfb;
  color: #575757;
}

.call-control-button.is-on {
  background: #ffcc0f;
  color: #171717;
}

.call-control-button.call-end-control {
  background: #ef4444;
  color: #ffffff;
}

.call-mini-card {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 18px;
  background: #faf9f4;
  color: #111111;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(17, 17, 17, 0.16);
}

.call-mini-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.call-mini-meta > div:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.call-mini-meta strong {
  color: #111111;
  font-size: 15px;
}

.call-mini-meta span {
  color: #5d5d66;
  font-size: 12px;
}

.call-mini-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffcc0f, #d9a700);
  color: #111111;
  font-size: 14px;
  font-weight: 900;
}

.call-mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 860px) {
  .call-panel.call-panel-stage .call-panel-head {
    min-height: 72px;
    padding: 14px 14px 12px;
  }

  .call-panel.call-panel-stage .call-stage-body {
    padding: 12px 12px calc(104px + env(safe-area-inset-bottom)) !important;
    gap: 12px !important;
  }

  .call-panel.call-panel-stage.is-call-chat-open .call-stage-body,
  .call-panel.call-panel-stage.is-screen-share .call-stage-body,
  .call-panel.call-panel-stage.is-screen-share.is-call-chat-open .call-stage-body {
    grid-template-columns: 1fr;
  }

  .call-panel.call-panel-stage.is-screen-share .call-video-grid,
  .call-panel.call-panel-stage.is-screen-share.is-call-chat-open .call-video-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(42vh, 1fr);
  }

  .call-panel.call-panel-stage.is-screen-share .call-video-featured,
  .call-panel.call-panel-stage.is-screen-share .call-video-tile:not(.call-video-featured) {
    grid-column: 1;
    grid-row: auto !important;
  }

  .call-panel.call-panel-stage .call-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100vw - 24px);
    max-width: none;
    bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 8px;
  }

  .call-control-button {
    justify-content: center;
    min-height: 46px;
    padding: 0 10px;
  }

  .call-mini-card {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }
}

/* Final call-surface safety overrides */
.chat.call-session-active .topbar .global-search {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.call-video-tile,
.call-video-empty {
  isolation: isolate;
}

.call-video-tile > video,
.call-video-tile > audio {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: #070708;
}

.call-video-tile > .call-video-identity,
.call-video-tile > span,
.call-video-tile > .call-muted-badge,
.call-video-tile > .call-live-badge,
.call-video-tile > .call-tile-action {
  z-index: 3 !important;
}

.call-video-tile > .call-participant-avatar {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: clamp(64px, 8vw, 92px) !important;
  height: clamp(64px, 8vw, 92px) !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #ffcc0f, #d9a700) !important;
  color: #111111 !important;
  font-size: clamp(18px, 2vw, 28px) !important;
  font-weight: 900 !important;
  transform: translate(-50%, -50%) !important;
  z-index: 2 !important;
  box-shadow: 0 16px 38px rgba(17, 17, 17, 0.18) !important;
}

.call-video-tile:not(.call-video-placeholder) > .call-participant-avatar {
  display: none !important;
}

.call-video-identity {
  position: absolute !important;
  inset: 12px auto auto 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  max-width: calc(100% - 92px) !important;
  padding: 6px 10px 6px 6px !important;
  border-radius: 999px !important;
  background: rgba(12, 12, 14, 0.72) !important;
  color: #ffffff !important;
}

.call-video-identity .call-participant-avatar {
  position: static !important;
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px !important;
  transform: none !important;
  box-shadow: none !important;
}

html[data-resolved-theme="light"] {
  --maxq-black: #f5f5f5;
  --maxq-page: #f5f5f5;
  --maxq-panel: #ffffff;
  --maxq-panel-soft: #f6f7f4;
  --maxq-border: rgba(10, 10, 10, 0.1);
  --maxq-text: #0a0a0a;
  --maxq-muted: #52525b;
  --maxq-muted-strong: #3f3f46;
  /* Previous light sent bg: rgba(245, 196, 0, 0.2). */
  --message-received-bg: var(--maxq-gold);
  --message-received-border: rgba(10, 10, 10, 0.14);
  --message-received-text: #0a0a0a;
  --message-sent-bg: #111111;
  --message-sent-border: rgba(10, 10, 10, 0.88);
  --message-sent-text: #f5f5f5;
  --maxq-popup-bg: #ffffff;
  --maxq-popup-soft: #fbfbfa;
  --maxq-popup-hover: #f3f4f1;
  --maxq-popup-border: rgba(10, 10, 10, 0.12);
  --maxq-popup-text: #111111;
  --maxq-popup-muted: #5f6368;
  --maxq-popup-shadow: 0 16px 42px rgba(15, 23, 42, 0.16);
}

html[data-resolved-theme="light"] .sidebar {
  background: #101014;
  color: #f5f5f5;
}

html[data-resolved-theme="light"] .sidebar .channel {
  color: #d4d4d8;
}

html[data-resolved-theme="light"] .sidebar .channel:hover,
html[data-resolved-theme="light"] .sidebar .channel-active {
  color: #f5c400;
}

html[data-resolved-theme="light"] .sidebar .channel-saved,
html[data-resolved-theme="light"] .chat.sidebar-collapsed .sidebar {
  background: #101014;
}

html[data-resolved-theme="light"] .sidebar .sidebar-title,
html[data-resolved-theme="light"] .sidebar .sidebar-empty {
  color: #a1a1aa;
}

html[data-resolved-theme="light"] .sidebar .utility-nav {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-resolved-theme="light"] .sidebar .sidebar-actions button:not([data-new-group]) {
  background: #16161a;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}

html[data-resolved-theme="light"] .topbar {
  background: #101014;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}

html[data-resolved-theme="light"] .topbar .mark {
  color: #f5f5f5;
}

html[data-resolved-theme="light"] .topbar .mark-product {
  color: #d4d4d8;
}

html[data-resolved-theme="light"] .topbar .global-search input {
  background: #16161a;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f5;
}

html[data-resolved-theme="light"] .message-reply-preview {
  background: #fff8d8;
  border-color: rgba(245, 196, 0, 0.46);
  color: #1f1f1f;
  box-shadow: inset 0 0 0 1px rgba(245, 196, 0, 0.14);
}

html[data-resolved-theme="light"] .message-mine .message-reply-preview {
  background: #fff1ad;
  border-color: rgba(245, 196, 0, 0.62);
}

html[data-resolved-theme="light"] .message-reply-preview span {
  color: #57534e;
}

html[data-resolved-theme="light"] .attachment-preview-backdrop {
  background: rgba(5, 5, 5, 0.68);
}

html[data-resolved-theme="light"] .attachment-preview-body {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.42)),
    rgba(5, 5, 5, 0.42);
}

html[data-resolved-theme="light"] .attachment-preview-info {
  color: #f5f5f5;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.85);
}

html[data-resolved-theme="light"] .attachment-preview-info strong {
  color: #f5f5f5;
}

html[data-resolved-theme="light"] .attachment-preview-info span {
  color: rgba(245, 245, 245, 0.76);
}

html[data-resolved-theme="light"] .attachment-preview-actions {
  border-color: rgba(10, 10, 10, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

html[data-resolved-theme="light"] .attachment-preview-actions a,
html[data-resolved-theme="light"] .attachment-preview-actions button {
  color: #0a0a0a;
}

html[data-resolved-theme="light"] .attachment-preview-actions [data-preview-zoom-label] {
  color: rgba(10, 10, 10, 0.68);
}

html[data-resolved-theme="light"] .message-date-separator {
  color: rgba(10, 10, 10, 0.58);
}

html[data-resolved-theme="light"] .message-date-separator::before,
html[data-resolved-theme="light"] .message-date-separator::after {
  background: rgba(10, 10, 10, 0.14);
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-color: rgba(245, 196, 0, 0.34) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

*:hover::-webkit-scrollbar-thumb,
*:focus-within::-webkit-scrollbar-thumb {
  background: rgba(245, 196, 0, 0.42);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(245, 196, 0, 0.13), transparent 28%),
    var(--maxq-black);
  color: var(--maxq-text);
  font-size: 13.5px;
  text-rendering: geometricPrecision;
}

html {
  text-size-adjust: 100%;
}

button,
a,
input,
select,
textarea,
summary,
[role="button"],
.channel,
.card,
.notification-card,
.response-notice,
.reminder-item,
.message-bubble {
  transition:
    background-color 180ms var(--motion-ease),
    border-color 180ms var(--motion-ease),
    color 180ms var(--motion-ease),
    box-shadow 180ms var(--motion-ease),
    transform 180ms var(--motion-ease),
    opacity 180ms var(--motion-ease);
}

button:hover,
a.button:hover,
.channel:hover,
.response-notice:hover,
.reminder-item:hover {
  transform: translateY(-1px);
}

button:active,
a.button:active,
.channel:active {
  transform: translateY(0) scale(0.985);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 0;
  box-shadow: var(--maxq-focus);
}

input,
select,
textarea {
  min-width: 0;
  caret-color: var(--maxq-gold);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

option {
  background: var(--maxq-panel);
  color: var(--maxq-text);
}

html[data-resolved-theme="light"] option {
  background: #ffffff;
  color: #0a0a0a;
}

.shell {
  min-height: 100vh;
}

.panel {
  width: min(100%, 420px);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 24px;
}

.mark {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--maxq-text);
  letter-spacing: 0;
  white-space: nowrap;
}

.mark-q {
  color: var(--maxq-gold);
}

.mark-product {
  color: var(--maxq-muted-strong);
  font-weight: 400;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

p {
  margin: 0;
  color: var(--maxq-muted);
  line-height: 1.5;
}

.button {
  width: fit-content;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #f5c400;
  color: #0a0a0a;
  text-decoration: none;
  font-weight: 650;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button-secondary {
  border: 1px solid var(--maxq-border);
  background: transparent;
  color: var(--maxq-text);
}

.login-form {
  display: grid;
  gap: 12px;
  width: min(100%, 340px);
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--maxq-muted-strong);
  font-size: 13px;
  font-weight: 650;
}

.login-form input {
  height: 42px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel);
  color: var(--maxq-text);
  padding: 0 12px;
  font: inherit;
}

.login-form .button {
  width: 100%;
  border: 0;
  cursor: pointer;
}

.login-form .button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-error {
  color: #e25544;
  font-size: 13px;
}

.panel-error .mark {
  color: #9d3327;
}

.chat {
  height: 100vh;
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  grid-template-rows: 52px 1fr;
  overflow: hidden;
  background: var(--maxq-page);
  transition: grid-template-columns 0.2s ease;
}

.chat.sidebar-collapsed {
  grid-template-columns: 4.5rem minmax(0, 1fr);
}

.topbar {
  grid-column: 1 / -1;
  position: relative;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--maxq-border);
  background: var(--maxq-black);
}

.mobile-nav-button,
.mobile-header-nav,
.sidebar-backdrop {
  display: none;
}

.global-search {
  position: relative;
  flex: 1;
  max-width: 640px;
}

.global-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  padding: 0 12px;
  font: inherit;
}

.global-search-results {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel);
  color: var(--maxq-text);
  box-shadow: 0 12px 28px rgb(0 0 0 / 26%);
  padding: 6px;
}

.search-group {
  display: grid;
  gap: 1px;
  padding: 4px 0;
}

.search-group + .search-group {
  border-top: 1px solid var(--maxq-border);
}

.search-group strong {
  color: var(--maxq-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px 2px;
  text-transform: uppercase;
}

.search-group button,
.search-group a,
.search-group span {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--maxq-text);
  display: block;
  text-align: left;
  padding: 7px 8px;
  text-decoration: none;
}

.search-group button,
.search-group a {
  cursor: pointer;
}

.search-group small {
  color: var(--maxq-muted);
  display: block;
  margin-top: 2px;
}

.profile-menu {
  position: relative;
  z-index: 140;
}

.profile-menu summary {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--maxq-gold);
  color: #0a0a0a;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-popover {
  position: absolute;
  right: 0;
  top: 44px;
  z-index: 240;
  width: 260px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--maxq-border);
  border-radius: 7px;
  background: var(--maxq-panel);
  box-shadow: 0 12px 30px rgb(23 32 29 / 14%);
  padding: 12px;
}

.profile-popover button {
  min-height: 34px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  font: inherit;
  cursor: pointer;
}

.presence-form {
  display: grid;
  gap: 8px;
}

.presence-form label {
  display: grid;
  gap: 5px;
  justify-items: stretch;
  color: var(--maxq-muted);
  font-size: 12px;
  line-height: 1.25;
}

.search-result {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  isolation: isolate;
}

.search-result::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--maxq-gold);
  box-shadow: 0 0 0 4px rgba(245, 196, 0, 0.12);
}

.search-result > span:first-child {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  padding: 0 !important;
  color: inherit !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result small {
  max-width: 132px;
  overflow: hidden;
  color: var(--mq-chat-muted) !important;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-person,
.search-result-channel,
.search-result-message,
.search-result-file {
  grid-template-columns: 7px minmax(0, 1fr) auto !important;
}

.search-result-person > span:first-child,
.search-result-channel > span:first-child,
.search-result-message > span:first-child,
.search-result-file > span:first-child {
  grid-column: 2;
}

.search-result-person small,
.search-result-channel small,
.search-result-message small,
.search-result-file small {
  grid-column: 3;
}

.search-empty {
  color: var(--mq-chat-muted) !important;
  font-size: 12px !important;
}

.presence-form select,
.presence-form input {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  padding: 0 9px;
  font: inherit;
}

.presence-dot {
  width: 9px;
  height: 9px;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid var(--maxq-panel);
  border-radius: 50%;
  background: var(--maxq-muted);
}

.presence-available {
  background: #22c55e;
}

.presence-away {
  background: #f59e0b;
}

.presence-busy {
  background: #ef4444;
}

.presence-busy::after {
  content: none;
}

.presence-offline {
  background: #71717a;
}

.presence-profile-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-color: var(--maxq-black);
}

.presence-channel-dot {
  margin-left: -8px;
  z-index: 1;
}

.channel-presence-spacer {
  width: 9px;
  height: 9px;
}

.sidebar {
  overflow-y: auto;
  border-right: 1px solid var(--maxq-border);
  background: var(--maxq-panel);
  padding: 10px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: minmax(0, max-content) 28px;
  gap: 6px;
  margin-bottom: 12px;
}

.back-button {
  min-height: 32px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  font: inherit;
  cursor: pointer;
}

.sidebar-actions button,
.attach-button {
  min-height: 34px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  font: inherit;
  cursor: pointer;
}

.sidebar-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-inline: 10px;
}

.sidebar-actions button[data-new-group] {
  border-color: transparent;
  background: var(--maxq-gold);
  color: #0a0a0a;
  font-weight: 400;
}

.sidebar-actions button[data-new-group]:hover {
  background: var(--maxq-gold-hover);
}

.button-icon,
.channel-icon {
  width: 17px;
  height: 17px;
  display: inline-flex;
  flex: 0 0 auto;
}

.button-icon svg,
.channel-icon svg,
.sidebar-toggle svg {
  width: 100%;
  height: 100%;
}

.sidebar-toggle {
  color: var(--maxq-gold);
  font-weight: 800;
  min-height: 28px;
  padding: 0;
  width: 28px;
}

.sidebar-toggle:hover {
  background: var(--maxq-gold);
  color: #050505;
}

.sidebar-title {
  margin: 0 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--maxq-muted);
  text-transform: uppercase;
}

.nav-section {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.sidebar-empty {
  padding: 8px;
  color: var(--maxq-muted);
  font-size: 13px;
}

.channel-list {
  display: grid;
  gap: 4px;
}

.utility-nav {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--maxq-border);
}

.channel {
  position: relative;
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 17px 9px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  border: 0;
  border-radius: 6px;
  padding: 0 7px;
  background: transparent;
  color: var(--maxq-muted-strong);
  text-align: left;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.channel-name {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-short-name {
  display: none;
}

.channel-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--maxq-gold);
  color: #050505;
  font-size: 11px;
  font-weight: 800;
  padding: 0 6px;
}

.channel:hover,
.channel-active {
  background: rgba(245, 196, 0, 0.14);
  color: var(--maxq-gold);
}

.channel-saved {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--maxq-panel);
}

.chat.sidebar-collapsed .sidebar {
  padding-inline: 8px;
}

.chat.sidebar-collapsed .sidebar-actions {
  grid-template-columns: 1fr;
}

.chat.sidebar-collapsed .sidebar-actions button:not(.sidebar-toggle) .button-label,
.chat.sidebar-collapsed .sidebar-title,
.chat.sidebar-collapsed .sidebar-empty,
.chat.sidebar-collapsed .channel-name {
  display: none;
}

.chat.sidebar-collapsed .sidebar-actions button:not(.sidebar-toggle) {
  width: 100%;
  padding-inline: 0;
}

.chat.sidebar-collapsed .channel {
  grid-template-columns: minmax(0, 1fr);
  column-gap: 0;
  padding-inline: 9px;
}

.chat.sidebar-collapsed .channel-icon,
.chat.sidebar-collapsed .presence-channel-dot,
.chat.sidebar-collapsed .channel-presence-spacer {
  display: none;
}

.chat.sidebar-collapsed .channel-short-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.chat.sidebar-collapsed .channel-badge {
  position: absolute;
  right: 3px;
  top: 3px;
  transform: none;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 9px;
}

.identity {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--maxq-muted);
}

.conversation {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  overflow: hidden;
  background: var(--maxq-black);
}

.conversation-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--maxq-border);
  background: var(--maxq-black);
}

.conversation-header h1 {
  font-size: 18px;
  color: var(--maxq-text);
}

.conversation-title {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
}

.conversation-title h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-timezone {
  min-width: 0;
  overflow: hidden;
  color: var(--maxq-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-presence {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--maxq-muted);
  font-size: 12px;
  line-height: 1.2;
}

.conversation-presence span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-header [data-show-reminder-form] {
  margin-left: auto;
  border-color: transparent;
  background: var(--maxq-gold);
  color: #0a0a0a;
  font-weight: 500;
}

.notification-read-button {
  margin-left: auto;
  padding: 0 12px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  font-weight: 500;
}

.notification-read-button:hover {
  border-color: var(--maxq-gold);
  color: var(--maxq-gold);
  background: rgba(245, 196, 0, 0.08);
}

.conversation-header [data-show-reminder-form]:hover {
  background: var(--maxq-gold-hover);
}

.call-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-header-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--maxq-border);
  border-radius: 12px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  padding: 0;
}

.call-header-button svg {
  width: 18px;
  height: 18px;
}

.call-header-button:hover {
  border-color: rgba(245, 196, 0, 0.46);
  background: rgba(245, 196, 0, 0.12);
  color: var(--maxq-gold);
}

.call-header-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.call-surface {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

.incoming-call,
.call-panel {
  pointer-events: auto;
  border: 1px solid var(--maxq-border);
  background: color-mix(in srgb, var(--maxq-panel) 92%, transparent);
  color: var(--maxq-text);
  box-shadow: var(--maxq-shadow);
  backdrop-filter: blur(16px);
}

.incoming-call {
  position: absolute;
  top: 84px;
  left: 50%;
  width: min(92vw, 520px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 18px;
  padding: 14px;
  transform: translateX(-50%);
}

.incoming-call div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.incoming-call strong,
.call-panel strong {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-call span,
.call-panel span,
.call-error {
  color: var(--maxq-muted);
  font-size: 12px;
}

.incoming-call-actions,
.call-controls,
.call-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.incoming-call-actions button,
.call-controls button,
.call-end-button {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  font-weight: 800;
  white-space: nowrap;
}

.incoming-call-actions [data-accept-call] {
  background: var(--maxq-gold);
  color: #0a0a0a;
}

.call-panel {
  position: absolute;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(92px, 12vh, 132px);
  width: min(420px, calc(100vw - 28px));
  display: grid;
  gap: 12px;
  border-radius: 20px;
  padding: 14px;
}

.call-panel-stage,
.call-panel.is-call-fullscreen {
  position: fixed;
  top: 65px;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at top left, rgba(245, 196, 0, 0.08), transparent 34%),
    #f7f7f3;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 100;
}

.call-panel-stage.is-call-chat-open,
.call-panel.is-call-fullscreen.is-call-chat-open {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.call-panel.is-call-fullscreen {
  inset: 0;
}

.call-panel-head {
  justify-content: space-between;
  min-height: 52px;
  padding: 0 18px;
}

.call-panel-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.call-end-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.call-window-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-window-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.08);
  color: #111111;
  font-weight: 900;
}

.call-panel-stage .call-end-button,
.call-panel.is-call-fullscreen .call-end-button {
  background: rgba(245, 196, 0, 0.22);
  color: #111111;
}

.call-video-grid {
  min-height: 150px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.call-stage-body {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  padding: 12px 18px 86px;
}

.call-panel-stage .call-stage-body,
.call-panel.is-call-fullscreen .call-stage-body {
  grid-template-columns: minmax(0, 1fr);
}

.call-panel-stage.is-call-chat-open .call-stage-body,
.call-panel.is-call-fullscreen.is-call-chat-open .call-stage-body {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 450px);
}

.call-panel-stage .call-video-grid,
.call-panel.is-call-fullscreen .call-video-grid {
  min-height: 0;
  height: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  grid-auto-rows: minmax(220px, 1fr);
  align-items: stretch;
  overflow: hidden;
}

.call-panel-stage .call-video-grid:has(.call-video-featured),
.call-panel.is-call-fullscreen .call-video-grid:has(.call-video-featured) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) minmax(128px, 22%);
}

.call-panel-stage.is-call-chat-open .call-video-grid:has(.call-video-featured),
.call-panel.is-call-fullscreen.is-call-chat-open .call-video-grid:has(.call-video-featured) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.call-chat-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(10, 10, 10, 0.12);
  border-radius: 18px;
  background: #1f2026;
  color: #f7f7f3;
  box-shadow: 0 20px 60px rgba(17, 17, 17, 0.18);
}

.call-chat-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.call-chat-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: var(--maxq-panel-soft);
  color: #111111;
  font-size: 20px;
  line-height: 1;
}

.call-chat-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 14px;
}

.call-chat-empty {
  margin: auto;
  color: rgba(247, 247, 243, 0.62);
  font-weight: 700;
}

.call-chat-message {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.call-chat-message div {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  color: rgba(247, 247, 243, 0.62);
  font-size: 11px;
}

.call-chat-message strong {
  min-width: 0;
  overflow: hidden;
  color: #f7f7f3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-chat-message p {
  width: fit-content;
  max-width: min(100%, 34ch);
  margin: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #f7f7f3;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.35;
}

.call-chat-message.is-mine {
  justify-items: end;
}

.call-chat-message.is-mine div {
  justify-content: flex-end;
}

.call-chat-message.is-mine p {
  background: rgba(245, 196, 0, 0.2);
  color: #111111;
}

.call-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.call-chat-form input {
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #f7f7f3;
  color: #111111;
  padding: 0 12px;
}

.call-chat-form button {
  border: 0;
  border-radius: 12px;
  background: var(--maxq-gold);
  color: #111111;
  font-weight: 900;
  padding: 0 14px;
}

.call-video-tile,
.call-video-empty {
  position: relative;
  min-height: 120px;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(245, 196, 0, 0.18), transparent 46%),
    var(--maxq-panel-soft);
}

.call-panel-stage .call-video-tile,
.call-panel-stage .call-video-empty,
.call-panel.is-call-fullscreen .call-video-tile,
.call-panel.is-call-fullscreen .call-video-empty {
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(245, 196, 0, 0.12), transparent 48%),
    #17171b;
}

.call-panel-stage .call-video-featured,
.call-panel.is-call-fullscreen .call-video-featured {
  grid-column: 1 / -1;
  grid-row: 1;
}

.call-panel-stage .call-video-grid:has(.call-video-featured) .call-video-tile:not(.call-video-featured),
.call-panel.is-call-fullscreen .call-video-grid:has(.call-video-featured) .call-video-tile:not(.call-video-featured) {
  grid-row: 2;
}

.call-video-tile video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.call-video-screen video,
.call-video-featured video {
  object-fit: contain;
  background: #09090b;
}

.call-video-tile span {
  position: absolute;
  left: 10px;
  bottom: 8px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.68);
  color: #f5f5f5;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-video-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--maxq-muted);
  font-weight: 700;
}

.call-controls {
  flex-wrap: wrap;
}

.call-panel-stage .call-controls,
.call-panel.is-call-fullscreen .call-controls {
  position: absolute;
  left: 50%;
  bottom: 32px;
  justify-self: center;
  max-width: min(100%, 720px);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(8, 8, 10, 0.64);
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.22);
  transform: translateX(-50%);
}

.call-controls button {
  flex: 1 1 auto;
  padding-inline: 12px;
}

.call-controls .is-off {
  color: var(--maxq-muted);
}

.call-controls .is-on {
  background: rgba(245, 196, 0, 0.18);
  color: var(--maxq-gold);
}

.call-controls .call-end-control {
  background: #ef4444;
  color: #ffffff;
}

.call-panel.call-panel-stage,
.call-panel.call-panel-stage.is-call-fullscreen {
  top: 65px !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: auto !important;
  max-height: none !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f6f6f1 !important;
  color: #111111 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}

.call-panel.call-panel-stage .call-panel-head {
  min-height: 64px;
  padding: 0 24px;
  background: #f6f6f1;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  color: #111111;
  box-shadow: 0 10px 30px rgba(17, 17, 17, 0.04);
  z-index: 2;
}

.call-panel.call-panel-stage .call-panel-head strong {
  color: #111111;
  font-size: 18px;
}

.call-panel.call-panel-stage .call-panel-head span {
  color: #4b5563;
  font-size: 13px;
}

.call-panel.call-panel-stage .call-stage-body {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
  padding: 16px 24px 92px;
}

.call-panel.call-panel-stage.is-call-chat-open .call-stage-body {
  grid-template-columns: minmax(0, 1fr) clamp(340px, 26vw, 470px);
}

.call-panel.call-panel-stage .call-video-grid {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.call-panel.call-panel-stage.is-screen-share .call-video-grid {
  grid-template-columns: minmax(0, 1fr) clamp(160px, 15vw, 230px);
  grid-template-rows: repeat(3, minmax(120px, 1fr));
  align-items: stretch;
}

.call-panel.call-panel-stage.is-screen-share .call-video-featured {
  grid-column: 1;
  grid-row: 1 / -1;
}

.call-panel.call-panel-stage.is-screen-share .call-video-tile:not(.call-video-featured) {
  grid-column: 2;
  grid-row: auto !important;
  min-height: 0;
}

.call-panel.call-panel-stage.is-screen-share.is-call-chat-open .call-video-grid {
  grid-template-columns: minmax(0, 1fr) clamp(130px, 11vw, 180px);
}

.call-panel.call-panel-stage .call-video-tile,
.call-panel.call-panel-stage .call-video-empty {
  min-height: 0 !important;
  height: 100%;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 16px;
  background: #111216 !important;
  box-shadow: none;
}

.call-panel.call-panel-stage.is-screen-share .call-video-tile:not(.call-video-featured) video {
  object-fit: cover;
}

.call-panel.call-panel-stage .call-video-featured video,
.call-panel.call-panel-stage .call-video-screen video {
  object-fit: contain;
  background: #050506;
}

.call-panel.call-panel-stage .call-chat-panel {
  min-height: 0;
  height: 100%;
  border: 1px solid var(--mq-chat-line);
  border-radius: 16px;
  background: var(--mq-chat-surface);
  color: var(--mq-chat-text);
  box-shadow: 0 16px 44px rgba(17, 17, 17, 0.12);
  opacity: 1;
  backdrop-filter: none;
}

.call-panel.call-panel-stage .call-chat-head {
  min-height: 58px;
  background: var(--mq-chat-panel);
  border-bottom: 1px solid var(--mq-chat-line);
  color: var(--mq-chat-text);
  padding: 12px 16px;
}

.call-panel.call-panel-stage .call-chat-head strong {
  color: var(--mq-chat-text);
  font-size: 16px;
}

.call-panel.call-panel-stage .call-chat-head button,
.call-panel.call-panel-stage .call-add-head button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--mq-chat-soft);
  color: var(--mq-chat-text);
  font-size: 20px;
  font-weight: 900;
}

.call-panel.call-panel-stage .call-chat-messages {
  gap: 12px;
  padding: 16px;
  background: var(--mq-chat-surface);
}

.call-panel.call-panel-stage .call-chat-empty,
.call-panel.call-panel-stage .call-chat-message div {
  color: var(--mq-chat-muted);
}

.call-panel.call-panel-stage .call-chat-message {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.call-panel.call-panel-stage .call-chat-message.is-mine {
  justify-items: end;
}

.call-panel.call-panel-stage .call-chat-message div {
  max-width: min(100%, 42ch);
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 12px;
  line-height: 1.2;
}

.call-panel.call-panel-stage .call-chat-message strong {
  color: var(--mq-chat-text);
}

.call-panel.call-panel-stage .call-chat-message p {
  max-width: min(100%, 44ch);
  margin: 0;
  border-radius: 16px 16px 16px 5px;
  background: var(--mq-chat-incoming);
  color: var(--mq-chat-text);
  padding: 10px 12px;
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.08);
  overflow-wrap: anywhere;
}

.call-panel.call-panel-stage .call-chat-message.is-mine p {
  border-radius: 16px 16px 5px 16px;
  background: var(--mq-chat-outgoing);
  color: var(--mq-chat-outgoing-text);
}

.call-panel.call-panel-stage .call-chat-form {
  gap: 10px;
  padding: 14px;
  background: var(--mq-chat-panel);
  border-top: 1px solid var(--mq-chat-line);
}

.call-panel.call-panel-stage .call-chat-form input {
  min-height: 46px;
  border: 1px solid var(--mq-chat-line);
  border-radius: 14px;
  background: var(--mq-chat-input);
  color: var(--mq-chat-text);
  font-size: 15px;
  padding: 0 14px;
}

.call-panel.call-panel-stage .call-chat-form button {
  min-height: 46px;
  min-width: 82px;
  border: 0;
  border-radius: 14px;
  background: var(--maxq-gold);
  color: #111111;
  font-weight: 900;
}

.call-panel.call-panel-stage .call-controls {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: auto;
  max-width: min(calc(100% - 48px), 760px);
  transform: translateX(-50%);
}

.call-participant-avatar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(56px, 8vw, 92px);
  height: clamp(56px, 8vw, 92px);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--maxq-gold);
  color: #111111;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
}

.call-video-identity {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 92px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.66);
  color: #ffffff;
  padding: 5px 9px 5px 5px;
  z-index: 2;
}

.call-video-identity .call-participant-avatar {
  position: static;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  font-size: 11px;
  transform: none;
  box-shadow: none;
}

.call-video-identity strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-muted-badge,
.call-live-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
}

.call-muted-badge {
  background: rgba(239, 68, 68, 0.92);
  color: #ffffff;
}

.call-live-badge {
  background: rgba(34, 197, 94, 0.92);
  color: #06230f;
}

.call-add-panel {
  position: absolute;
  top: 82px;
  right: 24px;
  z-index: 4;
  width: min(420px, calc(100vw - 48px));
  max-height: min(520px, calc(100% - 188px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--mq-chat-line);
  border-radius: 16px;
  background: var(--mq-chat-surface);
  color: var(--mq-chat-text);
  box-shadow: 0 24px 60px rgba(17, 17, 17, 0.2);
}

.call-add-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--mq-chat-line);
  background: var(--mq-chat-panel);
  padding: 12px 14px;
}

.call-add-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.call-add-head strong {
  color: var(--mq-chat-text);
  font-size: 16px;
}

.call-add-head span,
.call-add-empty,
.call-add-result small {
  color: var(--mq-chat-muted);
}

.call-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-bottom: 1px solid var(--mq-chat-line);
  background: var(--mq-chat-panel);
  padding: 12px;
}

.call-add-form input {
  min-height: 42px;
  border: 1px solid var(--mq-chat-line);
  border-radius: 13px;
  background: var(--mq-chat-input);
  color: var(--mq-chat-text);
  padding: 0 13px;
  font-size: 14px;
}

.call-add-form button {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  background: var(--maxq-gold);
  color: #111111;
  font-weight: 900;
  padding: 0 14px;
}

.call-add-results {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 12px;
}

.call-add-empty {
  border: 1px dashed var(--mq-chat-line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.call-add-result {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--mq-chat-line);
  border-radius: 14px;
  background: var(--mq-chat-panel);
  color: var(--mq-chat-text);
  padding: 8px 10px;
  text-align: left;
}

.call-add-result:hover {
  border-color: color-mix(in srgb, var(--maxq-gold) 54%, var(--mq-chat-line));
  background: color-mix(in srgb, var(--maxq-gold) 12%, var(--mq-chat-panel));
}

.call-add-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--maxq-gold);
  color: #111111;
  font-size: 12px;
  font-weight: 900;
}

.call-add-result span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.call-add-result strong,
.call-add-result small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.call-error {
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
  padding: 9px 10px;
}

.message-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px clamp(28px, 5vw, 72px);
}

.typing-indicator {
  min-height: 28px;
  padding: 0 clamp(28px, 5vw, 72px) 8px;
  color: var(--maxq-muted);
  font-size: 13px;
}

.side-card {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--maxq-border);
}

.side-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--maxq-text);
  font-size: 13px;
}

.response-notifications,
.reminder-list,
.reminder-form {
  display: grid;
  gap: 8px;
}

.response-notifications {
  width: 100%;
  justify-self: stretch;
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.response-notifications:has(.notification-card:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notification-card {
  min-width: 0;
  min-height: 0;
  height: min(660px, calc(100vh - 154px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--maxq-border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--maxq-panel-soft) 92%, var(--maxq-gold) 8%), var(--maxq-panel));
  box-shadow: var(--maxq-shadow-soft);
}

.notification-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--maxq-border);
}

.notification-card-header h2 {
  margin: 0;
  color: var(--maxq-text);
  font-size: 15px;
  line-height: 1.2;
}

.notification-card-header p {
  margin-top: 5px;
  color: var(--maxq-muted);
  font-size: 12px;
  line-height: 1.35;
}

.notification-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.notification-card-actions span {
  min-width: 30px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(245, 196, 0, 0.16);
  color: var(--maxq-gold);
  font-size: 12px;
  font-weight: 800;
}

.notification-card-actions button {
  min-height: 26px;
  border: 1px solid var(--maxq-border);
  border-radius: 999px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  padding: 0 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.notification-card-actions button:hover:not(:disabled) {
  border-color: var(--maxq-border-strong);
  color: var(--maxq-gold);
}

.notification-card-actions button:disabled {
  cursor: default;
  opacity: 0.48;
}

.notification-card-scroll {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
}

.notification-card-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed var(--maxq-border);
  border-radius: 7px;
}

.notification-group {
  display: grid;
  gap: 7px;
}

.notification-group + .notification-group {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--maxq-border);
}

.notification-group-title {
  color: var(--maxq-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.reminder-group {
  display: grid;
  gap: 8px;
  width: min(420px, 100%);
}

.reminder-group + .reminder-group {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--maxq-border);
}

.reminder-group-title {
  color: var(--maxq-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.response-notice,
.reminder-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--maxq-border);
  border-radius: 7px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
}

.response-notice,
.reminder-item {
  font: inherit;
}

.notification-line {
  grid-template-columns: 76px minmax(0, 1fr) auto;
  min-height: 48px;
  padding: 9px 12px;
  gap: 14px;
}

.notification-line time,
.notification-copy,
.notification-copy strong,
.notification-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-line time {
  color: var(--maxq-muted);
  font-size: 11px;
  white-space: nowrap;
}

.notification-copy {
  display: grid;
  gap: 3px;
}

.notification-copy strong {
  color: var(--maxq-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.notification-copy small {
  color: var(--maxq-muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.notification-line .result-action {
  align-self: center;
}

.response-notice:hover,
.reminder-item:hover {
  border-color: var(--maxq-border-strong);
  background: rgba(245, 196, 0, 0.08);
}

.result-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.result-action {
  color: var(--maxq-gold);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.reminder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.reminder-actions button {
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: transparent;
  color: var(--maxq-text);
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
  cursor: pointer;
}

.reminder-actions button:hover {
  border-color: var(--maxq-gold);
  color: var(--maxq-gold);
}

.reminder-item-project {
  border-color: rgba(245, 196, 0, 0.28);
}

.response-notice span,
.reminder-item span,
.reminder-item time,
.side-empty {
  color: var(--maxq-muted);
  font-size: 12px;
}

.utility-view {
  min-height: 0;
  overflow-y: auto;
  padding: 18px clamp(28px, 5vw, 72px);
}

.utility-list {
  width: 100%;
  max-width: 1040px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.utility-list.response-notifications {
  max-width: none;
  justify-self: stretch;
}

.reminder-header-action {
  position: relative;
  margin-left: auto;
}

.utility-reminder-form {
  width: min(440px, 100%);
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--maxq-border);
  border-radius: 7px;
  background: var(--maxq-panel);
  box-shadow: var(--maxq-shadow);
}

.reminder-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  width: min(440px, calc(100vw - 32px));
}

.utility-reminder-form[hidden] {
  display: none !important;
}

.reminder-form input,
.reminder-form textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  padding: 8px 9px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  font: inherit;
}

.reminder-form textarea {
  min-height: 62px;
  resize: vertical;
}

.reminder-form button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--maxq-gold);
  color: #0a0a0a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.empty-state {
  color: var(--maxq-muted);
  padding: 24px 0;
}

.message {
  width: fit-content;
  max-width: min(720px, 78%);
  align-self: flex-start;
  margin-bottom: 14px;
  overflow: visible;
}

.message-grouped {
  margin-top: -8px;
  margin-bottom: 8px;
}

.message-date-separator {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr);
  align-items: center;
  gap: 12px;
  margin: 16px auto 10px;
  color: rgba(245, 245, 245, 0.56);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.message-date-separator::before,
.message-date-separator::after {
  content: "";
  height: 1px;
  background: rgba(245, 245, 245, 0.14);
}

.message-date-separator span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-older-messages {
  justify-self: center;
  min-height: 34px;
  border: 1px solid var(--mq-chat-line);
  border-radius: 999px;
  background: var(--mq-chat-panel);
  color: var(--mq-chat-text);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.08);
}

.load-older-messages:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--maxq-gold) 54%, var(--mq-chat-line));
  background: color-mix(in srgb, var(--maxq-gold) 12%, var(--mq-chat-panel));
}

.message-mine {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
  text-align: right;
}

.message-meta {
  display: grid;
  gap: 1px;
  margin-bottom: 3px;
}

.message-meta-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.message-meta .presence-dot {
  align-self: center;
}

.message-mine .message-meta {
  justify-content: flex-end;
  justify-items: end;
}

.message-mine .message-meta-line {
  justify-content: flex-end;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  position: relative;
}

.message-content {
  min-width: 0;
  display: grid;
  justify-items: start;
  row-gap: 2px;
}

.message-highlight .message-content {
  animation: message-highlight 1.2s ease;
}

@keyframes message-highlight {
  0%,
  100% {
    filter: none;
  }
  35% {
    filter: drop-shadow(0 0 14px rgba(245, 196, 0, 0.35));
  }
}

.message-mine .message-row {
  justify-content: flex-end;
}

.message-mine .message-content {
  justify-items: end;
}

.message-meta strong {
  font-size: 10px;
  line-height: 1.2;
}

.message-meta time {
  font-size: 10px;
  color: var(--maxq-muted);
}

.message-timezone {
  min-width: 0;
  max-width: min(240px, 70vw);
  overflow: hidden;
  color: var(--maxq-muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edited {
  font-size: 10px;
  color: var(--maxq-muted);
}

.message-action-stack {
  position: absolute;
  left: -34px;
  top: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 30px;
  pointer-events: none;
}

.message-menu {
  position: relative;
  margin: 0;
  z-index: 25;
  pointer-events: auto;
}

.message-mine .message-action-stack {
  left: auto;
  right: -34px;
}

.message-read-state {
  color: var(--maxq-muted);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.message-menu summary {
  width: 30px;
  height: 28px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--maxq-panel) 82%, transparent);
  border: 1px solid var(--maxq-border);
  border-radius: 999px;
  color: var(--maxq-muted-strong);
  cursor: pointer;
  list-style: none;
  box-shadow: 0 10px 24px rgb(0 0 0 / 16%);
}

.message-menu summary svg {
  width: 17px;
  height: 17px;
}

.message-menu summary::-webkit-details-marker {
  display: none;
}

.message-menu summary:hover {
  background: rgba(245, 196, 0, 0.12);
  border-color: rgba(245, 196, 0, 0.38);
  color: var(--maxq-gold);
}

.message-menu[open] summary {
  background: rgba(245, 196, 0, 0.16);
  border-color: rgba(245, 196, 0, 0.42);
  color: var(--maxq-gold);
}

.message-menu-popover {
  position: absolute;
  top: 34px;
  left: 0;
  display: none;
  min-width: 150px;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--maxq-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--maxq-panel) 94%, transparent);
  box-shadow: 0 18px 48px rgb(0 0 0 / 24%);
  backdrop-filter: blur(18px) saturate(1.15);
}

.message-mine .message-menu-popover {
  left: auto;
  right: 0;
}

.message-menu[open] .message-menu-popover {
  display: grid;
  gap: 2px;
}

.message-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--maxq-text);
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.message-menu[open] {
  z-index: 80;
}

.message-menu button:hover {
  background: rgba(245, 196, 0, 0.12);
  border-color: rgba(245, 196, 0, 0.22);
  color: var(--maxq-gold);
}

.message-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 13px 12px 15px;
  border: 1px solid var(--message-received-border);
  border-radius: 7px;
  background: var(--message-received-bg);
  color: var(--message-received-text);
  box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
}

.message p {
  display: block;
  max-width: 100%;
  max-height: min(46vh, 520px);
  margin: 0;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.46;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: left;
  tab-size: 4;
  scrollbar-color: rgba(10, 10, 10, 0.72) rgba(10, 10, 10, 0.12);
  scrollbar-width: thin;
}

.message p a {
  color: #073b7a;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.message-mine p a {
  color: #f5c400;
}

html[data-resolved-theme="light"] .message p a {
  color: #073b7a;
}

html[data-resolved-theme="light"] .message-mine p a {
  color: #f5c400;
}

.message p strong {
  font-weight: 800;
}

.message p code {
  border-radius: 4px;
  background: rgba(10, 10, 10, 0.12);
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
}

.message-mine p code {
  background: rgba(245, 196, 0, 0.18);
  color: #f5c400;
}

.message-mine .message-bubble {
  border-color: var(--message-sent-border);
  background: var(--message-sent-bg);
  color: var(--message-sent-text);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.message-mine p {
  font-weight: 400;
  scrollbar-color: rgba(245, 196, 0, 0.82) rgba(245, 196, 0, 0.16);
}

.message p::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.message p::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.message p::-webkit-scrollbar-thumb {
  background: rgba(10, 10, 10, 0.72);
  border-radius: 999px;
}

.message-mine p::-webkit-scrollbar-track {
  background: transparent;
}

.message-mine p::-webkit-scrollbar-thumb {
  background: rgba(245, 196, 0, 0.82);
}

.message-reply-preview {
  max-width: min(340px, 100%);
  display: grid;
  gap: 4px;
  margin-bottom: 2px;
  border: 1px solid rgba(245, 196, 0, 0.28);
  border-left: 3px solid var(--maxq-gold);
  border-radius: 6px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 82%, var(--maxq-gold) 18%);
  color: var(--maxq-text);
  text-align: left;
  padding: 8px 10px;
  box-shadow: inset 0 0 0 1px rgba(245, 196, 0, 0.08);
  cursor: pointer;
}

.message-mine .message-reply-preview {
  background: color-mix(in srgb, var(--message-sent-bg) 76%, var(--maxq-panel) 24%);
  border-color: rgba(245, 196, 0, 0.42);
}

.message-reply-preview strong {
  font-size: 11px;
}

.message-reply-preview span {
  color: var(--maxq-muted-strong);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reactions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: -1px;
  max-width: 100%;
}

.message-mine .message-reactions {
  justify-content: flex-end;
}

.message-reactions button {
  min-height: 24px;
  border: 1px solid var(--maxq-border);
  border-radius: 999px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  padding: 1px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.message-reactions .reaction-active {
  border-color: rgba(245, 196, 0, 0.5);
  background: rgba(245, 196, 0, 0.16);
}

.reaction-quick-picker {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 35;
  display: inline-flex;
  gap: 4px;
  pointer-events: none;
}

.message-mine .reaction-quick-picker {
  left: auto;
  right: 0;
}

.message-reactions .reaction-ghost {
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: 160ms ease;
}

.message:hover .reaction-ghost,
.message:focus-within .reaction-ghost {
  opacity: 0.82;
  pointer-events: auto;
  transform: translateY(0);
}

.message:hover .reaction-quick-picker,
.message:focus-within .reaction-quick-picker {
  pointer-events: auto;
}

.message-mine .attachment {
  margin-left: auto;
}

.attachment-wrap {
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: stretch;
  gap: 6px;
  margin-top: 6px;
}

.message-mine .attachment-wrap {
  margin-left: auto;
}

.deleted-message {
  color: #74817b !important;
  font-style: italic;
}

.attachment {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 196, 0, 0.58);
  border-radius: 7px;
  color: var(--maxq-text);
  text-decoration: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--maxq-panel-soft) 84%, var(--maxq-gold) 16%), var(--maxq-panel));
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 10px 24px rgba(245, 196, 0, 0.1);
}

.attachment-download {
  min-height: 36px;
  display: grid;
  place-items: center;
  align-self: start;
  border: 1px solid rgba(245, 196, 0, 0.58);
  border-radius: 7px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 82%, var(--maxq-gold) 18%);
  color: var(--maxq-gold);
  box-shadow: 0 10px 24px rgba(245, 196, 0, 0.08);
}

.attachment-download:hover {
  background: rgba(245, 196, 0, 0.2);
  border-color: rgba(245, 196, 0, 0.78);
}

.attachment-download svg {
  width: 18px;
  height: 18px;
}

.attachment img {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 5px;
  background: var(--maxq-panel-soft);
}

.attachment-kind {
  align-self: start;
  border-radius: 999px;
  background: var(--maxq-gold);
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 850;
  padding: 3px 7px;
  text-transform: uppercase;
}

.attachment-name {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 750;
}

.attachment-preview[hidden] {
  display: none;
}

.attachment-preview {
  position: absolute;
  inset: 0;
  z-index: 180;
  display: block;
}

.attachment-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(7px);
  cursor: default;
}

.attachment-preview-panel {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.attachment-preview-header {
  display: none;
}

.attachment-preview-info {
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 3;
  min-width: 0;
  display: grid;
  gap: 3px;
  max-width: min(520px, calc(100% - 280px));
  color: var(--maxq-text);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.75);
}

.attachment-preview-info strong {
  overflow: hidden;
  color: var(--maxq-text);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-info span {
  color: rgba(245, 245, 245, 0.72);
  font-size: 12px;
}

.attachment-preview-actions {
  position: absolute;
  right: 14px;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(10, 10, 10, 0.58);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  padding: 5px;
  backdrop-filter: blur(12px);
}

.attachment-preview-actions a,
.attachment-preview-actions button {
  min-height: 32px;
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--maxq-text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  text-decoration: none;
}

.attachment-preview-actions svg {
  width: 17px;
  height: 17px;
}

.attachment-preview-actions a:hover,
.attachment-preview-actions button:hover {
  border-color: rgba(245, 196, 0, 0.36);
  background: rgba(245, 196, 0, 0.12);
  color: var(--maxq-gold);
}

.attachment-preview-actions button {
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.attachment-preview-actions [data-preview-zoom-label] {
  min-width: 42px;
  color: rgba(245, 245, 245, 0.74);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.attachment-preview-body {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 62px clamp(14px, 3vw, 32px) clamp(18px, 3vw, 32px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.5)),
    rgba(5, 5, 5, 0.46);
}

.attachment-preview-body img,
.attachment-preview-body video {
  max-width: 100%;
  max-height: calc(100vh - 132px);
  border-radius: 4px;
  object-fit: contain;
}

.attachment-preview-body img {
  transform: scale(var(--preview-zoom, 1));
  transform-origin: center center;
  transition: transform 140ms ease;
  cursor: zoom-in;
}

.attachment-preview-body img[data-zoomed="true"] {
  cursor: zoom-out;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.attachment-preview-body video {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.attachment-preview-body iframe {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 118px);
  border: 0;
  border-radius: 4px;
  background: white;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.attachment-preview-body audio {
  width: min(520px, 100%);
}

.attachment-preview-file {
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
  justify-items: center;
  border: 1px solid var(--maxq-border);
  border-radius: 8px;
  background: var(--maxq-panel);
  padding: 32px 20px;
  text-align: center;
}

.attachment-preview-file span {
  border-radius: 999px;
  background: rgba(245, 196, 0, 0.16);
  color: var(--maxq-gold);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  text-transform: uppercase;
}

.attachment-preview-file strong {
  overflow-wrap: anywhere;
  color: var(--maxq-text);
  font-size: 15px;
}

.attachment-preview-file small {
  color: var(--maxq-muted);
}

.pending-attachments {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 8px;
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 0 20px 8px 64px;
}

.pending-file {
  display: grid;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  font-size: 13px;
  max-width: 100%;
}

.pending-file-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.pending-file strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-file small {
  color: var(--maxq-muted);
  min-width: 78px;
  text-align: right;
}

.pending-file-size {
  color: var(--maxq-muted);
  font-size: 12px;
}

.pending-file progress {
  width: 100%;
  height: 8px;
  accent-color: #0e6b57;
}

.pending-file em {
  color: #9d3327;
  font-size: 12px;
  font-style: normal;
}

.pending-file button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.pending-file-failed {
  background: #f7e7e4;
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: 36px 36px 36px 36px minmax(0, 628px) 64px;
  gap: 8px;
  align-items: end;
  justify-self: center;
  width: min(100%, 920px);
  padding: 10px 20px 14px;
  background: var(--maxq-black);
  border-top: 1px solid var(--maxq-border);
}

.composer:has(.composer-tools) {
  grid-template-columns: auto minmax(0, 1fr);
}

.composer-tools {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.composer-entry {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: stretch;
}

.reply-target {
  width: min(100%, 920px);
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--maxq-border);
  background: var(--maxq-black);
  padding: 8px 20px;
}

.reply-target[hidden] {
  display: none !important;
}

.reply-target span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reply-target strong {
  font-size: 12px;
}

.reply-target small {
  color: var(--maxq-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-target button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--maxq-border);
  border-radius: 50%;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  cursor: pointer;
}

.composer-command-suggest {
  position: absolute;
  left: 64px;
  bottom: calc(100% + 8px);
  z-index: 70;
  width: min(260px, calc(100% - 128px));
  border: 1px solid rgba(245, 196, 0, 0.36);
  border-radius: 7px;
  background: var(--maxq-panel);
  box-shadow: 0 18px 46px rgb(0 0 0 / 24%);
  padding: 6px;
}

.composer-command-suggest[hidden] {
  display: none !important;
}

.composer .composer-command-suggest button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: rgba(245, 196, 0, 0.12);
  color: var(--maxq-gold);
  text-align: left;
  padding: 7px 10px;
  font: inherit;
  font-weight: 500;
}

.emoji-picker {
  position: absolute;
  left: 108px;
  bottom: calc(100% + 8px);
  z-index: 70;
  display: grid;
  grid-template-columns: repeat(6, 34px);
  gap: 6px;
  border: 1px solid rgba(245, 196, 0, 0.32);
  border-radius: 7px;
  background: var(--maxq-panel);
  box-shadow: 0 18px 46px rgb(0 0 0 / 24%);
  padding: 8px;
}

.format-toolbar {
  position: absolute;
  left: 64px;
  bottom: calc(100% + 8px);
  z-index: 70;
  display: flex;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--maxq-border) 72%, var(--maxq-gold) 28%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--maxq-panel) 92%, transparent);
  box-shadow: 0 18px 46px rgb(0 0 0 / 24%), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 7px;
  backdrop-filter: blur(18px) saturate(1.12);
  animation: composer-pop 150ms var(--motion-ease);
}

.list-toolbar {
  position: absolute;
  left: 184px;
  bottom: calc(100% + 8px);
  z-index: 72;
  display: grid;
  gap: 4px;
  width: min(178px, calc(100vw - 32px));
  border: 1px solid color-mix(in srgb, var(--maxq-border) 72%, var(--maxq-gold) 28%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--maxq-panel) 92%, transparent);
  box-shadow: 0 18px 46px rgb(0 0 0 / 24%), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 7px;
  backdrop-filter: blur(18px) saturate(1.12);
  animation: composer-pop 150ms var(--motion-ease);
}

.paste-toolbar {
  position: absolute;
  left: 108px;
  bottom: calc(100% + 8px);
  z-index: 70;
  display: grid;
  gap: 5px;
  width: min(280px, calc(100vw - 32px));
  border: 1px solid color-mix(in srgb, var(--maxq-border) 72%, var(--maxq-gold) 28%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--maxq-panel) 92%, transparent);
  box-shadow: 0 18px 46px rgb(0 0 0 / 24%), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 7px;
  backdrop-filter: blur(18px) saturate(1.12);
  animation: composer-pop 150ms var(--motion-ease);
}

.link-popover {
  position: absolute;
  left: 64px;
  bottom: calc(100% + 8px);
  z-index: 75;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid color-mix(in srgb, var(--maxq-border) 72%, var(--maxq-gold) 28%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--maxq-panel) 94%, transparent);
  box-shadow: 0 18px 46px rgb(0 0 0 / 24%), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 7px;
  backdrop-filter: blur(18px) saturate(1.12);
  animation: composer-pop 150ms var(--motion-ease);
}

.link-popover[hidden] {
  display: none !important;
}

.link-popover [data-link-form] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  gap: 6px;
  align-items: center;
}

.link-popover input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
}

.link-popover button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--maxq-gold);
  color: #0a0a0a;
  padding: 0 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.link-popover [data-link-cancel] {
  width: 30px;
  padding: 0;
  background: var(--maxq-panel-soft);
  border-color: var(--maxq-border);
  color: var(--maxq-muted-strong);
}

.link-popover button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(245, 196, 0, 0.14);
}

@keyframes composer-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.paste-toolbar[hidden] {
  display: none !important;
}

.list-toolbar[hidden] {
  display: none !important;
}

.paste-toolbar button {
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 88%, transparent);
  color: var(--maxq-text);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  padding: 0 11px;
}

.paste-toolbar button:hover {
  border-color: rgba(245, 196, 0, 0.38);
  background: rgba(245, 196, 0, 0.12);
  color: var(--maxq-gold);
}

.list-toolbar button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 88%, transparent);
  color: var(--maxq-text);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  padding: 0 9px;
}

.list-toolbar button:hover {
  border-color: rgba(245, 196, 0, 0.38);
  background: rgba(245, 196, 0, 0.12);
  color: var(--maxq-gold);
}

.list-option-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}

.format-toolbar[hidden] {
  display: none !important;
}

.format-toolbar button {
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 88%, transparent);
  color: var(--maxq-text);
  font-size: 12px;
  font-weight: 700;
}

.format-toolbar button:hover {
  border-color: rgba(245, 196, 0, 0.38);
  background: rgba(245, 196, 0, 0.12);
  color: var(--maxq-gold);
}

.format-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  min-width: 16px;
  height: 16px;
  line-height: 1;
}

.format-icon-bold {
  font-weight: 900;
}

.format-icon-italic {
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
}

.format-icon-strike {
  font-weight: 800;
  text-decoration: line-through;
}

.format-icon-link,
.format-icon-list {
  font-size: 15px;
  font-weight: 800;
}

.emoji-picker[hidden] {
  display: none !important;
}

.composer .emoji-picker button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
  font-size: 18px;
  line-height: 1;
}

.composer .emoji-picker button:hover {
  border-color: rgba(245, 196, 0, 0.38);
  background: rgba(245, 196, 0, 0.12);
}

.composer textarea,
.composer-editor {
  min-width: 0;
  height: 44px;
  min-height: 44px;
  max-height: min(30vh, 148px);
  overflow-y: auto;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.45;
  tab-size: 4;
  resize: none;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
}

.composer-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--maxq-muted);
  pointer-events: none;
}

.composer button {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--maxq-gold);
  color: #0a0a0a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.composer button[type="submit"] {
  width: auto;
}

.attach-button {
  width: 36px;
  min-width: 36px !important;
  border: 1px solid var(--maxq-border) !important;
  background: var(--maxq-panel-soft) !important;
  color: var(--maxq-text) !important;
  font-size: 20px !important;
}

.emoji-button,
.format-button,
.paste-button {
  width: 36px;
  min-width: 36px !important;
  border: 1px solid var(--maxq-border) !important;
  background: var(--maxq-panel-soft) !important;
  color: var(--maxq-text) !important;
  font-size: 18px !important;
}

.format-button {
  font-size: 15px !important;
  font-weight: 800 !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.paste-button {
  font-size: 14px !important;
  font-weight: 800 !important;
}

.message p code {
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, currentColor 10%, transparent);
  padding: 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
}

.message-quote-line {
  display: inline-block;
  border-left: 3px solid currentColor;
  padding-left: 8px;
  opacity: 0.88;
}

.setup-panel {
  padding: 22px;
}

.setup-form {
  width: min(100%, 520px);
  display: grid;
  gap: 14px;
}

.setup-form label {
  display: grid;
  gap: 7px;
  color: var(--maxq-muted);
  font-weight: 650;
}

.setup-form input,
.setup-form select,
.setup-form textarea,
.inline-edit textarea {
  min-height: 40px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
}

.setup-form textarea {
  min-height: 76px;
  resize: vertical;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--maxq-text) !important;
}

.check-row input {
  min-height: auto;
}

.setup-form button,
.person-result,
.inline-edit button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--maxq-gold);
  color: #0a0a0a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.settings-message {
  color: var(--maxq-gold);
  font-size: 13px;
  font-weight: 650;
}

.people-results {
  width: min(100%, 520px);
  display: grid;
  gap: 8px;
}

.member-list {
  display: grid;
  gap: 8px;
  width: min(100%, 720px);
}

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 150px auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel-soft);
}

.member-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row small {
  color: var(--maxq-muted);
}

.member-row select {
  min-height: 34px;
  border: 1px solid var(--maxq-border);
  border-radius: 6px;
  background: var(--maxq-panel);
  color: var(--maxq-text);
  font: inherit;
}

.member-row button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--maxq-panel);
  color: var(--maxq-text);
  cursor: pointer;
}

.person-result {
  display: grid;
  justify-items: start;
  padding: 9px 10px;
  background: var(--maxq-panel-soft);
  color: var(--maxq-text);
}

.person-result small {
  color: var(--maxq-muted);
}

.group-admin-panel {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px clamp(22px, 4vw, 48px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--maxq-panel-soft) 24%, transparent), transparent 260px),
    var(--maxq-black);
}

.group-admin-form {
  width: min(100%, 860px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.52fr);
  gap: 12px 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--maxq-border) 78%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--maxq-panel) 92%, transparent);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
}

.group-admin-form + .group-admin-form,
.group-admin-form + .member-list {
  margin-top: 2px;
}

.group-admin-form .field-wide {
  grid-column: 1 / -1;
}

.group-admin-form label {
  min-width: 0;
  gap: 5px;
  color: var(--maxq-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.group-admin-form input,
.group-admin-form select,
.group-admin-form textarea {
  min-height: 34px;
  border-color: color-mix(in srgb, var(--maxq-border) 82%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 92%, transparent);
  font-size: 13px;
}

.group-admin-form textarea {
  min-height: 68px;
}

.group-admin-form input::placeholder,
.group-admin-form textarea::placeholder {
  color: color-mix(in srgb, var(--maxq-muted) 72%, transparent);
}

.group-admin-form input:disabled,
.group-admin-form select:disabled,
.group-admin-form textarea:disabled {
  opacity: 0.76;
  cursor: not-allowed;
}

.group-admin-form .check-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  align-self: stretch;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--maxq-border) 82%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 84%, transparent);
  font-size: 12px;
  font-weight: 650;
}

.group-admin-form .check-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--maxq-gold);
}

.group-admin-form > button[type="submit"] {
  justify-self: start;
  min-height: 34px;
  min-width: 126px;
  border: 1px solid rgba(245, 196, 0, 0.48);
  border-radius: 5px;
  background: var(--maxq-gold);
  color: #0a0a0a;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.group-admin-form > button[type="submit"]:hover {
  transform: none;
  box-shadow: 0 10px 22px rgba(245, 196, 0, 0.12);
}

.group-member-search {
  grid-template-columns: minmax(0, 1fr);
}

.group-admin-panel .people-results {
  width: 100%;
  gap: 5px;
}

.group-admin-panel .person-result {
  min-height: 38px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: stretch;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--maxq-border) 82%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 82%, transparent);
  color: var(--maxq-text);
  padding: 7px 9px;
  text-align: left;
}

.group-admin-panel .person-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.group-admin-panel .person-result small {
  min-width: 0;
  overflow: hidden;
  color: var(--maxq-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-admin-panel .person-result:hover {
  border-color: rgba(245, 196, 0, 0.34);
  background: rgba(245, 196, 0, 0.08);
  color: var(--maxq-text);
  transform: none;
}

.group-admin-panel .member-list {
  width: min(100%, 860px);
  gap: 6px;
}

.group-admin-panel .empty-state {
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--maxq-border) 86%, transparent);
  border-radius: 6px;
  color: var(--maxq-muted);
  font-size: 12px;
}

.group-admin-panel .member-row {
  grid-template-columns: minmax(180px, 1fr) 126px 144px 78px;
  gap: 8px;
  padding: 8px;
  border-color: color-mix(in srgb, var(--maxq-border) 82%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--maxq-panel-soft) 88%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.group-admin-panel .member-row > span:first-child {
  display: grid;
  gap: 2px;
  line-height: 1.2;
}

.group-admin-panel .member-row > span:first-child small {
  display: block;
  overflow: hidden;
  color: var(--maxq-muted);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
}

.group-admin-panel .member-row select {
  min-height: 30px;
  border-radius: 5px;
  background: var(--maxq-panel);
  font-size: 12px;
}

.group-admin-panel .member-row button {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--maxq-border) 86%, transparent);
  border-radius: 5px;
  background: transparent;
  color: var(--maxq-muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.group-admin-panel .member-row button:hover {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  transform: none;
}

.inline-edit {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  max-width: min(100%, 720px);
}

.inline-edit-bubble {
  border: 1px solid var(--message-sent-border);
  border-radius: 7px;
  background: var(--message-sent-bg);
  color: var(--message-sent-text);
  box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
  padding: 8px;
}

.message:not(.message-mine) .inline-edit-bubble {
  border-color: var(--message-received-border);
  background: var(--message-received-bg);
  color: var(--message-received-text);
}

.inline-edit-editor {
  min-width: 0;
  min-height: 42px;
  max-height: min(46vh, 520px);
  overflow: auto;
  outline: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.inline-edit-actions {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
}

.inline-edit-actions button {
  min-height: 30px;
  padding: 0 10px;
}

.inline-edit-actions .format-button {
  width: 30px;
  min-width: 30px !important;
  min-height: 30px;
  padding: 0;
}

.inline-edit-format-toolbar {
  left: 8px;
  bottom: calc(100% + 6px);
}

.inline-edit-list-toolbar {
  left: 148px;
  bottom: calc(100% + 6px);
}

@media (min-width: 721px) and (max-width: 1240px) {
  .chat {
    grid-template-columns: clamp(11rem, 22vw, 16rem) minmax(0, 1fr);
  }

  .topbar {
    padding-inline: clamp(12px, 2vw, 18px);
  }

  .global-search {
    max-width: min(54vw, 560px);
  }

  .conversation-header {
    padding-inline: clamp(16px, 3vw, 28px);
  }

  .message-list {
    padding-inline: clamp(18px, 4vw, 48px);
  }

  .message {
    max-width: min(720px, 84%);
  }

  .composer,
  .reply-target {
    width: min(100%, 860px);
  }

  .response-notifications {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .response-notifications:has(.notification-card:nth-child(3)) .notification-card-crm {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .chat {
    grid-template-columns: 1fr;
    grid-template-rows: 52px minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    position: fixed;
    inset: 0;
    overflow: hidden;
  }

  .utility-view {
    padding: 14px;
  }

  .response-notifications,
  .response-notifications:has(.notification-card:nth-child(2):last-child) {
    grid-template-columns: 1fr;
  }

  .notification-card {
    height: min(460px, 68vh);
  }

  .notification-card-header {
    padding: 14px;
  }

  .notification-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .notification-line .result-action {
    display: none;
  }

  .chat.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .chat-side-panel {
    display: none;
  }

  .topbar {
    grid-column: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-width: 0;
    height: 52px;
    gap: 8px;
    padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--maxq-black) 96%, var(--maxq-panel-soft) 4%);
  }

  .mark {
    flex: 0 0 auto;
    font-size: 14px;
    white-space: nowrap;
  }

  .mark-product {
    display: none;
  }

  .global-search {
    max-width: none;
    min-width: 0;
  }

  .global-search input {
    min-height: 40px;
    font-size: 14px;
  }

  .global-search-results {
    position: fixed;
    top: 56px;
    left: 10px;
    right: 10px;
    max-height: min(420px, calc(100dvh - 72px));
  }

  .profile-menu {
    min-width: 36px;
  }

  .profile-popover {
    position: fixed;
    top: 56px;
    right: max(10px, env(safe-area-inset-right));
    left: auto;
    width: min(300px, calc(100vw - 20px));
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
  }

  .mobile-nav-button {
    display: none;
  }

  .mobile-header-nav {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--maxq-border);
    border-radius: 6px;
    background: var(--maxq-panel-soft);
    color: var(--maxq-text);
    padding: 0 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .sidebar {
    position: fixed;
    inset: 52px auto 0 0;
    z-index: 40;
    width: min(78vw, 300px);
    padding: 12px 10px calc(18px + env(safe-area-inset-bottom));
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 18px 0 32px rgb(0 0 0 / 36%);
  }

  .sidebar-toggle {
    display: none;
  }

  .chat.sidebar-collapsed .sidebar-actions {
    grid-template-columns: 1fr;
  }

  .chat.sidebar-collapsed .sidebar-actions button:not(.sidebar-toggle) .button-label,
  .chat.sidebar-collapsed .sidebar-title,
  .chat.sidebar-collapsed .sidebar-empty,
  .chat.sidebar-collapsed .channel-name {
    display: initial;
  }

  .chat.sidebar-collapsed .sidebar-actions button:not(.sidebar-toggle) {
    width: auto;
    padding-inline: 10px;
  }

  .chat.sidebar-collapsed .channel {
    grid-template-columns: 17px 9px minmax(0, 1fr) auto;
    column-gap: 7px;
    padding-inline: 10px;
  }

  .chat.sidebar-collapsed .channel-icon {
    display: inline-flex;
  }

  .chat.sidebar-collapsed .presence-channel-dot,
  .chat.sidebar-collapsed .channel-presence-spacer {
    display: inline-block;
  }

  .chat.sidebar-collapsed .channel-short-name {
    display: none;
  }

  .chat.sidebar-collapsed .channel-badge {
    position: static;
    transform: none;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
  }

  .chat.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 52px 0 0;
    z-index: 35;
    display: none;
    border: 0;
    background: rgb(0 0 0 / 42%);
  }

  .chat.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .chat.sidebar-groups-only .nav-section:first-child {
    display: none;
  }

  .chat.sidebar-groups-only .nav-section:last-child {
    margin-top: 0;
  }

  .conversation {
    grid-row: 2;
    min-height: 0;
    height: calc(100dvh - 52px);
    grid-template-rows: 58px minmax(0, 1fr) auto auto auto auto;
    overflow: hidden;
    background: #f3f4f6;
  }

  .conversation-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 58px;
    gap: 8px;
    padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--maxq-black) 96%, var(--maxq-panel-soft) 4%);
  }

  .conversation-title {
    min-width: 0;
  }

  .conversation-header h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
  }

  .conversation-header .back-button {
    max-width: 112px;
    min-width: 0;
    padding-inline: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .member-row {
    grid-template-columns: 1fr;
  }

  .group-admin-panel {
    padding: 16px 12px calc(112px + env(safe-area-inset-bottom));
  }

  .group-admin-form {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .group-admin-panel .member-row {
    grid-template-columns: 1fr;
  }

  .group-admin-panel .member-row select,
  .group-admin-panel .member-row button {
    width: 100%;
  }

  .message {
    max-width: 100%;
    width: min(100%, 680px);
  }

  .message-mine {
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
  }

  .message-mine p {
    text-align: left;
  }

  .message-list {
    min-height: 0;
    overflow-y: auto;
    padding: 14px 10px;
    overscroll-behavior: contain;
    background: #f3f4f6;
    color: #111827;
  }

  .message-meta strong,
  .message-meta time,
  .message-timezone,
  .message-read-state,
  .empty-state,
  .typing-indicator {
    color: #5f6368;
  }

  .message-row {
    width: 100%;
    min-width: 0;
    padding-left: 36px;
  }

  .message-mine .message-row {
    padding-left: 0;
    padding-right: 36px;
  }

  .message-content {
    max-width: 100%;
  }

  .message-bubble,
  .message-reply-preview,
  .attachment-wrap {
    max-width: 100%;
  }

  .message-action-stack {
    left: 0;
    right: auto;
    top: 2px;
  }

  .message-mine .message-action-stack {
    left: auto;
    right: 0;
  }

  .message-menu summary {
    width: 32px;
    height: 32px;
    background: color-mix(in srgb, var(--maxq-panel) 92%, transparent);
  }

  .message-menu-popover {
    left: 0;
    max-width: calc(100vw - 24px);
  }

  .message-mine .message-menu-popover {
    right: 0;
    left: auto;
  }

  .composer {
    grid-template-columns: 32px 32px 32px 32px minmax(0, 1fr) 50px;
    width: 100%;
    padding-inline: 12px;
    padding-top: 8px;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    align-self: end;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .composer textarea,
  .composer-editor {
    border-color: rgba(17, 24, 39, 0.12);
    background: #ffffff;
    color: #111827;
  }

  .composer-editor:empty::before {
    color: #6b7280;
  }

  .attach-button,
  .emoji-button,
  .format-button,
  .paste-button {
    border-color: rgba(17, 24, 39, 0.12) !important;
    background: #ffffff !important;
    color: #111827 !important;
  }

  .composer:has(.composer-tools) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .composer-tools {
    gap: 6px;
  }

  .composer-entry {
    grid-template-columns: minmax(0, 1fr) 50px;
    gap: 6px;
  }

  .composer button[type="submit"] {
    width: auto;
    padding-inline: 0;
  }

  .composer-editor {
    padding-inline: 10px;
  }

  .emoji-picker {
    left: 56px;
    grid-template-columns: repeat(4, 34px);
    max-width: calc(100vw - 80px);
  }

  .format-toolbar {
    left: 12px;
    right: 12px;
    overflow-x: auto;
  }

  .list-toolbar {
    left: 12px;
    right: 12px;
  }

  .paste-toolbar {
    left: 12px;
    right: 12px;
  }

  .pending-attachments {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 56px 12px;
    background: #f3f4f6;
  }
}

/* Call interaction polish: mirrored self view, mic state, fullscreen overlays */
.call-surface .call-video-local.call-video-live > video {
  transform: scaleX(-1) !important;
}

.call-surface .call-video-live > .call-video-identity {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  top: 10px !important;
  left: 10px !important;
  min-height: 28px !important;
  max-width: calc(100% - 20px) !important;
  border: 1px solid rgba(229, 231, 235, 0.88) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #111827 !important;
  padding: 0 8px 0 10px !important;
  box-shadow: none !important;
}

.call-surface .call-video-live > .call-video-identity strong {
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
}

.call-surface .call-video-identity .call-mic-state {
  position: static !important;
  width: 22px !important;
  height: 22px !important;
  border: 0 !important;
  background: transparent !important;
}

.call-surface .call-video-identity .call-mic-state svg {
  width: 13px !important;
  height: 13px !important;
}

.call-surface .call-control-button.is-muted {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

.call-surface .call-control-button.is-muted .call-control-icon {
  color: #dc2626 !important;
}

.call-surface .call-panel.is-screen-fullscreen {
  background: #050506 !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-panel-head,
.call-surface .call-panel.is-screen-fullscreen .call-chat-panel,
.call-surface .call-panel.is-screen-fullscreen .call-add-panel {
  display: none !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-stage-body {
  position: fixed !important;
  inset: 0 !important;
  display: block !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #050506 !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-video-grid {
  position: absolute !important;
  inset: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-video-featured {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #050506 !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-video-featured > video {
  object-fit: contain !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured) {
  position: relative !important;
  z-index: 8 !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: start !important;
  justify-self: end !important;
  width: clamp(132px, 14vw, 210px) !important;
  height: clamp(82px, 12vh, 132px) !important;
  margin: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 14px !important;
  background: rgba(17, 24, 39, 0.72) !important;
  opacity: 1 !important;
  transition: opacity 180ms ease !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured):nth-child(3) {
  margin-top: calc(16px + clamp(90px, 13vh, 140px)) !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured):nth-child(4) {
  margin-top: calc(16px + clamp(180px, 26vh, 280px)) !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured):nth-child(5) {
  margin-top: calc(16px + clamp(270px, 39vh, 420px)) !important;
}

.call-surface .call-panel.is-screen-fullscreen.is-call-ui-idle .call-video-tile:not(.call-video-featured) {
  opacity: 0 !important;
  pointer-events: none !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-controls {
  position: fixed !important;
  left: 50% !important;
  bottom: calc(18px + env(safe-area-inset-bottom)) !important;
  z-index: 12 !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(18, 18, 22, 0.46) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transition: opacity 180ms ease !important;
  transform: translateX(-50%) !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-control-button {
  background: rgba(255, 255, 255, 0.92) !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-control-button.is-on {
  background: rgba(245, 196, 0, 0.94) !important;
}

.call-surface .call-panel.is-screen-fullscreen .call-control-button.call-end-control {
  background: rgba(229, 72, 77, 0.94) !important;
}

.call-surface .call-panel.is-screen-fullscreen.is-call-ui-idle .call-controls {
  opacity: 0.18 !important;
}

@media (max-width: 720px) {
  .call-surface .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured) {
    width: 112px !important;
    height: 72px !important;
    margin: 10px !important;
  }
}

.call-surface:fullscreen,
.call-surface:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  background: #050506 !important;
}

/* 2026 maxQ polish layer */
:root {
  --maxq-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --maxq-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
  --maxq-shadow-soft: 0 3px 10px rgba(0, 0, 0, 0.1);
  --maxq-focus: 0 0 0 3px rgba(245, 196, 0, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    var(--maxq-page);
  background-size: 72px 72px, 72px 72px, auto;
  font-size: 13px;
}

html[data-resolved-theme="light"] body {
  background:
    linear-gradient(rgba(10, 10, 10, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 10, 0.035) 1px, transparent 1px),
    var(--maxq-page);
  background-size: 72px 72px, 72px 72px, auto;
}

button,
a,
input,
select,
textarea,
.channel,
.conversation-header,
.sidebar,
.topbar,
.profile-popover,
.global-search-results,
.message-bubble,
.message p,
.message-reply-preview,
.message-menu summary,
.message-menu button,
.response-notice,
.reminder-item,
.composer,
.attachment {
  transition:
    background-color 180ms var(--maxq-ease),
    border-color 180ms var(--maxq-ease),
    color 180ms var(--maxq-ease),
    box-shadow 180ms var(--maxq-ease),
    transform 180ms var(--maxq-ease),
    opacity 180ms var(--maxq-ease);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 0;
  box-shadow: var(--maxq-focus);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--maxq-gold);
  box-shadow: var(--maxq-focus);
}

select,
option,
summary {
  cursor: pointer;
}

option {
  background: var(--maxq-panel);
  color: var(--maxq-text);
}

html[data-resolved-theme="light"] option {
  background: #ffffff;
  color: #0a0a0a;
}

.topbar,
.sidebar,
.conversation-header,
.composer,
.profile-popover,
.global-search-results,
.message-menu[open] button,
.response-notice,
.reminder-item {
  backdrop-filter: saturate(1.08);
}

.profile-popover,
.global-search-results,
.message-menu-popover,
.reminder-dropdown {
  box-shadow: var(--maxq-shadow);
}

:where(.profile-popover, .global-search-results, .message-menu-popover, .reminder-dropdown, .response-notice, .reminder-item, .composer, .attachment) {
  border-radius: 6px;
}

/* Enterprise popup layer: compact, light, and consistent across themes. */
:where(
  .profile-popover,
  .global-search-results,
  .message-menu-popover,
  .reminder-dropdown,
  .composer-command-suggest,
  .emoji-picker,
  .format-toolbar,
  .list-toolbar,
  .paste-toolbar,
  .link-popover
) {
  border: 1px solid var(--maxq-popup-border) !important;
  border-radius: 6px !important;
  background: var(--maxq-popup-bg) !important;
  color: var(--maxq-popup-text) !important;
  box-shadow: var(--maxq-popup-shadow) !important;
  backdrop-filter: none !important;
}

:where(
  .profile-popover,
  .global-search-results,
  .message-menu-popover,
  .reminder-dropdown,
  .format-toolbar,
  .list-toolbar,
  .paste-toolbar,
  .link-popover
) {
  padding: 6px !important;
}

.profile-popover {
  gap: 6px !important;
  width: 248px;
}

.profile-popover strong,
.profile-popover small,
.presence-form label,
.search-group strong {
  color: var(--maxq-popup-muted) !important;
}

.presence-form {
  gap: 6px;
}

.presence-form label {
  gap: 4px;
  font-size: 11px;
  font-weight: 650;
}

:where(
  .profile-popover button,
  .presence-form select,
  .presence-form input,
  .reminder-form input,
  .reminder-form textarea,
  .link-popover input,
  .setup-form select,
  .member-row select
) {
  min-height: 30px !important;
  border-color: var(--maxq-popup-border) !important;
  border-radius: 5px !important;
  background: var(--maxq-popup-soft) !important;
  color: var(--maxq-popup-text) !important;
  font-size: 12px;
}

:where(.profile-popover button, .message-menu button, .list-toolbar button, .paste-toolbar button, .composer .composer-command-suggest button) {
  min-height: 28px !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: var(--maxq-popup-text) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 0 8px !important;
}

:where(.profile-popover button, .message-menu button, .list-toolbar button, .paste-toolbar button, .composer .composer-command-suggest button):hover {
  border-color: transparent !important;
  background: var(--maxq-popup-hover) !important;
  color: #0a0a0a !important;
  transform: none !important;
}

.global-search-results {
  top: 38px;
  max-height: min(320px, calc(100vh - 96px));
}

.search-group {
  gap: 0;
  padding: 2px 0;
}

.search-group strong {
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 4px 7px 3px;
}

.search-group button,
.search-group a,
.search-group span {
  min-height: 28px;
  border-radius: 5px;
  color: var(--maxq-popup-text);
  padding: 6px 7px;
}

.search-group button:hover,
.search-group a:hover {
  background: var(--maxq-popup-hover);
  border-color: transparent;
  color: #0a0a0a;
  transform: none;
}

.search-group small {
  color: var(--maxq-popup-muted);
}

.message-menu summary {
  width: 28px;
  height: 26px;
  background: var(--maxq-popup-bg);
  color: var(--maxq-popup-muted);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.message-menu summary:hover,
.message-menu[open] summary {
  background: var(--maxq-popup-soft);
  border-color: var(--maxq-popup-border);
  color: var(--maxq-popup-text);
}

.message-menu-popover {
  min-width: 136px;
  padding: 4px !important;
}

.message-menu[open] .message-menu-popover {
  gap: 1px;
}

.emoji-picker {
  grid-template-columns: repeat(6, 30px);
  gap: 4px;
  padding: 6px !important;
}

.composer .emoji-picker button,
.format-toolbar button {
  width: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: var(--maxq-popup-text) !important;
}

.composer .emoji-picker button:hover,
.format-toolbar button:hover {
  border-color: transparent !important;
  background: var(--maxq-popup-hover) !important;
  color: #0a0a0a !important;
}

.format-toolbar {
  gap: 3px;
}

.paste-toolbar {
  gap: 2px;
  width: min(238px, calc(100vw - 32px));
}

.list-toolbar {
  gap: 2px;
  width: min(176px, calc(100vw - 32px));
}

.link-popover {
  width: min(330px, calc(100vw - 32px));
}

.link-popover [data-link-form] {
  grid-template-columns: minmax(0, 1fr) auto 28px;
  gap: 5px;
}

.link-popover button {
  min-height: 30px;
  border-radius: 5px;
  padding: 0 9px;
  font-size: 12px;
}

.link-popover [data-link-cancel] {
  width: 28px;
}

.people-results {
  gap: 4px;
}

.person-result {
  min-height: 30px;
  border: 1px solid var(--maxq-popup-border);
  border-radius: 5px;
  background: var(--maxq-popup-bg);
  color: var(--maxq-popup-text);
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
}

.person-result:hover {
  background: var(--maxq-popup-hover);
  transform: none;
}

.reminder-dropdown {
  width: min(390px, calc(100vw - 32px));
}

.utility-reminder-form {
  padding: 8px;
}

.reminder-form {
  gap: 6px;
}

.reminder-form textarea {
  min-height: 54px;
}

.channel:hover,
.response-notice:hover,
.reminder-item:hover,
.search-group button:hover,
.search-group a:hover,
.message-menu button:hover,
.attachment:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 196, 0, 0.28);
}

.sidebar-actions button:hover,
.back-button:hover,
.attach-button:hover,
.emoji-button:hover,
.composer button[type="submit"]:hover,
.profile-popover button:hover,
.message-reactions button:hover {
  transform: translateY(-1px);
}

.sidebar-actions button:active,
.back-button:active,
.attach-button:active,
.emoji-button:active,
.composer button[type="submit"]:active,
.profile-popover button:active,
.message-reactions button:active {
  transform: translateY(0) scale(0.985);
}

.message-bubble,
.message-reply-preview,
.response-notice,
.reminder-item {
  box-shadow: var(--maxq-shadow-soft);
}

.message:hover .message-bubble,
.message:hover .message-reply-preview {
  border-color: rgba(245, 196, 0, 0.34);
}

.message:not(.message-mine) p {
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 1440px) {
  body {
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .composer {
    grid-template-columns: 30px 30px 30px 30px minmax(0, 1fr) 48px;
    gap: 6px;
    padding-inline: 8px;
    padding-top: 8px;
    position: relative;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .composer:has(.composer-tools) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .composer-tools {
    gap: 4px;
  }

  .composer-entry {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 6px;
  }

  .attach-button,
  .emoji-button,
  .format-button,
  .paste-button {
    width: 30px;
    min-width: 30px !important;
  }

  .composer button[type="submit"] {
    width: auto;
    font-size: 12px;
  }

  .attachment-preview-info {
    left: 12px;
    right: 12px;
    top: 58px;
    max-width: none;
  }

  .attachment-preview-actions {
    left: 12px;
    right: 12px;
    top: 10px;
    justify-content: flex-end;
  }

  .attachment-preview-body {
    padding-top: 104px;
  }
}

/* Reference-inspired maxQ chat shell: soft workspace, dark rail, gold accents. */
:root {
  --mq-shell-page: #f4f1de;
  --mq-shell-frame: #111111;
  --mq-chat-surface: #fbfaf5;
  --mq-chat-panel: #ffffff;
  --mq-chat-soft: #f3f1e7;
  --mq-chat-line: rgba(17, 17, 17, 0.09);
  --mq-chat-text: #151515;
  --mq-chat-muted: #77746c;
  --mq-chat-input: #eee9c9;
  --mq-chat-incoming: #eee9c9;
  --mq-chat-outgoing: #181818;
  --mq-chat-outgoing-text: #fff8d2;
  --mq-chat-shadow: 0 16px 42px rgba(17, 17, 17, 0.14);
  --mq-chat-shadow-soft: 0 10px 24px rgba(17, 17, 17, 0.08);
}

html[data-resolved-theme="dark"] {
  --mq-shell-page: #050505;
  --mq-chat-surface: #101014;
  --mq-chat-panel: #16161a;
  --mq-chat-soft: #1f1f23;
  --mq-chat-line: rgba(255, 255, 255, 0.1);
  --mq-chat-text: #f5f5f5;
  --mq-chat-muted: #a1a1aa;
  --mq-chat-input: #1d1d21;
  --mq-chat-incoming: #222226;
  --mq-chat-outgoing: var(--maxq-gold);
  --mq-chat-outgoing-text: #111111;
  --mq-chat-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  --mq-chat-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
  overflow: hidden;
  background: var(--mq-chat-surface) !important;
}

.shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: clamp(14rem, 18vw, 21rem) minmax(0, 1fr);
  grid-template-rows: 58px minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: var(--mq-chat-surface);
  box-shadow: none;
  overflow: hidden;
}

.chat.sidebar-collapsed {
  grid-template-columns: 5rem minmax(0, 1fr);
}

.topbar {
  min-width: 0;
  padding-inline: 20px;
  border-bottom: 0;
  background: var(--mq-shell-frame);
  color: #f8f6e8;
}

.mark {
  color: #f8f6e8;
  font-weight: 850;
}

.mark-q {
  color: var(--maxq-gold);
}

.mark-product {
  color: rgba(248, 246, 232, 0.72);
}

.global-search {
  max-width: min(620px, 48vw);
}

.global-search input {
  min-height: 40px;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8f6e8;
  padding-inline: 16px;
}

.global-search input::placeholder {
  color: rgba(248, 246, 232, 0.58);
}

.profile-menu summary {
  width: 40px;
  height: 40px;
  background: var(--maxq-gold);
  color: #111111;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.16);
}

.profile-popover,
.global-search-results,
.message-menu-popover,
.reminder-dropdown {
  border-radius: 14px !important;
}

.sidebar {
  margin: 0;
  padding: 14px 12px;
  border-right: 0;
  background: var(--mq-shell-frame);
  color: #f8f6e8;
}

.sidebar-actions {
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  margin-bottom: 14px;
}

.sidebar-actions button,
.sidebar-toggle {
  min-height: 40px;
  border-radius: 13px;
}

.sidebar-actions button[data-new-group] {
  background: var(--maxq-gold);
  color: #111111;
  font-weight: 800;
}

.sidebar-actions button:not([data-new-group]),
.sidebar-toggle {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #f8f6e8;
}

.utility-nav {
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-color: rgba(255, 255, 255, 0.12);
}

.channel-list,
.nav-section {
  gap: 8px;
}

.sidebar-title {
  color: rgba(248, 246, 232, 0.52);
  letter-spacing: 0.06em;
}

.channel {
  min-height: 58px;
  grid-template-columns: 32px 9px minmax(0, 1fr) auto;
  gap: 8px;
  border-radius: 15px;
  padding: 0 12px;
  color: rgba(248, 246, 232, 0.76);
}

.channel-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(245, 196, 0, 0.13);
  color: var(--maxq-gold);
}

.channel:hover,
.channel-active {
  background: rgba(245, 196, 0, 0.16);
  color: #ffffff;
  transform: none;
}

.channel-badge {
  min-width: 22px;
  height: 22px;
  background: var(--maxq-gold);
  color: #111111;
}

.conversation {
  min-width: 0;
  background: var(--mq-chat-surface);
  color: var(--mq-chat-text);
}

.conversation-header {
  min-height: 72px;
  padding-inline: clamp(22px, 3vw, 44px);
  border-bottom: 0;
  background: var(--mq-chat-surface);
  color: var(--mq-chat-text);
}

.conversation-header h1 {
  color: var(--mq-chat-text);
  font-size: clamp(24px, 2.2vw, 38px);
  line-height: 1.05;
}

.conversation-presence,
.conversation-timezone {
  color: var(--mq-chat-muted);
}

.message-list {
  padding: clamp(18px, 3vw, 40px) clamp(22px, 5vw, 80px);
  background: var(--mq-chat-surface);
  color: var(--mq-chat-text);
}

.message {
  max-width: min(760px, 78%);
}

.message-meta strong {
  color: color-mix(in srgb, var(--mq-chat-text) 76%, var(--maxq-gold) 24%);
}

.message-meta time,
.message-timezone,
.message-read-state,
.typing-indicator,
.empty-state {
  color: var(--mq-chat-muted);
}

.message-bubble {
  border: 0;
  border-radius: 18px 18px 18px 6px;
  background: var(--mq-chat-incoming);
  color: var(--mq-chat-text);
  box-shadow: var(--mq-chat-shadow-soft);
  padding: 14px 16px;
}

.message-mine .message-bubble {
  border: 0;
  border-radius: 18px 18px 6px 18px;
  background: var(--mq-chat-outgoing);
  color: var(--mq-chat-outgoing-text);
}

.message p {
  color: inherit;
}

.message-reply-preview,
.attachment {
  border: 1px solid rgba(245, 196, 0, 0.22);
  border-radius: 14px;
  background: var(--mq-chat-panel);
  color: var(--mq-chat-text);
}

.message-mine .message-reply-preview {
  background: var(--mq-chat-soft);
  color: var(--mq-chat-text);
}

.composer,
.reply-target,
.pending-attachments {
  width: min(100%, 920px);
  justify-self: center;
  border: 0 !important;
  background: var(--mq-chat-surface) !important;
  box-shadow: none !important;
}

.composer {
  grid-template-columns: 42px 42px 42px 42px minmax(0, 1fr) 62px;
  gap: 8px;
  padding: 12px clamp(20px, 4vw, 40px) 18px;
}

.composer-entry {
  grid-template-columns: minmax(0, 1fr) 62px;
}

.composer textarea,
.composer-editor {
  height: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--mq-chat-input);
  color: var(--mq-chat-text);
  padding-inline: 16px;
}

.composer-editor:empty::before {
  color: #7d786a;
}

.attach-button,
.emoji-button,
.format-button,
.paste-button {
  width: 42px;
  min-width: 42px !important;
  min-height: 42px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--mq-chat-input) !important;
  color: var(--mq-chat-text) !important;
}

.composer button[type="submit"] {
  min-height: 42px;
  border-radius: 16px;
  background: var(--maxq-gold);
  color: #111111;
}

.back-button,
.mobile-header-nav {
  border: 0;
  border-radius: 13px;
  background: var(--mq-chat-input);
  color: var(--mq-chat-text);
  font-weight: 800;
}

.call-header-button,
.incoming-call-actions button,
.call-controls button,
.call-end-button,
.call-window-button {
  background: var(--mq-chat-input);
  color: var(--mq-chat-text);
}

.incoming-call,
.call-panel {
  border-color: var(--mq-chat-line);
  background: color-mix(in srgb, var(--mq-chat-panel) 94%, transparent);
  color: var(--mq-chat-text);
}

.call-video-tile,
.call-video-empty {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--maxq-gold) 16%, transparent), transparent 46%),
    var(--mq-chat-soft);
}

.call-controls .call-end-control {
  background: #ef4444;
  color: #ffffff;
}

@media (min-width: 721px) and (max-width: 1180px) {
  .chat {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: clamp(12rem, 24vw, 17rem) minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .conversation-header {
    min-height: 66px;
  }

  .message {
    max-width: min(720px, 84%);
  }

  .message-list {
    padding-inline: clamp(18px, 4vw, 42px);
  }
}

@media (max-width: 720px) {
  body {
    display: block;
    background: var(--mq-chat-surface) !important;
  }

  .chat {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: 54px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--mq-chat-surface);
  }

  .topbar {
    height: 54px;
    padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right));
    background: var(--mq-shell-frame);
    color: #f8f6e8;
  }

  .mark {
    color: #f8f6e8;
  }

  .global-search input {
    min-height: 38px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.12);
    color: #f8f6e8;
  }

  .profile-menu summary {
    width: 38px;
    height: 38px;
    background: var(--maxq-gold);
    color: #111111;
  }

  .sidebar {
    inset: 54px auto 0 0;
    width: min(76vw, 300px);
    padding: 12px 10px calc(18px + env(safe-area-inset-bottom));
  }

  .sidebar-backdrop {
    inset: 54px 0 0;
  }

  .conversation {
    height: calc(100dvh - 54px);
    grid-template-rows: 62px minmax(0, 1fr) auto auto auto auto;
    background: var(--mq-chat-surface);
  }

  .conversation-header {
    min-height: 62px;
    padding-inline: 10px;
    background: var(--mq-chat-surface);
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .conversation-header h1 {
    font-size: 16px;
    line-height: 1.2;
  }

  .call-header-actions {
    gap: 6px;
  }

  .call-header-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .call-header-button svg {
    width: 16px;
    height: 16px;
  }

  .message-list {
    padding: 12px 10px;
  }

  .message {
    width: min(100%, 680px);
    max-width: 100%;
  }

  .message-bubble {
    border-radius: 16px 16px 16px 5px;
  }

  .message-mine .message-bubble {
    border-radius: 16px 16px 5px 16px;
  }

  .composer,
  .reply-target,
  .pending-attachments {
    width: 100%;
  }

  .composer {
    grid-template-columns: 34px 34px 34px 34px minmax(0, 1fr) 48px;
    gap: 6px;
    padding: 8px 8px max(10px, env(safe-area-inset-bottom));
    background: var(--mq-chat-surface) !important;
  }

  .composer-entry {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 6px;
  }

  .composer textarea,
  .composer-editor {
    height: 42px;
    min-height: 42px;
    border-radius: 12px;
  }

  .attach-button,
  .emoji-button,
  .format-button,
  .paste-button {
    width: 34px;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 11px !important;
  }

  .composer button[type="submit"] {
    min-height: 42px;
    border-radius: 12px;
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  .composer {
    grid-template-columns: 30px 30px 30px 30px minmax(0, 1fr) 44px;
    gap: 5px;
  }

  .attach-button,
  .emoji-button,
  .format-button,
  .paste-button {
    width: 30px;
    min-width: 30px !important;
    min-height: 32px !important;
  }

  .composer-entry {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 5px;
  }
}

/* Compact modern profile/settings panels. */
.profile-popover {
  width: min(300px, calc(100vw - 24px)) !important;
  gap: 10px !important;
  padding: 12px !important;
  border: 1px solid var(--mq-chat-line) !important;
  border-radius: 16px !important;
  background: var(--mq-chat-panel) !important;
  color: var(--mq-chat-text) !important;
  box-shadow: 0 18px 44px rgba(17, 17, 17, 0.16) !important;
}

.profile-popover strong {
  color: var(--mq-chat-text) !important;
  font-size: 14px;
  line-height: 1.2;
}

.presence-form {
  gap: 8px;
}

.presence-form label,
.setup-form label {
  gap: 6px;
  color: var(--mq-chat-muted) !important;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.presence-form select,
.presence-form input,
.setup-form input,
.setup-form select,
.setup-form textarea,
.inline-edit textarea {
  min-height: 36px !important;
  border: 1px solid var(--mq-chat-line) !important;
  border-radius: 11px !important;
  background: var(--mq-chat-soft) !important;
  color: var(--mq-chat-text) !important;
  padding: 8px 11px !important;
  font-size: 13px;
  box-shadow: none !important;
}

.presence-form input::placeholder,
.setup-form input::placeholder,
.setup-form textarea::placeholder {
  color: color-mix(in srgb, var(--mq-chat-muted) 74%, transparent);
}

.presence-picker {
  position: relative;
  min-width: 0;
}

.profile-popover .presence-picker-trigger {
  width: 100%;
  min-height: 38px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--mq-chat-line) !important;
  border-radius: 12px !important;
  background: var(--mq-chat-soft) !important;
  color: var(--mq-chat-text) !important;
  padding: 0 11px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.presence-picker-current {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.presence-picker-current span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-picker-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.62;
  transform: translateY(-2px) rotate(45deg);
}

.presence-picker-trigger[aria-expanded="true"] .presence-picker-chevron {
  transform: translateY(2px) rotate(225deg);
}

.presence-picker-menu {
  position: absolute;
  inset: calc(100% + 6px) 0 auto;
  z-index: 160;
  display: grid;
  gap: 3px;
  border: 1px solid var(--mq-chat-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--mq-chat-panel) 96%, transparent);
  box-shadow: 0 18px 44px rgba(17, 17, 17, 0.18);
  padding: 5px;
  backdrop-filter: blur(16px) saturate(1.08);
}

.presence-picker-menu[hidden] {
  display: none !important;
}

.profile-popover .presence-picker-option {
  width: 100%;
  min-height: 34px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--mq-chat-text) !important;
  padding: 0 9px !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  text-align: left;
}

.profile-popover .presence-picker-option:hover,
.profile-popover .presence-picker-option[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--maxq-gold) 42%, transparent) !important;
  background: color-mix(in srgb, var(--maxq-gold) 18%, var(--mq-chat-soft)) !important;
  color: var(--mq-chat-text) !important;
}

.profile-popover .presence-picker-option[aria-selected="true"] {
  font-weight: 900 !important;
}

.profile-popover button,
.setup-form button,
.inline-edit button {
  min-height: 36px !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: var(--maxq-gold) !important;
  color: #111111 !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  padding: 0 12px !important;
  box-shadow: none !important;
}

.profile-popover button:hover,
.setup-form button:hover,
.inline-edit button:hover {
  background: #ffd84a !important;
  color: #111111 !important;
  transform: none !important;
}

.setup-panel {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(18px, 3vw, 34px);
  background: var(--mq-chat-surface);
  color: var(--mq-chat-text);
}

.setup-form {
  width: min(100%, 520px);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--mq-chat-line);
  border-radius: 18px;
  background: var(--mq-chat-panel);
  box-shadow: var(--mq-chat-shadow-soft);
}

.setup-form textarea {
  min-height: 84px !important;
}

.setup-form .field-wide {
  grid-column: 1 / -1;
}

.check-row {
  min-height: 38px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px !important;
  color: var(--mq-chat-text) !important;
}

.check-row input {
  width: 16px;
  height: 16px;
  min-height: 16px !important;
  accent-color: var(--maxq-gold);
}

.settings-message {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  background: rgba(245, 196, 0, 0.14);
  color: color-mix(in srgb, var(--mq-chat-text) 70%, var(--maxq-gold) 30%);
  padding: 0 10px;
  font-size: 12px;
}

.settings-message[hidden],
.about-status[hidden] {
  display: none !important;
}

.conversation.settings-view .conversation-header {
  max-width: 1160px;
  width: min(100%, 1160px);
  margin: 0 auto;
}

.settings-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 420px);
  align-content: start;
  align-items: start;
  gap: clamp(14px, 2vw, 22px);
  max-width: 1160px;
  width: min(100%, 1160px);
  margin: 0 auto;
}

.settings-panel .setup-form,
.settings-panel .about-card {
  width: 100%;
}

.about-card {
  width: min(100%, 520px);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--mq-chat-line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mq-chat-panel) 88%, var(--maxq-gold) 12%), var(--mq-chat-panel));
  box-shadow: var(--mq-chat-shadow-soft);
}

.about-card h2 {
  margin: 2px 0 0;
  color: var(--mq-chat-text);
  font-size: 18px;
  line-height: 1.15;
}

.about-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.about-meta div {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--mq-chat-bg) 62%, transparent);
  padding: 8px 10px;
}

.about-meta dt {
  color: var(--mq-chat-muted);
  font-size: 12px;
  font-weight: 800;
}

.about-meta dd {
  margin: 0;
  color: var(--mq-chat-text);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.about-update-button {
  min-height: 40px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--maxq-gold) !important;
  color: #111111 !important;
  font-weight: 900 !important;
  box-shadow: 0 10px 24px rgba(245, 196, 0, 0.2) !important;
}

.about-update-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(245, 196, 0, 0.26) !important;
}

.about-update-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.about-status {
  width: fit-content;
  max-width: 100%;
  margin: 0;
}

@media (max-width: 980px) {
  .settings-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .conversation.settings-view .conversation-header,
  .settings-panel {
    width: 100%;
  }

  .settings-panel {
    padding: 14px;
  }

  .about-meta div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .about-meta dd {
    text-align: left;
  }
}

.people-results,
.member-list {
  width: min(100%, 520px);
  gap: 8px;
}

.person-result,
.member-row,
.selected-member {
  border: 1px solid var(--mq-chat-line) !important;
  border-radius: 14px !important;
  background: var(--mq-chat-panel) !important;
  color: var(--mq-chat-text) !important;
  box-shadow: none !important;
}

.person-result {
  min-height: 42px !important;
  padding: 9px 11px !important;
  text-align: left;
}

.person-result small,
.member-row small {
  color: var(--mq-chat-muted) !important;
}

.group-admin-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.group-admin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .profile-popover {
    position: fixed !important;
    top: 62px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
  }

  .setup-panel {
    padding: 14px 10px;
  }

  .setup-form,
  .people-results,
  .member-list {
    width: 100%;
  }

  .setup-form {
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .group-admin-form {
    grid-template-columns: 1fr;
  }
}

/* Full-screen tablet shell and modern interaction polish. */
@media (min-width: 721px) and (max-width: 1180px) {
  body {
    display: block;
    background: var(--mq-chat-surface) !important;
  }

  .chat {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

:where(button, a.button, summary, .channel, .person-result, .reminder-item, .response-notice, .attachment) {
  transition:
    background-color 130ms var(--maxq-ease),
    border-color 130ms var(--maxq-ease),
    color 130ms var(--maxq-ease),
    box-shadow 130ms var(--maxq-ease),
    transform 90ms var(--maxq-ease),
    opacity 130ms var(--maxq-ease);
}

:where(button, a.button, summary, .channel, .person-result, .reminder-item, .response-notice, .attachment):active {
  transform: translateY(1px) scale(0.985) !important;
  filter: brightness(0.98);
}

:where(button, a, input, select, textarea, summary, [role="button"], .channel):focus-visible {
  outline: 0 !important;
  box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.28) !important;
}

:where(input, select, textarea, .composer-editor):focus,
:where(input, select, textarea, .composer-editor):focus-visible {
  border-color: color-mix(in srgb, var(--maxq-gold) 72%, var(--mq-chat-line)) !important;
  box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.18) !important;
}

.global-search-results {
  top: 46px !important;
  right: 0;
  max-height: min(460px, calc(100dvh - 86px));
  overflow-y: auto;
  padding: 8px !important;
  border: 1px solid var(--mq-chat-line) !important;
  border-radius: 18px !important;
  background: var(--mq-chat-panel) !important;
  color: var(--mq-chat-text) !important;
  box-shadow: 0 22px 56px rgba(17, 17, 17, 0.18) !important;
}

.search-group {
  display: grid;
  gap: 4px;
  padding: 8px 0 10px;
}

.search-group + .search-group {
  border-top: 1px solid var(--mq-chat-line);
}

.search-group strong {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(245, 196, 0, 0.18);
  color: color-mix(in srgb, var(--mq-chat-text) 78%, var(--maxq-gold) 22%) !important;
  padding: 0 9px !important;
  font-size: 10px !important;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.search-group button,
.search-group a,
.search-group span {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--mq-chat-text) !important;
  padding: 8px 10px !important;
  font-size: 13px;
  line-height: 1.25;
}

.search-group button,
.search-group a {
  cursor: pointer;
}

.search-group button:hover,
.search-group a:hover {
  border-color: var(--mq-chat-line);
  background: var(--mq-chat-soft) !important;
  color: var(--mq-chat-text) !important;
  transform: none !important;
}

.search-group button:active,
.search-group a:active {
  background: color-mix(in srgb, var(--mq-chat-soft) 82%, var(--maxq-gold) 18%) !important;
  transform: translateY(1px) scale(0.99) !important;
}

.search-group small {
  display: block;
  margin-top: 2px;
  color: var(--mq-chat-muted) !important;
  font-size: 11px;
}

.search-group span {
  color: var(--mq-chat-muted) !important;
}

.profile-popover button:active,
.setup-form button:active,
.composer button:active,
.message-menu button:active,
.notification-card-actions button:active,
.reminder-actions button:active {
  transform: translateY(1px) scale(0.985) !important;
}

@media (max-width: 720px) {
  .global-search-results {
    position: fixed !important;
    top: 60px !important;
    left: 10px !important;
    right: 10px !important;
    max-height: calc(100dvh - 76px);
  }
}

.global-search-results .search-result {
  display: grid !important;
  grid-template-columns: 7px minmax(0, 1fr) auto !important;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.global-search-results .search-result::before {
  content: "";
  width: 7px;
  height: 7px;
  grid-column: 1;
  border-radius: 999px;
  background: var(--maxq-gold);
  box-shadow: 0 0 0 4px rgba(245, 196, 0, 0.12);
}

.global-search-results .search-result > span:first-child {
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--mq-chat-text) !important;
  padding: 0 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-results .search-result small {
  grid-column: 3;
  max-width: 132px;
  overflow: hidden;
  color: var(--mq-chat-muted) !important;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-results .search-empty {
  color: var(--mq-chat-muted) !important;
  font-size: 12px !important;
}

/* Remove browser-native blue click/tap chrome; keep a maxQ focus cue for keyboard users. */
* {
  -webkit-tap-highlight-color: transparent;
}

:where(button, a, input, select, textarea, summary, [role="button"], .channel, .person-result, .attachment) {
  outline: 0 !important;
}

:where(button, a, summary, [role="button"], .channel, .person-result, .attachment):focus {
  outline: 0 !important;
  box-shadow: none !important;
}

:where(input, select, textarea, .composer-editor):focus {
  outline: 0 !important;
}

:where(button, a, input, select, textarea, summary, [role="button"], .channel, .person-result, .attachment):focus-visible {
  outline: 0 !important;
  box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.24) !important;
}

/* Modern maxQ login and status panels. */
body:has(.panel-login),
body:has(.panel-error),
body:has(.panel:not(.panel-login):not(.panel-error) .mark) {
  display: grid;
  place-items: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  padding: clamp(16px, 4vw, 40px);
  background:
    radial-gradient(circle at 16% 14%, rgba(245, 196, 0, 0.2), transparent 28%),
    radial-gradient(circle at 86% 74%, rgba(17, 17, 17, 0.1), transparent 34%),
    linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    var(--mq-shell-page) !important;
  background-size: auto, auto, 72px 72px, 72px 72px, auto !important;
}

.panel {
  width: min(440px, 100%);
  max-height: min(720px, calc(100dvh - 32px));
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  margin: auto;
  border: 1px solid var(--mq-chat-line);
  border-radius: 24px;
  background: var(--mq-chat-panel);
  color: var(--mq-chat-text);
  box-shadow: 0 24px 70px rgba(17, 17, 17, 0.18);
  padding: 26px;
  overflow-y: auto;
}

.panel .mark {
  width: fit-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #111111;
  color: #f8f6e8;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 900;
}

.panel .mark-product {
  color: rgba(248, 246, 232, 0.72);
  font-weight: 650;
}

.panel h1 {
  color: var(--mq-chat-text);
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

.panel p {
  color: var(--mq-chat-muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel-login {
  position: relative;
  overflow: hidden;
  align-content: center;
}

.panel-login::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 72px;
  background:
    radial-gradient(ellipse at center top, rgba(245, 196, 0, 0.22), rgba(245, 196, 0, 0.08) 34%, transparent 74%);
  pointer-events: none;
}

.login-form {
  width: 100%;
  gap: 10px;
  margin-top: 4px;
}

.login-form label {
  gap: 6px;
  color: var(--mq-chat-muted);
  font-size: 12px;
  font-weight: 800;
}

.login-form input {
  height: 44px;
  border: 1px solid var(--mq-chat-line);
  border-radius: 13px;
  background: var(--mq-chat-soft);
  color: var(--mq-chat-text);
  padding: 0 13px;
  box-shadow: none;
}

.login-form input:focus {
  border-color: color-mix(in srgb, var(--maxq-gold) 68%, var(--mq-chat-line)) !important;
}

.button,
.login-form .button {
  min-height: 44px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 13px;
  background: var(--maxq-gold);
  color: #111111;
  font-weight: 900;
  text-decoration: none;
  padding: 0 16px;
}

.button:hover,
.login-form .button:hover {
  background: #ffd84a;
  transform: none;
}

.button:active,
.login-form .button:active {
  transform: translateY(1px) scale(0.99) !important;
}

.login-error {
  min-height: 34px;
  display: grid;
  align-items: center;
  border-radius: 12px;
  background: rgba(226, 85, 68, 0.11);
  color: #c24132;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 750;
}

.login-error[hidden] {
  display: none !important;
}

.panel-error {
  border-color: rgba(226, 85, 68, 0.22);
}

.panel-error .mark {
  color: #f8f6e8;
}

@media (max-width: 520px) {
  body:has(.panel-login),
  body:has(.panel-error),
  body:has(.panel:not(.panel-login) .mark) {
    display: grid;
    place-items: stretch;
    min-height: 100vh;
    min-height: 100svh;
    padding: 0;
    overflow: hidden;
    background: var(--mq-chat-surface) !important;
  }

  .panel {
    width: 100%;
    max-height: none;
    min-height: 100vh;
    min-height: 100svh;
    height: 100vh;
    height: 100svh;
    justify-content: center;
    align-content: center;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: max(42px, calc(env(safe-area-inset-top) + 30px)) 24px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .panel-login::before {
    top: max(12px, env(safe-area-inset-top));
    right: 24px;
    left: 24px;
    height: 5px;
    border-radius: 999px;
  }
}

@media (min-width: 521px) and (max-width: 900px) {
  body:has(.panel-login),
  body:has(.panel-error),
  body:has(.panel:not(.panel-login) .mark) {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(28px, 5vw, 56px);
    overflow: auto;
    background:
      radial-gradient(circle at 14% 8%, rgba(245, 196, 0, 0.16), transparent 32%),
      var(--mq-chat-surface) !important;
  }

  .panel {
    width: min(560px, calc(100vw - 56px));
    max-height: calc(100svh - 56px);
    border-radius: 24px;
  }
}

@media (max-height: 620px) and (min-width: 521px) {
  body:has(.panel-login),
  body:has(.panel-error),
  body:has(.panel:not(.panel-login) .mark) {
    align-items: start;
  }

  .panel {
    margin-block: 0;
    align-content: start;
    padding: 20px;
  }
}

/* Device-fit login: no floating tablet card, no low mobile drift. */
@media (max-width: 900px) {
  html:has(.panel-login),
  html:has(.panel-error),
  html:has(.panel:not(.panel-login) .mark) {
    background: #0a0a0a !important;
  }

  body:has(.panel-login),
  body:has(.panel-error),
  body:has(.panel:not(.panel-login) .mark) {
    display: block;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    padding: 0;
    background: #0a0a0a !important;
  }

  body:has(.panel-login) .shell,
  body:has(.panel-error) .shell,
  body:has(.panel:not(.panel-login) .mark) .shell {
    min-height: 100vh;
    min-height: 100svh;
    background: #0a0a0a;
  }

  .panel {
    width: 100%;
    max-width: none;
    max-height: none;
    min-height: 100vh;
    min-height: 100svh;
    align-content: start;
    justify-content: stretch;
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(ellipse at 50% 0%, rgba(245, 196, 0, 0.18), rgba(245, 196, 0, 0.07) 32%, transparent 64%),
      linear-gradient(180deg, rgba(245, 196, 0, 0.045), transparent 34%),
      #0a0a0a;
    color: #f5f5f5;
    box-shadow: none;
    overflow: hidden;
    padding: clamp(46px, 10svh, 92px) clamp(24px, 10vw, 84px) max(24px, env(safe-area-inset-bottom));
  }

  .panel > * {
    width: min(100%, 460px);
    margin-inline: auto;
  }

  .panel .mark {
    background: #f5c400;
    color: #0a0a0a;
  }

  .panel .mark-q {
    color: #0a0a0a;
  }

  .panel .mark-product {
    color: rgba(10, 10, 10, 0.72);
  }

  .panel-login {
    align-content: start;
  }

  .panel-login::before {
    top: 0;
    left: 0;
    right: 0;
    height: clamp(82px, 18svh, 150px);
    border-radius: 0;
    opacity: 0.82;
  }

  .panel h1 {
    color: #f5f5f5;
    font-size: clamp(28px, 7vw, 44px);
  }

  .panel p {
    color: #c9c9c9;
    font-size: clamp(13px, 2.6vw, 16px);
  }

  .login-form {
    gap: 12px;
  }

  .login-form label {
    color: #d4d4d8;
  }

  .login-form input {
    border-color: rgba(245, 196, 0, 0.22);
    background: #181818;
    color: #f5f5f5;
  }

  .login-form input:focus {
    background: #1f1f1f;
  }

  .login-form input,
  .login-form .button {
    height: clamp(44px, 7svh, 58px);
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .panel {
    padding: clamp(42px, 8svh, 74px) 24px max(20px, env(safe-area-inset-bottom));
  }

  .panel > * {
    width: 100%;
  }

  .panel-login::before {
    top: 0;
    left: 0;
    right: 0;
  }

  .panel .mark {
    min-height: 44px;
    padding-inline: 18px;
    font-size: 16px;
  }

  .panel h1 {
    font-size: clamp(30px, 10vw, 44px);
  }
}

@media (max-height: 720px) and (max-width: 900px) {
  .panel {
    padding-top: 36px;
    gap: 9px;
  }

  .panel-login::before {
    top: 0;
    height: 72px;
  }

  .login-form {
    gap: 8px;
  }

  .login-form input,
  .login-form .button {
    height: 42px;
  }
}

/* Keep message action menus inside the chat frame on tablet/mobile. */
@media (max-width: 1180px) {
  .message {
    max-width: min(760px, 100%);
  }

  .message-row {
    width: 100%;
    min-width: 0;
    padding-left: 38px;
  }

  .message-mine .message-row {
    padding-left: 0;
    padding-right: 38px;
  }

  .message-action-stack {
    left: 0 !important;
    right: auto !important;
    top: 4px;
  }

  .message-mine .message-action-stack {
    left: auto !important;
    right: 0 !important;
  }

  .message-menu summary {
    width: 32px;
    height: 32px;
    border: 1px solid var(--mq-chat-line);
    border-radius: 12px;
    background: var(--mq-chat-panel);
    color: var(--mq-chat-muted);
    box-shadow: 0 8px 20px rgba(17, 17, 17, 0.1);
  }

  .message-menu[open] summary,
  .message-menu summary:hover {
    border-color: rgba(245, 196, 0, 0.34);
    background: color-mix(in srgb, var(--mq-chat-panel) 84%, var(--maxq-gold) 16%);
    color: var(--mq-chat-text);
  }

  .message-menu-popover {
    top: 38px;
    left: 0 !important;
    right: auto !important;
    min-width: 154px;
    max-width: min(220px, calc(100vw - 28px));
    border: 1px solid var(--mq-chat-line) !important;
    border-radius: 14px !important;
    background: var(--mq-chat-panel) !important;
    box-shadow: 0 18px 46px rgba(17, 17, 17, 0.18) !important;
    padding: 6px !important;
  }

  .message-mine .message-menu-popover {
    left: auto !important;
    right: 0 !important;
  }

  .message-menu button {
    min-height: 34px !important;
    border-radius: 10px !important;
    color: var(--mq-chat-text) !important;
  }
}

@media (max-width: 520px) {
  .message-row {
    padding-left: 34px;
  }

  .message-mine .message-row {
    padding-right: 34px;
  }

  .message-menu summary {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 720px) {
  .call-header-actions {
    gap: 6px;
  }

  .call-header-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .call-header-button svg {
    width: 16px;
    height: 16px;
  }

  .incoming-call {
    top: 72px;
    left: 12px;
    right: 12px;
    width: auto;
    align-items: stretch;
    flex-direction: column;
    transform: none;
  }

  .incoming-call-actions {
    justify-content: stretch;
  }

  .incoming-call-actions button {
    flex: 1 1 0;
  }

  .call-panel {
    left: 10px;
    right: 10px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(66vh, 520px);
    overflow: auto;
    border-radius: 18px;
  }

  .call-panel-stage,
  .call-panel.is-call-fullscreen {
    top: 0 !important;
  }

  .call-video-grid {
    min-height: 118px;
  }

  .call-panel-stage .call-video-grid,
  .call-panel.is-call-fullscreen .call-video-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(160px, 1fr);
  }

  .call-stage-body {
    padding: 8px 10px calc(92px + env(safe-area-inset-bottom));
    overflow: auto;
  }

  .call-panel.call-panel-stage.is-call-chat-open .call-stage-body,
  .call-panel.call-panel-stage.is-screen-share .call-stage-body,
  .call-panel.call-panel-stage.is-screen-share.is-call-chat-open .call-stage-body {
    grid-template-columns: 1fr;
  }

  .call-panel.call-panel-stage.is-screen-share .call-video-grid,
  .call-panel.call-panel-stage.is-screen-share.is-call-chat-open .call-video-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(45vh, 1fr);
  }

  .call-panel.call-panel-stage.is-screen-share .call-video-featured,
  .call-panel.call-panel-stage.is-screen-share .call-video-tile:not(.call-video-featured) {
    grid-column: 1;
    grid-row: auto !important;
  }

  .call-panel-stage.is-call-chat-open .call-stage-body,
  .call-panel.is-call-fullscreen.is-call-chat-open .call-stage-body {
    grid-template-columns: 1fr;
  }

  .call-chat-panel {
    max-height: none;
    min-height: 280px;
    border-radius: 16px;
  }

  .call-chat-form {
    padding: 10px;
  }

  .call-chat-form input,
  .call-chat-form button {
    min-height: 42px;
  }

  .call-video-tile,
  .call-video-empty {
    min-height: 96px;
  }

  .call-panel-stage .call-video-tile,
  .call-panel-stage .call-video-empty,
  .call-panel.is-call-fullscreen .call-video-tile,
  .call-panel.is-call-fullscreen .call-video-empty {
    min-height: 180px;
  }

  .call-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .call-panel-stage .call-controls,
  .call-panel.is-call-fullscreen .call-controls {
    width: calc(100% - 20px);
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

/* Enterprise call interface: final cascade owner */
.chat.call-session-active .topbar .global-search,
.chat:has([data-call-panel]) .topbar .global-search {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.chat.call-session-active .topbar {
  justify-content: space-between;
}

.call-surface {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999 !important;
  pointer-events: none !important;
}

.call-surface .call-panel.call-panel-stage {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f4f3ed !important;
  color: #111111 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  pointer-events: auto !important;
}

.call-surface .call-panel.call-panel-stage .call-panel-head {
  min-height: 72px !important;
  padding: 16px 24px 12px !important;
  background: #fbfaf6 !important;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08) !important;
  color: #111111 !important;
  box-shadow: none !important;
}

.call-surface .call-panel.call-panel-stage .call-stage-body {
  min-height: 0 !important;
  height: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 18px !important;
  overflow: hidden !important;
  padding: 18px 24px 104px !important;
}

.call-surface .call-panel.call-panel-stage.is-call-chat-open .call-stage-body {
  grid-template-columns: minmax(0, 1fr) clamp(340px, 27vw, 480px) !important;
}

.call-surface .call-panel.call-panel-stage .call-video-grid {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)) !important;
  grid-auto-rows: minmax(0, 1fr) !important;
  gap: 14px !important;
  overflow: hidden !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share .call-video-grid {
  grid-template-columns: minmax(0, 1fr) clamp(170px, 15vw, 240px) !important;
  grid-template-rows: repeat(4, minmax(92px, 1fr)) !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share .call-video-featured {
  grid-column: 1 !important;
  grid-row: 1 / -1 !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share .call-video-tile:not(.call-video-featured) {
  grid-column: 2 !important;
  grid-row: auto !important;
  min-height: 0 !important;
}

.call-surface .call-video-tile,
.call-surface .call-video-empty {
  position: relative !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  isolation: isolate !important;
  border: 1px solid rgba(17, 17, 17, 0.14) !important;
  border-radius: 18px !important;
  background: #111216 !important;
  box-shadow: none !important;
}

.call-surface .call-video-tile > video,
.call-surface .call-video-tile > audio {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border-radius: 0 !important;
  background: #08080a !important;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

.call-surface .call-video-tile:not(.call-video-featured) > video {
  object-fit: cover !important;
}

.call-surface .call-video-featured > video,
.call-surface .call-video-screen > video {
  object-fit: contain !important;
}

.call-surface .call-video-tile > span,
.call-surface .call-video-tile > .call-video-identity,
.call-surface .call-video-tile > .call-muted-badge,
.call-surface .call-video-tile > .call-live-badge,
.call-surface .call-video-tile > .call-tile-action {
  z-index: 4 !important;
}

.call-surface .call-video-tile > span {
  position: absolute !important;
  left: 12px !important;
  bottom: 12px !important;
  max-width: calc(100% - 24px) !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 28px !important;
  border: 1px solid rgba(17, 17, 17, 0.08) !important;
  border-radius: 999px !important;
  background: rgba(250, 249, 244, 0.94) !important;
  color: #111111 !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.08) !important;
}

.call-surface .call-video-tile > .call-participant-avatar {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 78px !important;
  height: 78px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  background: #f5c400 !important;
  color: #111111 !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  transform: translate(-50%, -50%) !important;
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.2) !important;
  opacity: 1 !important;
  filter: none !important;
  z-index: 2 !important;
}

.call-surface .call-video-tile:not(.call-video-placeholder) > .call-participant-avatar {
  display: none !important;
}

.call-surface .call-video-identity {
  position: absolute !important;
  inset: 12px auto auto 12px !important;
  width: auto !important;
  max-width: calc(100% - 92px) !important;
  height: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(17, 17, 17, 0.08) !important;
  background: rgba(250, 249, 244, 0.94) !important;
  color: #111111 !important;
  padding: 0 10px !important;
  min-height: 28px !important;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.08) !important;
  transform: none !important;
  opacity: 1 !important;
}

.call-surface .call-video-identity .call-participant-avatar {
  position: static !important;
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px !important;
  font-size: 11px !important;
  transform: none !important;
  box-shadow: none !important;
}

.call-surface .call-video-identity strong {
  min-width: 0 !important;
  overflow: hidden !important;
  color: #111111 !important;
  font-size: 12px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.call-surface .call-controls {
  position: fixed !important;
  left: 50% !important;
  bottom: calc(24px + env(safe-area-inset-bottom)) !important;
  z-index: 20 !important;
  width: auto !important;
  max-width: calc(100vw - 48px) !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 18px !important;
  background: rgba(18, 18, 22, 0.92) !important;
  padding: 8px !important;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.24) !important;
  transform: translateX(-50%) !important;
}

.call-surface .call-control-button {
  min-width: 52px !important;
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  border: 0 !important;
  border-radius: 13px !important;
  background: #f4efd1 !important;
  color: #111111 !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.call-surface .call-control-button.is-on {
  background: #f5c400 !important;
}

.call-surface .call-control-button.is-off {
  background: #ffffff !important;
  color: #4f4f55 !important;
}

.call-surface .call-control-button.call-end-control {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.call-surface .call-control-icon,
.call-surface .call-control-icon svg {
  width: 16px !important;
  height: 16px !important;
}

.call-surface .call-chat-panel {
  min-height: 0 !important;
  height: 100% !important;
  border: 1px solid var(--mq-chat-line) !important;
  border-radius: 18px !important;
  background: var(--mq-chat-surface) !important;
  color: var(--mq-chat-text) !important;
  box-shadow: 0 14px 36px rgba(17, 17, 17, 0.12) !important;
}

.call-surface .call-panel.is-call-minimized {
  position: fixed !important;
  inset: auto 20px 20px auto !important;
  width: min(360px, calc(100vw - 24px)) !important;
  height: auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: auto !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-card {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 138px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  border: 1px solid rgba(17, 17, 17, 0.1) !important;
  border-radius: 18px !important;
  background: #fbfaf6 !important;
  padding: 10px !important;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.22) !important;
}

.call-surface .call-mini-preview {
  width: 138px !important;
  height: 78px !important;
  min-height: 78px !important;
  border-radius: 14px !important;
  background: #111216 !important;
}

.call-surface .call-mini-preview > video {
  object-fit: cover !important;
}

.call-surface .call-mini-preview.call-video-screen > video {
  object-fit: contain !important;
}

.call-surface .call-mini-preview > .call-participant-avatar {
  width: 44px !important;
  height: 44px !important;
  font-size: 14px !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-meta {
  min-width: 0 !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-avatar {
  display: none !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-actions {
  align-self: stretch !important;
  display: grid !important;
  align-content: center !important;
  gap: 8px !important;
}

@media (max-width: 860px) {
  .call-surface .call-panel.call-panel-stage .call-stage-body,
  .call-surface .call-panel.call-panel-stage.is-call-chat-open .call-stage-body,
  .call-surface .call-panel.call-panel-stage.is-screen-share .call-stage-body,
  .call-surface .call-panel.call-panel-stage.is-screen-share.is-call-chat-open .call-stage-body {
    grid-template-columns: 1fr !important;
    overflow: auto !important;
    padding: 12px 12px calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .call-surface .call-panel.call-panel-stage.is-screen-share .call-video-grid,
  .call-surface .call-panel.call-panel-stage.is-screen-share.is-call-chat-open .call-video-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(46vh, 1fr) !important;
  }

  .call-surface .call-panel.call-panel-stage.is-screen-share .call-video-featured,
  .call-surface .call-panel.call-panel-stage.is-screen-share .call-video-tile:not(.call-video-featured) {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .call-surface .call-controls {
    width: calc(100vw - 24px) !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  .call-surface .call-control-button {
    min-width: 0 !important;
    padding: 0 8px !important;
  }
}

/* PWA enterprise call fit: compact voice calls and minimized previews */
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f4f3ed !important;
  color: #111111 !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: auto !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-panel-head {
  min-height: 76px !important;
  padding: 16px 24px 12px !important;
  background: #fbfaf6 !important;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08) !important;
  color: #111111 !important;
  box-shadow: none !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-stage-body {
  min-height: 0 !important;
  height: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: center !important;
  overflow: hidden !important;
  padding: 24px 24px 18px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized).is-call-chat-open .call-stage-body {
  grid-template-columns: minmax(0, 1fr) clamp(320px, 32vw, 460px) !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid {
  width: min(520px, calc(100vw - 48px)) !important;
  height: min(380px, calc(100vh - 260px)) !important;
  min-height: 260px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-auto-rows: 1fr !important;
  gap: 0 !important;
  overflow: visible !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized).is-call-chat-open .call-video-grid {
  width: 100% !important;
  height: 100% !important;
  min-height: 260px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-tile,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-empty {
  min-height: 0 !important;
  height: 100% !important;
  border: 1px solid rgba(17, 17, 17, 0.1) !important;
  border-radius: 22px !important;
  background: #fbfaf6 !important;
  box-shadow: 0 18px 44px rgba(17, 17, 17, 0.1) !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder {
  display: grid !important;
  place-items: center !important;
  background: #fbfaf6 !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > .call-participant-avatar {
  width: 112px !important;
  height: 112px !important;
  font-size: 34px !important;
  background: #f5c400 !important;
  box-shadow: 0 16px 34px rgba(17, 17, 17, 0.12) !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > .call-live-badge,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > .call-muted-badge {
  top: 16px !important;
  right: 16px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > span {
  left: 16px !important;
  bottom: 16px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls {
  position: static !important;
  width: min(760px, calc(100vw - 32px)) !important;
  max-width: none !important;
  justify-self: center !important;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 0 auto calc(18px + env(safe-area-inset-bottom)) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 18px !important;
  background: rgba(18, 18, 22, 0.94) !important;
  padding: 8px !important;
  transform: none !important;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.18) !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-control-button {
  min-width: 0 !important;
  min-height: 46px !important;
  padding: 0 10px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-control-label {
  max-width: 96px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.call-surface .call-video-placeholder,
.call-surface .call-video-placeholder.call-video-tile {
  background: #fbfaf6 !important;
}

.call-surface .call-video-placeholder > .call-participant-avatar {
  background: #f5c400 !important;
}

.call-surface .call-panel.is-call-minimized {
  z-index: 1000 !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-card {
  grid-template-columns: 132px minmax(0, 1fr) auto !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-preview {
  width: 132px !important;
  height: 74px !important;
  background: #111216 !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-preview.call-video-placeholder {
  background: #fbfaf6 !important;
}

@media (max-width: 760px) {
  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-panel-head {
    min-height: 72px !important;
    padding: 14px 16px 10px !important;
  }

  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-stage-body,
  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized).is-call-chat-open .call-stage-body {
    grid-template-columns: 1fr !important;
    align-items: center !important;
    overflow: auto !important;
    padding: 16px 14px 12px !important;
  }

  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid {
    width: 100% !important;
    height: min(360px, 48vh) !important;
    min-height: 230px !important;
  }

  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls {
    width: calc(100vw - 24px) !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    margin-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-control-button {
    min-height: 44px !important;
  }

  .call-surface .call-panel.is-call-minimized {
    inset: auto 12px calc(12px + env(safe-area-inset-bottom)) auto !important;
    width: calc(100vw - 24px) !important;
  }

  .call-surface .call-panel.is-call-minimized .call-mini-card {
    grid-template-columns: 112px minmax(0, 1fr) auto !important;
    gap: 10px !important;
  }

  .call-surface .call-panel.is-call-minimized .call-mini-preview {
    width: 112px !important;
    height: 64px !important;
  }
}

/* Teams-inspired PWA call workspace: light, tight, low-cost */
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized),
.call-surface .call-panel.call-panel-stage:not(.is-call-minimized) {
  background: #f5f4ef !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-panel-head,
.call-surface .call-panel.call-panel-stage:not(.is-call-minimized) .call-panel-head {
  min-height: 68px !important;
  display: flex !important;
  align-items: center !important;
  padding: 12px 24px !important;
  background: #fbfaf6 !important;
  border-bottom: 1px solid #e2ded2 !important;
}

.call-surface .call-panel-title {
  gap: 2px !important;
}

.call-surface .call-panel-title strong {
  color: #171717 !important;
  font-size: 18px !important;
  line-height: 1.15 !important;
}

.call-surface .call-panel-title > span {
  color: #4d5562 !important;
  font-size: 13px !important;
}

.call-surface .call-session-chips {
  gap: 6px !important;
  margin-top: 6px !important;
}

.call-surface .call-session-chip {
  min-height: 24px !important;
  border-color: #d8d1b4 !important;
  background: #f4edcf !important;
  color: #2d2d2d !important;
  padding: 0 9px !important;
  font-size: 12px !important;
}

.call-surface .call-window-button {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  border: 1px solid #ddd6bd !important;
  border-radius: 12px !important;
  background: #f4edcf !important;
  color: #171717 !important;
  box-shadow: none !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-stage-body {
  align-content: center !important;
  padding: 20px 24px 14px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid {
  width: min(480px, calc(100vw - 48px)) !important;
  height: min(340px, calc(100vh - 236px)) !important;
  min-height: 250px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-tile,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-empty {
  border-color: #ded9c9 !important;
  border-radius: 18px !important;
  background: #fffef9 !important;
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.08) !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder {
  display: grid !important;
  place-items: center !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > .call-participant-avatar {
  width: 104px !important;
  height: 104px !important;
  border: 3px solid #fff5c4 !important;
  background: #f5c400 !important;
  color: #171717 !important;
  font-size: 32px !important;
  box-shadow: none !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > .call-live-badge,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > .call-muted-badge {
  top: 14px !important;
  right: 14px !important;
  min-height: 26px !important;
  border: 1px solid #d8d1b4 !important;
  border-radius: 999px !important;
  background: #f4edcf !important;
  color: #1f2937 !important;
  padding: 0 9px !important;
  font-size: 11px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > span,
.call-surface .call-video-tile > span {
  min-height: 26px !important;
  border-color: #ded9c9 !important;
  background: #fffef9 !important;
  color: #171717 !important;
  box-shadow: none !important;
}

.call-surface .call-controls {
  background: #1f2026 !important;
  border-color: #30313a !important;
  border-radius: 16px !important;
  padding: 7px !important;
  gap: 7px !important;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.18) !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls {
  width: min(650px, calc(100vw - 32px)) !important;
  grid-template-columns: repeat(6, minmax(72px, 1fr)) !important;
  margin-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
}

.call-surface .call-control-button {
  min-height: 42px !important;
  border-radius: 12px !important;
  background: #f4edcf !important;
  color: #171717 !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.call-surface .call-control-button.is-off {
  background: #ffffff !important;
  color: #444b57 !important;
}

.call-surface .call-control-button.is-on {
  background: #f5c400 !important;
  color: #171717 !important;
}

.call-surface .call-control-button.call-end-control {
  background: #e5484d !important;
  color: #ffffff !important;
}

.call-surface .call-control-label {
  max-width: 82px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.call-surface .call-control-icon,
.call-surface .call-control-icon svg {
  width: 15px !important;
  height: 15px !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized) .call-stage-body {
  padding: 16px 20px 92px !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized) .call-video-grid {
  gap: 10px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized) .call-video-grid {
  grid-template-columns: minmax(0, 1fr) clamp(150px, 13vw, 210px) !important;
  grid-template-rows: repeat(4, minmax(82px, 1fr)) !important;
}

.call-surface .call-chat-panel {
  border-color: #ded9c9 !important;
  background: #fffef9 !important;
  box-shadow: none !important;
}

.call-surface .call-chat-head,
.call-surface .call-chat-form {
  background: #fbfaf6 !important;
  border-color: #e2ded2 !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-card {
  border-color: #ded9c9 !important;
  background: #fffef9 !important;
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.16) !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-preview {
  border-color: #ded9c9 !important;
  background: #fbfaf6 !important;
}

@media (max-width: 900px) {
  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls,
  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized) .call-controls {
    width: calc(100vw - 24px) !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  .call-surface .call-control-button {
    min-width: 0 !important;
  }
}

@media (max-width: 560px) {
  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-panel-head,
  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized) .call-panel-head {
    padding: 10px 12px !important;
  }

  .call-surface .call-panel-title strong {
    font-size: 16px !important;
  }

  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid {
    width: calc(100vw - 24px) !important;
    height: min(310px, 43vh) !important;
    min-height: 220px !important;
  }

  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls,
  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized) .call-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .call-surface .call-control-button {
    min-height: 40px !important;
  }
}

/* Production conferencing layout: Teams-like, PWA-safe, no heavy effects */
.call-surface .call-panel.call-panel-stage:not(.is-call-minimized),
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) {
  background: #f7f7f5 !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized) .call-panel-head,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-panel-head {
  min-height: 64px !important;
  padding: 10px 24px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
}

.call-surface .call-panel-title strong {
  color: #111827 !important;
  font-size: 18px !important;
  font-weight: 850 !important;
}

.call-surface .call-panel-title > span {
  color: #4b5563 !important;
  font-size: 13px !important;
}

.call-surface .call-session-chip {
  min-height: 22px !important;
  border: 1px solid #e5e7eb !important;
  background: #f9fafb !important;
  color: #374151 !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}

.call-surface .call-window-button {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  border: 1px solid #e5e7eb !important;
  background: #f9fafb !important;
  color: #111827 !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized) .call-stage-body {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  padding: 16px 20px 84px !important;
}

.call-surface .call-panel.call-panel-stage.is-call-chat-open:not(.is-call-minimized) .call-stage-body {
  grid-template-columns: minmax(0, 1fr) clamp(330px, 27vw, 430px) !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized) .call-video-grid {
  grid-template-columns: minmax(0, 1fr) clamp(132px, 12vw, 190px) !important;
  grid-template-rows: repeat(4, minmax(78px, 1fr)) !important;
  gap: 10px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized).is-call-chat-open .call-video-grid {
  grid-template-columns: minmax(0, 1fr) clamp(118px, 10vw, 160px) !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized) .call-video-featured {
  grid-column: 1 !important;
  grid-row: 1 / -1 !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized) .call-video-tile:not(.call-video-featured) {
  grid-column: 2 !important;
  grid-row: auto !important;
  min-height: 0 !important;
  border-radius: 12px !important;
}

.call-surface .call-video-tile,
.call-surface .call-video-empty {
  border: 1px solid #d1d5db !important;
  border-radius: 14px !important;
  background: #111827 !important;
  box-shadow: none !important;
}

.call-surface .call-video-featured {
  border-radius: 16px !important;
}

.call-surface .call-video-live > .call-participant-avatar,
.call-surface .call-video-live .call-video-identity .call-participant-avatar {
  display: none !important;
}

.call-surface .call-video-live > .call-video-identity,
.call-surface .call-video-live > .call-live-badge,
.call-surface .call-video-live > .call-muted-badge {
  display: none !important;
}

.call-surface .call-video-tile > span {
  left: 10px !important;
  bottom: 10px !important;
  min-height: 24px !important;
  max-width: calc(100% - 20px) !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(17, 24, 39, 0.82) !important;
  color: #ffffff !important;
  padding: 0 9px !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  box-shadow: none !important;
}

.call-surface .call-video-featured > span {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
}

.call-surface .call-tile-action {
  right: 10px !important;
  bottom: 10px !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: none !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid {
  width: min(420px, calc(100vw - 48px)) !important;
  height: min(300px, calc(100vh - 220px)) !important;
  min-height: 220px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-tile,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-empty {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

.call-surface .call-video-placeholder > .call-participant-avatar,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-placeholder > .call-participant-avatar {
  width: 92px !important;
  height: 92px !important;
  border: 0 !important;
  background: #f5c400 !important;
  color: #111827 !important;
  font-size: 28px !important;
  box-shadow: none !important;
}

.call-surface .call-video-placeholder > .call-live-badge,
.call-surface .call-video-placeholder > .call-muted-badge {
  top: 12px !important;
  right: 12px !important;
  min-height: 24px !important;
  border: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  color: #374151 !important;
  font-size: 11px !important;
}

.call-surface .call-video-placeholder > span {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
}

.call-surface .call-chat-panel {
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: #111827 !important;
}

.call-surface .call-chat-head {
  min-height: 54px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
  padding: 10px 14px !important;
}

.call-surface .call-chat-messages {
  background: #ffffff !important;
  padding: 12px !important;
  gap: 8px !important;
}

.call-surface .call-chat-message p {
  max-width: min(100%, 34ch) !important;
  background: #f3f4f6 !important;
  color: #111827 !important;
  border-radius: 12px 12px 12px 4px !important;
  box-shadow: none !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
}

.call-surface .call-chat-message.is-mine p {
  background: #fff4b8 !important;
  color: #111827 !important;
  border-radius: 12px 12px 4px 12px !important;
}

.call-surface .call-chat-form {
  gap: 8px !important;
  background: #ffffff !important;
  border-top: 1px solid #e5e7eb !important;
  padding: 10px !important;
}

.call-surface .call-chat-form input {
  min-height: 42px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 12px !important;
  background: #f9fafb !important;
  color: #111827 !important;
  font-size: 14px !important;
}

.call-surface .call-chat-form button {
  min-height: 42px !important;
  min-width: 72px !important;
  border-radius: 12px !important;
}

.call-surface .call-controls,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls {
  width: auto !important;
  max-width: calc(100vw - 40px) !important;
  display: inline-flex !important;
  grid-template-columns: none !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  border: 1px solid #2f333d !important;
  border-radius: 16px !important;
  background: #202127 !important;
  padding: 7px !important;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.18) !important;
}

.call-surface .call-control-button {
  min-width: 44px !important;
  min-height: 42px !important;
  gap: 6px !important;
  border-radius: 11px !important;
  background: #f9fafb !important;
  color: #111827 !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

.call-surface .call-control-button.is-on {
  background: #f5c400 !important;
}

.call-surface .call-control-button.is-off {
  background: #ffffff !important;
  color: #374151 !important;
}

.call-surface .call-control-button.call-end-control {
  background: #e5484d !important;
  color: #ffffff !important;
}

.call-surface .call-control-label {
  max-width: 74px !important;
  letter-spacing: 0 !important;
}

.call-surface .call-control-icon,
.call-surface .call-control-icon svg {
  width: 14px !important;
  height: 14px !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-card {
  border: 1px solid #d1d5db !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.18) !important;
}

@media (max-width: 980px) {
  .call-surface .call-controls,
  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls {
    width: calc(100vw - 24px) !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  .call-surface .call-controls,
  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .call-surface .call-control-button {
    min-width: 0 !important;
    padding: 0 8px !important;
  }
}

/* Audio-only call card: dedicated speaker tile, no video placeholder stretching */
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-stage-body {
  padding-top: 34px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid:has(.call-audio-tile) {
  width: min(360px, calc(100vw - 48px)) !important;
  height: 260px !important;
  min-height: 260px !important;
}

.call-surface .call-audio-tile.call-video-tile {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.call-surface .call-audio-tile > .call-participant-avatar {
  position: static !important;
  width: 104px !important;
  height: 104px !important;
  display: grid !important;
  place-items: center !important;
  align-self: end !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #f5c400 !important;
  color: #111827 !important;
  font-size: 32px !important;
  font-weight: 900 !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

.call-surface .call-audio-tile > span {
  position: static !important;
  align-self: start !important;
  min-height: 26px !important;
  max-width: calc(100% - 24px) !important;
  margin-top: 14px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  background: #f9fafb !important;
  color: #111827 !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 26px !important;
  box-shadow: none !important;
}

.call-surface .call-audio-tile > .call-live-badge,
.call-surface .call-audio-tile > .call-muted-badge {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  min-height: 24px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #374151 !important;
  padding: 0 9px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

@media (max-width: 560px) {
  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid:has(.call-audio-tile) {
    width: calc(100vw - 32px) !important;
    height: 240px !important;
    min-height: 240px !important;
  }
}

/* Participant identity card: profile-style avatar, highlighted name, mic icon */
.call-surface .call-video-placeholder > .call-participant-avatar,
.call-surface .call-audio-tile > .call-participant-avatar,
.call-surface .call-mini-preview > .call-participant-avatar {
  background: #f5c400 !important;
  color: #0a0a0a !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

.call-surface .call-participant-name {
  position: absolute !important;
  left: 12px !important;
  bottom: 12px !important;
  z-index: 5 !important;
  max-width: calc(100% - 76px) !important;
  min-height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow: hidden !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #111827 !important;
  padding: 0 11px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

.call-surface .call-mic-state {
  position: absolute !important;
  right: 12px !important;
  bottom: 12px !important;
  z-index: 5 !important;
  width: 28px !important;
  height: 28px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #16a34a !important;
  box-shadow: none !important;
}

.call-surface .call-mic-state.is-muted {
  color: #dc2626 !important;
}

.call-surface .call-mic-state svg {
  width: 14px !important;
  height: 14px !important;
}

.call-surface .call-audio-tile > span {
  display: none !important;
}

.call-surface .call-audio-tile > .call-participant-name {
  left: 50% !important;
  bottom: 42px !important;
  max-width: calc(100% - 88px) !important;
  transform: translateX(-50%) !important;
}

.call-surface .call-audio-tile > .call-mic-state {
  right: 14px !important;
  top: 14px !important;
  bottom: auto !important;
}

.call-surface .call-mini-preview > .call-participant-name {
  min-height: 22px !important;
  max-width: calc(100% - 48px) !important;
  padding: 0 8px !important;
  font-size: 10px !important;
}

.call-surface .call-mini-preview > .call-mic-state {
  width: 22px !important;
  height: 22px !important;
  right: 8px !important;
  bottom: 8px !important;
}

/* Icon-only modern call controls and clean audio participant identity */
.call-surface .call-controls,
.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls {
  width: auto !important;
  display: inline-flex !important;
  gap: 10px !important;
  border-radius: 999px !important;
  background: #202127 !important;
  padding: 10px !important;
}

.call-surface .call-control-button {
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  padding: 0 !important;
}

.call-surface .call-control-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.call-surface .call-control-icon,
.call-surface .call-control-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.call-surface .call-control-button.call-end-control {
  width: 54px !important;
  min-width: 54px !important;
}

.call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid:has(.call-audio-tile) {
  width: min(400px, calc(100vw - 48px)) !important;
  height: 300px !important;
  min-height: 300px !important;
}

.call-surface .call-audio-tile.call-video-tile {
  grid-template-rows: 1fr auto !important;
  place-items: center !important;
  padding: 36px 24px 28px !important;
}

.call-surface .call-audio-tile > .call-participant-avatar {
  align-self: end !important;
  width: 116px !important;
  height: 116px !important;
  font-size: 34px !important;
}

.call-surface .call-audio-tile > .call-participant-name {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  align-self: start !important;
  max-width: min(100%, 260px) !important;
  min-height: 32px !important;
  margin-top: 18px !important;
  transform: none !important;
  justify-content: center !important;
  padding: 0 14px !important;
  font-size: 13px !important;
}

.call-surface .call-audio-tile > .call-mic-state {
  top: 16px !important;
  right: 16px !important;
  width: 32px !important;
  height: 32px !important;
}

@media (max-width: 560px) {
  .call-surface .call-controls,
  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-controls {
    gap: 8px !important;
    padding: 8px !important;
  }

  .call-surface .call-control-button {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  .call-surface .call-panel.call-panel-compact:not(.is-call-minimized) .call-video-grid:has(.call-audio-tile) {
    width: calc(100vw - 32px) !important;
    height: 280px !important;
    min-height: 280px !important;
  }
}

/* Minimized call preview: contained, docked, icon-only actions */
.call-surface .call-panel.is-call-minimized {
  position: fixed !important;
  left: auto !important;
  right: 18px !important;
  bottom: calc(18px + env(safe-area-inset-bottom)) !important;
  width: min(360px, calc(100vw - 36px)) !important;
  height: auto !important;
  z-index: 1200 !important;
  pointer-events: auto !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-card {
  width: 100% !important;
  min-height: 112px !important;
  display: grid !important;
  grid-template-columns: 132px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  overflow: hidden !important;
  border: 1px solid #d1d5db !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  padding: 10px !important;
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.2) !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-preview {
  position: relative !important;
  width: 132px !important;
  height: 84px !important;
  min-height: 84px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  background: #f9fafb !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-preview > .call-participant-avatar {
  position: static !important;
  width: 46px !important;
  height: 46px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  background: #f5c400 !important;
  color: #0a0a0a !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  transform: none !important;
  box-shadow: none !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-preview > .call-participant-name {
  position: absolute !important;
  left: 8px !important;
  right: 34px !important;
  bottom: 8px !important;
  width: auto !important;
  max-width: none !important;
  min-height: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow: hidden !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #111827 !important;
  padding: 0 8px !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-preview > .call-mic-state {
  position: absolute !important;
  right: 8px !important;
  bottom: 8px !important;
  width: 22px !important;
  height: 22px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 50% !important;
  background: #ffffff !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-meta {
  min-width: 0 !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-meta strong,
.call-surface .call-panel.is-call-minimized .call-mini-meta span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.call-surface .call-panel.is-call-minimized .call-mini-actions {
  display: inline-flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.call-surface .call-panel.is-call-minimized .call-window-button,
.call-surface .call-panel.is-call-minimized .call-end-button {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  padding: 0 !important;
}

@media (max-width: 720px) {
  .call-surface .call-panel.is-call-minimized {
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    width: calc(100vw - 24px) !important;
  }

  .call-surface .call-panel.is-call-minimized .call-mini-card {
    grid-template-columns: 112px minmax(0, 1fr) auto !important;
  }

  .call-surface .call-panel.is-call-minimized .call-mini-preview {
    width: 112px !important;
    height: 70px !important;
    min-height: 70px !important;
  }
}

/* Final fullscreen screen-share layout owner */
.call-surface:fullscreen,
.call-surface:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  background: #050506 !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  display: block !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #050506 !important;
  padding: 0 !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-panel-head,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-panel-head,
.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-chat-panel,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-chat-panel,
.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-add-panel,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-add-panel {
  display: none !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-stage-body,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-stage-body,
.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-video-grid,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-video-grid {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr !important;
  gap: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #050506 !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-video-featured,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-video-featured {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100vw !important;
  height: 100vh !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #050506 !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-video-featured > video,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-video-featured > video {
  object-fit: contain !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured),
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured) {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  z-index: 20 !important;
  width: clamp(132px, 13vw, 200px) !important;
  height: clamp(82px, 12vh, 126px) !important;
  margin: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 14px !important;
  background: rgba(17, 24, 39, 0.72) !important;
  opacity: 1 !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured):nth-child(3),
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured):nth-child(3) {
  top: calc(16px + clamp(92px, 13vh, 138px)) !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured):nth-child(4),
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured):nth-child(4) {
  top: calc(16px + clamp(184px, 26vh, 276px)) !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-video-tile:not(.call-video-featured),
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-video-tile:not(.call-video-featured) {
  opacity: 0 !important;
  pointer-events: none !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-controls,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-controls {
  position: fixed !important;
  left: 50% !important;
  bottom: calc(72px + env(safe-area-inset-bottom)) !important;
  z-index: 24 !important;
  width: auto !important;
  display: inline-flex !important;
  grid-template-columns: none !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(18, 18, 22, 0.46) !important;
  transform: translateX(-50%) !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-controls,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-controls {
  opacity: 0.2 !important;
}

/* Dedicated minimized call PIP component */
.call-surface .call-panel.call-panel-minimized {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: 20px !important;
  bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  width: min(380px, calc(100vw - 40px)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: block !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: auto !important;
  z-index: 1300 !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-card {
  width: 100% !important;
  min-height: 108px !important;
  display: grid !important;
  grid-template-columns: 132px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  overflow: hidden !important;
  border: 1px solid #d1d5db !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  padding: 10px !important;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.22) !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-preview {
  position: relative !important;
  width: 132px !important;
  height: 82px !important;
  min-height: 82px !important;
  overflow: hidden !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  background: #111827 !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-preview.call-video-placeholder {
  display: grid !important;
  place-items: center !important;
  background: #f9fafb !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-preview > video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-preview.call-video-screen > video {
  object-fit: contain !important;
  background: #050506 !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-meta {
  min-width: 0 !important;
  display: grid !important;
  gap: 3px !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-meta strong {
  overflow: hidden !important;
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 850 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-meta span {
  overflow: hidden !important;
  color: #4b5563 !important;
  font-size: 12px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-actions {
  display: grid !important;
  gap: 8px !important;
}

.call-surface .call-panel.call-panel-minimized .call-window-button,
.call-surface .call-panel.call-panel-minimized .call-end-button {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  padding: 0 !important;
}

@media (max-width: 720px) {
  .call-surface .call-panel.call-panel-minimized {
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    width: calc(100vw - 24px) !important;
  }

  .call-surface .call-panel.call-panel-minimized .call-mini-card {
    grid-template-columns: 112px minmax(0, 1fr) auto !important;
  }

  .call-surface .call-panel.call-panel-minimized .call-mini-preview {
    width: 112px !important;
    height: 70px !important;
    min-height: 70px !important;
  }
}

/* Compact modern minimized card */
.call-surface .call-panel.call-panel-minimized {
  width: min(330px, calc(100vw - 32px)) !important;
  right: 16px !important;
  bottom: calc(16px + env(safe-area-inset-bottom)) !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-card {
  min-height: 82px !important;
  grid-template-columns: 104px minmax(0, 1fr) auto !important;
  gap: 9px !important;
  border-radius: 16px !important;
  padding: 8px !important;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.18) !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-preview {
  width: 104px !important;
  height: 64px !important;
  min-height: 64px !important;
  border-radius: 12px !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-meta {
  gap: 2px !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-meta strong {
  font-size: 13px !important;
  line-height: 1.15 !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-meta span {
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.call-surface .call-panel.call-panel-minimized .call-mini-actions {
  gap: 7px !important;
}

.call-surface .call-panel.call-panel-minimized .call-window-button,
.call-surface .call-panel.call-panel-minimized .call-end-button {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  border: 0 !important;
  box-shadow: none !important;
}

.call-surface .call-panel.call-panel-minimized .call-window-button {
  background: #eaf2ff !important;
  color: #1d4ed8 !important;
}

.call-surface .call-panel.call-panel-minimized .call-end-button {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  font-size: 20px !important;
}

.call-surface .call-panel.call-panel-minimized .call-window-button svg,
.call-surface .call-panel.call-panel-minimized .call-end-button svg {
  width: 17px !important;
  height: 17px !important;
}

@media (max-width: 720px) {
  .call-surface .call-panel.call-panel-minimized {
    right: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    width: calc(100vw - 20px) !important;
  }

  .call-surface .call-panel.call-panel-minimized .call-mini-card {
    grid-template-columns: 96px minmax(0, 1fr) auto !important;
  }

  .call-surface .call-panel.call-panel-minimized .call-mini-preview {
    width: 96px !important;
    height: 58px !important;
    min-height: 58px !important;
  }
}

/* Final enterprise call header and participant identity owner */
.call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) {
  position: relative !important;
}

.call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-head {
  min-height: 104px !important;
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) auto minmax(52px, 1fr) !important;
  align-items: start !important;
  gap: 16px !important;
  padding: 18px 28px 14px !important;
}

/* Tight screen-share stage: compact header, full use of vertical space */
.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) {
  grid-template-rows: 74px minmax(0, 1fr) !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-head {
  min-height: 74px !important;
  height: 74px !important;
  align-items: center !important;
  padding: 8px 28px !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-title {
  align-self: center !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-title strong {
  font-size: 17px !important;
  line-height: 1.1 !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-title > span {
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-session-chips {
  margin-top: 5px !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-controls {
  top: 8px !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-stage-body {
  min-height: 0 !important;
  height: 100% !important;
  gap: 12px !important;
  padding: 10px 24px 14px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-stage-body {
  padding-top: 8px !important;
  padding-bottom: 10px !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-grid {
  min-height: 0 !important;
  height: 100% !important;
  gap: 12px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-grid {
  grid-template-columns: minmax(0, 1fr) clamp(128px, 12vw, 190px) !important;
  grid-template-rows: repeat(4, minmax(72px, 1fr)) !important;
  gap: 12px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-featured {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-featured > video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-tile:not(.call-video-featured) {
  min-height: 0 !important;
  height: 100% !important;
}

@media (min-width: 1400px) {
  .call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-stage-body {
    padding-left: 26px !important;
    padding-right: 26px !important;
  }
}

@media (max-width: 980px) {
  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) {
    grid-template-rows: 118px minmax(0, 1fr) !important;
  }

  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-head {
    height: 118px !important;
    min-height: 118px !important;
    padding: 12px 18px !important;
  }

  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-controls {
    top: 64px !important;
  }

  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-stage-body {
    padding: 8px 14px 10px !important;
  }
}

/* Final enterprise chat polish */
.conversation-header {
  min-height: 62px !important;
  padding-inline: clamp(18px, 2.6vw, 34px) !important;
}

.conversation-header h1 {
  font-size: clamp(17px, 1.25vw, 21px) !important;
  line-height: 1.2 !important;
  font-weight: 750 !important;
  letter-spacing: 0 !important;
}

.conversation-timezone,
.conversation-presence {
  font-size: 11px !important;
}

.channel {
  min-height: 48px !important;
  border-radius: 10px !important;
  padding-inline: 10px !important;
}

.channel-icon {
  width: 26px !important;
  height: 26px !important;
  border-radius: 8px !important;
}

.channel-name strong,
.channel-name small,
.message-meta,
.message p,
.composer-editor {
  font-size: 13.5px !important;
}

.message-list {
  padding-block: clamp(14px, 2.2vw, 28px) !important;
  transition:
    opacity 170ms var(--motion-ease),
    transform 170ms var(--motion-ease),
    filter 170ms var(--motion-ease) !important;
}

.conversation.conversation-switching .message-list {
  opacity: 0.28;
  transform: translateY(4px);
  filter: blur(0.6px);
}

.message {
  max-width: min(680px, 72%) !important;
}

.message-bubble {
  border: 1px solid color-mix(in srgb, var(--mq-chat-line) 70%, transparent) !important;
  border-radius: 14px 14px 14px 5px !important;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.055) !important;
  padding: 10px 13px !important;
}

.message-mine .message-bubble {
  border-radius: 14px 14px 5px 14px !important;
}

.composer {
  grid-template-columns: 34px 34px 34px 34px minmax(0, 1fr) 54px !important;
  gap: 6px !important;
  max-width: 880px !important;
  padding-block: 10px 14px !important;
}

.attach-button,
.emoji-button,
.format-button,
.paste-button {
  width: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 9px !important;
  font-size: 14px !important;
  box-shadow: none !important;
}

.attach-button {
  font-size: 18px !important;
}

.format-button {
  font-size: 13px !important;
}

.composer button[type="submit"] {
  min-height: 38px !important;
  border-radius: 11px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.composer-editor {
  min-height: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  padding-block: 10px !important;
}

@media (max-width: 720px) {
  .conversation {
    grid-template-rows: 56px minmax(0, 1fr) auto auto auto auto !important;
  }

  .conversation-header {
    min-height: 56px !important;
    padding-inline: 9px !important;
  }

  .conversation-header h1 {
    font-size: 15px !important;
  }

  .message-list {
    padding: 10px 10px 8px !important;
  }

  .message {
    max-width: 92% !important;
  }

  .composer {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px !important;
    grid-template-rows: minmax(48px, auto) 28px !important;
    column-gap: 6px !important;
    row-gap: 4px !important;
    align-items: end !important;
    width: calc(100% - 16px) !important;
    margin: 0 8px max(8px, env(safe-area-inset-bottom)) !important;
    padding: 6px 8px 6px 10px !important;
    border: 1px solid var(--mq-chat-line) !important;
    border-radius: 18px !important;
    background: var(--mq-chat-input) !important;
    box-shadow: 0 12px 30px rgba(17, 17, 17, 0.08) !important;
  }

  .composer-editor {
    grid-column: 1;
    grid-row: 1;
    width: 100% !important;
    min-height: 50px !important;
    height: auto !important;
    max-height: 132px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 9px 6px 5px 0 !important;
    box-shadow: none !important;
  }

  .attach-button,
  .format-button,
  .paste-button,
  .emoji-button {
    grid-row: 2 !important;
    width: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    height: 26px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: color-mix(in srgb, var(--mq-chat-text) 64%, transparent) !important;
    padding: 0 !important;
  }

  .attach-button {
    grid-column: 1 !important;
    justify-self: start !important;
    font-size: 17px !important;
  }

  .format-button {
    grid-column: 1 !important;
    justify-self: start !important;
    margin-left: 28px !important;
    font-size: 12px !important;
  }

  .paste-button {
    grid-column: 1 !important;
    justify-self: start !important;
    margin-left: 56px !important;
    font-size: 12px !important;
  }

  .emoji-button {
    grid-column: 1 !important;
    justify-self: start !important;
    margin-left: 84px !important;
    font-size: 14px !important;
  }

  .composer button[type="submit"] {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: end !important;
    width: 42px !important;
    min-width: 42px !important;
    min-height: 36px !important;
    height: 36px !important;
    border-radius: 14px !important;
    padding: 0 !important;
    font-size: 11px !important;
  }

  .composer-command-suggest,
  .format-toolbar,
  .paste-toolbar,
  .list-toolbar,
  .emoji-picker,
  .link-popover {
    left: 8px !important;
    right: 8px !important;
    bottom: calc(100% + 8px) !important;
    width: auto !important;
    max-width: none !important;
  }
}

@media (max-width: 390px) {
  .composer {
    grid-template-columns: minmax(0, 1fr) 40px !important;
  }

  .composer button[type="submit"] {
    width: 40px !important;
    min-width: 40px !important;
  }
}

/* Final presenter footer docking */
.call-surface .call-screen-presenter-card {
  position: absolute !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) 30px !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}

.call-surface .call-screen-presenter-card > video {
  inset: 0 !important;
  z-index: 0 !important;
}

.call-surface .call-screen-presenter-avatar {
  position: relative !important;
  z-index: 1 !important;
  align-self: center !important;
  justify-self: center !important;
  margin-bottom: 22px !important;
}

.call-surface .call-screen-presenter-meta {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 3 !important;
  width: 100% !important;
  min-height: 30px !important;
  height: 30px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 28px !important;
  align-items: center !important;
  gap: 6px !important;
  border-radius: 0 0 12px 12px !important;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.82)) !important;
  padding: 0 7px 0 10px !important;
}

.call-surface .call-screen-presenter-meta strong {
  align-self: center !important;
  min-width: 0 !important;
  line-height: 30px !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state {
  align-self: center !important;
  justify-self: end !important;
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
}

.call-surface .call-screen-presenter-card.has-video .call-screen-presenter-meta {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.82)) !important;
}

/* Final call mic badge alignment owner */
.call-surface .call-mic-state,
.call-surface .call-video-identity .call-mic-state,
.call-surface .call-screen-presenter-meta .call-mic-state,
.call-surface .call-audio-tile > .call-mic-state,
.call-surface .call-mini-preview > .call-mic-state {
  box-sizing: border-box !important;
  display: inline-grid !important;
  place-items: center !important;
  align-items: center !important;
  justify-items: center !important;
  line-height: 0 !important;
  padding: 0 !important;
}

.call-surface .call-mic-state svg,
.call-surface .call-video-identity .call-mic-state svg,
.call-surface .call-screen-presenter-meta .call-mic-state svg,
.call-surface .call-audio-tile > .call-mic-state svg,
.call-surface .call-mini-preview > .call-mic-state svg {
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  transform: translateY(0) !important;
}

.call-surface .call-screen-presenter-meta {
  grid-template-columns: minmax(0, 1fr) 24px !important;
  padding-right: 7px !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  justify-self: end !important;
}

/* Fullscreen screen share: show screen + presenter only, auto-hide controls */
.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured),
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-video-tile:not(.call-video-featured) {
  display: none !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-controls,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-controls {
  opacity: 1 !important;
  pointer-events: auto !important;
  transition:
    opacity 180ms ease,
    transform 180ms ease !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-controls,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-controls {
  opacity: 0 !important;
  pointer-events: none !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-video-tile:not(.call-video-featured),
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-video-tile:not(.call-video-featured) {
  display: none !important;
}

.call-surface .call-add-panel {
  z-index: 45 !important;
}

.call-surface .call-add-form {
  display: grid !important;
}

/* Final presenter card visual polish */
.call-surface .call-screen-presenter-card {
  right: 14px !important;
  bottom: 14px !important;
  width: clamp(168px, 12vw, 210px) !important;
  aspect-ratio: 16 / 9 !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) 34px !important;
  place-items: stretch !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(20, 21, 27, 0.98), rgba(12, 13, 18, 0.98)) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
}

.call-surface .call-screen-presenter-card > video {
  z-index: 0 !important;
}

.call-surface .call-screen-presenter-avatar {
  align-self: center !important;
  justify-self: center !important;
  width: 54px !important;
  height: 54px !important;
  font-size: 20px !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2) !important;
}

.call-surface .call-screen-presenter-card.has-video .call-screen-presenter-meta {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.86)) !important;
}

.call-surface .call-screen-presenter-meta {
  position: static !important;
  z-index: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 34px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 22px !important;
  align-items: center !important;
  gap: 7px !important;
  align-self: end !important;
  border-radius: 0 !important;
  background: rgba(15, 23, 42, 0.92) !important;
  padding: 0 8px 0 10px !important;
}

.call-surface .call-screen-presenter-meta strong {
  min-width: 0 !important;
  overflow: hidden !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state {
  width: 22px !important;
  height: 22px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: rgba(34, 197, 94, 0.16) !important;
  color: #22c55e !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state.is-muted {
  background: rgba(248, 113, 113, 0.16) !important;
  color: #f87171 !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state svg {
  width: 12px !important;
  height: 12px !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-screen-presenter-card,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-screen-presenter-card {
  width: clamp(176px, 12vw, 220px) !important;
}

@media (max-width: 720px) {
  .call-surface .call-screen-presenter-card {
    width: clamp(148px, 42vw, 178px) !important;
  }
}

/* Enterprise compact add-participant popover */
.call-surface .call-add-panel {
  top: 86px !important;
  right: 24px !important;
  z-index: 60 !important;
  width: min(340px, calc(100vw - 32px)) !important;
  max-height: min(420px, calc(100vh - 128px)) !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  border: 1px solid rgba(17, 24, 39, 0.12) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.18) !important;
}

.call-surface .call-add-head {
  min-height: 48px !important;
  gap: 10px !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  padding: 9px 10px 8px 12px !important;
}

.call-surface .call-add-head > div {
  gap: 1px !important;
}

.call-surface .call-add-head strong {
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
}

.call-surface .call-add-head span {
  color: #6b7280 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}

.call-surface .call-add-head button {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  background: #f9fafb !important;
  color: #111827 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 0 !important;
}

.call-surface .call-add-form {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #f9fafb !important;
  padding: 8px 10px !important;
}

.call-surface .call-add-form input {
  min-height: 34px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #111827 !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

.call-surface .call-add-form button {
  min-height: 34px !important;
  border-radius: 8px !important;
  background: #f5c400 !important;
  color: #0a0a0a !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  padding: 0 12px !important;
}

.call-surface .call-add-results {
  gap: 6px !important;
  background: #ffffff !important;
  padding: 8px !important;
}

.call-surface .call-add-empty {
  border: 1px dashed #d1d5db !important;
  border-radius: 8px !important;
  color: #6b7280 !important;
  padding: 12px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.call-surface .call-add-result {
  min-height: 46px !important;
  gap: 8px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #111827 !important;
  padding: 6px 8px !important;
}

.call-surface .call-add-result:hover {
  border-color: #f5c400 !important;
  background: #fff8d8 !important;
}

.call-surface .call-add-avatar {
  width: 30px !important;
  height: 30px !important;
  flex-basis: 30px !important;
  font-size: 11px !important;
}

.call-surface .call-add-result span:last-child {
  gap: 1px !important;
}

.call-surface .call-add-result strong {
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.call-surface .call-add-result small {
  color: #6b7280 !important;
  font-size: 11px !important;
}

@media (max-width: 720px) {
  .call-surface .call-add-panel {
    top: 74px !important;
    right: 10px !important;
    width: calc(100vw - 20px) !important;
    max-height: min(420px, calc(100vh - 96px)) !important;
  }
}

/* Keep screen-share fullscreen control clear of the presenter overlay */
.call-surface .call-video-screen.call-video-featured > .call-tile-action,
.call-surface .call-video-featured[data-screen-source] > .call-tile-action {
  top: 14px !important;
  right: 14px !important;
  bottom: auto !important;
  z-index: 30 !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid rgba(255, 255, 255, 0.52) !important;
  border-radius: 12px !important;
  background: rgba(17, 24, 39, 0.82) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24) !important;
}

.call-surface .call-video-screen.call-video-featured > .call-tile-action:hover,
.call-surface .call-video-featured[data-screen-source] > .call-tile-action:hover {
  background: #f5c400 !important;
  border-color: #f5c400 !important;
  color: #0a0a0a !important;
}

.call-surface .call-video-screen.call-video-featured > .call-tile-action svg,
.call-surface .call-video-featured[data-screen-source] > .call-tile-action svg {
  width: 20px !important;
  height: 20px !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-video-featured > .call-tile-action,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-video-featured > .call-tile-action {
  position: fixed !important;
  top: 18px !important;
  right: 18px !important;
  z-index: 32 !important;
}

/* Teams-style screen-share presenter overlay */
.call-surface .call-video-screen.call-video-featured {
  overflow: hidden !important;
}

.call-surface .call-video-screen.call-video-featured > .call-video-identity {
  display: none !important;
}

.call-surface .call-screen-presenter-card {
  position: absolute !important;
  right: 16px !important;
  bottom: 16px !important;
  z-index: 8 !important;
  width: clamp(148px, 15vw, 230px) !important;
  aspect-ratio: 16 / 10 !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.34) !important;
  border-radius: 14px !important;
  background: #15161b !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24) !important;
}

.call-surface .call-screen-presenter-card > video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transform: scaleX(-1) !important;
}

.call-surface .call-screen-presenter-avatar {
  width: 64px !important;
  height: 64px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  background: #f5c400 !important;
  color: #0a0a0a !important;
  font-size: 22px !important;
  font-weight: 900 !important;
}

.call-surface .call-screen-presenter-meta {
  position: absolute !important;
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;
  z-index: 2 !important;
  min-height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: rgba(17, 24, 39, 0.78) !important;
  color: #ffffff !important;
  padding: 4px 6px 4px 10px !important;
  backdrop-filter: none !important;
}

.call-surface .call-screen-presenter-meta strong {
  min-width: 0 !important;
  overflow: hidden !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state {
  position: static !important;
  flex: 0 0 auto !important;
  width: 22px !important;
  height: 22px !important;
  border: 0 !important;
  background: rgba(255, 255, 255, 0.18) !important;
  color: #22c55e !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state.is-muted {
  color: #f87171 !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state svg {
  width: 12px !important;
  height: 12px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-grid:not(:has(.call-video-tile:not(.call-video-featured))) {
  grid-template-columns: minmax(0, 1fr) !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-screen-presenter-card,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-screen-presenter-card {
  position: fixed !important;
  right: 20px !important;
  bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  z-index: 26 !important;
  width: clamp(168px, 16vw, 260px) !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-screen-presenter-card,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen.is-call-ui-idle .call-screen-presenter-card {
  opacity: 0.12 !important;
}

@media (max-width: 720px) {
  .call-surface .call-screen-presenter-card {
    right: 10px !important;
    bottom: 10px !important;
    width: clamp(118px, 34vw, 154px) !important;
    border-radius: 12px !important;
  }

  .call-surface .call-screen-presenter-meta strong {
    font-size: 10px !important;
  }
}

/* Presenter overlay refinement: compact enough to avoid blocking shared content */
.call-surface .call-screen-presenter-card {
  right: 12px !important;
  bottom: 12px !important;
  width: clamp(124px, 10vw, 164px) !important;
  aspect-ratio: 16 / 10 !important;
  border-color: rgba(255, 255, 255, 0.38) !important;
  border-radius: 12px !important;
  background: rgba(18, 19, 24, 0.94) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22) !important;
}

.call-surface .call-screen-presenter-avatar {
  width: 50px !important;
  height: 50px !important;
  font-size: 19px !important;
}

.call-surface .call-screen-presenter-meta {
  left: 6px !important;
  right: 6px !important;
  bottom: 6px !important;
  min-height: 24px !important;
  gap: 5px !important;
  padding: 3px 4px 3px 8px !important;
  background: rgba(15, 23, 42, 0.86) !important;
}

.call-surface .call-screen-presenter-meta strong {
  font-size: 10px !important;
  font-weight: 850 !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state {
  width: 18px !important;
  height: 18px !important;
}

.call-surface .call-screen-presenter-meta .call-mic-state svg {
  width: 10px !important;
  height: 10px !important;
}

.call-surface:fullscreen .call-panel.is-screen-fullscreen .call-screen-presenter-card,
.call-surface:-webkit-full-screen .call-panel.is-screen-fullscreen .call-screen-presenter-card {
  right: 18px !important;
  bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  width: clamp(136px, 11vw, 184px) !important;
}

@media (max-width: 720px) {
  .call-surface .call-screen-presenter-card {
    right: 8px !important;
    bottom: 8px !important;
    width: clamp(108px, 30vw, 136px) !important;
  }

  .call-surface .call-screen-presenter-avatar {
    width: 42px !important;
    height: 42px !important;
    font-size: 16px !important;
  }
}

.call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-title {
  min-width: 0 !important;
  max-width: 420px !important;
}

.call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-window-actions {
  justify-self: end !important;
  grid-column: 3 !important;
}

.call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-controls {
  position: absolute !important;
  top: 16px !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 18 !important;
  width: auto !important;
  max-width: min(calc(100vw - 420px), 520px) !important;
  display: inline-flex !important;
  grid-template-columns: none !important;
  justify-content: center !important;
  gap: 8px !important;
  border: 1px solid rgba(17, 24, 39, 0.08) !important;
  border-radius: 999px !important;
  background: #202127 !important;
  padding: 8px !important;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.18) !important;
  transform: translateX(-50%) !important;
}

.call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-control-button {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
}

.call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-control-button.call-end-control {
  width: 46px !important;
  min-width: 46px !important;
}

.call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-stage-body {
  padding-top: 26px !important;
}

.call-surface .call-video-placeholder:not(.call-mini-preview) {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 14px !important;
  padding: 24px 18px 20px !important;
}

.call-surface .call-video-placeholder:not(.call-mini-preview) > span {
  display: none !important;
}

.call-surface .call-video-placeholder:not(.call-mini-preview) > .call-participant-avatar {
  position: static !important;
  align-self: end !important;
  justify-self: center !important;
  width: clamp(78px, 30%, 128px) !important;
  height: clamp(78px, 30%, 128px) !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #f5c400 !important;
  color: #0a0a0a !important;
  font-size: clamp(24px, 5vw, 38px) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  transform: none !important;
  box-shadow: none !important;
}

.call-surface .call-video-placeholder:not(.call-mini-preview) > .call-participant-name {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  align-self: start !important;
  justify-self: center !important;
  width: auto !important;
  max-width: min(100%, 260px) !important;
  min-height: 30px !important;
  margin: 0 !important;
  justify-content: center !important;
  padding: 0 14px !important;
  transform: none !important;
}

.call-surface .call-video-placeholder:not(.call-mini-preview) > .call-mic-state {
  top: 14px !important;
  right: 14px !important;
  bottom: auto !important;
}

@media (max-width: 980px) {
  .call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-head {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 150px !important;
    padding: 16px 18px 12px !important;
  }

  .call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-window-actions {
    grid-column: 2 !important;
  }

  .call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-controls {
    top: 78px !important;
    max-width: calc(100vw - 36px) !important;
  }
}

@media (max-width: 560px) {
  .call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-controls {
    gap: 7px !important;
    padding: 7px !important;
  }

  .call-surface .call-panel:not(.is-call-minimized):not(.is-screen-fullscreen) .call-control-button {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }
}

/* Final screen-share space compactor */
.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) {
  grid-template-rows: 74px minmax(0, 1fr) !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-head {
  height: 74px !important;
  min-height: 74px !important;
  padding: 8px 28px !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-controls {
  top: 8px !important;
}

.call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-stage-body {
  height: 100% !important;
  gap: 12px !important;
  padding: 10px 24px 14px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-stage-body {
  padding-top: 8px !important;
  padding-bottom: 10px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-grid {
  height: 100% !important;
  grid-template-columns: minmax(0, 1fr) clamp(128px, 12vw, 190px) !important;
  grid-template-rows: repeat(4, minmax(72px, 1fr)) !important;
  gap: 12px !important;
}

.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-featured,
.call-surface .call-panel.call-panel-stage.is-screen-share:not(.is-call-minimized):not(.is-screen-fullscreen) .call-video-featured > video {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 980px) {
  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) {
    grid-template-rows: 118px minmax(0, 1fr) !important;
  }

  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-panel-head {
    height: 118px !important;
    min-height: 118px !important;
    padding: 12px 18px !important;
  }

  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-controls {
    top: 64px !important;
  }

  .call-surface .call-panel.call-panel-stage:not(.is-call-minimized):not(.is-screen-fullscreen) .call-stage-body {
    padding: 8px 14px 10px !important;
  }
}
