/* Hoteliers Chat — app shell.
   Shared, class for class, with the self-hosted build's app/chat/chat.module.css
   so the two look identical; keep them in sync. Both themes are defined, and the
   installed desktop app follows the OS setting. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.root,
.signInPage {
  --chat-bg: #ffffff;
  --chat-panel: #f6f7f9;
  --chat-border: #e3e6ea;
  --chat-text: #16181d;
  --chat-muted: #6b7280;
  --chat-accent: #2563eb;
  --chat-accent-soft: #e8efff;
  --chat-sidebar: #111827;
  --chat-sidebar-text: #d5dae3;
  --chat-sidebar-muted: #8b93a3;
  --chat-sidebar-active: #1f2b45;
  --chat-danger: #dc2626;
  --chat-online: #22c55e;
  --chat-radius: 10px;

  position: fixed;
  inset: 0;
  display: flex;
  color: var(--chat-text);
  background: var(--chat-bg);
  font-size: 15px;
}

@media (prefers-color-scheme: dark) {
  .root,
  .signInPage {
    --chat-bg: #12141a;
    --chat-panel: #171a21;
    --chat-border: #262b36;
    --chat-text: #e7e9ee;
    --chat-muted: #98a0b0;
    --chat-accent: #6ea8fe;
    --chat-accent-soft: #1c2c4a;
    --chat-sidebar: #0b0e15;
    --chat-sidebar-text: #ccd2de;
    --chat-sidebar-muted: #78808f;
    --chat-sidebar-active: #1b2436;
  }
}

.shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  width: 100%;
  height: 100%;
  /* Room for the window controls when the installed app uses an overlay title bar. */
  padding-top: env(titlebar-area-height, 0px);
}

/* ---------- sidebar ---------- */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--chat-sidebar);
  color: var(--chat-sidebar-text);
}

.workspace {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgb(255 255 255 / 0.07);
}

.workspace h1 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: #fff;
}

.workspace p {
  font-size: 0.72rem;
  color: var(--chat-sidebar-muted);
  margin-top: 2px;
}

.connection {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b45309;
  flex: none;
  margin-top: 6px;
}

.connectionLive {
  background: var(--chat-online);
}

.searchBox {
  padding: 12px 12px 4px;
}

.searchBox input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.06);
  color: inherit;
  font-size: 0.85rem;
}

.searchBox input::placeholder {
  color: var(--chat-sidebar-muted);
}

.channelNav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 16px;
}

.channelNav section {
  margin-top: 14px;
}

.channelNav h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--chat-sidebar-muted);
  padding: 0 8px 6px;
}

.channelNav h2 button {
  background: none;
  border: 0;
  color: var(--chat-sidebar-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
}

.channelNav h2 button:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.1);
}

.channelNav ul {
  list-style: none;
}

.channelButton {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  text-align: left;
  font-size: 0.9rem;
}

.channelButton:hover {
  background: rgb(255 255 255 / 0.07);
}

.channelActive,
.channelActive:hover {
  background: var(--chat-sidebar-active);
  color: #fff;
  font-weight: 600;
}

.channelUnjoined {
  color: var(--chat-sidebar-muted);
}

.hash {
  color: var(--chat-sidebar-muted);
}

.channelName {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: none;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--chat-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.presence {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  border: 1.5px solid var(--chat-sidebar-muted);
}

.presenceOnline {
  background: var(--chat-online);
  border-color: var(--chat-online);
}

/* Sub-groups hang off their parent with a hairline to show the relationship. */
.subGroup {
  margin: 2px 0 2px 14px;
  padding-left: 8px;
  border-left: 1px solid rgb(255 255 255 / 0.1);
}

.newChannel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.06);
}

.newChannelToggles label,
.memberPicker label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--chat-sidebar-text);
  line-height: 1.35;
}

.newChannelField {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chat-sidebar-muted);
}

.newChannelField select,
.cornerSelect {
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(0 0 0 / 0.25);
  color: var(--chat-sidebar-text);
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: normal;
}

.memberPicker {
  border-top: 1px solid rgb(255 255 255 / 0.1);
  padding-top: 6px;
}

.memberPicker p {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chat-sidebar-muted);
  margin-bottom: 4px;
}

.memberPicker ul {
  list-style: none;
  max-height: 132px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.newChannel input {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(0 0 0 / 0.2);
  color: inherit;
  font-size: 0.85rem;
}

.newChannel div {
  display: flex;
  gap: 6px;
}

.newChannel button {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 0;
  font-size: 0.8rem;
  background: rgb(255 255 255 / 0.12);
  color: inherit;
}

.newChannel button[type="submit"] {
  background: var(--chat-accent);
  color: #fff;
}

.sidebarFooter {
  border-top: 1px solid rgb(255 255 255 / 0.07);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meRow strong {
  display: block;
  font-size: 0.85rem;
  color: #fff;
}

.meRow span {
  font-size: 0.72rem;
  color: var(--chat-sidebar-muted);
}

.footerActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.homeLink {
  font-size: 0.72rem;
  color: var(--chat-sidebar-muted);
}

.homeLink:hover {
  color: #fff;
}

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

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--chat-bg);
}

.mainHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--chat-border);
}

.mainTitle {
  flex: 1;
  min-width: 0;
}

.mainTitle h2 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mainTitle p {
  font-size: 0.78rem;
  color: var(--chat-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navToggle {
  display: none;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.1rem;
}

.joinButton {
  border: 1px solid var(--chat-border);
  background: var(--chat-panel);
  color: inherit;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.joinButton:hover {
  border-color: var(--chat-accent);
  color: var(--chat-accent);
}

.headerActions {
  display: flex;
  gap: 6px;
  flex: none;
}

/* ---------- members ---------- */

.memberPanel {
  border-bottom: 1px solid var(--chat-border);
  background: var(--chat-panel);
  padding: 10px 20px 12px;
  max-height: 260px;
  overflow-y: auto;
}

.memberPanel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.memberPanel header button {
  border: 0;
  background: none;
  color: var(--chat-muted);
  font-size: 1.1rem;
  line-height: 1;
}

.memberPanel ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.memberPanel li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.memberPanel li button {
  margin-left: auto;
  border: 1px solid var(--chat-border);
  background: var(--chat-bg);
  color: var(--chat-muted);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
}

.memberPanel li button:hover {
  border-color: var(--chat-accent);
  color: var(--chat-accent);
}

.memberPanelHint {
  margin: 10px 0 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chat-muted);
}

.avatarSmall {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  flex: none;
}

.error {
  margin: 10px 20px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--chat-danger) 12%, transparent);
  color: var(--chat-danger);
  font-size: 0.85rem;
}

.scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 16px;
  /* Column + auto margin keeps a short conversation resting on the composer
     rather than floating at the top of an empty pane. */
  display: flex;
  flex-direction: column;
}

.placeholder {
  color: var(--chat-muted);
  padding: 32px 20px;
  font-size: 0.9rem;
}

/* ---------- messages ---------- */

.messages {
  display: flex;
  flex-direction: column;
  margin-top: auto;
}

.loadMore {
  display: flex;
  justify-content: center;
  padding: 8px;
}

.loadMore button {
  border: 1px solid var(--chat-border);
  background: var(--chat-panel);
  color: var(--chat-muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.78rem;
}

.daySeparator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 20px 8px;
  color: var(--chat-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.daySeparator::before,
.daySeparator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--chat-border);
}

.message {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  padding: 5px 20px 5px 12px;
}

.message:hover {
  background: var(--chat-panel);
}

.messageGrouped {
  padding-top: 1px;
  padding-bottom: 1px;
}

.messageMention {
  background: color-mix(in srgb, var(--chat-accent) 8%, transparent);
  box-shadow: inset 3px 0 0 var(--chat-accent);
}

.messageHighlight {
  animation: flash 2.4s ease-out;
}

@keyframes flash {
  from {
    background: color-mix(in srgb, var(--chat-accent) 22%, transparent);
  }
  to {
    background: transparent;
  }
}

.messageGutter {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
}

.hoverTime {
  font-size: 0.66rem;
  color: var(--chat-muted);
  opacity: 0;
  padding-top: 4px;
}

.message:hover .hoverTime {
  opacity: 1;
}

.messageBody {
  min-width: 0;
}

.messageHeader {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.authorName {
  font-weight: 700;
  font-size: 0.92rem;
}

.authorTitle {
  font-size: 0.72rem;
  color: var(--chat-muted);
  border: 1px solid var(--chat-border);
  border-radius: 4px;
  padding: 0 4px;
}

.messageHeader time {
  font-size: 0.7rem;
  color: var(--chat-muted);
}

.text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.text a {
  color: var(--chat-accent);
  text-decoration: underline;
}

.edited,
.deleted {
  color: var(--chat-muted);
  font-size: 0.75rem;
}

.deleted {
  font-style: italic;
}

.mention {
  background: var(--chat-accent-soft);
  color: var(--chat-accent);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 600;
}

.mentionMe {
  background: var(--chat-accent);
  color: #fff;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--chat-panel);
  border: 1px solid var(--chat-border);
  border-radius: 4px;
  padding: 0 4px;
}

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.reaction {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--chat-border);
  background: var(--chat-panel);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.78rem;
  color: var(--chat-muted);
}

.reactionMine {
  border-color: var(--chat-accent);
  background: var(--chat-accent-soft);
  color: var(--chat-accent);
}

.messageActions {
  position: absolute;
  top: -10px;
  right: 16px;
  display: none;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  background: var(--chat-bg);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
}

.message:hover .messageActions,
.message:focus-within .messageActions {
  display: flex;
}

.messageActions button {
  border: 0;
  background: none;
  color: var(--chat-muted);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 0.8rem;
}

.messageActions button:hover {
  background: var(--chat-panel);
  color: var(--chat-text);
}

.editForm {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0;
}

.editForm textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--chat-accent);
  background: var(--chat-bg);
  resize: vertical;
}

.editActions {
  display: flex;
  gap: 6px;
}

.editActions button {
  border: 1px solid var(--chat-border);
  background: var(--chat-panel);
  color: inherit;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.8rem;
}

.editActions button[type="submit"] {
  background: var(--chat-accent);
  border-color: var(--chat-accent);
  color: #fff;
}

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

.composerArea {
  padding: 0 20px 16px;
}

.typing {
  height: 18px;
  font-size: 0.75rem;
  color: var(--chat-muted);
}

.composerWrap {
  position: relative;
}

.composerDropping .composer {
  border-color: var(--chat-accent);
  border-style: dashed;
  background: var(--chat-accent-soft);
}

/* ---------- attachments ---------- */

.attachments {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.imageAttachment img {
  max-width: min(320px, 100%);
  max-height: 240px;
  border-radius: 10px;
  border: 1px solid var(--chat-border);
  display: block;
}

.fileAttachment {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  background: var(--chat-panel);
  padding: 8px 12px;
  max-width: 320px;
}

.fileAttachment:hover {
  border-color: var(--chat-accent);
}

.fileIcon {
  font-size: 1.2rem;
}

.fileMeta {
  min-width: 0;
}

.fileMeta strong {
  display: block;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fileMeta span {
  font-size: 0.72rem;
  color: var(--chat-muted);
}

.pendingFiles {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.pendingFiles li {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--chat-border);
  border-radius: 999px;
  background: var(--chat-panel);
  padding: 3px 6px 3px 10px;
  font-size: 0.76rem;
  max-width: 260px;
}

.pendingFailed {
  border-color: var(--chat-danger);
  color: var(--chat-danger);
}

.pendingName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pendingMeta {
  color: var(--chat-muted);
  font-size: 0.7rem;
  flex: none;
}

.pendingFiles li button {
  border: 0;
  background: none;
  color: var(--chat-muted);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 2px;
}

/* Beats `.composer button`, which paints every button in the form accent-blue. */
.composer .attachButton {
  border: 0;
  background: none;
  font-size: 1.05rem;
  line-height: 1;
  padding: 8px 4px;
  opacity: 0.7;
}

.composer .attachButton:hover:not(:disabled) {
  opacity: 1;
}

/* ---------- cube launcher ---------- */

.cubeLauncher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cubeLauncher > button {
  flex: 1 1 auto;
}

.cubeLauncher > select {
  flex: 0 0 auto;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius);
  background: var(--chat-bg);
  padding: 8px;
}

.composer:focus-within {
  border-color: var(--chat-accent);
}

.composer textarea {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  background: none;
  padding: 4px;
  max-height: 220px;
  line-height: 1.5;
}

.composer button {
  border: 0;
  border-radius: 8px;
  background: var(--chat-accent);
  color: #fff;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
}

.composer button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.composerHint {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--chat-muted);
}

.mentionMenu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  list-style: none;
  min-width: 240px;
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius);
  background: var(--chat-bg);
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.16);
  overflow: hidden;
  z-index: 5;
}

.mentionMenu button {
  display: flex;
  gap: 8px;
  align-items: baseline;
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  padding: 7px 12px;
  text-align: left;
  font-size: 0.85rem;
}

.mentionMenu span {
  color: var(--chat-muted);
  font-size: 0.78rem;
}

.mentionActive,
.mentionMenu button:hover {
  background: var(--chat-accent-soft);
}

/* ---------- search results ---------- */

.searchResults {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
}

.searchResults h3 {
  font-size: 0.85rem;
  color: var(--chat-muted);
  font-weight: 600;
}

.searchResults button {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius);
  background: var(--chat-panel);
  color: inherit;
  padding: 10px 12px;
}

.searchResults button:hover {
  border-color: var(--chat-accent);
}

.searchMeta {
  font-size: 0.72rem;
  color: var(--chat-muted);
}

.searchBody {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* ---------- install / notifications ---------- */

.installWrap {
  position: relative;
}

.install {
  border: 0;
  border-radius: 8px;
  background: var(--chat-accent);
  color: #fff;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.85rem;
}

.installCompact {
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 6px;
  background: rgb(255 255 255 / 0.06);
  color: inherit;
  padding: 4px 10px;
  font-size: 0.72rem;
}

.installCompact:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.14);
}

.installCompact:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.installHelp {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 280px;
  padding: 12px;
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius);
  background: var(--chat-bg);
  color: var(--chat-text);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.2);
  font-size: 0.8rem;
  z-index: 10;
}

.installHelp p {
  margin-bottom: 8px;
}

.installHelp button {
  border: 1px solid var(--chat-border);
  border-radius: 6px;
  background: var(--chat-panel);
  color: inherit;
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* ---------- calls ---------- */

.callRing,
.callPanel {
  position: fixed;
  right: 20px;
  top: 76px;
  z-index: 40;
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius);
  background: var(--chat-bg);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.28);
}

.callRing {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}

.callRing strong {
  display: block;
  font-size: 0.95rem;
}

.callRing span {
  font-size: 0.8rem;
  color: var(--chat-muted);
}

.callRingButtons {
  display: flex;
  gap: 6px;
}

.callRing button,
.callControls button {
  border: 1px solid var(--chat-border);
  background: var(--chat-panel);
  color: inherit;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.8rem;
}

.callAnswer {
  background: var(--chat-accent) !important;
  border-color: var(--chat-accent) !important;
  color: #fff !important;
  font-weight: 600;
}

.callEnd {
  background: var(--chat-danger) !important;
  border-color: var(--chat-danger) !important;
  color: #fff !important;
  font-weight: 600;
}

.callPanel {
  width: min(380px, calc(100vw - 40px));
  overflow: hidden;
}

.callPanel header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--chat-border);
}

.callPanel header span {
  font-size: 0.78rem;
  color: var(--chat-muted);
  font-variant-numeric: tabular-nums;
}

/* Black behind video, so letterboxing looks deliberate. */
.callStage {
  position: relative;
  background: #0b0e15;
  min-height: 76px;
}

.callStage video {
  display: block;
  width: 100%;
  max-height: 260px;
  background: #0b0e15;
}

/* The local preview sits in the corner of the remote one, as it should. */
#callLocalVideo {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 96px;
  max-height: 72px;
  border-radius: 6px;
  border: 1px solid rgb(255 255 255 / 0.25);
}

.callControls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
}

.callControls .callOff {
  border-color: var(--chat-accent);
  color: var(--chat-accent);
}

/* ---------- settings ---------- */

/* Settings has more to say than the member list, so it gets more room than
   .memberPanel's cap allows. */
#settingsPanel {
  max-height: min(60vh, 560px);
}

#settingsPanel > p + p {
  margin-bottom: 4px;
}

.settingsForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.settingsWho {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settingsWho strong {
  display: block;
  font-size: 0.85rem;
}

.settingsWho span {
  font-size: 0.75rem;
  color: var(--chat-muted);
}

.settingsForm label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chat-muted);
  max-width: 340px;
}

.settingsForm input {
  padding: 8px 10px;
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  background: var(--chat-bg);
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--chat-text);
}

.settingsActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settingsActions button {
  border: 0;
  border-radius: 8px;
  background: var(--chat-accent);
  color: #fff;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
}

.settingsSaved {
  font-size: 0.78rem;
  color: var(--chat-online, #16a34a);
}

.settingsToggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 460px;
  font-size: 0.82rem;
}

.settingsToggle strong {
  display: block;
  font-size: 0.85rem;
}

.settingsToggle span {
  color: var(--chat-muted);
  line-height: 1.45;
}

.settingsNote {
  font-size: 0.82rem;
  color: var(--chat-muted);
  max-width: 460px;
  line-height: 1.5;
}

/* ---------- the install gate ---------- */

.gateHow {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--chat-muted);
}

.gateHow p {
  margin-bottom: 8px;
}

.gateHow ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 2px solid var(--chat-border);
  padding-left: 12px;
}

.gateHow strong {
  color: var(--chat-text);
}

.installWrap .primaryButton {
  width: 100%;
}

.installWrap .primaryButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.signInPage {
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: radial-gradient(
    120% 120% at 50% 0%,
    color-mix(in srgb, var(--chat-accent) 12%, var(--chat-bg)),
    var(--chat-bg)
  );
}

.signInCard {
  width: min(400px, 100%);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  background: var(--chat-bg);
  padding: 28px;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.14);
}

.brandMark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: url("/icon-192.png") center / cover no-repeat;
}

.signInCard h1 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.signInLede {
  color: var(--chat-muted);
  font-size: 0.88rem;
  margin: 6px 0 20px;
}

.signInForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.signInForm label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.labelRow {
  display: flex;
  gap: 4px;
  align-items: baseline;
}

.signInForm label span span {
  font-weight: 400;
  color: var(--chat-muted);
}

.signInForm input {
  padding: 10px 12px;
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  background: var(--chat-panel);
  font-weight: 400;
  font-size: 0.9rem;
}

.signInForm input:focus {
  outline: 2px solid var(--chat-accent);
  outline-offset: -1px;
}

.primaryButton {
  border: 0;
  border-radius: 8px;
  background: var(--chat-accent);
  color: #fff;
  padding: 11px 16px;
  font-weight: 600;
  margin-top: 4px;
}

.primaryButton:disabled {
  opacity: 0.6;
}

.switchMode {
  margin-top: 16px;
  font-size: 0.83rem;
  color: var(--chat-muted);
}

.switchMode button {
  border: 0;
  background: none;
  color: var(--chat-accent);
  font-weight: 600;
  text-decoration: underline;
}

.domainNote {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--chat-muted);
}

.signInFooter {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--chat-border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.signInFooter p {
  font-size: 0.75rem;
  color: var(--chat-muted);
}

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

.skeletonList {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 16px;
}

.skeletonLine {
  height: 10px;
  border-radius: 5px;
  background: rgb(255 255 255 / 0.07);
  animation: pulse 1.6s ease-in-out infinite;
}

.skeletonLine:nth-child(even) {
  width: 70%;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

/* ---------- narrow windows ---------- */

@media (max-width: 720px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    z-index: 20;
    box-shadow: 0 0 40px rgb(0 0 0 / 0.35);
  }

  .shellNavOpen .sidebar {
    transform: none;
  }

  .navToggle {
    display: block;
  }

  .message {
    grid-template-columns: 36px 1fr;
    padding-right: 12px;
  }
}
