/* Phase 1 friends panel + chat box (self-contained dark theme, works on light and dark pages) */
.thf{color:#e2e8f0;font-size:14px}
.thf-filters{display:flex;gap:6px;margin:10px 0 8px}
.thf-filters button{flex:1;padding:9px 6px;border-radius:10px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.05);color:#cbd5e1;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.thf-filters button.active{background:rgba(45,212,191,.18);border-color:rgba(45,212,191,.6);color:#5eead4}
.thf-search{width:100%;box-sizing:border-box;margin-bottom:8px;padding:11px 12px;border-radius:10px;border:1px solid rgba(255,255,255,.14);background:rgba(8,19,33,.75);color:#e2e8f0;font:inherit;font-size:16px}
.thf-search:focus{outline:2px solid rgba(45,212,191,.5);outline-offset:1px}
.thf-tools{display:flex;gap:7px;margin-bottom:10px}
.thf-mini{padding:7px 11px;border-radius:9px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.06);color:#e2e8f0;font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.thf-mini.active{border-color:rgba(251,191,36,.6);color:#fbbf24}
.thf-list{display:flex;flex-direction:column;gap:6px}
.thf-empty{margin:14px 0;text-align:center;color:#94a3b8;font-size:13px}
.thf-row{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07);cursor:pointer}
.thf-row:hover,.thf-row:focus-visible{background:rgba(45,212,191,.1);outline:none}
.thf-av{position:relative;flex:none;width:40px;height:40px;border-radius:50%;background:#be185d;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700}
.thf-av img{width:100%;height:100%;border-radius:50%;object-fit:cover}
.thf-dot{position:absolute;right:-1px;bottom:-1px;width:12px;height:12px;border-radius:50%;border:2px solid #0e1c33;background:#64748b}
.thf-dot.on,.thf-dot.room{background:#22c55e}
.thf-info{flex:1;min-width:0;display:flex;flex-direction:column}
.thf-info strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thf-sub{font-size:11.5px;color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thf-sub.on,.thf-sub.room{color:#4ade80}
.thf-unread,.thf-badge{background:#ef4444;color:#fff;font-size:11px;font-weight:700;min-width:18px;height:18px;border-radius:9px;padding:0 5px;display:inline-flex;align-items:center;justify-content:center}
.thf-badge{margin-left:6px}
.thf-call{flex:none;padding:7px 11px;border-radius:999px;border:0;background:#16a34a;color:#fff;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.thf-call:hover{background:#15803d}
.thf-full{flex:none;font-size:11px;color:#fbbf24}
.thf-overlay{position:fixed;inset:0;z-index:10000;background:rgba(2,8,20,.6);display:flex}
.thf-overlay[hidden]{display:none}
.thf-panel{justify-content:flex-end}
.thf-side{width:min(420px,100%);height:100%;box-sizing:border-box;overflow-y:auto;background:#0e1c33;color:#e2e8f0;padding:16px;box-shadow:-12px 0 40px rgba(0,0,0,.45)}
.thf-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.1)}
.thf-me{display:flex;align-items:center;gap:10px;font-size:16px}
.thf-title{margin:14px 0 0;font-size:15px;color:#e2e8f0}
.thf-x{flex:none;width:36px;height:36px;border-radius:10px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.06);color:#e2e8f0;font-size:16px;cursor:pointer}
.thf-dm{align-items:center;justify-content:center;z-index:10001}
.thf-card{width:min(460px,100%);height:min(640px,100%);display:flex;flex-direction:column;background:#0e1c33;color:#e2e8f0;border-radius:16px;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.55)}
.thf-dm-head{display:flex;align-items:center;gap:10px;padding:12px;border-bottom:1px solid rgba(255,255,255,.1)}
.thf-msgs{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px}
.thf-msg{max-width:80%;align-self:flex-start;padding:8px 11px;border-radius:14px 14px 14px 4px;background:rgba(255,255,255,.09)}
.thf-msg.me{align-self:flex-end;background:#2563eb;border-radius:14px 14px 4px 14px}
.thf-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.4}
.thf-msg small{display:block;margin-top:3px;font-size:10px;opacity:.65;text-align:right}
.thf-note{margin:0 12px 8px;padding:8px 10px;border-radius:10px;background:rgba(251,191,36,.14);border:1px solid rgba(251,191,36,.45);font-size:12.5px}
.thf-send{display:flex;gap:8px;padding:10px;border-top:1px solid rgba(255,255,255,.1)}
.thf-send input{flex:1;min-width:0;padding:11px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:rgba(8,19,33,.8);color:#e2e8f0;font:inherit;font-size:16px}
.thf-sendbtn{flex:none;width:46px;border-radius:12px;border:0;background:#2563eb;color:#fff;font-size:18px;cursor:pointer}
.thf-sendbtn:disabled,.thf-send input:disabled{opacity:.5;cursor:not-allowed}
@media (max-width:600px){.thf-dm{align-items:stretch}.thf-card{height:100%;border-radius:0}}
