/**
 * Darwesh Premium Admin — Telegram-inspired Chat (scoped).
 * Does not recolor unrelated Admin modules.
 */
.ops-chat-tg {
  --dg-chat-bg: #07111f;
  --dg-chat-surface: #0c1a2d;
  --dg-chat-surface-raised: #10233b;
  --dg-chat-blue: #258bff;
  --dg-chat-blue-hover: #1775e5;
  --dg-chat-blue-soft: #123d78;
  --dg-chat-incoming: #17263b;
  --dg-chat-outgoing: #124a91;
  --dg-chat-text: #f3f7ff;
  --dg-chat-muted: #91a8c9;
  --dg-chat-border: rgba(147, 185, 244, 0.15);
  --dg-chat-rec: #e53935;
  color: var(--dg-chat-text);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.ops-chat-tg-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 4px 8px;
  margin-bottom: 4px;
}
.ops-chat-tg-bar-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ops-chat-tg .ops-rail-tabs,
.ops-chat-tg .ops-tabs {
  margin-bottom: 8px;
}

/* Shell */
.ops-comm--tg {
  --dg-chat-bg: #07111f;
  --dg-chat-surface: #0c1a2d;
  --dg-chat-surface-raised: #10233b;
  --dg-chat-blue: #258bff;
  --dg-chat-blue-hover: #1775e5;
  --dg-chat-blue-soft: #123d78;
  --dg-chat-incoming: #17263b;
  --dg-chat-outgoing: #124a91;
  --dg-chat-text: #f3f7ff;
  --dg-chat-muted: #91a8c9;
  --dg-chat-border: rgba(147, 185, 244, 0.15);
  --dg-chat-rec: #e53935;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 2fr);
  height: min(78vh, 740px);
  min-height: 520px;
  border: 1px solid var(--dg-chat-border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  color: var(--dg-chat-text);
  background: var(--dg-chat-surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 40px -28px rgba(0, 0, 0, 0.65);
}
@media (prefers-reduced-transparency: no-preference) {
  .ops-comm--tg {
    background: color-mix(in srgb, var(--dg-chat-surface) 92%, transparent);
    backdrop-filter: blur(10px);
  }
}

.ops-comm--tg .ops-comm-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-inline-end: 1px solid var(--dg-chat-border);
  background: var(--dg-chat-surface);
}
.ops-comm--tg .ops-comm-col:last-child,
.ops-comm--tg .ops-comm-col.wide { border-inline-end: 0; }
.ops-comm--tg .ops-comm-col.wide {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(37, 139, 255, 0.08), transparent 55%),
    var(--dg-chat-bg);
}

/* Subtle doodle wallpaper (CSS-only, low cost) */
.ops-comm--tg .ops-msgs {
  background-color: var(--dg-chat-bg);
  background-image:
    radial-gradient(rgba(147, 185, 244, 0.05) 0.6px, transparent 0.7px),
    radial-gradient(rgba(147, 185, 244, 0.04) 0.5px, transparent 0.6px);
  background-size: 28px 28px, 48px 48px;
  background-position: 0 0, 14px 10px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-anchor: none;
}

.ops-comm--tg .ops-comm-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--dg-chat-border);
  background: color-mix(in srgb, var(--dg-chat-surface-raised) 88%, transparent);
  color: var(--dg-chat-text);
}
.ops-comm--tg .ops-comm-h--sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--dg-chat-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ops-comm--tg .ops-inbox-search,
.ops-comm--tg .ops-inbox-status {
  margin: 8px 12px 0;
  background: var(--dg-chat-surface-raised) !important;
  border-color: var(--dg-chat-border) !important;
  color: var(--dg-chat-text) !important;
  border-radius: 12px !important;
}
.ops-comm--tg .ops-unread-toggle {
  color: var(--dg-chat-muted);
  border-bottom-color: var(--dg-chat-border);
}
.ops-comm--tg .ops-conv-list {
  overflow: auto;
  flex: 1 1 55%;
  min-height: 160px;
  padding: 4px 0;
}
.ops-comm--tg .ops-inbox-context-wrap {
  flex: 0 1 34%;
  min-height: 0;
  max-height: 38%;
  overflow: auto;
  border-top: 1px solid var(--dg-chat-border);
  background: color-mix(in srgb, var(--dg-chat-bg) 70%, var(--dg-chat-surface));
}

/* Conversation rows — Telegram identity-first list */
.ops-comm--tg .ops-conv {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  width: 100%;
  text-align: start;
  border: 0;
  border-bottom: 1px solid rgba(147, 185, 244, 0.08);
  background: transparent;
  color: var(--dg-chat-text);
  font: inherit;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.ops-comm--tg .ops-conv:hover { background: rgba(37, 139, 255, 0.08); }
.ops-comm--tg .ops-conv.on {
  background: rgba(37, 139, 255, 0.16);
  box-shadow: inset 3px 0 0 var(--dg-chat-blue);
}
.ops-comm--tg .ops-conv-av {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #e8f2ff;
  background: linear-gradient(145deg, #2a6fbf, #1a3f72);
  border: 1px solid rgba(147, 185, 244, 0.22);
  overflow: hidden;
  flex: 0 0 auto;
}
.ops-comm--tg .ops-conv-av.has-img {
  background: #0a1628;
  padding: 0;
}
.ops-comm--tg .ops-conv-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ops-comm--tg .ops-conv-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ops-comm--tg .ops-conv-line1,
.ops-comm--tg .ops-conv-line2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.ops-comm--tg .ops-conv-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--dg-chat-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-comm--tg .ops-conv.on .ops-conv-name { font-weight: 750; }
.ops-comm--tg .ops-conv-time {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--dg-chat-muted);
  white-space: nowrap;
}
.ops-comm--tg .ops-conv.on .ops-conv-time,
.ops-comm--tg .ops-conv:has(.ops-conv-unread) .ops-conv-time {
  color: #7eb6ff;
}
.ops-comm--tg .ops-conv-preview {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--dg-chat-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-comm--tg .ops-conv-unread {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--dg-chat-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ops-comm--tg .ops-conv-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7c93;
  flex: 0 0 auto;
}
.ops-comm--tg .ops-conv.is-closed .ops-conv-name { opacity: 0.85; }
.ops-comm--tg .ops-pill.unread {
  background: var(--dg-chat-blue);
  color: #fff;
  min-width: 18px;
  justify-content: center;
}
.ops-comm--tg .ops-chip {
  background: rgba(37, 139, 255, 0.14);
  color: #b7d4ff;
  border-color: transparent;
  font-size: 10px;
}
@media (max-width: 720px) {
  .ops-comm--tg .ops-conv {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 10px 12px;
  }
  .ops-comm--tg .ops-conv-av { width: 42px; height: 42px; font-size: 13px; }
  .ops-comm--tg .ops-conv-name { font-size: 14px; }
  .ops-comm--tg .ops-conv-preview { font-size: 12.5px; }
}
.ops-comm--tg .ops-chip.open { background: rgba(37, 139, 255, 0.2); color: #d6e8ff; }
.ops-comm--tg .ops-chip.closed { background: rgba(229, 57, 53, 0.18); color: #ffb4b0; }
.ops-comm--tg .ops-meta-quiet { color: var(--dg-chat-muted); }

/* Thread header */
.ops-comm--tg .ops-comm-thread-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--dg-chat-border);
  background: color-mix(in srgb, var(--dg-chat-surface-raised) 90%, transparent);
  flex: 0 0 auto;
}
.ops-comm--tg .ops-comm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  font-size: 14px;
  color: #e8f2ff;
  background: linear-gradient(145deg, #2a6fbf, #1a3f72);
  border: 1px solid rgba(147, 185, 244, 0.22);
}
.ops-comm--tg .ops-comm-avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.ops-comm--tg .ops-comm-avatar.has-img { padding: 0; overflow: hidden; }
.ops-comm--tg .ops-comm-avatar.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.ops-comm--tg .ops-comm-thread-meta strong { color: var(--dg-chat-text); font-size: 14px; }
.ops-comm--tg .ops-comm-thread-meta .note,
.ops-comm--tg .ops-kbd-hint { color: var(--dg-chat-muted); }
.ops-comm--tg .ops-ctx-open {
  background: rgba(37, 139, 255, 0.12);
  border-color: var(--dg-chat-border);
  color: var(--dg-chat-text);
  border-radius: 999px;
}

/* Messages */
.ops-comm--tg .ops-msg {
  max-width: min(78%, 420px);
  padding: 8px 12px 6px;
  border-radius: 14px 14px 14px 6px;
  border: 0;
  background: var(--dg-chat-incoming);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--dg-chat-text);
  align-self: flex-start;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.ops-comm--tg .ops-msg.admin {
  align-self: flex-end;
  background: var(--dg-chat-outgoing);
  border-radius: 14px 14px 6px 14px;
}
.ops-comm--tg .ops-msg .meta {
  font-size: 10.5px;
  color: var(--dg-chat-muted);
  margin-bottom: 3px;
}
.ops-comm--tg .ops-msg.admin .meta { color: rgba(227, 238, 255, 0.72); }
.ops-comm--tg .ops-msg--system {
  align-self: center;
  max-width: 92%;
  background: rgba(37, 139, 255, 0.1);
  border: 1px dashed var(--dg-chat-border);
  color: var(--dg-chat-muted);
}
.ops-comm--tg .ops-msg--voice { padding: 6px 8px; background: transparent; box-shadow: none; }
.ops-comm--tg .ops-msg--voice.admin { background: transparent; }

/* Voice bubbles */
.ops-comm--tg .ops-voice-inline {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: min(260px, 100%);
  position: relative;
}
.ops-comm--tg .ops-voice-bubble {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding: 8px 12px 6px 8px;
  border-radius: 16px;
  background: var(--dg-chat-incoming);
  border: 0;
  min-width: 190px;
}
.ops-comm--tg .ops-msg.admin .ops-voice-bubble { background: var(--dg-chat-outgoing); }
.ops-comm--tg .ops-voice-play {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
  padding: 0;
}
.ops-comm--tg .ops-msg.admin .ops-voice-play { background: rgba(180, 210, 255, 0.35); }
.ops-comm--tg .ops-voice-wave {
  grid-column: 2;
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 18px;
  min-width: 90px;
}
.ops-comm--tg .ops-voice-wave i {
  width: 2.5px;
  border-radius: 1px;
  background: color-mix(in srgb, #9ec4ff 85%, #fff);
  height: 40%;
  display: block;
}
.ops-comm--tg .ops-voice-wave i:nth-child(3n) { height: 90%; }
.ops-comm--tg .ops-voice-wave i:nth-child(3n+1) { height: 55%; }
.ops-comm--tg .ops-voice-wave i:nth-child(3n+2) { height: 75%; }
.ops-comm--tg .ops-voice-dur {
  grid-column: 2;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #c9ddff;
  min-height: 1em;
}
.ops-comm--tg .ops-voice-more {
  flex: 0 0 auto;
  align-self: center;
  position: relative;
}
.ops-comm--tg .ops-voice-more > summary {
  list-style: none;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dg-chat-muted);
  font-size: 14px;
  line-height: 1;
  opacity: 0.55;
}
.ops-comm--tg .ops-voice-more > summary::-webkit-details-marker { display: none; }
.ops-comm--tg .ops-voice-more[open] > summary,
.ops-comm--tg .ops-voice-inline:hover .ops-voice-more > summary { opacity: 1; }
.ops-comm--tg .ops-voice-more .ops-att--details {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  white-space: nowrap;
  font-size: 11px;
  background: var(--dg-chat-surface-raised);
  border: 1px solid var(--dg-chat-border);
  color: var(--dg-chat-text);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  z-index: 4;
}
.ops-comm--tg .ops-att {
  border-color: var(--dg-chat-border);
  background: var(--dg-chat-surface-raised);
  color: var(--dg-chat-text);
}

/* Composer — Telegram pill (idle / hold / locked) */
.ops-comm--tg .ops-composer--tg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--dg-chat-border);
  background: color-mix(in srgb, var(--dg-chat-surface-raised) 94%, transparent);
  flex: 0 0 auto;
}
.ops-comm--tg .ops-composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  position: relative;
}
.ops-comm--tg .ops-comp-pill {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background: #2b2b2b;
  border: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  position: relative;
  overflow: visible;
}
.ops-comm--tg .ops-pill-idle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 4px 8px;
  width: 100%;
}
.ops-comm--tg .ops-pill-idle[hidden] { display: none !important; }
.ops-comm--tg .ops-pill-ico {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d0d0d0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}
.ops-comm--tg .ops-pill-ico:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.ops-comm--tg .ops-pill-ico:disabled { opacity: 0.4; cursor: not-allowed; }
.ops-comm--tg .ops-pill-ico--emoji {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.ops-comm--tg .ops-attach-wrap,
.ops-comm--tg .ops-emoji-wrap {
  position: relative;
  flex: 0 0 auto;
}
.ops-comm--tg .ops-emoji-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.7);
  z-index: 30;
}
.ops-comm--tg .ops-emoji-menu[hidden] { display: none !important; }
.ops-comm--tg .ops-emoji-opt {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.ops-comm--tg .ops-emoji-opt:hover { background: rgba(37, 139, 255, 0.18); }
.ops-comm--tg .ops-composer-lead {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.ops-comm--tg .ops-icon-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--dg-chat-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  flex: 0 0 auto;
}
.ops-comm--tg .ops-icon-btn:hover { color: var(--dg-chat-text); background: rgba(37, 139, 255, 0.1); }
.ops-comm--tg .ops-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ops-comm--tg .ops-mic-btn {
  background: #5489b9;
  color: #fff;
  box-shadow:
    0 0 0 6px rgba(84, 137, 185, 0.22),
    0 8px 18px -10px rgba(37, 139, 255, 0.85);
}
.ops-comm--tg .ops-mic-btn:hover { background: #4a7eae; color: #fff; }
.ops-comm--tg .ops-mic-btn.is-hot {
  background: #5489b9;
  transform: scale(1.04);
}
.ops-comm--tg .ops-mic-btn.is-send {
  box-shadow:
    0 0 0 8px rgba(84, 137, 185, 0.28),
    0 10px 22px -10px rgba(37, 139, 255, 0.9);
}
.ops-comm--tg .ops-composer-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  height: 40px;
  border-radius: 0 !important;
  padding: 8px 6px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #f2f2f2 !important;
  font-size: 15px !important;
}
.ops-comm--tg .ops-composer-input::placeholder { color: #9a9a9a; }
.ops-comm--tg .ops-send {
  border-radius: 50%;
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  background: #5489b9 !important;
  border-color: transparent !important;
  color: #fff !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 6px rgba(84, 137, 185, 0.22),
    0 8px 18px -10px rgba(37, 139, 255, 0.85);
}
.ops-comm--tg .ops-send svg { display: block; }
.ops-comm--tg .ops-send[hidden],
.ops-comm--tg .ops-mic-btn[hidden] { display: none !important; }
.ops-comm--tg .ops-composer--tg.is-voice .ops-composer-more { display: none; }
.ops-comm--tg .ops-composer-more {
  margin: 0;
}
.ops-comm--tg .ops-composer-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--dg-chat-muted);
  padding: 0 4px;
  width: fit-content;
}
.ops-comm--tg .ops-composer-more > summary::-webkit-details-marker { display: none; }
.ops-comm--tg .ops-composer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.ops-comm--tg .ops-composer-tools .btn {
  background: rgba(37, 139, 255, 0.1);
  border-color: var(--dg-chat-border);
  color: var(--dg-chat-text);
  height: 30px;
  font-size: 12px;
}
.ops-comm--tg .ops-msg-time {
  font-size: 10.5px;
  color: var(--dg-chat-muted);
  text-align: end;
  margin-top: 2px;
  padding-inline-end: 2px;
}
.ops-comm--tg .ops-msg--voice .ops-msg-time { color: rgba(201, 221, 255, 0.75); }

/* Inline voice strip — fills pill during hold/lock */
.ops-comm--tg .ops-voice-strip {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 18px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  position: relative;
  overflow: visible;
}
.ops-comm--tg .ops-voice-strip[hidden] { display: none !important; }
.ops-comm--tg .ops-composer--tg.is-voice .ops-pill-idle { display: none !important; }
.ops-comm--tg .ops-voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b30;
  flex: 0 0 auto;
  animation: opsRecPulse 1s ease-in-out infinite;
}
@keyframes opsRecPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.ops-comm--tg .ops-voice-timer {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  min-width: 64px;
  letter-spacing: 0.02em;
}
.ops-comm--tg .ops-voice-levels {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  flex: 0 0 auto;
}
.ops-comm--tg .ops-voice-levels i {
  width: 2px;
  border-radius: 1px;
  background: var(--dg-chat-blue);
  height: 40%;
}
.ops-comm--tg .ops-voice-strip.is-recording .ops-voice-levels i {
  animation: opsLvl 0.55s ease-in-out infinite alternate;
}
.ops-comm--tg .ops-voice-strip.is-recording .ops-voice-levels i:nth-child(2) { height: 70%; animation-delay: 0.08s; }
.ops-comm--tg .ops-voice-strip.is-recording .ops-voice-levels i:nth-child(3) { height: 100%; animation-delay: 0.16s; }
.ops-comm--tg .ops-voice-strip.is-recording .ops-voice-levels i:nth-child(4) { height: 55%; animation-delay: 0.04s; }
.ops-comm--tg .ops-voice-strip.is-recording .ops-voice-levels i:nth-child(5) { height: 80%; animation-delay: 0.12s; }
@keyframes opsLvl { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }
.ops-comm--tg .ops-voice-hint {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a8a8a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  cursor: default;
}
.ops-comm--tg .ops-voice-hint.is-cancel-link {
  color: #5489b9;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  padding-inline-end: 4px;
}
.ops-comm--tg .ops-voice-strip.is-cancel-ready .ops-voice-hint:not(.is-cancel-link) { color: #ffb4b0; }
.ops-comm--tg .ops-voice-strip.is-locked .ops-voice-hint.is-cancel-link { color: #5489b9 !important; }
.ops-comm--tg .ops-voice-lock-ind {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%) translateY(6px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5489b9;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
  pointer-events: none;
}
.ops-comm--tg .ops-voice-strip.is-lock-ready .ops-voice-lock-ind {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ops-comm--tg .ops-voice-strip.is-locked .ops-voice-lock-ind { display: none; }
.ops-comm--tg .ops-voice-strip.is-locked {
  /* locked: Cancel link only — no slide chrome */
}
.ops-comm--tg .ops-voice-strip-acts { display: none !important; }
.ops-comm--tg .ops-voice-rec-chrome,
.ops-comm--tg .ops-voice-preview-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
}
.ops-comm--tg .ops-voice-rec-chrome[hidden],
.ops-comm--tg .ops-voice-preview-chrome[hidden] { display: none !important; }
.ops-comm--tg .ops-voice-stop-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}
.ops-comm--tg .ops-voice-stop-ico[hidden] { display: none !important; }
.ops-comm--tg .ops-voice-preview-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #5489b9;
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 12px;
  padding: 0;
}
.ops-comm--tg .ops-voice-preview-dur {
  flex: 1 1 auto;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.ops-comm--tg .ops-voice-del-ico {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #ff8a80;
  font-size: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}
.ops-comm--tg .ops-voice-strip audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.ops-comm--tg .ops-attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  min-width: 160px;
  padding: 6px;
  border-radius: 12px;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f2f2f2;
  z-index: 30;
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.7);
}
.ops-comm--tg .ops-attach-opt {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.ops-comm--tg .ops-attach-opt:hover { background: rgba(37, 139, 255, 0.18); }

/* Context under inbox */
.ops-comm--tg .ops-ctx-section > summary {
  background: color-mix(in srgb, var(--dg-chat-surface-raised) 90%, transparent);
  color: var(--dg-chat-text);
  border-bottom: 1px solid var(--dg-chat-border);
}
.ops-comm--tg .ops-context-body { color: var(--dg-chat-text); }
.ops-comm--tg .ops-context-body .note,
.ops-comm--tg .ops-context-body .kv dt { color: var(--dg-chat-muted); }
.ops-comm--tg .ops-context-body .btn {
  background: rgba(37, 139, 255, 0.12);
  border-color: var(--dg-chat-border);
  color: var(--dg-chat-text);
}
.ops-comm--tg .ops-context-body .btn.primary {
  background: var(--dg-chat-blue) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.ops-comm--tg .ops-context-body .field {
  background: var(--dg-chat-surface) !important;
  border-color: var(--dg-chat-border) !important;
  color: var(--dg-chat-text) !important;
}
.ops-comm--tg .ops-ev-request,
.ops-comm--tg .ops-ev-panel {
  background: var(--dg-chat-surface);
  border-color: var(--dg-chat-border);
}
.ops-comm--tg .ops-ctx-drawer-h,
.ops-comm--tg .ops-ctx-drawer-b {
  background: var(--dg-chat-surface);
  border-color: var(--dg-chat-border);
  color: var(--dg-chat-text);
}

.ops-comm--tg .empty-card {
  background: transparent;
  border-color: var(--dg-chat-border);
  color: var(--dg-chat-muted);
}

@media (max-width: 980px) {
  .ops-comm--tg {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .ops-comm--tg .ops-comm-col { border-inline-end: 0; border-bottom: 1px solid var(--dg-chat-border); }
  .ops-comm--tg .ops-comm-inbox { max-height: 38vh; }
  .ops-comm--tg .ops-inbox-context-wrap { display: none; }
  .ops-comm--tg .ops-comm-col.wide { max-height: none; min-height: 58vh; }
}

@media (prefers-reduced-motion: reduce) {
  .ops-comm--tg .ops-voice-dot,
  .ops-comm--tg .ops-voice-levels i,
  .ops-comm--tg .ops-voice-inline.is-playing .ops-voice-wave i { animation: none !important; }
}
