*{margin:0;padding:0;box-sizing:border-box}
:root{
  --navy:#2c3e6b;--navy-d:#243358;--navy-l:#3a5289;
  --teal:#0ea5a0;--teal-l:rgba(14,165,160,.07);--teal-m:rgba(14,165,160,.14);--teal-d:#0c8f8a;
  --coral:#ef5350;--coral-l:rgba(239,83,80,.07);
  --amber:#f5a623;--amber-l:rgba(245,166,35,.1);
  --green:#22c55e;--indigo:#5c6bc0;
  --white:#fff;--light:#f4f6f9;--gray:#ebeef3;--hover:#e4e8f0;--input:#f0f2f6;
  --cs-bg:#e8eaf6;--cs-head:#dde0f0;
  --us-bg:#eceef8;--us-head:#e4e6f2;
  --sc-bg:#f0f1fa;--sc-head:#eaebf5;
  --c1:#1a1f2e;--c2:#4a5068;--c3:#8b92a7;
  --border:#d8dce6;--border-l:#e8ecf2;
  --r:8px;--rs:6px;--rl:12px;--t:.18s ease;
  --font:'Noto Sans KR',sans-serif;--fd:'Outfit',sans-serif;--fm:'JetBrains Mono',monospace;
}
body{font-family:var(--font);background:var(--light);color:var(--c1);height:100vh;overflow:hidden}
::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
[ng-cloak]{display:none!important}
.app{display:flex;flex-direction:column;height:100vh}

/* TOP BAR */
.top-bar{display:flex;align-items:center;justify-content:space-between;height:50px;min-height:50px;background:linear-gradient(135deg,var(--navy-d),var(--navy-l));padding:0 20px;z-index:100;box-shadow:0 2px 12px rgba(44,62,107,.25)}
.top-left{display:flex;align-items:center;gap:4px}
.top-logo{display:flex;align-items:center;gap:8px;margin-left:8px;padding:6px 12px;color:#fff;user-select:none}
.top-logo svg{opacity:.95}
.top-logo-text{font-size:14px;font-weight:700;letter-spacing:.3px;background:linear-gradient(90deg,#fff,rgba(255,255,255,.7));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.tab-btn{display:flex;align-items:center;gap:7px;padding:8px 18px;font-size:13px;font-weight:600;font-family:var(--fd);color:rgba(255,255,255,.5);background:none;border:none;cursor:pointer;border-radius:var(--r);transition:var(--t)}
.tab-btn:hover{color:rgba(255,255,255,.8);background:rgba(255,255,255,.08)}
.tab-btn.active{color:#fff;background:rgba(255,255,255,.16)}
.tab-btn svg{width:16px;height:16px}
.tab-label{font-size:10px;font-family:var(--font);font-weight:400;color:rgba(255,255,255,.35);margin-left:2px}
.tab-btn.active .tab-label{color:rgba(255,255,255,.55)}
.top-right{display:flex;align-items:center;gap:14px}
.user-info{display:flex;align-items:center;gap:9px;font-size:13px;color:rgba(255,255,255,.88);font-weight:500}
.uav-top{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,var(--teal),var(--green));display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:#fff;box-shadow:0 2px 8px rgba(14,165,160,.35)}
.logout-btn{padding:6px 16px;font-size:12px;color:rgba(255,255,255,.55);background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:20px;cursor:pointer;transition:var(--t);font-family:var(--font);font-weight:500}
.logout-btn:hover{color:#fff;border-color:var(--coral);background:rgba(239,83,80,.25)}

/* 상단 사용자 드롭다운 */
.top-user-dd{position:absolute;top:100%;right:0;width:220px;background:var(--white);border:1px solid var(--border);border-radius:var(--r);box-shadow:0 6px 20px rgba(0,0,0,.15);z-index:200;margin-top:8px;overflow:hidden}
.tu-dd-info{padding:12px 14px}
.tu-dd-name{font-size:14px;font-weight:700;color:var(--c1)}
.tu-dd-email{font-size:11px;color:var(--c3);margin-top:2px}
.tu-dd-sep{height:1px;background:var(--border-l);margin:0}
.tu-dd-item{display:flex;align-items:center;gap:8px;padding:9px 14px;font-size:13px;color:var(--c2);cursor:pointer;transition:var(--t)}
.tu-dd-item:hover{background:var(--hover);color:var(--c1)}
.tu-dd-item svg{flex-shrink:0;color:var(--c3)}
.tu-dd-item:hover svg{color:var(--c1)}
.tu-dd-logout{color:var(--coral)}
.tu-dd-logout:hover{background:var(--coral-l);color:var(--coral)}
.tu-dd-logout svg{color:var(--coral)}
.tu-dd-lang-sub{padding:2px 8px 4px 28px}
.tu-lang-opt{font-size:12px;padding:6px 10px;border-radius:4px}
.tu-lang-opt.active{color:var(--teal);font-weight:600;background:var(--teal-l)}

/* 상단 핀 버튼 */
.top-header-settings{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;border:none;background:none;color:rgba(255,255,255,.55);cursor:pointer;transition:background .12s}
.top-header-settings:hover{background:rgba(255,255,255,.12)}
.top-header-settings.pinned{color:#4fc3f7}
.top-header-settings.pinned svg{fill:#4fc3f7}
.main-area{flex:1;display:flex;overflow:hidden}

/* CHANNEL SIDEBAR */
.cs-wrap{display:flex;flex-shrink:0;overflow:hidden;transition:width .25s ease,min-width .25s ease;order:-2}
.cs-wrap:not(.cs-folded){width:236px;min-width:236px}
.cs-wrap:not(.cs-folded) .cs-fold-btn{display:none}
.cs-wrap.cs-folded{width:20px;min-width:20px}
.cs-wrap.cs-folded:not(.cs-nohover):hover{width:236px;min-width:236px}
.cs-wrap.cs-folded:not(.cs-nohover):hover .cs-fold-btn{display:none}
/* 접기/펼치기 토글 버튼 (접힌 영역 안) */
.cs-fold-btn{width:20px;min-width:20px;display:flex;align-items:flex-start;padding-top:10px;justify-content:center;cursor:pointer;color:var(--c3);background:var(--cs-bg);border-right:1px solid var(--border);flex-shrink:0;transition:var(--t)}
.cs-fold-btn:hover{background:var(--cs-head);color:var(--navy)}

/* RIGHT PANEL */
.rp-wrap{display:flex;flex-shrink:0;width:214px;min-width:214px;order:-1}
.cs{width:236px;min-width:236px;background:var(--cs-bg);border-right:1px solid var(--border);display:flex;flex-direction:column}
.cs .sh{padding:10px 12px;display:flex;align-items:center;justify-content:space-between;background:var(--cs-head);border-bottom:1px solid var(--border)}
.side-t{font-size:13px;font-weight:700}
.cs .side-t{color:var(--navy);display:flex;align-items:center;gap:4px;cursor:pointer}
.cs .side-t .arr{transition:var(--t);display:inline-flex}.cs .side-t .arr svg{width:14px;height:14px}
.cs .side-t .arr.up{transform:rotate(180deg)}
.ha{display:flex;gap:3px}
.ib{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border:none;background:none;color:var(--c3);cursor:pointer;border-radius:var(--rs);transition:var(--t)}
.ib:hover{background:rgba(0,0,0,.06);color:var(--c1)}
.ib svg{width:15px;height:15px}
.cl{flex:1;overflow-y:auto;padding:8px 6px}
.gb{margin-bottom:4px}
.gh{display:flex;align-items:center;justify-content:space-between;padding:5px 10px;font-size:10.5px;font-weight:700;color:var(--navy);text-transform:uppercase;letter-spacing:.9px;cursor:pointer;border-radius:var(--rs);transition:var(--t);opacity:.55}
.gh:hover{opacity:.85;background:rgba(44,62,107,.05)}
.gh:hover .ctx-dots{opacity:1}
.gc{transition:var(--t);display:inline-flex}.gc svg{width:12px;height:12px}.gc.col{transform:rotate(-90deg)}
.ci{display:flex;align-items:center;justify-content:space-between;padding:7px 12px;margin:1px 0;font-size:13px;color:var(--c2);cursor:pointer;border-radius:var(--rs);transition:var(--t);user-select:none}
.ci:hover{background:rgba(44,62,107,.06);color:var(--c1)}
.ci:hover .ctx-dots{opacity:1}
.ci.active{background:var(--navy);color:#fff;font-weight:600;box-shadow:0 2px 8px rgba(44,62,107,.22)}
.ci.active .chh{color:rgba(255,255,255,.5)}
.ci.active .ub{background:rgba(255,255,255,.92);color:var(--coral)}
.ci.active .ctx-dots{color:rgba(255,255,255,.5)}
.ci.active:hover .ctx-dots{color:rgba(255,255,255,.8)}
.ci.disabled{opacity:.4;text-decoration:line-through}
.sub-ch-list{padding-left:16px}
.ci.ci-sub{font-size:12px;padding:5px 10px;color:var(--c3)}
.ci.ci-sub:hover{color:var(--c1)}
.ci.ci-sub.active{background:var(--navy-l);color:#fff}
.ci.ci-ai .chn svg{color:#667eea}
.ci.ci-ai.active .chn svg{color:rgba(255,255,255,.7)}
.ci.ci-stock .chn svg{color:#22c55e}
.ci.ci-stock.active .chn svg{color:rgba(255,255,255,.7)}
.chn{display:flex;align-items:center;gap:6px;flex:1;min-width:0}
.chn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chh{font-family:var(--fm);font-size:14px;color:var(--indigo);font-weight:500;opacity:.5}
.chl{font-size:10px;margin-left:1px;opacity:.5}
.ub{min-width:19px;height:19px;padding:0 6px;background:var(--coral);color:#fff;font-size:10px;font-weight:700;border-radius:10px;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 4px rgba(239,83,80,.25)}
/* Context dots (vertical ...) */
.ctx-dots{opacity:0;width:20px;height:20px;display:flex;align-items:center;justify-content:center;color:var(--c3);cursor:pointer;border-radius:var(--rs);transition:var(--t);flex-shrink:0;font-size:14px;line-height:1;letter-spacing:1px;border:none;background:none;font-family:var(--fd)}
.ctx-dots:hover{background:rgba(0,0,0,.08);color:var(--c1)}

.sf{border-top:1px solid var(--border);padding:5px 6px;background:var(--cs-head);display:flex;flex-direction:column;gap:1px}
.fi{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:12px;color:var(--c2);cursor:pointer;border-radius:var(--rs);transition:var(--t);font-weight:500;position:relative}
.fi:hover{background:rgba(44,62,107,.06);color:var(--navy)}
.fi svg{width:14px;height:14px;flex-shrink:0;color:var(--indigo);opacity:.5}

/* Context popup */
.ctx-popup{position:absolute;z-index:500;background:var(--white);border:1px solid var(--border);border-radius:var(--r);box-shadow:0 8px 24px rgba(44,62,107,.15);padding:4px 0;min-width:160px;animation:ctxIn .12s ease}
@keyframes ctxIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.ctx-item{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:12px;font-weight:500;color:var(--c2);cursor:pointer;transition:var(--t)}
.ctx-item:hover{background:var(--hover);color:var(--c1)}
.ctx-item.danger{color:var(--coral)}
.ctx-item.danger:hover{background:var(--coral-l);color:var(--coral)}
.ctx-item svg{width:14px;height:14px;flex-shrink:0}
.ctx-sep{height:1px;background:var(--border-l);margin:4px 0}

/* USER SIDEBAR */
.us{width:214px;min-width:214px;background:var(--us-bg);border-right:1px solid var(--border);display:flex;flex-direction:column}
.us .sh{padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;background:var(--us-head);border-bottom:1px solid var(--border)}
.us .side-t{color:var(--navy-l)}
.ar{display:flex;gap:5px;align-items:center}
.bb{display:flex;align-items:center;gap:4px;padding:5px 12px;font-size:11px;font-weight:600;color:#fff;background:linear-gradient(135deg,var(--teal),var(--teal-d));border:none;border-radius:16px;cursor:pointer;transition:var(--t);font-family:var(--font);box-shadow:0 2px 6px rgba(14,165,160,.25)}
.bb:hover{box-shadow:0 3px 10px rgba(14,165,160,.3);transform:translateY(-1px)}
.bb svg{width:12px;height:12px}
.ib2{display:flex;align-items:center;gap:4px;padding:5px 12px;font-size:11px;font-weight:700;color:#fff;background:linear-gradient(135deg,var(--amber),#e8961c);border:none;border-radius:16px;cursor:pointer;transition:var(--t);font-family:var(--font);box-shadow:0 2px 6px rgba(245,166,35,.25)}
.ib2:hover{box-shadow:0 3px 10px rgba(245,166,35,.3);transform:translateY(-1px)}
.ib2.empty{color:var(--c3);background:var(--gray);box-shadow:none}
.ib2 svg{width:12px;height:12px}
.usec{padding:4px 6px}
.ust{padding:6px 12px;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.7px;display:flex;align-items:center;gap:5px}
.ust.on{color:var(--teal-d)}.ust.off{color:var(--c3)}
.uc{font-weight:500;opacity:.6}
.ui{display:flex;align-items:center;justify-content:space-between;padding:5px 10px;border-radius:var(--rs);cursor:pointer;transition:var(--t)}
.ui:hover{background:rgba(44,62,107,.05)}
.ui:hover .dm-b{opacity:1}
.ul2{display:flex;align-items:center;gap:8px}
.uav{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:#fff;position:relative;flex-shrink:0;box-shadow:0 2px 4px rgba(0,0,0,.1)}
.sd{position:absolute;bottom:-1px;right:-1px;width:10px;height:10px;border-radius:50%;border:2px solid var(--us-bg)}
.sd.on{background:var(--green);box-shadow:0 0 4px rgba(34,197,94,.4)}.sd.off{background:#b0b8c8}
.uname{font-size:12px;color:var(--c2);font-weight:500}
.ui:hover .uname{color:var(--c1)}
.ui.off2 .uav{opacity:.7}.ui.off2 .uname{opacity:.75}
.dm-b{opacity:0;width:26px;height:26px;display:flex;align-items:center;justify-content:center;color:var(--teal);transition:var(--t);border-radius:var(--rs);cursor:pointer;background:none;border:none}
.dm-b:hover{background:var(--teal-l);color:var(--teal-d)}
.dm-b svg{width:14px;height:14px}

/* SUB SIDEBAR */
.scs{width:190px;min-width:190px;background:var(--sc-bg);border-right:1px solid var(--border);display:flex;flex-direction:column}
.scs .sh{background:var(--sc-head);padding:10px 12px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.scs .side-t{color:var(--navy-l);opacity:.7}
.scl{flex:1;overflow-y:auto;padding:6px}
.sci{display:flex;align-items:center;justify-content:space-between;padding:6px 12px;font-size:12px;color:var(--c2);cursor:pointer;border-radius:var(--rs);transition:var(--t);font-weight:500}
.sci:hover{background:rgba(44,62,107,.05);color:var(--c1)}
.sci:hover .ctx-dots{opacity:1}
.sci.active{background:rgba(44,62,107,.1);color:var(--navy);font-weight:600}
.sci.disabled{opacity:.4;text-decoration:line-through}
.scn{display:flex;align-items:center;gap:5px;flex:1;min-width:0}
.sce{padding:24px 12px;text-align:center;font-size:12px;color:var(--c3)}

/* CHAT AREA */
.ca{flex:1;display:flex;flex-direction:column;background:var(--white);min-width:0}
.cha{padding:10px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;background:var(--white);min-height:52px}
.chl2{display:flex;align-items:center;gap:10px}
.stm{display:flex;align-items:center;gap:3px;padding:4px 10px;font-size:10px;font-weight:700;font-family:var(--fd);letter-spacing:.5px;border:1px solid var(--border);background:var(--white);color:var(--c3);border-radius:14px;cursor:pointer;transition:var(--t);text-transform:uppercase}
.stm:hover{border-color:var(--navy-l);color:var(--navy-l)}
.stm.on{border-color:var(--navy);color:#fff;background:var(--navy);box-shadow:0 2px 6px rgba(44,62,107,.2)}
.stm svg{width:11px;height:11px}
.ccn{font-size:16px;font-weight:700;color:var(--navy)}
.ccn .sl{color:var(--indigo);font-size:13px;font-weight:600;opacity:.7}
.chr{display:flex;align-items:center;gap:8px}
.srch{display:flex;align-items:center;gap:7px;padding:7px 14px;background:var(--input);border:1px solid var(--border);border-radius:22px;transition:var(--t)}
.srch:focus-within{border-color:var(--teal);background:var(--white);box-shadow:0 0 0 3px var(--teal-l)}
.srch input{background:none;border:none;outline:none;font-size:12px;color:var(--c1);font-family:var(--font);width:140px}
.srch input::placeholder{color:var(--c3)}
.srch svg{width:14px;height:14px;color:var(--c3);flex-shrink:0}

/* Messages */
.ma{flex:1;overflow-y:auto;overflow-x:hidden;padding:14px 20px;display:flex;flex-direction:column;gap:3px;background:linear-gradient(180deg,#f5f7fb 0%,#fff 60%);position:relative}
.chat-content{flex:1;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;gap:3px}
.mg{display:flex;gap:11px;padding:8px 12px;border-radius:var(--r);transition:var(--t)}
.mg:hover{background:var(--white);box-shadow:0 1px 6px rgba(0,0,0,.05)}
.mav{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;color:#fff;flex-shrink:0;margin-top:2px;box-shadow:0 2px 6px rgba(0,0,0,.1)}
.mc2{flex:1;min-width:0}
.mh{display:flex;align-items:baseline;gap:8px;margin-bottom:3px}
.mau{font-size:13px;font-weight:700;color:var(--c1)}
.mt2{font-size:10px;color:var(--c3);font-family:var(--fm)}
.mx{font-size:13px;color:var(--c2);line-height:1.65;word-break:break-word}
.mf{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--light);border:1px solid var(--border);border-radius:var(--rs);margin-top:5px;font-size:12px;color:var(--c2);cursor:pointer;transition:var(--t);font-weight:500}
.mf:hover{border-color:var(--teal);color:var(--teal)}
.mf svg{width:13px;height:13px}
.sm2{text-align:center;padding:14px;font-size:12px;color:var(--c3)}
.sm2 strong{color:var(--navy)}

/* Input */
.ia{padding:12px 20px;border-top:1px solid var(--border);background:var(--white);position:relative}

/* File Upload Popup */
.fup-popup{position:absolute;bottom:100%;left:0;right:0;background:#fff;border:1px solid #e2e8f0;border-radius:12px 12px 0 0;box-shadow:0 -4px 24px rgba(0,0,0,.12);z-index:500;max-height:420px;display:flex;flex-direction:column;animation:fupSlideUp .2s ease}
@keyframes fupSlideUp{from{transform:translateY(10px);opacity:0}to{transform:translateY(0);opacity:1}}
.fup-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #f0f0f0}
.fup-title{font-size:14px;font-weight:600;color:#1a1a2e}
.fup-close{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border:none;background:none;border-radius:6px;cursor:pointer;font-size:16px;color:#888;transition:.15s}
.fup-close:hover{background:#f5f5f5;color:#333}
.fup-dropzone{margin:12px 16px;border:2px dashed #d0d5dd;border-radius:10px;padding:24px 16px;display:flex;flex-direction:column;align-items:center;gap:6px;transition:border-color .2s,background .2s;cursor:pointer}
.fup-dropzone.dragover{border-color:#0ea5a0;background:rgba(14,165,160,.05)}
.fup-drop-icon{margin-bottom:4px}
.fup-drop-text{font-size:13px;color:#555}
.fup-browse-btn{padding:6px 16px;font-size:12px;font-weight:500;color:#fff;background:linear-gradient(135deg,#0ea5a0,#38b2ac);border:none;border-radius:6px;cursor:pointer;transition:.15s}
.fup-browse-btn:hover{opacity:.9;transform:translateY(-1px)}
.fup-drop-hint{font-size:11px;color:#aaa;margin-top:2px}
.fup-file-list{max-height:160px;overflow-y:auto;padding:0 16px}
.fup-file-list::-webkit-scrollbar{width:4px}
.fup-file-list::-webkit-scrollbar-thumb{background:#ccc;border-radius:2px}
.fup-file-item{display:flex;align-items:center;gap:8px;padding:8px 10px;background:#f8fafc;border-radius:8px;margin-bottom:6px;position:relative}
.fup-file-icon{width:32px;height:32px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}
.fup-file-icon.img{background:#eff6ff;color:#3b82f6}
.fup-file-icon.doc{background:#f0fdf4;color:#16a34a}
.fup-file-icon.arc{background:#fef3c7;color:#d97706}
.fup-file-icon.vid{background:#fce7f3;color:#db2777}
.fup-file-icon.aud{background:#f3e8ff;color:#7c3aed}
.fup-file-icon.etc{background:#f1f5f9;color:#64748b}
.fup-file-info{flex:1;min-width:0}
.fup-file-name{font-size:12px;color:#1a1a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fup-file-size{font-size:11px;color:#999}
.fup-file-del{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:none;background:none;border-radius:50%;cursor:pointer;color:#ccc;font-size:14px;transition:.15s;flex-shrink:0}
.fup-file-del:hover{background:#fee2e2;color:#ef4444}
.fup-footer{display:flex;align-items:center;gap:8px;padding:10px 16px;border-top:1px solid #f0f0f0}
.fup-msg-input{flex:1;border:1px solid #e2e8f0;border-radius:8px;padding:8px 12px;font-size:12px;outline:none;font-family:inherit;transition:border-color .15s}
.fup-msg-input:focus{border-color:#0ea5a0}
.fup-msg-input::placeholder{color:#bbb}
.fup-send-btn{display:flex;align-items:center;gap:4px;padding:8px 16px;font-size:12px;font-weight:500;color:#fff;background:linear-gradient(135deg,#0ea5a0,#38b2ac);border:none;border-radius:8px;cursor:pointer;transition:.15s;flex-shrink:0}
.fup-send-btn:hover:not(:disabled){opacity:.9;transform:translateY(-1px)}
.fup-send-btn:disabled{opacity:.4;cursor:not-allowed}
.iw{display:flex;align-items:flex-end;gap:8px;background:var(--input);border:2px solid var(--border-l);border-radius:var(--rl);padding:8px 12px;transition:var(--t)}
.iw:focus-within{border-color:var(--teal);background:var(--white);box-shadow:0 0 0 4px var(--teal-l)}
.iact{display:flex;align-items:center;gap:2px}
.cin{flex:1;background:none;border:none;outline:none;font-size:13px;color:var(--c1);font-family:var(--font);resize:none;min-height:20px;max-height:200px;line-height:1.5;overflow-y:auto;word-break:break-word;padding:4px 0}
.cin:empty:before{content:attr(data-placeholder);color:var(--c3);pointer-events:none}
.snb{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--teal),var(--green));border:none;border-radius:50%;color:#fff;cursor:pointer;transition:var(--t);flex-shrink:0;box-shadow:0 3px 8px rgba(14,165,160,.3)}
.snb:hover{transform:scale(1.1)}
.snb svg{width:16px;height:16px}

/* Work */
.wa{flex:1;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;color:var(--c3);background:var(--white)}
.wa svg{width:56px;height:56px;opacity:.13}.wa p{font-size:15px;font-weight:500}

/* MODALS */
.mobg{position:fixed;inset:0;background:rgba(44,62,107,.35);z-index:1000;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(3px)}
.mobox{background:var(--white);border-radius:var(--rl);box-shadow:0 16px 48px rgba(44,62,107,.2);overflow:hidden;animation:msl .18s ease}
@keyframes msl{from{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}
.mohd{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background:linear-gradient(135deg,var(--navy-d),var(--navy-l))}
.motl{font-size:15px;font-weight:700;color:#fff}
.mox{width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.12);border:none;color:rgba(255,255,255,.7);cursor:pointer;border-radius:var(--rs);transition:var(--t)}
.mox:hover{background:rgba(255,255,255,.22);color:#fff}
.mox svg{width:16px;height:16px}
.mobd{padding:20px 22px}
.moft{padding:14px 22px;border-top:1px solid var(--border-l);display:flex;justify-content:flex-end;gap:8px;background:var(--light)}
.btn{padding:8px 22px;font-size:12px;font-weight:600;border-radius:22px;cursor:pointer;transition:var(--t);font-family:var(--font);border:none}
.bok{background:linear-gradient(135deg,var(--teal),var(--green));color:#fff;box-shadow:0 2px 8px rgba(14,165,160,.2)}.bok:hover{box-shadow:0 4px 12px rgba(14,165,160,.3);transform:translateY(-1px)}
.bcc{background:var(--gray);color:var(--c2)}.bcc:hover{background:var(--hover)}
.fl2{display:block;font-size:12px;font-weight:600;color:var(--c2);margin-bottom:7px}
.finp{width:100%;padding:10px 14px;background:var(--input);border:1px solid var(--border);border-radius:var(--rs);font-size:13px;color:var(--c1);font-family:var(--font);outline:none;transition:var(--t)}
.finp:focus{border-color:var(--teal);box-shadow:0 0 0 3px var(--teal-l)}
.ftxa{width:100%;padding:10px 14px;background:var(--input);border:1px solid var(--border);border-radius:var(--rs);font-size:13px;color:var(--c1);font-family:var(--font);outline:none;resize:vertical;min-height:85px;transition:var(--t)}
.ftxa:focus{border-color:var(--teal);box-shadow:0 0 0 3px var(--teal-l)}
.fsel{width:100%;padding:10px 14px;background:var(--input);border:1px solid var(--border);border-radius:var(--rs);font-size:13px;color:var(--c1);font-family:var(--font);outline:none}
.frow{margin-bottom:14px}.frow:last-child{margin-bottom:0}
.frow.ch-disabled{opacity:.4;pointer-events:none}

/* 채널 유형 옵션 */
.ch-type-toggle{display:flex;align-items:center;gap:4px;cursor:pointer;padding:4px 0;user-select:none}
.ch-type-toggle:hover{color:var(--teal)}
.ch-type-toggle svg{transition:transform .15s}
.ch-type-opts{display:flex;gap:6px;margin-top:6px}
.ch-type-opt{display:flex;align-items:center;gap:5px;padding:6px 12px;font-size:12px;color:var(--c2);border:1px solid var(--border);border-radius:var(--rs);cursor:pointer;transition:var(--t)}
.ch-type-opt:hover{border-color:var(--teal);color:var(--teal);background:var(--teal-l)}
.ch-type-opt.sel{border-color:var(--teal);color:var(--teal);background:var(--teal-l);font-weight:600}
.ch-ai-opts{margin-top:8px;padding:8px 10px;background:var(--light);border-radius:var(--rs);border:1px solid var(--border-l)}
.mosm{width:400px;max-width:92vw}
.momd{width:450px;max-width:92vw}
.molg{width:520px;max-width:92vw}
/* Channel Create - Invite Search */
.ch-inv-results{position:absolute;top:100%;left:0;right:0;background:#fff;border:1px solid var(--border);border-radius:var(--rs);box-shadow:0 8px 24px rgba(0,0,0,.12);z-index:10;max-height:180px;overflow-y:auto;margin-top:2px}
.ch-inv-item{display:flex;align-items:center;gap:10px;padding:8px 12px;cursor:pointer;transition:background .1s}
.ch-inv-item:hover{background:var(--hover)}
.ch-inv-av{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:13px;font-weight:600;flex-shrink:0}
.ch-inv-info{min-width:0}
.ch-inv-name{font-size:13px;font-weight:600;color:var(--c1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ch-inv-email{font-size:11px;color:var(--c3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ch-inv-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.ch-inv-tag{display:inline-flex;align-items:center;gap:4px;background:var(--input);border:1px solid var(--border);border-radius:16px;padding:3px 10px 3px 3px;font-size:12px;color:var(--c1);font-weight:500}
.ch-inv-tag-av{width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:10px;font-weight:600;flex-shrink:0}
.ch-inv-tag-x{margin-left:2px;cursor:pointer;color:#aaa;font-size:15px;line-height:1;transition:color .1s}
.ch-inv-tag-x:hover{color:#ef4444}
/* Radio */
.rg{display:flex;gap:8px;margin-top:4px}
.ro{display:flex;align-items:center;gap:6px;padding:8px 16px;border:1.5px solid var(--border);border-radius:20px;cursor:pointer;transition:var(--t);font-size:12px;font-weight:500;color:var(--c2)}
.ro:hover{border-color:var(--navy-l)}
.ro.sel{border-color:var(--navy);background:rgba(44,62,107,.06);color:var(--navy);font-weight:600}
.rd2{width:14px;height:14px;border-radius:50%;border:2px solid var(--border);transition:var(--t);display:flex;align-items:center;justify-content:center}
.ro.sel .rd2{border-color:var(--navy)}.ro.sel .rd2::after{content:'';width:7px;height:7px;border-radius:50%;background:var(--navy)}
.dmto{font-size:13px;font-weight:600;color:var(--teal);margin-bottom:4px}
.dmto.bc{color:var(--amber)}
.bcc2{font-size:24px;font-weight:700;color:var(--navy);text-align:center;padding:12px 0 4px}
.bccl{font-size:12px;color:var(--c3);text-align:center;margin-bottom:16px}

/* Invite tags */
.inv-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px;min-height:28px}
.inv-tag{display:flex;align-items:center;gap:4px;padding:4px 10px;background:var(--teal-l);border:1px solid rgba(14,165,160,.2);border-radius:16px;font-size:11px;font-weight:600;color:var(--teal-d)}
.inv-tag button{background:none;border:none;color:var(--teal-d);cursor:pointer;font-size:14px;line-height:1;padding:0;margin-left:2px}
.inv-tag button:hover{color:var(--coral)}

/* INBOX */
.moib{width:720px;max-width:94vw;max-height:82vh;display:flex;flex-direction:column}
.ibd{display:flex;flex:1;overflow:hidden;min-height:370px}
.ibl{width:280px;min-width:280px;border-right:1px solid var(--border);display:flex;flex-direction:column;background:var(--light)}
.ibls{flex:1;overflow-y:auto}
.ibft{display:flex;gap:3px;padding:10px;border-bottom:1px solid var(--border-l);background:var(--white)}
.fbtn{padding:5px 14px;font-size:11px;font-weight:600;color:var(--c3);background:none;border:none;border-radius:16px;cursor:pointer;transition:var(--t);font-family:var(--font)}
.fbtn:hover{color:var(--c2);background:var(--hover)}
.fbtn.on{color:#fff;background:var(--navy)}
.ibi{padding:12px 14px;cursor:pointer;border-bottom:1px solid var(--border-l);transition:var(--t)}
.ibi:hover{background:var(--hover)}
.ibi.on{background:var(--teal-l);border-left:3px solid var(--teal)}
.ibi.ur{border-left:3px solid var(--coral)}
.ibi.ur .ibsn{color:var(--c1);font-weight:700}
.ibi.on.ur{border-left-color:var(--teal)}
.ibsn{font-size:12px;color:var(--c2);font-weight:500;margin-bottom:3px}
.ibpv{font-size:11px;color:var(--c3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ibtm{font-size:10px;color:var(--c3);margin-top:4px;font-family:var(--fm)}
.ibdt{flex:1;padding:20px;overflow-y:auto;background:var(--white)}
.ibdh{margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--border-l)}
.ibdf{font-size:16px;font-weight:700;color:var(--navy)}
.ibdt2{font-size:11px;color:var(--c3);margin-top:4px;font-family:var(--fm)}
.ibdb{font-size:13px;color:var(--c2);line-height:1.75}
.ibe{display:flex;align-items:center;justify-content:center;color:var(--c3);font-size:13px;height:100%}
/* Context user list */
.ctx-users{max-height:200px;overflow-y:auto;padding:4px 0;border-top:1px solid var(--border-l)}
.ctx-ulabel{padding:6px 14px;font-size:10px;font-weight:700;color:var(--c3);text-transform:uppercase;letter-spacing:.5px}
.ctx-ufilter{padding:2px 8px 6px}
.ctx-ufilter input{width:100%;padding:5px 10px;font-size:11px;border:1px solid var(--border);border-radius:var(--rs);background:var(--input);outline:none;font-family:var(--font);color:var(--c1)}
.ctx-ufilter input:focus{border-color:var(--teal)}
.ctx-uitem{display:flex;align-items:center;gap:8px;padding:5px 14px;font-size:12px;color:var(--c2);cursor:pointer;transition:var(--t)}
.ctx-uitem:hover{background:var(--hover)}
.ctx-uitem.selected{background:var(--teal-l);color:var(--teal-d);font-weight:600}
.ctx-uav{width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;color:#fff;flex-shrink:0}
.ctx-ucheck{width:16px;height:16px;border-radius:3px;border:1.5px solid var(--border);display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:var(--t)}
.ctx-uitem.selected .ctx-ucheck{border-color:var(--teal);background:var(--teal)}
.ctx-uitem.selected .ctx-ucheck::after{content:'✓';color:#fff;font-size:10px;font-weight:700}
.ctx-uall{display:flex;align-items:center;gap:6px;padding:6px 14px;font-size:11px;font-weight:600;color:var(--navy);cursor:pointer;transition:var(--t)}
.ctx-uall:hover{background:var(--hover)}
.ctx-uall.all-sel{color:var(--teal)}
.ctx-wide{min-width:220px}
/* User manage modal */
.um-list{max-height:250px;overflow-y:auto;border:1px solid var(--border);border-radius:var(--rs);margin-bottom:12px}
.um-item{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid var(--border-l);transition:var(--t)}
.um-item:last-child{border-bottom:none}
.um-item:hover{background:var(--hover)}
.um-left{display:flex;align-items:center;gap:8px}
.um-av{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:#fff}
.um-name{font-size:12px;font-weight:500;color:var(--c2)}
.um-del{background:none;border:none;color:var(--c3);cursor:pointer;font-size:16px;transition:var(--t);padding:2px 6px;border-radius:var(--rs)}
.um-del:hover{color:var(--coral);background:var(--coral-l)}
.um-add{display:flex;gap:6px}
.um-empty{padding:20px;text-align:center;color:var(--c3);font-size:12px}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --navy: #2c3e6b;
    --navy-d: #243358;
    --navy-l: #3a5289;
    --teal: #0ea5a0;
    --teal-l: rgba(14,165,160,.07);
    --teal-m: rgba(14,165,160,.14);
    --teal-d: #0c8f8a;
    --coral: #ef5350;
    --coral-l: rgba(239,83,80,.07);
    --amber: #f5a623;
    --amber-l: rgba(245,166,35,.1);
    --green: #22c55e;
    --indigo: #5c6bc0;
    --white: #fff;
    --light: #f4f6f9;
    --gray: #ebeef3;
    --hover: #e4e8f0;
    --input: #f0f2f6;
    --cs-bg: #e8eaf6;
    --cs-head: #dde0f0;
    --us-bg: #eceef8;
    --us-head: #e4e6f2;
    --sc-bg: #f0f1fa;
    --sc-head: #eaebf5;
    --c1: #1a1f2e;
    --c2: #4a5068;
    --c3: #8b92a7;
    --border: #d8dce6;
    --border-l: #e8ecf2;
    --r: 8px;
    --rs: 6px;
    --rl: 12px;
    --t: .18s ease;
    --font: 'Noto Sans KR',sans-serif;
    --fd: 'Outfit',sans-serif;
    --fm: 'JetBrains Mono',monospace;
}

body {
    font-family: var(--font);
    background: var(--light);
    color: var(--c1);
    height: 100vh;
    overflow: hidden
}

::-webkit-scrollbar {
    width: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px
}

[ng-cloak] {
    display: none!important
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh
}

/* TOP BAR */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    min-height: 50px;
    background: linear-gradient(135deg,var(--navy-d),var(--navy-l));
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(44,62,107,.25)
}

.top-left {
    display: flex;
    align-items: center;
    gap: 4px
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--fd);
    color: rgba(255,255,255,.5);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--r);
    transition: var(--t)
}

.tab-btn:hover {
    color: rgba(255,255,255,.8);
    background: rgba(255,255,255,.08)
}

.tab-btn.active {
    color: #fff;
    background: rgba(255,255,255,.16)
}

.tab-btn svg {
    width: 16px;
    height: 16px
}

.tab-label {
    font-size: 10px;
    font-family: var(--font);
    font-weight: 400;
    color: rgba(255,255,255,.35);
    margin-left: 2px
}

.tab-btn.active .tab-label {
    color: rgba(255,255,255,.55)
}

.top-right {
    display: flex;
    align-items: center;
    gap: 14px
}

.user-info {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: rgba(255,255,255,.88);
    font-weight: 500
}

.uav-top {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg,var(--teal),var(--green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 8px rgba(14,165,160,.35)
}

.logout-btn {
    padding: 6px 16px;
    font-size: 12px;
    color: rgba(255,255,255,.55);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--t);
    font-family: var(--font);
    font-weight: 500
}

.logout-btn:hover {
    color: #fff;
    border-color: var(--coral);
    background: rgba(239,83,80,.25)
}

.main-area {
    flex: 1;
    display: flex;
    overflow: hidden
}

/* CHANNEL SIDEBAR */
.cs {
    width: 236px;
    min-width: 236px;
    background: var(--cs-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column
}

.cs .sh {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--cs-head);
    border-bottom: 1px solid var(--border)
}

.side-t {
    font-size: 13px;
    font-weight: 700
}

.cs .side-t {
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer
}

.cs .side-t .arr {
    transition: var(--t);
    display: inline-flex
}

.cs .side-t .arr svg {
    width: 14px;
    height: 14px
}

.cs .side-t .arr.up {
    transform: rotate(180deg)
}

.ha {
    display: flex;
    gap: 3px
}

.ib {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--c3);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t)
}

.ib:hover {
    background: rgba(0,0,0,.06);
    color: var(--c1)
}

.ib svg {
    width: 15px;
    height: 15px
}

.cl {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px
}

.gb {
    margin-bottom: 4px
}

.gh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: .9px;
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t);
    opacity: .55
}

.gh:hover {
    opacity: .85;
    background: rgba(44,62,107,.05)
}

.gh:hover .ctx-dots {
    opacity: 1
}

.gc {
    transition: var(--t);
    display: inline-flex
}

.gc svg {
    width: 12px;
    height: 12px
}

.gc.col {
    transform: rotate(-90deg)
}

.ci {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    margin: 1px 0;
    font-size: 13px;
    color: var(--c2);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t);
    user-select: none
}

.ci:hover {
    background: rgba(44,62,107,.06);
    color: var(--c1)
}

.ci:hover .ctx-dots {
    opacity: 1
}

.ci.active {
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(44,62,107,.22)
}

.ci.active .chh {
    color: rgba(255,255,255,.5)
}

.ci.active .ub {
    background: rgba(255,255,255,.92);
    color: var(--coral)
}

.ci.active .ctx-dots {
    color: rgba(255,255,255,.5)
}

.ci.active:hover .ctx-dots {
    color: rgba(255,255,255,.8)
}

.ci.disabled {
    opacity: .4;
    text-decoration: line-through
}

.chn {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0
}

.chn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.chh {
    font-family: var(--fm);
    font-size: 14px;
    color: var(--indigo);
    font-weight: 500;
    opacity: .5
}

.chl {
    font-size: 10px;
    margin-left: 1px;
    opacity: .5
}

.ub {
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    background: var(--coral);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(239,83,80,.25)
}

/* Context dots (vertical ...) */
.ctx-dots {
    opacity: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c3);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t);
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 1px;
    border: none;
    background: none;
    font-family: var(--fd)
}

.ctx-dots:hover {
    background: rgba(0,0,0,.08);
    color: var(--c1)
}

.sf {
    border-top: 1px solid var(--border);
    padding: 5px 6px;
    background: var(--cs-head);
    display: flex;
    flex-direction: column;
    gap: 1px
}

.fi {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--c2);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t);
    font-weight: 500;
    position: relative
}

.fi:hover {
    background: rgba(44,62,107,.06);
    color: var(--navy)
}

.fi svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--indigo);
    opacity: .5
}

/* Context popup */
.ctx-popup {
    position: absolute;
    z-index: 500;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: 0 8px 24px rgba(44,62,107,.15);
    padding: 4px 0;
    min-width: 160px;
    animation: ctxIn .12s ease
}

@keyframes ctxIn {
    from {
        opacity: 0;
        transform: translateY(-4px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--c2);
    cursor: pointer;
    transition: var(--t)
}

.ctx-item:hover {
    background: var(--hover);
    color: var(--c1)
}

.ctx-item.danger {
    color: var(--coral)
}

.ctx-item.danger:hover {
    background: var(--coral-l);
    color: var(--coral)
}

.ctx-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0
}

.ctx-sep {
    height: 1px;
    background: var(--border-l);
    margin: 4px 0
}

/* USER SIDEBAR */
.us {
    width: 214px;
    min-width: 214px;
    background: var(--us-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column
}

.us .sh {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
    background: var(--us-head);
    border-bottom: 1px solid var(--border)
}

.us .side-t {
    color: var(--navy-l)
}

.ar {
    display: flex;
    gap: 5px;
    align-items: center
}

.bb {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg,var(--teal),var(--teal-d));
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--t);
    font-family: var(--font);
    box-shadow: 0 2px 6px rgba(14,165,160,.25)
}

.bb:hover {
    box-shadow: 0 3px 10px rgba(14,165,160,.3);
    transform: translateY(-1px)
}

.bb svg {
    width: 12px;
    height: 12px
}

.ib2 {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg,var(--amber),#e8961c);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--t);
    font-family: var(--font);
    box-shadow: 0 2px 6px rgba(245,166,35,.25)
}

.ib2:hover {
    box-shadow: 0 3px 10px rgba(245,166,35,.3);
    transform: translateY(-1px)
}

.ib2.empty {
    color: var(--c3);
    background: var(--gray);
    box-shadow: none
}

.ib2 svg {
    width: 12px;
    height: 12px
}

.usec {
    padding: 4px 6px
}

.ust {
    padding: 6px 12px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    display: flex;
    align-items: center;
    gap: 5px
}

.ust.on {
    color: var(--teal-d)
}

.ust.off {
    color: var(--c3)
}

.uc {
    font-weight: 500;
    opacity: .6
}

.ui {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border-radius: var(--rs);
    cursor: pointer;
    transition: var(--t)
}

.ui:hover {
    background: rgba(44,62,107,.05)
}

.ui:hover .dm-b {
    opacity: 1
}

.ul2 {
    display: flex;
    align-items: center;
    gap: 8px
}

.uav {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.1)
}

.sd {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--us-bg)
}

.sd.on {
    background: var(--green);
    box-shadow: 0 0 4px rgba(34,197,94,.4)
}

.sd.off {
    background: #b0b8c8
}

.uname {
    font-size: 12px;
    color: var(--c2);
    font-weight: 500
}

.ui:hover .uname {
    color: var(--c1)
}

.ui.off2 .uav {
    opacity: .7
}

.ui.off2 .uname {
    opacity: .75
}

.dm-b {
    opacity: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
    transition: var(--t);
    border-radius: var(--rs);
    cursor: pointer;
    background: none;
    border: none
}

.dm-b:hover {
    background: var(--teal-l);
    color: var(--teal-d)
}

.dm-b svg {
    width: 14px;
    height: 14px
}

/* SUB SIDEBAR */
.scs {
    width: 190px;
    min-width: 190px;
    background: var(--sc-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column
}

.scs .sh {
    background: var(--sc-head);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.scs .side-t {
    color: var(--navy-l);
    opacity: .7
}

.scl {
    flex: 1;
    overflow-y: auto;
    padding: 6px
}

.sci {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--c2);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t);
    font-weight: 500
}

.sci:hover {
    background: rgba(44,62,107,.05);
    color: var(--c1)
}

.sci:hover .ctx-dots {
    opacity: 1
}

.sci.active {
    background: rgba(44,62,107,.1);
    color: var(--navy);
    font-weight: 600
}

.sci.disabled {
    opacity: .4;
    text-decoration: line-through
}

.scn {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0
}

.sce {
    padding: 24px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--c3)
}

/* CHAT AREA */
.ca {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    min-width: 0
}

.cha {
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    min-height: 52px
}

.chl2 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 50px;     /* 좁아져도 최소 몇 글자 + … 는 보이도록 */
    overflow: hidden
}

.stm {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--fd);
    letter-spacing: .5px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--c3);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--t);
    text-transform: uppercase
}

.stm:hover {
    border-color: var(--navy-l);
    color: var(--navy-l)
}

.stm.on {
    border-color: var(--navy);
    color: #fff;
    background: var(--navy);
    box-shadow: 0 2px 6px rgba(44,62,107,.2)
}

.stm svg {
    width: 11px;
    height: 11px
}

.ccn {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    white-space: nowrap;     /* 타이틀 줄바꿈 금지 — 넘치면 … 처리 */
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0
}

.ccn .sl {
    color: var(--indigo);
    font-size: 13px;
    font-weight: 600;
    opacity: .7
}

.chr {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0            /* 검색창이 대신 줄어들 수 있도록 */
}

.chr .srch {
    flex-shrink: 1;
    min-width: 0
}

.chr .srch input {
    flex: 1 1 40px;         /* 좁을 때 검색 입력칸이 우선 축소 (최소 40px) */
    min-width: 40px;
    max-width: 140px
}

.srch {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 22px;
    transition: var(--t)
}

.srch:focus-within {
    border-color: var(--teal);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--teal-l)
}

.srch input {
    background: none;
    border: none;
    outline: none;
    font-size: 12px;
    color: var(--c1);
    font-family: var(--font);
    width: 140px
}

.srch input::placeholder {
    color: var(--c3)
}

.srch svg {
    width: 14px;
    height: 14px;
    color: var(--c3);
    flex-shrink: 0
}

/* Messages */
.ma {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: linear-gradient(180deg,#f5f7fb 0%,#fff 60%)
}

.mg {
    display: flex;
    gap: 11px;
    padding: 8px 12px;
    border-radius: var(--r);
    transition: var(--t)
}

.mg:hover {
    background: var(--white);
    box-shadow: 0 1px 6px rgba(0,0,0,.05)
}

.mav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,.1)
}

.mc2 {
    flex: 1;
    min-width: 0
}

.mh {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px
}

.mau {
    font-size: 13px;
    font-weight: 700;
    color: var(--c1)
}

.mt2 {
    font-size: 10px;
    color: var(--c3);
    font-family: var(--fm)
}

.mx {
    font-size: 13px;
    color: var(--c2);
    line-height: 1.65;
    word-break: break-word
}

.mf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    margin-top: 5px;
    font-size: 12px;
    color: var(--c2);
    cursor: pointer;
    transition: var(--t);
    font-weight: 500
}

.mf:hover {
    border-color: var(--teal);
    color: var(--teal)
}

.mf svg {
    width: 13px;
    height: 13px
}

.sm2 {
    text-align: center;
    padding: 14px;
    font-size: 12px;
    color: var(--c3)
}

.sm2 strong {
    color: var(--navy)
}

/* Input */
.ia {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--white)
}

.iw {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--input);
    border: 2px solid var(--border-l);
    border-radius: var(--rl);
    padding: 8px 12px;
    transition: var(--t)
}

.iw:focus-within {
    border-color: var(--teal);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--teal-l)
}

.iact {
    display: flex;
    align-items: center;
    gap: 2px
}

.cin {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--c1);
    font-family: var(--font);
    resize: none;
    max-height: 240px;
    line-height: 1.5;
    overflow-y: auto
}

.cin::placeholder {
    color: var(--c3)
}

.snb {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,var(--teal),var(--green));
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: var(--t);
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(14,165,160,.3)
}

.snb:hover {
    transform: scale(1.1)
}

.snb svg {
    width: 16px;
    height: 16px
}

/* Work Area - Full */
.wa {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--white)
}

.w-side {
    width: 230px;
    min-width: 230px;
    background: var(--cs-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column
}

.w-side .sh {
    padding: 12px 14px;
    background: var(--cs-head);
    border-bottom: 1px solid var(--border)
}

.w-side .side-t {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy)
}

.w-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px
}

.w-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--c2);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t);
    margin-bottom: 1px
}

.w-nav-item:hover {
    background: rgba(44,62,107,.06);
    color: var(--c1)
}

.w-nav-item.active {
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(44,62,107,.2)
}

.w-nav-item.active svg {
    color: #fff;
    opacity: .7
}

.w-nav-item svg {
    width: 16px;
    height: 16px;
    color: var(--indigo);
    opacity: .5;
    flex-shrink: 0
}

.w-nav-sep {
    height: 1px;
    background: var(--border);
    margin: 8px 12px
}

.w-nav-label {
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 700;
    color: var(--c3);
    text-transform: uppercase;
    letter-spacing: .8px
}

.w-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--coral);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto
}

.w-badge.warn {
    background: var(--amber)
}

.w-badge.ok {
    background: var(--green)
}

/* Main content */
.w-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.w-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    min-height: 54px
}

.w-header-left {
    display: flex;
    align-items: center;
    gap: 12px
}

.w-header-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy)
}

.w-view-toggle {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    overflow: hidden
}

.w-vt-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--white);
    border: none;
    cursor: pointer;
    color: var(--c3);
    transition: var(--t);
    font-family: var(--font)
}

.w-vt-btn:hover {
    color: var(--c2)
}

.w-vt-btn.active {
    background: var(--navy);
    color: #fff
}

.w-header-right {
    display: flex;
    align-items: center;
    gap: 6px
}

.w-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--t);
    font-family: var(--font);
    border: none
}

.w-btn-primary {
    background: linear-gradient(135deg,var(--teal),var(--green));
    color: #fff;
    box-shadow: 0 2px 8px rgba(14,165,160,.2)
}

.w-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(14,165,160,.3);
    transform: translateY(-1px)
}

.w-btn-outline {
    background: var(--white);
    color: var(--c2);
    border: 1.5px solid var(--border)
}

.w-btn-outline:hover {
    border-color: var(--c3);
    background: var(--light)
}

.w-btn svg {
    width: 14px;
    height: 14px
}

.w-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: var(--light)
}

/* Dashboard */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 14px;
    margin-bottom: 20px
}

.dash-card {
    background: var(--white);
    border-radius: var(--rl);
    padding: 18px 20px;
    border: 1px solid var(--border-l);
    transition: var(--t)
}

.dash-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.06)
}

.dash-card-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--c3);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .5px
}

.dash-card-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1
}

.dash-card-sub {
    font-size: 11px;
    color: var(--c3);
    margin-top: 6px
}

.dash-card.accent .dash-card-val {
    color: var(--teal)
}

.dash-card.warn .dash-card-val {
    color: var(--coral)
}

/* Task table */
.task-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--rl);
    border: 1px solid var(--border-l);
    overflow: hidden
}

.task-table table {
    width: 100%;
    border-collapse: collapse
}

.task-table th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--c3);
    text-align: left;
    background: var(--light);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: .5px
}

.task-table td {
    padding: 10px 14px;
    font-size: 12px;
    color: var(--c2);
    border-bottom: 1px solid var(--border-l);
    vertical-align: middle
}

.task-table tr:hover td {
    background: rgba(44,62,107,.015)
}

.task-table tr.overdue td {
    background: rgba(239,83,80,.03)
}

.task-table tr.due-soon td {
    background: rgba(245,166,35,.03)
}

.task-title-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--c1);
    cursor: pointer
}

.task-title-cell:hover {
    color: var(--teal)
}

.task-title-cell .tree-indent {
    display: inline-block;
    width: 20px
}

.task-title-cell .tree-toggle {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    transition: var(--t);
    color: var(--c3);
    flex-shrink: 0
}

.task-title-cell .tree-toggle:hover {
    background: var(--hover);
    color: var(--c1)
}

.task-title-cell .tree-toggle svg {
    width: 12px;
    height: 12px
}

.st-badge {
    display: inline-flex;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: .3px
}

.st-todo {
    background: #e8eaf6;
    color: var(--navy)
}

.st-prog {
    background: rgba(14,165,160,.1);
    color: var(--teal-d)
}

.st-done {
    background: rgba(34,197,94,.1);
    color: #16a34a
}

.st-hold {
    background: rgba(245,166,35,.1);
    color: #d4850a
}

.st-cancel {
    background: var(--gray);
    color: var(--c3)
}

.pri-high {
    color: var(--coral);
    font-weight: 700;
    font-size: 11px
}

.pri-mid {
    color: var(--amber);
    font-weight: 600;
    font-size: 11px
}

.pri-low {
    color: var(--c3);
    font-size: 11px
}

.due-text {
    font-size: 11px;
    font-family: var(--fm)
}

.due-over {
    color: var(--coral);
    font-weight: 700
}

.due-soon {
    color: var(--amber);
    font-weight: 600
}

.task-actions {
    display: flex;
    gap: 2px
}

.task-act {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--c3);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t)
}

.task-act:hover {
    background: var(--hover);
    color: var(--c1)
}

.task-act svg {
    width: 14px;
    height: 14px
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 6px
}

.task-assignee .ta-av {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #fff
}

.perm-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--gray);
    color: var(--c3)
}

.perm-badge.owner {
    background: rgba(14,165,160,.1);
    color: var(--teal-d)
}

.perm-badge.edit {
    background: rgba(92,107,192,.1);
    color: var(--indigo)
}

.perm-badge.view {
    background: var(--gray);
    color: var(--c3)
}

/* Calendar */
.cal-wrap {
    background: var(--white);
    border-radius: var(--rl);
    border: 1px solid var(--border-l);
    overflow: hidden
}

.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border)
}

.cal-head-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy)
}

.cal-nav {
    display: flex;
    gap: 4px
}

.cal-nav button {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: var(--rs);
    cursor: pointer;
    color: var(--c2);
    transition: var(--t)
}

.cal-nav button:hover {
    background: var(--light)
}

.cal-nav svg {
    width: 14px;
    height: 14px
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7,1fr)
}

.cal-day-head {
    padding: 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--c3);
    background: var(--light);
    border-bottom: 1px solid var(--border-l)
}

.cal-cell {
    min-height: 80px;
    padding: 4px 6px;
    border-right: 1px solid var(--border-l);
    border-bottom: 1px solid var(--border-l);
    cursor: pointer;
    transition: var(--t)
}

.cal-cell:nth-child(7n) {
    border-right: none
}

.cal-cell:hover {
    background: var(--teal-l)
}

.cal-cell.today {
    background: rgba(14,165,160,.04)
}

.cal-cell.other {
    opacity: .3
}

.cal-date {
    font-size: 11px;
    font-weight: 600;
    color: var(--c2);
    margin-bottom: 2px
}

.cal-cell.today .cal-date {
    color: var(--teal);
    font-weight: 700
}

.cal-task {
    padding: 2px 5px;
    font-size: 9px;
    font-weight: 600;
    border-radius: 3px;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer
}

.cal-task.ct-todo {
    background: #e8eaf6;
    color: var(--navy)
}

.cal-task.ct-prog {
    background: rgba(14,165,160,.12);
    color: var(--teal-d)
}

.cal-task.ct-over {
    background: rgba(239,83,80,.12);
    color: var(--coral);
    font-weight: 700
}

/* Task detail panel */
.td-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 520px;
    max-width: 100vw;
    height: 100vh;
    background: var(--white);
    box-shadow: -8px 0 32px rgba(44,62,107,.12);
    z-index: 800;
    display: flex;
    flex-direction: column;
    animation: tdSlide .2s ease
}

@keyframes tdSlide {
    from {
        transform: translateX(100%)
    }

    to {
        transform: translateX(0)
    }
}

.td-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--light)
}

.td-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    flex: 1
}

.td-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--c3);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t)
}

.td-close:hover {
    background: var(--hover);
    color: var(--c1)
}

.td-close svg {
    width: 18px;
    height: 18px
}

.td-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px
}

.td-field {
    margin-bottom: 16px
}

.td-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--c3);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px
}

.td-val {
    font-size: 13px;
    color: var(--c2);
    line-height: 1.6
}

.td-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px
}

.td-row .td-field {
    flex: 1;
    margin-bottom: 0
}

.td-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-l);
    margin-bottom: 16px
}

.td-tab {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--t)
}

.td-tab:hover {
    color: var(--c2)
}

.td-tab.active {
    color: var(--navy);
    border-bottom-color: var(--navy)
}

.td-history {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.td-hist-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--light);
    border-radius: var(--rs)
}

.td-hist-av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0
}

.td-hist-content {
    flex: 1;
    min-width: 0
}

.td-hist-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--c1)
}

.td-hist-text {
    font-size: 12px;
    color: var(--c2);
    margin-top: 2px;
    line-height: 1.5
}

.td-hist-time {
    font-size: 10px;
    color: var(--c3);
    font-family: var(--fm);
    margin-top: 3px
}

.td-comment-input {
    display: flex;
    gap: 8px;
    margin-top: 12px
}

.td-comment-input input {
    flex: 1;
    padding: 9px 14px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--rs);
    background: var(--input);
    outline: none;
    font-family: var(--font);
    color: var(--c1)
}

.td-comment-input input:focus {
    border-color: var(--teal)
}

.td-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
    background: var(--light)
}

/* Share modal extra */
.share-ch-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--rs);
    margin-top: 6px
}

.share-ch-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 12px;
    color: var(--c2);
    cursor: pointer;
    transition: var(--t)
}

.share-ch-item:hover {
    background: var(--hover)
}

.share-ch-item.selected {
    background: var(--teal-l);
    color: var(--teal-d);
    font-weight: 600
}

/* MODALS */
.mobg {
    position: fixed;
    inset: 0;
    background: rgba(44,62,107,.35);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px)
}

.mobox {
    background: var(--white);
    border-radius: var(--rl);
    box-shadow: 0 16px 48px rgba(44,62,107,.2);
    overflow: hidden;
    animation: msl .18s ease
}

@keyframes msl {
    from {
        transform: translateY(8px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

.mohd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg,var(--navy-d),var(--navy-l))
}

.motl {
    font-size: 15px;
    font-weight: 700;
    color: #fff
}

.mox {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.12);
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    border-radius: var(--rs);
    transition: var(--t)
}

.mox:hover {
    background: rgba(255,255,255,.22);
    color: #fff
}

.mox svg {
    width: 16px;
    height: 16px
}

.mobd {
    padding: 20px 22px
}

.moft {
    padding: 14px 22px;
    border-top: 1px solid var(--border-l);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--light)
}

.btn {
    padding: 8px 22px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 22px;
    cursor: pointer;
    transition: var(--t);
    font-family: var(--font);
    border: none
}

.bok {
    background: linear-gradient(135deg,var(--teal),var(--green));
    color: #fff;
    box-shadow: 0 2px 8px rgba(14,165,160,.2)
}

.bok:hover {
    box-shadow: 0 4px 12px rgba(14,165,160,.3);
    transform: translateY(-1px)
}

.bcc {
    background: var(--gray);
    color: var(--c2)
}

.bcc:hover {
    background: var(--hover)
}

.fl2 {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--c2);
    margin-bottom: 7px
}

.finp {
    width: 100%;
    padding: 10px 14px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    font-size: 13px;
    color: var(--c1);
    font-family: var(--font);
    outline: none;
    transition: var(--t)
}

.finp:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-l)
}

.ftxa {
    width: 100%;
    padding: 10px 14px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    font-size: 13px;
    color: var(--c1);
    font-family: var(--font);
    outline: none;
    resize: vertical;
    min-height: 85px;
    transition: var(--t)
}

.ftxa:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-l)
}

.fsel {
    width: 100%;
    padding: 10px 14px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    font-size: 13px;
    color: var(--c1);
    font-family: var(--font);
    outline: none
}

.frow {
    margin-bottom: 14px
}

.frow:last-child {
    margin-bottom: 0
}

.mosm {
    width: 400px;
    max-width: 92vw
}

.momd {
    width: 450px;
    max-width: 92vw
}

.molg {
    width: 520px;
    max-width: 92vw
}

/* Radio */
.rg {
    display: flex;
    gap: 8px;
    margin-top: 4px
}

.ro {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--t);
    font-size: 12px;
    font-weight: 500;
    color: var(--c2)
}

.ro:hover {
    border-color: var(--navy-l)
}

.ro.sel {
    border-color: var(--navy);
    background: rgba(44,62,107,.06);
    color: var(--navy);
    font-weight: 600
}

.rd2 {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: var(--t);
    display: flex;
    align-items: center;
    justify-content: center
}

.ro.sel .rd2 {
    border-color: var(--navy)
}

.ro.sel .rd2::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--navy)
}

.dmto {
    font-size: 13px;
    font-weight: 600;
    color: var(--teal);
    margin-bottom: 4px
}

.dmto.bc {
    color: var(--amber)
}

.bcc2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
    padding: 12px 0 4px
}

.bccl {
    font-size: 12px;
    color: var(--c3);
    text-align: center;
    margin-bottom: 16px
}

/* Invite tags */
.inv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    min-height: 28px
}

.inv-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--teal-l);
    border: 1px solid rgba(14,165,160,.2);
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--teal-d)
}

.inv-tag button {
    background: none;
    border: none;
    color: var(--teal-d);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin-left: 2px
}

.inv-tag button:hover {
    color: var(--coral)
}

/* INBOX */
.moib {
    width: 720px;
    max-width: 94vw;
    max-height: 82vh;
    display: flex;
    flex-direction: column
}

.ibd {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 370px
}

.ibl {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--light)
}

.ibls {
    flex: 1;
    overflow-y: auto
}

.ibft {
    display: flex;
    gap: 3px;
    padding: 10px;
    border-bottom: 1px solid var(--border-l);
    background: var(--white)
}

.fbtn {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--c3);
    background: none;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--t);
    font-family: var(--font)
}

.fbtn:hover {
    color: var(--c2);
    background: var(--hover)
}

.fbtn.on {
    color: #fff;
    background: var(--navy)
}

.ibi {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-l);
    transition: var(--t)
}

.ibi:hover {
    background: var(--hover)
}

.ibi.on {
    background: var(--teal-l);
    border-left: 3px solid var(--teal)
}

.ibi.ur {
    border-left: 3px solid var(--coral)
}

.ibi.ur .ibsn {
    color: var(--c1);
    font-weight: 700
}

.ibi.on.ur {
    border-left-color: var(--teal)
}

.ibsn {
    font-size: 12px;
    color: var(--c2);
    font-weight: 500;
    margin-bottom: 3px
}

.ibpv {
    font-size: 11px;
    color: var(--c3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.ibtm {
    font-size: 10px;
    color: var(--c3);
    margin-top: 4px;
    font-family: var(--fm)
}

.ibdt {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--white)
}

.ibdh {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-l)
}

.ibdf {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy)
}

.ibdt2 {
    font-size: 11px;
    color: var(--c3);
    margin-top: 4px;
    font-family: var(--fm)
}

.ibdb {
    font-size: 13px;
    color: var(--c2);
    line-height: 1.75
}

.ibe {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c3);
    font-size: 13px;
    height: 100%
}

/* Context user list */
.ctx-users {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
    border-top: 1px solid var(--border-l)
}

.ctx-ulabel {
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 700;
    color: var(--c3);
    text-transform: uppercase;
    letter-spacing: .5px
}

.ctx-ufilter {
    padding: 2px 8px 6px
}

.ctx-ufilter input {
    width: 100%;
    padding: 5px 10px;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: var(--rs);
    background: var(--input);
    outline: none;
    font-family: var(--font);
    color: var(--c1)
}

.ctx-ufilter input:focus {
    border-color: var(--teal)
}

.ctx-uitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: var(--c2);
    cursor: pointer;
    transition: var(--t)
}

.ctx-uitem:hover {
    background: var(--hover)
}

.ctx-uitem.selected {
    background: var(--teal-l);
    color: var(--teal-d);
    font-weight: 600
}

.ctx-uav {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0
}

.ctx-ucheck {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--t)
}

.ctx-uitem.selected .ctx-ucheck {
    border-color: var(--teal);
    background: var(--teal)
}

.ctx-uitem.selected .ctx-ucheck::after {
    content: '✓';
    color: #fff;
    font-size: 10px;
    font-weight: 700
}

.ctx-uall {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
    transition: var(--t)
}

.ctx-uall:hover {
    background: var(--hover)
}

.ctx-uall.all-sel {
    color: var(--teal)
}

.ctx-wide {
    min-width: 220px
}

/* User manage modal */
.um-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--rs);
    margin-bottom: 12px
}

.um-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-l);
    transition: var(--t)
}

.um-item:last-child {
    border-bottom: none
}

.um-item:hover {
    background: var(--hover)
}

.um-left {
    display: flex;
    align-items: center;
    gap: 8px
}

.um-av {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff
}

.um-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--c2)
}

.um-del {
    background: none;
    border: none;
    color: var(--c3);
    cursor: pointer;
    font-size: 16px;
    transition: var(--t);
    padding: 2px 6px;
    border-radius: var(--rs)
}

.um-del:hover {
    color: var(--coral);
    background: var(--coral-l)
}

.um-add {
    display: flex;
    gap: 6px
}

.um-empty {
    padding: 20px;
    text-align: center;
    color: var(--c3);
    font-size: 12px
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg,#1e2a4a 0%,#2c3e6b 40%,#3a5289 100%);
    overflow: hidden;
    position: relative
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle,rgba(14,165,160,.15),transparent 70%);
    top: -150px;
    right: -100px
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle,rgba(245,166,35,.1),transparent 70%);
    bottom: -100px;
    left: -50px
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    color: #fff;
    position: relative;
    z-index: 1
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px
}

.login-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg,var(--teal),var(--green));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(14,165,160,.35)
}

.login-logo-icon svg {
    width: 26px;
    height: 26px;
    color: #fff
}

.login-logo-text {
    font-family: var(--fd);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.5px
}

.login-hero {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -.5px
}

.login-hero em {
    font-style: normal;
    background: linear-gradient(135deg,var(--teal),#4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent
}

.login-sub {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,.6);
    margin-bottom: 40px;
    max-width: 440px
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 14px
}

.login-feat {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255,255,255,.7)
}

.login-feat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.login-feat-icon svg {
    width: 18px;
    height: 18px;
    color: var(--teal)
}

.login-right {
    width: 480px;
    min-width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25)
}

.login-card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--c1);
    margin-bottom: 4px;
    text-align: center
}

.login-card-desc {
    font-size: 13px;
    color: var(--c3);
    text-align: center;
    margin-bottom: 28px
}

.login-field {
    margin-bottom: 18px
}

.login-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--c2);
    margin-bottom: 6px
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--input);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--c1);
    font-family: var(--font);
    outline: none;
    transition: var(--t)
}

.login-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px var(--teal-l);
    background: var(--white)
}

.login-input::placeholder {
    color: var(--c3)
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px
}

.login-check {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    color: var(--c2)
}

.login-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t);
    flex-shrink: 0;
    background: var(--white)
}

.login-checkbox.checked {
    background: var(--teal);
    border-color: var(--teal)
}

.login-checkbox.checked::after {
    content: '✓';
    color: #fff;
    font-size: 11px;
    font-weight: 700
}

.login-forgot {
    font-size: 12px;
    color: var(--teal);
    cursor: pointer;
    font-weight: 500
}

.login-forgot:hover {
    text-decoration: underline
}

.login-btn {
    width: 100%;
    padding: 13px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg,var(--navy),var(--navy-l));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--t);
    font-family: var(--font);
    letter-spacing: .3px;
    box-shadow: 0 4px 12px rgba(44,62,107,.3)
}

.login-btn:hover {
    box-shadow: 0 6px 20px rgba(44,62,107,.4);
    transform: translateY(-1px)
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    font-size: 11px;
    color: var(--c3);
    font-weight: 500
}

.login-divider::before,.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border)
}

.social-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 24px
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    transition: var(--t);
    font-size: 12px;
    font-weight: 600;
    color: var(--c2);
    font-family: var(--font)
}

.social-btn:hover {
    border-color: var(--c3);
    background: var(--light)
}

.social-btn img,.social-btn svg {
    width: 18px;
    height: 18px
}

.social-google {
    color: #4285f4
}

.social-naver {
    color: #03c75a
}

.social-kakao {
    color: #fee500
}

.naver-icon {
    width: 18px;
    height: 18px;
    background: #03c75a;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    font-family: var(--fd)
}

.kakao-icon {
    width: 18px;
    height: 18px;
    background: #fee500;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center
}

.kakao-icon svg {
    width: 12px;
    height: 12px
}

.login-signup {
    text-align: center;
    font-size: 13px;
    color: var(--c3)
}

.login-signup a {
    color: var(--teal);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none
}

.login-signup a:hover {
    text-decoration: underline
}

/* Signup modal */
.signup-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden
}

.signup-tab {
    flex: 1;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c3);
    background: var(--light);
    border: none;
    cursor: pointer;
    transition: var(--t);
    text-align: center;
    font-family: var(--font)
}

.signup-tab.active {
    color: var(--white);
    background: var(--navy)
}

.signup-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0
}

.signup-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    transition: var(--t);
    font-size: 13px;
    font-weight: 600;
    color: var(--c2);
    font-family: var(--font)
}

.signup-social-btn:hover {
    border-color: var(--c3);
    background: var(--light)
}

.signup-social-btn.google:hover {
    border-color: #4285f4;
    background: rgba(66,133,244,.04)
}

.signup-social-btn.naver:hover {
    border-color: #03c75a;
    background: rgba(3,199,90,.04)
}

.signup-social-btn.kakao:hover {
    border-color: #f9e000;
    background: rgba(254,229,0,.08)
}

/* File Search Popup */
.fs-item{display:flex;align-items:center;gap:10px;padding:10px 16px;cursor:pointer;transition:background .12s}
.fs-item:hover{background:#f5f7fb}
.fs-icon{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:#f0f4ff;border-radius:8px;flex-shrink:0}
.fs-info{flex:1;min-width:0}
.fs-name{font-size:13px;font-weight:500;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fs-meta{font-size:11px;color:#999;margin-top:2px}
.fs-dl{width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#999;border-radius:6px;transition:all .12s;flex-shrink:0}
.fs-item:hover .fs-dl{color:var(--teal);background:var(--teal-l)}

/* Search expand + nav */
.srch{transition:width .25s ease,border-color .2s,background .2s,box-shadow .2s}
.srch input{transition:width .25s ease}
.srch:not(.expanded) input{width:80px}
.srch.expanded input{width:180px}
.srch-nav{display:flex;align-items:center;gap:2px;margin-left:4px;flex-shrink:0}
.srch-cnt{font-size:11px;color:#999;white-space:nowrap;min-width:30px;text-align:center}
.srch-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;color:#666;border-radius:4px;transition:all .12s;padding:0}
.srch-btn:hover:not(:disabled){background:#e5e7eb;color:#333}
.srch-btn:disabled{color:#ccc;cursor:not-allowed}

/* Subchannel user select */
.sub-ulist{max-height:200px;overflow-y:auto;border:1px solid #e5e7eb;border-radius:8px;background:#fafafa}
.sub-uall,.sub-uitem{display:flex;align-items:center;gap:8px;padding:8px 12px;cursor:pointer;transition:background .1s;font-size:13px}
.sub-uall:hover,.sub-uitem:hover{background:#f0f4ff}
.sub-uall{border-bottom:1px solid #eee;font-weight:600;font-size:12px;color:#555}
.sub-uchk{width:18px;height:18px;border:2px solid #ccc;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all .12s;flex-shrink:0;font-size:11px;color:#fff}
.sub-uchk.on{background:var(--teal);border-color:var(--teal)}
.sub-uav{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;font-weight:600;flex-shrink:0}
.sub-uname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sub-uempty{text-align:center;padding:20px;color:#aaa;font-size:12px}
.sub-usel{margin-top:6px;font-size:12px;color:var(--teal);font-weight:500}

/* Message search highlight */
.msg-hl{background:#ffeb3b;padding:1px 0;border-radius:2px}
.msg-hl-cur{background:#ff9800;color:#fff;padding:1px 2px;border-radius:2px}

/* Custom Message Box */
.msgbox-bg{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.45);z-index:11000;display:flex;align-items:center;justify-content:center;animation:fadeIn .15s}
.msgbox{background:#fff;border-radius:12px;width:380px;max-width:90vw;box-shadow:0 8px 32px rgba(0,0,0,.2);overflow:hidden;animation:slideUp .2s}
.msgbox-hd{display:flex;align-items:center;justify-content:space-between;padding:14px 18px 10px;border-bottom:1px solid #f0f0f0}
.msgbox-title{font-size:15px;font-weight:600;color:#333}
.msgbox-bd{padding:20px 18px;text-align:center}
.msgbox-icon{margin-bottom:12px}
.msgbox-msg{font-size:14px;color:#555;line-height:1.6;white-space:pre-line}
.msgbox-input-wrap{margin-top:14px}
.msgbox-input{width:100%;padding:10px 12px;border:1.5px solid #ddd;border-radius:8px;font-size:14px;outline:none;transition:border .2s}
.msgbox-input:focus{border-color:var(--teal)}
.msgbox-ft{display:flex;justify-content:flex-end;gap:8px;padding:12px 18px 16px;border-top:1px solid #f0f0f0}
.msgbox-ft .btn{min-width:72px;padding:9px 18px;font-size:13px;font-weight:600;border-radius:8px;cursor:pointer;border:none;transition:all .15s}
.msgbox-ft .btn.bcc{background:#f3f4f6;color:#555}
.msgbox-ft .btn.bcc:hover{background:#e5e7eb}
.msgbox-ft .btn.bok{background:var(--teal);color:#fff}
.msgbox-ft .btn.bok:hover{background:var(--teal-d)}
.msgbox-ft .btn-danger{background:#ef4444!important;color:#fff!important}
.msgbox-ft .btn-danger:hover{background:#dc2626!important}
@keyframes slideUp{from{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

/* Channel drag-to-reorder */
.ci[draggable="true"]{cursor:grab}
.ci[draggable="true"]:active{cursor:grabbing}
.ci.dragging{opacity:.4;background:var(--teal-l)}
.ci.drag-over{border-top:2px solid var(--teal);padding-top:0;margin-top:-2px}

/* ===== CHAT MESSAGE ===== */
.message{display:flex;align-items:flex-start;gap:8px;padding:4px 12px;max-width:100%;position:relative}
.message .header{font-size:10px;color:var(--c3);font-family:var(--fm);white-space:nowrap;margin-top:4px;min-width:36px}
/* vue3 렌더러(chat-render.ts)의 시간 표기 — .header 와 동일 톤(작게) */
.message .msg-time{font-size:10px;color:var(--c3);font-family:var(--fm);white-space:nowrap;flex-shrink:0;margin-bottom:2px}
/* 말풍선+시간 행 — 시간이 말풍선 바로 옆(중앙 쪽)에 붙음 */
.msg-row{display:flex;align-items:flex-end;gap:6px;max-width:100%}
.message.sent .msg-row{flex-direction:row-reverse}
.msg-row .message-bubble{margin-left:0!important;margin-right:0!important}

/* 받은 메시지 - 왼쪽 */
.message.received{flex-direction:row;justify-content:flex-start}
.message.received .message-bubble{background:#f0f2f6;border-radius:4px 12px 12px 12px;margin-right:auto;max-width:70%}
.message.received .message-bubble_content{color:var(--c1)}

/* 보낸 메시지 - 오른쪽 */
.message.sent{flex-direction:row-reverse;justify-content:flex-start}
.message.sent .message-bubble{background:#dbeafe;border-radius:12px 4px 12px 12px;margin-left:auto;max-width:70%}
.message.sent .message-bubble_content{color:var(--c1)}
.message.sent .header{text-align:right}

/* 말풍선 공통 */
/* flex 아이템 기본 min-width:auto 때문에 넓은 코드블록/표가 컬럼을 화면 밖으로 밀어내는 것 방지 */
.message-col{min-width:0;max-width:100%;flex:1}
.message-bubble{padding:8px 12px;position:relative;box-shadow:0 1px 3px rgba(0,0,0,.06);word-break:break-word;line-height:1.6;font-size:13px;min-width:140px}
.message-bubble_content{white-space:pre-wrap;overflow-wrap:anywhere}.message-bubble_content pre{max-width:100%;overflow-x:auto}
.message-bubble_content img.sys_img_preview{max-width:260px;max-height:200px;border-radius:6px;cursor:pointer;margin:4px 0}

/* 메시지 호버 메뉴 */
.msg-hover-menu{display:none;position:absolute;top:auto;bottom:calc(100% - 1px);right:8px;background:var(--white);border:1px solid var(--border);border-radius:6px;padding:2px 3px;box-shadow:0 3px 12px rgba(0,0,0,.12);z-index:10;gap:1px;align-items:center}
.message:hover .msg-hover-menu{display:flex}
.message.sent .msg-hover-menu{right:auto;left:8px}
.msg-menu-btn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;cursor:pointer;border-radius:5px;color:var(--c3);transition:all .15s ease;position:relative}
.msg-menu-btn:hover{background:var(--teal-l);color:var(--teal)}
.msg-menu-btn:active{transform:scale(.9)}
.msg-menu-btn svg{pointer-events:none}
/* 호버 툴팁 */
.msg-menu-btn::after{content:attr(title);position:absolute;bottom:-22px;left:50%;transform:translateX(-50%);background:rgba(0,0,0,.75);color:#fff;font-size:10px;padding:2px 6px;border-radius:3px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s}
.msg-menu-btn:hover::after{opacity:1}

/* 아바타 */
.message .user-item{position:relative;display:flex;align-items:flex-start;gap:8px;flex-shrink:0}
.message .user-avatar{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex-shrink:0;box-shadow:0 2px 6px rgba(0,0,0,.1);cursor:pointer}
.message .user-name{font-size:12px;font-weight:600;color:var(--c1);margin-bottom:1px}
.message .user-alias{font-size:10px;color:var(--c3)}
.message.sent .user-item{display:none}

/* 사용자 호버 팝업 */
.message .user-item .user-popup{display:none;position:absolute;top:36px;left:0;background:#fff;border:1px solid #e0e0e0;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,.12);padding:4px;z-index:50;min-width:90px}
.message .user-item:hover .user-popup{display:flex}
.message .user-item .popup-actions{display:flex;flex-direction:column;gap:2px;width:100%}
.message .user-item .popup-btn{display:flex;align-items:center;gap:6px;padding:5px 8px;font-size:11px;color:#333;cursor:pointer;border-radius:4px;white-space:nowrap;user-select:none}
.message .user-item .popup-btn:hover{background:#f0f4ff;color:#1a73e8}
.message .user-item .popup-btn span:first-child{font-size:13px}

/* 날짜 구분선 */
.date-divider{display:flex;align-items:center;justify-content:center;padding:12px 0 6px;position:relative}
.date-divider::before,.date-divider::after{content:'';flex:1;height:1px;background:var(--border-l)}
.date-label{padding:4px 14px;font-size:11px;font-weight:600;color:var(--c3);background:var(--light);border-radius:12px;cursor:pointer;white-space:nowrap;margin:0 10px;border:1px solid var(--border-l);transition:var(--t)}
.date-label:hover{background:var(--hover);color:var(--c2)}
.date-group{display:flex;flex-direction:column;gap:2px}
.date-group.collapsed{display:none}

/* AI typing indicator */
.typing-indicator{padding:12px;text-align:left}
.typing-indicator span{display:inline-block;width:8px;height:8px;border-radius:50%;background:#999;margin-right:4px;animation:typingDot 1.4s infinite}
.typing-indicator span:nth-child(2){animation-delay:.2s}
.typing-indicator span:nth-child(3){animation-delay:.4s}
@keyframes typingDot{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-10px);opacity:1}}

/* 시스템 메시지 */
.message .content{font-size:12px;color:var(--c3);text-align:center;padding:6px 12px;font-style:italic}

/* ===== MEMO POPUP ===== */
.memo-popup-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.4);z-index:10000;display:flex;align-items:center;justify-content:center}
.memo-popup{width:700px;max-width:90vw;height:500px;max-height:80vh;background:var(--white);border-radius:var(--rl);box-shadow:0 8px 32px rgba(0,0,0,.2);display:flex;flex-direction:column;overflow:hidden}
.memo-popup-header{display:flex;align-items:center;justify-content:space-between;padding:12px 18px;border-bottom:1px solid var(--border);background:var(--light)}
.memo-popup-title{font-size:15px;font-weight:700;color:var(--c1)}
.memo-popup-close{background:none;border:none;font-size:22px;color:var(--c3);cursor:pointer;padding:0 4px;line-height:1}
.memo-popup-close:hover{color:var(--coral)}
.memo-popup-body{display:flex;flex:1;overflow:hidden}
.memo-list-panel{width:200px;border-right:1px solid var(--border);display:flex;flex-direction:column;background:var(--light)}
.memo-add-btn{padding:10px 14px;font-size:13px;font-weight:600;color:var(--teal);background:none;border:none;border-bottom:1px solid var(--border);cursor:pointer;text-align:left;transition:var(--t)}
.memo-add-btn:hover{background:var(--teal-l)}
#memoListContainer{flex:1;overflow-y:auto}
.memo-list-item{padding:10px 14px;cursor:pointer;border-bottom:1px solid var(--border-l);transition:var(--t)}
.memo-list-item:hover{background:var(--hover)}
.memo-list-item.active{background:var(--teal-l);border-left:3px solid var(--teal)}
.memo-list-item-title{font-size:12px;font-weight:600;color:var(--c1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.memo-edit-panel{flex:1;display:flex;flex-direction:column;padding:14px 18px;gap:10px;min-height:0}
.memo-form-group{display:flex;flex-direction:column;gap:4px;min-height:0}
.memo-form-group label{font-size:11px;font-weight:600;color:var(--c3);text-transform:uppercase;letter-spacing:.5px}
.memo-input{padding:7px 10px;border:1px solid var(--border);border-radius:var(--rs);font-size:13px;color:var(--c1);outline:none;transition:var(--t)}
.memo-input:focus{border-color:var(--teal);box-shadow:0 0 0 3px var(--teal-l)}
.memo-editor{flex:1;padding:10px 12px;border:1px solid var(--border);border-radius:var(--rs);font-size:13px;color:var(--c1);line-height:1.6;overflow-y:auto;outline:none;min-height:120px;word-break:break-word}
.memo-editor:focus{border-color:var(--teal);box-shadow:0 0 0 3px var(--teal-l)}
.memo-editor:empty::before{content:attr(data-placeholder);color:var(--c3)}
.memo-btn-group{display:flex;gap:8px;justify-content:flex-end}

/* DM 배지 (상단) */
.dm-badge-btn{position:relative;display:flex;align-items:center;justify-content:center;width:36px;height:36px;background:rgba(255,255,255,.1);border:none;border-radius:50%;cursor:pointer;color:rgba(255,255,255,.7);transition:var(--t)}
.dm-badge-btn:hover{background:rgba(255,255,255,.2);color:#fff}
.dm-badge-cnt{position:absolute;top:-2px;right:-2px;background:var(--coral);color:#fff;font-size:10px;font-weight:700;min-width:16px;height:16px;border-radius:8px;display:flex;align-items:center;justify-content:center;padding:0 4px;line-height:1}
.dm-unread{background:var(--teal-l);border-left:3px solid var(--teal)}

/* ===== AI PANEL ===== */
.ai-info-card{background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);border-radius:var(--r);padding:14px;color:#fff;margin-bottom:12px}
.ai-info-title{font-size:14px;font-weight:700;margin-bottom:4px}
.ai-info-desc{font-size:11px;opacity:.85;line-height:1.5}
.ai-info-desc b{color:#ffeb3b}
.ai-section{margin-bottom:14px}
.ai-section-title{font-size:11px;font-weight:600;color:var(--c3);text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px}
.ai-quick-btn{padding:7px 10px;font-size:12px;color:var(--c2);background:var(--light);border:1px solid var(--border-l);border-radius:var(--rs);cursor:pointer;margin-bottom:4px;transition:var(--t)}
.ai-quick-btn:hover{border-color:var(--teal);color:var(--teal);background:var(--teal-l)}
.ai-quick-btn.ai-quick-sel{border-color:var(--teal);color:var(--teal);background:var(--teal-l);font-weight:600}
.ai-hist-empty{font-size:11px;color:var(--c3);padding:8px 0}
.ai-hist-item{padding:6px 8px;border-bottom:1px solid var(--border-l);cursor:pointer;transition:var(--t)}
.ai-hist-item:hover{background:var(--hover)}
.ai-hist-q{font-size:12px;color:var(--c1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-hist-t{font-size:10px;color:var(--c3);margin-top:2px}

/* AI 토글 */
.ai-toggle{position:relative;width:36px;height:20px;display:inline-block}
.ai-toggle input{opacity:0;width:0;height:0}
.ai-toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:var(--border);border-radius:10px;transition:.2s}
.ai-toggle-slider::before{content:'';position:absolute;height:16px;width:16px;left:2px;bottom:2px;background:#fff;border-radius:50%;transition:.2s}
.ai-toggle input:checked+.ai-toggle-slider{background:var(--teal)}
.ai-toggle input:checked+.ai-toggle-slider::before{transform:translateX(16px)}

/* AI 요청 목록 */
.ai-req-add{background:none;border:none;color:var(--teal);font-size:11px;font-weight:600;cursor:pointer;padding:2px 6px;border-radius:var(--rs);transition:var(--t)}
.ai-req-add:hover{background:var(--teal-l)}
.ai-req-item{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;font-size:12px;color:var(--c2);cursor:pointer;border-radius:var(--rs);margin-bottom:2px;transition:var(--t);border:1px solid transparent}
.ai-req-item:hover{background:var(--hover)}
.ai-req-item.sel{background:var(--teal-l);border-color:var(--teal);color:var(--teal);font-weight:600}
.ai-req-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-req-actions{display:flex;gap:2px;flex-shrink:0;opacity:0;transition:var(--t)}
.ai-req-item:hover .ai-req-actions{opacity:1}
.ai-req-actions span{cursor:pointer;font-size:12px;padding:1px 3px;border-radius:3px}
.ai-req-actions span:hover{background:var(--hover)}

/* AI 요청 팝업 (중앙) */
.ai-req-popup{width:600px;max-width:90vw;height:480px;max-height:80vh;background:var(--white);border-radius:var(--rl);box-shadow:0 8px 32px rgba(0,0,0,.2);display:flex;flex-direction:column;overflow:hidden}
.ai-req-popup-body{flex:1;display:flex;flex-direction:column;padding:18px 24px;gap:14px;overflow:hidden}

/* 채널 옵션 설정 팝업 */
.msgopt-popup{position:fixed;background:var(--white);border:1px solid var(--border);border-radius:var(--rs);padding:8px;box-shadow:0 4px 12px rgba(0,0,0,.15);z-index:200;min-width:140px}
.msgopt-title{font-size:11px;font-weight:600;color:var(--c3);margin-bottom:6px;text-transform:uppercase;letter-spacing:.5px}
.msgopt-row{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--c2);padding:5px 4px;border-radius:4px;cursor:pointer;transition:var(--t)}
.msgopt-row:hover{background:var(--hover)}
.msgopt-row input[type=checkbox]{margin:0;accent-color:var(--teal)}

/* ===== STOCK PANEL ===== */
.stock-summary{display:flex;flex-direction:column;gap:4px;padding:8px 10px;background:var(--light);border-radius:var(--rs);margin-bottom:8px;border:1px solid var(--border-l)}
.stock-stat{display:flex;justify-content:space-between;align-items:center;font-size:12px}
.stock-stat-label{color:var(--c3)}
.stock-stat-val{font-weight:600;color:var(--c1)}
.stock-up{color:#22c55e!important}
.stock-down{color:#ef4444!important}
.stock-filter{margin-bottom:8px}
.stock-empty{font-size:11px;color:var(--c3);text-align:center;padding:20px 0}
.stock-card{border:1px solid var(--border-l);border-radius:var(--rs);margin-bottom:6px;cursor:pointer;transition:var(--t);overflow:hidden}
.stock-card:hover{border-color:var(--border);box-shadow:0 1px 4px rgba(0,0,0,.06)}
.stock-card-head{display:flex;justify-content:space-between;align-items:center;padding:8px 10px}
.stock-card-name{font-size:12px;font-weight:600;color:var(--c1)}
.stock-card-code{font-size:10px;color:var(--c3)}
.stock-card-price{font-size:12px;font-weight:600}
.stock-card-change{font-size:10px}
.stock-card-body{padding:6px 10px 10px;border-top:1px solid var(--border-l);background:var(--light)}
.stock-card-row{display:flex;justify-content:space-between;font-size:11px;color:var(--c2);padding:2px 0}
.stock-card-btns{display:flex;gap:6px;margin-top:6px;justify-content:flex-end}

/* ========== CHATBOT (Claude Code) ========== */
.cb-area{flex:1;display:flex;flex-direction:row;background:var(--bg);overflow:hidden;min-height:0}
.cb-proj-panel{width:260px;flex-shrink:0;background:#fafbfd;border-right:1px solid var(--border-l);display:flex;flex-direction:column;overflow:hidden}
.cb-panel-head{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--border-l);background:#fff}
.cb-panel-title{font-size:13px;font-weight:600;color:var(--c1)}
.cb-btn-add{width:24px;height:24px;border:none;border-radius:4px;background:#0ea5a0;color:#fff;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.cb-btn-add:hover{background:#089a92}
.cb-proj-list{flex:1;overflow-y:auto;padding:6px}
.cb-proj-item{padding:8px 10px;border-radius:6px;cursor:pointer;margin-bottom:3px;border:1px solid transparent;transition:all .12s}
.cb-proj-item:hover{background:#eef3f9}
.cb-proj-item.cb-sel{background:#e6f4f3;border-color:#0ea5a0}
.cb-proj-name{font-size:12px;font-weight:600;color:var(--c1);display:flex;align-items:center;gap:6px;margin-bottom:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cb-proj-info{display:flex;gap:6px;font-size:10px;color:var(--c2)}
.cb-mode-badge{background:#dbeafe;color:#1e40af;padding:1px 5px;border-radius:3px;font-weight:600}
.cb-status-dot{width:8px;height:8px;border-radius:50%;background:#9ca3af;flex-shrink:0;display:inline-block}
.cb-status-dot.running{background:#3b82f6;box-shadow:0 0 6px #3b82f6;animation:cb-pulse 1.2s infinite}
.cb-status-dot.done{background:#10b981}
.cb-status-dot.error{background:#ef4444}
.cb-status-dot.idle{background:#9ca3af}
.cb-status-dot.paused{background:#f59e0b}
@keyframes cb-pulse{0%,100%{opacity:1}50%{opacity:.4}}
.cb-empty{padding:30px 16px;text-align:center;color:var(--c2);font-size:11px;line-height:1.6}

.cb-chat-panel{flex:1;display:flex;flex-direction:column;overflow:hidden;background:#fff;min-width:0;min-height:0}
.cb-chat-head{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border-l);background:#fafbfd}
.cb-chat-title{font-size:13px;font-weight:700;color:var(--c1)}
.cb-chat-path{font-size:11px;color:var(--c2);margin-left:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:50%;font-family:monospace}
.cb-chat-body{flex:1;min-height:0;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.cb-msg{display:flex;flex-direction:column;max-width:90%}
.cb-msg-user{align-self:flex-end;align-items:flex-end}
.cb-msg-bot{align-self:flex-start;align-items:flex-start}
.cb-bubble{padding:8px 12px;border-radius:12px;font-size:13px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.cb-bubble-user{background:#0ea5a0;color:#fff;border-bottom-right-radius:4px}
.cb-bubble-bot{background:#f1f4f8;color:#1f2937;border-bottom-left-radius:4px;border:1px solid #e5e7eb}
.cb-bubble.cb-running{}  /* DONE 과 동일한 회색 유지 — 진행중 색 구분 안 함 */
.cb-bubble.cb-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.cb-anim-dots{font-size:14px;font-weight:700;color:#0ea5a0;line-height:1;margin-top:6px;letter-spacing:2px;height:1em}
.cb-anim-dots::after{content:'.';animation:cb-dots-blink 1.5s infinite}
@keyframes cb-dots-blink{
   0%,33%{content:'.'}
   34%,66%{content:'..'}
   67%,100%{content:'...'}
}
.cb-result{font-family:'Consolas','Monaco',monospace;font-size:12px;white-space:pre-wrap;word-break:break-word}
.cb-err{color:#991b1b;font-size:12px}
.cb-time{font-size:10px;color:var(--c2);margin-top:3px;padding:0 4px}
.cb-tag{display:inline-block;padding:1px 5px;border-radius:3px;font-size:9px;font-weight:600;background:#e5e7eb;color:#374151;margin-right:4px}
.cb-tag.running{background:#dbeafe;color:#1e40af}
.cb-tag.done{background:#d1fae5;color:#065f46}
.cb-tag.error{background:#fee2e2;color:#991b1b}
.cb-tag.pending{background:#fef3c7;color:#92400e}
.cb-tag.waiting{background:#e0e7ff;color:#3730a3}
.cb-typing{display:flex;gap:4px;padding:4px 0}
.cb-typing span{width:7px;height:7px;border-radius:50%;background:#9ca3af;animation:cb-bounce 1.2s infinite}
.cb-typing span:nth-child(2){animation-delay:.2s}
.cb-typing span:nth-child(3){animation-delay:.4s}
@keyframes cb-bounce{0%,80%,100%{transform:translateY(0);opacity:.4}40%{transform:translateY(-6px);opacity:1}}

.cb-input-area{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--border-l);background:#fafbfd}
.cb-input{flex:1;min-height:40px;max-height:200px;padding:8px 10px;border:1px solid var(--border-l);border-radius:8px;font-size:13px;font-family:inherit;resize:none;outline:none;background:#fff;overflow-y:auto}
.cb-input:focus{border-color:#0ea5a0}
.cb-send{width:40px;height:40px;border:none;border-radius:8px;background:#0ea5a0;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;align-self:flex-end}
.cb-send:hover{background:#089a92}
.cb-send:disabled{background:#cbd5e1;cursor:not-allowed}
.ci.ci-cb .chn svg{color:#0ea5a0}
.ci.ci-cb.active .chn svg{color:rgba(255,255,255,.7)}
.cb-cursor{display:inline-block;width:2px;height:1em;background:#0ea5a0;margin-left:2px;vertical-align:text-bottom;animation:cb-blink 1s steps(2,start) infinite}
@keyframes cb-blink{to{visibility:hidden}}
.cb-btn-icon{width:24px;height:24px;border:none;border-radius:4px;background:transparent;color:var(--c2);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;line-height:1}
.cb-btn-icon:hover{background:#eef3f9;color:#1a73e8}
.cb-filter-row{display:flex;gap:4px;padding:6px 8px;border-bottom:1px solid var(--border-l);background:#fff}
.cb-filter-input{flex:1;padding:5px 8px;font-size:11px;border:1px solid var(--border-l);border-radius:4px;outline:none;background:#fff}
.cb-filter-input:focus{border-color:#0ea5a0}

/* 챗봇 프로젝트 패널 - 범위 선택 메뉴 */
.cb-menu-wrap{position:relative;display:inline-block}
.cb-menu{position:absolute;top:100%;right:0;margin-top:2px;min-width:90px;background:#fff;border:1px solid var(--border-l);border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.12);z-index:50}
.cb-menu>.cb-menu-item:first-child{border-top-left-radius:6px;border-top-right-radius:6px}
.cb-menu>.cb-menu-item:last-child{border-bottom-left-radius:6px;border-bottom-right-radius:6px}
.cb-menu-item{padding:7px 12px;font-size:12px;cursor:pointer;color:var(--c1);white-space:nowrap}
.cb-menu-item:hover{background:#eef3f9;color:#1a73e8}
.cb-menu-item.cb-menu-sel{background:#e8f0fe;color:#1a73e8;font-weight:600}

/* 챗봇 입력란 - 첨부 미리보기 (cb-input-area 를 세로 컬럼으로 override) */
.cb-input-area{flex-direction:column;align-items:stretch}
.cb-input-row{display:flex;gap:8px;align-items:flex-end;width:100%}
.cb-input-row .cb-input{flex:1}
.cb-attach-row{display:flex;flex-wrap:wrap;gap:6px;padding:0 0 8px;border-bottom:1px dashed var(--border-l);margin-bottom:6px}
.cb-attach-item{position:relative;width:64px;height:64px;border:1px solid var(--border-l);border-radius:6px;overflow:hidden;background:#f5f7fa;flex:0 0 auto}
.cb-attach-thumb{width:100%;height:100%;object-fit:cover;display:block}
.cb-attach-x{position:absolute;top:2px;right:2px;width:18px;height:18px;border:none;border-radius:50%;background:rgba(0,0,0,0.55);color:#fff;font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.cb-attach-x:hover{background:rgba(220,38,38,0.85)}

/* 챗봇 질문 풍선 - 첨부 썸네일 + 라이트박스 */
.cb-prompt-txt{white-space:pre-wrap;word-break:break-word}
.cb-att-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.cb-att-thumb-wrap{cursor:zoom-in;border-radius:6px;overflow:hidden;background:#f5f7fa;border:1px solid var(--border-l);transition:transform .12s,filter .12s}
.cb-att-thumb-wrap:hover{transform:scale(1.04);filter:brightness(0.95)}
.cb-att-thumb{display:block;width:140px;max-height:100px;object-fit:cover}
.cb-att-loading{width:140px;height:80px;display:flex;align-items:center;justify-content:center;color:#94a3b8;font-size:18px}
.cb-lightbox{position:fixed;inset:0;background:rgba(0,0,0,0.85);z-index:9999;display:flex;align-items:center;justify-content:center;cursor:zoom-out;animation:cb-lb-fade .12s ease-out}
@keyframes cb-lb-fade{from{opacity:0}to{opacity:1}}
.cb-lightbox-img{max-width:95vw;max-height:95vh;object-fit:contain;cursor:default;box-shadow:0 8px 32px rgba(0,0,0,0.5);background:#fff}
.cb-lightbox-close{position:fixed;top:16px;right:20px;width:38px;height:38px;border:none;border-radius:50%;background:rgba(255,255,255,0.18);color:#fff;font-size:24px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.cb-lightbox-close:hover{background:rgba(255,255,255,0.32)}

/* 챗봇 프로젝트 목록 - 모델 표시 (1=Opus, 2=Sonnet, 3=Haiku) — 날짜와 동일 스타일 */
.cb-proj-info{display:flex;align-items:center;gap:0}
.cb-mb{font:inherit;font-size:inherit;font-weight:inherit;color:inherit;background:transparent;border:none;margin-left:0.5em;padding:0;line-height:inherit}

/* 챗봇 프로젝트 - 즐겨찾기 버튼 */
.cb-proj-name{justify-content:space-between}
.cb-proj-name-txt{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.cb-fav-btn{flex:0 0 auto;width:20px;height:20px;border:none;background:transparent;color:#cbd5e1;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;border-radius:4px;line-height:1;visibility:hidden;opacity:0;transition:opacity .12s}
.cb-fav-btn:hover{background:#eef3f9;color:#f59e0b}
.cb-proj-item:hover .cb-fav-btn{visibility:visible;opacity:1}
.cb-fav-btn.cb-fav-on{visibility:visible;opacity:1;color:#f59e0b}
.cb-fav-btn.cb-fav-on svg{fill:#f59e0b}

/* ============================================================
   CHATAI (Multi-LLM) — 챗봇AI 채널 패널
   ============================================================ */
.cai-area{flex:1;display:flex;flex-direction:column;background:#fff;min-width:0;overflow:hidden}
.cai-head{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--border-l);background:#fafbfd}
.cai-title{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}
.cai-ch-name{font-size:13px;font-weight:600;color:var(--c1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cai-mode-tabs{display:flex;gap:0;border:1px solid var(--border-l);border-radius:6px;overflow:hidden}
.cai-mode-tabs button{border:none;background:#fff;color:var(--c2);padding:5px 10px;font-size:11px;cursor:pointer;border-right:1px solid var(--border-l)}
.cai-mode-tabs button:last-child{border-right:none}
.cai-mode-tabs button:hover{background:#eef3f9}
.cai-mode-tabs button.cai-mode-on{background:#1a73e8;color:#fff}
.cai-actions{display:flex;gap:4px}
.cai-btn-icon{width:28px;height:28px;border:1px solid var(--border-l);background:#fff;border-radius:6px;color:var(--c2);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.cai-btn-icon:hover{background:#eef3f9;color:#1a73e8}

.cai-model-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:10px;font-size:10px;font-weight:600;color:#fff}
.cai-mb-claude{background:#c97b48}
.cai-mb-chatgpt{background:#10a37f}
.cai-mb-gemini{background:#4285f4}

.cai-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:8px;background:#fff}

.cai-input-area{border-top:1px solid var(--border-l);background:#fafbfd;padding:10px 12px;display:flex;flex-direction:column;align-items:stretch;gap:6px}
.cai-input-row{display:flex;gap:8px;align-items:flex-end;width:100%}
.cai-input{flex:1;min-height:40px;max-height:200px;padding:8px 10px;border:1px solid var(--border-l);border-radius:8px;font-size:13px;font-family:inherit;resize:none;outline:none;background:#fff;overflow-y:auto}
.cai-input:focus{border-color:#1a73e8}

.cai-settings-wrap{position:relative;display:inline-block}
.cai-settings-mask{position:fixed;inset:0;z-index:9998;background:transparent}
.cai-settings-sheet{position:fixed;z-index:9999;min-width:300px;max-width:380px;background:#fff;border:1px solid var(--border-l);border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:10px;animation:cai-sheet-in .15s ease-out;box-shadow:0 8px 28px rgba(0,0,0,0.18)}
.cai-prov-btn{padding:4px 10px;border:1px solid var(--border-l);background:#fff;color:var(--c2);border-radius:6px;font-size:11px;cursor:pointer}
.cai-prov-btn:hover{background:#eef3f9}
.cai-prov-btn.cai-prov-on{background:#1a73e8;color:#fff;border-color:#1a73e8}
@keyframes cai-sheet-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.cai-set-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cai-set-label{font-size:11px;color:var(--c2);font-weight:600}
.cai-set-input{width:60px;padding:3px 6px;border:1px solid var(--border-l);border-radius:4px;font-size:11px;outline:none}
.cai-set-input:focus{border-color:#1a73e8}
.cai-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;background:#fff;border:1px solid var(--border-l);border-radius:12px;font-size:11px;cursor:pointer;color:var(--c1)}
.cai-chip input[type="checkbox"]{margin:0}
.cai-chip:has(input:checked){background:#e8f0fe;border-color:#1a73e8;color:#1a73e8}

.cai-tag{display:inline-block;padding:1px 6px;background:#eef3f9;border-radius:8px;font-size:10px;color:var(--c2);margin-right:4px}

/* compare 그리드 */
.cai-compare-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%}
.cai-compare-col{display:flex;flex-direction:column;gap:4px;min-width:0}
.cai-compare-head{display:flex;align-items:center}

/* chatai 사이드바 아이콘 색 (AI/Stock 패턴 따름) */
.ci.ci-cai .chn svg{color:#7c3aed}
.ci.ci-cai.active .chn svg{color:rgba(255,255,255,.85)}

/* 챗봇 vanilla JS 렌더 - 결과 안의 Markdown 출력 스타일 */
.cb-task-wrap{display:block}
.cb-result{font-size:13px;line-height:1.55;color:var(--c1);word-break:break-word;overflow-wrap:break-word}
.cb-result p{margin:0 0 8px 0}
.cb-result p:last-child{margin-bottom:0}
.cb-result h1,.cb-result h2,.cb-result h3,.cb-result h4{margin:10px 0 6px;font-weight:700;line-height:1.3}
.cb-result h1{font-size:18px}
.cb-result h2{font-size:16px}
.cb-result h3{font-size:14px}
.cb-result h4{font-size:13px}
.cb-result ul,.cb-result ol{margin:4px 0 8px;padding-left:22px}
.cb-result li{margin:2px 0}
.cb-result code{background:#f3f4f6;padding:1px 5px;border-radius:3px;font-family:'Consolas','Monaco','Courier New',monospace;font-size:12px;color:#c7254e}
.cb-result pre{background:#1e293b;color:#e2e8f0;padding:10px 12px;border-radius:6px;overflow-x:auto;margin:6px 0;font-family:'Consolas','Monaco','Courier New',monospace;font-size:12px;line-height:1.5}
.cb-result pre code{background:transparent;color:inherit;padding:0;border-radius:0;font-size:inherit}
.cb-result blockquote{border-left:3px solid #cbd5e1;margin:6px 0;padding:2px 0 2px 10px;color:var(--c2)}
.cb-result a{color:#1a73e8;text-decoration:none}
.cb-result a:hover{text-decoration:underline}
.cb-result table{border-collapse:collapse;margin:6px 0;font-size:12px;display:block;max-width:100%;overflow-x:auto}
.cb-result th,.cb-result td{border:1px solid var(--border-l);padding:4px 8px}
.cb-result th{background:#f8fafc;font-weight:600}
.cb-result img{max-width:100%;height:auto;border-radius:4px}
.cb-result hr{border:none;border-top:1px solid var(--border-l);margin:10px 0}

/* 챗봇 프로젝트 메뉴 - 그룹 서브메뉴 */
.cb-menu-item.cb-menu-has-sub{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px}
.cb-menu-caret{color:#94a3b8;font-size:14px;line-height:1}
.cb-submenu{position:absolute;left:100%;top:-1px;min-width:140px;background:#fff;border:1px solid var(--border-l);border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.12);z-index:60;overflow:hidden;display:none;padding:2px 0}
.cb-menu-item.cb-menu-has-sub:hover .cb-submenu{display:block}
.cb-submenu .cb-menu-item{padding:6px 12px;font-size:12px;white-space:nowrap}
.cb-submenu-empty{padding:6px 12px;font-size:11px;color:#94a3b8;font-style:italic}

/* 챗봇 프로젝트 - 편집 버튼 (hover 시 노출, 공간은 항상 차지) */
.cb-edit-btn{flex:0 0 auto;width:20px;height:20px;border:none;background:transparent;color:#cbd5e1;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;border-radius:4px;line-height:1;visibility:hidden;opacity:0;transition:opacity .12s;margin-right:2px}
.cb-edit-btn:hover{background:#eef3f9;color:#1a73e8}
.cb-proj-item:hover .cb-edit-btn{visibility:visible;opacity:1}

/* 상담채널 사이드바 아이콘 색 */
.ci.ci-cs .chn svg{color:#9333ea}
.ci.ci-cs.active .chn svg{color:rgba(255,255,255,.85)}

/* 상담채널 사이드바 아이콘 색 */
.ci.ci-cs .chn svg{color:#9333ea}
.ci.ci-cs.active .chn svg{color:rgba(255,255,255,.85)}

/* ============================================
   채팅 파일/폴더 카드 — 좁을 때 파일명 한 줄 + … 처리
   (이미 전송된 메시지의 카드는 inline style 로 저장되어 있어 !important 로 오버라이드)
   ============================================ */
.ds-msg-card{max-width:100%!important;box-sizing:border-box!important;overflow:hidden!important;}
.ds-msg-card>span:nth-child(2){flex:1 1 auto!important;min-width:40px!important;overflow:hidden!important;}
.ds-msg-card>span:nth-child(2)>span{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}

/* ============================================
   채팅 헤더 우측 필터 (드롭다운 + 칩)
   ============================================ */
.chat-filter-wrap{display:inline-flex;align-items:center;gap:6px;margin-right:8px;flex-shrink:0;}
.chat-filter-chips{display:inline-flex;align-items:center;gap:4px;}
.chat-filter-chip{white-space:nowrap;}
.chat-filter-chip{
  display:inline-flex;align-items:center;gap:4px;
  padding:3px 4px 3px 8px;background:#f1f5f9;border:1px solid #e2e8f0;
  border-radius:12px;font-size:11px;color:#64748b;opacity:.75;
  transition:opacity .12s;
}
.chat-filter-chip:hover{opacity:1;}
.chat-filter-chip-x{
  display:inline-flex;align-items:center;justify-content:center;
  width:16px;height:16px;border:none;background:none;color:#94a3b8;
  cursor:pointer;border-radius:50%;font-size:11px;line-height:1;padding:0;
}
.chat-filter-chip-x:hover{background:#cbd5e1;color:#0f172a;}
.chat-filter-btn{
  display:inline-flex;align-items:center;gap:4px;
  padding:5px 10px;background:none;border:1px solid #e2e8f0;border-radius:6px;
  color:#64748b;font-size:12px;font-family:inherit;cursor:pointer;
  white-space:nowrap;flex-shrink:0;   /* 좁아져도 "필터" 줄바꿈/축소 금지 */
  transition:background .12s, color .12s, border-color .12s;
}
.chat-filter-btn:hover{background:#f8fafc;color:#0f172a;border-color:#cbd5e1;}
.chat-filter-btn.active{background:#ecfdf5;color:#0c8a86;border-color:#a7f3d0;}
.chat-filter-btn svg{opacity:.8;}

/* 대화 전체 복사 버튼 (필터 좌측) */
.chat-copyall-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:30px;padding:0;background:none;border:1px solid #e2e8f0;border-radius:6px;
  color:#64748b;cursor:pointer;margin-right:2px;flex-shrink:0;
  transition:background .12s, color .12s, border-color .12s, transform .12s;
}
.chat-copyall-btn:hover{background:#f8fafc;color:#0f172a;border-color:#cbd5e1;}
.chat-copyall-btn svg{opacity:.85;}
.chat-copyall-btn:active{transform:scale(.9);}
/* 복사 완료 애니메이션 */
.chat-copyall-btn.copied{background:#ecfdf5;color:#16a34a;border-color:#a7f3d0;animation:ccaPop .4s ease;}
.chat-copyall-btn.copied .cca-ico-copy{display:none;}
.chat-copyall-btn.copied .cca-ico-check{display:inline-block!important;animation:ccaCheck .4s ease;}
@keyframes ccaPop{0%{transform:scale(1);}40%{transform:scale(1.25);}100%{transform:scale(1);}}
@keyframes ccaCheck{0%{transform:scale(.3);opacity:0;}60%{transform:scale(1.2);opacity:1;}100%{transform:scale(1);opacity:1;}}

/* 컨텍스트 메뉴 팝업 */
.chat-filter-menu{
  position:fixed;z-index:5000;
  min-width:200px;background:#fff;
  border:1px solid #e2e8f0;border-radius:10px;
  box-shadow:0 12px 30px rgba(15,23,42,.15);
  padding:6px;font-size:13px;
  animation:cfmFade .12s ease-out;
}
@keyframes cfmFade{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.chat-filter-menu-item{
  display:flex;align-items:center;gap:8px;
  padding:8px 12px;border-radius:6px;cursor:pointer;color:#334155;
  transition:background .1s;
}
.chat-filter-menu-item:hover{background:#f1f5f9;color:#0f172a;}
.chat-filter-menu-item.checked{background:#ecfdf5;color:#0c8a86;}
.chat-filter-menu-item svg{flex-shrink:0;opacity:.7;}
.chat-filter-menu-item.checked svg{opacity:1;}
.chat-filter-menu-item .cfm-check{
  margin-left:auto;color:#0ea5a0;font-size:14px;
  visibility:hidden;
}
.chat-filter-menu-item.checked .cfm-check{visibility:visible;}

/* 메시지 필터링 (data-filters 에 콤마 구분 키 포함) */
#mbody[data-filters~="file"]    .message:not(.has-file),
#mbody[data-filters~="image"]   .message:not(.has-image),
#mbody[data-filters~="mention"] .message:not(.has-mention){display:none;}

/* 전송 대기 첨부(칩) 바 — 입력창 위 */
#pendingAttachBar{display:none;flex-wrap:wrap;gap:6px;padding:6px 10px;margin:0 8px 4px 8px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;}
.pnd-chip{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:3px 6px;background:#fff;border:1px solid #dbe3ec;border-radius:14px;font-size:12px;color:#334155;}
.pnd-thumb{width:26px;height:26px;object-fit:cover;border-radius:6px;flex-shrink:0;}
.pnd-ico{font-size:14px;flex-shrink:0;}
.pnd-nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pnd-x{cursor:pointer;color:#94a3b8;font-size:14px;line-height:1;padding:0 2px;flex-shrink:0;}
.pnd-x:hover{color:#ef4444;}

/* '#' AI 연속대화 상태 안내 버블 */
.message.ai-status .message-bubble{background:#eef7f6;border:1px solid #cdeceb;color:#0f172a;}
.message.ai-status .message-bubble_content{font-size:13px;line-height:1.55;}

/* ============================================================
 * 모바일 반응형 (≤820px) — 2026-07-20
 *   좌측 채널: 드로어(햄버거) / 우측 사용자패널: 드로어 / 채팅: 전체 폭
 *   EDM 패널(#dsPanel): 우측 오버레이
 *   ※ vue3 전용(public/legacy/chat.css). 데스크톱 레이아웃은 영향 없음.
 * ========================================================== */
@media (max-width: 820px) {
  .main-area { position: relative; }

  /* 좌측 채널 — 드로어 */
  .cs-wrap,
  .cs-wrap:not(.cs-folded),
  .cs-wrap.cs-folded,
  .cs-wrap.cs-folded:not(.cs-nohover):hover {
    position: fixed; left: 0; top: 50px; bottom: 0; z-index: 1600;
    width: 82vw; min-width: 0; max-width: 300px;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,.18);
  }
  .main-area.mo-nav .cs-wrap { transform: translateX(0); }
  .cs-wrap .cs-fold-btn { display: none !important; }   /* 모바일은 접기 버튼 불필요 */
  .cs { width: 100%; min-width: 0; }

  /* 우측 사용자 패널 — 드로어 */
  .rp-wrap {
    position: fixed; right: 0; top: 50px; bottom: 0; z-index: 1600;
    width: 78vw; min-width: 0; max-width: 280px;
    transform: translateX(100%); transition: transform .22s ease;
    box-shadow: -2px 0 16px rgba(0,0,0,.18);
  }
  .main-area.mo-user .rp-wrap { transform: translateX(0); }
  .us { width: 100%; min-width: 0; }

  /* 채팅 — 전체 폭 */
  .ca { width: 100%; min-width: 0; }

  /* 드로어 딤 */
  .mo-dim { position: fixed; inset: 50px 0 0 0; background: rgba(15,23,42,.4); z-index: 1500; }

  /* EDM 패널 — 우측 오버레이 (id=docSharePanel, legacy 가 .main-area flex 형제로 붙임)
     인라인 style 로 width/min-width 를 주므로 !important 로 덮어씀 */
  #docSharePanel {
    position: fixed !important; inset: 0 !important;          /* 전체 화면 */
    width: 100vw !important; min-width: 0 !important; max-width: 100vw !important;
    height: 100dvh !important; border-left: none !important;
    z-index: 2400 !important; box-shadow: none;
  }
  #docSharePanel #dsResizer { display: none !important; }   /* 모바일은 폭 조절 불필요 */

  /* 본문 가독성 보정 */
  .message.received .message-bubble, .message.sent .message-bubble { max-width: 86%; }
  .message-bubble { min-width: 0; }
  .ma { padding: 10px 8px; }
  .message { padding: 4px 4px; }
  .cha { padding-left: 8px; padding-right: 8px; }
  .ia { padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .top-logo-text { display: inline; font-size: 15px; }   /* 모바일에서도 WorkChat 타이틀 노출 */
  /* 채팅 헤더 — EDM 버튼(#docShareHeaderBtn)은 우측 끝 상시 노출, 나머지는 ⋮ 로 접힘 */
  .cha { padding: 8px 10px; min-height: 46px; position: relative; }
  .chr { gap: 6px; flex: none; }
  #docShareHeaderBtn { flex: none !important; order: 2; margin-left: 4px !important; }
  .chl2 { min-width: 0; overflow: hidden; }
  .ccn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 38vw; display: inline-block; }
  .top-bar { padding: 0 10px; }
  /* EDM 열림 시에도 채팅 본문은 전체 폭 유지(오버레이라 눌리지 않음) */
  .ca { flex: 1 1 100%; }
}
