/* Base look lifted from ~/erza/public/builds/pupcall2.html (the mockup). */
:root{
  --bg-rail:#060806; --bg-side:#0b0f0b; --bg-main:#0e120e; --bg-raised:#131913;
  --bg-input:#171f17; --hover:#151c15; --active:#1b241b; --border:#1f2a1f;
  --text:#dce6dc; --bright:#ffffff; --muted:#8ca08c; --faint:#5f715f;
  --green:#3bff70; --green-soft:#2ee05f; --green-glow:rgba(59,255,112,.38);
  --amber:#f0b232; --red:#f23f43; --radius:8px;
  font-synthesis:none;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  background:#040504; color:var(--text); overflow:hidden;
  font-family:"gg sans","Segoe UI",Inter,Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:15.5px; line-height:1.4; -webkit-font-smoothing:antialiased;
}
.app{display:none; grid-template-columns:72px 264px minmax(0,1fr) 292px; height:100vh; width:100vw}
.app.visible{display:grid}
.app.call-view{grid-template-columns:72px 264px minmax(0,1fr) 340px}

/* ============ far-left rail ============ */
.rail{background:var(--bg-rail); display:flex; flex-direction:column; align-items:center; gap:8px; padding:12px 0}
.rail-item{position:relative; width:48px; height:48px; border-radius:50%; cursor:pointer;
  display:grid; place-items:center; font-size:21px; background:var(--bg-raised); color:var(--muted);
  transition:border-radius .15s,background .15s,color .15s}
.rail-item:hover{border-radius:16px; background:var(--active); color:var(--bright)}
.rail-logo{background:linear-gradient(135deg,#123c1f,#0a140b); color:var(--green); font-size:23px;
  box-shadow:0 0 14px var(--green-glow); border:1px solid #1d4a2a; border-radius:16px}
.rail-item.active{border-radius:16px; background:var(--active); color:var(--bright)}
.rail-pill{position:absolute; left:-16px; top:50%; transform:translateY(-50%);
  width:4px; height:0; border-radius:0 4px 4px 0; background:var(--bright); transition:height .15s}
.rail-item:hover .rail-pill{height:20px}
.rail-item.active .rail-pill{height:36px}
.rail-sep{width:32px; height:2px; background:var(--border); border-radius:1px; margin:2px 0}
.rail-badge{position:absolute; right:-3px; bottom:-3px; min-width:17px; height:17px; padding:0 4px;
  border-radius:9px; background:var(--red); color:#fff; font-size:11px; font-weight:700;
  display:grid; place-items:center; border:3px solid var(--bg-rail)}
.rail-add{color:var(--green); font-size:24px}
.den-ic{font-size:17px; font-weight:700; letter-spacing:.3px}

/* ============ sidebar ============ */
.side{background:var(--bg-side); display:flex; flex-direction:column; min-height:0}
.side-head{height:50px; flex:none; display:flex; align-items:center; padding:0 14px;
  border-bottom:1px solid var(--border); font-weight:700; color:var(--bright); cursor:pointer}
.side-head:hover{background:var(--hover)}
.side-head .chev{margin-left:auto; color:var(--muted); font-size:12px}
.side-search{margin:10px 10px 4px; flex:none}
.side-search input{width:100%; background:#060906; border:1px solid var(--border); border-radius:6px;
  color:var(--muted); font-size:13px; padding:7px 10px; outline:none}
.side-scroll{flex:1; overflow-y:auto; padding:8px; min-height:0}
.nav-item{display:flex; align-items:center; gap:12px; padding:8px 10px; border-radius:6px;
  color:var(--muted); cursor:pointer; font-weight:500; margin-bottom:2px}
.nav-item:hover{background:var(--hover); color:var(--text)}
.nav-item.active{background:var(--active); color:var(--bright)}
.nav-ico{width:22px; text-align:center; font-size:17px}
.side-label{display:flex; align-items:center; font-size:11.5px; font-weight:700; letter-spacing:.4px;
  color:var(--faint); text-transform:uppercase; padding:14px 8px 4px; cursor:pointer}
.side-label:hover{color:var(--muted)}
.side-label .plus{margin-left:auto; font-size:15px; cursor:pointer}
.side-label .plus:hover{color:var(--bright)}

/* DM rows */
.dm-row{display:flex; align-items:center; gap:10px; padding:5px 8px; border-radius:6px;
  cursor:pointer; margin-bottom:1px; color:var(--muted)}
.dm-row:hover{background:var(--hover); color:var(--text)}
.dm-row.active{background:var(--active); color:var(--bright)}
.dm-row .close{margin-left:auto; opacity:0; font-size:13px}
.dm-row:hover .close{opacity:.6}
.dm-name{font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.dm-sub{font-size:11.5px; color:var(--faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.dm-col{min-width:0}
.dm-unread{margin-left:auto; min-width:18px; height:18px; padding:0 5px; border-radius:9px;
  background:var(--red); color:#fff; font-size:11px; font-weight:700; display:grid; place-items:center}

/* avatars */
.av{position:relative; flex:none; width:34px; height:34px; border-radius:50%;
  display:grid; place-items:center; font-size:17px}
.av.lg{width:40px; height:40px; font-size:20px}
.av.sm{width:24px; height:24px; font-size:12px}
.av.xs{width:20px; height:20px; font-size:10px}
.dot{position:absolute; right:-2px; bottom:-2px; width:12px; height:12px; border-radius:50%;
  border:3px solid var(--bg-side)}
.dot.on{background:var(--green-soft)} .dot.idle{background:var(--amber)} .dot.dnd{background:var(--red)}
.dot.off{background:#4a554a}
.a-mark{background:linear-gradient(135deg,#1d4a2a,#0d2414)} .a-erik{background:linear-gradient(135deg,#5a2e14,#2e1708)}
.a-steve{background:linear-gradient(135deg,#1c3a5e,#0d1d30)} .a-erza{background:linear-gradient(135deg,#14421f,#06160a);box-shadow:0 0 8px var(--green-glow)}
.a-justin{background:linear-gradient(135deg,#4b2d66,#241233)} .a-inferno{background:linear-gradient(135deg,#5e1c1c,#2d0d0d)}
.a-careless{background:linear-gradient(135deg,#4f4a14,#28250a)} .a-raleigh{background:linear-gradient(135deg,#39404d,#191d24)}

/* channels */
.chan{display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:6px;
  color:var(--muted); cursor:pointer; margin-bottom:1px; font-weight:500; position:relative}
.chan:hover{background:var(--hover); color:var(--text)}
.chan.active{background:var(--active); color:var(--bright)}
.chan.unread{color:var(--bright); font-weight:600}
.chan.unread::before{content:""; position:absolute; left:-8px; top:50%; transform:translateY(-50%);
  width:4px; height:8px; border-radius:0 4px 4px 0; background:var(--bright)}
.chan .hash{color:var(--faint); font-size:17px; width:18px; text-align:center}
.chan.active .hash{color:var(--text)}
.chan .m-badge{margin-left:auto; min-width:18px; height:18px; padding:0 5px; border-radius:9px;
  background:var(--red); color:#fff; font-size:11px; font-weight:700; display:grid; place-items:center}
.voice-users{padding:2px 0 4px 26px; display:flex; flex-direction:column; gap:3px}
.vu{display:flex; align-items:center; gap:8px; padding:3px 8px; border-radius:6px; color:var(--muted); font-size:13.5px; cursor:pointer}
.vu:hover{background:var(--hover); color:var(--text)}
.vu .av{width:22px; height:22px; font-size:11px}
.vu.speaking .av{box-shadow:0 0 0 2px var(--green)}
.bot-tag{background:var(--green-soft); color:#03140a; font-size:9.5px; font-weight:800; letter-spacing:.3px;
  padding:1px 5px; border-radius:4px; vertical-align:middle}

/* voice connected panel */
.voice-panel{flex:none; border-top:1px solid var(--border); background:#0a0e0a; padding:8px 10px}
.vp-top{display:flex; align-items:center; gap:8px}
.vp-status{color:var(--green); font-weight:700; font-size:13.5px; text-shadow:0 0 10px var(--green-glow)}
.vp-sub{font-size:12px; color:var(--muted)}
.vp-ping{margin-left:auto; font-size:11.5px; color:var(--green-soft)}
.vp-btns{display:flex; gap:6px; margin-top:8px}
.vp-btn{flex:1; background:var(--bg-raised); border:none; border-radius:6px; color:var(--text);
  padding:6px 0; font-size:15px; cursor:pointer}
.vp-btn:hover{background:var(--active)}
.vp-btn.danger{color:var(--red)}

/* user bar */
.userbar{flex:none; height:56px; background:#080b08; display:flex; align-items:center; gap:8px; padding:0 8px}
.userbar .av{cursor:pointer}
.ub-col{min-width:0; cursor:pointer; padding:2px 4px; border-radius:4px}
.ub-col:hover{background:var(--hover)}
.ub-name{font-size:13.5px; font-weight:700; color:var(--bright); line-height:1.2}
.ub-sub{font-size:11.5px; color:var(--muted)}
.ub-icons{margin-left:auto; display:flex}
.ub-ic{width:32px; height:32px; border-radius:6px; display:grid; place-items:center; cursor:pointer; color:var(--muted); font-size:15px}
.ub-ic:hover{background:var(--hover); color:var(--text)}

/* ============ main column ============ */
.main{background:var(--bg-main); display:flex; flex-direction:column; min-width:0; min-height:0}
.topbar{height:50px; flex:none; display:flex; align-items:center; gap:10px; padding:0 16px;
  border-bottom:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.25); z-index:2}
.topbar .t-ico{color:var(--faint); font-size:19px}
.t-name{font-weight:700; color:var(--bright)}
.t-topic{color:var(--muted); font-size:13.5px; border-left:1px solid var(--border); padding-left:10px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.t-dot{width:10px; height:10px; border-radius:50%; background:var(--green-soft)}
.t-actions{margin-left:auto; display:flex; gap:4px}
.t-btn{width:34px; height:34px; border-radius:6px; display:grid; place-items:center; cursor:pointer; color:var(--muted); font-size:16px}
.t-btn:hover{background:var(--hover); color:var(--text)}

.chat{flex:1; overflow-y:auto; padding:16px 0 4px; min-height:0}
.divider{display:flex; align-items:center; gap:10px; margin:12px 16px; color:var(--faint); font-size:12px; font-weight:700}
.divider::before,.divider::after{content:""; flex:1; height:1px; background:var(--border)}
.msg{position:relative; display:flex; gap:14px; padding:3px 16px 3px 18px; margin-top:14px}
.msg.cont{margin-top:0; padding-top:1px; padding-bottom:1px}
.msg:hover,.msg.force-hover{background:var(--hover)}
.msg .av{margin-top:2px}
.msg.cont .gutter{width:40px; flex:none; font-size:10.5px; color:var(--faint); text-align:right;
  padding-top:5px; visibility:hidden}
.msg.cont:hover .gutter{visibility:visible}
.m-body{min-width:0; flex:1}
.m-head{display:flex; align-items:baseline; gap:8px}
.m-user{font-weight:600; cursor:pointer}
.m-user:hover{text-decoration:underline}
.m-time{font-size:11.5px; color:var(--faint)}
.m-text{color:var(--text); word-wrap:break-word}
.m-text .mention{background:rgba(59,255,112,.14); color:var(--green); border-radius:4px; padding:0 3px; font-weight:600; cursor:pointer}
.msg.mentioned{background:rgba(240,178,50,.07); border-left:3px solid var(--amber); padding-left:15px}
.msg.mentioned:hover{background:rgba(240,178,50,.11)}
.u-mark{color:var(--green)} .u-erik{color:#ff8a5c} .u-steve{color:#58b9ff} .u-erza{color:#7dffa4}
.u-justin{color:#c48bfa} .u-inferno{color:#ff6262} .u-careless{color:#ffd166} .u-raleigh{color:#9aa7b5}

/* reply bar */
.reply-ctx{display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--muted);
  margin:0 16px 0 48px; padding-top:8px; cursor:pointer}
.reply-ctx:hover{color:var(--text)}
.reply-ctx .curve{width:28px; height:10px; border-left:2px solid var(--border); border-top:2px solid var(--border);
  border-top-left-radius:6px; margin-left:4px; margin-top:8px}
.reply-ctx .av{width:16px; height:16px; font-size:8px}
.msg.has-reply{margin-top:0}

/* hover toolbar */
.m-tools{position:absolute; right:20px; top:-14px; display:none; background:var(--bg-raised);
  border:1px solid var(--border); border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,.4); overflow:hidden}
.msg:hover .m-tools,.msg.force-hover .m-tools{display:flex}
.m-tool{width:34px; height:30px; display:grid; place-items:center; cursor:pointer; font-size:15px; color:var(--muted)}
.m-tool:hover{background:var(--active); color:var(--bright)}

/* reactions */
.reactions{display:flex; gap:4px; margin-top:4px}
.react{display:flex; align-items:center; gap:5px; background:var(--bg-raised); border:1px solid var(--border);
  border-radius:8px; padding:2px 8px; font-size:13px; cursor:pointer; color:var(--muted)}
.react:hover{border-color:var(--faint)}
.react.mine{background:rgba(59,255,112,.12); border-color:var(--green-soft); color:var(--green)}

/* attachment */
.attach-card{margin-top:6px; width:380px; max-width:100%; border-radius:8px; overflow:hidden;
  border:1px solid var(--border); cursor:pointer}
.attach-img{height:200px; display:grid; place-items:center; font-size:54px;
  background:linear-gradient(145deg,#15301c 0%,#0a1a0e 55%,#13241c 100%)}
.attach-bar{background:var(--bg-raised); font-size:12.5px; color:var(--muted); padding:6px 10px; display:flex; gap:8px; align-items:center}

/* typing */
.typing{flex:none; display:flex; align-items:center; gap:8px; padding:2px 18px 6px; font-size:13px; color:var(--muted); min-height:24px}
.t-dots{display:flex; gap:3px}
.t-dots i{width:6px; height:6px; border-radius:50%; background:var(--muted); animation:bounce 1.2s infinite}
.t-dots i:nth-child(2){animation-delay:.15s} .t-dots i:nth-child(3){animation-delay:.3s}
@keyframes bounce{0%,60%,100%{transform:none;opacity:.4}30%{transform:translateY(-4px);opacity:1}}

/* composer */
.composer{flex:none; margin:0 16px 20px; background:var(--bg-input); border-radius:10px;
  display:flex; align-items:center; padding:0 14px; min-height:46px; gap:12px}
.c-plus{width:24px; height:24px; border-radius:50%; background:var(--muted); color:var(--bg-main);
  display:grid; place-items:center; font-weight:800; font-size:16px; cursor:pointer}
.c-plus:hover{background:var(--text)}
.c-input{flex:1; color:var(--faint); font-size:15px}
.c-icons{display:flex; gap:12px; font-size:19px; color:var(--muted)}
.c-icons span{cursor:pointer}
.c-icons span:hover{color:var(--text)}
.gif-pill{background:var(--muted); color:var(--bg-main); font-size:10.5px; font-weight:800;
  border-radius:4px; padding:2px 5px; align-self:center; cursor:pointer}

/* ============ right column ============ */
.right{background:var(--bg-side); border-left:1px solid var(--border); overflow-y:auto; min-height:0}
.mem-label{font-size:11.5px; font-weight:700; letter-spacing:.4px; color:var(--faint);
  text-transform:uppercase; padding:18px 14px 6px}
.mem{display:flex; align-items:center; gap:10px; padding:5px 10px; margin:0 6px; border-radius:6px;
  cursor:pointer; color:var(--muted)}
.mem:hover{background:var(--hover); color:var(--text)}
.mem.offline{opacity:.4}
.mem .nm{font-weight:500; font-size:14.5px}
.mem .sub{font-size:11.5px; color:var(--faint)}
.mem .av{width:30px; height:30px; font-size:15px}
.mem.speaking .av{box-shadow:0 0 0 2px var(--green)}

/* profile card (DM right panel) */
.profile{padding:0}
.p-banner{height:110px; background:linear-gradient(135deg,#123c1f,#061007 60%,#0d2b16)}
.p-avatar-wrap{margin:-44px 0 0 18px}
.p-avatar{width:84px; height:84px; border-radius:50%; border:6px solid var(--bg-side);
  display:grid; place-items:center; font-size:40px; position:relative}
.p-dot{position:absolute; right:2px; bottom:2px; width:20px; height:20px; border-radius:50%;
  background:var(--green-soft); border:5px solid var(--bg-side)}
.p-card{margin:12px 14px; background:#070a07; border:1px solid var(--border); border-radius:10px; padding:14px}
.p-name{font-size:19px; font-weight:800; color:var(--bright)}
.p-tag{font-size:13px; color:var(--muted)}
.p-sect{margin-top:14px; font-size:11.5px; font-weight:700; letter-spacing:.4px; color:var(--faint); text-transform:uppercase}
.p-val{font-size:13.5px; color:var(--text); margin-top:3px}
.p-activity{margin-top:10px; background:rgba(59,255,112,.07); border:1px solid #1d4a2a; border-radius:8px; padding:10px; font-size:13px}
.p-activity b{color:var(--green)}
.p-btns{display:flex; gap:8px; margin-top:14px}
.p-btn{flex:1; background:var(--green-soft); color:#03140a; border:none; border-radius:6px;
  font-weight:700; font-size:13px; padding:8px 0; cursor:pointer}
.p-btn.ghost{background:var(--bg-raised); color:var(--text)}
.p-btn:hover{filter:brightness(1.15)}

/* ============ call stage ============ */
.stage{flex:1; min-height:0; display:flex; flex-direction:column; background:#070907; padding:14px 14px 100px; gap:12px; position:relative}
.share-tile{flex:1; border-radius:12px; position:relative; overflow:hidden;
  background:linear-gradient(145deg,#132a18 0%,#070e09 50%,#10231a 100%);
  display:grid; place-items:center; border:1px solid var(--border)}
.share-inner{text-align:center; color:var(--muted)}
.share-inner .big{font-size:64px}
.share-inner .cap{margin-top:8px; font-size:15px}
.tile-name{position:absolute; left:12px; bottom:10px; background:rgba(0,0,0,.55); border-radius:6px;
  padding:3px 10px; font-size:12.5px; font-weight:600; display:flex; align-items:center; gap:6px}
.tile-live{position:absolute; left:12px; top:10px; background:var(--red); color:#fff; font-size:10.5px;
  font-weight:800; letter-spacing:.5px; border-radius:4px; padding:2px 7px}
.filmstrip{flex:none; display:flex; gap:10px; justify-content:center}
.f-tile{width:172px; height:100px; border-radius:10px; position:relative; display:grid; place-items:center;
  border:1px solid var(--border); background:var(--bg-raised)}
.f-tile.speaking{box-shadow:0 0 0 2.5px var(--green), 0 0 18px var(--green-glow)}
.f-tile .av{width:52px; height:52px; font-size:26px}
.f-mute{position:absolute; right:8px; bottom:6px; font-size:12px; color:var(--red)}
.callbar{position:absolute; left:50%; bottom:26px; transform:translateX(-50%);
  background:rgba(7,10,7,.92); border:1px solid var(--border); border-radius:999px;
  display:flex; gap:8px; padding:8px 14px; box-shadow:0 8px 30px rgba(0,0,0,.5); z-index:3}
.cb-btn{width:46px; height:46px; border-radius:50%; border:none; cursor:pointer; font-size:18px;
  background:var(--bg-raised); color:var(--text); display:grid; place-items:center}
.cb-btn:hover{background:var(--active)}
.cb-btn.on{background:var(--green-soft); color:#03140a}
.cb-btn.hang{background:var(--red); color:#fff; width:58px; border-radius:999px}
.cb-btn.hang:hover{filter:brightness(1.1)}

/* call-side chat */
.call-chat{background:var(--bg-side); border-left:1px solid var(--border); display:flex; flex-direction:column; min-height:0}
.cc-head{height:50px; flex:none; display:flex; align-items:center; padding:0 14px; gap:8px;
  border-bottom:1px solid var(--border); font-weight:700; color:var(--bright); font-size:14px}

::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-thumb{background:#1b241b; border-radius:4px}
::-webkit-scrollbar-track{background:transparent}
