/* 🛡 Дискорд-Торрент: перетаскивание людей между каналами, контекстное меню, значок модератора (talkmod.js). Токены rec.css / talk.css */

/* значок модератора — щит рядом с именем (как корона владельца) */
.tm-badge { display:inline-flex; flex:none; }
.tm-badge .i { width:13px; height:13px; stroke-width:2; }
.tm-mod { color:var(--blue); }
.tm-mod .i path:first-child { fill:color-mix(in srgb, currentColor 22%, transparent); }

/* строки людей, которые можно тянуть: без выделения текста и системного меню на долгое нажатие (iOS) */
.tm-list [data-pid] { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
.tm-list .tm-armed { transform:scale(.98); background:var(--soft); border-radius:8px; transition:transform .12s; }
html.tm-dragging, html.tm-dragging * { cursor:grabbing !important; }
html.tm-dragging body { -webkit-user-select:none; user-select:none; }
/* кого тянут — приглушён на своём месте */
.tm-list .tm-src { opacity:.4; }
/* канал под курсором: куда бросить (красный — нельзя: канал полон) */
.tm-list .tm-drop { position:relative; border-radius:10px; background:color-mix(in srgb, var(--blue) 10%, transparent);
  box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--blue) 55%, transparent); transition:background .1s, box-shadow .1s; }
.tm-list .tm-drop.tm-no { background:color-mix(in srgb, var(--bad) 8%, transparent); box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--bad) 45%, transparent); }

/* «призрак» под курсором: аватар и имя */
.tm-ghost { position:fixed; left:0; top:0; z-index:60; display:flex; align-items:center; gap:8px; max-width:240px; padding:5px 12px 5px 5px; border-radius:20px;
  background:var(--card); color:var(--text); border:1px solid var(--line); box-shadow:0 14px 34px -10px rgba(0,0,0,.5); pointer-events:none;
  font-size:13.5px; font-weight:500; white-space:nowrap; animation:tm-lift .12s ease-out; will-change:transform; }
.tm-ghost .tk-av { width:26px; height:26px; font-size:12px; box-shadow:none; }
.tm-ghost-n { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.tm-ghost.ok { border-color:color-mix(in srgb, var(--blue) 60%, var(--line)); }
.tm-ghost.no { border-color:color-mix(in srgb, var(--bad) 60%, var(--line)); opacity:.85; }
@keyframes tm-lift { from { scale:.9; } }

/* контекстное меню (как выпадающее меню пространства) */
.tm-menu { position:fixed; z-index:50; min-width:220px; max-width:min(300px, calc(100vw - 16px)); max-height:calc(100dvh - 16px); overflow-y:auto; display:flex; flex-direction:column;
  padding:6px; border-radius:14px; background:var(--card); color:var(--text); border:1px solid var(--line); box-shadow:0 18px 44px -14px rgba(0,0,0,.45);
  animation:tm-pop .12s ease-out; overscroll-behavior:contain; }
@keyframes tm-pop { from { opacity:0; transform:scale(.97); } }
.tm-sub { z-index:51; min-width:200px; }
.tm-item, .tm-back { display:flex; align-items:center; gap:10px; width:100%; min-height:36px; padding:0 10px; border:0; border-radius:9px; background:none; color:var(--text);
  cursor:pointer; text-align:left; font:inherit; font-size:13.5px; }
.tm-item:hover:not(:disabled), .tm-item:focus-visible, .tm-item.open, .tm-back:hover, .tm-back:focus-visible { background:var(--soft, var(--hover)); outline:none; }
.tm-item:disabled { cursor:default; opacity:.5; }
.tm-item .i, .tm-back .i { width:17px; height:17px; flex:none; color:var(--text2); }
.tm-ico { width:17px; flex:none; }
.tm-lbl { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tm-hint { flex:none; font-size:12px; color:var(--text2); font-variant-numeric:tabular-nums; }
.tm-item .tm-arr { width:15px; height:15px; margin-right:-4px; }
.tm-item .tm-check { color:var(--blue); }
.tm-item.danger, .tm-item.danger .i { color:var(--bad); }
.tm-item.danger:hover:not(:disabled), .tm-item.danger:focus-visible { background:var(--rec-soft); }
.tm-sep { height:1px; margin:5px 6px; background:var(--line); flex:none; }
.tm-head { display:flex; align-items:center; gap:10px; padding:6px 8px 8px; min-width:0; font-weight:500; }
.tm-head + .tm-item, .tm-head + .tm-custom { margin-top:2px; }
.tm-custom { padding:4px 8px; }
.tm-back { font-weight:500; margin-bottom:4px; color:var(--text2); }
.tm-back .i { color:var(--text2); }
.tm-bg { display:none; }

/* телефон — шторка снизу, как меню человека */
@media (max-width: 760px) {
  .tm-menu.sheet { left:0; right:0; top:auto; bottom:0; width:auto; max-width:none; min-width:0; max-height:72dvh; border-radius:20px 20px 0 0; border-bottom:0;
    padding:22px 10px calc(12px + env(safe-area-inset-bottom)); animation:tm-sheet .18s ease-out; }
  .tm-menu.sheet::before { content:""; position:absolute; top:8px; left:50%; width:36px; height:4px; margin-left:-18px; border-radius:2px; background:var(--line); }
  .tm-menu.sheet .tm-item, .tm-menu.sheet .tm-back { min-height:46px; font-size:15px; border-radius:12px; }
  .tm-bg.on { display:block; position:fixed; inset:0; z-index:49; background:rgba(0,0,0,.4); animation:tm-fade .18s ease-out; }
}
@keyframes tm-sheet { from { transform:translateY(24px); opacity:.6; } }
@keyframes tm-fade { from { opacity:0; } }
@media (prefers-reduced-motion: reduce) { .tm-menu, .tm-ghost, .tm-bg.on { animation:none; } .tm-list .tm-armed { transition:none; } }

/* ---------- в меню человека (talk.js): перенести в канал, модератор, выгнать ---------- */
.tk-mn-own { display:flex; flex-direction:column; gap:2px; }
.tk-mn-own .btn.tk-mn-mv, .tk-mn-own .btn.tk-mn-mod { gap:8px; color:var(--text); }
.tk-mn-own .btn.tk-mn-mv:hover:not(:disabled), .tk-mn-own .btn.tk-mn-mod:hover { background:var(--soft); color:var(--text); }
.tk-mn-own .btn.tk-mn-mv .i, .tk-mn-own .btn.tk-mn-mod .i { color:var(--text2); }
.tk-mn-own .btn.tk-mn-mod .i { color:var(--blue); }
.tk-mn-own .btn.tk-mn-kick { gap:8px; }
.tk-mn-own .btn.tk-mn-mv:disabled { opacity:.55; cursor:default; }
.tk-mn-own .btn small { margin-left:auto; font-size:11.5px; font-weight:400; color:var(--text2); }
.tk-mn-arr { margin-left:auto; width:15px !important; height:15px !important; transition:transform .15s; }
.tk-mn-mv[aria-expanded="true"] .tk-mn-arr { transform:rotate(180deg); }
.tk-mn-chans { display:flex; flex-direction:column; gap:1px; margin:0 0 4px 14px; padding-left:8px; border-left:2px solid var(--line); }
.tk-mn-chans[hidden] { display:none; }
.tk-mn-ch { display:flex; align-items:center; gap:8px; min-height:34px; padding:0 8px; border:0; border-radius:9px; background:none; color:var(--text); font:inherit; font-size:13px; text-align:left; cursor:pointer; }
.tk-mn-ch:hover:not(:disabled), .tk-mn-ch:focus-visible { background:var(--soft); outline:none; }
.tk-mn-ch:disabled { opacity:.45; cursor:default; }
.tk-mn-ch .i { width:15px; height:15px; color:var(--text2); }
.tk-mn-ch-n { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tk-mn-ch small { font-size:11.5px; color:var(--text2); font-variant-numeric:tabular-nums; }
/* кнопка «лимит людей» у канала: стоит лимит — видна всегда */
.tk-own.tk-lim.on { opacity:1; color:var(--blue); }
@media (max-width: 760px) { .tk-mn-ch { min-height:44px; font-size:14.5px; } }
