:root {
  color-scheme: dark;
  --bg: #14161f;
  --deep: #0f1118;
  --ink: #c5cce0;
  --bright: #e8ecf6;
  --muted: #8b95b4;
  --rule: #262c3d;
  --blue: #a2cafe;
  --leaf: #9fd6b8;
  font:
    15px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button,
input,
textarea,
select {
  outline: none;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
button {
  border: 0;
}
input,
textarea,
select {
  color: var(--ink);
  border: 1px solid var(--rule);
  background: var(--deep);
  border-radius: 10px;
  padding: 12px 14px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
.primary {
  background: var(--blue);
  color: var(--deep);
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
}
.plain {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
}
.plain:hover,
.icon:hover {
  color: var(--bright);
  background: #202637;
}
.icon {
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}
.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
}
.auth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(340px, calc(100vw - 48px));
  text-align: center;
}
.auth-card .mark {
  font-size: 44px;
  color: var(--blue);
}
.boot-mark {
  display: none;
}
.booting .auth-card > * {
  display: none;
}
.booting .auth-card > .mark {
  display: block;
  font-size: 56px;
}
.booting .mark .speak-mark {
  display: none;
}
.booting .mark .boot-mark {
  display: block;
  width: 1em;
  height: 1em;
  margin-inline: auto;
  color: var(--blue);
  opacity: 0;
  animation: placeholder-in 0.4s ease-out 0.25s forwards;
}
.boot-mark .track {
  opacity: 0.18;
}
.boot-mark .trace {
  stroke-dasharray: 0.3 1;
  animation: trace 1.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}
.boot-mark .tail {
  animation: tail 1.5s ease-in-out infinite;
}
@keyframes trace {
  from {
    stroke-dashoffset: 0.3;
  }
  to {
    stroke-dashoffset: -1;
  }
}
@keyframes tail {
  0%,
  55% {
    opacity: 0.18;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0.18;
  }
}
.auth-card h1 {
  font-size: 26px;
  margin-bottom: 18px;
  color: var(--bright);
}
.auth-card input {
  text-align: left;
}
.auth-card .plain {
  padding: 3px;
}
.error {
  color: #f1adb4;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.workspace {
  height: var(--app-height, 100dvh);
  display: grid;
  grid-template-columns: 76px 246px minmax(0, 1fr);
}
.server-rail {
  background: var(--deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 20px;
  gap: 13px;
  overflow-y: auto;
}
.brand {
  font-size: 32px;
  color: var(--blue);
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  width: 46px;
  height: 46px;
}
.round {
  height: 46px;
  width: 46px;
  border-radius: 50%;
  background: var(--bg);
}
#servers {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.server-button {
  border-radius: 18px;
  color: var(--muted);
  font-size: 17px;
  background: var(--bg);
  width: 46px;
  height: 46px;
  position: relative;
}
.server-button.active {
  background: var(--blue);
  color: var(--deep);
}
.server-button.active:before {
  content: "";
  position: absolute;
  left: -14px;
  top: 14px;
  width: 3px;
  height: 18px;
  background: var(--blue);
  border-radius: 2px;
}
.rail-rule {
  width: 28px;
  height: 1px;
  background: var(--rule);
  margin: 4px 0;
}
.rail-spacer {
  flex: 1;
}
.sidebar {
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.server-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  min-height: 64px;
  padding: 0 22px;
}
.server-heading h1 {
  font-size: 18px;
  font-weight: 650;
  color: var(--bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar input {
  margin: 16px 18px 12px;
  width: calc(100% - 36px);
  border: 0;
  padding: 10px 13px;
}
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 13px;
}
.channel-button {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  background: transparent;
  color: var(--muted);
  padding: 11px 13px;
  border-radius: 9px;
  text-align: left;
  font-size: 15px;
  margin: 3px 0;
}
.channel-button.active {
  color: var(--blue);
  background: #1e2433;
  font-weight: 600;
}
.channel-button:hover {
  background: #1b202d;
}
.channel-button .symbol {
  font-size: 22px;
  font-weight: 300;
}
.channel-divider {
  height: 1px;
  background: var(--rule);
  margin: 24px 12px;
}
.brand.active { background: #1e2433; }
.direct-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 3px 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.direct-row:hover { background: #1b202d; }
.direct-row.active { background: #1e2433; color: var(--blue); }
.direct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.direct-row .avatar { width: 30px; height: 30px; font-size: 11px; }
.direct-channels { margin-left: 29px; }
.direct-channels .channel-button { padding: 8px 12px; }
.direct-pagination { display: flex; justify-content: space-between; gap: 8px; padding: 14px 4px; }
.direct-pagination button { font-size: 12px; padding: 7px 9px; }
.account {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  border-top: 1px solid var(--rule);
  padding: 18px 23px;
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 76px;
}
.avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #262c3d;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
#user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.channel-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  border-bottom: 1px solid var(--rule);
  padding: 0 34px;
}
.channel-heading h2 {
  font-size: 18px;
  font-weight: 650;
  color: var(--bright);
}
.channel-symbol {
  font-size: 30px;
  color: var(--muted);
  font-weight: 200;
}
#preview-label {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
#mobile-sidebar {
  display: none;
}
.banner {
  padding: 9px 30px;
  border-bottom: 1px solid var(--rule);
}
.voice-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  gap: 20px;
}
.voice-channel h2 {
  font-size: 20px;
  font-weight: 600;
}
.voice-channel .voice-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center;
}
.person {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
button.person {
  padding: 8px 10px;
  border-radius: 12px;
}
button.person:hover {
  background: #1b202d;
  color: var(--ink);
}
.person .avatar {
  margin: 0 auto 8px;
  width: 50px;
  height: 50px;
  font-size: 16px;
}
#voice-status {
  margin: 10px 13px;
  padding: 10px 8px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--blue);
}
#voice-label {
  flex: 1;
}
#voice-people {
  width: 100%;
  color: var(--muted);
  padding-top: 4px;
}
dialog {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 24px;
  width: min(400px, calc(100% - 32px));
  box-shadow: 0 24px 100px #0008;
}
dialog::backdrop {
  background: #080a10b0;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font-size: 20px;
  color: var(--bright);
  margin-bottom: 20px;
}
#dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
#dialog-error {
  margin-top: 14px;
}
/* ---- Timeline ---- */
.timeline-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* No CSS smooth scrolling: programmatic pinning must land instantly. Smooth
   motion is opt-in per user jump, and only without reduced motion. */
.timeline {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #2a3145 transparent;
}
.timeline:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px #a2cafe55;
}
/* Few messages sit at the bottom, near the composer, like any chat. */
.timeline-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px 0 14px;
}
.day-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 22px 24px 6px;
}
.day-divider:before,
.day-divider:after {
  content: "";
  height: 1px;
  background: var(--rule);
  flex: 1;
}
.history-edge.start {
  padding: 40px 24px 8px;
  animation: fade-in 0.3s ease-out;
}
.history-edge.start p {
  max-width: 56ch;
}
.edge-face {
  width: 64px;
  height: 64px;
  font-size: 20px;
  margin-bottom: 14px;
}
.edge-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #1f2535;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 300;
  color: var(--bright);
  margin-bottom: 14px;
}
.history-edge h3,
.empty-state h3 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--bright);
}
.history-edge p,
.empty-state p {
  color: var(--muted);
}
.history-edge.more,
.history-edge.loading,
.history-edge.newer {
  padding: 6px 0;
}
/* A loading channel is placeholders from the composer to the top, clipped
   to the timeline and fading out toward the header. */
.history-edge.loading {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%);
  mask-image: linear-gradient(to bottom, transparent, #000 22%);
}
.history-edge.loading .skeleton {
  flex: none;
}
/* Placeholders fade in only after a beat, so a quick or cached load never
   flashes them, and share one light sweep pinned to the viewport. */
.skeleton,
.channel-skeleton {
  opacity: 0;
  animation: placeholder-in 0.5s ease-out calc(140ms + var(--i, 0) * 45ms) forwards;
}
.skeleton {
  display: flex;
  gap: 14px;
  padding: 10px 24px;
}
.skeleton.grouped {
  padding-top: 2px;
}
.skeleton.grouped .skeleton-avatar {
  height: 0;
}
.skeleton-avatar,
.skeleton-line {
  background: linear-gradient(100deg, #1a1f2d 40%, #242b3d 50%, #1a1f2d 60%) fixed;
  background-size: 200vw 100%;
  animation: shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.skeleton-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: none;
}
.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 5px;
}
.skeleton-line {
  height: 10px;
  border-radius: 5px;
}
.skeleton-line.short {
  width: 112px;
}
.skeleton-line.mid {
  width: min(42%, 340px);
}
.skeleton-line.long {
  width: min(68%, 520px);
}
.skeleton-line.longer {
  width: min(84%, 660px);
}
.channel-skeleton {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 13px;
  margin: 3px 0;
}
.channel-skeleton .skeleton-line {
  display: block;
  width: calc(62% - var(--i, 0) * 11%);
}
.channel-skeleton .skeleton-symbol {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: none;
}
@keyframes placeholder-in {
  to {
    opacity: 1;
  }
}
@keyframes shimmer {
  from {
    background-position: 100vw 0;
  }
  to {
    background-position: -100vw 0;
  }
}
@keyframes skeleton-pulse {
  50% {
    opacity: 0.55;
  }
}
.empty-state {
  margin: auto;
  max-width: 360px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-state .edge-icon {
  margin-bottom: 18px;
}
.empty-state p {
  line-height: 1.5;
}
.empty-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #1c2232;
  box-shadow: inset 0 0 0 1px #262c3d;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: 18px;
}
.empty-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.sidebar-note {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 13px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.sidebar-note strong {
  color: var(--ink);
  font-weight: 600;
}
.room-empty {
  color: var(--muted);
  font-size: 14px;
}

/* ---- Message rows ---- */
.message {
  display: flex;
  gap: 14px;
  position: relative;
  margin-top: 14px;
  padding: 3px 76px 3px 24px;
  scroll-margin: 64px 0;
}
.message.grouped {
  margin-top: 0;
  padding-top: 1px;
  padding-bottom: 1px;
}
.message:hover,
.message:focus-within,
.message.picking {
  background: #181c28;
}
.message:focus-visible {
  outline: none;
  box-shadow: inset 2px 0 0 var(--blue);
}
.message-gutter {
  width: 38px;
  flex: none;
}
.message .message-gutter .avatar {
  width: 38px;
  height: 38px;
  margin-top: 2px;
  font-size: 13px;
}
.message.has-reply .message-gutter {
  padding-top: 22px;
}
.hover-time {
  display: block;
  text-align: right;
  font-size: 10.5px;
  line-height: 22.5px;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
}
.message:hover .hover-time,
.message:focus-within .hover-time {
  opacity: 1;
}
.message-main {
  min-width: 0;
  flex: 1;
}
.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  line-height: 22px;
}
.author {
  font-weight: 650;
  font-size: 15px;
  color: var(--bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-trigger { background: transparent; padding: 0; text-align: left; border-radius: 4px; }
.profile-trigger.author:hover { text-decoration: underline; }
.profile-trigger:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.viewed-profile { display: flex; justify-content: center; }
dialog.profile-card {
  width: min(340px, calc(100% - 32px));
  padding: 32px 24px 24px;
}
.profile-card #dialog-form {
  display: flex;
  flex-direction: column;
}
.profile-card #dialog-body { order: 0; }
.profile-card #dialog-title {
  order: 1;
  margin: 14px 0 0;
  text-align: center;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.profile-card .viewed-profile .avatar {
  width: 72px;
  height: 72px;
  font-size: 24px;
  box-shadow: 0 0 0 1px var(--rule);
}
.profile-card #dialog-error { order: 2; }
.profile-card .dialog-actions { order: 3; margin-top: 24px; }
.profile-card #dialog-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
}
.profile-card #dialog-submit .tool-icon { width: 18px; height: 18px; }
.profile-card #dialog-cancel {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}
.profile-card #dialog-cancel .tool-icon { width: 18px; height: 18px; }
.time {
  flex: none;
  font-size: 11.5px;
  color: var(--muted);
}
.message-content {
  padding-inline-end: 22px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.custom-emoji {
  height: 22px;
  width: 22px;
  object-fit: contain;
  vertical-align: -5px;
}
.message-reply {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  height: 20px;
  margin-bottom: 2px;
  padding: 0;
  background: none;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
}
.reply-spine {
  position: absolute;
  left: -33px;
  top: 10px;
  width: 27px;
  height: 13px;
  border-left: 2px solid #343b50;
  border-top: 2px solid #343b50;
  border-top-left-radius: 7px;
}
.message .avatar.avatar-mini {
  width: 16px;
  height: 16px;
  margin: 0;
  font-size: 7px;
  flex: none;
}
.reply-author {
  flex: none;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.reply-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-reply:hover .reply-text,
.message-reply:hover .reply-author {
  color: var(--bright);
}
.message.flash {
  animation: flash 1.8s ease-out;
}
@keyframes flash {
  0%,
  35% {
    background: rgb(162 202 254 / 0.16);
  }
  100% {
    background: transparent;
  }
}
.message.reply-target {
  background: rgb(162 202 254 / 0.07);
  box-shadow: inset 2px 0 0 var(--blue);
}
/* Device sends stay muted; a quiet clock appears only after 3 s. */
.message[data-state="sending"] .message-content,
.message[data-state="slow"] .message-content {
  color: var(--muted);
}
.message[data-state="sending"] .message-content *,
.message[data-state="slow"] .message-content * {
  color: inherit;
}
.message-status {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  animation: fade-in 0.3s ease-out;
}
.message[data-state="slow"] .message-content,
.message[data-state="slow"] .media-card {
  opacity: 0.72;
  transition: opacity 0.3s ease;
}
.message[data-state="failed"],
.message[data-state="rejected"] {
  box-shadow: inset 2px 0 0 #ef8a80;
}
.message[data-state="failed"] .message-content,
.message[data-state="rejected"] .message-content {
  opacity: 0.7;
}
.message-failure {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-top: 3px;
  font-size: 12.5px;
  color: #f1adb4;
}
.failure-icon {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ef8a80;
  color: var(--deep);
  font-size: 11px;
  font-weight: 800;
}
.message-failure .plain {
  padding: 2px 8px;
  color: var(--blue);
  font-weight: 600;
  font-size: 12.5px;
}
.message-failure .discard {
  color: var(--muted);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ---- Reactions ---- */
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 5px 0 2px;
}
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #1b2130;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.12s ease;
}
.reaction:hover {
  background: #222a3c;
  border-color: #323b52;
}
.reaction:active {
  transform: scale(0.94);
}
.reaction.mine {
  background: rgb(162 202 254 / 0.14);
  border-color: rgb(162 202 254 / 0.55);
  color: var(--blue);
}
.reaction-emoji {
  display: inline-flex;
  font-size: 15px;
}
.reaction-emoji .custom-emoji {
  width: 17px;
  height: 17px;
  vertical-align: 0;
}
.reaction-count {
  min-width: 1ch;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.reaction.bump .reaction-count {
  animation: bump 0.28s ease-out;
}
@keyframes bump {
  40% {
    transform: translateY(-3px);
  }
}
.reaction-add {
  gap: 0;
  padding: 0 7px;
  color: var(--muted);
  opacity: 0;
}
.reaction-add .add-glyph {
  font-size: 15px;
}
.reaction-add .add-plus {
  font-size: 11px;
  font-weight: 700;
  margin: -8px 0 0 -1px;
}
.message:hover .reaction-add,
.message:focus-within .reaction-add,
.message.picking .reaction-add {
  opacity: 1;
}

/* ---- Hover toolbar (one, shared) ---- */
.message-actions {
  position: absolute;
  right: 16px;
  top: -18px;
  z-index: 2;
  display: none;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border-radius: 10px;
  background: #1c2030;
  box-shadow:
    0 0 0 1px var(--rule),
    0 6px 18px #00000066;
}
.message:hover .message-actions,
.message:focus-within .message-actions,
.message.picking .message-actions {
  display: flex;
}
.message-actions .icon {
  width: 32px;
  height: 30px;
  font-size: 17px;
  border-radius: 7px;
}
.message-actions .tool-icon {
  width: 18px;
  height: 18px;
  display: block;
}
.message-actions .custom-emoji {
  width: 19px;
  height: 19px;
  vertical-align: 0;
}
.actions-rule {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--rule);
}
.message.grouped .message-actions {
  top: -22px;
}

/* ---- Jump pill, tooltip, toast ---- */
.jump-pill {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 16px;
  border-radius: 999px;
  background: #232a3d;
  color: var(--bright);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow:
    0 0 0 1px #313a52,
    0 8px 24px #00000073;
  animation: pill-in 0.18s ease-out;
}
.jump-pill.fresh {
  background: var(--blue);
  color: var(--deep);
  box-shadow: 0 8px 24px #00000073;
}
.jump-pill:hover {
  filter: brightness(1.1);
}
.jump-arrow {
  font-size: 15px;
}
@keyframes pill-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}
.tooltip {
  position: fixed;
  z-index: 30;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #0b0d13;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow:
    0 0 0 1px var(--rule),
    0 6px 20px #00000080;
  pointer-events: none;
}
.tooltip strong {
  color: var(--bright);
  font-weight: 600;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  z-index: 40;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  background: #252c40;
  color: var(--bright);
  font-size: 13.5px;
  text-align: center;
  box-shadow:
    0 0 0 1px #343d55,
    0 12px 32px #00000099;
}
.toast.show {
  animation: pill-in 0.2s ease-out;
}
.toast.actionable {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 16px;
}
.toast-action {
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--blue);
  color: var(--deep);
  font-weight: 600;
  font-size: 13px;
}
.setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  color: var(--ink);
}
.setting-row select {
  min-width: 132px;
}
.setting-note {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--muted);
}
.setting-note:empty {
  display: none;
}

/* ---- Composer ---- */
.reply-preview {
  margin: 0 16px 8px;
  padding: 10px 10px 10px 14px;
  border-radius: 10px;
  background: #181c28;
  box-shadow: inset 2px 0 0 var(--blue);
  font-size: 13px;
  max-height: 160px;
  overflow: auto;
}
.reply-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.reply-preview-head .avatar {
  width: 20px;
  height: 20px;
  font-size: 8px;
}
.reply-preview-head strong {
  color: var(--bright);
}
.reply-preview-head .plain {
  margin-left: auto;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--blue);
}
.reply-preview .icon {
  width: 26px;
  height: 26px;
  font-size: 18px;
}
.reply-preview p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.composer {
  margin: 0 16px 24px;
  border-radius: 12px;
  background: #1c2030;
  box-shadow: 0 0 0 1px var(--rule);
  transition: box-shadow 0.15s ease;
}
.composer:focus-within {
  box-shadow: 0 0 0 1px #3a4560;
}
#replying {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 14px;
  border-radius: 12px 12px 0 0;
  background: #181c28;
  border-bottom: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--muted);
}
#replying strong {
  color: var(--ink);
  font-weight: 600;
}
#replying .icon {
  width: 26px;
  height: 26px;
  font-size: 17px;
}
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 5px 6px;
}
.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 220px;
  padding: 8px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  display: block;
}
.composer textarea:focus-visible {
  outline: none;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.composer .icon {
  width: 38px;
  height: 38px;
  font-size: 21px;
}
.composer .send {
  width: 32px;
  height: 32px;
  margin: 3px 3px 3px 4px;
  border-radius: 9px;
  font-size: 18px;
  background: #283247;
  color: #6f7ea0;
}
.composer .send:not(:disabled) {
  background: var(--blue);
  color: var(--deep);
}
.composer .send:disabled {
  opacity: 1;
}
.attachment-button {
  cursor: pointer;
}
.attachment-button input {
  display: none;
}
.attachments {
  margin: 10px 12px 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.typing {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 3px;
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.typing:before {
  content: "•••";
  margin-right: 6px;
  letter-spacing: 1px;
  color: var(--ink);
  animation: skeleton-pulse 1s ease-in-out infinite;
}

/* ---- Emoji picker ---- */
.emoji-picker {
  position: fixed;
  z-index: 20;
  width: 352px;
  max-width: calc(100vw - 16px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #181c28;
  box-shadow:
    0 0 0 1px var(--rule),
    0 18px 50px #000000a6;
  overflow: hidden;
  animation: picker-in 0.14s ease-out;
}
@keyframes picker-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.985);
  }
}
.emoji-picker > input {
  margin: 10px 10px 4px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--deep);
}
.emoji-picker > input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px #3a4560;
}
.emoji-grid {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: #2a3145 transparent;
}
.emoji-section {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 8px 4px 4px;
  background: #181c28;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
}
.emoji-set {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
}
.emoji-choice {
  display: grid;
  place-items: center;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
.emoji-choice:hover,
.emoji-choice:focus-visible {
  background: #262d40;
}
.emoji-choice:focus-visible {
  outline-offset: -2px;
}
.emoji-choice .custom-emoji {
  width: 26px;
  height: 26px;
  vertical-align: 0;
}
.emoji-empty {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 6px 12px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
}
.emoji-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.preview-glyph {
  font-size: 20px;
}
.preview-glyph .custom-emoji {
  vertical-align: 0;
}
.upload {
  flex: none;
  color: var(--blue);
  cursor: pointer;
}
.picker-actions {
  display: flex;
  gap: 6px;
  padding: 10px 10px 2px;
}
.picker-actions button {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  background: #222838;
  color: var(--bright);
  font-size: 14px;
}
.picker-actions button,
.picker-back {
  display: flex;
  align-items: center;
  gap: 12px;
}
.picker-actions .tool-icon,
.picker-back .tool-icon { width: 18px; height: 18px; flex: none; }
.picker-quick {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--rule);
}
.picker-quick .emoji-choice { height: 44px; font-size: 26px; }
.quick-more { color: var(--muted); }
.quick-more .tool-icon { width: 22px; height: 22px; }
.emoji-picker.compact .picker-actions {
  flex-direction: column;
  gap: 0;
  padding: 6px 8px 10px;
}
.emoji-picker.compact .picker-actions button {
  flex: none;
  min-height: 44px;
  padding: 10px 14px;
  background: transparent;
  text-align: left;
}
.emoji-picker.compact .picker-actions button:hover,
.emoji-picker.compact .picker-actions button:focus-visible { background: #262d40; }
.picker-back {
  align-self: flex-start;
  margin: 8px 10px 0;
  padding: 8px;
  min-height: 40px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.emoji-picker.sheet {
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  width: 100%;
  max-width: none;
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation-name: sheet-in;
  /* Dims the conversation behind the sheet. */
  box-shadow: 0 0 0 100vmax #080a1099;
}
.emoji-picker.sheet .emoji-grid {
  max-height: 42vh;
}
.emoji-picker.sheet .emoji-choice {
  height: 44px;
}
@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
.invite-result {
  overflow-wrap: anywhere;
  user-select: all;
  font-size: 14px;
  color: var(--blue);
}
.message-link {
  color: var(--blue);
  text-decoration: none;
}
.message-link:hover {
  text-decoration: underline;
}
.attachment-button {
  cursor: pointer;
}
.attachment-button input {
  display: none;
}
.attachments {
  margin: 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.draft-attachment {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--deep);
  box-shadow: inset 0 0 0 1px var(--rule);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
}
.draft-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.draft-attachment.uploading .draft-thumb {
  filter: brightness(0.7);
}
.draft-attachment.failed .draft-thumb {
  filter: grayscale(1) brightness(0.45);
}
.draft-kind {
  font-size: 11px;
  color: var(--blue);
  font-weight: 600;
}
.draft-name {
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
}
.draft-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 3px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.18);
  overflow: hidden;
}
.draft-progress span {
  display: block;
  height: 100%;
  background: var(--blue);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.draft-retry {
  position: relative;
  padding: 3px 8px;
  border-radius: 6px;
  border: 0;
  background: var(--blue);
  color: var(--deep);
  font-size: 11px;
  font-weight: 600;
}
.draft-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgb(8 10 16 / 0.72);
  color: var(--bright);
  font-size: 13px;
  line-height: 1;
}
.draft-remove:disabled {
  display: none;
}
.media-card {
  position: relative;
  margin-top: 8px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
/* Images and not-yet-known attachments reserve their box up front, so the
   timeline never jumps when pixels arrive. */
.media-card.loading,
.media-card.image {
  display: block;
  width: 320px;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--deep);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.media-card.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgb(255 255 255 / 0.06) 50%,
    transparent 80%
  );
  background-size: 200% 100%;
  animation: media-shimmer 1.3s ease-in-out infinite;
}
@keyframes media-shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}
.media-card.loading .media-file,
.media-card.image .media-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.media-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.015);
  transition:
    opacity 0.28s ease,
    transform 0.4s ease;
  cursor: zoom-in;
}
.media-card.ready {
  box-shadow: none;
}
.media-card.ready .media-image {
  opacity: 1;
  transform: none;
}
.media-image:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.media-card.failed {
  cursor: pointer;
}
.media-card.failed::after {
  content: "Couldn’t load image · Tap to retry";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}
.media-card.player {
  width: auto;
  aspect-ratio: auto;
  background: none;
  box-shadow: none;
}
.media-file {
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
}
.media-card video {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  border-radius: 10px;
}
.media-card audio {
  max-width: 100%;
  height: 36px;
}

.speak-mark {
  width: 1em;
  height: 1em;
  display: block;
  margin-inline: auto;
  color: var(--blue);
}
.google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--deep);
  color: var(--bright);
}
.google svg {
  width: 18px;
  height: 18px;
}
img.avatar {
  object-fit: cover;
}
.avatar-large {
  width: 56px;
  height: 56px;
  font-size: 18px;
}
.picture-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  color: var(--blue);
}
.picture-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.dialog-hint {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 13px;
}
canvas.openable {
  cursor: zoom-in;
}
.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #080a10e6;
  cursor: zoom-out;
}
.media-viewer img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 12px 40px #00000080;
}
@media (prefers-reduced-motion: reduce) {
  .media-card.loading::before {
    animation: none;
  }
  .media-image {
    transition: none;
    transform: none;
  }
}
.connection {
  position: absolute;
  top: 76px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 9px 10px 9px 14px;
  border-radius: 999px;
  background: #1c2030;
  box-shadow:
    0 0 0 1px var(--rule),
    0 8px 24px #00000059;
  font-size: 13px;
  animation: connection-in 0.22s ease-out;
}
.connection-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f2c46d;
  box-shadow: 0 0 0 0 #f2c46d80;
  animation: connection-pulse 1.4s ease-out infinite;
}
.connection.offline .connection-dot {
  background: #ef8a80;
  animation: none;
}
.connection.restored .connection-dot {
  background: var(--leaf);
  animation: none;
}
.connection-text {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-width: 0;
}
.connection-text strong {
  color: var(--bright);
  font-weight: 600;
}
.connection-text span {
  color: var(--muted);
}
#connection-retry {
  flex-shrink: 0;
  padding: 4px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--rule);
  color: var(--bright);
  font-size: 12px;
}
#connection-retry:hover {
  background: #313850;
}
@keyframes connection-in {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
}
@keyframes connection-pulse {
  70% {
    box-shadow: 0 0 0 7px #f2c46d00;
  }
  100% {
    box-shadow: 0 0 0 0 #f2c46d00;
  }
}
@media (max-width: 760px) {
  .connection {
    top: 66px;
    border-radius: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .connection,
  .connection-dot {
    animation: none;
  }
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 84px 272px minmax(0, 1fr);
  }
  .channel-heading {
    padding: 0 44px;
  }
  .message {
    padding-left: 40px;
    padding-right: 96px;
  }
  .day-divider {
    margin-left: 40px;
    margin-right: 40px;
  }
  .skeleton,
  .history-edge.start {
    padding-left: 40px;
  }
  .composer {
    margin: 0 32px 26px;
  }
  .reply-preview {
    margin: 0 32px 8px;
  }
  .typing {
    left: 46px;
  }
}
@media (max-width: 800px) {
  .workspace {
    grid-template-columns: 64px 204px minmax(0, 1fr);
  }
  .server-heading {
    padding: 0 15px;
  }
  .channel-heading {
    padding: 0 20px;
    gap: 12px;
  }
  .message {
    gap: 12px;
    padding: 3px 56px 3px 16px;
  }
  .day-divider {
    margin: 18px 16px 6px;
  }
  .skeleton {
    padding: 10px 16px;
  }
  .history-edge.start {
    padding: 32px 16px 8px;
  }
  .composer {
    margin: 0 12px 24px;
  }
  .reply-preview {
    margin: 0 12px 8px;
  }
  .typing {
    left: 24px;
  }
}
@media (max-width: 600px) {
  .workspace {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .server-rail {
    padding-top: 16px;
  }
  .round,
  .server-button {
    width: 40px;
    height: 40px;
  }
  .sidebar {
    position: fixed;
    left: 58px;
    top: 0;
    bottom: 0;
    width: 230px;
    background: var(--bg);
    z-index: 5;
    box-shadow: 15px 0 45px #0008;
    display: none;
  }
  .workspace.sidebar-open .sidebar {
    display: flex;
  }
  .conversation {
    grid-column: 2;
  }
  .channel-heading {
    min-height: 56px;
    padding: 0 10px;
    gap: 8px;
  }
  .channel-heading h2 {
    font-size: 16px;
  }
  .channel-symbol {
    font-size: 24px;
  }
  #mobile-sidebar {
    display: grid;
  }
  .message {
    gap: 10px;
    padding: 3px 12px;
  }
  .message-gutter {
    width: 34px;
  }
  .message .message-gutter .avatar {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }
  .message.has-reply .message-gutter {
    padding-top: 22px;
  }
  .reply-spine {
    left: -29px;
    width: 23px;
  }
  .day-divider {
    margin: 16px 12px 6px;
  }
  .skeleton {
    padding: 10px 12px;
  }
  .history-edge.start {
    padding: 28px 12px 8px;
  }
  .history-edge h3 {
    font-size: 20px;
  }
  .composer {
    margin: 0 8px 22px;
  }
  .composer .icon {
    width: 34px;
  }
  .reply-preview {
    margin: 0 8px 8px;
  }
  .typing {
    left: 16px;
    right: 16px;
  }
  .account {
    padding: 16px;
  }
  .auth-card {
    width: min(340px, calc(100vw - 44px));
  }
  .voice-channel h2 {
    font-size: 18px;
  }
  .banner {
    padding: 8px 14px;
  }
  .toast {
    bottom: 92px;
  }
}
/* Touch: no hover toolbar; long-press opens reactions and actions. */
@media (hover: none) {
  .message-actions {
    display: none !important;
  }
  .message:hover,
  .message:focus-within {
    background: transparent;
  }
  .message.picking {
    background: #181c28;
  }
  .reaction-add {
    opacity: 1;
  }
  .message {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .typing:before,
  .message.flash,
  .reaction.bump .reaction-count,
  .jump-pill,
  .toast.show,
  .emoji-picker,
  .message-status {
    animation: none;
  }
  .reaction,
  .composer {
    transition: none;
  }
}
/* Delivery sits quietly in the row's right gutter, clear of the text. */
.message-delivery {
  position: absolute;
  right: 26px;
  bottom: 7px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  pointer-events: none;
}
.message-receipt {
  display: inline-flex;
  line-height: 1;
  color: var(--muted);
  opacity: 0.7;
  transition: opacity 0.4s ease;
}
.message-receipt svg {
  height: 10px;
  width: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.message-receipt[data-receipt="saved"] {
  color: var(--muted);
}
.message-receipt.fading {
  opacity: 0;
}
.inline-code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--deep);
  box-shadow: inset 0 0 0 1px var(--rule);
  font: 0.88em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.message-quote {
  margin: 4px 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  white-space: pre-wrap;
}
.code-block {
  margin: 6px 0;
  max-width: min(100%, 720px);
  border-radius: 10px;
  overflow: hidden;
  background: var(--deep);
  box-shadow: inset 0 0 0 1px var(--rule);
  white-space: normal;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 5px 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  color: var(--muted);
}
.code-language {
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.code-copy {
  padding: 2px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.code-copy:hover {
  background: var(--rule);
  color: var(--bright);
}
.code-block pre {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  white-space: pre;
}
.tok-comment {
  color: #6f7896;
  font-style: italic;
}
.tok-string {
  color: var(--leaf);
}
.tok-number {
  color: #f2c46d;
}
.tok-keyword {
  color: var(--blue);
}

.upload-usage { display: flex; flex-direction: column; gap: 12px; color: var(--ink); }
.media-card.file { width: fit-content; max-width: 100%; min-height: 0; padding: 12px 16px; }
.media-card.file .media-file { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .channel-skeleton,
  .booting .mark .boot-mark {
    animation: none;
    opacity: 1;
  }
  .skeleton-avatar,
  .skeleton-line {
    animation: none;
    background: #1c2130;
  }
  .history-edge.start,
  .boot-mark .tail {
    animation: none;
  }
  .boot-mark .trace {
    animation: none;
    stroke-dasharray: none;
    opacity: 0.55;
  }
}
/* Updates settle in rather than pop: new rows rise a few pixels, a first
   paint fades up from the placeholders. */
.message.appear {
  animation: fade-in 0.18s ease-out;
}
.message.arrive {
  animation: arrive 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.channel-button.arrive {
  animation: fade-in 0.35s ease-out;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .message.appear,
  .message.arrive,
  .channel-button.arrive {
    animation: none;
  }
}

/* ---- Voice channel room bar: who is in the call, above its chat ---- */
.voice-room {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 34px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, #171b27, var(--bg));
}
.room-glyph {
  color: var(--leaf);
  font-size: 16px;
}
.room-status {
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
}
.room-people {
  display: flex;
  flex: 1;
  min-width: 0;
}
.room-person {
  margin-left: -6px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 2px var(--bg);
}
.room-person:first-child {
  margin-left: 0;
}
.room-person .avatar {
  width: 28px;
  height: 28px;
  font-size: 10px;
}
.room-join {
  padding: 7px 16px;
  font-size: 13.5px;
}
.room-join.plain {
  color: #f1adb4;
  box-shadow: inset 0 0 0 1px #4a2f38;
}

/* ---- Mentions and shared times ---- */
.mention {
  padding: 0 4px;
  border-radius: 5px;
  background: #a2cafe1f;
  color: var(--blue);
  font: inherit;
  font-weight: 550;
}
.mention:hover {
  background: #a2cafe33;
}
.mention.self {
  background: #a2cafe33;
  color: var(--bright);
}
.message.mentions-me {
  background: #a2cafe0d;
  box-shadow: inset 2px 0 0 var(--blue);
}
.time-token {
  padding: 0 5px;
  border-radius: 5px;
  background: #262c3d;
  color: var(--bright);
  white-space: nowrap;
  cursor: help;
}
.composer {
  position: relative;
}
.mention-menu,
.time-picker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  padding: 6px;
  border-radius: 12px;
  background: #1c2030;
  box-shadow:
    0 0 0 1px #313a52,
    0 16px 40px #00000099;
  animation: picker-in 0.14s ease-out;
}
.mention-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.mention-option.active {
  background: #262d40;
}
.mention-option .avatar {
  width: 24px;
  height: 24px;
  font-size: 9px;
}
.mention-glyph {
  width: 24px;
  text-align: center;
  color: var(--blue);
}
.mention-name {
  color: var(--bright);
  font-weight: 550;
}
.mention-hint {
  color: var(--muted);
  font-size: 13px;
}
.time-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px;
}
.time-picker[hidden] {
  display: none;
}
.time-picker input {
  color-scheme: dark;
}
.time-zone {
  flex: 1 1 200px;
  color: var(--muted);
  font-size: 12.5px;
}
.time-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
@media (prefers-reduced-motion: reduce) {
  .mention-menu,
  .time-picker {
    animation: none;
  }
}
@media (max-width: 760px) {
  .voice-room {
    padding: 8px 16px;
  }
}

/* ---- Link previews ---- */
.link-preview {
  display: flex;
  gap: 14px;
  width: fit-content;
  max-width: min(520px, 100%);
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #1a1e2b;
  box-shadow:
    inset 3px 0 0 #3a4560,
    0 0 0 1px var(--rule);
  color: inherit;
  text-decoration: none;
}
.link-preview:hover {
  background: #1d2231;
}
.link-preview.waiting {
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: none;
}
.link-preview.arrive {
  animation: fade-in 0.25s ease-out;
}
.preview-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.preview-site {
  color: var(--muted);
  font-size: 12px;
}
.preview-title {
  color: var(--blue);
  font-weight: 600;
  line-height: 1.35;
}
.preview-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}
.preview-image {
  flex: none;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--deep);
}
.link-preview.large {
  flex-direction: column;
}
.link-preview.large .preview-image {
  width: 100%;
  height: auto;
  max-height: 260px;
  aspect-ratio: 1.91;
}
@media (prefers-reduced-motion: reduce) {
  .link-preview.arrive {
    animation: none;
  }
}

/* Drawn icons in icon buttons, centered like the toolbar's. */
.icon .tool-icon {
  width: 20px;
  height: 20px;
  display: block;
}
.dialog-note {
  color: var(--muted);
}

/* ---- Profile and welcome ---- */
.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-identity.welcome {
  flex-direction: column;
  gap: 12px;
  margin: 4px 0 6px;
}
.avatar-hero {
  width: 64px;
  height: 64px;
  font-size: 22px;
}
.welcome .avatar-hero {
  width: 88px;
  height: 88px;
  font-size: 30px;
  box-shadow: 0 0 0 4px #1c2232, 0 0 0 5px #313a52;
}
img.avatar-hero {
  object-fit: cover;
}
.photo-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.photo-action {
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}
.photo-action.quiet {
  color: var(--muted);
  font-weight: 450;
}
.photo-action:hover {
  text-decoration: underline;
}
.photo-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.photo-action:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
}
.setting-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0 2px;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.setting-link:hover {
  color: var(--bright);
}
.setting-chevron {
  color: var(--muted);
  font-size: 18px;
}
#dialog-submit.danger {
  background: #f1adb4;
  color: #2a0f14;
}

/* ---- Boot: the mark stays up until the first channel has rendered, then
   the finished workspace fades in (no placeholder text ever shows). ---- */
.booting #auth[hidden] {
  display: grid !important;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
}
#chat {
  transition: opacity 0.25s ease-out;
}
.booting #chat {
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #chat {
    transition: none;
  }
}
.person-glyph {
  width: 52%;
  height: 52%;
  color: var(--muted);
}
dialog.welcome #dialog-title,
dialog.welcome .dialog-note {
  text-align: center;
}
dialog.welcome .dialog-note {
  margin: -2px auto 2px;
  max-width: 30ch;
}
dialog.welcome #dialog-submit {
  width: 100%;
}
