/* FFA Chat PC 0.1.20 — keyboard, media and conversation workspace.
   Loaded after the established desktop theme; reaction state is account-specific. */
html.tl-desktop-app body.tl-employee-authenticated {
  --tl-pc-accent: #C1121C;
  --tl-pc-accent-soft: #FDE8E9;
  --tl-pc-line: #E6E1DD;
  --tl-pc-ink: #16120F;
  font-family: "Segoe UI", Arial, sans-serif;
}
html.tl-desktop-app body.tl-employee-authenticated .tl-grid {
  position: relative;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(260px, 292px);
}
html.tl-desktop-app body.tl-employee-authenticated .tl-side,
html.tl-desktop-app body.tl-employee-authenticated .tl-conv,
html.tl-desktop-app body.tl-employee-authenticated .tl-context { min-width: 0; }
html.tl-desktop-app body.tl-employee-authenticated .tl-side { background: #fff; }
html.tl-desktop-app body.tl-employee-authenticated .tl-channel-list { background: #fff; }
html.tl-desktop-app body.tl-employee-authenticated .tl-channel {
  min-height: 72px;
  padding-block: 12px;
  border-bottom-color: #f1f3f6;
}
html.tl-desktop-app body.tl-employee-authenticated .tl-channel:hover { background: #f5f7fa; }
html.tl-desktop-app body.tl-employee-authenticated .tl-channel.active,
html.tl-desktop-app body.tl-employee-authenticated .tl-channel.is-active {
  background: var(--tl-pc-accent-soft);
  box-shadow: inset 3px 0 0 var(--tl-pc-accent);
}
html.tl-desktop-app body.tl-employee-authenticated .tl-feed {
  scrollbar-gutter: stable;
  padding: 20px clamp(14px, 2.5vw, 36px) 14px;
  background: #F1EDEA;
}
html.tl-desktop-app body.tl-employee-authenticated .tl-bubble {
  max-width: 100%;
  box-sizing: border-box;
  border-color: #dfe5ec;
  box-shadow: 0 1px 2px #24364b07;
  font-size: 15px;
  line-height: 1.5;
}
html.tl-desktop-app body.tl-employee-authenticated .tl-msg.mine .tl-bubble {
  background: #eaf3fc;
  border-color: #d4e4f5;
}
html.tl-desktop-app body.tl-employee-authenticated .tl-msg-name { font-size: 12px; }
html.tl-desktop-app body.tl-employee-authenticated .tl-context { border-left: 1px solid var(--tl-pc-line); }
html.tl-desktop-app body.tl-employee-authenticated .tl-compose { padding: 10px 16px 8px; }
html.tl-desktop-app body.tl-employee-authenticated #tlText { font-size: 15px; line-height: 1.5; }
html.tl-desktop-app body.tl-employee-authenticated .tl-info-toggle[aria-expanded="true"] {
  border-color: #ebbdc2;
  background: var(--tl-pc-accent-soft);
  color: var(--tl-pc-accent);
}
html.tl-desktop-app body.tl-employee-authenticated .tl-app[data-info-open="false"] .tl-grid {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
}
html.tl-desktop-app body.tl-employee-authenticated .tl-app[data-info-open="false"] .tl-context { display: none; }

/* Preserve the row's height when its mouse tools appear, avoiding scroll jumps. */
html.tl-desktop-app body.tl-employee-authenticated .tl-msg-actions {
  min-height: 28px !important;
  max-height: 28px;
  margin-top: 2px;
  overflow: visible;
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity .12s ease;
}
html.tl-desktop-app body.tl-employee-authenticated .tl-msg:hover .tl-msg-actions,
html.tl-desktop-app body.tl-employee-authenticated .tl-msg:focus-within .tl-msg-actions {
  opacity: 1 !important;
  pointer-events: auto;
}
html.tl-desktop-app body.tl-employee-authenticated .tl-icon-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #607287;
}
html.tl-desktop-app body.tl-employee-authenticated .tl-icon-action:hover { background: #fff; color: var(--tl-pc-accent); }
html.tl-desktop-app body.tl-employee-authenticated button:focus-visible,
html.tl-desktop-app body.tl-employee-authenticated [tabindex]:focus-visible {
  outline: 2px solid var(--tl-pc-accent);
  outline-offset: 3px;
}

/* A mouse menu stays next to the message; touch retains the existing sheet. */
html.tl-desktop-app .tl-msg-context.is-desktop {
  display: block;
  padding: 0;
  background: transparent;
}
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-backdrop { background: transparent; }
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-card {
  position: fixed;
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  box-sizing: border-box;
  overflow: auto;
  padding: 7px;
  border-color: #d9e1ea;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 35px #16120F2e, 0 2px 8px #16120F12;
  animation: none;
}
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-preview { display: none; }
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-reactions {
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 5px;
  padding: 3px 0 8px;
  border: 0;
  border-bottom: 1px solid #EFEAE6;
  border-radius: 0;
  box-shadow: none;
}
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-reactions button {
  width: 36px;
  height: 36px;
  font-size: 24px;
}
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-actions {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0;
  border: 0;
}
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-actions button {
  min-height: 36px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
}
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-actions svg { width: 19px; height: 19px; color: #5c7086; }
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-actions button:hover,
html.tl-desktop-app .tl-msg-context.is-desktop .tl-msg-context-actions button:focus-visible { background: #F6F4F2; color: #16120F; }
html.tl-desktop-app .tl-msg-context.is-desktop [data-context-action="hide"] { color: #ac1724; }

/* MP4/MOV etc. are media cards, with native playback controls and a clear fallback. */
.tl-chat-video {
  display: flex;
  width: min(420px, 100%);
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin: 5px 0;
  overflow: hidden;
  border: 1px solid #d7e0e9;
  border-radius: 10px;
  background: #fff;
  white-space: normal;
}
.tl-chat-video video {
  display: block;
  width: 100%;
  max-height: min(360px, 47vh);
  min-height: 120px;
  aspect-ratio: 16/10;
  object-fit: contain;
  border-radius: 9px 9px 0 0;
  background: #16120F;
}
.tl-chat-video > footer,
.tl-chat-video .tl-chat-video-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 9px 9px;
}
.tl-chat-video .tl-chat-video-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #485e74;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-chat-video [role="status"],
.tl-chat-video .tl-video-error { margin: 0; padding: 8px 10px; color: #677b90; font-size: 12px; line-height: 1.45; }
.tl-file-chip video { width: 60px; height: 46px; flex: none; border-radius: 5px; object-fit: contain; background: #16120F; }

.tl-video-viewer[hidden] { display: none !important; }
.tl-video-viewer {
  position: fixed;
  inset: 0;
  z-index: 6400;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px clamp(16px, 3vw, 52px);
  box-sizing: border-box;
  overflow: auto;
  background: #111923;
  color: #fff;
}
.tl-video-viewer header,
.tl-video-viewer .tl-video-viewer-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.tl-video-viewer header strong { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.tl-video-viewer video { display: block; width: 100%; min-height: 0; flex: 1; max-height: calc(100dvh - 140px); margin: auto; object-fit: contain; background: #080d13; }
.tl-video-viewer button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #ffffff40;
  border-radius: 7px;
  background: #243242;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.tl-video-viewer button:hover { background: #35485c; }
.tl-video-viewer [role="status"],
.tl-video-viewer .tl-video-error { margin: auto; max-width: 520px; padding: 24px; text-align: center; line-height: 1.6; }

@media (max-width: 1120px) and (min-width: 701px) {
  html.tl-desktop-app body.tl-employee-authenticated .tl-grid,
  html.tl-desktop-app body.tl-employee-authenticated .tl-app[data-info-open="false"] .tl-grid { grid-template-columns: minmax(235px, 275px) minmax(0, 1fr); }
  html.tl-desktop-app body.tl-employee-authenticated .tl-context { display: none; }
  html.tl-desktop-app body.tl-employee-authenticated .tl-app[data-info-open="true"] .tl-context {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 150;
    display: block;
    width: min(320px, calc(100% - 24px));
    box-sizing: border-box;
    border-left-color: #d6dee8;
    box-shadow: -12px 0 28px #22334d20;
  }
}
@media (pointer: coarse) {
  html.tl-desktop-app body.tl-employee-authenticated .tl-msg-actions { opacity: 1 !important; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html.tl-desktop-app body.tl-employee-authenticated * { scroll-behavior: auto !important; }
  html.tl-desktop-app body.tl-employee-authenticated .tl-msg-actions { transition: none; }
}

/* Text accompanies every receipt; color is only a secondary distinction. */
.tl-message-receipt {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  margin-inline-start: 7px;
  color: #6b625c;
  font-size: 11px;
  line-height: 1.45;
  vertical-align: baseline;
}
.tl-message-receipt.is-read { color: #13713a; font-weight: 600; }
.tl-message-receipt [aria-hidden="true"] { flex: none; font-size: 12px; }
.tl-setting-status { min-height: 20px; margin: 8px 0; color: #6b625c; font-size: 13px; line-height: 1.5; }
#tlReadReceiptEnabled:disabled { cursor: wait; opacity: .6; }

/* The quick heart indicates this account's reaction, never somebody else's. */
.tl-reaction.is-heart {
  touch-action: manipulation;
  user-select: none;
  -webkit-touch-callout: none;
}
.tl-reaction.is-heart .tl-reaction-icon { display: inline-flex; align-items: center; }
.tl-reaction-heart-icon { fill: #fff; stroke: #7b8997; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-reaction.is-heart.active,
.tl-reaction.is-heart.active:hover { color: #c1121c; background: #fff2f3; border-color: #efb5bb; box-shadow: none; }
.tl-reaction.is-heart.active .tl-reaction-heart-icon { fill: #e31e24; stroke: #e31e24; }
.tl-reaction.is-heart:focus-visible,
.tl-reaction-menu button:focus-visible { outline: 2px solid #2469b3; outline-offset: 2px; }
.tl-reaction:disabled { cursor: wait; opacity: .65; }
.tl-reaction-menu.is-floating {
  position: fixed;
  z-index: 6700;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: auto;
}
.tl-reaction-menu button[aria-pressed="true"] { background: #fff0b8; box-shadow: inset 0 0 0 1px #e1b52d; }

/* Fit photos to the conversation column while retaining their natural ratio.
   Feed-only selectors leave sidebar thumbnails and viewer/menu previews alone. */
.tl-feed .tl-msg.has-photos {
  width: min(85%, 760px);
  max-width: min(85%, 760px);
  min-width: 0;
}
.tl-feed .tl-bubble.has-photos { min-width: 0; max-width: 100%; box-sizing: border-box; }
html.tl-desktop-app body.tl-employee-authenticated .tl-feed .tl-bubble.is-photo-only,
.tl-feed .tl-bubble.is-photo-only {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.tl-feed .tl-bubble.is-photo-only > .tl-photos { margin-top: 0; }
.tl-feed .tl-bubble.is-photo-only > .tl-pinned-badge { margin: 4px 6px; }
.tl-feed .tl-photos {
  max-width: 100%;
  gap: 4px;
  align-items: flex-start;
}
.tl-feed .tl-photo-wrap {
  min-width: 0;
  max-width: 100%;
  width: fit-content;
  align-items: flex-start;
  flex: 0 1 auto;
}
.tl-feed .tl-photos .tl-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(62dvh, 620px);
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 9px;
}
.tl-feed .tl-photos.is-album {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  align-items: start;
}
.tl-feed .tl-photos.is-album > .tl-photo-wrap { justify-self: start; }
.tl-feed .tl-bubble:has(> .tl-photos.is-album) { width: min(680px, 100%); }
@supports (container-type: size) {
  .tl-feed { container-type: size; }
  .tl-feed .tl-photos .tl-photo {
    max-height: min(620px, max(160px, calc(100cqh - 104px)));
  }
}
@media (max-width: 700px) {
  .tl-feed .tl-msg.has-photos { width: 94%; max-width: 94%; }
}
