/* Glass channel header, header search, chat chrome overlay. */
/* Compact glass header (same look on desktop and mobile). */
.channel-header {
  height: auto;
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  /* No row-gap while search/notif slots are collapsed (0fr). */
  gap: 0 8px;
  margin: 8px 12px 0;
  padding: 6px 8px 6px 6px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: 8px;
  overflow: visible;
  box-sizing: border-box;
  flex: none;
  z-index: 3;
}
.channel-header .menu-toggle,
.channel-header .icon-btn {
  width: var(--chrome-icon-btn);
  height: var(--chrome-icon-btn);
  background: transparent;
}
.channel-header .icon-btn:hover,
.channel-header .icon-btn:active {
  background: transparent;
  color: var(--accent);
}
.channel-header .menu-toggle svg,
.channel-header .icon-btn svg {
  width: var(--chrome-icon-svg);
  height: var(--chrome-icon-svg);
}
.channel-header .channel-avatar-btn .avatar,
.channel-header #channel-avatar {
  width: 36px;
  height: 36px;
}
.pinned-banner {
  flex: none; display: flex; align-items: stretch; gap: 4px;
  margin: 6px 12px 0;
  padding: 6px 8px 6px 10px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: 8px;
  z-index: 3;
}
.pinned-banner.hidden { display: none !important; }
.pinned-banner-main {
  appearance: none; border: 0; background: transparent; padding: 2px 0;
  flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 10px;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.pinned-banner-bar {
  width: 2px; border-radius: 2px; background: #1a1d26; flex: none; align-self: stretch;
}
.pinned-banner-copy {
  min-width: 0; display: flex; flex-direction: column; gap: 1px; justify-content: center;
}
.pinned-banner-title {
  font-size: calc(13px * var(--text-scale, 1)); font-weight: 700; color: #1a1d26; line-height: 1.25;
}
.pinned-banner-preview {
  font-size: calc(13px * var(--text-scale, 1)); color: #5c6270; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pinned-banner-close {
  appearance: none; border: 0; background: transparent; color: #9aa0ab;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; flex: none;
  align-self: center; font-size: 20px; line-height: 1; padding: 0;
}
.pinned-banner-close:hover { color: #1a1d26; background: #f3f5f8; }
.pinned-banner-close.hidden { display: none !important; }
/* The message a reply (pin, search) leads to: a grey frame that comes and fades. */
.msg.msg-flash .msg-bubble { animation: msg-flash-frame 1.6s ease-out; }
@keyframes msg-flash-frame {
  0% { box-shadow: 0 0 0 0 rgba(110, 118, 132, 0); }
  15%, 55% { box-shadow: 0 0 0 2px rgba(110, 118, 132, .75), 0 4px 16px rgba(20, 32, 51, .12); }
  100% { box-shadow: 0 0 0 2px rgba(110, 118, 132, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .msg.msg-flash .msg-bubble { animation: none; box-shadow: 0 0 0 2px rgba(110, 118, 132, .75); }
}
.app.rail-feature-open .pinned-banner { display: none !important; }
/* Mobile shared-element: sidebar → header fly (see runHeaderFly in app.js). */
.header-fly-clone {
  position: fixed;
  z-index: 10060;
  margin: 0;
  padding: 0;
  pointer-events: none;
  will-change: transform, opacity, color;
  box-sizing: border-box;
  overflow: hidden;
}
.header-fly-label {
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: inherit;
  font-family: inherit;
}
.header-fly-avatar {
  border-radius: 50%;
  overflow: visible;
  line-height: 0;
}
.header-fly-avatar .avatar {
  display: block;
  border-radius: 50%;
}
.channel-header.is-fly-pending #channel-name,
.channel-header.is-fly-pending #channel-avatar-btn,
.channel-header.is-fly-pending #channel-prefix,
.channel-header.is-fly-pending #channel-topic {
  opacity: 0 !important;
}
.channel-header:not(.is-fly-pending) #channel-name,
.channel-header:not(.is-fly-pending) #channel-avatar-btn,
.channel-header:not(.is-fly-pending) #channel-prefix,
.channel-header:not(.is-fly-pending) #channel-topic {
  transition: opacity .12s ease;
}

.channel-avatar-btn {
  appearance: none; border: 0; background: transparent; padding: 2px; cursor: pointer;
  flex: none; border-radius: 50%; overflow: visible; line-height: 0;
}
.channel-avatar-btn.hidden { display: none !important; }
.channel-avatar-btn .avatar { width: 36px; height: 36px; font-size: 14px; }
.channel-avatar-btn:hover .avatar { box-shadow: 0 0 0 2px var(--accent-soft); }
.channel-heading { min-width: 0; flex: 1; text-align: left; align-self: center; }
.channel-header > .header-actions { align-self: center; }
.channel-heading-btn {
  appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer;
  color: inherit; font: inherit; border-radius: 8px; padding: 2px 6px; margin: -2px -6px;
}
.channel-heading-btn:hover,
.channel-heading-btn:focus,
.channel-heading-btn:active {
  background: transparent;
  color: inherit;
  outline: none;
}
.channel-heading-btn.is-profile {
  cursor: default;
  pointer-events: none;
}
.channel-title {
  font-weight: 700;
  font-size: calc(16px * var(--text-scale, 1));
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: nowrap;
  min-width: 0;
}
#channel-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-title-sep {
  color: #8b8e98;
  font-weight: 700;
  flex: 0 0 auto;
}
.channel-title-sep.hidden { display: none !important; }
.channel-title-dialogues {
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.channel-title-dialogues.hidden { display: none !important; }
.channel-title-dialogues:hover,
.channel-title-dialogues:focus,
.channel-title-dialogues:active {
  color: inherit;
  text-decoration: none;
  outline: none;
  background: transparent;
}
#channel-prefix { color: #8b8e98; flex: 0 0 auto; }
.channel-topic { color: #8b8e98; font-size: calc(13px * var(--text-scale, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-topic.is-typing { color: #8b8e98; font-weight: 400; }
#channel-list {
  /* Small reserve so DMs stay close; tools row adds its own height when mounted. */
  padding-bottom: 4px;
}
#channel-list:has(> .chat-tools) {
  padding-bottom: 0;
}
#channel-list.is-collapsed {
  padding-bottom: 0;
}
.chat-tools {
  display: flex; align-items: center; gap: 2px; flex: none;
  width: calc(100% - 16px); margin: 0 8px 4px; padding: 2px 6px 4px 10px;
  box-sizing: border-box;
  background: transparent;
  border-radius: 0;
  min-height: var(--chat-tool-btn-h);
}
.chat-tools.is-dm { padding-left: 10px; }
/* Collapsed / parked: never reserve space under channel or DM rows. */
#channel-list > .chat-tools.is-collapsed,
#dm-list > .chat-tools.is-collapsed,
.chat-tools.is-collapsed,
.chat-tools.hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}
.chat-tool-btn {
  appearance: none; border: 0; background: transparent; color: rgba(255,255,255,.78);
  width: var(--chat-tool-btn-w); height: var(--chat-tool-btn-h); border-radius: 8px; padding: 0;
  display: grid; place-items: center; cursor: pointer; flex: none;
  -webkit-tap-highlight-color: transparent;
}
.chat-tool-btn svg { display: block; width: var(--chat-tool-svg); height: var(--chat-tool-svg); }
.chat-tool-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.chat-tool-btn:focus-visible { outline: 2px solid rgba(255,255,255,.75); outline-offset: 2px; }
.chat-tool-btn.is-active {
  color: #fff; background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.chat-tool-btn.hidden { display: none !important; }
.profile-visit.is-readonly .visit-edit,
.profile-visit.is-readonly #card-avatar-clear,
.profile-visit.is-readonly #open-settings,
.profile-visit.is-readonly .card-availability .chevron { display: none !important; }
.profile-visit.is-readonly #card-availability-toggle { pointer-events: none; cursor: default; }
.profile-visit.is-readonly #card-avatar { cursor: default; }
.header-actions { display: flex; align-items: center; gap: 4px; min-width: 0; }
#header-notifications {
  position: relative;
  margin-left: -10px;
}
#header-notifications .header-ico-sat {
  display: block;
  pointer-events: none;
  width: var(--chrome-icon-svg);
  height: var(--chrome-icon-svg);
  color: #8b8e98;
  flex: none;
}
#header-notifications.has-alerts .header-ico-sat {
  animation: header-notif-blink .9s ease-in-out infinite;
}
#header-notifications.is-muted .header-ico-sat {
  color: #b0b4be;
  opacity: .45;
  animation: none !important;
}
@keyframes header-notif-blink {
  0%, 100% { color: #c5c8d0; }
  50% { color: #2f6bff; }
}
/* Same expand mechanic as composer format toolbar: grows inside the header glass. */
.header-notif-slot {
  display: grid;
  grid-template-rows: 0fr;
  flex: 1 0 100%;
  width: 100%;
  min-width: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  position: relative;
  z-index: 1;
  transition:
    grid-template-rows .34s cubic-bezier(.22, .61, .36, 1),
    opacity .26s ease;
}
html.header-notif-open .header-notif-slot {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}
.header-notif-slot-inner {
  min-height: 0;
  overflow: hidden;
}
.header-notif-panel {
  margin: 0;
  padding: 8px 2px 2px;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(180, 186, 198, 0.45);
  border-radius: 0;
  box-shadow: none;
  transform: translateY(-8px);
  opacity: 0;
  transition:
    transform .34s cubic-bezier(.22, .61, .36, 1),
    opacity .26s ease;
}
html.header-notif-open .header-notif-panel {
  transform: translateY(0);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .header-notif-slot,
  .header-notif-panel {
    transition: none !important;
  }
}
/* Mail search C: strip expands inside the glass header (same motion as notif). */
.header-mail-search-slot {
  display: grid;
  grid-template-rows: 0fr;
  flex: 1 0 100%;
  width: 100%;
  min-width: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  position: relative;
  z-index: 1;
  transition:
    grid-template-rows .34s cubic-bezier(.22, .61, .36, 1),
    opacity .26s ease;
}
html.header-mail-search-open .header-mail-search-slot {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}
.header-mail-search-slot-inner {
  min-height: 0;
  overflow: hidden;
}
.header-mail-search-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 2px 4px;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(180, 186, 198, 0.45);
  border-radius: 0;
  box-shadow: none;
  transform: translateY(-8px);
  opacity: 0;
  transition:
    transform .34s cubic-bezier(.22, .61, .36, 1),
    opacity .26s ease;
}
html.header-mail-search-open .header-mail-search-panel {
  transform: translateY(0);
  opacity: 1;
}
.header-mail-search-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.header-mail-search-panel input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0 96px 0 12px;
  border: 1px solid rgba(180, 186, 198, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #1f2328;
  font: inherit;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.header-mail-search-panel input:focus {
  border-color: rgba(90, 140, 220, 0.65);
  box-shadow: 0 0 0 2px rgba(90, 140, 220, 0.18);
}
.header-mail-search-panel input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.header-mail-search-scope {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 42%;
  height: 24px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #2a2d35;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(42, 45, 53, 0.1);
  z-index: 1;
}
.header-mail-search-scope:hover {
  background: #f7f8fa;
}
.header-mail-search-scope svg {
  flex: none;
  opacity: 0.55;
}
html.header-feature-search .header-mail-search-scope { display: none; }
/* Channels and DMs: the messages found, right under the strip. */
.header-chat-search-results { display: none; margin: 4px 0 2px; max-height: min(320px, 50vh); }
html.header-chat-search .header-chat-search-results:not(:empty) { display: block; }
html.header-feature-search .header-mail-search-panel input { padding-right: 12px; }
.header-mail-search-close {
  flex: none;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.header-mail-search-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1f2328;
}
@media (prefers-reduced-motion: reduce) {
  .header-mail-search-slot,
  .header-mail-search-panel {
    transition: none !important;
  }
}
.header-notif-empty {
  margin: 0;
  text-align: center;
  color: #8b8e98;
  font-size: 14px;
  line-height: 1.4;
  padding: 10px 6px;
}
.header-notif-msg {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 6px 4px 2px;
  text-align: left;
  cursor: pointer;
  color: var(--text-strong, #1a1d26);
  display: grid;
  gap: 2px;
}
.header-notif-msg:hover { background: rgba(255, 255, 255, .35); }
.header-notif-msg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.header-notif-msg-who {
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-notif-msg-time {
  flex: none;
  font-size: 12px;
  color: #8b8e98;
}
.header-notif-msg-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: #3f4350;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.member-menu-wrap { position: relative; display: flex; align-items: center; gap: 4px; }
.member-search-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 12; width: 260px;
  background: var(--glass-chip-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 8px;
}
.member-search-menu input,
.member-search-menu input[type="text"] {
  width: 100%;
  border: 1px solid rgba(216, 216, 220, 0.65);
  border-radius: 4px;
  padding: 8px 10px;
  background: transparent;
}
.member-search-menu input:focus-visible,
.member-search-menu input[type="text"]:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
}
.member-search-results { max-height: 280px; overflow: auto; margin-top: 6px; }
.member-search-results button {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  border: none; background: transparent; border-radius: 4px; padding: 6px 8px; color: var(--text-strong);
}
.member-search-results button:hover { background: var(--accent-soft); }
.member-search-results .avatar { width: 28px; height: 28px; font-size: 11px; }
.member-search-empty { color: #8b8e98; font-size: 13px; padding: 8px; }
.member-search-results .chat-search-hit {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.member-search-results .chat-search-hit strong {
  font-size: 13px;
  color: var(--text-strong);
}
.member-search-results .chat-search-hit span {
  font-size: 12px;
  color: #6b7080;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* Header search = in-chat search (DM/channel), not people directory. */
.header-ico-members { display: none !important; }
.header-ico-search { display: block !important; }
/* Own profile lives in the left rail — never next to outgoing bubbles. */
.msg.mine .msg-avatar-slot {
  display: none !important;
}
/* …but in «Диалог» both sides show who wrote, so own messages get the avatar too. */
#dialogue-overlay .msg.mine .msg-avatar-slot {
  display: block !important;
}
/* DM header: avatar + name are enough (no @ / member count). */
.channel-heading-btn.is-profile #channel-prefix {
  display: none !important;
}
.channel-heading-btn.is-profile ~ .header-actions #member-count {
  display: none !important;
}
/* Keep glass header + search popover above the message list. */
.main > .channel-header {
  z-index: 12;
}
.channel-header .member-menu-wrap {
  z-index: 13;
}
.channel-header .member-search-menu {
  z-index: 40;
}
.count { color: #8b8e98; font-size: 13px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 4px; border: none; background: transparent; color: #555;
  display: grid; place-items: center; font-size: 20px; line-height: 1;
}
.icon-btn:hover { background: #f2f2f2; }
.sidebar .icon-btn { color: #fff; }
.sidebar .icon-btn:hover { background: rgba(255,255,255,.12); }

.thread {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: transparent;
}
.thread::before,
.thread::after { content: none; display: none; }
.messages {
  position: relative; z-index: 1;
  flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 20px;
  background: transparent;
}
html[data-wallpaper="custom"] .thread {
  background: transparent;
}
html[data-wallpaper="custom"] .thread::before,
html[data-wallpaper="custom"] .thread::after {
  content: none;
  display: none;
}
.jump {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2;
  background: var(--sidebar); color: #fff; border: none; border-radius: 16px; padding: 6px 12px;
  font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
/* Header and composer overlay the message list so backdrop-filter samples bubbles,
   not only the wallpaper behind a flex sibling. */
html.chat-chrome-overlay .main {
  --chat-banner-h: 0px;
  --chat-pin-top: 76px;
  --chat-overlay-top: 64px;
  --chat-overlay-bottom: 48px;
  --chat-scroll-top: 76px;
  --chat-scroll-bottom: 96px;
}
html.chat-chrome-overlay .main > .banner:not(.hidden) {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  z-index: 14;
}
html.chat-chrome-overlay .main > .channel-header {
  position: absolute;
  top: calc(8px + var(--chat-banner-h, 0px));
  left: 12px;
  right: 12px;
  margin: 0;
  z-index: 12;
}
html.chat-chrome-overlay .main > .pinned-banner:not(.hidden) {
  position: absolute;
  top: var(--chat-pin-top, 76px);
  left: 12px;
  right: 12px;
  margin: 0;
  z-index: 11;
}
html.chat-chrome-overlay .main > .composer-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  margin: 0;
  z-index: 4;
}
html.chat-chrome-overlay .main > .thread {
  position: absolute;
  inset: 0;
  z-index: 1;
}
html.chat-chrome-overlay .thread > .messages {
  position: absolute;
  inset: 0;
  padding-top: var(--chat-overlay-top, 64px);
  padding-bottom: var(--chat-overlay-bottom, 48px);
  scroll-padding-top: var(--chat-scroll-top, 76px);
  scroll-padding-bottom: var(--chat-scroll-bottom, 96px);
}
html.chat-chrome-overlay .thread > .typing {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--chat-scroll-bottom, 96px);
  z-index: 2;
  margin: 0;
}
html.chat-chrome-overlay .thread > .jump {
  bottom: calc(8px + var(--chat-scroll-bottom, 96px));
}
/* The chat sits in its own glass card over the wallpaper (desktop): header,
   messages and composer inside, the wallpaper showing around it. */
@media (min-width: 801px) {
  html.chat-chrome-overlay .main::after {
    content: "";
    position: absolute;
    inset: 12px;
    z-index: 0;
    border-radius: 22px;
    background: var(--glass-window-bg, rgba(255, 255, 255, .55));
    border: 1px solid rgba(255, 255, 255, .75);
    box-shadow: 0 12px 40px rgba(40, 50, 110, .10);
    pointer-events: none;
  }
  html.chat-chrome-overlay .main > .thread {
    inset: 13px;
    border-radius: 21px;
    overflow: hidden;
  }
  html.chat-chrome-overlay .main > .channel-header {
    top: calc(22px + var(--chat-banner-h, 0px));
    left: 22px;
    right: 22px;
    border-radius: 16px;
  }
  html.chat-chrome-overlay .main > .pinned-banner:not(.hidden) {
    /* --chat-pin-top is already the header's bottom + 6px (19-chat.js). */
    top: calc(2px + var(--chat-pin-top, 76px));
    left: 22px;
    right: 22px;
  }
  html.chat-chrome-overlay .main > .composer-wrap {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 8px 10px 10px;
  }
  html.chat-chrome-overlay .main > .composer-wrap .composer-shell { border-radius: 16px; }
}
.empty-thread { color: var(--on-wallpaper-muted, #3a4150); padding: 32px 20px; font-size: calc(15px * var(--text-scale, 1)); }

/* Mobile: after the avatar has flown into the header, the name (then the topic)
   appears left to right. Runs once per opening (is-name-reveal, see app.js). */
@keyframes header-name-reveal {
  from { clip-path: inset(0 100% 0 0); opacity: 0.35; transform: translateX(-6px); }
  to { clip-path: inset(0 0 0 0); opacity: 1; transform: none; }
}
.channel-header.is-name-reveal #channel-name,
.channel-header.is-name-reveal #channel-prefix {
  animation: header-name-reveal 420ms cubic-bezier(.22, .61, .36, 1) both;
}
.channel-header.is-name-reveal #channel-topic {
  animation: header-name-reveal 420ms cubic-bezier(.22, .61, .36, 1) 90ms both;
}
@media (prefers-reduced-motion: reduce) {
  .channel-header.is-name-reveal #channel-name,
  .channel-header.is-name-reveal #channel-prefix,
  .channel-header.is-name-reveal #channel-topic { animation: none; }
}

/* A new notification where the header's bell isn't on screen (settings, the
   phone's chat list…): a card floating at the top of the window. */
.notif-float {
  position: fixed;
  left: 50%;
  top: max(10px, calc(var(--sat) + 8px));
  z-index: 5000;
  width: min(420px, calc(100vw - 24px));
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 6px 8px 10px;
  box-sizing: border-box;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .22), 0 0 0 1px rgba(15, 23, 42, .06);
  transform: translate(-50%, calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.notif-float.is-open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.notif-float-msg {
  appearance: none;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 2px 4px;
  text-align: left;
  cursor: pointer;
  color: var(--text-strong, #1a1d26);
  display: grid;
  gap: 2px;
  font: inherit;
}
.notif-float-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.notif-float-who { font-size: 14px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-float-time { flex: none; font-size: 12px; color: #8b8e98; }
.notif-float-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: #3f4350;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-float-close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8b8e98;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.notif-float-close:hover { background: rgba(15, 23, 42, .06); color: #3f4350; }
@media (prefers-reduced-motion: reduce) { .notif-float { transition: none; } }

/* —— Pin banner: the sheets-with-a-clip and the pin history (39-pin-history.js) —— */
.pinned-banner-clip {
  appearance: none; border: 0; background: transparent; cursor: pointer; flex: none;
  width: 36px; align-self: stretch; display: grid; place-items: center; padding: 0;
  margin: -2px 2px -2px -4px; border-radius: 8px; color: #1a1d26;
  transition: background .15s ease, transform .15s ease;
}
.pinned-banner-clip:hover { background: rgba(16, 24, 40, .06); }
.pinned-banner-clip:active { transform: scale(.94); }
.pinned-banner-clip[aria-expanded="true"] { background: rgba(16, 24, 40, .08); }
.pin-history { position: fixed; inset: 0; z-index: 60; }
.pin-history-card {
  position: fixed; display: flex; flex-direction: column; box-sizing: border-box;
  padding: 8px 14px 14px; border-radius: 16px;
  background: var(--glass-window-bg, rgba(255, 255, 255, .55));
  -webkit-backdrop-filter: blur(var(--glass-blur, 16px)) saturate(1.2);
  backdrop-filter: blur(var(--glass-blur, 16px)) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 12px 36px rgba(16, 24, 40, .18);
  transform: scale(.06); opacity: 0;
  transition: transform .26s cubic-bezier(.2, .9, .25, 1.05), opacity .18s ease;
}
.pin-history.is-open .pin-history-card { transform: none; opacity: 1; }
.pin-history.is-closing .pin-history-card { transform: scale(.06); opacity: 0; transition-duration: .2s, .16s; }
@media (prefers-reduced-motion: reduce) {
  .pin-history-card { transition: opacity .12s ease; transform: none; }
  .pin-history.is-closing .pin-history-card { transform: none; }
}
.pin-history-head { display: flex; align-items: center; gap: 6px; flex: none; margin: 0 0 8px -6px; }
.pin-history-back { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #1a1d26; }
.pin-history-titles { display: flex; flex-direction: column; min-width: 0; }
.pin-history-titles h2 { margin: 0; font-size: calc(18px * var(--text-scale, 1)); color: #1a1d26; }
.pin-history-count { color: #6b7080; font-size: calc(12.5px * var(--text-scale, 1)); }
.pin-history-list {
  flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 2px 2px 4px;
}
.pin-history-item {
  appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; padding: 7px 10px 6px; border-radius: 12px;
  border: 0; background: color-mix(in srgb, #ffffff var(--glass-text-mix, 100%), transparent);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 3px 10px rgba(38, 44, 96, .10);
  transition: transform .12s ease;
}
.pin-history-item:hover { transform: translateY(-1px); }
.pin-history-item.is-current { box-shadow: inset 3px 0 0 var(--accent, #1c58d9), 0 1px 2px rgba(16, 24, 40, .08), 0 3px 10px rgba(38, 44, 96, .10); }
.pin-history-item.is-gone { cursor: default; opacity: .7; }
.pin-history-item.is-gone:hover { transform: none; }
.pin-history-item-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pin-history-item .avatar.pin-history-avatar { width: 22px; height: 22px; min-width: 22px; min-height: 22px; max-width: 22px; max-height: 22px; flex: 0 0 22px; font-size: 10px; align-self: center; }
.pin-history-avatar .presence, .pin-history-avatar [class*="presence"] { display: none !important; }
.pin-history-item-who { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1 1 auto; line-height: 1.2; }
.pin-history-item-who strong { font-size: calc(12.5px * var(--text-scale, 1)); color: #1a1d26; white-space: nowrap; }
.pin-history-item-who span { font-size: calc(11px * var(--text-scale, 1)); color: #8b8e98; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-history-badge {
  flex: none; padding: 1px 6px; border-radius: 999px; font-size: calc(10.5px * var(--text-scale, 1)); font-weight: 650;
  background: color-mix(in srgb, var(--accent, #1c58d9) 14%, #fff); color: var(--accent, #1c58d9);
}
.pin-history-item-body {
  font-size: calc(13px * var(--text-scale, 1)); color: #1a1d26; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.pin-history-item-meta { font-size: calc(10.5px * var(--text-scale, 1)); color: #9aa0ab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-history-search { margin-left: auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #3f4350; }
.pin-history-list { gap: 6px; }
.pin-item-menu {
  position: fixed; z-index: 2; min-width: 190px; padding: 4px; border-radius: 10px;
  background: #fff; border: 1px solid #e6e8ee; box-shadow: 0 10px 28px rgba(16, 24, 40, .18);
  display: flex; flex-direction: column;
}
.pin-item-menu-btn {
  appearance: none; border: 0; background: transparent; text-align: left; font: inherit; cursor: pointer;
  padding: 8px 10px; border-radius: 7px; color: #1a1d26; font-size: calc(13.5px * var(--text-scale, 1));
}
.pin-item-menu-btn:hover { background: #f2f4f8; }
.pin-item-menu-btn.is-danger { color: #c4323c; }
.pin-history-empty { padding: 24px 12px; text-align: center; color: #6b7080; font-size: calc(14px * var(--text-scale, 1)); }
.pin-history-search.is-active { background: rgba(16, 24, 40, .07); color: var(--accent, #1c58d9); }
.pin-history-find { flex: none; margin: 0 0 8px; }
.pin-history-find[hidden] { display: none; }
.pin-history-find-input {
  width: 100%; box-sizing: border-box; height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid rgba(16, 24, 40, .12); background: rgba(255, 255, 255, .8);
  font: inherit; font-size: calc(14px * var(--text-scale, 1)); color: #1a1d26; outline: none;
}
.pin-history-find-input:focus { border-color: color-mix(in srgb, var(--accent, #1c58d9) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #1c58d9) 14%, transparent); }
/* The clip icon: two sheets that turn over at each click (39-pin-history.js). */
.pinned-banner-clip { --pin-paper: #fff; }
.pinned-banner-clip .clip-sheet { transform-box: view-box; transform-origin: 12px 12px; }
.pin-history-item.is-new { animation: pin-item-in .3s ease-out; }
@keyframes pin-item-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .pin-history-item.is-new { animation: none; }
}
/* The clip in the colour of the composer's icons (smiley, microphone). */
.pinned-banner-clip { color: #8b8e98; }
@media (hover: hover) {
  .pinned-banner-clip:hover { color: var(--accent); background: transparent; }
}
.pinned-banner-clip:active,
.pinned-banner-clip[aria-expanded="true"] { color: var(--accent); background: transparent; }
