/* =====================================================================
   Social: the messenger (class room, DMs, groups), the pickers, the
   animated stickers, side notifications, and the profile editor.
   ===================================================================== */

/* ------------------------------------------------------------- FAB -- */
.chat-fab{
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--z-fab);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 750;
  font-size: .98rem;
  box-shadow: var(--sh-pop);
  transition: transform var(--t) var(--spring), opacity var(--t) var(--ease), background var(--t) var(--ease);
}
.chat-fab .ic{ width: 22px; height: 22px; }
.chat-fab:hover{ transform: translateY(-2px); }
.chat-fab:active{ transform: scale(.96); }
.chat-badge{
  position: absolute;
  top: -7px; right: -7px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--now);
  color: #fff;
  font-size: .74rem;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 0 0 3px var(--bg);
  animation: pop .4s var(--spring);
}
body.chat-open .chat-fab{ opacity: 0; pointer-events: none; transform: scale(.9); }
@media (max-width: 900px){ .chat-fab{ display: none; } }

/* ------------------------------------------------------- messenger -- */
.messenger{
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--z-chat);
  width: min(920px, calc(100vw - 48px));
  height: min(680px, calc(100dvh - var(--header-h) - 40px));
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--sh-pop);
  overflow: hidden;
  transform-origin: bottom right;
  animation: msIn .38s var(--ease-out) both;
}
.messenger.closing{ animation: msOut .2s var(--ease) both; }
@keyframes msIn{ from{ opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes msOut{ to{ opacity: 0; transform: translateY(12px) scale(.97); } }
.messenger.big{ width: min(1180px, calc(100vw - 48px)); height: calc(100dvh - var(--header-h) - 40px); }

.ms-side{
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}
.ms-side-head{ display: flex; align-items: center; gap: 6px; padding: 16px 14px 10px 18px; }
.ms-side-head h2{ flex: 1; font-size: 1.35rem; }
.ms-search{ position: relative; margin: 0 12px 8px; }
.ms-search .ic{ position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); }
.ms-search input{ min-height: 38px !important; padding: 7px 12px 7px 35px !important; border-radius: 11px !important; font-size: .88rem !important; background: var(--surface) !important; }
.ms-list{ flex: 1; overflow-y: auto; padding: 4px 8px 12px; overscroll-behavior: contain; }
.ms-sec{ font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 12px 10px 5px; }
.ms-item{
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 13px;
  background: none;
  text-align: left;
  color: var(--ink);
  transition: background var(--t-fast) var(--ease);
}
.ms-item:hover{ background: var(--surface-3); }
.ms-item.on{ background: var(--surface); box-shadow: var(--sh-1); }
.ms-item .mi-b{ flex: 1; min-width: 0; }
.ms-item .mi-top{ display: flex; align-items: baseline; gap: 6px; }
.ms-item .mi-name{ flex: 1; min-width: 0; font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-item .mi-time{ font-size: .72rem; color: var(--ink-4); flex: none; }
.ms-item .mi-last{ display: flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--ink-3); }
.ms-item .mi-last span{ flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-item .mi-last .ic{ width: 14px; height: 14px; flex: none; }
.ms-item.unread .mi-name{ font-weight: 800; }
.ms-item.unread .mi-last{ color: var(--ink); font-weight: 600; }
.mi-badge{
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--now);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  flex: none;
}
.ms-item.muted .mi-badge{ background: var(--ink-4); }
.class-av{
  width: 40px; height: 40px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--display);
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: -.02em;
}
.class-av img{ width: 26px; height: 26px; filter: brightness(0) invert(1); }
:root[data-theme="dark"] .class-av img{ filter: brightness(0); }
.group-av{ position: relative; width: 40px; height: 40px; flex: none; }
.group-av .avatar{ position: absolute; --av: 28px; box-shadow: 0 0 0 2px var(--surface-2); }
.group-av .avatar:first-child{ left: 0; top: 0; }
.group-av .avatar:nth-child(2){ right: 0; bottom: 0; }
.ms-side-foot{ padding: 10px 14px 14px; border-top: 1px solid var(--line); }

.ms-thread{ position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.ms-head{
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
  min-height: 66px;
}
.ms-head .mh-b{ flex: 1; min-width: 0; }
.ms-head h3{ font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-head p{ margin: 1px 0 0; font-size: .8rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-head .mh-actions{ display: flex; gap: 4px; }
.ms-back{ display: none !important; }
.ms-notice{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  font-size: .76rem;
  color: var(--ink-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.ms-notice .ic{ width: 14px; height: 14px; color: var(--good); }
.ms-notice.warn{ color: var(--bad); background: var(--bad-soft); }
.ms-notice.warn .ic{ color: var(--bad); }

.ms-msgs{
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scroll-behavior: auto;
}
.msg-day{
  align-self: center;
  margin: 14px 0 8px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: .72rem;
  font-weight: 750;
}
.msg-new{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
  color: var(--now-ink);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.msg-new::before, .msg-new::after{ content: ""; flex: 1; height: 1.5px; background: var(--now-line); }
.msg-group{ display: flex; gap: 9px; align-items: flex-end; margin-top: 8px; max-width: 100%; }
.msg-group .avatar{ margin-bottom: 2px; }
.msg-col{ display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; max-width: min(78%, 560px); }
.msg-name{ font-size: .76rem; font-weight: 750; color: var(--ink-2); margin: 0 0 2px 4px; display: flex; gap: 6px; align-items: baseline; }
.msg-name time{ font-weight: 500; color: var(--ink-4); font-size: .7rem; }
.msg-name .role{ font-size: .64rem; font-weight: 800; padding: 1px 5px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-ink); }
.msg-group.me{ flex-direction: row-reverse; }
.msg-group.me .msg-col{ align-items: flex-end; }
.msg-group.me .msg-name{ margin: 0 4px 2px 0; }
.msg-group.me .avatar{ display: none; }

.msg-wrap{ position: relative; display: flex; flex-direction: column; align-items: inherit; max-width: 100%; }
.msg{
  position: relative;
  padding: 8px 13px;
  border-radius: 18px;
  background: var(--surface-3);
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: bubbleIn .28s var(--ease-out) both;
  max-width: 100%;
}
@keyframes bubbleIn{ from{ opacity: 0; transform: translateY(6px) scale(.97); } }
.msg-group:not(.me) .msg-wrap:not(:first-of-type) .msg{ border-top-left-radius: 6px; }
.msg-group:not(.me) .msg-wrap:not(:last-child) .msg{ border-bottom-left-radius: 6px; }
.msg-group.me .msg{ background: var(--brand); color: var(--on-brand); }
.msg-group.me .msg-wrap:not(:first-of-type) .msg{ border-top-right-radius: 6px; }
.msg-group.me .msg-wrap:not(:last-child) .msg{ border-bottom-right-radius: 6px; }
.msg a{ color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg .mention{ font-weight: 800; color: var(--brand-ink); background: var(--brand-soft); border-radius: 5px; padding: 0 3px; }
.msg-group.me .msg .mention{ color: inherit; background: rgba(255, 255, 255, .2); }
.msg.mentions-me{ box-shadow: inset 3px 0 0 var(--now); }
.msg.pending{ opacity: .6; }
.msg.big-emoji{ background: none !important; font-size: 2.6rem; line-height: 1.1; padding: 0 2px; }
.msg .edited{ font-size: .7rem; opacity: .7; margin-left: 5px; }
.msg-quote{
  display: block;
  margin: 0 0 6px;
  padding: 4px 9px;
  border-left: 3px solid currentColor;
  border-radius: 6px;
  background: rgba(127, 127, 127, .12);
  font-size: .8rem;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
  cursor: pointer;
}
.msg-quote b{ margin-right: 5px; }
.msg-media{
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-3);
  max-width: min(300px, 100%);
  cursor: zoom-in;
  animation: bubbleIn .28s var(--ease-out) both;
}
.msg-media img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-media.loading::after{ content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.msg-media.failed{ display: grid; place-items: center; font-size: .8rem; color: var(--ink-3); padding: 20px; cursor: default; }
.msg-sticker{ width: 148px; height: 148px; animation: bubbleIn .3s var(--spring) both; }
.msg-reacts{ display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 2px 0; }
.msg-react{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  font-size: .85rem;
  line-height: 1;
  color: var(--ink-2);
  box-shadow: var(--sh-1);
  animation: pop .35s var(--spring);
}
.msg-react b{ font-size: .74rem; font-weight: 800; }
.msg-react.mine{ border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }

/* hover toolbar on a message */
.msg-tools{
  position: absolute;
  top: -18px;
  right: -6px;
  z-index: 3;
  display: none;
  gap: 1px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--sh-2);
}
.msg-group.me .msg-tools{ right: auto; left: -6px; }
.msg-wrap:hover .msg-tools, .msg-wrap.tools .msg-tools, .msg-tools:focus-within{ display: flex; }
.msg-tools button{
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1;
}
.msg-tools button:hover{ background: var(--surface-3); color: var(--ink); }
.msg-tools button .ic{ width: 17px; height: 17px; }
.msg-tools .q{ font-size: 1.05rem; }
.msg-tools button.danger:hover{ color: var(--bad); }
@media (hover: none){ .msg-wrap:hover .msg-tools{ display: none; } .msg-wrap.tools .msg-tools{ display: flex; } }

.ms-jump{
  position: absolute;
  right: 18px;
  bottom: 86px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: .8rem;
  font-weight: 750;
  box-shadow: var(--sh-2);
  animation: pop .3s var(--spring);
}
.ms-jump .ic{ width: 15px; height: 15px; }

.ms-reply{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px;
  padding: 8px 10px 8px 12px;
  border-radius: 12px 12px 0 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom: 0;
  font-size: .82rem;
  color: var(--ink-3);
  animation: fadeIn .2s var(--ease);
}
.ms-reply .ic{ width: 16px; height: 16px; color: var(--brand-ink); flex: none; }
.ms-reply span{ flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-reply b{ color: var(--ink); }
.ms-reply button{ border: 0; background: none; color: var(--ink-3); font-size: 1.1rem; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.ms-reply button:hover{ color: var(--ink); background: var(--surface-3); }

.ms-compose{
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.ms-compose textarea{
  flex: 1;
  min-height: 42px !important;
  max-height: 160px;
  height: 42px;
  padding: 10px 14px !important;
  border-radius: 21px !important;
  resize: none;
  line-height: 1.35 !important;
  font-size: .95rem !important;
  background: var(--surface-2) !important;
}
.ms-compose .icon-btn{ border-radius: 50%; flex: none; }
.ms-compose .icon-btn.flat.on{ color: var(--brand-ink); background: var(--brand-soft); }
.ms-send{ width: 42px !important; height: 42px !important; }
.ms-send:disabled{ opacity: .45; }
.ms-mention{
  position: absolute;
  left: 60px;
  bottom: 66px;
  z-index: 6;
  width: 260px;
  max-height: 220px;
  overflow-y: auto;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--sh-pop);
}
.ms-mention button{ display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: none; text-align: left; font-weight: 650; font-size: .88rem; }
.ms-mention button.on, .ms-mention button:hover{ background: var(--brand-soft); }

.chat-gate{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: .9rem;
}
.chat-empty{
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 34ch;
  text-align: center;
  color: var(--ink-3);
  padding: 30px 10px;
}
.chat-empty .hand{ font-size: 1.7rem; color: var(--brand-ink); transform: rotate(-3deg); }
.chat-empty .ic{ width: 38px; height: 38px; color: var(--brand); stroke-width: 1.5; }

/* ------------------------------------------------ picker popover -- */
.ms-picker{
  position: absolute;
  left: 12px; right: 12px;
  bottom: 66px;
  z-index: 5;
  height: min(360px, 62%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--sh-pop);
  overflow: hidden;
  animation: popUp .26s var(--ease-out) both;
  transform-origin: bottom center;
}
@keyframes popUp{ from{ opacity: 0; transform: translateY(8px) scale(.97); } }
.pk-tabs{ display: flex; align-items: center; gap: 4px; padding: 8px 8px 0; }
.pk-tab{
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-3);
  font-weight: 750;
  font-size: .85rem;
}
.pk-tab.on{ background: var(--surface-3); color: var(--ink); }
.pk-tabs .grow{ flex: 1; }
.pk-search{ padding: 8px 10px 6px; }
.pk-search input{ min-height: 36px !important; padding: 6px 12px !important; font-size: .88rem !important; border-radius: 10px !important; }
.pk-cats{ display: flex; gap: 2px; padding: 0 8px 4px; overflow-x: auto; scrollbar-width: none; }
.pk-cats::-webkit-scrollbar{ display: none; }
.pk-cats button{ flex: none; width: 34px; height: 30px; border: 0; border-radius: 8px; background: none; font-size: 1.1rem; opacity: .6; }
.pk-cats button.on{ opacity: 1; background: var(--surface-3); }
.pk-body{ flex: 1; overflow-y: auto; padding: 4px 8px 10px; overscroll-behavior: contain; }
.pk-label{ font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); padding: 8px 4px 4px; }
.emo-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
.emo-grid button{
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 1.45rem;
  line-height: 1;
  transition: transform var(--t-fast) var(--spring), background var(--t-fast) var(--ease);
}
.emo-grid button:hover{ background: var(--surface-3); transform: scale(1.18); }
.stk-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.stk-grid button{
  aspect-ratio: 1;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.stk-grid button:hover{ border-color: var(--brand-line); transform: translateY(-2px); }
.gif-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.gif-tile{
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-3);
}
.gif-tile img{ width: 100%; height: 100%; object-fit: cover; }
.gif-tile .gt-name{ position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: .7rem; font-weight: 700; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gif-tile .gt-x{ position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: .85rem; display: none; }
.gif-tile:hover .gt-x{ display: grid; place-items: center; }
.gif-up{
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: none;
  color: var(--ink-3);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}
.gif-up:hover{ border-color: var(--brand); color: var(--brand-ink); }
.pk-empty{ padding: 22px 10px; text-align: center; color: var(--ink-3); font-size: .86rem; }

/* quick reaction row */
.react-pop{
  position: fixed;
  z-index: calc(var(--z-chat) + 2);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-pop);
  animation: popIn .22s var(--spring) both;
}
.react-pop button{ width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; font-size: 1.4rem; transition: transform var(--t-fast) var(--spring), background var(--t-fast); }
.react-pop button:hover{ transform: scale(1.25) translateY(-3px); background: var(--surface-3); }
.react-pop .more{ font-size: 1rem; color: var(--ink-3); }

/* people picker for new chats */
.pp-list{ display: flex; flex-direction: column; gap: 2px; max-height: 44vh; overflow-y: auto; margin: 8px -6px 0; padding: 0 6px; }
.pp-row{ display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 12px; cursor: pointer; }
.pp-row:hover{ background: var(--surface-2); }
.pp-row input{ margin-left: auto; }
.pp-row b{ display: block; font-size: .92rem; }
.pp-row small{ display: block; font-size: .76rem; color: var(--ink-3); }
.member-row{ display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.member-row .grow b{ display: block; font-size: .92rem; }
.member-row .grow small{ font-size: .76rem; color: var(--ink-3); }

/* ------------------------------------------------ side notifications -- */
.notify-stack{
  position: fixed;
  top: calc(var(--header-h) + 12px);
  right: 16px;
  z-index: var(--z-notify);
  width: min(360px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.ntf{
  position: relative;
  pointer-events: auto;
  display: flex;
  gap: 11px;
  padding: 13px 13px 13px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-pop);
  overflow: hidden;
  animation: ntfIn .42s var(--ease-out) both;
  cursor: pointer;
}
.ntf::before{ content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.ntf.dm::before{ background: var(--now); }
.ntf.leaving{ animation: ntfOut .25s var(--ease) both; }
@keyframes ntfIn{ from{ opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes ntfOut{ to{ opacity: 0; transform: translateX(40px); } }
.ntf .nb{ flex: 1; min-width: 0; }
.ntf .nt{ display: flex; align-items: baseline; gap: 6px; font-size: .86rem; }
.ntf .nt b{ font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ntf .nt small{ color: var(--ink-3); font-size: .74rem; white-space: nowrap; }
.ntf .nx{ font-size: .9rem; color: var(--ink-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ntf .nclose{ align-self: flex-start; flex: none; width: 26px; height: 26px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); font-size: 1.1rem; line-height: 1; }
.ntf .nclose:hover{ background: var(--surface-3); color: var(--ink); }
.ntf form{ display: flex; gap: 6px; margin-top: 9px; }
.ntf form input{ min-height: 34px !important; padding: 5px 11px !important; font-size: .84rem !important; border-radius: 17px !important; }
.ntf form .icon-btn{ width: 34px; height: 34px; border-radius: 50%; flex: none; }
.ntf .nbar{ position: absolute; left: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--brand) 40%, transparent); animation: ntfBar linear forwards; animation-duration: var(--life, 7s); transform-origin: left; width: 100%; }
.ntf:hover .nbar, .ntf:focus-within .nbar{ animation-play-state: paused; }
@keyframes ntfBar{ from{ transform: scaleX(1); } to{ transform: scaleX(0); } }
@media (max-width: 900px){
  .notify-stack{ top: auto; bottom: calc(var(--bottom-h) + 10px); right: 10px; left: 10px; width: auto; flex-direction: column-reverse; }
  @keyframes ntfIn{ from{ opacity: 0; transform: translateY(24px) scale(.97); } }
}

/* ---------------------------------------------------- phone layout -- */
@media (max-width: 900px){
  .messenger{
    inset: 0;
    right: 0; bottom: 0;
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    grid-template-columns: 1fr;
    animation-name: msUp;
  }
  @keyframes msUp{ from{ transform: translateY(24px); opacity: 0; } }
  .messenger .ms-thread{ display: none; }
  .messenger.show-thread .ms-side{ display: none; }
  .messenger.show-thread .ms-thread{ display: flex; }
  .ms-back{ display: grid !important; }
  .ms-side-head{ padding-top: calc(14px + env(safe-area-inset-top)); }
  .ms-head{ padding-top: calc(10px + env(safe-area-inset-top)); padding-left: 8px; }
  .ms-compose{ padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .msg-col{ max-width: 84%; }
  .ms-picker{ left: 6px; right: 6px; height: 50%; }
  .ms-side-foot{ padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.chat-open{ overflow: hidden; }
  .ms-expand{ display: none !important; }
}

/* ------------------------------------------------------- stickers -- */
/* Every sticker is drawn with HTML and CSS, so they're tiny, sharp at any
   size, and never need a download. They loop only while on screen. */
.stk{
  position: relative;
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1;
  user-select: none;
  container-type: size;
  --u: 1cqw;
}
.stk *{ animation-play-state: paused; }
.stk.on *, .stk:hover *{ animation-play-state: running; }
html.reduce-motion .stk *{ animation: none !important; }
.stk .t{ position: relative; z-index: 2; text-align: center; letter-spacing: -.03em; }
.stk .lt{ display: inline-block; }

.stk-letsgo{ background: radial-gradient(circle at 50% 60%, #FFE2CE, #FFB27E); color: #7A2C00; }
.stk-letsgo .t{ font-size: calc(var(--u) * 21); transform: rotate(-8deg); }
.stk-letsgo .lt{ animation: hop .9s var(--spring) infinite; animation-delay: calc(var(--i) * 70ms); }
.stk-letsgo .ln{ position: absolute; left: -20%; height: 4%; border-radius: 3px; background: #fff; opacity: .8; animation: zoomby 1s linear infinite; }
.stk-letsgo .ln:nth-child(1){ top: 20%; width: 40%; }
.stk-letsgo .ln:nth-child(2){ top: 76%; width: 55%; animation-delay: -.4s; }
.stk-letsgo .ln:nth-child(3){ top: 86%; width: 30%; animation-delay: -.7s; }
@keyframes hop{ 0%, 60%, 100%{ transform: translateY(0); } 30%{ transform: translateY(-22%); } }
@keyframes zoomby{ from{ transform: translateX(0); } to{ transform: translateX(380%); } }

.stk-w{ background: #FFF4C8; color: #5B2B8C; }
.stk-w .t{ font-size: calc(var(--u) * 62); animation: wbob 1.6s var(--ease) infinite; }
.stk-w .rays{ position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg, rgba(255, 190, 40, .55) 0 12deg, transparent 12deg 30deg); animation: spin 8s linear infinite; }
@keyframes wbob{ 50%{ transform: scale(1.08) rotate(-4deg); } }
@keyframes spin{ to{ transform: rotate(360deg); } }

.stk-l{ background: #E3E8F2; color: #3C4A66; }
.stk-l .t{ font-size: calc(var(--u) * 62); transform-origin: 20% 90%; animation: droop 2.2s var(--ease) infinite; }
.stk-l .drop{ position: absolute; right: 26%; top: 22%; width: 9%; height: 13%; background: #6AA8FF; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; animation: sweat 2.2s ease-in infinite; }
@keyframes droop{ 0%, 30%{ transform: rotate(0); } 55%, 80%{ transform: rotate(-14deg) translateY(4%); } 100%{ transform: rotate(0); } }
@keyframes sweat{ 0%, 40%{ opacity: 0; transform: translateY(0); } 55%{ opacity: 1; } 100%{ opacity: 0; transform: translateY(160%); } }

.stk-gg{ background: #1E1535; color: #fff; }
.stk-gg .t{ font-size: calc(var(--u) * 42); background: linear-gradient(90deg, #B98CFF, #FF8A4C, #B98CFF) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 1.6s linear infinite, pulse 1.6s var(--ease) infinite; }
.stk-gg i{ position: absolute; width: 4%; height: 7%; border-radius: 1px; animation: fallc 1.8s linear infinite; }
@keyframes shine{ to{ background-position: -200% 0; } }
@keyframes pulse{ 50%{ transform: scale(1.1); } }
@keyframes fallc{ from{ transform: translateY(-40%) rotate(0); } to{ transform: translateY(1500%) rotate(540deg); } }

.stk-noway{ background: #FFE1E6; color: #B0233C; }
.stk-noway .t{ font-size: calc(var(--u) * 24); animation: shakeit .5s linear infinite; }
.stk-noway .e{ display: block; font-size: calc(var(--u) * 30); margin-bottom: 6%; }
@keyframes shakeit{ 0%, 100%{ transform: translate(0, 0) rotate(0); } 25%{ transform: translate(-3%, 1%) rotate(-3deg); } 75%{ transform: translate(3%, -1%) rotate(3deg); } }

.stk-facts{ background: #FAF8F2; }
.stk-facts .t{
  font-size: calc(var(--u) * 22);
  color: #C0263D;
  border: calc(var(--u) * 2.2) solid #C0263D;
  border-radius: 10%;
  padding: 6% 8%;
  letter-spacing: .06em;
  transform: rotate(-12deg);
  animation: stamp 1.8s var(--ease) infinite;
  -webkit-mask: radial-gradient(circle at 30% 40%, #000 60%, rgba(0,0,0,.75) 61%);
  mask: radial-gradient(circle at 30% 40%, #000 60%, rgba(0,0,0,.75) 61%);
}
@keyframes stamp{ 0%{ transform: rotate(-12deg) scale(2.2); opacity: 0; } 18%{ transform: rotate(-12deg) scale(.94); opacity: 1; } 26%, 100%{ transform: rotate(-12deg) scale(1); opacity: 1; } }

.stk-lol{ background: #E4F7EE; color: #0E7A4F; }
.stk-lol .t{ font-size: calc(var(--u) * 40); }
.stk-lol .lt{ animation: jelly 1.2s var(--ease) infinite; animation-delay: calc(var(--i) * 120ms); }
@keyframes jelly{ 0%, 100%{ transform: scale(1, 1); } 25%{ transform: scale(1.25, .8); } 50%{ transform: scale(.85, 1.2); } 75%{ transform: scale(1.06, .96); } }

.stk-brb{ background: #EAE6FF; color: #3A2A8C; }
.stk-brb .t{ font-size: calc(var(--u) * 40); animation: runoff 2s var(--ease) infinite; }
.stk-brb .d{ position: absolute; left: 12%; height: 3%; background: #3A2A8C; border-radius: 2px; opacity: 0; animation: dash 2s var(--ease) infinite; }
.stk-brb .d:nth-child(1){ top: 44%; width: 22%; }
.stk-brb .d:nth-child(2){ top: 54%; width: 14%; animation-delay: .08s; }
@keyframes runoff{ 0%, 25%{ transform: translateX(0); } 60%{ transform: translateX(140%); } 61%{ transform: translateX(-140%); } 100%{ transform: translateX(0); } }
@keyframes dash{ 20%, 50%{ opacity: .6; } 0%, 60%, 100%{ opacity: 0; } }

.stk-hw{ background: #FFF2DC; color: #6A3B00; }
.stk-hw .t{ font-size: calc(var(--u) * 16); margin-top: 32%; }
.stk-hw .bk{ position: absolute; top: 22%; font-size: calc(var(--u) * 32); animation: wbob 1.8s var(--ease) infinite; }
.stk-hw .q{ position: absolute; font-size: calc(var(--u) * 16); color: #E8641C; opacity: 0; animation: qpop 2.4s var(--ease) infinite; }
.stk-hw .q:nth-of-type(1){ left: 16%; top: 14%; }
.stk-hw .q:nth-of-type(2){ right: 14%; top: 18%; animation-delay: .6s; }
.stk-hw .q:nth-of-type(3){ right: 26%; top: 44%; animation-delay: 1.2s; }
@keyframes qpop{ 0%{ opacity: 0; transform: scale(.3) rotate(-20deg); } 20%{ opacity: 1; transform: scale(1.15) rotate(8deg); } 60%{ opacity: 1; transform: scale(1) rotate(0); } 100%{ opacity: 0; transform: translateY(-40%); } }

.stk-omw{ background: #E0ECFF; color: #1D47B5; }
.stk-omw .t{ font-size: calc(var(--u) * 19); }
.stk-omw .ar{ display: block; margin: 8% auto 0; width: 50%; height: calc(var(--u) * 10); position: relative; }
.stk-omw .ar i{ position: absolute; top: 0; width: calc(var(--u) * 10); height: calc(var(--u) * 10); border-top: calc(var(--u) * 2.4) solid #1D47B5; border-right: calc(var(--u) * 2.4) solid #1D47B5; transform: rotate(45deg); opacity: .2; animation: chev 1.2s linear infinite; }
.stk-omw .ar i:nth-child(1){ left: 0; } .stk-omw .ar i:nth-child(2){ left: 32%; animation-delay: .2s; } .stk-omw .ar i:nth-child(3){ left: 64%; animation-delay: .4s; }
@keyframes chev{ 30%{ opacity: 1; } 70%{ opacity: .2; } }

.stk-tmrw{ background: #FFE9DB; color: #8A3A08; }
.stk-tmrw .e{ font-size: calc(var(--u) * 42); transform-origin: 70% 80%; animation: wave 1.2s var(--ease) infinite; display: inline-block; }
.stk-tmrw .t{ font-size: calc(var(--u) * 15); margin-top: 6%; }
@keyframes wave{ 0%, 100%{ transform: rotate(0); } 20%{ transform: rotate(18deg); } 40%{ transform: rotate(-10deg); } 60%{ transform: rotate(14deg); } 80%{ transform: rotate(-4deg); } }

.stk-heart{ background: #FFE3EA; }
.stk-heart .e{ font-size: calc(var(--u) * 52); animation: beat 1s var(--ease) infinite; }
.stk-heart .h{ position: absolute; bottom: 8%; font-size: calc(var(--u) * 12); opacity: 0; animation: floatup 2.4s var(--ease) infinite; }
.stk-heart .h:nth-of-type(1){ left: 16%; } .stk-heart .h:nth-of-type(2){ right: 18%; animation-delay: .8s; } .stk-heart .h:nth-of-type(3){ left: 44%; animation-delay: 1.6s; }
@keyframes beat{ 0%, 100%{ transform: scale(1); } 15%{ transform: scale(1.2); } 30%{ transform: scale(1); } 45%{ transform: scale(1.12); } }
@keyframes floatup{ 0%{ opacity: 0; transform: translateY(0) scale(.6); } 30%{ opacity: 1; } 100%{ opacity: 0; transform: translateY(-420%) scale(1.1); } }

.stk-fire{ background: radial-gradient(circle at 50% 80%, #FFD08A, #FF7A2E 70%); }
.stk-fire .e{ font-size: calc(var(--u) * 50); animation: flicker .35s steps(2) infinite alternate; transform-origin: bottom; }
.stk-fire .t{ position: absolute; bottom: 9%; font-size: calc(var(--u) * 15); color: #fff; text-shadow: 0 2px 0 #B34700; }
@keyframes flicker{ from{ transform: scale(1, 1) skewX(0); } to{ transform: scale(1.05, 1.1) skewX(-3deg); } }

.stk-cry{ background: #E2EEFF; }
.stk-cry .e{ font-size: calc(var(--u) * 50); animation: sob .5s linear infinite; }
.stk-cry .tear{ position: absolute; top: 56%; width: 5%; height: 9%; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #3E8BFF; animation: tearfall .9s ease-in infinite; }
.stk-cry .tear:nth-of-type(1){ left: 30%; } .stk-cry .tear:nth-of-type(2){ right: 30%; animation-delay: .45s; }
@keyframes sob{ 50%{ transform: translateY(3%); } }
@keyframes tearfall{ from{ transform: translateY(0); opacity: 1; } to{ transform: translateY(300%); opacity: 0; } }

.stk-halfday{ background: #5B2B8C; color: #fff; }
.stk-halfday .t{ font-size: calc(var(--u) * 20); animation: pulse 1.2s var(--ease) infinite; }
.stk-halfday .t small{ display: block; font-family: var(--hand); font-weight: 700; font-size: .7em; color: #FFB27E; margin-top: 6%; letter-spacing: 0; }
.stk-halfday i{ position: absolute; top: -8%; width: 4%; height: 7%; border-radius: 1px; animation: fallc 2s linear infinite; }

.stk-thanks{ background: #FFF6E6; color: #5B2B8C; }
.stk-thanks .t{ font-family: var(--hand); font-weight: 700; font-size: calc(var(--u) * 27); letter-spacing: 0; transform: rotate(-6deg); }
.stk-thanks .t span{ display: inline-block; clip-path: inset(0 100% 0 0); animation: write 2.6s var(--ease) infinite; }
.stk-thanks .e{ position: absolute; right: 16%; bottom: 18%; font-size: calc(var(--u) * 16); animation: beat 1s var(--ease) infinite; }
@keyframes write{ 0%{ clip-path: inset(0 100% 0 0); } 45%, 90%{ clip-path: inset(0 0 0 0); } 100%{ clip-path: inset(0 0 0 0); opacity: 0; } }

.stk-gm{ background: linear-gradient(#BFE0FF, #FFE6C7); color: #6A3B00; }
.stk-gm .sun{ position: absolute; left: 50%; bottom: 30%; width: 38%; aspect-ratio: 1; margin-left: -19%; border-radius: 50%; background: #FFB300; box-shadow: 0 0 0 calc(var(--u) * 4) rgba(255, 179, 0, .25); animation: rise 3s var(--ease) infinite; }
.stk-gm .t{ position: absolute; bottom: 10%; font-size: calc(var(--u) * 15); }
@keyframes rise{ 0%{ transform: translateY(80%); } 40%, 100%{ transform: translateY(0); } }

.stk-study{ background: #EDE7F9; color: #3D1E6A; }
.stk-study .e{ font-size: calc(var(--u) * 38); animation: wbob 2s var(--ease) infinite; }
.stk-study .t{ font-size: calc(var(--u) * 15); margin-top: 6%; }
.stk-study .ring{ position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; border: calc(var(--u) * 1.4) dashed rgba(91, 43, 140, .35); animation: spin 9s linear infinite; }

.stk-done{ background: #E3F4EC; color: #0E7A4F; }
.stk-done svg{ width: 50%; height: 50%; overflow: visible; }
.stk-done path{ fill: none; stroke: #16A06A; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: check 1.8s var(--ease) infinite; }
.stk-done .t{ position: absolute; bottom: 10%; font-size: calc(var(--u) * 16); }
@keyframes check{ 0%{ stroke-dashoffset: 1; } 40%, 100%{ stroke-dashoffset: 0; } }

.stk-3cs{ background: #1C1830; color: #fff; }
.stk-3cs .t{ font-size: calc(var(--u) * 42); }
.stk-3cs .lt{ animation: flip 2.4s var(--ease) infinite; animation-delay: calc(var(--i) * 150ms); }
.stk-3cs .lt:nth-child(1){ color: #FF8A4C; } .stk-3cs .lt:nth-child(2){ color: #C4A2F2; } .stk-3cs .lt:nth-child(3){ color: #9DB9FF; }
.stk-3cs small{ position: absolute; bottom: 12%; font-family: var(--hand); font-size: calc(var(--u) * 13); color: #FFB27E; letter-spacing: 0; }
@keyframes flip{ 0%, 60%, 100%{ transform: rotateX(0); } 30%{ transform: rotateX(360deg); } }

.stk-bruh{ background: #ECEAF1; color: #2A2640; }
.stk-bruh .t{ font-size: calc(var(--u) * 30); animation: slowzoom 2.4s var(--ease) infinite; }
@keyframes slowzoom{ 0%{ transform: scale(.9); } 80%, 100%{ transform: scale(1.18); } }

.stk-yes{ background: #FFE7D6; color: #B24A0E; }
.stk-yes .t{ font-size: calc(var(--u) * 26); animation: stretch 1.1s var(--spring) infinite; }
@keyframes stretch{ 0%, 100%{ transform: scaleX(1); letter-spacing: -.03em; } 50%{ transform: scaleX(1.12); letter-spacing: .04em; } }

/* ------------------------------------------------------ profile -- */
.profile-box{ max-width: 520px; }
.profile-top{ display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.profile-top h2{ font-size: 1.4rem; }
.profile-top p{ margin: 2px 0 0; color: var(--ink-3); font-size: .88rem; }
.drop-zone{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.drop-zone:hover, .drop-zone.over{ border-color: var(--brand); background: var(--brand-soft); }
.drop-zone .ic{ width: 28px; height: 28px; color: var(--brand); }
.drop-zone small{ color: var(--ink-3); }
.crop-stage{ position: relative; width: min(280px, 72vw); aspect-ratio: 1; margin: 8px auto 0; border-radius: 18px; overflow: hidden; background: var(--surface-3); touch-action: none; }
.crop-stage canvas{ width: 100%; height: 100%; cursor: grab; }
.crop-stage canvas:active{ cursor: grabbing; }
.crop-ring{ position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 999px rgba(10, 8, 18, .45); border-radius: 18px; -webkit-mask: radial-gradient(circle at center, transparent 49.5%, #000 50%); mask: radial-gradient(circle at center, transparent 49.5%, #000 50%); }
.crop-ring::after{ content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); }
.crop-zoom{ display: flex; align-items: center; gap: 10px; width: min(280px, 72vw); margin: 12px auto 0; color: var(--ink-3); }
.crop-hint{ text-align: center; font-size: .8rem; color: var(--ink-3); margin-top: 6px; }

/* small menus anchored to a button */
.pop-menu{
  position: fixed;
  z-index: calc(var(--z-chat) + 2);
  min-width: 190px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-pop);
  animation: popIn .2s var(--ease-out) both;
}
.pop-menu button{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
}
.pop-menu button .ic{ width: 18px; height: 18px; color: var(--ink-3); }
.pop-menu button:hover, .pop-menu button:focus-visible{ background: var(--surface-3); outline: none; }
.pop-menu button.danger{ color: var(--bad); }
.pop-menu button.danger .ic{ color: var(--bad); }
.ms-close-list{ display: none !important; }
.ms-thread.drop::after{
  content: "Drop pictures to send them";
  position: absolute;
  inset: 10px;
  z-index: 8;
  display: grid;
  place-items: center;
  border: 2px dashed var(--brand);
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-soft) 85%, transparent);
  color: var(--brand-ink);
  font-weight: 800;
}
@media (max-width: 900px){
  .ms-close-list{ display: inline-flex !important; }
  .ms-head .ms-close{ display: none; }
}
