/* ==========================================================================
   Chat – isolated stylesheet
   Used by chat-core.js + chat-site.js + chat-twitch.js + chat-settings-ui.js
   ========================================================================== */

/* ---- CSS variables (fallbacks if not defined globally) ---- */
:root{
  --chat-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --chatExpanded: 380px;
  --chatCollapsed: 40px;

  --chat-bg: var(--panel, #18181b);
  --chat-border: var(--border, #26262c);
  --chat-text: var(--text, #efeff1);
  --chat-muted: var(--muted, #b3b3b3);
  --chat-accent: var(--accent, #9146ff);
  --chat-radius: 14px;

  /* hover */
  --chat-hover: rgba(255,255,255,0.06);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.chat-card{
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--chat-bg);
  border-left: 1px solid var(--chat-border);
  position: relative;
  font-family: var(--chat-font);
}

/* Collapsed (header only) */
.chat-card.collapsed .chat-body,
.chat-card.collapsed .chat-footer{
  display: none;
}

/* ==========================================================================
   Header (compact)
   ========================================================================== */

.chat-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-bottom: 1px solid var(--chat-border);
  height: 25px;
}

.chat-title{
  font-size: 12px;
  font-weight: 600;
}

.chat-header-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header .nav-btn{
  background: none;
  border: none;
  color: var(--chat-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 0;
  transition: all 0.15s ease;
  font-size: 14px;
}

.chat-header .nav-btn:hover {
  background: var(--panel2);
  color: var(--text);
}

/* ==========================================================================
   Status bar
   ========================================================================== */

.chat-status{
  padding: 4px var(--space-2, 8px);
  font-size: var(--text-xs, 11px);
  color: var(--chat-muted);
  border-bottom: 1px solid var(--chat-border);
}

/* ==========================================================================
   Messages (scroll + auto-scroll FIX)
   ========================================================================== */

.chat-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.chat-shell{
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* THIS is the scroll container */
#chatMessages{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;

  padding: 8px calc(var(--chatPadX, 8) * 1px);
  font-size: 12px;
  line-height: 1.35;
  user-select: text;
}

/* Drag-scroll feedback */
#chatMessages.dragging{
  cursor: grabbing;
}

/* Message line */
.chat-line{
  display: block;
  margin-bottom: calc(var(--lineSpacingPx, 3) * 1px);
  padding: 2px 4px;
  border-radius: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-userwrap,
.chat-ts,
.chat-msg {
  display: inline;
  vertical-align: baseline;
}

.chat-userwrap {
  margin-right: 6px;
}

.chat-ts {
  margin-right: 6px;
  position: relative;
  top: -2.5px;
}

/* Enhanced hover highlight with slide effect */
.chat-line:hover{
  background: var(--chat-hover);
  transform: translateX(2px);
}

/* Source-specific hover border colors */
.chat-line[data-src="twitch"]:hover {
  box-shadow: -2px 0 0 #9146ff;
}

.chat-line[data-src="site"]:hover {
  box-shadow: -2px 0 0 #ff8c00;
}

.chat-line[data-src="kick"]:hover {
  box-shadow: -2px 0 0 #53fc18;
}

.chat-line[data-src="discord"]:hover {
  box-shadow: -2px 0 0 #5865f2;
}

.chat-line[data-src="youtube"]:hover {
  box-shadow: -2px 0 0 #ff0000;
}

/* New message animation - enhanced */
.chat-line.is-new{
  animation: chatSlideInUp 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatSlideInUp{
  from{ 
    opacity: 0; 
    transform: translateY(12px) scale(0.98); 
  }
  to{ 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* Loading old messages animation */
.chat-line.is-old{
  animation: chatSlideInDown 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatSlideInDown{
  from{ 
    opacity: 0; 
    transform: translateY(-12px) scale(0.98); 
  }
  to{ 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* Highlight effect for mentions/special messages */
.chat-line.highlighted{
  background: rgba(var(--primary-rgb, 139, 92, 246), 0.15);
  border-left: 2px solid var(--primary);
  padding-left: 6px;
  animation: messageHighlight 1.5s ease-out;
}

@keyframes messageHighlight{
  0% {
    background: rgba(var(--primary-rgb, 139, 92, 246), 0.3);
  }
  100% {
    background: rgba(var(--primary-rgb, 139, 92, 246), 0.15);
  }
}

/* ==========================================================================
   Username pill
   ========================================================================== */

.chat-userwrap{
  display: inline-flex;
  align-items: center;
  gap: calc(var(--badgeNameGap, 6) * 1px);
  height: 22px;
  padding: 2px 8px;
  border-radius: 0;
  border: 1px solid var(--chat-border);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-userwrap:hover{
  background: rgba(255,255,255,0.06);
  border-color: var(--primary);
  transform: scale(1.02);
}

.chat-user,
.chat-user-link{
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

/* no underline, ever */
.chat-user-link:hover{
  text-decoration: none;
}

/* Source */
.chat-userwrap.from-twitch{
  border-color: var(--chat-accent);
}

.chat-userwrap.from-site{
  border-color: var(--chat-border);
}

/* Hide pills when disabled */
.chat-messages.no-pills .chat-userwrap {
  display: none;
}

.chat-messages.no-pills .chat-line {
  gap: 0;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.chat-badge{
  display: inline-flex;
  align-items: center;
}

.chat-badge-img{
  width: 16px;
  height: 16px;
  display: block;
}

/* ==========================================================================
   Message text
   ========================================================================== */

.chat-msg{
  color: var(--chat-text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Emotes */
.chat-emote{
  vertical-align: middle;
  height: 20px;
  margin: 0 1px;
}

/* ==========================================================================
   Footer (send bar – compact, restored)
   ========================================================================== */

.chat-footer{
  padding: 2px;
  border-top: 1px solid var(--chat-border);
}

.chat-input-row{
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 2px 6px;
  border-radius: 0;

  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.02)
  );

  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}

.chat-input-row:focus-within{
  border-color: rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}

#chatInput{
     resize: none;
  overflow: hidden;     /* no scrollbar */
  min-height: 18px;
  line-height: 1.35;
    
  flex: 1;
  height: auto;          /* JS sets height */
  max-height: calc(1.35em * 3 + 8px);

  background: transparent;
  border: none;
  outline: none;

  padding: 0 4px;
  margin: 0;

  color: var(--chat-text);
  font-size: 12px;
}

#chatInput::placeholder{
  color: var(--chat-muted);
}

#chatInput:disabled{
  opacity: 0.6;
}

#chatSendBtn{
  width: 20px;
  height: 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--primary);
  border: none;
  border-radius: 0;

  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

#chatSendBtn:hover{
  filter: brightness(1.1);
  box-shadow: 0 2px 8px rgba(145,70,255,0.35);
}

#chatSendBtn:disabled{
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
  filter: none;
}

/* ==========================================================================
   Settings panel
   ========================================================================== */

.chat-settings-panel{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  z-index: 20;
}

.chat-settings-panel.open{
  display: block;
}

.chat-settings-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--chat-bg);
  border-bottom: 1px solid var(--chat-border);
}

.chat-settings-title{
  font-size: 13px;
  font-weight: 600;
}

.chat-settings-close{
  background: none;
  border: none;
  color: var(--chat-muted);
  cursor: pointer;
}

.chat-settings-body{
  padding: 10px;
  background: var(--chat-bg);
}

/* ==========================================================================
   Scrollbar
   ========================================================================== */

#chatMessages::-webkit-scrollbar{
  width: 8px;
}

#chatMessages::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.15);
  border-radius: 0;
}

#chatMessages::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.25);
}

/* ==========================================================================
   Toggles / layout options
   ========================================================================== */

/* Font size scaling */
#chatMessages{
  font-size: calc(12px * (var(--chatFontPct, 100) / 100));
}

/* Line spacing modes */
/* CSS variable controls line spacing */
#chatMessages .chat-line {
  margin-bottom: calc(var(--lineSpacingPx, 3) * 1px) !important;
}

/* Legacy line spacing classes (disabled - use slider instead) */
/* #chatMessages.line-compact .chat-line{ margin-bottom: 2px; } */
/* #chatMessages.line-normal  .chat-line{ margin-bottom: 3px; } */
/* #chatMessages.line-comfy   .chat-line{ margin-bottom: 6px; } */

/* Timestamp inline */
.chat-ts{
  display: inline-block;
  margin-right: 6px;
  color: var(--chat-muted);
  font-size: 11px;
  opacity: 0.9;
}

/* Disable badges/emojis */
#chatPanel.no-badges .chat-badge{ display:none !important; }
#chatPanel.no-emojis .chat-emote{ display:none !important; }

/* Bold username */
#chatPanel.bold-username .chat-user,
#chatPanel.bold-username .chat-user-link {
  font-weight: 700;
}

/* Bold message */
#chatPanel.bold-message .chat-msg {
  font-weight: 600;
}

/* Disable animations */
#chatPanel.animations-disabled .chat-line.is-new,
#chatPanel.animations-disabled .chat-line.is-old {
  animation: none !important;
}

/* Disable chat colors */
#chatPanel.no-colors .chat-userwrap.from-twitch{ border-color: var(--chat-border) !important; }
#chatPanel.no-colors .chat-userwrap.has-guild{
  border-color: var(--chat-border) !important;
  box-shadow: none !important;
}

/* Disable profile links */
#chatPanel.no-profilelinks .chat-user-link{
  pointer-events: none;
  cursor: default;
}

/* Left chat layout */
#layoutGrid.chat-left{
  flex-direction: row-reverse;
}
#layoutGrid.chat-left .chat-card{
  border-left: 0;
  border-right: 1px solid var(--chat-border, var(--border));
}

/* Consecutive grouping: compress spacing */
.chat-line.is-grouped{
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Spacer uses per-group measured width */
.chat-userwrap-spacer{
  flex: 0 0 var(--groupIndent, 0px);
  width: var(--groupIndent, 0px);
}

/* ===== Settings warning banner ===== */
.chat-settings-warning{
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.3;
  background: rgba(234,179,8,.15);        /* yellow-ish */
  color: rgba(234,179,8,.95);
  border-bottom: 1px solid rgba(234,179,8,.35);
}

/* No Guild mode: twitch purple, site gray */
.chat-card.pill-border-noguild .chat-userwrap.has-guild{
  border-color: var(--chat-border) !important;
  box-shadow: none !important;
}

/* Twitch stays purple */
.chat-card.pill-border-noguild .chat-userwrap.from-twitch{
  border-color: var(--accent);
}

/* DEFAULT + NO-GUILD: onsite = blue (when not guild-colored) */
.chat-card:not(.pill-border-off):not(.pill-border-custom) .chat-userwrap.from-site:not(.has-guild){
  border-color: #f59e0b; /* blue */
  box-shadow: inset 0 0 0 1px rgba(59,130,246,0.18);
}

/* DEFAULT: kick = green */
.chat-card:not(.pill-border-off):not(.pill-border-custom) .chat-userwrap.from-kick:not(.has-guild){
  border-color: #22c55e;
  box-shadow: inset 0 0 0 1px rgba(34,197,94,0.18);
}

.emote-7tv {
  height: 1.5em;
  vertical-align: middle;
}

.chat-userwrap.from-kick{
  border-color: #22c55e;
}

/* ==========================================================================
   Link Preview Feature
   ========================================================================== */

/* Link button in chat messages */
.chat-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(145, 70, 255, 0.15);
  border: 1px solid rgba(145, 70, 255, 0.3);
  border-radius: 0;
  padding: 1px 4px;
  margin: 0 2px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--chat-text);
  vertical-align: middle;
}

.chat-link-btn:hover {
  background: rgba(145, 70, 255, 0.25);
  border-color: rgba(145, 70, 255, 0.5);
  transform: scale(1.05);
}

.chat-link-btn:active {
  transform: scale(0.95);
}

/* Link Preview Modal */
.chat-link-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: chatLinkModalFadeIn 0.2s ease;
}

@keyframes chatLinkModalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chat-link-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.chat-link-modal-content {
  position: relative;
  background: var(--panel, #18181b);
  border: 1px solid var(--border, #26262c);
  border-radius: 0;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: chatLinkModalSlideIn 0.3s ease;
}

@keyframes chatLinkModalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.chat-link-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #26262c);
}

.chat-link-modal-icon {
  font-size: 28px;
  line-height: 1;
}

.chat-link-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #efeff1);
}

.chat-link-modal-body {
  padding: 24px;
}

.chat-link-warning {
  margin: 0 0 20px 0;
  color: var(--muted, #b3b3b3);
  font-size: 14px;
  line-height: 1.5;
}

.chat-link-preview {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 12px;
  margin-bottom: 12px;
}

.chat-link-preview:last-child {
  margin-bottom: 0;
}

.chat-link-preview-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted, #b3b3b3);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.chat-link-preview-domain {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary, #9146ff);
  word-break: break-all;
}

.chat-link-preview-url {
  font-size: 13px;
  color: var(--text, #efeff1);
  word-break: break-all;
  font-family: 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 0;
}

.chat-link-modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border, #26262c);
}

.chat-link-modal-footer button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-link-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #efeff1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-link-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chat-link-btn-proceed {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: 1px solid transparent;
}

.chat-link-btn-proceed:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-link-btn-cancel:active,
.chat-link-btn-proceed:active {
  transform: scale(0.98);
}

/* YouTube Modal Specific Styles */
.chat-youtube-modal {
  max-width: 800px;
}

.chat-youtube-embed {
  margin-top: 16px;
  border-radius: 0;
  overflow: hidden;
  background: #000;
}

.chat-youtube-embed iframe {
  display: block;
  width: 100%;
  height: 450px;
}

.chat-link-modal-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #efeff1);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-link-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Tenor GIF Hover Popup */
.chat-gif-hover-popup {
  position: fixed;
  z-index: 100001;
  display: none;
  background: var(--panel, #18181b);
  border: 1px solid var(--border, #26262c);
  border-radius: 0;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  max-width: 300px;
  animation: gifHoverFadeIn 0.15s ease;
}

@keyframes gifHoverFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-gif-hover-img {
  display: block;
  max-width: 300px;
  max-height: 300px;
  width: auto;
  height: auto;
  border-radius: 0;
}

.chat-gif-hover-loading,
.chat-gif-hover-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  gap: 8px;
}

.chat-gif-hover-loading {
  color: var(--muted, #b3b3b3);
  font-size: 12px;
}

.gif-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(145, 70, 255, 0.2);
  border-top-color: var(--primary, #9146ff);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-bottom: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.chat-gif-btn {
  position: relative;
}

.chat-gif-btn:hover {
  background: rgba(145, 70, 255, 0.25);
  border-color: rgba(145, 70, 255, 0.5);
}

/* ==========================================================================
   Chat Animations (optional, enabled by user setting)
   ========================================================================== */

/* Message entry animation - slide in from right */
@keyframes chatMessageSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Message entry animation - fade in */
@keyframes chatMessageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Apply animation to new messages when chat_animations is enabled */
.chat-messages:not(.no-animations) .chat-line.is-new {
  animation: chatMessageSlideIn 0.3s ease-out;
}

/* Hover effect on messages (subtle highlight) */
.chat-messages:not(.no-hover-effect) .chat-line:hover {
  background: var(--msg-hover-bg, rgba(255, 255, 255, 0.04));
  transition: background 0.2s ease;
}

/* Optional: scale effect on hover */
.chat-messages.hover-scale .chat-line:hover {
  transform: scale(1.01);
  transition: transform 0.2s ease, background 0.2s ease;
}

/* ===== Emoji Picker Button ===== */
#chatEmojiBtn {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--chat-border, var(--border));
  color: var(--text);
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}
#chatEmojiBtn:hover { background: rgba(255, 255, 255, 0.12); }

.chat-emoji-panel {
  position: absolute;
  bottom: 48px;
  right: 12px;
  width: 320px;
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 50;
  padding: 12px;
  padding-right: 4px; /* Minimal right padding for scrollbar clearance */
  display: none;
}
.chat-emoji-panel.open { display: flex; flex-direction: column; }
.chat-emoji-panel::-webkit-scrollbar{ width: 8px; }
.chat-emoji-panel::-webkit-scrollbar-track { background: transparent; }
.chat-emoji-panel::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.15);
  border-radius: 0;
}
.chat-emoji-panel::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,0.25); }

.chat-emoji-header{ display:flex; flex-direction:column; gap:8px; margin-bottom:12px; flex-shrink: 0; padding-right: 8px; }
.chat-emoji-search{ width: 100%; height:32px; border-radius:0; border:1px solid var(--border); background: var(--panel2); color: var(--text); padding: 0 10px; font-size: 13px; }
.chat-emoji-filters{ display:flex; gap:6px; flex-wrap: wrap; }
.emoji-filter-pill{ border:1px solid var(--border); background: rgba(255,255,255,.06); color: var(--text); border-radius:999px; padding:5px 10px; font-size:11px; cursor:pointer; white-space: nowrap; }
.emoji-filter-pill.active{ background: rgba(145,70,255,.22); border-color: rgba(145,70,255,.35); }
.emoji-filter-pill[disabled]{ opacity:.4; cursor: not-allowed; }
.chat-emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; overflow-x: hidden; padding-right: 8px; }
.chat-emoji-item { display:flex; flex-direction:column; align-items:center; gap:2px; cursor:pointer; padding: 4px; border-radius: 0; transition: background 0.15s; max-width: 100%; min-width: 0; }
.chat-emoji-item:hover { background: rgba(255,255,255,.08); }
.chat-emoji-item img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.chat-emoji-item .code { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Emote size variations */
.chat-emote.size-small {
  height: 18px;
  width: auto;
}

.chat-emote.size-medium {
  height: 28px;
  width: auto;
}

.chat-emote.size-large {
  height: 38px;
  width: auto;
}

/* Provider-specific emote styling */
.chat-emote.emote-7tv {
  vertical-align: middle;
  margin: 0 2px;
}

.chat-emote.emote-bttv {
  vertical-align: middle;
  margin: 0 2px;
}

.chat-emote.emote-ffz {
  vertical-align: middle;
  margin: 0 2px;
}

/* Hide emote text when setting is enabled */
.chat-messages.hide-emote-text .chat-emote::after {
  content: attr(alt);
  display: none;
}
