:root {
  --bg: #0b1020;
  --panel: rgba(17, 24, 43, 0.82);
  --panel-2: rgba(30, 41, 66, 0.7);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e6e9f2;
  --muted: #8f9bb3;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --claude: #e08a64;
  --antigravity: #5b9bff;
  --user: #f5c542;
  --radius: 14px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: radial-gradient(1200px 600px at 20% -10%, #1a2350 0%, var(--bg) 55%) fixed; color: var(--text); }
body { min-height: 100vh; font-size: 14px; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }

/* ---------- 상단 */
header.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px; background: rgba(11, 16, 32, 0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
header.top h1 { font-size: 17px; margin: 0; letter-spacing: -0.2px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
.live.off i { background: var(--bad); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.stats { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip b { color: var(--text); font-weight: 600; }
.chip.topic { cursor: pointer; color: var(--accent-2); }
.chip.warn { color: var(--warn); border-color: rgba(251, 191, 36, .3); }
.chip.bad { color: var(--bad); border-color: rgba(248, 113, 113, .35); }
.chip.ok { color: var(--ok); border-color: rgba(52, 211, 153, .3); }

/* ---------- 배치 */
main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 16px; padding: 16px 18px 40px; max-width: 1600px; margin: 0 auto; }
@media (max-width: 1000px) { main { grid-template-columns: 1fr; padding: 12px 12px 40px; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.office-wrap { padding: 10px; position: relative; }
#office { width: 100%; height: auto; display: block; border-radius: 10px; cursor: pointer; image-rendering: auto; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 4px 2px; color: var(--muted); font-size: 12px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; background: var(--c); vertical-align: middle; }

.working { margin-top: 12px; padding: 12px 14px; }
.working h3, .section-title { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.work-list { display: grid; gap: 8px; }
.work-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--panel-2); border-radius: 10px; border: 1px solid var(--line); }
.work-item .who { font-weight: 600; }
.work-item .t { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--accent-2); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); padding: 10px 2px; font-size: 13px; }

/* ---------- 탭 */
.side { display: flex; flex-direction: column; min-width: 0; }
.tabs { display: flex; gap: 4px; padding: 6px; position: sticky; top: 52px; z-index: 10; background: rgba(17, 24, 43, 0.95); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; padding: 9px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; position: relative; }
.tabs button.on { background: var(--accent); color: white; }
.badge { position: absolute; top: 3px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: white; font-size: 11px; line-height: 18px; }
.pane { padding: 14px; display: none; }
.pane.on { display: block; }

/* ---------- 진행판 */
.board { display: grid; gap: 14px; }
.col h4 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.col h4 .n { color: var(--muted); font-weight: 400; }
.task { padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; }
.task .name { font-weight: 650; margin-bottom: 4px; }
.task .meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.task .status { color: var(--muted); font-size: 13px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar.indet i { width: 35%; animation: indet 1.6s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.col.done .task { opacity: .75; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 6px; }
details.more .content { font-size: 13px; color: #c9cfdd; margin-top: 6px; word-break: break-word; }

/* ---------- 결재함 */
.inbox-item { padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 10px; }
.inbox-item.pending { border-color: rgba(99, 102, 241, .55); box-shadow: 0 0 0 1px rgba(99, 102, 241, .25) inset; }
.inbox-item .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inbox-item .title { font-weight: 650; font-size: 15px; margin: 6px 0; }
.kind { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(99,102,241,.2); color: var(--accent-2); font-weight: 600; }
.kind.decision { background: rgba(251,191,36,.15); color: var(--warn); }
.kind.question { background: rgba(52,211,153,.15); color: var(--ok); }
.scope { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: rgba(0,0,0,.25); padding: 6px 8px; border-radius: 8px; margin: 6px 0; word-break: break-all; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 600; }
.btn:hover { border-color: rgba(255,255,255,.2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.ok { background: #059669; border-color: #059669; color: white; }
.btn.no { background: transparent; border-color: rgba(248,113,113,.5); color: var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
textarea, input[type=text], input[type=password], select {
  width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); outline: none;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent); }
.note { margin-top: 8px; min-height: 38px; resize: vertical; }

/* ---------- 대화 */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.filters input { grid-column: span 2; }
.msg { padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; }
.msg .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.msg .time { color: var(--muted); font-variant-numeric: tabular-nums; }
.who-c { font-weight: 700; }
.msg .q { margin-top: 6px; color: #c9cfdd; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg.open .q { display: none; }
.msg .body { display: none; margin-top: 8px; }
.msg.open .body { display: block; }
.msg .body h5 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.edit-box { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(99,102,241,.08); border: 1px dashed rgba(99,102,241,.4); font-size: 13px; }
.outside { color: var(--bad); font-weight: 600; }
.md { font-size: 13.5px; word-break: break-word; }
.md pre { background: rgba(0,0,0,.35); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: 12px; }
.md code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; color: #7dd3fc; font-size: 12.5px; }
.md pre code { background: none; padding: 0; color: #dbe4f3; }
.md h1, .md h2, .md h3, .md h4 { font-size: 14px; margin: 10px 0 4px; }
.md ul, .md ol { padding-left: 20px; margin: 4px 0; }
.md p { margin: 6px 0; }

/* ---------- 질문하기 / 로그인 */
.form { display: grid; gap: 10px; }
.form label { font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.hint { color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #111827; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 50; display: none; max-width: 90vw; }
.toast.on { display: block; }
#login { max-width: 360px; margin: 18vh auto; padding: 24px; display: none; }
#login h2 { margin-top: 0; }
.footer-note { color: var(--muted); font-size: 12px; padding: 0 18px 30px; text-align: center; }
.todo { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.35); }
.todo.clear { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.3); }
