/* Microsoft Teams (new, neutral light theme) — faithful chat-pane replica.
   Overrides the brand-gradient .chatapp.teams styles in site-v3.css.
   Scoped to .chatapp.teamsx so it cannot leak into Slack. */
.chatapp.teamsx {
  --tx-bg: #f5f5f5;          /* rail + list + app shell */
  --tx-content: #ffffff;     /* main pane, selected row, composer */
  --tx-fg-1: #252423;        /* primary text */
  --tx-fg-2: #616161;        /* secondary text */
  --tx-fg-3: #424242;        /* icon glyphs */
  --tx-stroke: #e0e0e0;      /* dividers */
  --tx-hover: #ededed;
  --tx-brand: #5b5fc7;
  --tx-brand-2: #4f52b5;
  --tx-brand-bg: #e8ebfa;    /* active tint */
  --tx-bub: #f5f5f5;         /* incoming message bubble */
  background: var(--tx-bg); display: flex; color: var(--tx-fg-1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'system-ui', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  font-size: 14px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* — left activity rail (icon-only) — */
.chatapp.teamsx .tx-rail {
  width: 68px; flex: none; background: var(--tx-bg); display: flex;
  flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 12px;
  border-right: 1px solid var(--tx-stroke);
}
.chatapp.teamsx .tx-ric {
  position: relative; width: 44px; height: 44px; border-radius: 6px;
  display: grid; place-items: center; color: var(--tx-fg-3); cursor: default;
}
.chatapp.teamsx .tx-ric svg { width: 22px; height: 22px; stroke-width: 1.6; }
.chatapp.teamsx .tx-ric:hover:not(.on) { background: var(--tx-hover); }
.chatapp.teamsx .tx-ric.on { color: var(--tx-brand-2); background: var(--tx-brand-bg); }
.chatapp.teamsx .tx-ric.on::before {
  content: ""; position: absolute; left: -12px; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--tx-brand-2);
}
.chatapp.teamsx .tx-pill {
  position: absolute; top: 2px; right: 2px; background: #c4314b; color: #fff;
  font-size: 9px; font-weight: 700; padding: 0 4px; border-radius: 8px; line-height: 1.45;
  min-width: 12px; text-align: center; z-index: 1; box-shadow: 0 0 0 2px var(--tx-bg);
}
.chatapp.teamsx .tx-ric.mind { margin-top: auto; width: 36px; height: 36px; }
.chatapp.teamsx .tx-ric.mind img { width: 28px; height: 28px; border-radius: 999px; }
/* — chat list panel — */
.chatapp.teamsx .tx-list {
  width: 264px; flex: none; background: var(--tx-bg); display: flex; flex-direction: column;
  border-right: 1px solid var(--tx-stroke); min-width: 0;
}
.chatapp.teamsx .tx-listhead {
  padding: 13px 8px 6px 16px; display: flex; align-items: center; justify-content: space-between;
}
.chatapp.teamsx .tx-listhead h4 {
  margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--tx-fg-1);
}
.chatapp.teamsx .tx-acts { display: inline-flex; gap: 2px; }
.chatapp.teamsx .tx-ibtn {
  width: 30px; height: 30px; border-radius: 4px; display: grid; place-items: center;
  background: transparent; color: var(--tx-fg-3); border: 0;
}
.chatapp.teamsx .tx-ibtn:hover { background: var(--tx-hover); }
.chatapp.teamsx .tx-ibtn svg { width: 17px; height: 17px; stroke-width: 1.7; }
.chatapp.teamsx .tx-ibtn .caret { width: 12px; height: 12px; margin-left: -3px; }
.chatapp.teamsx .tx-ibtn.combo { width: auto; padding: 0 4px; gap: 0; }
.chatapp.teamsx .tx-section { padding: 6px 14px 2px; }
.chatapp.teamsx .tx-sectit {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; color: var(--tx-fg-3);
}
.chatapp.teamsx .tx-sectit svg { width: 14px; height: 14px; stroke-width: 2; }
.chatapp.teamsx .tx-rows { padding: 2px 6px 12px; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.chatapp.teamsx .tx-row {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 0 10px; height: 52px; box-sizing: border-box; border-radius: 4px; cursor: pointer;
}
.chatapp.teamsx .tx-row:hover:not(.on) { background: var(--tx-hover); }
.chatapp.teamsx .tx-row.on { background: var(--tx-content); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.chatapp.teamsx .tx-row.on:hover { background: var(--tx-content); }
.chatapp.teamsx .tx-av {
  position: relative; width: 32px; height: 32px; border-radius: 999px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 12.5px;
  overflow: visible;
}
.chatapp.teamsx .tx-av.cal { background: var(--tx-brand-bg); color: var(--tx-brand-2); }
.chatapp.teamsx .tx-av.cal svg { width: 17px; height: 17px; stroke-width: 2; }
.chatapp.teamsx .tx-pres {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 999px;
  background: #6bb700; border: 2px solid var(--tx-bg); box-sizing: content-box;
}
.chatapp.teamsx .tx-pres.dnd { background: #c4314b; }
.chatapp.teamsx .tx-pres.away { background: #f8d22a; }
.chatapp.teamsx .tx-row.on .tx-pres { border-color: var(--tx-content); }
.chatapp.teamsx .tx-rmid { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.chatapp.teamsx .tx-rtop { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chatapp.teamsx .tx-rtop b {
  font-size: 14px; line-height: 20px; font-weight: 600; color: var(--tx-fg-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chatapp.teamsx .tx-row.unread .tx-rtop b { font-weight: 700; }
.chatapp.teamsx .tx-rt { font-size: 12px; line-height: 16px; color: var(--tx-fg-2); flex: none; }
.chatapp.teamsx .tx-rprev {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; line-height: 16px; color: var(--tx-fg-2);
}
.chatapp.teamsx .tx-rprev span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.chatapp.teamsx .tx-row.unread .tx-rprev { color: var(--tx-fg-1); font-weight: 600; }
.chatapp.teamsx .tx-unread {
  flex: none; margin-left: auto; background: var(--tx-brand); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 16px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; text-align: center; box-sizing: border-box;
}
/* — main chat — */
.chatapp.teamsx .tx-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--tx-content);
}
.chatapp.teamsx .tx-head {
  flex: none; height: 48px; padding: 0 20px 0 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--tx-stroke);
}
.chatapp.teamsx .tx-hav {
  width: 32px; height: 32px; border-radius: 999px; background: var(--tx-brand-bg); color: var(--tx-brand-2);
  display: grid; place-items: center; flex: none;
}
.chatapp.teamsx .tx-hav svg { width: 17px; height: 17px; stroke-width: 2; }
.chatapp.teamsx .tx-htxt { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex-shrink: 1; }
.chatapp.teamsx .tx-htxt b {
  font-size: 16px; line-height: 22px; font-weight: 700; color: var(--tx-fg-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chatapp.teamsx .tx-htxt svg { width: 14px; height: 14px; color: var(--tx-fg-2); flex: none; }
.chatapp.teamsx .tx-htitle { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
/* back arrow + "Chat" dropdown subtitle — mobile only (hidden on desktop) */
.chatapp.teamsx .tx-back { display: none; }
.chatapp.teamsx .tx-sub { display: none; }
.chatapp.teamsx .tx-tabs { display: inline-flex; gap: 18px; margin-left: 18px; flex-shrink: 1; min-width: 0; overflow: hidden; align-self: stretch; align-items: center; }
.chatapp.teamsx .tx-tabs span {
  font-size: 14px; line-height: 20px; font-weight: 400; color: var(--tx-fg-2);
  align-self: stretch; display: inline-flex; align-items: center; cursor: default; position: relative;
}
.chatapp.teamsx .tx-tabs span.on { color: var(--tx-fg-1); font-weight: 600; }
.chatapp.teamsx .tx-tabs span.on::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: 0; height: 2px;
  background: var(--tx-brand-2); border-radius: 2px 2px 0 0;
}
.chatapp.teamsx .tx-hicons { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.chatapp.teamsx .tx-hi {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--tx-fg-3);
  width: 32px; height: 32px; border-radius: 4px; justify-content: center;
}
.chatapp.teamsx .tx-hi:hover { background: var(--tx-hover); cursor: default; }
.chatapp.teamsx .tx-hi svg { width: 17px; height: 17px; stroke-width: 1.7; }
.chatapp.teamsx .tx-hi.peep { width: auto; padding: 0 8px; gap: 4px; font-weight: 600; }
.chatapp.teamsx .tx-meet {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-left: 4px;
  background: var(--tx-brand); color: #fff; border: none; font-weight: 600; font-size: 13px;
  height: 32px; padding: 0 14px; border-radius: 4px; cursor: default;
}
.chatapp.teamsx .tx-meet svg { width: 16px; height: 16px; stroke-width: 2; }
/* — stream / bubbles — */
.chatapp.teamsx .tx-stream {
  flex: 1; min-height: 0; padding: 16px 20px 8px; display: flex; flex-direction: column;
  gap: 14px; overflow-y: auto; overflow-x: hidden; background: var(--tx-content);
  scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth;
}
.chatapp.teamsx .tx-stream::-webkit-scrollbar { width: 0; height: 0; display: none; }
.chatapp.teamsx .tx-grp { display: flex; gap: 10px; align-items: flex-start; }
.chatapp.teamsx .tx-mav {
  width: 32px; height: 32px; border-radius: 999px; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 12.5px; overflow: hidden;
}
.chatapp.teamsx .tx-mav.mind { background: transparent; }
.chatapp.teamsx .tx-mav.mind img { width: 100%; height: 100%; object-fit: cover; }
.chatapp.teamsx .tx-mbody { min-width: 0; display: flex; flex-direction: column; gap: 2px; max-width: 560px; position: relative; }
.chatapp.teamsx .tx-mhead { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.chatapp.teamsx .tx-mhead b { font-size: 14px; font-weight: 700; color: var(--tx-fg-1); }
.chatapp.teamsx .tx-mtime { font-size: 12px; color: var(--tx-fg-2); }
.chatapp.teamsx .tx-tag {
  font-size: 10px; font-weight: 600; letter-spacing: .01em; color: #5a5a5a;
  background: #ededed; border-radius: 3px; padding: 1px 6px;
}
.chatapp.teamsx .tx-bub {
  position: relative; background: var(--tx-bub); color: var(--tx-fg-1); font-size: 14px; line-height: 20px;
  padding: 8px 12px; border-radius: 4px 8px 8px 8px; max-width: 100%; width: fit-content;
}
.chatapp.teamsx .tx-bub + .tx-bub { border-radius: 8px; margin-top: 2px; }
.chatapp.teamsx .tx-mention { color: var(--tx-brand-2); background: var(--tx-brand-bg); border-radius: 4px; padding: 0 4px; font-weight: 600; }
.chatapp.teamsx .tx-bub.atxt { padding: 0; background: transparent; }
.chatapp.teamsx .tx-att {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--tx-content); border: 1px solid var(--tx-stroke); border-radius: 6px; max-width: 280px;
}
.chatapp.teamsx .tx-att .fticon { width: 28px; height: 28px; display: grid; place-items: center; flex: none; }
.chatapp.teamsx .tx-att .fticon img { width: 24px; height: 24px; }
.chatapp.teamsx .tx-att .nm { font-size: 13px; font-weight: 600; color: var(--tx-fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatapp.teamsx .tx-att .sz { font-size: 11.5px; color: var(--tx-fg-2); display: inline-flex; align-items: center; gap: 5px; }
.chatapp.teamsx .tx-att .sz .okdot { width: 6px; height: 6px; border-radius: 999px; background: #6bb700; }
.chatapp.teamsx .tx-bub .tx-reax {
  position: absolute; top: -13px; right: 8px; display: inline-flex; gap: 4px; align-items: center;
  height: 24px; padding: 2px 7px; box-sizing: border-box;
  background: var(--tx-content); border: 1px solid var(--tx-stroke); border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
.chatapp.teamsx .tx-rchip {
  font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tx-fg-1);
  display: inline-flex; align-items: center; gap: 2px;
}
/* — composer — */
.chatapp.teamsx .tx-composer {
  flex: none; margin: 6px 16px 14px; padding: 0 6px 0 14px; min-height: 44px;
  display: flex; align-items: center; gap: 8px; background: var(--tx-content);
  border: 1px solid #d1d1d1; border-radius: 4px;
}
.chatapp.teamsx .tx-composer:hover { border-color: #c7c7c7; }
.chatapp.teamsx .tx-composer:focus-within { border-color: var(--tx-brand); box-shadow: 0 0 0 1px var(--tx-brand); }
.chatapp.teamsx .tx-cph { flex: 1; font-size: 14px; line-height: 20px; color: var(--tx-fg-2); }
.chatapp.teamsx .tx-cacts { display: inline-flex; align-items: center; gap: 6px; color: var(--tx-fg-3); }
.chatapp.teamsx .tx-cacts > i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 4px; }
.chatapp.teamsx .tx-cacts > i:hover { background: var(--tx-hover); }
.chatapp.teamsx .tx-cacts svg { width: 17px; height: 17px; stroke-width: 1.6; }
.chatapp.teamsx .tx-cacts .cop { color: var(--tx-brand); }
.chatapp.teamsx .tx-cacts .cop svg { stroke-width: 1.9; }
.chatapp.teamsx .tx-send {
  margin-left: 2px; width: 30px; height: 30px; border-radius: 4px; background: transparent;
  color: var(--tx-brand); border: none; cursor: default; display: grid; place-items: center; padding: 0;
}
.chatapp.teamsx .tx-send:hover { background: var(--tx-hover); }
.chatapp.teamsx .tx-send svg { width: 17px; height: 17px; stroke: var(--tx-brand); fill: none; stroke-width: 1.8; }
/* — typing dots — */
.chatapp.teamsx .tx-typing { display: none; align-items: flex-end; gap: 10px; }
.chatapp.teamsx .tx-typing .tx-mav { width: 32px; height: 32px; border-radius: 999px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 12px; overflow: hidden; }
.chatapp.teamsx .tx-typing .tx-mav.mind { background: transparent; }
.chatapp.teamsx .tx-typing .tx-mav.mind img { width: 100%; height: 100%; object-fit: cover; }
.chatapp.teamsx .tx-dots { display: inline-flex; align-items: center; gap: 5px; background: var(--tx-bub); border-radius: 4px 16px 16px 16px; padding: 11px 14px; }
.chatapp.teamsx .tx-dots i { width: 6px; height: 6px; border-radius: 999px; background: #b8b8b8; display: block; animation: txdot 1.1s infinite; }
.chatapp.teamsx .tx-dots i:nth-child(2) { animation-delay: .18s; }
.chatapp.teamsx .tx-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes txdot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-3px); opacity: 1; } }
/* — phase visibility — */
.chatapp.teamsx .tx-stream .tx-grp,
.chatapp.teamsx .tx-stream .tx-typing { display: none; }
/* phase 0 = empty; 1 = user message sent; 2 = typing; 3 = reply; 4 = reactions land */
.chatapp.teamsx .tx-stream[data-phase="1"] .tx-grp.tg-asker,
.chatapp.teamsx .tx-stream[data-phase="2"] .tx-grp.tg-asker,
.chatapp.teamsx .tx-stream[data-phase="3"] .tx-grp.tg-asker,
.chatapp.teamsx .tx-stream[data-phase="4"] .tx-grp.tg-asker { display: flex; }
.chatapp.teamsx .tx-stream[data-phase="2"] .tx-typing.t-minded { display: flex; }
.chatapp.teamsx .tx-stream[data-phase="3"] .tx-grp.tg-minded,
.chatapp.teamsx .tx-stream[data-phase="4"] .tx-grp.tg-minded { display: flex; }
/* reactions land a beat AFTER Minded's message (phase 4), not with it */
.chatapp.teamsx .tx-stream .tx-bub .tx-reax { display: none; }
.chatapp.teamsx .tx-stream[data-phase="4"] .tx-bub .tx-reax { display: inline-flex; animation: txreaxpop .34s cubic-bezier(.22,1.2,.4,1) both; }
@keyframes txreaxpop { 0% { opacity: 0; transform: translateY(4px) scale(.7); } 100% { opacity: 1; transform: none; } }
.chatapp.teamsx .tx-stream .tx-typing { animation: txrise .32s ease both; }
.chatapp.teamsx .tx-stream .tx-grp.tg-minded { animation: txrise .32s ease both; }
/* user message "sent" — rises up from the composer */
.chatapp.teamsx .tx-stream .tx-grp.tg-asker { animation: txsend .42s cubic-bezier(.22,1,.36,1) both; }
.chatapp.teamsx .tx-stream .tx-grp.tg-asker .tx-bub { transform-origin: bottom left; animation: txbubpop .42s cubic-bezier(.22,1,.36,1) both; }
@keyframes txrise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes txsend { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes txbubpop { 0% { opacity: 0; transform: translateY(8px) scale(.92); } 100% { opacity: 1; transform: none; } }
.chatapp.teamsx .tx-stream.tx-out { opacity: 0; transition: opacity .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .chatapp.teamsx .tx-stream .tx-grp,
  .chatapp.teamsx .tx-stream .tx-grp.tg-asker,
  .chatapp.teamsx .tx-stream .tx-grp.tg-asker .tx-bub,
  .chatapp.teamsx .tx-stream .tx-typing,
  .chatapp.teamsx .tx-dots i { animation: none; }
}
/* — fit inside the bw-panes container (820px track) — */
.bw-pane[data-bw="teams"] { min-width: 0; }
.bw-pane[data-bw="teams"].active { width: 100%; }
.chatapp.teamsx { min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.chatapp.teamsx .tx-main { min-width: 0; }
.chatapp.teamsx .tx-head { min-width: 0; overflow: hidden; }
.chatapp.teamsx .tx-htxt { flex: none; overflow: hidden; }
.chatapp.teamsx .tx-tabs { gap: 14px; margin-left: 14px; }
.chatapp.teamsx .tx-hicons { flex: none; }
.chatapp.teamsx .tx-meet { padding: 0; width: 32px; gap: 0; flex: none; }
/* — responsive — */
@media (max-width: 920px) {
  .chatapp.teamsx .tx-list { width: 240px; }
}
@media (max-width: 860px) {
  /* container itself starts shrinking — trim header so nothing clips */
  .chatapp.teamsx .tx-tabs span:nth-child(3) { display: none; }
  .chatapp.teamsx .tx-hi.peep { display: none; }
}
@media (max-width: 760px) {
  /* phone: rail + chat-list can't fit beside the conversation — show the
     single chat pane (the Minded hand-off), like Teams' own mobile chat view */
  .chatapp.teamsx .tx-rail { display: none; }
  .chatapp.teamsx .tx-list { display: none; }
  .chatapp.teamsx .tx-main { width: 100%; min-width: 0; border-radius: inherit; }
  /* mobile header: ← back · avatar · stacked title + "Chat ⌄" · actions (no tab row) */
  /* keep the Meet button clear of the pane's 16px rounded corner */
  .chatapp.teamsx .tx-head { height: 54px; padding: 0 18px 0 6px; gap: 8px; }
  .chatapp.teamsx .tx-back { display: grid; place-items: center; width: 30px; height: 30px;
    border-radius: 4px; color: var(--tx-fg-1); flex: none; }
  .chatapp.teamsx .tx-back svg { width: 20px; height: 20px; stroke-width: 1.8; }
  .chatapp.teamsx .tx-tabs { display: none; }
  .chatapp.teamsx .tx-htxt { flex-direction: column; align-items: flex-start; gap: 1px; justify-content: center; }
  .chatapp.teamsx .tx-htxt b { font-size: 15px; line-height: 19px; }
  .chatapp.teamsx .tx-tcaret { display: none; }
  .chatapp.teamsx .tx-sub { display: inline-flex; align-items: center; gap: 3px;
    font-size: 12px; line-height: 15px; color: var(--tx-fg-2); }
  .chatapp.teamsx .tx-sub svg { width: 13px; height: 13px; }
  .chatapp.teamsx .tx-hi.peep { display: none; }
  .chatapp.teamsx .tx-meet { padding: 0 9px; }
  .chatapp.teamsx .tx-stream { padding: 14px; }
}
