/* ============================================================
   3floor — Tree sidebar + Pipeline main + Document drawer
   ============================================================ */

:root {
  /* 애플 시스템 다크 톤 — 순수 검정 베이스 + 미묘한 elev */
  --bg: #000000;
  --bg-elev: #0d0d12;
  --bg-elev-2: #16161c;
  --bg-elev-3: #1d1d24;
  --bg-doc: #0a0a0e;

  /* 더 미묘한 보더 */
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* 텍스트 — 애플 SF 톤 */
  --text: #f5f5f7;
  --text-doc: #d6d6dc;
  --text-dim: #a1a1a6;
  --text-muted: #6e6e73;

  
  /* 액센트 — 보다 절제된 인디고 */
  --accent: #7c7fff;
  --accent-2: #5e62e5;
  --success: #30d158;     /* Apple system green */
  --warning: #ffd60a;     /* Apple system yellow */
  --danger: #ff453a;      /* Apple system red */
  --info: #64d2ff;        /* Apple system blue */

  /* ====== 상태 색상 룰 (전 시스템 통일) ======
     - 대기 (idle):       흰색 톤
     - 진행 중 (running):  노란색
     - 정지 (blocked):    빨간색
     - 결재 대기 (review): 파란색
     - 연동/API (integration): 초록색
  */
  --state-idle: rgba(255, 255, 255, 0.65);
  --state-running: #ffd60a;
  --state-blocked: #ff453a;
  --state-review: #64d2ff;
  --state-integration: #30d158;

  /* 층별 정체성 색 — 카페 vertical 7층 (carma/우드/라떼 톤) */
  --floor-1: #b09080;   /* 1F Meeting Room    — 라떼 베이지 */
  --floor-2: #6b4226;   /* 2F 기획팀          — 다크 우드 */
  --floor-3: #c47b7d;   /* 3F 인테리어팀      — 핑크 카멜 */
  --floor-4: #d4a574;   /* 4F 장비팀          — 캐러멜 */
  --floor-5: #8fae8f;   /* 5F 메뉴팀          — 민트 라떼 */
  --floor-6: #e8744c;   /* 6F 마케팅팀        — 따뜻한 주황 (디자인 톤) */
  --floor-7: #3a8073;   /* 7F 행정팀          — 청록 (행정 신뢰감) */

  /* legacy alias — JS/CSS 일부에서 참조 */
  --floor-ops: var(--floor-7);
  --floor-planning: var(--floor-2);
  --floor-dev: var(--floor-4);
  --floor-mkt: var(--floor-6);
  --floor-design: var(--floor-6);
  --floor-cafe-meeting: var(--floor-1);
  --floor-cafe-interior: var(--floor-3);
  --floor-cafe-menu: var(--floor-5);

  /* 라운드 — 애플은 더 부드러움 */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 980px;
  --gap: 12px;
  --sidebar-w: 280px;
  --drawer-w: 720px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
dl, dt, dd { margin: 0; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  transition: grid-template-columns 0.28s ease;
}
body.left-collapsed .app {
  grid-template-columns: 0 1fr;
}
body.left-collapsed .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
.sidebar { transition: transform 0.28s ease, opacity 0.2s ease; }

/* ============================================================
   Edge collapse buttons (좌우 사이드바 토글 — 플로팅 탭)
   ============================================================ */
.edge-collapse-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  width: 22px;
  height: 56px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  transition: left 0.28s ease, right 0.28s ease, background 0.15s, color 0.15s, transform 0.2s;
  padding: 0;
  line-height: 1;
}
.edge-collapse-btn:hover { background: var(--bg-elev-2); color: var(--text); }
.edge-left {
  left: var(--sidebar-w);
  border-left: none;
  border-radius: 0 8px 8px 0;
}
body.left-collapsed .edge-left { left: 0; }
body.left-collapsed .edge-left { transform: translateY(-50%) rotate(180deg); }
.edge-right {
  right: 354px;
  border-right: none;
  border-radius: 8px 0 0 8px;
}
body.right-collapsed .edge-right { right: 0; }
body.right-collapsed .edge-right { transform: translateY(-50%) rotate(180deg); }
@media (max-width: 768px) {
  .edge-collapse-btn { display: none; }
}

/* ============================================================
   Left sidebar (Tree)
   ============================================================ */
.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
  position: relative;
  z-index: 100;  /* SVG connector(z-index 50)보다 위 — 점선이 사이드바 가로지르지 않게 */
}

/* 사이드바 통계 카드 (이전 가운데 dash-top-stats에서 이동) */
.sb-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}
.sb-stat {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.sb-stat:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-3);
}
.sb-stat-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1;
}
.sb-stat-lbl {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.05px;
}
/* stat 칩을 버튼으로 (클릭 가능) */
.sb-stat-btn {
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.sb-stat-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.sb-stat-btn-active {
  border-color: var(--accent);
  background: var(--bg-elev-3);
}

/* 전체 task 모달 */
.all-tasks-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.all-tasks-modal[hidden] { display: none; }
.all-tasks-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.all-tasks-panel {
  position: relative;
  width: min(720px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  animation: allTasksSlideIn 0.22s ease-out;
}
@keyframes allTasksSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.all-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.all-tasks-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.all-tasks-actions { display: flex; gap: 8px; align-items: center; }
.all-tasks-bulk-btn {
  font-size: 12px;
  padding: 7px 12px;
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.all-tasks-bulk-btn:not(:disabled):hover {
  background: rgba(248, 113, 113, 0.22);
  border-color: #f87171;
}
.all-tasks-bulk-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.all-tasks-close {
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}
.all-tasks-close:hover { background: var(--bg-elev-2); color: var(--text); }
.all-tasks-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 16px;
}
.all-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.12s;
}
.all-task-row:hover { background: var(--bg-elev-2); }
.all-task-check { flex-shrink: 0; }
.all-task-check input { cursor: pointer; }
.all-task-info { flex: 1; min-width: 0; cursor: pointer; }
.all-task-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.all-task-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.all-task-status {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-elev-3, var(--bg-elev));
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}
.all-task-status[data-status="done"] { color: #4ade80; }
.all-task-status[data-status="blocked"] { color: #f87171; }
.all-task-status[data-status="review_pending"] { color: #fbbf24; }
.all-task-del {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.all-task-del:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: #f87171;
  color: #f87171;
}
.sb-stat.sb-info .sb-stat-num    { color: var(--state-running); }   /* 진행 = 노랑 */
.sb-stat.sb-success .sb-stat-num { color: var(--state-idle); }      /* 완료 = 대기 톤 */
.sb-stat.sb-warning .sb-stat-num { color: var(--state-blocked); }   /* 정지 = 빨강 */

/* 활성 작업 섹션 */
.sb-1f-section {
  padding: 12px 12px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.sb-1f-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 2px;
}
.sb-1f-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sb-1f-task {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.sb-1f-task:hover { background: var(--bg-elev-2); }
.sb-1f-task.active {
  background: var(--bg-elev-2);
  border-color: var(--accent);
}
.sb-1f-task .sb-task-dot { margin-top: 5px; }
.sb-1f-task-body { min-width: 0; }
.sb-1f-task-goal {
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-1f-task-meta {
  display: flex;
  gap: 6px;
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 2px;
  align-items: center;
}
.sb-1f-status {
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-elev-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 9px;
}
/* 진행 단계 칩 — 어떤 agent가 작업 중인지 라이브 표시 */
.sb-1f-stage {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(126, 96, 191, 0.15);
  color: var(--accent);
  border: 1px solid rgba(126, 96, 191, 0.3);
  font-weight: 500;
  white-space: nowrap;
  animation: stageBlink 2.4s ease-in-out infinite;
}
@keyframes stageBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.sb-1f-task[data-status="queued"] .sb-1f-status { color: var(--info); }
.sb-1f-task[data-status="planning"] .sb-1f-status { color: var(--warning); }
.sb-1f-task[data-status="routing"] .sb-1f-status { color: var(--accent); }
.sb-1f-task[data-status="assigned"] .sb-1f-status { color: var(--info); }
.sb-1f-task[data-status="dev"] .sb-1f-status { color: var(--floor-dev); }
.sb-1f-task[data-status="blocked"] .sb-1f-status { color: var(--danger); }
.sb-1f-task[data-status="done"] .sb-1f-status {
  color: var(--success);
  background: rgba(52, 211, 153, 0.12);
}
.sb-1f-task[data-status="done"] {
  border-color: rgba(52, 211, 153, 0.2);
}
.sb-1f-task[data-status="done"] .sb-1f-task-goal {
  color: var(--text-dim);
}
.sb-1f-stage {
  color: var(--text-dim);
  font-size: 9.5px;
}

/* Team badges (assigned_teams 표시용 — 모든 곳에서 재사용) */
.team-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.team-badge {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.team-badge[data-team="development"] { color: var(--floor-dev); background: rgba(6, 182, 212, 0.12); }
.team-badge[data-team="operations"]  { color: var(--info); background: rgba(96, 165, 250, 0.12); }
.team-badge[data-team="marketing"]   { color: #f59e0b; background: rgba(245, 158, 11, 0.14); }
.team-badge[data-team="design"]      { color: #ec4899; background: rgba(236, 72, 153, 0.14); }
.team-badge[data-team="legal"]       { color: #94a3b8; background: rgba(148, 163, 184, 0.14); }
.team-badge[data-team="finance"]     { color: var(--success); background: rgba(52, 211, 153, 0.12); }

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.brand h1 { font-size: 15px; margin: 0; font-weight: 500; letter-spacing: -0.3px; }
.brand-sub { font-size: 10px; color: var(--text-muted); margin: 0; letter-spacing: 0; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-weight: 600; font-size: 11px; color: white;
  flex-shrink: 0;
  letter-spacing: -0.2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Tree */
.tree {
  overflow-y: auto;
  padding: 8px 6px;
  min-height: 0;
}
.tree-node { display: flex; flex-direction: column; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-doc);
  transition: background 0.12s;
  user-select: none;
}
.tree-row:hover { background: var(--bg-elev-2); }
.tree-children {
  margin-left: 14px;
  border-left: 1px dashed rgba(255, 255, 255, 0.06);
  padding-left: 4px;
  overflow: hidden;
  max-height: 4000px;
  transition: max-height 0.2s;
}
.tree-node.collapsed > .tree-children { max-height: 0; display: none; }

.tree-caret {
  display: inline-block;
  width: 12px;
  font-size: 9px;
  color: var(--text-muted);
  flex-shrink: 0;
  text-align: center;
}
.tree-caret-spacer { display: inline-block; width: 12px; flex-shrink: 0; }

.tree-floor {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 1px 5px;
  background: var(--bg-elev-2);
  border-radius: 3px;
}
.tree-team-row { font-weight: 600; color: var(--text); }
.tree-team-row .tree-label { letter-spacing: -0.01em; }

.tree-agent-row .tree-label { color: var(--text-doc); }
.tree-count {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  padding: 1px 6px;
  border-radius: 8px;
}

.tree-task-row {
  font-size: 11.5px;
}
.tree-task-row.active {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent);
  font-weight: 600;
}
.tree-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.tree-status-dot[data-status="queued"] { background: var(--info); }
.tree-status-dot[data-status="planning"] { background: var(--warning); }
.tree-status-dot[data-status="routing"] { background: var(--accent); }
.tree-status-dot[data-status="assigned"] { background: var(--info); }
.tree-status-dot[data-status="dev"] { background: var(--floor-dev); }
.tree-status-dot[data-status="done"] { background: var(--success); }
.tree-status-dot[data-status="blocked"] { background: var(--danger); }

/* Standalone status dots (used in 1F section) */
.sb-task-dot[data-status="queued"] { background: var(--info); }
.sb-task-dot[data-status="planning"] { background: var(--warning); }
.sb-task-dot[data-status="routing"] { background: var(--accent); }
.sb-task-dot[data-status="assigned"] { background: var(--info); }
.sb-task-dot[data-status="dev"] { background: var(--floor-dev); }
.sb-task-dot[data-status="done"] { background: var(--success); }
.sb-task-dot[data-status="blocked"] { background: var(--danger); }

.tree-doc-row {
  font-size: 11px;
  color: var(--text-dim);
  padding-left: 18px;
}
.tree-doc-row:hover { color: var(--text); }
.tree-doc-row.active {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent);
}
.tree-doc-icon { width: 14px; flex-shrink: 0; opacity: 0.8; }

.tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.tree-empty {
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 4px 8px;
  font-style: italic;
}

/* Sidebar footer (new task input) */
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.new-task-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
#newTaskInput {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
  padding: 6px 10px;
  outline: none;
  min-width: 0;
}
#newTaskInput:focus { border-color: var(--accent); }
#newTaskInput::placeholder { color: var(--text-muted); }

.worker-hint {
  font-size: 9.5px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.04em;
  cursor: help;
}

/* ============================================================
   Main (pipeline)
   ============================================================ */
.main {
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.hidden { display: none !important; }

.home-view, .task-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap);
  overflow: hidden;
}

.task-view {
  display: grid;
  grid-template-rows: auto 1fr 2fr;
}
.task-view.hidden { display: none !important; }

/* 빌딩은 1/3, 스크롤 */
.task-view .building {
  overflow-y: auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 6px 4px 0;
}
/* lower-grid (결재함 + Events)가 2/3 차지 */
.task-view .lower-grid {
  min-height: 0;
}

/* ============================================================
   Brand (clickable home button)
   ============================================================ */
.brand { cursor: pointer; position: relative; }
.brand:hover { background: var(--bg-elev-2); }
.brand-home-icon {
  margin-left: auto;
  font-size: 14px;
  opacity: 0.5;
}
.brand:hover .brand-home-icon { opacity: 1; }

/* ============================================================
   Home view
   ============================================================ */
.home-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-right: 4px;
}

/* ============================================================
   Home Grid — 상단 대시보드 / 좌측 빌딩+팀 / 우측 결재함+이벤트
   ============================================================ */
.home-view .home-grid {
  flex: 1 1 auto;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  transition: grid-template-columns 0.28s ease;
}
body.right-collapsed .home-view .home-grid {
  grid-template-columns: minmax(0, 1fr) 0;
}
body.right-collapsed .home-right {
  opacity: 0;
  transform: translateX(100%);
  pointer-events: none;
}
.home-right { transition: transform 0.28s ease, opacity 0.2s ease; }

/* ============================================================
   TOP — 가로형 대시보드 (입력 + 통계 + 활성 작업)
   ============================================================ */
.home-dash-top {
  grid-column: 1;
  grid-row: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: minmax(320px, 2fr) auto minmax(220px, 2fr);
  gap: 22px;
  align-items: stretch;
}
.dash-top-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.dash-top-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.dash-top-input-row #homeNewTaskInput {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}
.dash-top-input-row #homeNewTaskInput:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15); }
.dash-top-input-row #homeNewTaskBtn {
  padding: 10px 18px;
  font-size: 12.5px;
}
.dash-top-input-row .attach-btn {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
  width: 40px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  display: grid;
  place-items: center;
}
.dash-top-input-row .attach-btn:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}
.dash-top-input-row .attach-btn.has-files {
  border-color: var(--accent);
  color: var(--accent);
}

/* 선택된 첨부 파일 chip 리스트 */
.attach-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.attach-list:empty { display: none; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 10px 4px 8px;
  font-size: 11px;
  color: var(--text-doc);
  max-width: 220px;
}
.attach-chip-icon { font-size: 12px; flex-shrink: 0; }
.attach-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip-size { color: var(--text-muted); font-size: 10px; flex-shrink: 0; }
.attach-chip-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.attach-chip-remove:hover { color: var(--danger); }

/* project detail panel 안에 첨부 표시 */
.pd-attachments {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pd-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-doc);
  padding: 4px 0;
}
.pd-attach-item a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.pd-attach-item a:hover { text-decoration: underline; }
.pd-attach-item .pd-attach-size {
  color: var(--text-muted);
  font-size: 10px;
}
.dash-examples {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.dash-ex-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
}
.dash-examples .example-chip { font-size: 10.5px; padding: 3px 9px; }

.dash-top-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(60px, 1fr));
  gap: 8px;
  align-items: stretch;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0 18px;
}
.dash-stat {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 64px;
}
.dash-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.dash-stat-lbl {
  font-size: 9.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.dash-info .dash-stat-num    { color: var(--info); }
.dash-success .dash-stat-num { color: var(--success); }
.dash-warning .dash-stat-num { color: var(--danger); }

.dash-top-active {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-height: 110px;
}
.dash-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-task-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  min-height: 0;
}
.dash-task {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--bg-elev-2);
  transition: all 0.15s;
}
.dash-task:hover { border-color: var(--border-strong); background: var(--bg-elev-3); }
.dash-task .dash-task-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
}
.dash-task .dash-task-dot[data-status="planning"] { background: var(--warning); }
.dash-task .dash-task-dot[data-status="routing"]  { background: var(--accent); }
.dash-task .dash-task-dot[data-status="assigned"] { background: var(--info); }
.dash-task .dash-task-dot[data-status="dev"]      { background: var(--floor-dev); }
.dash-task .dash-task-dot[data-status="ops"]      { background: #ec4899; }
.dash-task .dash-task-dot[data-status="done"]     { background: var(--success); }
.dash-task .dash-task-dot[data-status="blocked"]  { background: var(--danger); }
.dash-task-goal {
  font-size: 11px;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-task-stage {
  font-size: 9.5px;
  color: var(--text-muted);
}

/* PMO 칩 — 부모(진행률) / 자식(연결 표시) */
.pmo-progress-chip {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(126, 96, 191, 0.18);
  color: #c8b3ff;
  font-size: 9.5px;
  font-weight: 600;
  vertical-align: middle;
}
.pmo-child-chip {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(91, 143, 249, 0.14);
  color: #9bb8fa;
  font-size: 9.5px;
  vertical-align: middle;
}

/* ============================================================
   CENTER MAIN — 지도식 zoom/pan 캔버스
   ============================================================ */
.home-center {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  position: relative;
}
.home-center .zoom-canvas {
  flex: 1;
  min-height: 0;
}

/* ============================================================
   완료된 작업 — 자유 위치 (드래그 가능), zoom-content 직접 자식
   ============================================================ */
.done-tasks-bar {
  position: absolute;
  /* 기본 위치 — 지면선(827) 아래, 카드 영역과 맞춤 */
  top: 880px;
  left: 290px;
  width: 460px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
  pointer-events: none;  /* 카운트 칩만 표시 — 카드 클릭 차단 X */
}
.done-tasks-bar > * {
  pointer-events: auto;
}
/* 미니 카운트 칩 (카드 위에 미세하게) */
.done-bar-count-mini {
  position: absolute;
  top: -20px;
  left: 4px;
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.05px;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}
.done-bar-count-mini::before {
  content: "✓ ";
  color: var(--state-integration);
}
.done-bar-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.done-bar-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.done-bar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
}
.done-bar-grid::-webkit-scrollbar { width: 6px; }
.done-bar-grid::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.done-bar-empty {
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 10px 4px;
  margin: 0;
}
.done-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  user-select: none;
}
.done-card:active { cursor: grabbing; }
.done-card.dragging {
  cursor: grabbing;
  border-color: rgba(48, 209, 88, 0.6);
  box-shadow: 0 6px 22px rgba(48, 209, 88, 0.3);
  transform: translateY(-3px);
}
.done-card:hover {
  transform: translateY(-2px);
  border-color: rgba(48, 209, 88, 0.4);
  box-shadow: 0 4px 14px rgba(48, 209, 88, 0.18);
}
.done-card-icon {
  font-size: 14px;
  position: absolute;
  top: 10px;
  right: 12px;
  opacity: 0.5;
}
.done-card-goal {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.1px;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 18px;
}
.done-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.done-card-date {
  letter-spacing: -0.05px;
}
.done-card-artifacts {
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  color: var(--text-dim);
}

/* ============================================================
   완료 작업 상세 모달
   ============================================================ */
.done-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
}
.done-modal.hidden { display: none; }
.done-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.done-modal-panel {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  animation: doneModalIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes doneModalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.done-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.done-modal-titles { min-width: 0; flex: 1; }
.done-modal-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.4;
}
.done-modal-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.done-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.done-modal-close:hover { color: var(--text); }
.done-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.done-modal-section h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.done-modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

/* 타임라인 */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: baseline;
  font-size: 12px;
}
.timeline-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
}
.timeline-event {
  color: var(--text);
}
.timeline-event .event-type {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  font-family: "SF Mono", Menlo, monospace;
}

/* 가운데 아래 floating 입력 바 — textarea 2~3줄 */
.bottom-input-bar {
  flex-shrink: 0;
  padding: 14px 24px 18px;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 30%);
  position: relative;
  z-index: 30;
}
.bot-input-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 14px 14px 14px 20px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
.bot-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 127, 255, 0.15), 0 6px 24px rgba(0, 0, 0, 0.4);
}
.bot-input-wrap textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: -0.1px;
  outline: none;
  resize: none;
  min-height: 64px;       /* 더 큰 입력 영역 */
  max-height: 160px;
  line-height: 1.55;
  padding: 8px 0;
  width: 100%;
}
.bot-input-wrap textarea::placeholder { color: var(--text-muted); }
.bot-input-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.bot-input-actions .attach-btn {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 14px;
  transition: all 0.15s;
}
.bot-input-actions .attach-btn:hover {
  background: var(--bg-elev-3);
  color: var(--text);
  border-color: var(--border-strong);
}
.bot-input-actions .primary-btn {
  padding: 9px 18px;
  font-size: 13px;
}
.zoom-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0) 0 0/24px 24px,
    var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.zoom-canvas.grabbing { cursor: grabbing; }
.zoom-content {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  display: grid;
  /* 2개 column: [left-zone(panel+building 묶음)] [middle-column] — left-zone 자체가 flex로 panel+building stretch */
  grid-template-columns: auto auto;
  gap: 120px;
  padding: 30px 30px 30px 0;
  align-items: start;
  will-change: transform;
  transition: grid-template-columns 0.25s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}
.zoom-content.with-docs,
.zoom-content.with-detail {
  grid-template-columns: auto auto 420px;
}

/* left-zone — 데이터센터 + 빌딩을 flex로 묶음 (stretch로 같은 height 자동) */
.left-zone {
  display: flex;
  flex-direction: row;
  align-items: stretch;  /* 핵심: 두 박스 같은 height 자동 */
  gap: 120px;
  flex-shrink: 0;
}

/* ============================================================
   연동 대시보드 — 외곽 박스 1개 + 그 안에 일정 크기 카드들
   ============================================================ */
/* 검색 API 빌딩 — 데이터센터와 동일 스타일 (Marketing Researcher 용) */
.search-apis-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 3px solid rgba(191, 90, 242, 0.45);  /* 5F Marketing 보라 */
  border-radius: 18px;
  padding: 18px 16px 20px;
  box-shadow:
    0 0 0 1px rgba(191, 90, 242, 0.10),
    0 8px 32px rgba(0, 0, 0, 0.5);
  transform: translateX(-90px);
  position: relative;
  width: 380px;  /* 2-column 카드 grid 들어가도록 폭 늘림 */
  flex-shrink: 0;
  align-self: flex-end;
  gap: 10px;
  box-sizing: border-box;
}
/* 검색 API 카드들 — 2 column grid로 배치해서 높이 절반 */
.search-apis-panel .int-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.search-apis-panel .int-card {
  padding: 10px 12px;
  gap: 5px;
  min-width: 0;  /* grid item이 컨텐츠 폭에 갇히지 않게 */
}
.search-apis-panel .int-card-name {
  font-size: 12.5px;
}
.search-apis-panel .int-card-meta {
  font-size: 10.5px;
}
/* 검색 API → 5F 점선은 JS connector SVG가 그림 (renderConnectorLines).
   CSS ::before는 비활성 처리하되, has-active 시 단순 dot만 유지하는 ::after는 SVG에서도 그리니까 함께 비활성. */
.search-apis-panel.has-active::before { content: none; }
.search-apis-panel.has-active::after { content: none; }

/* ===== 6F Design API 빌딩 — 검색랩 왼쪽, 그린 톤 ===== */
.design-apis-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 3px solid rgba(48, 209, 88, 0.45);  /* 6F Design 그린 */
  border-radius: 18px;
  padding: 18px 16px 20px;
  box-shadow:
    0 0 0 1px rgba(48, 209, 88, 0.10),
    0 8px 32px rgba(0, 0, 0, 0.5);
  transform: translateX(-90px);
  position: relative;
  width: 380px;
  flex-shrink: 0;
  align-self: flex-end;
  gap: 10px;
  box-sizing: border-box;
}
.design-apis-panel .int-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.design-apis-panel .int-card {
  padding: 10px 12px;
  gap: 5px;
  min-width: 0;
}
.design-apis-panel .int-card-name { font-size: 12.5px; }
.design-apis-panel .int-card-meta { font-size: 10.5px; }
.design-apis-panel.has-active::before { content: none; }
.design-apis-panel.has-active::after { content: none; }

.integrations-panel {
  display: flex;
  flex-direction: column;
  /* 외곽 박스: 빌딩과 같은 위계 — 두꺼운 흰 border + 콤팩트 padding */
  background: var(--bg-elev);
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  padding: 20px 20px 24px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.5);
  transform: translateX(-90px);
  position: relative;
  width: 290px;
  flex-shrink: 0;
  /* 자연 height + 하단 정렬 — building 하단(=지면선)에 panel 하단 자동 일치 */
  align-self: flex-end;
  gap: 10px;
  box-sizing: border-box;
}

/* 통합 → 4F 점선도 JS connector SVG가 그림 */
.integrations-panel.has-active::before { content: none; }
.integrations-panel.has-active::after { content: none; }

/* JS SVG connector — viewport fixed overlay (transform/zoom 영향 안 받게)
   2026-06-19: stroke-width 0.8 + opacity 0.5 + z-index 3 (캔버스 위 침범 noise 감소) */
.connector-svg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
  opacity: 0.5;
}
.connector-svg path {
  fill: none;
  stroke-width: 0.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 6;
  animation: connectorDashFlow 1.8s linear infinite;
}
@keyframes connectorDashFlow {
  to { stroke-dashoffset: -10; }
}
.connector-svg circle {
  animation: connectorDotPulse 2.4s ease-in-out infinite;
}
@keyframes connectorDotPulse {
  0%, 100% { r: 2; opacity: 0.7; }
  50% { r: 3; opacity: 0.5; }
}
.int-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* 자연 size — 카드 사이 분산 안 함 (panel align-self: flex-start로 자체 자연 height) */
}
/* 각 카드 — 일정 크기, 클릭마다 변동 없음 */
.int-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.int-card.active {
  background: linear-gradient(180deg, rgba(48, 209, 88, 0.14), rgba(48, 209, 88, 0.04));
  border-color: rgba(48, 209, 88, 0.55);
  box-shadow: 0 4px 18px rgba(48, 209, 88, 0.18), 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* 카드 개별 점선/dot 제거 — 통합 점선은 .integrations-panel.has-active 에서 처리 */
@keyframes cable-flow {
  from { background-position: 0 0; }
  to   { background-position: 28px 0; }
}
@keyframes cable-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.18), 0 0 16px rgba(48, 209, 88, 0.8); }
  50%      { box-shadow: 0 0 0 6px rgba(48, 209, 88, 0.25), 0 0 24px rgba(48, 209, 88, 1); }
}
.int-card.coming-soon {
  opacity: 0.55;
  background: var(--bg-elev);
}
.int-card.coming-soon:hover {
  opacity: 0.75;
}
.int-card.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(48, 209, 88, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.int-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.int-card-icon {
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}
.int-card.active .int-card-icon {
  background: rgba(48, 209, 88, 0.2);
}
.int-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.int-card-status {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: -0.05px;
  white-space: nowrap;
}
.int-card.active .int-card-status {
  background: var(--success);
  color: #062a14;
}
.int-card.coming-soon .int-card-status {
  background: var(--bg-elev-3);
  color: var(--text-muted);
}
.int-card-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.55;
  letter-spacing: -0.05px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.int-card-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.int-card-stat strong {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.2px;
}
/* "+ 새 연동 요청" 버튼 */
.int-add-btn {
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--text-muted);
  padding: 12px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: -0.1px;
  margin-top: 4px;
}
.int-add-btn:hover {
  background: var(--bg-elev);
  color: var(--text-dim);
  border-color: var(--accent);
  border-style: solid;
}
.docs-panel {
  display: none;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  flex-direction: column;
  gap: 10px;
  width: 400px;
  min-height: 0;
  max-height: 80vh;
  position: relative;
}
/* docs-panel::before / ::after 제거 — member-connector div 사용 (JS가 위치 직접) */

/* 팀원 카드 → docs panel 연결선 — JS가 left/top/width 직접 inline 설정 */
.member-connector {
  position: absolute;
  height: 1px;
  background: repeating-linear-gradient(90deg,
    var(--accent) 0,
    var(--accent) 5px,
    transparent 5px,
    transparent 10px);
  pointer-events: none;
  z-index: 50;
  opacity: 0.75;
  filter: drop-shadow(0 0 2px var(--accent));
}
.member-connector::before,
.member-connector::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  top: -1.5px;
  box-shadow: 0 0 4px var(--accent);
}
.member-connector::before { left: -2px; }
.member-connector::after  { right: -2px; }

/* ============================================================
   PROJECT DETAIL PANEL — 프로젝트 클릭 시 진행상황 + 팀별 문서
   ============================================================ */
.project-detail-panel {
  display: none;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  flex-direction: column;
  gap: 14px;
  width: 420px;
  min-height: 0;
  max-height: 85vh;
  position: relative;
  /* overflow visible — ::before 연결선이 잘리지 않도록 */
}
/* 내부 스크롤 영역 (헤더 제외 본문) */
.pd-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.zoom-content.with-detail .project-detail-panel {
  display: flex;
}
/* 프로젝트(클릭) → 디테일 패널 연결선 (점선) */
.zoom-content.with-detail .project-detail-panel::before {
  content: "";
  position: absolute;
  left: -70px;
  top: 24px;
  width: 70px;
  height: 0;
  border-top: 2px dotted var(--accent);
  pointer-events: none;
  opacity: 0.85;
}
/* 헤더 */
.pd-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.pd-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pd-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.pd-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  margin-left: 8px;
  flex-shrink: 0;
}
.pd-close:hover { color: var(--text); }

/* 섹션 (진행상황 / 문서) */
.pd-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* 진행 스텝 */
.pd-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pd-step {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.pd-step-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-elev-2);
  border: 1.5px solid var(--text-muted);
  color: var(--text-muted);
}
.pd-step.done .pd-step-icon {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg);
}
.pd-step.current .pd-step-icon {
  background: var(--warning);
  border-color: var(--warning);
  color: var(--bg);
}
.pd-step.done .pd-step-label  { color: var(--text); }
.pd-step.current .pd-step-label {
  color: var(--text);
  font-weight: 600;
}
.pd-step.current {
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.35);
  animation: inbox-pulse 2.5s ease-in-out infinite;
}
.pd-step-state {
  font-size: 10px;
  color: var(--text-muted);
}
.pd-step.done .pd-step-state    { color: var(--success); }
.pd-step.current .pd-step-state { color: var(--warning); }

/* Triage가 건너뛴 단계 */
.pd-step.skipped {
  opacity: 0.55;
  background: transparent;
  border-style: dashed;
}
.pd-step.skipped .pd-step-icon {
  background: transparent;
  border-color: var(--text-muted);
  color: var(--text-muted);
}
.pd-step.skipped .pd-step-label {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}
.pd-step.skipped .pd-step-state {
  color: var(--text-muted);
  font-style: italic;
}

/* 팀별 문서 그룹 */
.pd-docs-group {
  margin-bottom: 10px;
}
.pd-docs-group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px dashed var(--border);
  margin-bottom: 4px;
}
.pd-docs-group-count {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 600;
}
.pd-docs-group-empty {
  font-size: 10.5px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}
.pd-doc-item {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  margin: 4px 0;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.pd-doc-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}
.pd-doc-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
}
.pd-doc-time {
  font-size: 10px;
  color: var(--text-muted);
}
.zoom-content.with-docs .docs-panel {
  display: flex;
}
.docs-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.docs-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.docs-panel-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.docs-panel-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.docs-panel-close:hover { color: var(--text); }
.docs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.doc-item {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.doc-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}
.doc-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.doc-item-meta {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}
.doc-item-task {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.docs-empty {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
  padding: 16px 4px;
  text-align: center;
}

/* 프로젝트 picker (팀원이 처리한 task들) */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.project-item {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.project-item:hover {
  border-color: var(--accent);
  background: var(--bg-elev-3);
  transform: translateX(2px);
}
.project-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.project-dot[data-status="queued"]   { background: var(--info); }
.project-dot[data-status="planning"] { background: var(--warning); }
.project-dot[data-status="routing"]  { background: var(--accent); }
.project-dot[data-status="assigned"] { background: var(--info); }
.project-dot[data-status="dev"]      { background: var(--floor-dev); }
.project-dot[data-status="ops"]      { background: #ec4899; }
.project-dot[data-status="done"]     { background: var(--success); }
.project-dot[data-status="blocked"]  { background: var(--danger); }
.project-body { min-width: 0; }
.project-goal {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.project-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.project-status {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-elev);
}
.project-status[data-status="planning"] { color: var(--warning); }
.project-status[data-status="routing"]  { color: var(--accent); }
.project-status[data-status="assigned"] { color: var(--info); }
.project-status[data-status="dev"]      { color: var(--floor-dev); }
.project-status[data-status="ops"]      { color: #ec4899; }
.project-status[data-status="done"]     { color: var(--success); }
.project-status[data-status="blocked"]  { color: var(--danger); }
.project-arrow {
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
}
.project-item:hover .project-arrow { color: var(--accent); }

/* docs 헤더 라인 (← 뒤로 + 타이틀) */
.docs-panel-headline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.docs-back {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 26px; height: 26px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.docs-back:hover { background: var(--bg-elev-3); color: var(--text); border-color: var(--border-strong); }

/* doc-item 좀 더 크게/가시성 ↑ */
.doc-item {
  padding: 12px 14px;
}
.doc-item-label {
  font-size: 13px;
}
.team-card { cursor: pointer; }
/* sub-search agent 카드 — Lead Researcher 아래 들여쓰기 + 작은 스타일 */
.team-card-sub {
  margin-left: 24px;
  padding: 8px 10px;
  font-size: 12px;
}
.team-card-sub .tc-avatar { width: 22px; height: 22px; font-size: 11px; }
.team-card-sub .tc-name { font-size: 12px; }
.team-card-sub .tc-role { font-size: 10.5px; }
.team-card-sub .tc-status { font-size: 9.5px; padding: 1px 5px; }
.team-card.member-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.zoom-controls {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
  align-items: center;
}
.zoom-btn {
  width: 34px; height: 34px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.15s;
  padding: 0;
  line-height: 1;
}
.zoom-btn:hover { background: var(--bg-elev-2); }
.zoom-btn:active { background: var(--accent); color: white; }
.zoom-level {
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}
.zoom-hint {
  position: absolute;
  bottom: 14px;
  left: 14px;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 9px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 5;
}

.building-tall {
  display: flex;
  flex-direction: column;
  gap: 10px;  /* 7층으로 늘어서 약간 좁힘 */
  width: 460px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  padding: 24px 24px 30px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 2px 10px rgba(255, 255, 255, 0.05);
}

/* 빌딩 옥상 brand — 2026-06-22 사용자 요청, 깔끔하게 이름만 */
.building-brand {
  position: absolute;
  top: -36px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  user-select: none;
}

/* 빌딩 옥상 — 가로 띠 + 입체 하이라이트 */
.building-tall::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 30px;
  right: 30px;
  height: 5px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.06) 100%);
  border-radius: 3px 3px 0 0;
  pointer-events: none;
}
/* 바닥 지면선 — 빌딩 외곽 박스 padding 안쪽 + 가로로 매우 길게 */
.building-tall::after {
  content: "";
  position: absolute;
  left: -2500px;
  right: -2500px;
  bottom: -15px;  /* 박스 외곽 하단 바로 아래 — 박스 border가 지면선 위에 위치 */
  height: 2.5px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.10) 4%,
    rgba(255, 255, 255, 0.4) 25%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.4) 75%,
    rgba(255, 255, 255, 0.10) 96%,
    transparent 100%);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 0;
  border-radius: 2px;
}
.bld-floor {
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 18px 30px 18px 50px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  min-height: 140px;
  position: relative;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  outline: none;
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1;
}
/* 좌측 상태 띠 — 대기: 흰색 톤 */
.bld-floor::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 10px;
  background: rgba(255, 255, 255, 0.55);
  opacity: 1;
  transition: background 0.25s, opacity 0.25s, box-shadow 0.25s;
  border-radius: 14px 0 0 14px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

/* ===== 클릭(active)일 때만 — 각 층 정체성 색 ===== */
.bld-floor[data-floor="1"].active {
  background: linear-gradient(180deg, rgba(124, 127, 255, 0.22), rgba(124, 127, 255, 0.06));
  border-color: rgba(124, 127, 255, 0.55);
  box-shadow: 0 4px 22px rgba(124, 127, 255, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor[data-floor="1"].active::before { background: var(--floor-1); box-shadow: 0 0 18px rgba(124, 127, 255, 0.7); }
.bld-floor[data-floor="1"].active .bld-num { color: var(--floor-1); }

.bld-floor[data-floor="2"].active {
  background: linear-gradient(180deg, rgba(255, 55, 95, 0.22), rgba(255, 55, 95, 0.06));
  border-color: rgba(255, 55, 95, 0.55);
  box-shadow: 0 4px 22px rgba(255, 55, 95, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor[data-floor="2"].active::before { background: var(--floor-2); box-shadow: 0 0 18px rgba(255, 55, 95, 0.7); }
.bld-floor[data-floor="2"].active .bld-num { color: var(--floor-2); }

.bld-floor[data-floor="3"].active {
  background: linear-gradient(180deg, rgba(90, 200, 250, 0.22), rgba(90, 200, 250, 0.06));
  border-color: rgba(90, 200, 250, 0.55);
  box-shadow: 0 4px 22px rgba(90, 200, 250, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor[data-floor="3"].active::before { background: var(--floor-3); box-shadow: 0 0 18px rgba(90, 200, 250, 0.7); }
.bld-floor[data-floor="3"].active .bld-num { color: var(--floor-3); }

.bld-floor[data-floor="4"].active {
  background: linear-gradient(180deg, rgba(255, 159, 10, 0.22), rgba(255, 159, 10, 0.06));
  border-color: rgba(255, 159, 10, 0.55);
  box-shadow: 0 4px 22px rgba(255, 159, 10, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor[data-floor="4"].active::before { background: var(--floor-4); box-shadow: 0 0 18px rgba(255, 159, 10, 0.7); }
.bld-floor[data-floor="4"].active .bld-num { color: var(--floor-4); }

.bld-floor[data-floor="5"].active {
  background: linear-gradient(180deg, rgba(191, 90, 242, 0.22), rgba(191, 90, 242, 0.06));
  border-color: rgba(191, 90, 242, 0.55);
  box-shadow: 0 4px 22px rgba(191, 90, 242, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor[data-floor="5"].active::before { background: var(--floor-5); box-shadow: 0 0 18px rgba(191, 90, 242, 0.7); }
.bld-floor[data-floor="5"].active .bld-num { color: var(--floor-5); }

.bld-floor[data-floor="6"].active {
  background: linear-gradient(180deg, rgba(232, 116, 76, 0.22), rgba(232, 116, 76, 0.06));
  border-color: rgba(232, 116, 76, 0.55);
  box-shadow: 0 4px 22px rgba(232, 116, 76, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor[data-floor="6"].active::before { background: var(--floor-6); box-shadow: 0 0 18px rgba(232, 116, 76, 0.7); }
.bld-floor[data-floor="6"].active .bld-num { color: var(--floor-6); }

.bld-floor[data-floor="7"].active {
  background: linear-gradient(180deg, rgba(58, 128, 115, 0.22), rgba(58, 128, 115, 0.06));
  border-color: rgba(58, 128, 115, 0.55);
  box-shadow: 0 4px 22px rgba(58, 128, 115, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor[data-floor="7"].active::before { background: var(--floor-7); box-shadow: 0 0 18px rgba(58, 128, 115, 0.7); }
.bld-floor[data-floor="7"].active .bld-num { color: var(--floor-7); }

.bld-floor:hover {
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateX(2px);
  box-shadow: 0 4px 22px rgba(255, 255, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.35);
}
/* ===== 상태별 빌딩 — 연동 active 톤과 통일 ===== */
/* 진행 중 (running) — 노랑 */
.bld-floor.has-running {
  background: linear-gradient(180deg, rgba(255, 214, 10, 0.18), rgba(255, 214, 10, 0.05));
  border-color: rgba(255, 214, 10, 0.5);
  box-shadow: 0 4px 18px rgba(255, 214, 10, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor.has-running::before {
  background: var(--state-running);
  opacity: 1;
  box-shadow: 0 0 16px rgba(255, 214, 10, 0.55);
}
.bld-floor.has-running .bld-stat {
  color: var(--state-running);
  border-color: rgba(255, 214, 10, 0.4);
  background: rgba(255, 214, 10, 0.10);
}

/* ★ P0-2 Quota chip — 헤더 사용자 chip 옆 (2026-06-22) */
.user-quota {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-left: 6px;
  color: var(--text-muted);
  cursor: default;
}
.user-quota span { display: inline-flex; gap: 2px; align-items: center; }
.user-quota .quota-warn { color: #ff9f0a; }
.user-quota .quota-admin {
  color: #a78bfa; font-weight: 700; letter-spacing: 0.3px;
}
.user-quota .quota-loading { opacity: 0.5; }

/* ★ PMO 자식 chip (사이드바 + done card) + drawer 자식 list (2026-06-22) */
.sb-1f-pmo-chip,
.done-card-pmo-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9px;
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.35);
  margin-left: 4px;
  letter-spacing: 0.2px;
}
.done-card-pmo-chip {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
}
.drawer-pmo-children {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.drawer-pmo-child {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: background 0.12s, border-color 0.12s;
  cursor: pointer;
}
.drawer-pmo-child:hover {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.35);
}

/* ★ 업체 견적서 drag-drop 영역 (2026-06-22) */
.vendor-quote-drop {
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: rgba(255,255,255,0.02);
  margin: 12px 0;
}
.vendor-quote-drop:hover,
.vendor-quote-drop.drag-over {
  background: rgba(76, 144, 255, 0.08);
  border-color: rgba(76, 144, 255, 0.55);
}
.vqd-icon { font-size: 32px; margin-bottom: 6px; }
.vqd-text {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 4px;
}
.vqd-sub { font-size: 11px; color: var(--text-muted); }
.vendor-quote-file-list {
  display: flex; flex-direction: column; gap: 6px;
  margin: 8px 0 12px;
  max-height: 200px; overflow-y: auto;
}
.vqfl-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elev-2, #242427);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  font-size: 12px;
}
.vqfl-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vqfl-size { color: var(--text-muted); font-size: 10.5px; }
.vqfl-remove {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px; padding: 0 4px;
}
.vqfl-remove:hover { color: #ff453a; }

/* ★ 예약 인스타 게시 카드 (2026-06-22) — 자유 위치, 보라 톤 */
.sched-card {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.14), rgba(167, 139, 250, 0.04));
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 11.5px;
  user-select: none;
  cursor: default;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.sched-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.25);
  border-color: rgba(167, 139, 250, 0.55);
}
.sched-card-hd {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; color: rgba(167, 139, 250, 0.95);
  margin-bottom: 4px;
}
.sched-card-icon { font-size: 12px; }
.sched-card-when { font-weight: 700; color: #d8b4fe; }
.sched-card-status {
  margin-left: auto; font-size: 9.5px;
  padding: 1px 6px; border-radius: 999px;
  background: rgba(167, 139, 250, 0.15);
  color: #d8b4fe;
}
.sched-card-title {
  font-size: 11.5px; color: var(--text); font-weight: 600;
  margin: 2px 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sched-card-meta {
  display: flex; gap: 10px;
  font-size: 10px; color: var(--text-muted);
}
.sched-card-meta a {
  color: #a78bfa; text-decoration: none;
  margin-left: auto;
}
.sched-card-meta a:hover { text-decoration: underline; }
/* 상태별 색상 — pending(보라), posted(녹), failed(빨), cancelled(회) */
.sched-card.sched-status-posted { border-color: rgba(74, 222, 128, 0.45); }
.sched-card.sched-status-posted .sched-card-when,
.sched-card.sched-status-posted .sched-card-status { color: #6ee7b7; background: rgba(74, 222, 128, 0.12); }
.sched-card.sched-status-failed { border-color: rgba(248, 113, 113, 0.5); }
.sched-card.sched-status-failed .sched-card-when,
.sched-card.sched-status-failed .sched-card-status { color: #fca5a5; background: rgba(248, 113, 113, 0.12); }
.sched-card.sched-status-cancelled { opacity: 0.55; }

/* ★ 카페 창업 기획서 입력 폼 모달 (2026-06-22) */
.cafe-startup-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.cafe-startup-modal[hidden] { display: none; }
.cafe-startup-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.cafe-startup-modal-body {
  position: relative; z-index: 1;
  width: 560px; max-width: 90vw;
  max-height: 88vh; overflow: auto;
  background: var(--bg-elev, #1a1a1f);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 22px 26px 24px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
}
.cafe-startup-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 0 6px;
}
.cafe-startup-modal-header h3 {
  font-size: 18px; color: var(--text); margin: 0;
}
.cafe-startup-modal-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 20px;
  cursor: pointer; padding: 4px 8px;
}
.cafe-startup-modal-close:hover { color: var(--text); }
.cafe-startup-modal-sub {
  font-size: 12.5px; color: var(--text-doc);
  margin: 0 0 16px; line-height: 1.55;
}
.cafe-startup-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.csf-field {
  display: flex; flex-direction: column; gap: 4px;
}
.csf-field-full { grid-column: 1 / -1; }
.csf-label {
  font-size: 11.5px; color: var(--text-doc); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.csf-req {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a; font-size: 9.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px;
  font-style: normal; letter-spacing: 0.3px;
}
.csf-field input,
.csf-field select,
.csf-field textarea {
  background: var(--bg-elev-2, #242427);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px; color: var(--text);
  font-family: inherit;
}
.csf-field input:focus,
.csf-field select:focus,
.csf-field textarea:focus {
  outline: none;
  border-color: rgba(76, 144, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(76, 144, 255, 0.15);
}
.csf-actions {
  grid-column: 1 / -1;
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 8px;
}
.csf-actions .cancel-btn {
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-doc);
  padding: 8px 16px; border-radius: 6px; cursor: pointer;
}
.csf-actions .cancel-btn:hover { background: rgba(255,255,255,0.05); }

/* 사용자 결재/응답 대기 (파란 펄스) — 클릭 유도용. 1F에 주로 적용 */
/* 2026-06-22: 옛 has-running으로 통합돼 있던 결재 파란 펄스 분리 복원 */
.bld-floor.has-user-attention {
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.22), rgba(0, 122, 255, 0.05));
  border-color: rgba(0, 122, 255, 0.6);
  box-shadow: 0 4px 22px rgba(0, 122, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: bldPulseBlue 1.4s ease-in-out infinite;
}
.bld-floor.has-user-attention::before {
  background: #007aff;
  opacity: 1;
  box-shadow: 0 0 18px rgba(0, 122, 255, 0.7);
}
.bld-floor.has-user-attention .bld-stat {
  color: #4ea3ff;
  border-color: rgba(0, 122, 255, 0.5);
  background: rgba(0, 122, 255, 0.15);
}
@keyframes bldPulseBlue {
  0%, 100% { box-shadow: 0 4px 22px rgba(0, 122, 255, 0.35), 0 0 0 0 rgba(0, 122, 255, 0); }
  50%      { box-shadow: 0 4px 28px rgba(0, 122, 255, 0.55), 0 0 0 6px rgba(0, 122, 255, 0.12); }
}

/* 정지 (blocked) — 빨강 */
.bld-floor.has-blocked-tasks {
  background: linear-gradient(180deg, rgba(255, 69, 58, 0.18), rgba(255, 69, 58, 0.05));
  border-color: rgba(255, 69, 58, 0.5);
  box-shadow: 0 4px 18px rgba(255, 69, 58, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor.has-blocked-tasks::before {
  background: var(--state-blocked);
  opacity: 1;
  box-shadow: 0 0 16px rgba(255, 69, 58, 0.55);
}
.bld-floor.has-blocked-tasks .bld-stat {
  color: var(--state-blocked);
  border-color: rgba(255, 69, 58, 0.4);
  background: rgba(255, 69, 58, 0.10);
}

/* 결재 대기 (review) — 파랑 (이전 인디고에서 변경) */
/* has-pending 규칙은 아래 1820라인 근처에서 재정의됨 — 색만 통일 */

/* 완료 (has-done) — 대기 톤 (사용자 룰: 완료는 대기로 회수) */
.bld-floor.has-done::before { background: var(--state-idle); opacity: 0.45; }
.bld-floor.has-done .bld-stat {
  color: var(--text-dim);
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}

/* active 공통 스타일은 위 [data-floor="N"].active 각 층별로 정의됨 */

.bld-num {
  font-size: 76px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 110px;
  line-height: 1;
  white-space: nowrap;
}
.bld-name {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.bld-tag, .bld-stat {
  font-size: 13px;
  background: var(--bg);
  padding: 7px 14px;
  border-radius: 14px;
  color: var(--text-dim);
  font-weight: 600;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}
/* has-running 색상 처리는 ::before 띠 + .bld-stat 규칙으로 통합 */

/* ============================================================
   MIDDLE COLUMN — 팀 패널 + 진행중 프로젝트 패널 (수직 스택)
   ============================================================ */
.middle-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* team-panel + decision callout 가로 배치 wrap */
.team-panel-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 28px;  /* 점선 connector 공간 */
  /* col 3가 auto일 때 자식들이 shrink 되지 않게 — team-panel 540px 보장 */
  flex-shrink: 0;
  width: max-content;
}
.team-panel-row > .team-panel { flex-shrink: 0; }
.team-panel-row > .decision-callout { flex-shrink: 0; }

/* ============================================================
   DECISION CALLOUT — team panel 옆에 떠있는 결재/halt 카드
   ============================================================ */
.decision-callout {
  /* 두 panel을 가로로 묶는 transparent wrapper — 각 panel은 자기 컨텐츠 크기 */
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 28px;
  max-height: 88vh;
  position: relative;
  flex-shrink: 0;
  animation: calloutSlideIn 0.28s ease-out;
}
.decision-callout[hidden] { display: none !important; }

/* 분리된 두 panel — list panel(좌) + detail panel(우) */
.callout-list-panel,
.callout-detail-panel {
  background: linear-gradient(160deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 6px 24px rgba(120, 110, 220, 0.18);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.callout-list-panel { flex: 0 0 220px; position: relative; }
/* detail panel — 컨텐츠 사이즈에 따라 유동적 (min 540px, max 820px) */
.callout-detail-panel {
  flex: 1 1 auto;
  min-width: 540px;
  max-width: 820px;
  max-height: 88vh;
  position: relative;
}

/* list panel → detail panel 사이 점선 connector (gap 28px 안에 그림) */
.callout-detail-panel::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 36px;
  width: 28px;
  height: 1px;
  border-top: 2px dashed var(--accent);
  opacity: 0.7;
}
.callout-detail-panel::after {
  content: '';
  position: absolute;
  left: -32px;
  top: 32px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.decision-callout.callout-halt .callout-detail-panel::before { border-top-color: #f87171; }
.decision-callout.callout-halt .callout-detail-panel::after { background: #f87171; box-shadow: 0 0 8px #f87171; }
.decision-callout.callout-approval .callout-detail-panel::before { border-top-color: #fbbf24; }
.decision-callout.callout-approval .callout-detail-panel::after { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }

/* halt/approval — 두 panel 모두 같은 색 */
.decision-callout.callout-halt .callout-list-panel,
.decision-callout.callout-halt .callout-detail-panel {
  border-color: #f87171;
  box-shadow: 0 6px 24px rgba(248, 113, 113, 0.22);
}
.decision-callout.callout-approval .callout-list-panel,
.decision-callout.callout-approval .callout-detail-panel {
  border-color: #fbbf24;
  box-shadow: 0 6px 24px rgba(251, 191, 36, 0.20);
}
.decision-callout.callout-active .callout-list-panel::before {
  content: '';
  position: absolute;
  top: 24px;
  left: -1px;
  width: 3px;
  height: 36px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px var(--accent);
  animation: pulseStripe 1.6s ease-in-out infinite;
}
.decision-callout.callout-halt.callout-active .callout-list-panel::before { background: #f87171; box-shadow: 0 0 12px #f87171; }
.decision-callout.callout-approval.callout-active .callout-list-panel::before { background: #fbbf24; box-shadow: 0 0 12px #fbbf24; }

/* 점선 connector — team-panel 우측 → callout 좌측 */
.callout-connector {
  position: absolute;
  left: -28px;
  top: 36px;
  width: 28px;
  height: 1px;
  border-top: 2px dashed var(--accent);
  opacity: 0.7;
}
.callout-connector::before,
.callout-connector::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  top: -4px;
  box-shadow: 0 0 8px var(--accent);
}
.callout-connector::before { left: -4px; }
.callout-connector::after  { right: -4px; }
.callout-halt .callout-connector { border-top-color: #f87171; }
.callout-halt .callout-connector::before,
.callout-halt .callout-connector::after { background: #f87171; box-shadow: 0 0 8px #f87171; }
.callout-approval .callout-connector { border-top-color: #fbbf24; }
.callout-approval .callout-connector::before,
.callout-approval .callout-connector::after { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }

.callout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.callout-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.callout-count {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}
.callout-halt .callout-count { background: #f87171; }
.callout-approval .callout-count { background: #fbbf24; color: #1a1a1a; }

.callout-attachments {
  margin-bottom: 8px;
}
.callout-attachments:empty {
  margin-bottom: 0;
}

.callout-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.callout-body .inbox-card {
  background: var(--bg);
}

@keyframes calloutSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulseStripe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* 좁은 화면에서는 세로로 떨어짐 */
@media (max-width: 1280px) {
  .team-panel-row { flex-direction: column; gap: 16px; }
  .callout-connector { display: none; }
  .decision-callout { width: 100%; max-width: 540px; }
}

/* ============================================================
   TEAM PANEL — 우측 정리된 그리드 (zoom 캔버스 내부)
   ============================================================ */
.team-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 540px;
  padding: 18px 20px;
  /* 연동 active 카드 톤 — 통일 */
  background: linear-gradient(160deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  position: relative;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   PROJECTS PANEL — 진행 중 프로젝트 리스트 (팀 패널 아래)
   ============================================================ */
.projects-panel {
  background: linear-gradient(160deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 18px 20px;
  width: 540px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}
/* 팀 패널 없을 때 1F와 연결선 */
.projects-panel.standalone::before {
  content: "";
  position: absolute;
  left: -62px;
  top: 24px;
  width: 56px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  pointer-events: none;
}
.projects-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.projects-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.projects-panel-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 360px;
  overflow-y: auto;
}
.projects-list .project-item {
  background: var(--bg-elev-2);
}
.projects-empty {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
  padding: 16px 4px;
  text-align: center;
}
/* 빌딩(active 층) → 팀 패널 연결선 — 흐름 애니메이션 + 글로우 */
.team-panel::before {
  content: "";
  position: absolute;
  left: -120px;
  top: 30px;
  width: 120px;
  height: 3px;
  background:
    repeating-linear-gradient(90deg,
      rgba(124, 127, 255, 0.85) 0,
      rgba(124, 127, 255, 0.85) 10px,
      transparent 10px,
      transparent 18px);
  filter: drop-shadow(0 0 6px rgba(124, 127, 255, 0.55));
  pointer-events: none;
  z-index: 10;
  animation: cable-flow 1.6s linear infinite;
  border-radius: 1.5px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
/* dot은 has-pending::after와 충돌해서 생략 — 흐름 효과만으로 충분 */

/* ============================================================
   Drawer — Task 상세 모드
   ============================================================ */
.drawer-task-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.drawer-task-section:last-child { border-bottom: none; margin-bottom: 0; }
.drawer-task-section h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.drawer-task-goal {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-doc);
  letter-spacing: -0.1px;
  white-space: pre-wrap;
}

/* 산출 문서 행 */
.task-artifact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.task-artifact-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-3);
  transform: translateX(2px);
}
.task-artifact-row.drive {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.10), rgba(48, 209, 88, 0.02));
  border-color: rgba(48, 209, 88, 0.35);
}
.task-artifact-row.drive:hover {
  border-color: rgba(48, 209, 88, 0.6);
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.14), rgba(48, 209, 88, 0.04));
}
.task-artifact-icon {
  font-size: 17px;
  width: 24px;
  text-align: center;
}
.task-artifact-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-artifact-ext {
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-elev);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

/* 부서별 문서 그룹 */
.drawer-dept-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.drawer-dept-group:last-child { margin-bottom: 0; }
.drawer-dept-name {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding: 4px 2px;
  text-transform: uppercase;
}
.drawer-doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drawer-doc-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-3);
}
.drawer-doc-icon { font-size: 13px; opacity: 0.7; }
.drawer-doc-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  flex-shrink: 0;
}
.drawer-doc-sub {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-doc-content {
  font-size: 11.5px;
  color: var(--text-doc);
  padding: 10px 12px 4px;
  white-space: pre-wrap;
  line-height: 1.55;
  width: 100%;
}

/* 완료/활성 카드 통일 — status 라벨 */
.done-card-status, .sb-1f-status[data-status] {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  color: var(--text-dim);
}
.sb-1f-status[data-status="done"]    { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }
.sb-1f-status[data-status="blocked"] { background: rgba(255, 69, 58, 0.15); color: var(--state-blocked); }
.sb-1f-status[data-status="ops"],
.sb-1f-status[data-status="dev"],
.sb-1f-status[data-status="planning"],
.sb-1f-status[data-status="review_pending"] { background: rgba(255, 214, 10, 0.15); color: var(--state-running); }

/* 후속 작업 버튼 (drawer 산출 문서 섹션 끝) */
.followup-btn {
  margin-top: 12px;
  background: linear-gradient(135deg, rgba(124, 127, 255, 0.15), rgba(124, 127, 255, 0.04));
  border: 1px solid rgba(124, 127, 255, 0.4);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  font-family: inherit;
  transition: all 0.15s;
  width: 100%;
  text-align: center;
}
.followup-btn:hover {
  background: linear-gradient(135deg, rgba(124, 127, 255, 0.25), rgba(124, 127, 255, 0.08));
  border-color: rgba(124, 127, 255, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 127, 255, 0.2);
}

/* 후속 작업 chip (입력 바 위) */
.followup-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(124, 127, 255, 0.15), rgba(124, 127, 255, 0.04));
  border: 1px solid rgba(124, 127, 255, 0.4);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text);
  max-width: 900px;
  width: max-content;
  font-weight: 500;
  letter-spacing: -0.1px;
}
.followup-chip-file {
  color: var(--text-dim);
  font-size: 11.5px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}
.followup-chip-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  font-family: inherit;
}
.followup-chip-x:hover { color: var(--state-blocked); }
.bottom-input-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 진행 상황 단계 (drawer) */
.drawer-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px;
}
.drawer-step {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s;
}
.drawer-step-icon {
  font-size: 13px;
  text-align: center;
  font-weight: 700;
}
.drawer-step-label {
  font-size: 12.5px;
  color: var(--text);
  letter-spacing: -0.1px;
}
.drawer-step-state {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  color: var(--text-muted);
}
.drawer-step.done {
  background: linear-gradient(180deg, rgba(48, 209, 88, 0.10), rgba(48, 209, 88, 0.02));
  border-color: rgba(48, 209, 88, 0.35);
}
.drawer-step.done .drawer-step-icon,
.drawer-step.done .drawer-step-state { color: var(--state-integration); }
.drawer-step.done .drawer-step-state { background: rgba(48, 209, 88, 0.15); }
.drawer-step.current {
  background: linear-gradient(180deg, rgba(255, 214, 10, 0.14), rgba(255, 214, 10, 0.03));
  border-color: rgba(255, 214, 10, 0.5);
  box-shadow: 0 0 12px rgba(255, 214, 10, 0.18);
}
.drawer-step.current .drawer-step-icon { color: var(--state-running); animation: drawer-step-pulse 1.6s ease-in-out infinite; }
.drawer-step.current .drawer-step-state { background: rgba(255, 214, 10, 0.18); color: var(--state-running); }
.drawer-step.pending {
  opacity: 0.55;
}
.drawer-step.pending .drawer-step-icon { color: var(--text-muted); }
.drawer-step.skip {
  opacity: 0.4;
}
.drawer-step.skip .drawer-step-icon { color: var(--text-muted); }
@keyframes drawer-step-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* 옛 project-detail-panel — 사용 안 함, 안전하게 숨김 */
.project-detail-panel { display: none !important; }

/* drawer 하단 삭제 영역 */
.drawer-task-section.drawer-danger {
  border-top: 1px solid rgba(255, 69, 58, 0.2);
  margin-top: 22px;
  padding-top: 22px;
}
.drawer-delete-btn {
  width: 100%;
  background: rgba(255, 69, 58, 0.08);
  border: 1px solid rgba(255, 69, 58, 0.35);
  color: var(--state-blocked);
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.1px;
  font-family: inherit;
  transition: all 0.15s;
}
.drawer-delete-btn:hover {
  background: rgba(255, 69, 58, 0.18);
  border-color: rgba(255, 69, 58, 0.6);
}
.drawer-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.team-panel-header {
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.team-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.team-panel-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* 수직 조직도 — 카드 + 파이프 교대 배치 */
.team-org-vertical {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
.org-pipe {
  width: 2px;
  height: 18px;
  background: var(--border-strong);
  align-self: center;
  position: relative;
}
.org-pipe::before, .org-pipe::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  transform: translateX(-50%);
}
.org-pipe::before { top: -3px; }
.org-pipe::after { bottom: -3px; }

.team-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 14px;
  align-items: center;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.team-card:hover {
  border-color: rgba(124, 127, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
/* 진행 중 — 노랑 (룰) */
.team-card.running {
  background: linear-gradient(180deg, rgba(255, 214, 10, 0.12), rgba(255, 214, 10, 0.02));
  border-color: rgba(255, 214, 10, 0.45);
  box-shadow: 0 4px 14px rgba(255, 214, 10, 0.15);
}
/* 완료 — 대기 톤 */
.team-card.done {
  background: var(--bg-elev-2);
  border-color: var(--border);
}

/* 팀장 카드 — 다른 카드와 동일 (★ 아바타로만 구분) */
.team-card.team-leader {
  padding: 16px 20px;
}

/* ============================================================
   인라인 결재함 — 팀원 카드 사이에 삽입 (사용자 결정/승인 대기)
   ============================================================ */
.inline-inbox {
  background: linear-gradient(180deg, rgba(124, 127, 255, 0.10), rgba(124, 127, 255, 0.04));
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  position: relative;
}
/* 펄스 글로우 오버레이 — 텍스트와 분리된 레이어 */
.inline-inbox::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 13px;
  pointer-events: none;
  animation: inbox-glow 3.2s ease-in-out infinite;
}
.inline-inbox.inbox-approval {
  background: rgba(248, 113, 113, 0.04);
  border-color: var(--danger);
}
.inline-inbox.inbox-approval::after {
  animation-name: inbox-glow-approval;
}
.inline-inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(96, 165, 250, 0.25);
}
.inline-inbox.inbox-approval .inline-inbox-header {
  color: var(--danger);
  border-bottom-color: rgba(248, 113, 113, 0.25);
}
.inline-inbox-count {
  font-size: 11px;
  background: rgba(96, 165, 250, 0.15);
  padding: 3px 9px;
  border-radius: 8px;
}
.inline-inbox.inbox-approval .inline-inbox-count {
  background: rgba(248, 113, 113, 0.15);
}
.inline-inbox .inbox-card {
  margin: 0;
}
/* 안쪽 텍스트 모두 키워서 zoom 시 선명도 ↑ */
.inline-inbox .inbox-card .card-title { font-size: 14px; }
.inline-inbox .inbox-card .card-sub { font-size: 11.5px; }
.inline-inbox .qa-q { font-size: 13.5px; line-height: 1.5; }
.inline-inbox .qa-qid { font-size: 11px; }
.inline-inbox .qa-why { font-size: 12px; line-height: 1.55; margin-top: 2px; }
.inline-inbox .qa-input { font-size: 13px; padding: 9px 12px; min-height: 56px; }
.inline-inbox .primary-btn { font-size: 13px; padding: 8px 16px; }
.inline-inbox .opt-label { font-size: 13px; }
.inline-inbox .opt-meta { font-size: 12px; }
.inline-inbox .opt-meta dt { font-size: 11px; }

@keyframes inbox-glow {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(124, 127, 255, 0.4),
      0 0 22px 6px rgba(124, 127, 255, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(124, 127, 255, 0.55),
      0 0 44px 12px rgba(124, 127, 255, 0.6);
  }
}
@keyframes inbox-glow-approval {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(255, 69, 58, 0.4),
      0 0 22px 6px rgba(255, 69, 58, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(255, 69, 58, 0.6),
      0 0 44px 12px rgba(255, 69, 58, 0.6);
  }
}

/* 정지 사유 인라인 카드 — 운영팀장 아래에 표시 */
.inline-inbox.inbox-halt {
  background: linear-gradient(180deg, rgba(255, 69, 58, 0.10), rgba(255, 69, 58, 0.02));
  border: 1.5px solid rgba(255, 69, 58, 0.5);
  box-shadow: 0 4px 18px rgba(255, 69, 58, 0.18);
}
.inline-inbox.inbox-halt .inline-inbox-header {
  color: var(--state-blocked);
  border-bottom-color: rgba(255, 69, 58, 0.25);
}
.inline-inbox.inbox-halt .halt-count {
  background: rgba(255, 69, 58, 0.18);
  color: var(--state-blocked);
}
.halt-reason {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-doc);
  line-height: 1.55;
  white-space: pre-wrap;
}
.halt-report-link {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.15s;
}
.halt-report-link:hover {
  background: var(--bg-elev-2);
  color: var(--text);
  border-color: var(--accent);
}
/* 개발팀 진단 — 정지 카드에 버튼 */
.halt-diagnose-row {
  margin-top: 8px;
}
.halt-diagnose-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(124, 127, 255, 0.18), rgba(124, 127, 255, 0.08));
  border: 1px dashed rgba(124, 127, 255, 0.45);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #c8caff;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-align: left;
}
.halt-diagnose-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(124, 127, 255, 0.28), rgba(124, 127, 255, 0.12));
  border-color: var(--accent);
  color: #fff;
}
.halt-diagnose-btn.done {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.18), rgba(48, 209, 88, 0.08));
  border: 1px solid rgba(48, 209, 88, 0.4);
  color: #9ce5b4;
}
.halt-diagnose-btn.done:hover {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.28), rgba(48, 209, 88, 0.12));
  color: #fff;
}
.halt-diagnose-btn.pending {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  cursor: wait;
  animation: pulse-diag 1.4s ease-in-out infinite;
}
.halt-diagnose-btn.failed {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: #f87171;
}
@keyframes pulse-diag {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* drawer 진단 보고서 */
.diag-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 10px;
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.diag-pattern {
  background: rgba(124, 127, 255, 0.2);
  color: #c8caff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.diag-report {
  font-size: 13px;
  line-height: 1.6;
}
.diag-report h1 { font-size: 18px; margin: 0 0 12px; color: var(--text); }
.diag-report h2 { font-size: 14px; margin: 16px 0 8px; color: var(--accent); }
.diag-report h3 { font-size: 13px; margin: 12px 0 6px; }
.diag-report code { background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.diag-report pre { background: rgba(0,0,0,0.4); padding: 10px; border-radius: 6px; overflow: auto; }
.diag-report ul { margin: 6px 0; padding-left: 20px; }
.diag-report li { margin: 3px 0; }
.diag-report strong { color: var(--text); }

/* Patch 섹션 (Self-feedback Level 2-A) */
.patch-section {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(124, 127, 255, 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(124, 127, 255, 0.05), transparent);
}
.patch-section h3 {
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--accent);
}
.patch-hint { font-size: 11.5px; margin: 4px 0 10px; }
.patch-pending { color: #fbbf24; animation: pulse-diag 1.4s ease-in-out infinite; }
.patch-error {
  color: #f87171;
  font-size: 11.5px;
  padding: 8px 10px;
  background: rgba(248, 113, 113, 0.08);
  border-radius: 6px;
  margin: 4px 0 10px;
}
.patch-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.patch-risk {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid;
}
.patch-files, .patch-tokens {
  font-size: 11px;
  color: var(--text-muted);
}
.patch-safety {
  font-size: 11.5px;
  padding: 8px 10px;
  background: rgba(251, 191, 36, 0.08);
  border-left: 2px solid #fbbf24;
  border-radius: 4px;
  margin: 8px 0;
  color: #fbbf24;
}
.patch-files-list {
  font-size: 10.5px;
  margin: 6px 0;
}
.patch-files-list code {
  background: rgba(255,255,255,0.05);
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
}
.patch-diff {
  font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  padding: 12px;
  background: #0a0a0e;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: auto;
  max-height: 320px;
  white-space: pre;
  color: #e0e0e6;
  margin: 8px 0;
}
.patch-diff.applied {
  border-color: rgba(48, 209, 88, 0.4);
  opacity: 0.85;
}
.patch-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.patch-copy-btn { flex: 1; }
.patch-reject-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
}
.patch-reject-btn:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
}
.patch-apply-hint {
  font-size: 10.5px;
  margin-top: 8px;
}
.patch-apply-hint code {
  background: rgba(255,255,255,0.06);
  padding: 1px 4px;
  border-radius: 3px;
}

/* 자동화 영역 — 카드만, 헤더/버튼 없음 (메인 입력창에서 자동 판별로 추가) */
.automation-bar {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  pointer-events: none;
  /* 자식 auto-card-free 들은 각자 absolute로 zoom-content 안에 떠 있음 */
}
.automation-bar-grid { display: none; }

/* 자동화 카드 — done-card와 비슷한 스타일 (드래그 가능) */
.auto-card {
  background: linear-gradient(135deg, rgba(124, 127, 255, 0.08), rgba(124, 127, 255, 0.02));
  border: 1px solid rgba(124, 127, 255, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  user-select: none;
}
.auto-card:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124, 127, 255, 0.16), rgba(124, 127, 255, 0.05));
  box-shadow: 0 6px 18px rgba(124, 127, 255, 0.18);
}
.auto-card.disabled {
  opacity: 0.55;
  background: var(--bg-elev);
  border-color: var(--border);
}
.auto-card.dragging {
  cursor: grabbing;
  opacity: 0.85;
  transform: scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  z-index: 100 !important;
}
.auto-card-free {
  /* zoom-content 직접 자식 absolute */
  position: absolute;
}
.auto-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.auto-card-src {
  font-size: 14px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(124, 127, 255, 0.4));
}
.auto-card-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.auto-card-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* on/off 토글 스위치 */
.auto-toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}
.auto-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.auto-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  transition: 0.2s;
}
.auto-toggle-slider::before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.auto-toggle-switch input:checked + .auto-toggle-slider {
  background: var(--accent);
}
.auto-toggle-switch input:checked + .auto-toggle-slider::before {
  transform: translateX(14px);
}

/* 자동화 모달 폼 */
.automation-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0;
}
.automation-form .auto-label {
  font-size: 11.5px;
  color: var(--text-doc);
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.automation-form input[type="text"],
.automation-form textarea,
.automation-form select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
}
.automation-form input:focus,
.automation-form textarea:focus,
.automation-form select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
}
.automation-form .auto-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}
.auto-delete-btn {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  color: #f87171;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  margin-right: auto;
}
.auto-delete-btn:hover {
  background: rgba(248, 113, 113, 0.22);
  color: #fff;
}

.halt-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.halt-actions .primary-btn { flex: 1; }
.halt-dismiss {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.halt-dismiss:hover {
  background: var(--bg-elev-2);
  color: var(--text-dim);
}

/* ====== 응답 대기 — 강한 펄스 (파랑) ====== */
@keyframes pending-soft-glow {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(100, 210, 255, 0.45),
      0 0 24px 6px rgba(100, 210, 255, 0.35),
      0 0 60px 14px rgba(100, 210, 255, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(100, 210, 255, 0.65),
      0 0 44px 12px rgba(100, 210, 255, 0.55),
      0 0 90px 22px rgba(100, 210, 255, 0.3);
  }
}

/* 빌딩 층 — 결재 대기 강조 (사용자 룰: 결재 대기 = 파랑) */
.bld-floor.has-pending {
  background: linear-gradient(180deg, rgba(100, 210, 255, 0.18), rgba(100, 210, 255, 0.05));
  border-color: rgba(100, 210, 255, 0.55);
  box-shadow: 0 4px 18px rgba(100, 210, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.bld-floor.has-pending .bld-num {
  color: #fff;
}
.bld-floor.has-pending::before {
  background: var(--state-review) !important;
  opacity: 1;
  box-shadow: 0 0 16px rgba(100, 210, 255, 0.65);
}
.bld-floor.has-pending::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 17px;
  pointer-events: none;
  z-index: -1;
  animation: pending-soft-glow 2.4s ease-in-out infinite;
}
/* 결재 대기 뱃지 */
.bld-floor.has-pending .bld-stat {
  color: var(--state-review) !important;
  border-color: rgba(100, 210, 255, 0.45) !important;
  background: rgba(100, 210, 255, 0.12) !important;
  font-weight: 600;
}

.team-panel.has-pending::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--radius) + 3px);
  pointer-events: none;
  z-index: -1;
  animation: pending-soft-glow 2.4s ease-in-out infinite;
}
@keyframes inbox-glow-approval {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(248, 113, 113, 0),
      0 0 0 0 rgba(248, 113, 113, 0);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(248, 113, 113, 0.28),
      0 0 32px 6px rgba(248, 113, 113, 0.45);
  }
}

/* 인라인 결재함에 드래그앤드롭 — 활성 상태 */
.inline-inbox.drop-active {
  background: rgba(96, 165, 250, 0.18);
  border-style: dashed;
  border-width: 2px;
}
.inline-inbox.drop-active::before {
  content: "📎 파일 놓기 (여러 개 가능)";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  background: rgba(96, 165, 250, 0.9);
  border-radius: 9px;
  z-index: 20;
  pointer-events: none;
  letter-spacing: 0.04em;
}
.inline-inbox.inbox-approval.drop-active {
  background: rgba(248, 113, 113, 0.14);
}
.inline-inbox.inbox-approval.drop-active::before {
  background: rgba(248, 113, 113, 0.88);
}

/* 결재함 헤더 우측 첨부 버튼 */
.inline-inbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-attach-btn {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  width: 28px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.inline-attach-btn:hover {
  background: var(--bg-elev-3);
  color: var(--text);
}

/* 업로드 진행 표시 — 결재함 헤더에 작은 라벨 */
.inline-upload-status {
  font-size: 10.5px;
  color: var(--info);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* 업로드된 첨부 미리보기 (결재함 안) */
.inline-inbox-attachments {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 4px 0 8px;
  border-bottom: 1px dashed rgba(96, 165, 250, 0.2);
}
.inline-inbox-attachments:empty { display: none; }
.inline-inbox-attachments .attach-chip {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
}

.tc-avatar {
  width: 38px; height: 38px;
  background: var(--bg-elev-2);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 16px;
  color: var(--accent);
  font-weight: 700;
}
.team-card.team-leader .tc-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 18px;
}
.tc-body { min-width: 0; }
.tc-tag {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.tc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-card.team-leader .tc-name { font-size: 15px; }
.tc-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-status {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-elev-2);
  color: var(--text-muted);
  display: inline-block;
}
.tc-status.idle    { color: var(--text-muted); }
.tc-status.running { color: var(--warning); background: rgba(251, 191, 36, 0.12); }
.tc-status.done    { color: var(--success); background: rgba(52, 211, 153, 0.12); }
.tc-status.pending { color: var(--text-muted); background: var(--bg-elev-2); font-style: italic; }

.team-resp {
  padding: 12px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.team-resp-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.team-resp ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.team-resp li { padding-left: 14px; position: relative; line-height: 1.55; }
.team-resp li::before { content: "›"; position: absolute; left: 4px; color: var(--text-muted); }

/* ============================================================
   RIGHT — 결재함 + 라이브트랙 (세로 풀 높이)
   ============================================================ */
.home-right {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: 1fr;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}
.hr-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* 결재함 강조 — pending 있을 때 펄스 글로우 (전체 패널) */
.hr-panel.hr-inbox.has-pending-strong {
  border-color: rgba(124, 127, 255, 0.6);
  box-shadow:
    0 0 0 1px rgba(124, 127, 255, 0.35),
    0 0 24px rgba(124, 127, 255, 0.28),
    0 0 56px rgba(124, 127, 255, 0.14);
  animation: hrInboxBreathe 2.2s ease-in-out infinite;
}
.hr-panel.hr-inbox.has-pending-strong .hr-panel-header {
  background: linear-gradient(180deg, rgba(124, 127, 255, 0.18), rgba(124, 127, 255, 0.05));
  border-bottom-color: rgba(124, 127, 255, 0.35);
}
.hr-panel.hr-inbox.has-pending-strong .hr-panel-header h3 {
  color: #fff;
  font-weight: 600;
}
.hr-panel.hr-inbox.has-pending-strong #hrInboxCount {
  background: var(--accent);
  color: #fff;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.1px;
  min-width: 22px;
  text-align: center;
  animation: hrInboxBadgePulse 1.4s ease-in-out infinite;
}
@keyframes hrInboxBreathe {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(124, 127, 255, 0.35),
      0 0 24px rgba(124, 127, 255, 0.28),
      0 0 56px rgba(124, 127, 255, 0.14);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(124, 127, 255, 0.55),
      0 0 32px rgba(124, 127, 255, 0.45),
      0 0 80px rgba(124, 127, 255, 0.25);
  }
}
@keyframes hrInboxBadgePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}
.hr-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.hr-panel-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.hr-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.hr-events .hr-panel-body {
  padding: 6px 10px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
}

/* Responsive */
@media (max-width: 1200px) {
  .home-view .home-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .home-dash-top { grid-template-columns: minmax(280px, 1fr) auto; gap: 16px; }
  .home-dash-top .dash-top-active { display: none; }
  .bld-floor { min-height: 88px; padding: 18px 18px; }
  .bld-num { font-size: 26px; }
}
@media (max-width: 900px) {
  .home-view .home-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    overflow-y: auto;
  }
  .home-dash-top { grid-template-columns: 1fr; gap: 12px; }
  .home-dash-top .dash-top-stats { padding: 0; border-left: none; border-right: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding-top: 10px; padding-bottom: 10px; }
  .home-center, .home-right { grid-column: 1; }
  .home-right { grid-row: 3; grid-template-rows: auto auto; max-height: 60vh; }
  .home-center { min-height: 500px; }
  .zoom-content { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .building-tall { width: 100%; max-width: 320px; }
  .team-panel { width: 100%; max-width: 540px; }
}
@media (max-width: 600px) {
  .home-dash-top { padding: 12px 14px; }
  .home-dash-top .dash-top-stats { grid-template-columns: repeat(4, 1fr); }
  .dash-stat-num { font-size: 18px; }
  .bld-num { font-size: 22px; }
  .bld-name { font-size: 13px; }
  .bld-floor { padding: 14px 16px; min-height: 64px; }
  .team-members-grid { grid-template-columns: 1fr; }
  .zoom-hint { display: none; }
}

/* ============================================================
   Org Chart layout (1/4 빌딩 + 3/4 팀 상세)
   사이드바는 유지 — 홈 모드에서 빌딩이 사이드바 역할 아님
   ============================================================ */
.org-layout {
  display: grid;
  grid-template-columns: minmax(200px, 24%) 1fr;
  gap: 16px;
  min-height: 520px;
}

.org-building {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px 4px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: relative;
}

.org-floor {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  transition: all 0.2s;
  position: relative;
}
.org-floor:hover {
  background: var(--bg-elev-3);
  border-color: var(--border-strong);
  transform: translateX(2px);
}
.org-floor.active {
  border-color: var(--floor-color, var(--accent));
  background: rgba(139, 92, 246, 0.05);
  box-shadow: inset 3px 0 0 var(--floor-color, var(--accent));
}
.org-floor-4 { --floor-color: var(--text-muted); border-style: dashed; opacity: 0.7; }
.org-floor-3 { --floor-color: var(--floor-dev); }
.org-floor-2 { --floor-color: var(--floor-planning); }
.org-floor-1 { --floor-color: var(--floor-ops); }

.org-floor-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--floor-color, var(--text-dim));
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.org-floor-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.org-floor-tag, .org-floor-stat {
  font-size: 10.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.org-floor-stat.running { color: var(--warning); }
.org-floor-stat.done { color: var(--success); }

/* (구) .org-pipe 정의 제거 — 새 정의(line ~862)와 충돌. 옛 org-* 뷰는 더 이상 안 씀 */

.org-ground {
  height: 6px;
  margin: 8px 0 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--border-strong),
    var(--border-strong) 3px,
    transparent 3px,
    transparent 7px
  );
  border-bottom: 1px solid var(--border-strong);
  opacity: 0.6;
}

/* Org Detail (3/4 우측) */
.org-detail {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.org-d-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.org-d-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.org-d-floor-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(139, 92, 246, 0.12);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  margin-right: 10px;
}
.org-d-status {
  font-size: 11px;
  color: var(--text-muted);
}

/* 조직도 — 팀장 / 멤버 */
.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 12px 0 20px;
}
.org-leader {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 14px 22px;
  text-align: center;
  min-width: 180px;
  position: relative;
}
.org-leader-tag {
  font-size: 9.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 4px;
}
.org-leader-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.org-connect {
  width: 2px;
  height: 24px;
  background: var(--border-strong);
}

.org-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
  position: relative;
}
.org-members::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--border-strong);
}
.org-member {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
  position: relative;
  margin-top: 14px;
}
.org-member::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 50%;
  width: 2px;
  height: 16px;
  background: var(--border-strong);
  transform: translateX(-50%);
}
.org-member-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.org-member-role {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
.org-member.running {
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.06);
}
.org-member.implemented::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  color: var(--success);
}
.org-member.pending::after {
  content: "⋯";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* 책임 + 통계 */
.org-d-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.org-d-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.org-d-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.org-d-list li {
  padding: 6px 12px;
  background: var(--bg-elev-2);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-doc);
}
.org-d-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.org-d-stat {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
}
.org-d-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.org-d-stat-lbl {
  font-size: 9.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.org-d-tasks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.org-d-task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  align-items: center;
  transition: all 0.15s;
}
.org-d-task:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-3);
}
.org-d-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.org-d-task-goal {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-d-task-status {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.org-d-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px 12px;
  font-style: italic;
}

/* Inbox area in 1F detail */
.org-d-inbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============================================================
   Artifacts — 다운로드 카드 + 미리보기 (운영팀 산출물)
   ============================================================ */
.artifact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.artifact-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.artifact-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
}
.artifact-icon {
  font-size: 22px;
}
.artifact-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.artifact-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
.artifact-download {
  text-decoration: none;
  display: inline-block;
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
}

/* ============================================================
   Login screen — Apple inspired
   ============================================================ */
#bootMessage.login-mode {
  background: #000;
  display: block;
  padding: 0;
}
#bootMessage.login-mode .boot-card { display: none; }  /* 기존 boot 카드 숨김 (혹시 남아있을 때) */

.login-scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at top, #1a1d28 0%, #000 65%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  color: #f5f5f7;
}

/* 미묘한 광원 효과 */
.login-orb {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  animation: loginOrbBreathe 8s ease-in-out infinite;
}
@keyframes loginOrbBreathe {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

.login-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 440px;
  padding: 40px 32px;
  animation: loginFadeIn 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  font-size: 56px;
  font-weight: 200;
  letter-spacing: -1px;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #b0b4c0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}

.login-tagline {
  font-size: 19px;
  font-weight: 400;
  color: #a1a1a6;
  letter-spacing: -0.2px;
  margin-bottom: 56px;
}

.login-pitch {
  font-size: 15px;
  line-height: 1.65;
  color: #86868b;
  margin: 0 0 44px;
  font-weight: 400;
}

.login-btn {
  background: #ffffff;
  color: #1d1d1f;
  border: none;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.1px;
  border-radius: 980px;          /* Apple pill */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 4px 14px rgba(0, 0, 0, 0.35);
  font-family: inherit;
}
.login-btn:hover {
  background: #f5f5f7;
  transform: scale(1.02);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 6px 22px rgba(0, 0, 0, 0.5);
}
.login-btn:active {
  transform: scale(0.985);
}

/* ★ P0-4 로그인 화면 quota 안내 + Drive 옵션 (2026-06-22) */
.login-quota-info {
  margin-top: 28px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  text-align: left;
}
.login-quota-line {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.login-quota-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.login-quota-list li {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 3px 0;
}
.login-quota-list li strong {
  color: var(--text);
  font-weight: 700;
}
.login-quota-note {
  font-size: 11px;
  color: #86868b;
  letter-spacing: -0.1px;
}
.login-fine {
  margin-top: 18px;
  font-size: 11px;
  color: #86868b;
  line-height: 1.6;
  letter-spacing: -0.1px;
}

.login-note {
  margin-top: 36px;
  font-size: 12px;
  color: #86868b;
  line-height: 1.6;
  letter-spacing: -0.1px;
}
.login-note-mute {
  display: block;
  font-size: 11px;
  color: #5e5e63;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .login-logo { font-size: 44px; }
  .login-tagline { font-size: 16px; margin-bottom: 40px; }
  .login-pitch { font-size: 14px; }
  .login-content { padding: 32px 24px; }
}

/* ============================================================
   User chip (우상단)
   ============================================================ */
.user-chip {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 9000;
  background: rgba(22, 24, 33, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 4px 10px 4px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #e6e8ee;
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}
.user-avatar-fallback {
  background: linear-gradient(135deg, #4a90e2, #5856d6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; max-width: 180px; }
.user-name { font-weight: 500; }
.user-drive { font-size: 10px; color: #8a8d96; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* drawer task별 비용 */
.drawer-task-cost {
  font-size: 12px;
  color: var(--text);
}
.task-cost-summary { padding: 4px 0; }
.task-cost-total {
  font-size: 14px;
  margin-bottom: 4px;
}
.task-cost-total strong { color: var(--accent); }
.task-cost-tokens {
  font-size: 10.5px;
  margin-bottom: 8px;
}
.task-cost-breakdown {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 10.5px;
  color: var(--text-doc);
}
.task-cost-breakdown li {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.task-cost-breakdown li:last-child { border-bottom: none; }

/* 오늘 LLM 비용 chip */
.user-cost {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: 4px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 6px;
}
.user-cost:hover {
  background: rgba(124, 127, 255, 0.12);
}
.user-cost-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}
.user-cost-amount {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.user-menu-btn {
  background: none;
  border: none;
  color: #8a8d96;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 12px;
}
.user-menu-btn:hover { color: #fff; }
.user-menu {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 9001;
  background: rgba(28, 30, 39, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.user-menu-item {
  background: none;
  border: none;
  color: #e6e8ee;
  padding: 9px 12px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.user-menu-item:hover { background: rgba(255, 255, 255, 0.06); }

/* Google Drive artifact 강조 */
.artifact-card.artifact-gdrive {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.08), rgba(52, 168, 83, 0.05));
  border: 1.5px solid rgba(66, 133, 244, 0.4);
}
.artifact-card.artifact-gdrive .artifact-header {
  background: rgba(66, 133, 244, 0.06);
  border-bottom: none;
}
.artifact-card.artifact-gdrive .artifact-icon {
  color: #4285f4;
}
.artifact-card.artifact-gdrive .artifact-download {
  background: #4285f4;
}
.artifact-card.artifact-gdrive .artifact-download:hover {
  background: #3367d6;
}
.artifact-download:hover { background: var(--accent-2); }

.artifact-preview {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-doc);
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg);
}
.artifact-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
}

/* 이미지 미리보기 — PNG/JPG/SVG 등 (6F Design 산출물) */
.artifact-preview.image-preview {
  max-height: 480px;
  padding: 14px;
  /* 체스 패턴 배경 — 투명 SVG/PNG 잘 보이게 */
  background:
    linear-gradient(45deg, rgba(255,255,255,0.04) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%) 0 8px / 16px 16px,
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.04) 75%) 8px -8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.04) 75%) -8px 0 / 16px 16px,
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.artifact-preview.image-preview a {
  display: inline-block;
  line-height: 0;
}
.artifact-preview.image-preview img {
  max-width: 100%;
  max-height: 440px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  cursor: zoom-in;
  transition: transform 0.18s;
}
.artifact-preview.image-preview img:hover {
  transform: scale(1.015);
}
.image-preview-fallback {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 32px;
}
.artifact-preview.video-preview {
  padding: 14px;
  background: var(--bg);
  display: flex;
  justify-content: center;
}

/* 결재 카드 — HTML 카드 zip 다운로드 (전체 PNG 한 번에) */
.html-zip-bulk-block {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.12), rgba(48, 209, 88, 0.04));
  border: 1px solid rgba(48, 209, 88, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.html-zip-bulk-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.html-zip-bulk-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.html-zip-bulk-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.html-zip-bulk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.html-zip-bulk-size {
  padding: 7px 10px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.html-zip-bulk-btn {
  flex: 1;
  font-size: 12.5px;
  padding: 8px 14px;
  background: rgba(48, 209, 88, 0.3);
}
.html-zip-bulk-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* HTML 카드 미리보기 (Claude HTML Card Designer) */
.artifact-preview.html-preview {
  padding: 14px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.html-card-iframe {
  width: 100%;
  height: 400px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: white;
}
.html-card-actions {
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 8px;
}
.html-actions-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.html-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.html-size-select {
  padding: 6px 10px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.html-download-png {
  flex: 1;
  font-size: 12px;
  padding: 7px 12px;
}
.html-download-png:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Plan Review 카드 — Universal Runner의 plan 결재 (markdown 본문) */
.inbox-card .card-title :is(h1, h2, h3) {
  font-size: 14px;
  margin: 8px 0 4px;
  color: var(--text);
}
.inbox-card .card-title p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--text-doc);
}
.inbox-card .card-title ol, .inbox-card .card-title ul {
  margin: 4px 0 4px 18px;
  padding: 0;
  font-size: 12.5px;
  color: var(--text-doc);
  line-height: 1.55;
}
.inbox-card .card-title li {
  margin: 3px 0;
}
.inbox-card .card-title strong {
  color: var(--text);
}
.inbox-card .card-title em {
  color: var(--text-muted);
  font-size: 11px;
}
/* 결재 카드 안의 카드 미리보기 이미지 (trend_card Step 8 등) — 2026-06-19 */
.inbox-card .card-title img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* 카드 5장 이상이면 2열 grid로 (가독성 + 공간 절약) */
.inbox-card .card-title p:has(img) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}
.inbox-card .card-title p:has(img) img {
  margin: 0;
  max-height: 320px;
  object-fit: cover;
}

/* SVG actions — PNG 변환 다운로드 (Logo Designer) */
.svg-actions {
  padding: 10px 14px 12px;
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.svg-actions-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.svg-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.svg-size-select {
  padding: 6px 10px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.svg-download-png {
  flex: 1;
  font-size: 12px;
  padding: 7px 12px;
}
.svg-download-png:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Markdown preview */
.md-preview h1, .md-preview h2, .md-preview h3 {
  color: var(--text);
  margin: 12px 0 6px;
}
.md-preview h1 { font-size: 16px; }
.md-preview h2 { font-size: 14px; }
.md-preview h3 { font-size: 13px; }
.md-preview p { margin: 4px 0; line-height: 1.55; }
.md-preview ul, .md-preview ol { margin: 4px 0 4px 20px; }
.md-preview code {
  background: var(--bg-elev-2);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}
.md-preview pre {
  background: var(--bg-elev-2);
  padding: 8px 10px;
  border-radius: 4px;
}
.md-preview blockquote {
  border-left: 3px solid var(--accent);
  margin: 6px 0;
  padding-left: 10px;
  color: var(--text-dim);
}

/* CSV table preview */
.csv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.csv-table th, .csv-table td {
  padding: 5px 8px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.csv-table th {
  background: var(--bg-elev-2);
  font-weight: 600;
  color: var(--text);
}
.csv-table td {
  color: var(--text-doc);
}

/* ============================================================
   Task delete button (× — 호버 시 등장, 모바일은 항상 보임)
   ============================================================ */
.task-delete-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
.task-delete-btn:hover {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}
.sb-1f-task:hover .task-delete-btn,
.org-d-task:hover .task-delete-btn,
.tree-task-row:hover .task-delete-btn {
  opacity: 1;
}

/* 모바일: 항상 보임 */
@media (max-width: 768px) {
  .task-delete-btn { opacity: 0.6; }
  .task-delete-btn:active { opacity: 1; }
}

/* sb-1f-task에 3컬럼 그리드 적용 (dot | body | delete) */
.sb-1f-task {
  grid-template-columns: auto 1fr auto !important;
}

/* tree row에 delete 자리 */
.tree-task-row { position: relative; }
.tree-delete-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  font-size: 12px;
}

/* org task row에 grid 적용 (dot | goal | status | delete) */
.org-d-task {
  grid-template-columns: auto 1fr auto auto !important;
}

/* Mobile: 빌딩 위, 팀 상세 아래로 */
@media (max-width: 768px) {
  .org-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .org-building {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
  }
  .org-floor {
    min-width: 130px;
    flex-shrink: 0;
    grid-template-columns: auto 1fr;
  }
  .org-floor-tag, .org-floor-stat { display: none; }
  .org-pipe { display: none; }
  .org-ground { display: none; }
  .org-detail { padding: 16px 16px; }
}

/* Home hero (PM input) */
.home-hero {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.06));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-hero-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.home-hero-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
}
.home-hero-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 6px;
}
#homeNewTaskInput {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
}
#homeNewTaskInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 127, 255, 0.18); }
#homeNewTaskInput::placeholder { color: var(--text-muted); }
.primary-btn-lg {
  padding: 12px 24px;
  font-size: 13.5px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  letter-spacing: -0.15px;
}
.home-hero-examples {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.example-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}
.example-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  transition: all 0.15s;
}
.example-chip:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  color: var(--text);
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-lbl {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat-card.stat-success .stat-num { color: var(--success); }
.stat-card.stat-warning .stat-num { color: var(--danger); }
.stat-card.stat-info .stat-num { color: var(--warning); }

.home-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.home-h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 14px 0;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-count {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}

/* Department list */
.dept-list { display: flex; flex-direction: column; gap: 14px; }
.dept-team { display: flex; flex-direction: column; gap: 8px; }
.dept-team-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.dept-team-header.team-planning .dept-team-floor { background: rgba(139, 92, 246, 0.15); color: var(--floor-planning); }
.dept-team-header.team-development .dept-team-floor { background: rgba(6, 182, 212, 0.15); color: var(--floor-dev); }
.dept-team-floor {
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  background: var(--bg-elev-2);
  color: var(--text-muted);
}
.dept-agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.dept-agent {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.dept-agent.idle { opacity: 0.55; }
.dept-agent-icon {
  font-size: 14px;
  color: var(--text-muted);
}
.dept-agent.running .dept-agent-icon { color: var(--warning); }
.dept-agent.done .dept-agent-icon { color: var(--success); }
.dept-agent-body { min-width: 0; }
.dept-agent-name { font-size: 12px; font-weight: 600; color: var(--text); }
.dept-agent-meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.dept-agent-count {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Home task grid */
.home-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.home-task-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.home-task-card:hover {
  background: var(--bg-elev-3);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.home-task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.home-task-goal {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-task-status {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.home-task-status[data-status="queued"] { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.home-task-status[data-status="planning"] { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.home-task-status[data-status="routing"] { background: rgba(139, 92, 246, 0.15); color: var(--accent); }
.home-task-status[data-status="assigned"] { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.home-task-status[data-status="dev"] { background: rgba(6, 182, 212, 0.15); color: var(--floor-dev); }
.home-task-status[data-status="done"] { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.home-task-status[data-status="blocked"] { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.home-task-meta {
  display: flex;
  gap: 10px;
  font-size: 10.5px;
  color: var(--text-muted);
  align-items: center;
}
.home-task-meta-item { display: flex; align-items: center; gap: 4px; }
.home-task-progress {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}
.home-task-progress .prog-step {
  flex: 1;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  position: relative;
}
.home-task-progress .prog-step.done { background: var(--success); }
.home-task-progress .prog-step.running { background: var(--warning); animation: pulse-running 1.4s ease-in-out infinite; }
.home-task-progress .prog-step.waiting { background: var(--info); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  gap: 14px;
}
.topbar h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-meta { display: flex; align-items: center; gap: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: -0.05px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.badge[data-state="queued"] { color: var(--info); border-color: rgba(96, 165, 250, 0.3); }
.badge[data-state="planning"] { color: var(--warning); border-color: rgba(251, 191, 36, 0.3); }
.badge[data-state="routing"] { color: var(--accent); border-color: rgba(139, 92, 246, 0.3); }
.badge[data-state="assigned"] { color: var(--info); border-color: rgba(96, 165, 250, 0.3); }
.badge[data-state="dev"] { color: var(--floor-dev); border-color: rgba(6, 182, 212, 0.3); }
.badge[data-state="ops"] { color: #ec4899; border-color: rgba(236, 72, 153, 0.3); }
.badge[data-state="done"] { color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.badge[data-state="blocked"] { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.badge[data-level="L0"], .badge[data-level="L1"] { color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.badge[data-level="L2"] { color: var(--warning); border-color: rgba(251, 191, 36, 0.3); }
.badge[data-level="L3"], .badge[data-level="L4"] { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.conn-status {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 4px;
}
.conn-status.connected { color: var(--success); }
.conn-status.disconnected { color: var(--danger); }

/* ============================================================
   Building (회사 빌딩 단면도 — 1F 기반, 위로 쌓임)
   ============================================================ */
.building {
  display: flex;
  flex-direction: column;
  padding: 8px 4px 0;
  overflow-y: auto;
  min-height: 0;
}

.floor {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 8px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* 청사진 corner brackets */
.corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--floor-color, var(--text-muted));
  border-style: solid;
  pointer-events: none;
  opacity: 0.7;
}
.corner-tl { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.corner-tr { top: -2px; right: -2px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; }
.corner-br { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

/* 층별 색상 (CSS 변수 + 좌측 좁은 바) */
.floor-1 { --floor-color: var(--floor-ops); box-shadow: inset 3px 0 0 var(--floor-ops); }
.floor-2 { --floor-color: var(--floor-planning); box-shadow: inset 3px 0 0 var(--floor-planning); }
.floor-3 { --floor-color: var(--floor-dev); box-shadow: inset 3px 0 0 var(--floor-dev); }
.floor-4 { --floor-color: #ec4899; box-shadow: inset 3px 0 0 #ec4899; }
.floor-4.has-running { box-shadow: inset 3px 0 0 #ec4899, 0 0 0 0 rgba(251, 191, 36, 0.4); animation: floor-pulse 2.2s ease-in-out infinite; }
.org-floor-4 { --floor-color: #ec4899; }
.org-floor-5 { --floor-color: var(--text-muted); border-style: dashed; opacity: 0.7; }
.floor-future {
  border-style: dashed;
  opacity: 0.65;
}
.floor-future .corner { display: none; }

/* 작업 중일 때 — 미세 펄스 */
.floor.has-running {
  border-color: var(--warning);
}
.floor-1.has-running { box-shadow: inset 3px 0 0 var(--floor-ops), 0 0 0 0 rgba(251, 191, 36, 0.4); animation: floor-pulse 2.2s ease-in-out infinite; }
.floor-2.has-running { box-shadow: inset 3px 0 0 var(--floor-planning), 0 0 0 0 rgba(251, 191, 36, 0.4); animation: floor-pulse 2.2s ease-in-out infinite; }
.floor-3.has-running { box-shadow: inset 3px 0 0 var(--floor-dev), 0 0 0 0 rgba(251, 191, 36, 0.4); animation: floor-pulse 2.2s ease-in-out infinite; }
@keyframes floor-pulse {
  0%, 100% { outline: 0px solid rgba(251, 191, 36, 0); }
  50% { outline: 1px solid rgba(251, 191, 36, 0.25); outline-offset: 2px; }
}

/* Floor header */
.floor-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.floor-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--floor-color, var(--text-dim));
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.floor-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.floor-tag {
  font-size: 9.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-elev-2);
  padding: 2px 7px;
  border-radius: 3px;
}
.floor-stats {
  margin-left: auto;
  display: flex;
  gap: 10px;
}
.floor-stat {
  font-size: 10.5px;
  color: var(--text-dim);
  padding: 2px 8px;
  background: var(--bg-elev-2);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.floor-stat.running { color: var(--warning); }
.floor-stat.done { color: var(--success); }

.floor-body {
  display: flex;
  flex-direction: column;
}

/* 1F Operating Room body (stats 4분할) */
.floor-ops-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ops-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev-2);
  padding: 9px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.ops-stat-icon { font-size: 16px; line-height: 1; }
.ops-stat-label {
  font-size: 9.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ops-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
#opsRealtime { color: var(--text-muted); }
#opsRealtime.connected { color: var(--success); }
#opsRealtime.disconnected { color: var(--danger); }

/* 4F future teams */
.future-teams {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.future-team {
  background: var(--bg-elev-2);
  border: 1px dashed var(--border);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

/* 층간 수직 파이프 */
.floor-pipe {
  height: 22px;
  margin: 2px 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.floor-pipe::before {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--border-strong);
  left: 50%;
  transform: translateX(-50%);
}
.floor-pipe.active::before {
  background: linear-gradient(to bottom, var(--floor-dev), var(--floor-planning));
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}
.pipe-label {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 0 8px;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* GROUND line — 빌딩 기반 */
.ground-line {
  height: 6px;
  margin: 6px 8px 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--border-strong),
    var(--border-strong) 3px,
    transparent 3px,
    transparent 7px
  );
  border-bottom: 1px solid var(--border-strong);
  opacity: 0.6;
}

/* Agent pipeline (full size in center) */
.pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.agent-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  min-width: 130px;
  transition: all 0.25s;
  cursor: pointer;
}
.agent-tile:hover { background: var(--bg-elev-3); border-color: var(--border-strong); }
.agent-tile .agent-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2; }
.agent-tile .agent-state { font-size: 10.5px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }
.agent-tile .agent-detail { font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.agent-tile.state-idle { opacity: 0.55; }
.agent-tile.state-running {
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.06);
  animation: pulse-running 1.4s ease-in-out infinite;
}
.agent-tile.state-running .agent-state { color: var(--warning); }
.agent-tile.state-done {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.04);
}
.agent-tile.state-done .agent-state { color: var(--success); }
.agent-tile.state-waiting {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.04);
}
.agent-tile.state-waiting .agent-state { color: var(--info); }
.agent-tile.state-blocked {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.06);
}
.agent-tile.state-blocked .agent-state { color: var(--danger); }
.agent-tile.gate {
  background: rgba(99, 102, 241, 0.05);
  border-style: dashed;
  border-color: rgba(99, 102, 241, 0.4);
  min-width: 110px;
}
.agent-tile.gate.state-waiting {
  border-color: var(--info);
  animation: pulse-waiting 2s ease-in-out infinite;
}
@keyframes pulse-running {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}
@keyframes pulse-waiting {
  0%, 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(96, 165, 250, 0); }
}
.pipe-arrow {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 16px;
  transition: color 0.3s;
}
.pipe-arrow::before { content: "→"; }
.pipe-arrow.active {
  color: var(--success);
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

/* ============================================================
   Lower grid (Inbox + Events)
   ============================================================ */
.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  min-height: 0;
}
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.panel-header h3 { margin: 0; font-size: 12px; font-weight: 600; }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  transition: all 0.2s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--border-strong); }
.muted { color: var(--text-muted); font-size: 11px; margin: 0; }

/* Inbox */
.inbox-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inbox-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  animation: fadeIn 0.3s;
}
.inbox-card .card-header { margin-bottom: 8px; }
.inbox-card .card-title { font-size: 12px; font-weight: 600; }

/* 결재 카드 collapsed 패턴 — 다건 시 리스트, 클릭 시 펼침 (accordion) */
.inbox-card.collapsed { padding: 7px 12px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.inbox-card.collapsed:hover { background: var(--bg-elev); border-color: var(--accent); }
.inbox-card.collapsed > *:not(.card-header) { display: none; }
.inbox-card.collapsed .card-header { margin-bottom: 0; }
.inbox-card.collapsed .card-title::before { content: '▶ '; color: var(--text-muted); font-size: 10px; }
.inbox-card:not(.collapsed) .card-title::before { content: '▼ '; color: var(--accent); font-size: 10px; }
.inbox-card:not(.collapsed) .card-header { cursor: pointer; }

/* callout-body 스크롤 — 결재 카드 펼치면 길어져서 화면 잘리는 거 방지 */
.callout-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 4px; }

/* detail panel header — 선택된 결재 제목 + 첨부 버튼 */
.callout-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.callout-detail-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 결재 리스트 — list panel 내부 항목 컨테이너 */
.callout-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  overflow-y: auto;
  min-height: 0;
}
.callout-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.callout-list-item:hover { background: var(--bg-elev); border-color: var(--border-strong); }
.callout-list-item.active {
  background: linear-gradient(90deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
/* 자동 재시도 후에도 정지된 task — 운영자 개입 필요 강조 (빨강 깜빡임) */
.callout-list-item.needs-attention {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  box-shadow: inset 3px 0 0 #f87171, 0 0 12px rgba(248, 113, 113, 0.25);
  animation: needsAttnPulse 1.6s ease-in-out infinite;
}
.callout-list-item.needs-attention.active {
  background: rgba(248, 113, 113, 0.15);
  border-color: #ef4444;
  box-shadow: inset 3px 0 0 #ef4444, 0 0 18px rgba(248, 113, 113, 0.35);
}
.cl-attn {
  font-size: 11px;
  margin-left: 4px;
  display: inline-block;
  animation: needsAttnIconShake 1.2s ease-in-out infinite;
}
@keyframes needsAttnPulse {
  0%, 100% { box-shadow: inset 3px 0 0 #f87171, 0 0 12px rgba(248, 113, 113, 0.25); }
  50% { box-shadow: inset 3px 0 0 #ef4444, 0 0 22px rgba(248, 113, 113, 0.5); }
}
@keyframes needsAttnIconShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg); }
  75% { transform: rotate(6deg); }
}

/* 정지 카드 자체에 needs-attention 강조 (detail panel에서 표시) */
.inline-inbox.inbox-halt.needs-attention {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px #ef4444, 0 0 20px rgba(239, 68, 68, 0.35);
  animation: needsAttnPulse 1.6s ease-in-out infinite;
}
.halt-attention-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.halt-gh-link {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: #f87171;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid rgba(248, 113, 113, 0.4);
}
.halt-gh-link:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: #f87171;
}
.cl-icon { font-size: 14px; flex-shrink: 0; }
.cl-text { flex: 1; min-width: 0; }
.cl-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cl-sub { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

/* 3F 팀 패널 — 진단 보고서 mini list + GitHub 링크 (B 계획) */
.team-diagnostic-section {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.team-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dr-list { display: flex; flex-direction: column; gap: 4px; }
.dr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 11.5px;
}
.dr-row:hover { background: var(--bg-elev); border-color: var(--accent); }
.dr-status { font-size: 10px; width: 14px; text-align: center; flex-shrink: 0; }
.dr-status-complete { color: #4ade80; }
.dr-status-processing,
.dr-status-partial { color: #fbbf24; }
.dr-status-failed { color: #f87171; }
.dr-status-requested { color: var(--text-muted); }
.dr-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.dr-pattern {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 9.5px;
  padding: 2px 5px;
  background: var(--bg-elev-3, var(--bg-elev));
  color: var(--text-muted);
  border-radius: 3px;
  white-space: nowrap;
}
.dr-gh {
  font-size: 10.5px;
  padding: 2px 6px;
  color: var(--accent);
  background: rgba(126, 96, 191, 0.12);
  border: 1px solid rgba(126, 96, 191, 0.4);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}
.dr-gh:hover { background: rgba(126, 96, 191, 0.25); }

/* 우측 사이드바 inbox — 짧은 라벨 리스트 (callout-list-item과 동일 스타일) */
.inbox-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.inbox-list-item:hover { background: var(--bg-elev); border-color: var(--accent); }

/* 사이드바 inbox 도 동일 — 카드 펼침 시 잘림 방지 */
.inbox-body { overflow-y: auto; }
.inbox-card .card-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.final-review-arts-block {
  margin: 6px 0 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.final-review-arts-block summary {
  cursor: pointer;
  font-size: 11.5px;
  color: var(--text-doc);
  padding: 2px 0;
  user-select: none;
}
.final-review-arts-block summary:hover { color: var(--text); }
.final-review-arts {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.final-review-arts::-webkit-scrollbar { width: 8px; }
.final-review-arts::-webkit-scrollbar-track { background: transparent; }
.final-review-arts::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.final-review-arts::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* 카드 한 줄 압축 — icon · 이름 · 메타 · 다운로드 한 줄에 다 (좁아도 ellipsis 됨) */
.final-review-arts .artifact-card {
  font-size: 11.5px;
  padding: 6px 8px;
  background: var(--bg);
}
.final-review-arts .artifact-card .artifact-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}
.final-review-arts .artifact-card .artifact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.final-review-arts .artifact-card .artifact-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.final-review-arts .artifact-name {
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.final-review-arts .artifact-meta {
  font-size: 10px;
  color: var(--text-muted);
}
.final-review-arts .artifact-card .artifact-download {
  font-size: 10.5px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* 미리보기는 카드 클릭 펼침 영역 — 결재함 안에서는 너무 크면 거추장 */
.final-review-arts .artifact-preview {
  max-height: 120px;
  overflow: auto;
  margin-top: 6px;
  font-size: 10.5px;
}
.final-review-arts .artifact-preview pre {
  font-size: 10px;
  line-height: 1.4;
  margin: 0;
}

/* 폴더 그룹화 — <details>/<summary> 기반 */
.final-review-arts .arts-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  overflow: hidden;
}
.final-review-arts .arts-group[open] {
  background: var(--bg-elev-2);
}
.final-review-arts .arts-group-header {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-doc);
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  list-style: none;
  position: relative;
}
.final-review-arts .arts-group-header::-webkit-details-marker { display: none; }
.final-review-arts .arts-group-header::before {
  content: '▶';
  font-size: 9px;
  margin-right: 6px;
  color: var(--text-muted);
  transition: transform 0.15s;
  display: inline-block;
}
.final-review-arts .arts-group[open] .arts-group-header::before {
  transform: rotate(90deg);
}
.final-review-arts .arts-group[open] .arts-group-header {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.final-review-arts .arts-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

/* 결재 카드 — 옵션 아래 자유 텍스트 입력 (universal) */
.decision-custom-text {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.decision-custom-label {
  display: block;
  font-size: 11px;
  color: var(--text-doc);
  margin-bottom: 4px;
  user-select: none;
}
.decision-custom-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 11.5px;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 36px;
  box-sizing: border-box;
}
.decision-custom-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
}
.decision-custom-input::placeholder {
  color: var(--text-muted);
  font-size: 11px;
}

.option-list { display: flex; flex-direction: column; gap: 6px; }
.option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.option:hover { border-color: var(--border-strong); }
.option.recommended {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.04);
}
.option-body .opt-id { font-size: 10px; font-weight: 700; color: var(--accent); }
.option-body .opt-label { font-size: 12px; font-weight: 600; margin: 2px 0 5px 0; }
.option-body .opt-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  font-size: 10.5px;
  color: var(--text-dim);
}
.option-body .opt-meta dt { color: var(--text-muted); }
.option .recommend-mark { font-size: 9px; color: var(--accent); margin-left: 4px; }

.primary-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -0.1px;
  align-self: start;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 1px 2px rgba(0, 0, 0, 0.25);
}
.primary-btn:hover { background: var(--accent-2); transform: scale(1.02); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-approve, .btn-reject {
  border-radius: var(--radius-pill) !important;
  padding: 6px 14px !important;
  font-weight: 500 !important;
  letter-spacing: -0.1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-approve:hover, .btn-reject:hover { transform: scale(1.02); }
.btn-approve:active, .btn-reject:active { transform: scale(0.98); }

/* Q&A card */
.qa-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.qa-item { display: flex; flex-direction: column; gap: 3px; }
.qa-q { font-size: 11.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.qa-qid {
  display: inline-block;
  font-weight: 700;
  color: var(--accent);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  margin-right: 5px;
}
.qa-why { font-size: 10.5px; color: var(--text-muted); }
.qa-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
  padding: 6px 9px;
  resize: vertical;
  min-height: 36px;
}
.qa-input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

.approval-card {
  background: var(--bg-elev-2);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 6px;
  padding: 10px 12px;
}
.approval-card .approval-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn-approve {
  background: var(--success); color: var(--bg);
  border: none; padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
}
.btn-reject {
  background: var(--danger); color: white;
  border: none; padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
}

/* Event stream */
.event-stream {
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
}
.event-row {
  display: grid;
  grid-template-columns: 75px 38px auto 1fr;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  animation: fadeIn 0.4s;
}
.event-time { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.event-floor {
  font-weight: 600;
  text-align: center;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 9.5px;
  align-self: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.event-floor.operating_room { color: var(--floor-ops); background: rgba(99, 102, 241, 0.08); }
.event-floor.planning { color: var(--floor-planning); background: rgba(139, 92, 246, 0.08); }
.event-floor.development { color: var(--floor-dev); background: rgba(6, 182, 212, 0.08); }
.event-type { color: var(--text-dim); font-size: 9.5px; align-self: center; }
.event-msg { color: var(--text); font-size: 10.5px; }
.event-row.event-agent_started .event-msg { color: var(--warning); }
.event-row.event-agent_completed .event-msg { color: var(--success); }
.event-row.event-user_decision_pending .event-msg { color: var(--info); }
.event-row.event-user_decision .event-msg { color: var(--accent); }
.event-row.event-task_created .event-msg { color: var(--accent); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Drawer (document viewer, Notion-like)
   ============================================================ */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-w);
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-title { font-size: 15px; font-weight: 700; color: var(--text); }
.drawer-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.drawer-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.drawer-dl {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.drawer-dl:hover {
  background: var(--bg-elev-3);
  color: var(--text);
  border-color: var(--border-strong);
}
.drawer-dl:active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
/* drawer 좌측 가장자리 중앙 닫기 탭 — edge-collapse 패턴 */
.drawer-close-tab {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 51;
  width: 22px;
  height: 56px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--text-dim);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.3);
  transition: background 0.15s, color 0.15s, transform 0.18s;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}
.drawer-close-tab:hover {
  background: var(--bg-elev-2);
  color: var(--text);
  transform: translateY(-50%) scale(1.05);
}
.drawer-close-tab:active { transform: translateY(-50%) scale(0.95); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 64px;
  color: var(--text-doc);
}

/* Notion-like doc inside drawer */
.doc-summary {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-doc);
  margin: 8px 0 16px;
  padding: 12px 16px;
  background: rgba(139, 92, 246, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.doc-h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 6px;
  letter-spacing: -0.01em;
}
.doc-h3:first-child { margin-top: 0; }
.doc-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.doc-list li {
  font-size: 12.5px;
  line-height: 1.55;
  padding: 4px 0 4px 20px;
  position: relative;
  color: var(--text-doc);
}
.doc-list li::before {
  content: "•"; position: absolute; left: 6px; color: var(--text-muted);
}
.doc-list.bullets-fact li::before { color: var(--success); }
.doc-list.bullets-assume li::before { content: "?"; color: var(--warning); }
.doc-list.bullets-system li::before { content: "▸"; color: var(--info); }

.doc-qlist { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.doc-q {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.doc-q.blocking { border-left-color: var(--danger); }
.doc-q-text { font-size: 12px; color: var(--text); font-weight: 500; margin-bottom: 3px; }
.doc-q-why { font-size: 10.5px; color: var(--text-muted); }
.doc-q-blocking-tag {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 5px;
  letter-spacing: 0.05em;
}

.doc-options { display: flex; flex-direction: column; gap: 10px; }
.doc-option {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.doc-option.recommended { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.04); }
.doc-option.chosen { border-color: var(--success); background: rgba(52, 211, 153, 0.05); }
.doc-option-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.doc-option-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.doc-option-id {
  display: inline-block;
  font-size: 9.5px; font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-right: 6px;
}
.doc-option-tag { font-size: 9.5px; font-weight: 600; padding: 2px 6px; border-radius: 3px; }
.doc-option-tag.ai-rec { color: var(--accent); background: rgba(139, 92, 246, 0.12); }
.doc-option-tag.chosen { color: var(--success); background: rgba(52, 211, 153, 0.12); }
.doc-option-meta {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 4px 12px;
  font-size: 11.5px;
}
.doc-option-meta dt { color: var(--text-muted); font-size: 10.5px; }
.doc-option-meta dd { color: var(--text-doc); }

.doc-risk-table { display: flex; flex-direction: column; gap: 8px; }
.doc-risk-item {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
}
.doc-risk-level {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  text-align: center;
  min-width: 30px;
  align-self: start;
}
.doc-risk-level.L0, .doc-risk-level.L1 { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.doc-risk-level.L2 { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.doc-risk-level.L3, .doc-risk-level.L4 { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.doc-risk-body .doc-risk-desc { font-size: 12px; color: var(--text); font-weight: 500; margin-bottom: 3px; }
.doc-risk-body .doc-risk-reason { font-size: 10.5px; color: var(--text-muted); margin-bottom: 3px; }
.doc-risk-body .doc-risk-action { font-size: 10px; color: var(--danger); font-weight: 600; }

.doc-money-gate {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.doc-money-gate dt { color: var(--text-muted); font-size: 10.5px; }
.doc-money-gate dd { color: var(--text-doc); font-variant-numeric: tabular-nums; }

.doc-note {
  padding: 10px 14px;
  background: rgba(96, 165, 250, 0.05);
  border-left: 3px solid var(--info);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px;
  color: var(--text-doc);
}

.doc-qa-block { display: flex; flex-direction: column; gap: 10px; }
.doc-qa-pair {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.doc-qa-q { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.doc-qa-q-mark { color: var(--accent); font-weight: 700; margin-right: 4px; }
.doc-qa-a { font-size: 12.5px; color: var(--text); padding-left: 16px; position: relative; }
.doc-qa-a::before { content: "→"; position: absolute; left: 0; color: var(--text-muted); }

.doc-raw { margin-top: 16px; }
.doc-raw summary {
  cursor: pointer;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.doc-raw summary:hover { color: var(--text-dim); background: var(--bg-elev-2); }
.doc-raw pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 6px 0 0;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* ============================================================
   Boot overlay
   ============================================================ */
.boot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 20, 0.95);
  display: grid;
  place-items: center;
  z-index: 100;
  transition: opacity 0.4s, visibility 0.4s;
}
/* 한번 hidden 되면 절대 재출현 안 함 */
.boot-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}
.boot-card {
  text-align: center;
  padding: 28px 44px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.boot-card h2 { margin: 0 0 10px 0; font-size: 22px; }
.boot-card p { color: var(--text-dim); margin: 0; font-size: 12px; }
.boot-card code {
  background: var(--bg-elev-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ============================================================
   Mobile sidebar toggle (햄버거)
   ============================================================ */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  width: 38px;
  height: 38px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.sidebar-toggle:active { background: var(--bg-elev-2); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 45;
}
.sidebar-backdrop.show { display: block; }

/* ============================================================
   Responsive — Tablet (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .home-stats { grid-template-columns: repeat(3, 1fr); }
  .home-task-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Responsive — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  html, body { font-size: 13px; }

  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 86vw;
    max-width: 320px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-toggle { display: flex; }

  .topbar, .topbar-compact {
    padding-left: 60px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar h2, .topbar-compact h2 { font-size: 13px; }
  .topbar-meta { flex-wrap: wrap; gap: 4px; }
  .badge { font-size: 10px; padding: 2px 6px; }

  .new-task-bar {
    grid-template-columns: 1fr auto;
    padding: 8px 12px;
  }
  .new-task-bar .new-task-icon, .new-task-bar .new-task-hint { display: none; }
  #newTaskInput { font-size: 13px; }

  .home-hero { padding: 18px 18px; }
  .home-hero-title { font-size: 17px; }
  .home-hero-sub { font-size: 11.5px; }
  .home-hero-input { grid-template-columns: 1fr; gap: 8px; }
  #homeNewTaskInput { font-size: 14px; padding: 11px 14px; }
  .primary-btn-lg { padding: 11px 18px; font-size: 13px; }
  .home-hero-examples { gap: 4px; }
  .example-chip { font-size: 10.5px; padding: 4px 9px; }

  .home-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-num { font-size: 20px; }
  .stat-lbl { font-size: 9.5px; }

  .dept-agent-grid { grid-template-columns: 1fr; }
  .home-section { padding: 14px 16px; }
  .home-h3 { font-size: 12.5px; margin-bottom: 12px; }
  .home-task-grid { grid-template-columns: 1fr; }

  .lower-grid { grid-template-columns: 1fr; }

  .building { padding: 4px 0 0; }
  .floor { margin: 0 4px; padding: 10px 12px 12px; }
  .floor-header { flex-wrap: wrap; gap: 6px; }
  .floor-num { font-size: 13px; }
  .floor-name { font-size: 11.5px; }
  .floor-tag { font-size: 9px; padding: 1px 5px; }
  .floor-stats { width: 100%; margin-left: 0; }
  .floor-stat { font-size: 10px; padding: 1px 6px; }

  .pipeline {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .agent-tile {
    min-width: 100px;
    padding: 6px 9px;
    flex-shrink: 0;
  }
  .agent-tile .agent-name { font-size: 10.5px; }
  .agent-tile .agent-state { font-size: 9.5px; }
  .pipe-arrow { font-size: 12px; padding: 0 4px; flex-shrink: 0; }

  .floor-ops-body { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ops-stat { padding: 7px 9px; gap: 7px; }
  .ops-stat-icon { font-size: 14px; }
  .ops-stat-value { font-size: 14px; }
  .ops-stat-label { font-size: 9px; }

  .future-team { font-size: 10px; padding: 2px 8px; }

  .drawer { width: 100%; max-width: 100vw; }
  .drawer-body { padding: 18px 18px 60px; }

  .inbox-card { padding: 9px 11px; }
  .option { grid-template-columns: 1fr; gap: 6px; padding: 8px 10px; }
  .option button { width: 100%; }

  .event-row {
    grid-template-columns: 55px 30px 1fr;
    gap: 5px;
  }
  .event-row .event-type { display: none; }

  .brand h1 { font-size: 13px; }
  .sb-1f-section { max-height: 30vh; }
  .tree-row { padding: 5px 7px; }
}

/* ============================================================
   Responsive — 작은 폰 (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .home-hero { padding: 14px 14px; }
  .home-hero-title { font-size: 15px; }
  .floor { margin: 0 2px; padding: 9px 10px 11px; }
  .drawer-body { padding: 14px 14px 50px; }
}
