/* ============================================================
   한국투자증권 AI직원 워크스페이스 — 셸 · 명단 · 단계패널 · 대화창
   ============================================================ */
:root{
  --navy:#0a2540; --navy2:#123a63; --navy3:#1e4b7a;
  --red:#c8102e; --red-soft:#fdeef0;
  --gold:#b8894a;
  --ink:#1f2937; --ink2:#374151; --muted:#6b7280; --muted2:#9ca3af;
  --line:#e5e7eb; --line2:#eef1f5;
  --bg:#f4f6f9; --panel:#ffffff; --soft:#f8fafc;
  --l1:#dc3545; --l2:#fd7e14; --l3:#f0ad00; --l4:#28a745; --l5:#0d9488;
  --ok:#0f9d58;
  --c1:216px; --c2:272px; --c3:404px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;font-family:'Pretendard','Apple SD Gothic Neo','Malgun Gothic',system-ui,-apple-system,sans-serif;
  color:var(--ink);background:var(--bg);line-height:1.5;font-size:13px;
  -webkit-font-smoothing:antialiased;overflow:hidden;
}
button{font-family:inherit}
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-thumb{background:#cfd6e0;border-radius:6px;border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:#b6c0ce;background-clip:content-box}
::-webkit-scrollbar-track{background:transparent}

/* ---------- 셸 ---------- */
.app{display:grid;grid-template-columns:var(--c1) var(--c2) var(--c3) 1fr;
  grid-template-rows:minmax(0,1fr);height:100vh;overflow:hidden}
.col{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;
  background:var(--panel);border-right:1px solid var(--line)}
.col:last-child{border-right:none;background:var(--bg)}
.col-head{flex:0 0 auto;padding:10px 14px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;min-height:48px}
.col-head h2{font-size:13px;font-weight:800;margin:0;letter-spacing:-.2px}
.col-head .sub{font-size:11px;color:var(--muted)}
.col-head .rt{margin-left:auto;display:flex;align-items:center;gap:6px}
.col-body{flex:1;overflow-y:auto;overflow-x:hidden;min-height:0}
.hidden{display:none !important}

.count{font-size:11px;font-weight:800;color:var(--muted);background:var(--soft);border:1px solid var(--line);
  border-radius:20px;padding:1px 8px;white-space:nowrap}

/* ---------- 1열 · 조직 명단 ---------- */
.brand{padding:12px 14px;border-bottom:1px solid var(--line);display:flex;gap:9px;align-items:center;
  background:linear-gradient(135deg,var(--navy),var(--navy3))}
.brand .mark{width:28px;height:28px;border-radius:7px;background:#fff;color:var(--navy);
  display:grid;place-items:center;font-weight:900;font-size:13px;flex:0 0 auto}
.brand .bt{color:#fff;min-width:0}
.brand .bt b{display:block;font-size:12.5px;font-weight:800;letter-spacing:-.3px}
.brand .bt span{display:block;font-size:10.5px;opacity:.72;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.rsec{padding:12px 10px 4px}
.rsec-t{font-size:10.5px;font-weight:800;color:var(--muted2);letter-spacing:.4px;padding:0 4px 7px;
  display:flex;align-items:center;gap:6px}
.rsec-t::after{content:"";flex:1;height:1px;background:var(--line2)}

.person{display:flex;align-items:center;gap:8px;padding:6px 6px;border-radius:8px;cursor:default}
.person:hover{background:var(--soft)}
.avatar{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;color:#fff;
  font-size:11px;font-weight:800;flex:0 0 auto}
.person .pn{min-width:0;flex:1}
.person .pn b{display:block;font-size:12px;font-weight:700;line-height:1.3}
.person .pn span{display:block;font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dot{width:6px;height:6px;border-radius:50%;flex:0 0 auto;background:var(--muted2)}
.dot.on{background:var(--ok)}
.dot.away{background:#f0ad00}

.agent{width:100%;text-align:left;display:block;border:1px solid var(--line);background:#fff;
  border-radius:10px;padding:8px 9px;margin-bottom:7px;cursor:pointer;transition:.14s}
.agent:hover{border-color:#c7d3e2;background:#fbfdff}
.agent.sel{border-color:var(--navy);background:#f5f8fc;box-shadow:0 0 0 1px var(--navy) inset}
.agent-top{display:flex;align-items:center;gap:7px}
.agent .em{width:24px;height:24px;border-radius:7px;background:var(--soft);border:1px solid var(--line);
  display:grid;place-items:center;font-size:13px;flex:0 0 auto}
.agent.sel .em{background:#fff;border-color:#c7d3e2}
.agent .an{min-width:0;flex:1}
.agent .an b{display:block;font-size:12px;font-weight:800;line-height:1.3}
.agent .an span{display:block;font-size:10px;color:var(--muted)}
.agent .ad{font-size:10.5px;color:var(--muted);margin-top:6px;line-height:1.45}
.agent .askills{display:flex;flex-wrap:wrap;gap:3px;margin-top:6px}
.askill{font-size:9.5px;font-weight:700;color:var(--navy3);background:#eef4fa;border-radius:4px;padding:1px 5px}
.agent.sel .askill{background:#e3ecf6}
.agent .stat{font-size:9.5px;font-weight:800;padding:1px 6px;border-radius:20px;background:var(--soft);
  color:var(--muted);border:1px solid var(--line);white-space:nowrap}
.agent .stat.run{background:#fff7ed;color:#c2410c;border-color:#fed7aa}
.agent .stat.done{background:#ecfdf5;color:#047857;border-color:#a7f3d0}

.rfoot{flex:0 0 auto;padding:10px;border-top:1px solid var(--line);background:var(--soft)}
.rfoot .rline{display:flex;align-items:flex-start;gap:6px;font-size:10.5px;color:var(--muted);
  margin-bottom:4px;line-height:1.45}
.rfoot .rline .dot{margin-top:5px}
.rfoot .rline:last-child{margin-bottom:0}

/* ---------- 2열 · 단계 패널 ---------- */
.steps{display:flex;gap:3px;padding:8px 10px;border-bottom:1px solid var(--line);background:var(--soft)}
.step-b{flex:1;border:1px solid transparent;background:transparent;border-radius:7px;padding:5px 2px;cursor:pointer;
  font-size:10.5px;font-weight:700;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:2px;
  transition:.14s;min-width:0}
.step-b .si{font-size:14px;line-height:1}
.step-b:hover:not(:disabled){background:#fff;color:var(--ink2)}
.step-b.on{background:#fff;border-color:var(--navy);color:var(--navy);box-shadow:0 1px 2px rgba(10,37,64,.1)}
.step-b:disabled{opacity:.38;cursor:not-allowed}
.step-b.ok{color:var(--ok)}

.pnl-empty{padding:44px 20px;text-align:center;color:var(--muted2)}
.pnl-empty .pe-i{font-size:26px;opacity:.5}
.pnl-empty b{display:block;font-size:12.5px;color:var(--muted);margin:8px 0 4px;font-weight:700}
.pnl-empty span{font-size:11px;line-height:1.6}

/* 수집 항목 트리 */
.cgrp{border-bottom:1px solid var(--line2);padding:9px 12px;opacity:.32;transition:.3s}
.cgrp.on{opacity:1}
.cgrp-h{display:flex;align-items:center;gap:7px}
.cgrp-h .no{font-size:10px;font-weight:800;color:var(--muted2);font-variant-numeric:tabular-nums}
.cgrp-h b{font-size:12px;font-weight:800;flex:1;min-width:0}
.cgrp .src{font-size:10px;color:var(--muted2);margin:2px 0 0 22px}
.cgrp ul{list-style:none;margin:7px 0 0;padding:0 0 0 22px}
.cgrp li{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--ink2);padding:2.5px 0}
.cgrp li .ck{color:var(--ok);font-size:10px;flex:0 0 auto}
.cgrp li .cn{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cgrp li .cc{font-size:10px;font-weight:700;color:var(--muted)}
.srcpill{font-size:9px;font-weight:700;padding:0 4px;border-radius:3px;background:var(--soft);
  border:1px solid var(--line);color:var(--muted)}

/* 진단 영역 리스트 */
.arow{width:100%;text-align:left;border:none;border-bottom:1px solid var(--line2);background:#fff;
  padding:10px 12px;cursor:pointer;display:block;opacity:.32;transition:.3s}
.arow.on{opacity:1}
.arow:hover.on{background:var(--soft)}
.arow.sel{background:#f5f8fc;box-shadow:inset 3px 0 0 var(--navy)}
.arow.core{box-shadow:inset 3px 0 0 var(--red)}
.arow.core.sel{background:var(--red-soft)}
.arow-t{display:flex;align-items:center;gap:7px}
.arow-t .ic{font-size:11px;color:var(--muted2);flex:0 0 auto}
.arow-t b{font-size:12px;font-weight:800;flex:1;min-width:0}
.arow .aq{font-size:10.5px;color:var(--muted);margin:3px 0 0 18px;line-height:1.4}
.arow .abar{margin:6px 0 0 18px;height:4px;border-radius:3px;background:var(--line2);overflow:hidden}
.arow .abar i{display:block;height:100%;border-radius:3px;transition:width .4s}
.arow .ameta{margin:5px 0 0 18px;font-size:10px;color:var(--muted2);display:flex;gap:8px}

/* 목차 */
.tocg{border-bottom:1px solid var(--line2);padding:8px 12px;opacity:.32;transition:.3s}
.tocg.on{opacity:1}
.tocg-h{display:flex;align-items:center;gap:8px;cursor:pointer}
.tocg-h .cno{width:18px;height:18px;border-radius:5px;background:var(--soft);border:1px solid var(--line);
  display:grid;place-items:center;font-size:10px;font-weight:800;color:var(--muted);flex:0 0 auto}
.tocg.on .cno{background:var(--navy);border-color:var(--navy);color:#fff}
.tocg-h b{font-size:12px;font-weight:800;flex:1;min-width:0}
.tocg-h .st{width:6px;height:6px;border-radius:50%;background:var(--line);flex:0 0 auto}
.tocg.on .st{background:var(--ok)}
.tocg ul{list-style:none;margin:6px 0 0;padding:0 0 0 26px}
.tocg li{font-size:11px;color:var(--muted);padding:2.5px 0;cursor:pointer;line-height:1.4}
.tocg li:hover{color:var(--navy3)}

/* 슬라이드 썸네일 */
.thumbs{padding:10px}
.thsec{font-size:10px;font-weight:800;color:var(--muted2);letter-spacing:.3px;margin:10px 2px 6px}
.thsec:first-child{margin-top:0}
.thumb{display:block;width:100%;border:none;background:transparent;padding:0;margin-bottom:10px;cursor:pointer;text-align:left}
.thumb .tw{position:relative;border:1px solid var(--line);border-radius:6px;overflow:hidden;background:#fff;
  transition:.14s}
.thumb:hover .tw{border-color:#c7d3e2}
.thumb.sel .tw{border-color:var(--red);box-shadow:0 0 0 2px var(--red-soft)}
.thumb .tno{position:absolute;top:0;left:0;background:rgba(255,255,255,.9);font-size:9px;font-weight:800;
  padding:1px 5px;border-bottom-right-radius:5px;color:var(--ink);z-index:2}
.thumb .tdot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:50%;background:var(--ok);z-index:2}
.thumb .tt{font-size:10.5px;font-weight:700;color:var(--ink2);margin-top:4px;line-height:1.35;
  display:flex;gap:4px;align-items:baseline}
.thumb .tt i{font-style:normal;color:var(--muted2);font-weight:800;font-variant-numeric:tabular-nums}
.thumb.ghost .tw{background:var(--soft);border-style:dashed}
.thumb.ghost .tw .sfit{opacity:0}

.pnl-foot{flex:0 0 auto;padding:9px 10px;border-top:1px solid var(--line);display:flex;gap:6px;background:var(--soft)}

/* ---------- 3열 · 대화창 ---------- */
.chat-head{flex:0 0 auto;padding:9px 14px;border-bottom:1px solid var(--line)}
.chat-head .ct{display:flex;align-items:center;gap:8px}
.chat-head b{font-size:13px;font-weight:800}
.chat-head .cs{font-size:11px;color:var(--muted);margin-top:1px}
.live{font-size:10px;font-weight:800;color:#c2410c;background:#fff7ed;border:1px solid #fed7aa;
  border-radius:20px;padding:1px 8px;display:inline-flex;align-items:center;gap:4px}
.live i{width:5px;height:5px;border-radius:50%;background:#f97316;animation:pulse 1.1s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.25}}

.chat-body{flex:1;overflow-y:auto;padding:16px 14px 8px;min-height:0}

.msg{margin-bottom:14px;display:flex;flex-direction:column}
.msg.user{align-items:flex-end}
.msg-who{display:flex;align-items:center;gap:6px;font-size:10.5px;color:var(--muted);margin-bottom:5px;font-weight:700}
.msg-who .wa{width:18px;height:18px;border-radius:5px;display:grid;place-items:center;font-size:10px;color:#fff;background:var(--navy)}
.bubble{max-width:92%;border-radius:12px;padding:10px 13px;font-size:12.5px;line-height:1.68;
  border:1px solid var(--line);background:#fff}
.msg.user .bubble{background:var(--navy);border-color:var(--navy);color:#fff;border-bottom-right-radius:4px}
.msg.agent .bubble{border-bottom-left-radius:4px}
.bubble.warn{background:#fffbeb;border-color:#fde68a}
.bubble b{font-weight:800}
.msg.agent .bubble b{color:var(--navy)}
.bubble.warn b{color:#b45309}

/* 작업 계획 */
.plan{max-width:96%;border:1px solid #c7d3e2;background:#f7fafd;border-radius:12px;padding:11px 13px}
.plan-h{display:flex;align-items:center;gap:6px;font-size:11.5px;font-weight:800;color:var(--navy);margin-bottom:3px}
.plan .pnote{font-size:10.5px;color:var(--muted);margin-bottom:8px;line-height:1.5}
.plan ol{margin:0;padding-left:0;list-style:none;counter-reset:p}
.plan li{counter-increment:p;font-size:11.5px;color:var(--ink2);padding:4px 0 4px 22px;position:relative;line-height:1.5}
.plan li::before{content:counter(p);position:absolute;left:0;top:4px;width:15px;height:15px;border-radius:4px;
  background:#fff;border:1px solid #c7d3e2;color:var(--navy3);font-size:9px;font-weight:800;display:grid;place-items:center}

/* 도구 사용 */
.tool{max-width:96%;border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 11px}
.tool-h{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:800;color:var(--ink2)}
.tool-h .tico{font-size:11px}
.tool-h .tn{background:var(--soft);border:1px solid var(--line);border-radius:5px;padding:1px 6px;
  font-size:10.5px;font-weight:800;color:var(--navy3)}
.tool .td{font-size:10.5px;color:var(--muted);margin:5px 0 0;line-height:1.5}
.tool .tr{font-size:11.5px;color:var(--ink2);margin-top:7px;padding-top:7px;border-top:1px dashed var(--line);line-height:1.55}
.tool .tr::before{content:"↳ ";color:var(--muted2)}
.tool .tr b{color:var(--navy);font-weight:800}

/* 체크리스트 */
.cl{max-width:96%;border:1px solid var(--line);border-left:3px solid var(--red);background:#fff;
  border-radius:0 10px 10px 0;padding:10px 12px}
.cl-h{display:flex;align-items:baseline;gap:7px;font-size:11.5px;font-weight:800;margin-bottom:7px}
.cl-h .cn{margin-left:auto;font-size:10.5px;font-weight:800;color:var(--red);font-variant-numeric:tabular-nums}
.cl ul{list-style:none;margin:0;padding:0}
.cl li{display:flex;gap:7px;align-items:flex-start;font-size:11.5px;padding:3px 0;color:var(--muted2);
  transition:.2s;line-height:1.5}
.cl li .m{width:13px;flex:0 0 auto;text-align:center;font-size:10px;line-height:1.6}
.cl li.run{color:var(--ink);font-weight:700}
.cl li.run .m{color:#f97316}
.cl li.done{color:var(--ink2)}
.cl li.done .m{color:var(--ok)}
.cl li .lt{flex:1;min-width:0}
.cl li .ln{display:block;font-size:10px;color:var(--muted);font-weight:400;margin-top:1px}

/* 결과 */
.result{max-width:96%;border:1px solid #a7f3d0;background:#f2fdf8;border-radius:12px;padding:11px 13px}
.result-h{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:800;color:#047857;margin-bottom:7px}
.result ul{list-style:none;margin:0;padding:0}
.result li{font-size:11.5px;color:var(--ink2);padding:3px 0 3px 15px;position:relative;line-height:1.55}
.result li::before{content:"•";position:absolute;left:3px;color:#10b981;font-weight:800}
.result li b{color:#065f46;font-weight:800}

/* 업무 이관 */
.handoff{max-width:96%;border:1px dashed #c7b7e6;background:#faf7ff;border-radius:10px;padding:9px 12px}
.handoff-h{font-size:11px;font-weight:800;color:#6d28d9;display:flex;align-items:center;gap:6px;margin-bottom:5px}
.handoff .hr{font-size:11.5px;color:var(--ink2);line-height:1.6}
.handoff .hr b{color:#5b21b6;font-weight:800}
.handoff .hw{font-size:10.5px;color:var(--muted);margin-top:4px;line-height:1.5}

/* 액션 버튼 */
.acts{max-width:96%}
.acts .at{font-size:11.5px;color:var(--ink2);margin-bottom:8px;line-height:1.6}
.acts .ab{display:flex;flex-wrap:wrap;gap:6px}

.btn{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:8px;padding:7px 13px;
  font-size:11.5px;font-weight:700;cursor:pointer;transition:.14s;white-space:nowrap}
.btn:hover:not(:disabled){border-color:#c7d3e2;background:var(--soft)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.pri{background:var(--red);border-color:var(--red);color:#fff;font-weight:800}
.btn.pri:hover:not(:disabled){background:#a80d26;border-color:#a80d26}
.btn.nav{background:var(--navy);border-color:var(--navy);color:#fff;font-weight:800}
.btn.nav:hover:not(:disabled){background:#08203a}
.btn.sm{padding:5px 10px;font-size:11px}

.typing{display:inline-flex;gap:3px;align-items:center;padding:3px 0}
.typing i{width:5px;height:5px;border-radius:50%;background:var(--muted2);animation:bnc 1.2s infinite}
.typing i:nth-child(2){animation-delay:.16s}
.typing i:nth-child(3){animation-delay:.32s}
@keyframes bnc{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-4px);opacity:1}}

/* 시작 화면 예시 */
.starter{padding:8px 2px}
.starter h3{font-size:15px;font-weight:800;margin:0 0 6px}
.starter p{font-size:11.5px;color:var(--muted);margin:0 0 14px;line-height:1.65}
.sp{width:100%;text-align:left;border:1px solid var(--line);background:#fff;border-radius:9px;
  padding:10px 12px;margin-bottom:7px;cursor:pointer;font-size:11.5px;color:var(--ink2);line-height:1.55;
  display:flex;gap:8px;align-items:flex-start;transition:.14s}
.sp:hover{border-color:var(--navy);background:#f7fafd}
.sp .spa{color:var(--muted2);flex:0 0 auto;font-weight:800}

/* 입력창 */
.composer{flex:0 0 auto;border-top:1px solid var(--line);padding:10px 12px;background:#fff}
.cbox{display:flex;gap:7px;align-items:flex-end;border:1px solid var(--line);border-radius:10px;padding:7px 8px 7px 11px;
  background:#fff;transition:.14s}
.cbox:focus-within{border-color:var(--navy);box-shadow:0 0 0 3px rgba(10,37,64,.06)}
.cbox textarea{flex:1;border:none;outline:none;resize:none;font-family:inherit;font-size:12px;line-height:1.55;
  max-height:88px;min-height:20px;color:var(--ink);background:transparent}
.chint{font-size:10px;color:var(--muted2);margin-top:6px;display:flex;gap:5px;align-items:center;flex-wrap:wrap}
.kbd{border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;padding:0 4px;font-size:9.5px;
  font-weight:700;color:var(--muted);background:var(--soft)}
