:root {
  --primary:        #4f46e5;
  --primary-light:  #e0e7ff;
  --primary-dark:   #3730a3;
  --success:        #10b981;
  --success-light:  #d1fae5;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --purple:         #7c3aed;
  --purple-light:   #ede9fe;
  --bg:             #f1f5f9;
  --card:           #ffffff;
  --text:           #1e293b;
  --muted:          #64748b;
  --border:         #e2e8f0;
  --radius:         12px;
  --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Header ── */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 13px;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: .5px;
}

header h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.month-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 14px;
  border-radius: 20px;
}

.refresh-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.refresh-btn:hover { background: var(--bg); color: var(--primary); }

/* ── Portal nav (상위 탭) ── */
.portal-nav {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  padding: 0 32px;
  display: flex;
  gap: 4px;
}

.portal-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
}
.portal-btn:hover  { color: var(--text); background: var(--card); }
.badge-new {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  background: #ef4444;
  color: #fff;
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
  letter-spacing: .04em;
  margin-left: 5px;
  line-height: 1.4;
}
.portal-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
  background: var(--card);
}

.portal-section { display: block; }
.portal-section.hidden { display: none; }
#portal-meeting { display: flex; flex-direction: column; height: calc(100vh - 100px); }

#portal-settings { padding: 28px 80px; }

/* ── Tabs (리소스 관리 내 하위 탭) ── */
.tabs {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  gap: 0;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.tab-btn:hover  { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Main ── */
main { padding: 28px 32px; max-width: 1440px; margin: 0 auto; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Portal placeholder ── */
.portal-placeholder-main {
  padding: 28px 32px;
  max-width: 1440px;
  margin: 0 auto;
}
.portal-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
  color: var(--muted);
}
.portal-placeholder-icon { font-size: 48px; }
.portal-placeholder-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 0; }
.portal-placeholder-desc  { font-size: 15px; color: var(--muted); margin: 0; }

/* ── 회의록 탭 ── */
.mn-page { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.mn-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mn-toolbar-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* 녹음 바 */
.mn-record-bar { padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.mn-record-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mn-label { font-size: 12px; color: var(--muted); }
.mn-name-input { border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 13px; width: 120px; background: var(--bg); color: var(--text); }
.mn-btn-start { background: #16a34a; color: #fff; border: none; border-radius: 8px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.mn-btn-start:hover:not(:disabled) { opacity: .85; }
.mn-btn-start:disabled { background: #9ca3af; cursor: not-allowed; opacity: .55; }
.mn-btn-stop  { background: #dc2626; color: #fff; border: none; border-radius: 8px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.mn-btn-stop:hover { opacity: .85; }
.mn-record-status { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mn-record-dot { animation: mn-blink 1s step-start infinite; }
@keyframes mn-blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.mn-record-timer { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: #dc2626; }
.mn-record-hint { color: var(--muted); font-size: 12px; }
.mn-upload-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 2px 0; }
.mn-client-select { border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 13px; background: var(--bg); color: var(--text); cursor: pointer; min-width: 110px; max-width: 160px; }
.mn-client-select:disabled { opacity: .5; cursor: not-allowed; }
.mn-record-notes-wrap { padding: 0 0 4px; }
.mn-record-notes { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; line-height: 1.6; resize: vertical; background: var(--bg); color: var(--text); font-family: inherit; transition: border-color .15s; }
.mn-record-notes:focus { outline: none; border-color: var(--primary); }
.mn-recorder-name-wrap { display: flex; flex-direction: column; gap: 2px; }

/* 녹음 모드 토글 (일반 / 1on1) */
.mn-mode-toggle { display: flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.mn-mode-btn { border: none; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; padding: 5px 11px; cursor: pointer; transition: background .15s, color .15s; }
.mn-mode-btn.active { background: #7c3aed; color: #fff; }
.mn-mode-btn:hover:not(.active) { background: var(--hover); }

/* 녹음 중 모드 배지 */
.mn-record-mode-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: #dcfce7; color: #16a34a; }
.mn-record-mode-badge.oo { background: #ede9fe; color: #7c3aed; }

/* 🔒 1on1 진입 버튼 */
.mn-oo-entry-btn { border: 1px solid #7c3aed; color: #7c3aed; background: transparent; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s; }
.mn-oo-entry-btn:hover { background: #ede9fe; }

/* 탭 전체 뷰 전환 */
.mn-full-view { display: flex; flex-direction: column; height: 100%; }

/* 1on1 뷰 — 돌아가기 버튼 */
.mn-oo-back-btn { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.mn-oo-back-btn:hover { background: var(--hover); }

/* 1on1 인증 모달 오버레이 */
.mn-oo-auth-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 9000; }
.mn-oo-auth-modal { background: var(--card); border-radius: 14px; padding: 28px 32px; width: 340px; box-shadow: 0 16px 48px rgba(0,0,0,.22); }
.mn-oo-auth-title { font-size: 16px; font-weight: 800; color: #7c3aed; margin-bottom: 8px; }
.mn-oo-auth-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.mn-oo-pw-input { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 14px; background: var(--bg); color: var(--text); }
.mn-oo-pw-input:focus { outline: none; border-color: #7c3aed; }
.mn-oo-auth-err { min-height: 20px; font-size: 12px; color: var(--danger); margin: 8px 0; }
.mn-oo-auth-btns { display: flex; gap: 8px; margin-top: 4px; }

/* 마스터-디테일 레이아웃 */
.mn-layout { display: flex; flex: 1; overflow: hidden; }
.mn-list-panel { flex: 0 0 min(380px, 33%); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--border); background: var(--card); }
.mn-search-wrap { padding: 9px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mn-search-input { width: 100%; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); outline: none; }
.mn-search-input:focus { border-color: var(--primary); }
.mn-list-inner { flex: 1; overflow-y: auto; }
.mn-detail-panel { flex: 1; overflow-y: auto; padding: 0; background: var(--bg); }

/* 목록 */
.mn-loading { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.mn-empty-list { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 13px; line-height: 1.6; }
.mn-pending-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; flex-wrap: wrap; flex-shrink: 0; background: #fef9c3; border-bottom: 1px solid #fde047; }
.mn-pending-banner-text { font-size: 13px; color: #854d0e; }
.mn-pending-banner-btns { display: flex; gap: 6px; flex-shrink: 0; }
:root[data-theme="dark"] .mn-pending-banner { background: #422006; border-bottom-color: #92400e; }
:root[data-theme="dark"] .mn-pending-banner-text { color: #fde68a; }
@media (prefers-color-scheme: dark) { .mn-pending-banner { background: #422006; border-bottom-color: #92400e; } .mn-pending-banner-text { color: #fde68a; } }
.mn-date-group { }
.mn-date-header { font-size: 11px; font-weight: 700; color: var(--muted); padding: 10px 16px 4px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--border); }
.mn-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.mn-item:hover { background: var(--primary-light); }
.mn-item-active { background: var(--primary-light); border-right: 3px solid var(--primary); }
.mn-item-proc { opacity: .7; }
.mn-status-badge { display: inline-block; font-size: 9px; font-weight: 700; border-radius: 3px; padding: 1px 4px; vertical-align: middle; margin-left: 4px; }
.mn-status-proc { background: #f59e0b; color: #fff; }
.mn-status-err  { background: #ef4444; color: #fff; }
/* 삭제 확인 폼 */
.mn-delete-confirm { margin-top: 12px; padding: 14px; background: var(--danger-light); border: 1px solid #fca5a5; border-radius: 8px; }
.mn-delete-warn { font-size: 13px; color: var(--danger); margin-bottom: 8px; }
.mn-delete-pw-input { width: 100%; padding: 6px 10px; border: 1px solid #fca5a5; border-radius: 6px; font-size: 13px; background: #fff; }
.mn-item-dur { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; min-width: 36px; }
.mn-item-center { flex: 1; min-width: 0; }
.mn-item-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-item-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* 상세 패널 */
.mn-detail-empty { height: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.mn-detail-inner { padding: 28px 32px; max-width: 760px; }
.mn-detail-head { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.mn-detail-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
/* 편집 모드 */
.mn-edit-title-input { width: 100%; font-size: 18px; font-weight: 700; border: 1px solid var(--primary); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; background: var(--bg); color: var(--text); }
.mn-edit-textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.7; background: var(--bg); color: var(--text); resize: vertical; font-family: inherit; }
.mn-edit-textarea:focus { outline: none; border-color: var(--primary); }
.mn-detail-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.mn-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mn-audio-expired { font-size: 12px; color: var(--muted); padding: 5px 10px; border: 1px dashed var(--border); border-radius: 6px; }
.mn-audio-btn { font-size: 12px; }
.mn-detail-section { margin-bottom: 20px; }
.mn-detail-section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.mn-detail-summary { font-size: 14px; color: var(--text); line-height: 1.7; margin: 0; }
.mn-script-toggle { background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; font-size: 12px; color: var(--muted); cursor: pointer; transition: background .12s; }
.mn-script-toggle:hover { background: var(--primary-light); color: var(--primary); }
.mn-script-body { margin-top: 12px; padding: 16px; background: var(--card); border-radius: 8px; border: 1px solid var(--border); font-size: 13px; line-height: 1.75; }

@media (max-width: 700px) {
  .mn-layout { flex-direction: column; }
  .mn-list-panel { flex: none; width: 100%; height: 260px; border-right: none; border-bottom: 1px solid var(--border); }
  .mn-detail-inner { padding: 16px; }
}

/* ── 새 회의 시작 버튼 ── */
.mn-new-meeting-btn { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity .15s; }
.mn-new-meeting-btn:hover { opacity: .85; }

/* ── 목록 아이템 (신규 형식) ── */
.mn-item { display: flex; flex-direction: row; align-items: center; gap: 0; padding: 11px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.mn-item:hover { background: var(--primary-light); }
.mn-item-active { background: var(--primary-light); border-right: 3px solid var(--primary); }
.mn-item-proc { opacity: .7; }
.mn-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mn-item-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-item-type { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-item-footer { display: flex; align-items: center; }
.mn-item-footer-text { font-size: 11px; color: var(--muted); }
.mn-item-badge-col { flex-shrink: 0; display: flex; align-items: center; padding-left: 10px; }
.mn-item-badge { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.mn-item-badge-proc { background: #fef3c7; color: #92400e; }
.mn-item-badge-err  { background: #fee2e2; color: #991b1b; }
.mn-item-badge-done { background: #dcfce7; color: #166534; }
/* ── 태그 필터 바 ── */
.mn-tag-filter-bar { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--bg); }
.mn-tag-filter-bar:empty { display: none; }
.mn-tag-btn { padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 11px; font-weight: 500; cursor: pointer; transition: background .12s, color .12s, border-color .12s; white-space: nowrap; }
.mn-tag-btn:hover { border-color: var(--primary); color: var(--primary); }
.mn-tag-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── 빈 상태 패널 ── */
.mn-empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 40px; }
.mn-empty-state-icon { font-size: 48px; }
.mn-empty-state-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.mn-empty-state-desc { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.7; }
.mn-empty-state-features { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.mn-empty-state-features span { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; }

/* ── 상세 패널 신규 구조 ── */
.mn-dv-wrap { display: flex; flex-direction: column; height: 100%; }
.mn-dv-header { padding: 20px 28px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mn-dv-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.mn-dv-title { font-size: 19px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.4; flex: 1; min-width: 0; }
.mn-dv-actions-top { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.mn-dv-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-bottom: 12px; }
.mn-dv-edit-title { width: 100%; font-size: 18px; font-weight: 700; border: 1px solid var(--primary); border-radius: 6px; padding: 6px 10px; margin-bottom: 0; background: var(--bg); color: var(--text); }
/* 더보기 메뉴 */
.mn-dv-more-menu { position: absolute; right: 28px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.12); z-index: 100; min-width: 120px; overflow: hidden; }
.mn-dv-header { position: relative; }
.mn-more-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 10px 16px; font-size: 13px; color: var(--text); cursor: pointer; }
.mn-more-item:hover { background: var(--hover); }
/* 탭 */
.mn-dv-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--card); flex-shrink: 0; padding: 0 28px; }
.mn-tab-btn { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .15s; white-space: nowrap; }
.mn-tab-btn:hover  { color: var(--primary); }
.mn-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
/* 탭 콘텐츠 */
.mn-dv-body { flex: 1; overflow-y: auto; }
.mn-tab-pane { display: none; }
.mn-tab-pane.active { display: block; }
.mn-dv-section { padding: 20px 28px; border-bottom: 1px solid var(--border); }
.mn-dv-section-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.mn-script-toggle { display: flex; gap: 0; padding: 12px 20px 0; }
.mn-script-btn { background: var(--bg); border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 500; padding: 5px 14px; cursor: pointer; transition: all .15s; }
.mn-script-btn:first-child { border-radius: 6px 0 0 6px; border-right: none; }
.mn-script-btn:last-child  { border-radius: 0 6px 6px 0; }
.mn-script-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mn-script-notice { margin: 6px 20px 0; font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 5px 10px; }
.mn-script-pane { display: none; }
.mn-script-pane.active { display: block; }
.mn-script-text { padding: 20px 28px; font-size: 13px; line-height: 1.8; color: var(--text); white-space: pre-wrap; word-break: break-word; }
/* 오디오 카드 */
.mn-audio-card { margin: 0 28px 20px; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mn-audio-card-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mn-audio-card-icon { font-size: 22px; flex-shrink: 0; }
.mn-audio-card-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mn-audio-card-meta { font-size: 11px; color: var(--muted); }

/* ── 새 회의 모달 ── */
.mn-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 8000; padding: 16px; }
.mn-modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 540px; max-height: 96vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.mn-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mn-modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.mn-modal-close { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.mn-modal-close:hover { background: var(--hover); color: var(--text); }
.mn-modal-body { overflow-y: auto; flex: 1; }
/* 폼 */
.mn-modal-form { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.mn-mf-group { display: flex; flex-direction: column; gap: 5px; }
.mn-mf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mn-mf-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.mn-mf-input { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; background: var(--bg); color: var(--text); outline: none; transition: border-color .15s; }
.mn-mf-input:focus { border-color: var(--primary); }
.mn-mf-select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: var(--bg); color: var(--text); cursor: pointer; outline: none; }
.mn-mf-textarea { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; background: var(--bg); color: var(--text); resize: vertical; font-family: inherit; line-height: 1.6; outline: none; width: 100%; box-sizing: border-box; transition: border-color .15s; }
.mn-mf-textarea:focus { border-color: var(--primary); }
/* 공개 범위 토글 */
.mn-mf-privacy-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mn-privacy-btn { flex: 1; border: none; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; padding: 7px 10px; cursor: pointer; transition: background .15s, color .15s; }
.mn-privacy-btn.active { background: #7c3aed; color: #fff; }
.mn-privacy-btn:hover:not(.active) { background: var(--hover); }
/* 모달 푸터 */
.mn-modal-footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); flex-shrink: 0; }
.mn-modal-footer-rec  { justify-content: space-between; }
.mn-modal-footer-memo { justify-content: flex-end; gap: 8px; }
.mn-modal-start-btn { background: #16a34a; color: #fff; border: none; border-radius: 8px; padding: 8px 20px; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity .15s; }
.mn-modal-start-btn:disabled { background: #9ca3af; cursor: not-allowed; opacity: .6; }
.mn-modal-start-btn:hover:not(:disabled) { opacity: .85; }
.mn-modal-stop-btn { background: #dc2626; color: #fff; border: none; border-radius: 8px; padding: 8px 20px; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity .15s; }
.mn-modal-stop-btn:hover { opacity: .85; }
.mn-modal-generate-btn { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 8px 20px; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity .15s; }
.mn-modal-generate-btn:hover { opacity: .85; }
/* 녹음 중 뷰 */
.mn-modal-rec  { padding: 20px 24px; display: flex; flex-direction: column; }
.mn-rec-timer-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mn-rec-dot { font-size: 14px; animation: mn-blink 1s step-start infinite; }
.mn-rec-timer { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; color: #dc2626; }
.mn-rec-privacy-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: #dcfce7; color: #16a34a; }
.mn-rec-privacy-badge.oo { background: #ede9fe; color: #7c3aed; }
.mn-rec-title { font-size: 14px; font-weight: 600; color: var(--text); }
/* 메모 정리 뷰 */
.mn-modal-memo { padding: 20px 24px; display: flex; flex-direction: column; }
.mn-memo-done-banner { display: flex; align-items: flex-start; gap: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 14px 16px; }
.mn-memo-done-icon { font-size: 22px; flex-shrink: 0; }
.mn-memo-done-title { font-size: 14px; font-weight: 700; color: #166534; }
.mn-memo-done-desc { font-size: 12px; color: #166534; margin-top: 3px; opacity: .8; }

/* ── 포털소개 탭 ── */
.intro-page { max-width: 1300px; margin: 0 auto; padding: 40px 32px; }
.intro-hero { text-align: center; margin-bottom: 52px; }
.intro-hero-logo { display: inline-block; font-size: 22px; font-weight: 800; color: var(--primary); background: var(--primary-light); padding: 8px 18px; border-radius: 10px; letter-spacing: .5px; margin-bottom: 18px; }
.intro-hero-title { font-size: 36px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.intro-hero-sub { font-size: 17px; color: var(--muted); margin: 0; }
.intro-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
@media (max-width: 640px)  { .intro-cards { grid-template-columns: 1fr; } }
.intro-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; min-height: 320px; }
.intro-card-icon { font-size: 40px; }
.intro-card-head { font-size: 21px; font-weight: 700; color: var(--text); }
.intro-card-desc { font-size: 15px; color: var(--muted); }
.intro-card-list { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text); line-height: 2.1; }
.intro-card-formula { font-size: 13px; color: var(--primary); background: var(--primary-light); border-radius: 8px; padding: 10px 16px; font-family: monospace; }
.intro-card-btn { margin-top: auto; align-self: flex-start; background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 11px 22px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.intro-card-btn:hover { opacity: .85; }

/* ── 문서함 탭 ── */
.docs-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 32px; background: var(--card); border-bottom: 1px solid var(--border);
}
.docs-toolbar-title { font-size: 15px; font-weight: 700; color: var(--text); }
.docs-body { padding: 20px 40px; max-width: calc(100% - 80px); margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }

.docs-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.docs-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.docs-section-title { font-size: 15px; font-weight: 700; color: var(--text); }
.docs-section-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary);
}
.docs-error-badge { font-size: 12px; color: var(--danger); margin-left: auto; }
.docs-empty { padding: 20px; color: var(--muted); font-size: 13px; }
.docs-section-body { padding: 12px 16px 16px; }

.docs-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0; padding: 12px;
}
.docs-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--border); margin: 4px;
  transition: all .15s; background: var(--card);
}
.docs-card:hover { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 2px 8px rgba(79,70,229,.08); }
.docs-card-title   { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; word-break: break-word; }
.docs-card-summary { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.docs-card-date    { font-size: 11px; color: var(--muted); margin-top: auto; }
.docs-card-footer  { display: flex; justify-content: space-between; align-items: center; margin-top: auto; gap: 8px; }
.docs-card-link    { font-size: 11px; color: var(--primary); text-decoration: none; white-space: nowrap; }
.docs-card-link:hover { text-decoration: underline; }
.docs-card-error   { border-color: var(--danger); background: #fff5f5; }

/* ── Amplitude 카테고리 아코디언 ── */
.amp-cat-accordion { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.amp-cat-item      { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.amp-cat-header    {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  cursor: pointer; background: var(--bg); user-select: none;
  transition: background .15s;
}
.amp-cat-header:hover { background: var(--primary-light); }
.amp-cat-name   { font-size: 13px; font-weight: 600; flex: 1; color: var(--text); }
.amp-cat-count  { font-size: 12px; color: var(--muted); }
.amp-cat-chevron { font-size: 11px; color: var(--muted); transition: transform .2s; }
.amp-cat-item.open .amp-cat-chevron { transform: rotate(180deg); }
.amp-cat-body   { display: none; border-top: 1px solid var(--border); }
.amp-cat-item.open .amp-cat-body { display: block; }

/* ── Amplitude 공식 가이드 Master-Detail ──────────────────────────────────── */
.amp-guide-layout { display: grid; grid-template-columns: 300px 1fr; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 12px; }
.amp-guide-list-panel { border-right: 1px solid var(--border); overflow-y: auto; max-height: calc(100vh - 220px); background: var(--bg); }
.amp-guide-detail-panel { overflow-y: auto; max-height: calc(100vh - 220px); padding: 20px 24px; }
/* 카테고리 헤더 */
.amp-guide-cat-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.amp-guide-cat-header:hover { background: var(--primary-light); }
.amp-guide-cat-name  { flex: 1; font-size: 12px; font-weight: 700; color: var(--text); }
.amp-guide-cat-count { font-size: 11px; color: var(--muted); }
.amp-guide-chevron   { font-size: 10px; color: var(--muted); transition: transform .2s; }
.amp-guide-cat.open .amp-guide-chevron { transform: rotate(180deg); }
/* 문서 목록 */
.amp-guide-cat-docs { display: none; }
.amp-guide-cat.open .amp-guide-cat-docs { display: block; }
.amp-guide-list-row { display: flex; align-items: center; gap: 6px; padding: 8px 12px 8px 18px; font-size: 12px; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--border); transition: background .1s; }
.amp-guide-list-row:hover { background: var(--primary-light); }
.amp-guide-list-row.active { background: var(--primary); color: #fff; }
.amp-guide-list-row.active .amp-guide-badge-fail { background: rgba(255,255,255,.25); color: #fff; }
.amp-guide-list-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amp-guide-no-guide { opacity: .55; }
.amp-guide-badge-fail { flex-shrink: 0; font-size: 10px; background: var(--danger-light); color: var(--danger); padding: 1px 5px; border-radius: 4px; }
/* 우측 상세 패널 */
.amp-guide-detail-empty { display: flex; align-items: center; justify-content: center; height: 100%; flex-direction: column; gap: 14px; color: var(--muted); font-size: 14px; text-align: center; }
.amp-guide-orig-link-btn { padding: 8px 18px; background: var(--primary); color: #fff; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; }
.amp-guide-detail-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; line-height: 1.4; }
.amp-guide-detail-cat { font-size: 12px; color: var(--muted); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.amp-guide-detail-content { font-size: 14px; color: var(--text); line-height: 1.8; }
.amp-guide-detail-content h1,.amp-guide-detail-content h2,.amp-guide-detail-content h3 { font-size: 15px; font-weight: 700; margin: 18px 0 8px; color: var(--text); }
.amp-guide-detail-content ul,.amp-guide-detail-content ol { padding-left: 20px; margin: 8px 0; }
.amp-guide-detail-content li { margin: 4px 0; }
.amp-guide-detail-content strong { font-weight: 700; }
.amp-guide-detail-content p { margin: 8px 0; }
.amp-guide-detail-content pre,.amp-guide-detail-content .md-code { background: #1e1e2e; color: #cdd6f4; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 12px; font-family: monospace; margin: 10px 0; }
.amp-guide-detail-content code { background: var(--primary-light); color: var(--primary); padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: monospace; }
.amp-guide-detail-content pre code,.amp-guide-detail-content .md-code code { background: transparent; color: inherit; padding: 0; border-radius: 0; }
.amp-guide-detail-content .mermaid { margin: 16px 0; text-align: center; overflow-x: auto; background: #fff; border-radius: 8px; padding: 16px; border: 1px solid var(--border); }
.amp-guide-orig-link { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.amp-guide-orig-link a { color: var(--primary); font-size: 13px; text-decoration: none; font-weight: 500; }
.amp-guide-orig-link a:hover { text-decoration: underline; }
@media (max-width: 768px) { .amp-guide-layout { grid-template-columns: 1fr; } .amp-guide-list-panel { max-height: 260px; border-right: none; border-bottom: 1px solid var(--border); } .amp-guide-detail-panel { max-height: none; padding: 18px 16px; } }

/* ── Loading ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
}
.loading::before {
  content: '';
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ── Error ── */
.error {
  background: var(--danger-light);
  color: #991b1b;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid #fca5a5;
  font-size: 13px;
}

/* ── Section titles (legacy, kept for safety) ── */
.subtitle { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Alerts ── */
.alerts {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.alerts-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.alert-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.alert-chip.warning { background: var(--warning-light); color: #92400e; }
.alert-chip.danger  { background: var(--danger-light);  color: #991b1b; }

/* ── Member grid ── */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.member-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.member-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.member-card.accumulating { border-style: dashed; opacity: .8; }
.member-accumulating {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  letter-spacing: .01em;
  margin-bottom: 10px;
}

.member-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.member-name { font-size: 15px; font-weight: 700; }

.tier-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
}

.slot-info {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.gauge-track {
  background: var(--border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.gauge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s ease;
  min-width: 2px;
}
.gauge-fill.success { background: linear-gradient(90deg, #34d399, var(--success)); }
.gauge-fill.warning { background: linear-gradient(90deg, #fbbf24, var(--warning)); }
.gauge-fill.danger  { background: linear-gradient(90deg, #f87171, var(--danger)); }

.member-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pct-label {
  font-size: 14px;
  font-weight: 700;
}
.pct-label.success { color: var(--success); }
.pct-label.warning { color: var(--warning); }
.pct-label.danger  { color: var(--danger); }

.task-count {
  font-size: 12px;
  color: var(--muted);
}

/* ── Chart card ── */
.chart-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  background: #f8fafc;
  padding: 11px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

/* ── W-score badges ── */
.w-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.w-badge.w-high { background: var(--danger-light);  color: #991b1b; }
.w-badge.w-mid  { background: var(--warning-light); color: #92400e; }
.w-badge.w-low  { background: var(--success-light); color: #065f46; }

/* ── Todo cards ── */
.project-todo-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.project-todo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}
.project-todo-header h3 {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}
.completion-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.completion-bar {
  background: var(--border);
  border-radius: 999px;
  height: 5px;
  margin-bottom: 14px;
  overflow: hidden;
}
.completion-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 999px;
  transition: width .6s;
}

.todo-list { list-style: none; }

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.todo-item:last-child { border-bottom: none; }

.todo-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.todo-assignee {
  font-size: 11px;
  color: var(--muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.todo-more {
  padding: 8px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.all-done {
  font-size: 13px;
  color: var(--success);
  padding: 8px 0;
  font-weight: 500;
}

.stat-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 140px;
}
.stat-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); margin-top: 4px; }
.stat-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Unmatched assignee warning ── */
.unmatched-warn {
  margin-top: 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.7;
}
.unmatched-warn code {
  background: #fef3c7;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

/* ── Tab toolbar (새로고침 + 마지막 업데이트) ── */
.tab-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.last-updated {
  font-size: 11px;
  color: var(--muted);
}
.tab-refresh-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.tab-refresh-btn:hover { background: var(--bg); color: var(--primary); border-color: var(--primary); }

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-title-text h2 { font-size: 17px; font-weight: 700; }
.section-title-text .subtitle { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Vacancy banner ── */
.vacancy-banner {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Keyword badges ── */
.kw-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.kw-design   { background: #fee2e2; color: #991b1b; }
.kw-analysis { background: #fef3c7; color: #92400e; }
.kw-share    { background: #d1fae5; color: #065f46; }
.kw-other    { background: #f1f5f9; color: #64748b; }

/* ── Client badges ── */
.client-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.cb-vip    { background: var(--purple-light); color: var(--purple); }
.cb-normal { background: var(--primary-light); color: var(--primary); }
.cb-none   { background: #f1f5f9; color: #94a3b8; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }

.modal-content {
  background: var(--card);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-title-wrap { display: flex; align-items: center; gap: 10px; }
.modal-member-name { font-size: 18px; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--bg);
  border-radius: 8px; cursor: pointer;
  font-size: 16px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body { padding: 20px 24px; }

.modal-section { margin-bottom: 24px; }
.modal-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}

.modal-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.modal-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal-donut-wrap canvas { max-width: 180px; max-height: 180px; }

.kw-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.kw-stat-row:last-child { border-bottom: none; }
.kw-stat-count {
  margin-left: auto;
  font-weight: 700;
  color: var(--text);
  background: #f1f5f9;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 12px;
}

/* ── Settings tab ── */
.settings-section { margin-bottom: 32px; }
.settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.settings-table th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.settings-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.settings-table td:last-child { cursor: default; }
.settings-table tr:last-child td { border-bottom: none; }
.settings-table tr:hover td { background: #f8fafc; }
.settings-table td.editing { padding: 4px 8px; background: #f0f9ff; }

.settings-input {
  width: 100%;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  outline: none;
  background: white;
}

.settings-add-row td { background: #f8fafc; }
.settings-add-input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  width: 100%;
  outline: none;
}
.settings-add-input:focus { border-color: var(--primary); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger  { background: var(--danger-light); color: #991b1b; }
.btn-danger:hover  { background: #fca5a5; }
.btn-ghost   { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover   { color: var(--primary); border-color: var(--primary); }

.settings-action-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.vacancy-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.vacancy-item span { flex: 1; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  transition: opacity .3s;
}
.toast.hidden { display: none; }

/* ── Info box (업무 부담률 설명) ── */
.info-box {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.info-box.info-box-why {
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  border: 1px solid #fde047;
  border-left: 4px solid #f59e0b;
}
.info-box.info-box-why .info-box-title {
  color: #92400e;
}
.info-box.info-box-why p {
  font-size: 13px;
  line-height: 1.7;
  color: #78350f;
  margin: 0;
}
.info-box-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.info-box-block {
  flex: 1;
  min-width: 260px;
}
.info-box-title {
  font-size: 14px;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 8px;
}
.info-box-block > p {
  font-size: 13px;
  color: #0c4a6e;
  margin-bottom: 10px;
  line-height: 1.6;
}
.info-box-levels {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.info-level {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}
.info-level.success { background: var(--success-light); color: #065f46; }
.info-level.warning { background: var(--warning-light); color: #92400e; }
.info-level.danger  { background: var(--danger-light);  color: #991b1b; }
.info-box-divider {
  width: 1px;
  background: #bae6fd;
  align-self: stretch;
  flex-shrink: 0;
}
.info-box-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.info-box-list li {
  font-size: 13px;
  color: #0c4a6e;
  padding: 3px 0;
  border-bottom: 1px solid #e0f2fe;
  line-height: 1.5;
}
.info-box-list li:last-child { border-bottom: none; }
.info-box-list strong { color: #0369a1; }

/* ── W score tab description ── */
.wscore-desc {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* ── Asana tag badges ── */
.asana-tag-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  margin-left: 3px;
  vertical-align: middle;
}

/* ── Importance badges ── */
.importance-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Blocked status ── */
.status-blocked {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #991b1b;
  white-space: nowrap;
}

/* ── Subtask marker ── */
.subtask-marker {
  font-size: 11px;
  color: var(--muted);
  margin-right: 3px;
}

/* ── AI classification badges ── */
.ai-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: #cffafe;
  color: #0e7490;
}
.ai-badge.ai-pending {
  background: #f1f5f9;
  color: #94a3b8;
  font-weight: 500;
}

/* ── W score filter row ── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.filter-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--primary); }

/* ── Member card actions (서머리 버튼) ── */
.member-card-actions {
  padding: 4px 12px 10px;
  display: flex;
  justify-content: flex-end;
}
.btn-summary {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.btn-summary:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ── History tab ── */
.history-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.history-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .history-charts-row { grid-template-columns: 1fr; } }
.history-chart-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.history-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}
.history-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.history-month-header h3 { font-size: 16px; font-weight: 700; }
.history-month-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.history-month-stats strong { color: var(--text); }
.member-clients {
  padding: 0 12px 8px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.client-tag {
  font-size: 11px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 7px;
  border-radius: 10px;
}

/* ── Admin modal animation ── */
#admin-modal .modal-content {
  animation: modal-scale-in .18s ease;
}
@keyframes modal-scale-in {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Summary modal ── */
.summary-modal-content { max-width: 720px; width: 96vw; }
.summary-body {
  max-height: 72vh;
  overflow-y: auto;
  padding: 24px 28px;
}
.summary-content h2 {
  font-size: 18px; font-weight: 700; margin-bottom: 6px;
}
.summary-content h3 {
  font-size: 15px; font-weight: 700; color: var(--primary);
  margin-top: 20px; margin-bottom: 8px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.summary-content h4 { font-size: 13px; font-weight: 600; margin-top: 12px; }
.summary-content ul,
.summary-content ol { padding-left: 18px; margin-bottom: 10px; }
.summary-content li { margin-bottom: 5px; line-height: 1.6; }
.summary-content p  { line-height: 1.7; margin-bottom: 8px; }
.summary-content strong { font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 768px) {
  header, main, .portal-placeholder-main { padding: 14px 16px; }
  header { height: auto; padding: 12px 16px; }
  .portal-nav { padding: 0 16px; overflow-x: auto; }
  .portal-btn { padding: 8px 12px; font-size: 12px; white-space: nowrap; }
  .tabs { padding: 0 16px; overflow-x: auto; }
  .tab-btn { padding: 12px 14px; font-size: 13px; white-space: nowrap; }
  .member-grid { grid-template-columns: 1fr; }
  .stat-row { gap: 10px; }
}

/* ── Grade badges (client difficulty) ── */
.grade-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.grade-badge-hard   { background: #fee2e2; color: #991b1b; }
.grade-badge-normal { background: #f1f5f9; color: #475569; }
.grade-badge-easy   { background: #d1fae5; color: #065f46; }

/* ── Client badge variants ── */
.cb-hard   { background: #fee2e2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }
.cb-easy   { background: #d1fae5 !important; color: #065f46 !important; border-color: #6ee7b7 !important; }
.cb-vip    { background: #fee2e2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }

/* ── AI difficulty badge ── */
.ai-diff-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  white-space: nowrap;
}

/* ── Formula guide card (설정 탭) ── */
.formula-guide-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #f8fafc;
}
.formula-guide-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
}
.formula-guide-header:hover { background: #f1f5f9; }
.formula-guide-arrow { font-size: 13px; color: var(--muted); white-space: nowrap; }
.formula-guide-body {
  padding: 0 16px 16px;
  border-top: 1px solid #e2e8f0;
}
.formula-step {
  margin-top: 12px;
  padding: 12px 14px;
  background: white;
  border-radius: 6px;
  border-left: 3px solid #6366f1;
  border: 1px solid #e9ecef;
  border-left: 3px solid #6366f1;
}
.formula-step-num {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6366f1;
  margin-bottom: 3px;
}
.formula-step-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.formula-block {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 12px;
  color: #1e293b;
  word-break: break-all;
}
.formula-coeff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.formula-coeff-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; padding: 8px 10px; font-size: 12px; line-height: 1.6; }
.formula-mini-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.formula-mini-table th { background: #f1f5f9; padding: 4px 8px; text-align: left; font-weight: 600; border: 1px solid #e2e8f0; }
.formula-mini-table td { padding: 4px 8px; border: 1px solid #e2e8f0; }
.fw-bold { font-weight: 700; }

/* ── 프로젝트별 탭: 구성원 비중 바 ── */
.mbr-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 1px; margin-bottom: 3px; }
.mbr-seg { height: 100%; min-width: 4px; cursor: default; }
.mbr-labels { display: flex; gap: 6px; flex-wrap: wrap; font-size: 10px; }

/* ── 난이도 점수 탭: 지연 배지 ── */
.overdue-badge { display: inline-block; background: #fee2e2; color: #991b1b; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-left: 4px; vertical-align: middle; }
.wscore-filters { flex-wrap: wrap; gap: 6px; }
.btn-reset { background: #f1f5f9; border: 1px solid #e2e8f0; color: var(--muted); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.btn-reset:hover { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ── To-do 탭: 완료 고객사 압축 카드 ── */
.done-clients-card { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; color: #166534; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.done-chip { background: #dcfce7; border: 1px solid #86efac; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }

/* ── To-do 탭: 유사 태스크 그룹 ── */
.todo-grp { background: #fafafa; }
.grp-badge { display: inline-block; background: #e0e7ff; color: #3730a3; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-right: 4px; }
.od-dot { font-size: 10px; margin-right: 2px; }

/* ── To-do 탭: 뷰 전환 버튼 ── */
.view-toggle { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.view-btn { background: #fff; border: none; padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--muted); }
.view-btn.active { background: var(--primary); color: #fff; font-weight: 600; }
.view-btn:hover:not(.active) { background: var(--bg); }

/* ── To-do 탭: 달력 뷰 ── */
.cal-wrap { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; margin-bottom: 20px; overflow-x: auto; }
.cal-title { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; min-width: 560px; }
.cal-hd { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 4px; min-height: 64px; padding: 4px; font-size: 11px; }
.cal-cell.cal-empty { background: transparent; border-color: transparent; }
.cal-cell.cal-today { background: #eff6ff; border-color: #bfdbfe; }
.cal-cell.cal-has { border-color: #c7d2fe; }
.cal-cell.cal-clickable { cursor: pointer; transition: background .12s; }
.cal-cell.cal-clickable:hover { background: #eef2ff; }
.cal-dn { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.cal-today .cal-dn { color: var(--primary); }
.cal-dot { background: #e0e7ff; color: #3730a3; border-radius: 3px; padding: 1px 3px; margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; cursor: default; }
.cal-dot.cal-dot-od { background: #fee2e2; color: #991b1b; }
.cal-more { font-size: 10px; color: var(--muted); text-align: right; }

/* ── 달력 날짜 클릭 팝업 ─────────────────────────────────── */
#cal-popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 299; }
#cal-popup-overlay.hidden { display: none; }
#cal-date-popup {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--card-bg, #fff); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.18);
  min-width: 340px; max-width: 520px; width: 90vw;
  max-height: 72vh; overflow-y: auto; z-index: 300; padding: 0;
}
#cal-date-popup.hidden { display: none; }
.cal-popup-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.cal-popup-date { font-size: 15px; font-weight: 700; color: var(--text); }
.cal-popup-count { font-size: 12px; color: var(--muted); margin-left: 8px; }
.cal-popup-close { background: transparent; border: none; font-size: 16px; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.cal-popup-close:hover { background: var(--primary-light); color: var(--primary); }
.cal-popup-body { padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.cal-popup-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 12px 0; }
.cal-popup-task { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: 7px; transition: background .1s; }
.cal-popup-task:hover { background: var(--primary-light); }
.cal-popup-done { opacity: .55; }
.cal-popup-check { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.cal-popup-link { color: var(--text); text-decoration: none; flex: 1; line-height: 1.4; word-break: break-all; }
.cal-popup-link:hover { color: var(--primary); text-decoration: underline; }
.cal-popup-who { flex-shrink: 0; font-size: 11px; color: var(--muted); white-space: nowrap; align-self: center; margin-left: 4px; }

/* ── 히스토리 탭: 자동 요약 ── */
.auto-summary { font-size: 11px; color: var(--muted); padding: 4px 0 0; border-top: 1px dashed var(--border); margin-top: 6px; }
.history-month-body { display: flex; flex-direction: column; gap: 16px; }

/* ── 히스토리 탭: 고객사별 담당자 기여도 도넛 그리드 ── */
.client-donut-section { width: 100%; }
.client-donut-title { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.client-donut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.client-donut-card { display: flex; flex-direction: column; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 12px 14px; }
.client-donut-card canvas { display: block; }
.client-donut-label { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 10px; text-align: center; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 프로젝트별 탭: 고객사 자동병합 배지 ── */
.auto-merge-badge { display:inline-block; font-size:10px; color:#92400e; background:#fef3c7; border:1px solid #fde68a; border-radius:3px; padding:1px 5px; margin-left:5px; vertical-align:middle; white-space:nowrap; }

/* ── 팀 현황 탭: 멤버 카드 인라인 코멘트 ── */
.member-inline-comment { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; border-top: 1px dashed var(--border); padding-top: 6px; }

/* ── 멤버 모달: 완료 태스크 카드 리스트 ── */
.task-card-list { display: flex; flex-direction: column; gap: 5px; max-height: 50vh; overflow-y: auto; padding-right: 2px; }
.task-card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); min-width: 0; }
.task-card-row:hover { background: var(--primary-light); border-color: #c7d2fe; }
.task-card-name { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text); }
.task-card-meta { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.task-card-days { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── AI 분류: 추정 배지 ── */
.ai-estimated-badge { display:inline-block; font-size:10px; color:#78350f; background:#fef3c7; border:1px solid #fde68a; border-radius:3px; padding:1px 4px; margin-left:3px; cursor:help; vertical-align:middle; white-space:nowrap; }

/* ── 온보딩 탭 서브탭 ── */
.ob-subtab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  padding: 0 20px;
}
.ob-subtab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.ob-subtab-btn:hover { color: var(--text); }
.ob-subtab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ── 온보딩 탭 ── */
.ob-wrap { display: flex; flex-direction: column; gap: 16px; padding: 20px; max-width: 860px; margin: 0 auto; }
.ob-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ob-title { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; }
.ob-updated { font-size: 12px; color: var(--muted); }
.ob-regen-btn { font-size: 12px; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; white-space: nowrap; }
.ob-regen-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.ob-content { font-size: 14px; line-height: 1.8; color: var(--text); }
.ob-content h1 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.ob-content h2 { font-size: 17px; font-weight: 600; margin: 22px 0 10px; color: var(--text); }
.ob-content h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; color: var(--muted); }
.ob-content p { margin: 8px 0; }
.ob-content ul, .ob-content ol { padding-left: 20px; margin: 6px 0; }
.ob-content li { margin: 4px 0; }
.ob-content blockquote { border-left: 3px solid var(--primary); padding: 8px 14px; margin: 10px 0; background: var(--primary-light); border-radius: 0 6px 6px 0; font-size: 13px; color: var(--muted); }
.ob-content pre { background: #1e1e2e; color: #cdd6f4; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 12px; margin: 10px 0; }
.ob-content code { background: var(--primary-light); color: var(--primary); padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: monospace; }
.ob-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.ob-content a:hover { opacity: 0.8; }
.ob-sources { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); margin-top: 8px; }
.ob-sources-title { width: 100%; font-size: 12px; font-weight: 600; color: var(--muted); }
.ob-source-link { font-size: 12px; padding: 4px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.ob-source-link:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.ob-loading, .ob-empty, .ob-error { padding: 40px 20px; text-align: center; font-size: 14px; color: var(--muted); }
.ob-error { color: var(--danger, #ef4444); }

/* ── 우리팀 문서 탭 — linkOnly 섹션 ── */
.td-link-section { padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 12px; }
.td-link-cat { display: flex; flex-direction: column; gap: 8px; }
.td-link-cat-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 4px; }

/* ── 우리팀 문서 탭 — synthesized 아코디언 ── */
.td-synth-accordion { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 12px; }
.td-synth-item { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.td-synth-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; background: var(--bg); user-select: none; }
.td-synth-name { font-size: 13px; font-weight: 600; flex: 1; color: var(--text); }
.td-synth-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.td-synth-chevron { font-size: 11px; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.td-synth-item.open .td-synth-chevron { transform: rotate(180deg); }
.td-synth-body { display: none; border-top: 1px solid var(--border); }
.td-synth-item.open .td-synth-body { display: block; }
.td-synth-content { padding: 16px 20px; font-size: 13px; line-height: 1.75; max-height: 600px; overflow-y: auto; }
.td-synth-sources { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 12px; border-top: 1px dashed var(--border); background: var(--bg); }
.td-synth-sources-label { font-size: 11px; color: var(--muted); align-self: center; white-space: nowrap; }
.td-synth-source-link { font-size: 11px; padding: 3px 10px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.td-synth-source-link:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* ── 마크다운 테이블 ── */
.md-table-wrap { overflow-x: auto; margin: 12px 0; border-radius: 6px; border: 1px solid var(--border); }
.md-table { border-collapse: collapse; width: 100%; min-width: 320px; font-size: 13px; }
.md-table th, .md-table td { padding: 8px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.md-table th { background: var(--primary-light); color: var(--primary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid var(--border); }
.md-table tbody tr:nth-child(even) { background: var(--bg); }
.md-table tbody tr:hover { background: var(--primary-light); }
.md-table tbody tr:last-child td { border-bottom: none; }
/* 고객사 배지 */
.td-client-badge { background: #f0f4ff; color: #4a6cf7; font-weight: 600; }

/* 택소노미 고객사 등록 현황 그리드 */
.taxo-progress { margin: 8px 4px 12px; }
.taxo-progress-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.taxo-progress-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.taxo-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s; }
.taxo-cust-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.taxo-cust-card { display: flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.taxo-cust-yes { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; text-decoration: none; }
.taxo-cust-yes:hover { background: #c8e6c9; }
.taxo-cust-no { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.taxo-missing { font-size: 11px; opacity: .7; }

/* 고객사 페이지 바로가기 그리드 */
.td-link-meta { font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.cust-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 4px 0; }
.cust-page-card { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg, #fff); text-decoration: none; color: var(--text); font-size: 13px; font-weight: 500; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.cust-page-card:hover { border-color: var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.cust-page-name { word-break: break-word; line-height: 1.4; }
.cust-page-badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; white-space: nowrap; align-self: flex-start; }
.cust-badge-active { background: #e8f5e9; color: #2e7d32; }
.cust-badge-done   { background: #f5f5f5; color: #757575; }
.cust-badge-hold   { background: #fff8e1; color: #e65100; }
.cust-filter-bar { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.cust-filter-btn { font-size: 12px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); background: none; cursor: pointer; color: var(--muted); transition: all .15s; }
.cust-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.cust-filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* Amplitude 업데이트 — 필터 바 */
.upd-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.upd-filter-btn { padding: 4px 12px; border: 1px solid var(--border); border-radius: 20px; background: transparent; font-size: 12px; color: var(--muted); cursor: pointer; transition: all .15s; white-space: nowrap; }
.upd-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.upd-filter-btn.active { background: var(--primary, #4f46e5); border-color: var(--primary, #4f46e5); color: #fff; font-weight: 600; }

/* Amplitude 업데이트 — Master-Detail 레이아웃 */
.upd-master-detail { display: grid; grid-template-columns: 300px 1fr; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; min-height: 500px; }
.upd-list-panel { overflow-y: auto; max-height: calc(100vh - 220px); border-right: 1px solid var(--border); background: var(--card); }
.upd-list-row { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
.upd-list-row:last-child { border-bottom: none; }
.upd-list-row:hover { background: var(--hover-bg, #f5f5f5); }
.upd-list-row.active { background: var(--primary-light, #eef2ff); border-left: 3px solid var(--primary, #4f46e5); padding-left: 11px; }
.upd-list-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.upd-list-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; word-break: break-word; overflow-wrap: break-word; }
.upd-list-row.active .upd-list-title { color: var(--primary, #4f46e5); font-weight: 600; }
.upd-cat-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; letter-spacing: 0.02em; white-space: nowrap; }
.upd-item-date { font-size: 11px; color: var(--muted); }
.upd-unread-dot { font-size: 9px; color: #e53e3e; line-height: 1; flex-shrink: 0; }

/* Amplitude 업데이트 — 상세 패널 */
.upd-detail-panel { overflow-y: auto; max-height: calc(100vh - 220px); padding: 20px 24px; background: var(--bg, #fafafa); }
.upd-detail-empty { display: flex; align-items: center; justify-content: center; min-height: 280px; color: var(--muted); font-size: 13px; text-align: center; }
.upd-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.upd-detail-title { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.45; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); word-break: break-word; overflow-wrap: break-word; }

/* 마크다운 렌더링 영역 */
.upd-note-content { font-size: 13px; line-height: 1.85; color: var(--text); word-break: break-word; overflow-wrap: break-word; }
.upd-note-content h1 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.upd-note-content h2 { font-size: 15px; font-weight: 600; margin: 14px 0 6px; }
.upd-note-content h3 { font-size: 13px; font-weight: 600; margin: 10px 0 4px; color: var(--muted); }
.upd-note-content h1:first-child, .upd-note-content h2:first-child, .upd-note-content h3:first-child { margin-top: 0; }
.upd-note-content p { margin: 6px 0; }
.upd-note-content ul, .upd-note-content ol { padding-left: 20px; margin: 6px 0; }
.upd-note-content li { margin: 3px 0; }
.upd-note-content strong { font-weight: 700; }
.upd-note-content blockquote { border-left: 3px solid var(--primary); padding: 6px 12px; margin: 8px 0; background: var(--primary-light); border-radius: 0 6px 6px 0; font-size: 12px; color: var(--muted); }
.upd-note-content pre { background: #1e1e2e; color: #cdd6f4; padding: 12px 14px; border-radius: 6px; overflow-x: auto; font-size: 12px; margin: 8px 0; }
.upd-note-content code { background: var(--primary-light); color: var(--primary); padding: 2px 5px; border-radius: 3px; font-size: 12px; }
.upd-orig-link { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); text-align: right; }
.upd-orig-link a { font-size: 12px; color: var(--primary); text-decoration: none; opacity: 0.75; }
.upd-orig-link a:hover { opacity: 1; text-decoration: underline; }

/* Amplitude 업데이트 — 모바일 반응형 */
@media (max-width: 700px) {
  .upd-master-detail { grid-template-columns: 1fr; }
  .upd-list-panel { border-right: none; border-bottom: 1px solid var(--border); max-height: 260px; }
  .upd-detail-panel { max-height: none; }
}

/* Amplitude 대시보드 모음 */
.amp-login-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; padding: 6px 10px; background: #fff8e1; border-radius: 6px; border-left: 3px solid #f9a825; }
.amp-badge { background: #fff3e0; color: #e65100; }

/* 대시보드 추가 버튼 */
.amp-add-btn { margin-left: auto; padding: 5px 12px; font-size: 12px; font-weight: 600; border: 1.5px solid var(--primary); border-radius: 6px; background: var(--primary-light); color: var(--primary); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.amp-add-btn:hover { background: var(--primary); color: #fff; }

/* 대시보드 추가 폼 */
.amp-form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.amp-form-label { font-size: 13px; font-weight: 600; color: var(--text); }
.amp-required { color: var(--danger); }
.amp-form-input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--bg); color: var(--text); width: 100%; box-sizing: border-box; transition: border-color .15s; }
.amp-form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.amp-form-err { font-size: 12px; color: var(--danger); margin-top: 2px; }
.amp-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.amp-form-actions .btn-ghost, .amp-form-actions .btn-primary { padding: 8px 20px; font-size: 14px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; font-weight: 600; }
.amp-form-actions .btn-ghost { background: var(--bg); color: var(--muted); border-color: var(--border); }
.amp-form-actions .btn-ghost:hover { color: var(--primary); border-color: var(--primary); }
.amp-form-actions .btn-primary { background: var(--primary); color: #fff; }
.amp-form-actions .btn-primary:hover { background: var(--primary-dark); }
.amp-form-actions .btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* 수동 등록 카드 — 등록자 표시 */
.amp-added-by { font-size: 11px; color: var(--muted); margin-left: auto; }

/* ── 문서함 사이드바 레이아웃 ── */
.docs-layout { display: flex; gap: 20px; align-items: flex-start; }

.docs-sidebar {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  position: sticky;
  top: 68px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  width: 100%;
  transition: background .15s, color .15s;
}
.docs-sidebar-item:hover { background: var(--primary-light); color: var(--primary); }
.docs-sidebar-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
  padding-left: 9px;
}
.docs-sidebar-icon { font-size: 15px; flex-shrink: 0; line-height: 1; }
.docs-sidebar-icon-img { display: block; vertical-align: middle; }
.docs-sidebar-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docs-sidebar-badge {
  font-size: 11px; font-weight: 600;
  background: var(--border); color: var(--muted);
  padding: 1px 6px; border-radius: 10px;
  flex-shrink: 0;
}
.docs-sidebar-item.active .docs-sidebar-badge { background: var(--primary-light); color: var(--primary); }

.docs-content { flex: 1; min-width: 0; }
.docs-section-pane { /* shown/hidden via display:none */ }

/* 모바일: 가로 스크롤 탭 */
@media (max-width: 700px) {
  .docs-layout { flex-direction: column; gap: 12px; }
  .docs-sidebar {
    width: 100%; min-width: unset;
    flex-direction: row;
    overflow-x: auto; scrollbar-width: none;
    position: static;
    padding: 4px;
    gap: 0;
    border-radius: 8px;
  }
  .docs-sidebar::-webkit-scrollbar { display: none; }
  .docs-sidebar-item {
    flex-direction: column; gap: 3px;
    padding: 8px 14px;
    white-space: nowrap; flex-shrink: 0;
    font-size: 12px; border-radius: 6px;
    justify-content: center;
  }
  .docs-sidebar-item.active {
    box-shadow: none;
    border-bottom: 3px solid var(--primary);
    border-radius: 6px 6px 0 0;
    padding-left: 14px;
  }
  .docs-sidebar-icon { font-size: 16px; }
  .docs-sidebar-badge { display: none; }
}

/* ── Admin 서브탭 네비게이션 ───────────────────────────── */
.admin-subtab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.admin-subtab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.admin-subtab-btn:hover { color: var(--text); }
.admin-subtab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ── 포털 소개 카드 그리드 ──────────────────────────────── */
.admin-intro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1100px) {
  .admin-intro-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .admin-intro-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  #portal-settings { padding: 20px 32px; }
}
.admin-intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.admin-intro-card-header {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.admin-intro-formula {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.admin-intro-subtitle {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
}
.admin-intro-vars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.admin-intro-var {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-intro-var strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.admin-intro-var-desc {
  font-size: 12px;
  color: var(--muted);
}
.admin-intro-thresholds {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-intro-note {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  margin-top: 8px;
}
.admin-intro-note a {
  color: var(--primary);
  text-decoration: underline;
  font-style: normal;
}

/* ── 문서함 소메뉴 (sticky) ─────────────────────────────── */
.docs-submenu {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  display: flex;
  gap: 4px;
  padding: 8px 0 0;
  margin-bottom: 24px;
}
.docs-submenu-item {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 7px 16px 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}
.docs-submenu-item:hover { color: var(--text); }
.docs-submenu-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ── 팀 문서 섹션 스크롤 구분 ──────────────────────────── */
.docs-team-sections { display: flex; flex-direction: column; gap: 40px; }
.docs-team-section {
  scroll-margin-top: 130px; /* sticky header 60px + submenu ~52px + 여유 */
}

/* ── 사이드바 2개 메뉴일 때 충분한 높이 ─────────────────── */
@media (min-width: 701px) {
  .docs-sidebar { min-height: unset; }
}

/* ── admin 포털 버튼 우측 정렬 ─────────────────────────── */
.portal-btn-admin { margin-left: auto; }

/* ── 문서함 사이드바 세로 서브메뉴 ─────────────────────── */
.docs-sidebar-subitems {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 2px 0 4px 0;
}
.docs-sidebar-subitem {
  display: flex;
  align-items: center;
  padding: 7px 10px 7px 30px;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.docs-sidebar-subitem::before {
  content: '─';
  position: absolute;
  left: 14px;
  font-size: 10px;
  color: var(--border);
}
.docs-sidebar-subitem:hover { color: var(--text); background: var(--primary-light); }
.docs-sidebar-subitem.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}
.docs-sidebar-subitem.active::before { color: var(--primary); }

@media (max-width: 700px) {
  .docs-sidebar-subitems { flex-direction: row; overflow-x: auto; padding: 2px 4px; }
  .docs-sidebar-subitem { padding: 6px 12px; white-space: nowrap; flex-shrink: 0; }
  .docs-sidebar-subitem::before { display: none; }
}

/* ── 문서함 사이드바 — Amplitude 그룹 헤더 ─────────────────── */
.docs-sidebar-group { display: flex; flex-direction: column; }
.docs-sidebar-group-hdr {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text);
  text-align: left; width: 100%; transition: background .15s, color .15s;
}
.docs-sidebar-group-hdr:hover { background: var(--primary-light); color: var(--primary); }
.docs-sidebar-group-hdr.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.docs-sidebar-group-arrow { font-size: 11px; color: var(--muted); margin-left: auto; flex-shrink: 0; }
.docs-sidebar-group-hdr.active .docs-sidebar-group-arrow { color: var(--primary); }

@media (max-width: 700px) {
  .docs-sidebar-group { flex-direction: row; flex-shrink: 0; }
  .docs-sidebar-group-hdr { flex-direction: column; gap: 3px; padding: 8px 14px; font-size: 12px; border-radius: 6px; white-space: nowrap; }
  .docs-sidebar-group-arrow { display: none; }
  .docs-sidebar-group-hdr.active { border-bottom: 3px solid var(--primary); border-radius: 6px 6px 0 0; }
}

/* ── 마지막 갱신 타임스탬프 ───────────────────────────────── */
.docs-last-updated {
  font-size: 11px; color: var(--muted); margin-left: 8px;
  white-space: nowrap; flex-shrink: 0;
}

/* ════════════════════════════════════════════
   Assignment Section (온보딩 탭 과제 제출)
════════════════════════════════════════════ */
.assign-section {
  max-width: calc(100% - 80px);
  margin: 24px auto 0;
  padding-bottom: 40px;
}
.assign-section-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.assign-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.assign-empty {
  font-size: 14px;
  color: var(--muted);
  padding: 20px 0;
}
.assign-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.assign-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.assign-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.assign-dday {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.assign-dday.success { background: var(--success-light); color: var(--success); }
.assign-dday.warning { background: var(--warning-light); color: var(--warning); }
.assign-dday.danger  { background: var(--danger-light);  color: var(--danger); }
.assign-card-topic {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}
.assign-card-assigned {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.assign-card-due {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.assign-card-actions {
  margin-bottom: 16px;
}
.assign-form-wrap {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.assign-form-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}
.assign-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.assign-label {
  font-size: 13px;
  color: var(--muted);
  min-width: 80px;
  flex-shrink: 0;
}
.assign-name {
  max-width: 200px;
}
.assign-file-input {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  cursor: pointer;
}
.assign-submit-btn {
  margin-top: 4px;
}
.assign-result {
  margin-top: 16px;
}
.assign-lookup-wrap {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 6px;
}
.assign-lookup-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Feedback card */
.assign-feedback-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
}
.assign-feedback-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.assign-version-diff {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--primary-light);
  border-radius: 6px;
}
.assign-scores {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.assign-score-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
}
.assign-score-label {
  font-size: 13px;
  color: var(--muted);
  min-width: 90px;
  flex-shrink: 0;
}
.assign-score-bar {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}
.assign-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 5px;
  transition: width 0.5s ease;
}
.assign-score-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-width: 36px;
  text-align: right;
}
.assign-feedback-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}
.assign-feedback-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
/* Feedback boxes */
.assign-fb-box {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.assign-fb-box-good {
  background: var(--success-light);
  border-left: 4px solid var(--success);
}
.assign-fb-box-improve {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
}
.assign-fb-box-neutral {
  background: var(--bg);
  border-left: 4px solid var(--border);
}
.assign-fb-box-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  color: var(--text);
}
.assign-fb-box-good .assign-fb-box-label  { color: #065f46; }
.assign-fb-box-improve .assign-fb-box-label { color: #92400e; }
.assign-fb-box-body {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
}
.assign-fb-box-body p  { margin: 0 0 8px; }
.assign-fb-box-body p:last-child { margin-bottom: 0; }
.assign-fb-box-body ul, .assign-fb-box-body ol { margin: 4px 0 8px 18px; padding: 0; }
.assign-fb-box-body li { margin-bottom: 4px; }
.assign-fb-box-body strong { font-weight: 700; }
.assign-fb-box-body table { border-collapse: collapse; font-size: 12px; margin: 8px 0; width: 100%; }
.assign-fb-box-body th, .assign-fb-box-body td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; }
.assign-fb-box-body th { background: rgba(0,0,0,0.04); font-weight: 600; }

/* ════════════════════════════════════════════
   분석 셀프체크
════════════════════════════════════════════ */
.sc-section { padding: 0; }
.sc-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 20px;
}
.sc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}
.sc-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.assign-loading {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
  font-style: italic;
}

/* ── Notion 회의록 패널 ──────────────────────────────────────────────────── */
.mm-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.mm-filter-btn { padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: background .12s, color .12s; }
.mm-filter-btn.active, .mm-filter-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.mm-list { display: flex; flex-direction: column; }
.mm-item { border-bottom: 1px solid var(--border); }
.mm-item-header { padding: 14px 16px; cursor: pointer; user-select: none; }
.mm-item-header:hover { background: var(--primary-light); }
.mm-item-title-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mm-item-title { font-size: 14px; font-weight: 600; color: var(--text); }
.mm-item-chevron { font-size: 11px; color: var(--muted); transition: transform .15s; }
.mm-item.open .mm-item-chevron { transform: rotate(180deg); }
.mm-item-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.mm-meta-item { font-size: 12px; color: var(--muted); }
.mm-tags-row { display: flex; flex-wrap: wrap; gap: 4px; }
.mm-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: var(--primary-light); color: var(--primary); font-weight: 500; }
.mm-item-body { display: none; padding: 0 16px 16px; }
.mm-item.open .mm-item-body { display: block; }
.mm-discussion { font-size: 13px; color: var(--text); line-height: 1.6; white-space: pre-wrap; margin-bottom: 10px; padding: 10px 12px; background: var(--primary-light); border-radius: 6px; }
.mm-notion-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.mm-notion-link:hover { text-decoration: underline; }

/* ── 회의록 탭 (Growth / 고객사) ──────────────────────────────────────────── */
.mm-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 0; }
.mm-tab { padding: 10px 20px; border: none; background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .12s, border-color .12s; }
.mm-tab:hover { color: var(--primary); }
.mm-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.mm-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; padding: 0 5px; height: 18px; border-radius: 9px; background: var(--primary-light); color: var(--primary); font-size: 11px; font-weight: 600; }
.mm-tab.active .mm-tab-count { background: var(--primary); color: #fff; }
#mm-panel-growth, #mm-panel-client { padding-top: 4px; }
.mm-customer-badge { background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }

/* ── Phase가이드/플레이북 Master-Detail ──────────────────────────────────────── */
.synth-master-detail { display: grid; grid-template-columns: 260px 1fr; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; min-height: 480px; margin: 8px 12px 12px; }
.synth-md-list { overflow-y: auto; max-height: calc(100vh - 220px); border-right: 1px solid var(--border); background: var(--card); }
.synth-md-row { padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; transition: background .12s; }
.synth-md-row:last-child { border-bottom: none; }
.synth-md-row:hover { background: var(--hover-bg, #f5f5f5); }
.synth-md-row.active { background: var(--primary-light, #eef2ff); border-left: 3px solid var(--primary, #4f46e5); padding-left: 11px; }
.synth-md-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; flex: 1; }
.synth-md-row.active .synth-md-name { color: var(--primary, #4f46e5); font-weight: 600; }
.synth-md-count { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.synth-md-detail { overflow-y: auto; max-height: calc(100vh - 220px); padding: 24px 28px; background: var(--bg, #fafafa); }
.synth-md-detail-title { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.45; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.synth-md-empty { display: flex; align-items: center; justify-content: center; min-height: 280px; color: var(--muted); font-size: 13px; }
@media (max-width: 768px) { .synth-master-detail { grid-template-columns: 1fr; } .synth-md-list { max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); } .synth-md-detail { max-height: none; } }

/* ── 회의록 Master-Detail ──────────────────────────────────────────────────── */
.mm-master-detail { display: grid; grid-template-columns: 280px 1fr; border-top: 1px solid var(--border); overflow: hidden; min-height: 440px; }
.mm-md-list { overflow-y: auto; max-height: calc(100vh - 240px); border-right: 1px solid var(--border); background: var(--card); }
.mm-md-row { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
.mm-md-row:last-child { border-bottom: none; }
.mm-md-row:hover { background: var(--hover-bg, #f5f5f5); }
.mm-md-row.active { background: var(--primary-light, #eef2ff); border-left: 3px solid var(--primary, #4f46e5); padding-left: 11px; }
.mm-md-row-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; margin-bottom: 5px; }
.mm-md-row.active .mm-md-row-title { color: var(--primary); font-weight: 600; }
.mm-md-row-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mm-md-detail { overflow-y: auto; max-height: calc(100vh - 240px); padding: 20px 24px; background: var(--bg, #fafafa); }
.mm-detail-header { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.mm-detail-title { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.45; margin-bottom: 8px; }
.mm-detail-summary { font-size: 14px; color: var(--text); line-height: 1.7; }
.mm-detail-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.mm-notion-link-small { font-size: 12px; color: var(--muted); text-decoration: none; }
.mm-notion-link-small:hover { color: var(--primary); text-decoration: underline; }
.mm-md-empty { display: flex; align-items: center; justify-content: center; min-height: 240px; color: var(--muted); font-size: 13px; }
@media (max-width: 768px) { .mm-master-detail { grid-template-columns: 1fr; } .mm-md-list { max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); } .mm-md-detail { max-height: none; } }

/* ── 로그인 오버레이 & 인증 UI ──────────────────────────────────────────────── */
.auth-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.auth-overlay.hidden { display: none; }
.auth-card { background: var(--card); border-radius: 14px; padding: 36px 32px 32px; width: 100%; max-width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,.18); display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-logo { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 20px; color: var(--text); width: 100%; }
/* .logo의 기본 스타일(파란 배경 + 흰 글자)을 그대로 사용 — color 오버라이드 제거 */
.auth-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.auth-tab-btn { flex: 1; padding: 9px 0; border: none; background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .12s, border-color .12s; }
.auth-tab-btn.active, .auth-tab-btn:hover { color: var(--primary); border-bottom-color: var(--primary); }
.auth-panel.hidden { display: none; }
.auth-input { display: block; width: 100%; box-sizing: border-box; padding: 10px 13px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); font-size: 14px; margin-bottom: 10px; outline: none; transition: border-color .15s; }
.auth-input:focus { border-color: var(--primary); }
.auth-code-input { letter-spacing: 6px; font-size: 22px; text-align: center; font-weight: 700; }
.auth-error { min-height: 20px; font-size: 12px; color: var(--danger); margin-bottom: 8px; }
.auth-submit-btn { display: block; width: 100%; padding: 11px 0; background: var(--primary); color: #fff; border: none; border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.auth-submit-btn:hover { opacity: .88; }
.auth-submit-btn:disabled { opacity: .55; cursor: default; }
.auth-text-btn { display: block; width: 100%; padding: 8px 0; background: transparent; color: var(--muted); border: none; font-size: 13px; cursor: pointer; text-align: center; margin-top: 8px; }
.auth-text-btn:hover { color: var(--primary); }
.auth-hint { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0; line-height: 1.5; }
.auth-success-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--success-light, #d1fae5); color: var(--success, #059669); font-size: 24px; display: flex; align-items: center; justify-content: center; margin: 8px auto 12px; }
.auth-success-msg { font-size: 16px; font-weight: 600; text-align: center; color: var(--text); margin: 0 0 8px; }
.auth-google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; align-self: stretch; padding: 11px 16px; background: #fff; color: #3c4043; border: 1px solid #dadce0; border-radius: 8px; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; transition: box-shadow .15s, background .15s; box-sizing: border-box; }
.auth-google-btn:hover { box-shadow: 0 2px 8px rgba(60,64,67,.18); background: #f8f9fa; }
@media (prefers-color-scheme: dark) { .auth-google-btn { background: #303134; color: #e8eaed; border-color: #5f6368; } .auth-google-btn:hover { background: #3c4043; } }
:root[data-theme="dark"] .auth-google-btn { background: #303134; color: #e8eaed; border-color: #5f6368; }
:root[data-theme="dark"] .auth-google-btn:hover { background: #3c4043; }
:root[data-theme="light"] .auth-google-btn { background: #fff; color: #3c4043; border-color: #dadce0; }
:root[data-theme="light"] .auth-google-btn:hover { background: #f8f9fa; }

/* ── 헤더 사용자 표시 ────────────────────────────────────────────────────────── */
.header-user { font-size: 13px; color: var(--muted); font-weight: 500; }
.header-user.hidden { display: none; }
.header-logout-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: background .12s, color .12s; }
.header-logout-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.header-logout-btn.hidden { display: none; }
.header-mypage-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: background .12s, color .12s; }
.header-mypage-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.header-mypage-btn.hidden { display: none; }

/* ── 프로필 설정 오버레이 ────────────────────────────────────────────────────── */
.ps-card { max-width: 440px !important; }
.ps-form { display: flex; flex-direction: column; gap: 14px; text-align: left; align-self: stretch; }
.ps-field { display: flex; flex-direction: column; gap: 5px; }
.ps-label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.ps-required { color: var(--danger); }
.ps-badge-auto { font-size: 11px; font-weight: 500; background: var(--success-light); color: var(--success); padding: 2px 7px; border-radius: 20px; }
.ps-badge-auto.hidden { display: none; }
.ps-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--card); color: var(--text); transition: border-color .15s; }
.ps-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,.12); }
.ps-input-readonly { background: var(--bg) !important; color: var(--muted) !important; cursor: default; }
.ps-error { min-height: 18px; font-size: 13px; color: var(--danger); text-align: center; }
.ps-submit-btn { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.ps-submit-btn:hover:not(:disabled) { opacity: .88; }
.ps-submit-btn:disabled { opacity: .55; cursor: default; }

/* ── 생일 배너 ───────────────────────────────────────────────────────────────── */
.birthday-banner { background: linear-gradient(135deg, #fef3c7, #fde68a); border: 1px solid #f59e0b; border-radius: 12px; padding: 14px 22px; margin-bottom: 28px; font-size: 16px; font-weight: 600; color: #92400e; text-align: center; }
@media (prefers-color-scheme: dark) { .birthday-banner { background: linear-gradient(135deg,#3b2a0a,#4b3008); border-color:#b45309; color:#fde68a; } }
:root[data-theme="dark"] .birthday-banner { background: linear-gradient(135deg,#3b2a0a,#4b3008); border-color:#b45309; color:#fde68a; }

/* ── 마이페이지 ──────────────────────────────────────────────────────────────── */
.mp-loading { padding: 60px; text-align: center; color: var(--muted); font-size: 15px; }
.mp-page { max-width: 960px; margin: 0 auto; padding: 36px 28px; display: flex; flex-direction: column; gap: 24px; }
.mp-header { display: flex; align-items: center; gap: 12px; }
.mp-title { font-size: 24px; font-weight: 700; color: var(--text); }
.mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .mp-grid { grid-template-columns: 1fr; } }
.mp-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.mp-card-wide { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.mp-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.mp-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.mp-count { font-size: 13px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.mp-edit-btn { margin-left: auto; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: background .12s; }
.mp-edit-btn:hover { background: var(--primary-light); color: var(--primary); }
.mp-link-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--primary); font-size: 12px; cursor: pointer; transition: background .12s; }
.mp-link-btn:hover { background: var(--primary-light); }
.mp-info-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mp-info-table th { width: 80px; text-align: left; color: var(--muted); font-weight: 500; padding: 8px 0; vertical-align: middle; }
.mp-info-table td { color: var(--text); padding: 8px 0; vertical-align: middle; }
.mp-inline-input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--card); color: var(--text); width: 100%; max-width: 220px; }
.mp-inline-input:focus { outline: none; border-color: var(--primary); }
.mp-edit-actions { display: flex; gap: 8px; margin-top: 14px; }
.mp-burden-card { border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.mp-burden-success { background: var(--success-light); }
.mp-burden-warning { background: var(--warning-light); }
.mp-burden-danger  { background: var(--danger-light); }
.mp-burden-empty   { background: var(--bg); }
.mp-burden-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.mp-burden-pct { font-size: 32px; font-weight: 800; color: var(--text); }
.mp-burden-detail { font-size: 12px; color: var(--muted); }
.mp-burden-hint { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mp-notes-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.mp-note-item { display: flex; align-items: baseline; gap: 12px; padding: 7px 10px; border-radius: 7px; transition: background .12s; }
.mp-note-item:hover { background: var(--bg); }
.mp-note-date { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.mp-note-title { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-empty { font-size: 14px; color: var(--muted); padding: 12px 0; text-align: center; }
.mp-more { font-size: 13px; color: var(--muted); text-align: center; padding: 8px 0; }

/* ── AI 챗봇 위젯 ──────────────────────────────────────────────────────────── */
.chatbot-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1100;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer; font-size: 22px;
  box-shadow: 0 4px 16px rgba(79,70,229,.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.chatbot-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(79,70,229,.55); }
.chatbot-fab .chatbot-fab-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 10px;
  padding: 1px 5px; display: none;
}
.chatbot-fab .chatbot-fab-badge.visible { display: block; }

.chatbot-panel {
  position: fixed; bottom: 86px; right: 24px; z-index: 1099;
  width: 380px; height: 540px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; overflow: hidden;
  transition: opacity .15s, transform .15s;
}
.chatbot-panel.hidden { display: none; }

.chatbot-header {
  padding: 14px 16px 12px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.chatbot-header-icon { font-size: 20px; }
.chatbot-header-title { font-size: 15px; font-weight: 700; flex: 1; }
.chatbot-header-sub { font-size: 11px; opacity: .8; }
.chatbot-expand-btn {
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px 5px; opacity: .8; margin-right: 2px;
}
.chatbot-expand-btn:hover { opacity: 1; }
.chatbot-close-btn {
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 4px; opacity: .8;
}
.chatbot-close-btn:hover { opacity: 1; }
.chatbot-resize-handle {
  position: absolute; top: 0; left: 0; width: 20px; height: 20px;
  cursor: nw-resize; z-index: 10;
}
.chatbot-resize-handle::after {
  content: ''; position: absolute; top: 5px; left: 5px;
  width: 9px; height: 9px;
  border-top: 2px solid rgba(255,255,255,.55);
  border-left: 2px solid rgba(255,255,255,.55);
  border-radius: 1px;
}

.chatbot-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.chatbot-msg { display: flex; flex-direction: column; max-width: 88%; gap: 4px; }
.chatbot-msg.user { align-self: flex-end; align-items: flex-end; }
.chatbot-msg.bot  { align-self: flex-start; align-items: flex-start; }

.chatbot-bubble {
  padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.6;
  word-break: break-word;
}
.chatbot-msg.user .chatbot-bubble {
  background: var(--primary); color: #fff; border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}
.chatbot-msg.bot .chatbot-bubble {
  background: var(--bg); color: var(--text); border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
/* 봇 말풍선 내 마크다운 렌더링 스타일 */
.chatbot-msg.bot .chatbot-bubble h1,
.chatbot-msg.bot .chatbot-bubble h2,
.chatbot-msg.bot .chatbot-bubble h3 { font-size: 13px; font-weight: 700; margin: 10px 0 4px; color: var(--text); }
.chatbot-msg.bot .chatbot-bubble p  { margin: 4px 0; }
.chatbot-msg.bot .chatbot-bubble ul,
.chatbot-msg.bot .chatbot-bubble ol { padding-left: 18px; margin: 4px 0; }
.chatbot-msg.bot .chatbot-bubble li { margin: 2px 0; }
.chatbot-msg.bot .chatbot-bubble strong { font-weight: 700; }
.chatbot-msg.bot .chatbot-bubble hr  { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.chatbot-msg.bot .chatbot-bubble .md-table-wrap { overflow-x: auto; margin: 6px 0; border-radius: 4px; border: 1px solid var(--border); }
.chatbot-msg.bot .chatbot-bubble .md-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.chatbot-msg.bot .chatbot-bubble .md-table th { background: var(--primary-light); color: var(--primary); padding: 5px 10px; font-weight: 600; font-size: 11px; border-bottom: 1px solid var(--border); }
.chatbot-msg.bot .chatbot-bubble .md-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); }
.chatbot-msg.bot .chatbot-bubble .md-table tbody tr:last-child td { border-bottom: none; }
.chatbot-msg.bot .chatbot-bubble .md-code { background: #1e1e2e; color: #cdd6f4; padding: 8px 12px; border-radius: 6px; overflow-x: auto; font-size: 11px; font-family: monospace; margin: 6px 0; display: block; }

.chatbot-sources {
  margin-top: 8px; display: flex; flex-direction: column; gap: 4px;
}
.chatbot-source-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.chatbot-source-item {
  font-size: 12px; color: var(--primary); cursor: pointer;
  text-decoration: none; display: block;
  padding: 3px 0; border-bottom: 1px dotted var(--border);
}
.chatbot-source-item:last-child { border-bottom: none; }
.chatbot-source-item:hover { text-decoration: underline; }

.chatbot-typing {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.chatbot-typing span {
  width: 6px; height: 6px; background: var(--muted);
  border-radius: 50%; animation: chatbot-dot 1.2s infinite ease-in-out;
}
.chatbot-typing span:nth-child(2) { animation-delay: .2s; }
.chatbot-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatbot-dot {
  0%,80%,100% { opacity: .3; transform: scale(.8); }
  40%         { opacity: 1;  transform: scale(1); }
}

.chatbot-input-row {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0;
}
.chatbot-input {
  flex: 1; min-height: 36px; max-height: 96px;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; resize: none;
  font-family: inherit; background: var(--bg); color: var(--text);
  outline: none; line-height: 1.5;
}
.chatbot-input:focus { border-color: var(--primary); }
.chatbot-send-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.chatbot-send-btn:hover { background: var(--primary-dark, #4338ca); }
.chatbot-send-btn:disabled { background: var(--muted); cursor: not-allowed; }

.chatbot-empty-hint {
  color: var(--muted); font-size: 12px; text-align: center;
  padding: 12px 0; line-height: 1.8;
}

/* ═══════════════════════════════════════════
   택소노미 검토 탭
═══════════════════════════════════════════ */
.taxo-wrap {
  max-width: calc(100% - 80px); margin: 0 auto; padding: 28px 40px;
}
.taxo-header { margin-bottom: 24px; }
.taxo-title  { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.taxo-desc   { color: var(--muted); font-size: 13px; margin: 0; }

.taxo-upload-area {
  border: 2px dashed var(--border); border-radius: 14px;
  padding: 36px 24px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 20px;
}
.taxo-upload-area:hover, .taxo-upload-area.taxo-drag {
  border-color: var(--primary); background: var(--primary-light, #eef2ff);
}
.taxo-upload-icon  { font-size: 40px; margin-bottom: 10px; }
.taxo-upload-label { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.taxo-upload-sub   { font-size: 12px; color: var(--muted); }
.taxo-file-name    { font-size: 13px; color: var(--primary); margin-top: 10px; }
.taxo-btn-row      { display: flex; align-items: center; gap: 16px; justify-content: center; flex-wrap: wrap; }
.taxo-test-label   { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }

.taxo-progress { margin-bottom: 20px; }
.taxo-progress-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.taxo-progress-bar-wrap {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.taxo-progress-bar {
  height: 100%; background: var(--primary); border-radius: 4px;
  transition: width .5s ease;
}

.taxo-stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.taxo-stat-card {
  flex: 1; min-width: 90px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; text-align: center;
}
.taxo-stat-num    { font-size: 24px; font-weight: 700; color: var(--text); }
.taxo-stat-label  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.taxo-stat-tag    { display: inline-block; font-size: 10px; background: var(--primary-light,#eef2ff); color: var(--primary); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.taxo-stat-total .taxo-stat-num { color: var(--primary); }
.taxo-stat-typo  .taxo-stat-num { color: #ef4444; }
.taxo-stat-conv  .taxo-stat-num { color: #f59e0b; }
.taxo-stat-dup   .taxo-stat-num { color: #8b5cf6; }

.taxo-dl-btn { margin-bottom: 20px; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }

.taxo-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.taxo-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.taxo-table th {
  background: var(--primary-light, #eef2ff); color: var(--primary);
  padding: 10px 12px; font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left;
}
.taxo-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.taxo-table tbody tr:last-child td { border-bottom: none; }
.taxo-table tbody tr:hover { background: var(--hover, #f9fafb); }
.taxo-row-num { font-weight: 600; color: var(--muted); text-align: center; }
.taxo-orig    { color: #ef4444; font-family: monospace; font-size: 12px; }
.taxo-sugg    { color: #16a34a; font-family: monospace; font-size: 12px; font-weight: 600; }
.taxo-reason  { color: var(--muted); font-size: 12px; }

.taxo-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px; white-space: nowrap;
}
.taxo-badge-typo { background: #fee2e2; color: #b91c1c; }
.taxo-badge-conv { background: #fef3c7; color: #92400e; }
.taxo-badge-dup  { background: #ede9fe; color: #5b21b6; }
.taxo-badge-etc  { background: var(--border); color: var(--muted); }

.taxo-no-issues {
  text-align: center; padding: 32px; font-size: 15px; color: var(--muted);
}

.taxo-badge-mismatch { background: #fce7f3; color: #9d174d; }
.taxo-pri-1 { background: #dcfce7; color: #14532d; }
.taxo-pri-2 { background: #dbeafe; color: #1e3a8a; }
.taxo-pri-3 { background: #fef3c7; color: #78350f; }
.taxo-pri-4 { background: #fee2e2; color: #7f1d1d; }

/* ── 택소노미 추가 지침 입력 ─────────────────────────────── */
.taxo-extra-prompt-wrap {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.taxo-extra-prompt-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
}
.taxo-extra-prompt-input {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; font-family: inherit;
  background: var(--bg); color: var(--text);
  resize: vertical; min-height: 64px;
  transition: border-color 0.15s;
}
.taxo-extra-prompt-input:focus {
  outline: none; border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.taxo-extra-prompt-hint {
  margin-top: 6px; font-size: 11px; color: var(--muted);
}

/* ── 택소노미 검수 UI ───────────────────────────────────── */
.taxo-review-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 10px;
  background: var(--bg-alt, #f8fafc); border: 1px solid var(--border);
  border-radius: 8px; gap: 12px; flex-wrap: wrap;
}
.taxo-ctrl-info { font-size: 13px; color: var(--muted); }
.taxo-ctrl-info strong { color: var(--text); }
.taxo-ctrl-btns { display: flex; gap: 6px; }

.taxo-cell-editable { cursor: text; }
.taxo-cell-editable:hover .taxo-edit-display { text-decoration: underline dotted; }
.taxo-edit-input {
  width: 100%; box-sizing: border-box;
  padding: 3px 6px; font-size: 12px; font-family: monospace;
  border: 1px solid var(--primary, #6366f1); border-radius: 4px;
  background: var(--bg); color: #16a34a; font-weight: 600;
}
.taxo-edited { color: #7c3aed !important; font-weight: 700 !important; }
.taxo-edited::after { content: ' ✏'; font-size: 10px; opacity: .7; }

.taxo-dl-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0 4px;
}
.taxo-dl-hint { font-size: 13px; color: var(--muted); }

/* ══════════════════════════════════════════════════
   크리티컬패스 설계 탭
══════════════════════════════════════════════════ */
.cp-wrap { max-width: calc(100% - 80px); margin: 0 auto; padding: 28px 40px; }
.cp-header { margin-bottom: 20px; }
.cp-title  { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.cp-desc   { font-size: 13px; color: var(--muted); }

.cp-section {
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.cp-section-title {
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
  color: var(--text);
}

.cp-link-display {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.cp-link-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.cp-link-row   { display: flex; align-items: center; gap: 8px; }
.cp-link-url   {
  flex: 1; font-size: 11px; word-break: break-all;
  background: transparent; color: var(--text);
  font-family: monospace; user-select: all;
}
.cp-qr-canvas  { display: block; margin-top: 10px; }

.cp-upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cp-upload-area:hover, .cp-upload-area.cp-drag {
  border-color: var(--primary, #6366f1);
  background: rgba(99,102,241,.04);
}

.cp-progress {
  margin: 12px 0;
  padding: 12px 0;
}
.cp-progress-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.cp-progress-track {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.cp-progress-bar {
  height: 100%; background: var(--primary, #6366f1);
  border-radius: 3px; width: 0%; transition: width .4s;
}

.cp-result-stats {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.cp-stat {
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
  min-width: 90px;
}
.cp-stat-highlight { border-color: var(--primary, #6366f1); }
.cp-stat-num { display: block; font-size: 22px; font-weight: 700; }
.cp-stat-lbl { font-size: 11px; color: var(--muted); }

.cp-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.cp-thumb-item {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--bg-alt, #f8fafc);
  transition: transform .15s;
}
.cp-thumb-item:hover { transform: scale(1.03); }
.cp-thumb-img  { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.cp-thumb-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px;
}
.cp-thumb-ts   { font-size: 12px; font-weight: 600; }
.cp-thumb-diff { font-size: 10px; color: var(--muted); }

/* ── 크리티컬패스 프로젝트/시나리오 ─────────────────────────────── */
.cp-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.cp-empty  { color: var(--muted); text-align: center; padding: 40px 0; font-size: 13px; }

.cp-breadcrumb { display: flex; align-items: center; gap: 8px; }
.cp-breadcrumb-sep     { color: var(--muted); }
.cp-breadcrumb-current { font-size: 13px; color: var(--muted); }

/* 프로젝트 카드 */
.cp-project-list { display: flex; flex-direction: column; gap: 10px; }
.cp-project-card {
  background: var(--surface, #f8f8f8);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  display: flex; align-items: center; gap: 10px;
}
.cp-project-card:hover { background: var(--surface-hover, #f0f0f0); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cp-project-card-body { flex: 1; min-width: 0; }
.cp-project-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.cp-project-meta { font-size: 12px; color: var(--muted); }
.cp-proj-del-btn {
  flex-shrink: 0; background: none; border: none; padding: 4px 8px;
  font-size: 16px; cursor: pointer; opacity: 0.4; border-radius: 6px;
  transition: opacity .15s, background .15s;
}
.cp-proj-del-btn:hover { opacity: 1; background: #fee2e2; }

/* 시나리오 카드 */
.cp-scenario-list { display: flex; flex-direction: column; gap: 10px; }
.cp-scen-card {
  background: var(--surface, #f8f8f8);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
}
.cp-scen-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cp-scen-name   { font-size: 14px; font-weight: 600; }
.cp-scen-meta   { font-size: 12px; color: var(--muted); margin-bottom: 8px; min-height: 16px; }
.cp-scen-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; scrollbar-width: thin; }
.cp-scen-thumb  { width: 90px; height: 60px; object-fit: cover; border-radius: 5px; flex-shrink: 0; border: 1px solid var(--border, #e5e7eb); }

/* 상태 뱃지 */
.cp-badge      { display:inline-flex; align-items:center; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.cp-badge-done { background:#d1fae5; color:#065f46; }
.cp-badge-error{ background:#fee2e2; color:#991b1b; }
.cp-badge-proc { background:#dbeafe; color:#1e40af; }
.cp-badge-pend { background:var(--surface,#f0f0f0); color:var(--muted); }

@media (prefers-color-scheme: dark) {
  .cp-badge-done { background:#065f46; color:#d1fae5; }
  .cp-badge-error{ background:#7f1d1d; color:#fca5a5; }
  .cp-badge-proc { background:#1e3a8a; color:#bfdbfe; }
}

/* 모바일 링크 모달 */
.cp-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.cp-modal {
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  width: 440px; max-width: 94vw;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.cp-modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.cp-modal-x  { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); padding: 0 4px; }
.cp-modal-bd { padding: 20px; }
.cp-modal-url{ font-size: 12px; word-break: break-all; }
.cp-modal-prog { margin-top: 14px; }

/* ── 시나리오 선택완료 배지 ───────────────────────────────────────────────── */
.cp-badge-sel {
  background: #d1fae5; color: #065f46;
  border: 1px solid #6ee7b7;
}
@media (prefers-color-scheme: dark) {
  .cp-badge-sel { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
}
:root[data-theme="dark"]  .cp-badge-sel { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
:root[data-theme="light"] .cp-badge-sel { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }

/* ── 프레임 선택 그리드 ───────────────────────────────────────────────────── */
.cp-sel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 4px 0 16px;
}
.cp-sel-item {
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid var(--border, #e5e7eb);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
  background: var(--card, #fff);
  user-select: none;
}
.cp-sel-item:hover { border-color: var(--primary, #6366f1); }
.cp-sel-item.selected {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,.2);
}
.cp-sel-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  background: #0f172a;
  overflow: hidden;
}
.cp-sel-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cp-sel-thumb-missing {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #64748b;
}
.cp-sel-check-icon {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #22c55e; color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.cp-sel-item.selected .cp-sel-check-icon { opacity: 1; }
.cp-sel-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px;
  font-size: 11px;
}
.cp-sel-ts  { color: var(--muted); }
.cp-sel-diff { color: var(--muted); opacity: .75; }

/* ── 트리 영역 ────────────────────────────────────────────────────────────── */
.cp-tree-area {
  margin-top: 20px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card, #fff);
}
.cp-tree-hd {
  padding: 14px 20px;
  font-size: 15px; font-weight: 700;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.cp-tree-loading {
  padding: 32px 20px; text-align: center;
}
.cp-tree-body {
  padding: 20px;
  overflow-x: auto;
  min-height: 160px;
  text-align: center;
}
.cp-tree-body .mermaid {
  display: inline-block;
  min-width: 300px;
  text-align: left;
}
.cp-tree-code {
  background: var(--bg, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre;
  margin-top: 8px;
  color: var(--text, #111);
}
@media (prefers-color-scheme: dark) {
  .cp-tree-code { background: #0f172a; color: #e2e8f0; }
}
:root[data-theme="dark"]  .cp-tree-code { background: #0f172a; color: #e2e8f0; }
:root[data-theme="light"] .cp-tree-code { background: #f9fafb; color: #111; }

/* ── 이벤트 설계 패널 ─────────────────────────────────────────────────────── */
.cp-evt-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  font-size: 15px; font-weight: 700;
  border-top: 1px solid var(--border, #e5e7eb);
  flex-wrap: wrap; gap: 10px;
}
.cp-evt-list { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 16px; }

.cp-evt-item {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--bg, #f9fafb);
}
@media (prefers-color-scheme: dark) {
  .cp-evt-item { background: #1e293b; }
}
:root[data-theme="dark"]  .cp-evt-item { background: #1e293b; }
:root[data-theme="light"] .cp-evt-item { background: #f9fafb; }

.cp-evt-screens {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.cp-screen-chip {
  background: var(--primary, #6366f1); color: #fff;
  padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.cp-arrow-mid  { font-size: 16px; color: var(--muted); }
.cp-ui-el      { font-size: 12px; color: var(--muted); }

.cp-evt-options { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cp-evt-opt {
  flex: 1; min-width: 200px; display: flex; align-items: flex-start;
  gap: 4px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--border, #e5e7eb);
  transition: border-color .15s, background .15s;
}
.cp-evt-opt.active { border-color: var(--primary, #6366f1); background: rgba(99,102,241,.06); }
.cp-opt-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; margin-bottom: 4px;
  background: #e0e7ff; color: #3730a3;
}
.cp-opt-badge.cp-opt-b { background: #dcfce7; color: #166534; }
.cp-rec-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; margin-left: 4px;
  background: #fef3c7; color: #92400e;
}
.cp-rec-badge.cp-rec-b { background: #fef3c7; color: #92400e; }
.cp-opt-name { font-size: 12px; font-family: monospace; font-weight: 600; margin-top: 2px; }
.cp-opt-prop { font-size: 11px; color: var(--muted); margin-top: 2px; }

.cp-rec-reason {
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
  padding: 6px 10px; background: rgba(99,102,241,.05); border-radius: 6px;
}

.cp-evt-name-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.cp-evt-name-lbl { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cp-evt-name-input {
  flex: 1; min-width: 200px; font-family: monospace; font-size: 12px;
  padding: 5px 10px; border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 6px; background: var(--card, #fff); color: var(--text, #111);
}
.cp-evt-name-input:focus { outline: none; border-color: var(--primary, #6366f1); }
@media (prefers-color-scheme: dark) {
  .cp-evt-name-input { background: #0f172a; color: #f1f5f9; }
}
:root[data-theme="dark"]  .cp-evt-name-input { background: #0f172a; color: #f1f5f9; }
:root[data-theme="light"] .cp-evt-name-input { background: #fff; color: #111; }

.cp-evt-props-hd { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.cp-prop-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 12px; cursor: pointer;
}
.cp-prop-name  { font-family: monospace; font-weight: 600; min-width: 120px; }
.cp-prop-type  {
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: #e0e7ff; color: #3730a3; white-space: nowrap;
}
.cp-prop-desc  { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .cp-opt-badge { background: #312e81; color: #a5b4fc; }
  .cp-opt-badge.cp-opt-b { background: #14532d; color: #86efac; }
  .cp-prop-type { background: #312e81; color: #a5b4fc; }
}
:root[data-theme="dark"] .cp-opt-badge   { background: #312e81; color: #a5b4fc; }
:root[data-theme="dark"] .cp-opt-badge.cp-opt-b { background: #14532d; color: #86efac; }
:root[data-theme="dark"] .cp-prop-type   { background: #312e81; color: #a5b4fc; }

/* ── 트리 생성 지침 textarea ─────────────────────────────────────────────────── */
.cp-user-prompt-wrap {
  margin: 14px 0 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.cp-user-prompt-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.cp-user-prompt-textarea {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border-radius: 8px; font-size: 13px;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text); resize: vertical; font-family: inherit; line-height: 1.5;
  transition: border-color 0.15s;
}
.cp-user-prompt-textarea:focus { border-color: var(--primary); outline: none; }

/* ── 유저 프로퍼티 섹션 ──────────────────────────────────────────────────────── */
.cp-up-section {
  margin-top: 20px; padding: 14px 16px 10px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--bg-card);
}
.cp-up-hd {
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
}
.cp-up-list { display: flex; flex-direction: column; gap: 2px; }
.cp-up-item { align-items: flex-start; }
.cp-up-reason {
  font-size: 11px; color: var(--muted); font-style: italic; margin-left: 4px;
}

/* ── 택소노미 사용 가이드 ─────────────────────────────────────────────────────── */
.taxo-guide {
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--bg-card); margin-bottom: 20px;
  overflow: hidden;
}
.taxo-guide-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; cursor: pointer; font-size: 14px; font-weight: 700;
  list-style: none; user-select: none;
}
.taxo-guide-summary::-webkit-details-marker { display: none; }
.taxo-guide-toggle {
  font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px;
}
.taxo-guide-body {
  padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px;
  border-top: 1px solid var(--border);
}
.taxo-guide-step {
  display: flex; gap: 14px; padding-top: 14px;
}
.taxo-guide-step-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; margin-top: 1px;
}
.taxo-guide-step-content { flex: 1; min-width: 0; }
.taxo-guide-step-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.taxo-guide-step-desc  { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.taxo-guide-list {
  margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px;
}
.taxo-guide-list li { font-size: 13px; color: var(--text); line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   CCAF 스터디 탭
═══════════════════════════════════════════════════════════════ */
.ccaf-wrap {
  display: flex; flex-direction: column; height: calc(100vh - 96px); overflow: hidden;
}
.ccaf-admin-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 24px;
  background: var(--primary-light); border-bottom: 1px solid var(--primary);
  flex-shrink: 0; flex-wrap: wrap;
}
:root[data-theme="dark"] .ccaf-admin-bar { background: #1e1b4b; border-bottom-color: #4338ca; }
.ccaf-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap;
}
.ccaf-toolbar-left  { display: flex; align-items: center; gap: 16px; }
.ccaf-toolbar-right { display: flex; align-items: center; gap: 12px; }
.ccaf-title { font-size: 16px; font-weight: 700; }
.ccaf-stat  { font-size: 12px; color: var(--muted); }
.ccaf-toggle-label {
  display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer;
}
.ccaf-lang-switch { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ccaf-lang-btn {
  padding: 4px 12px; font-size: 12px; border: none; background: var(--bg-card);
  color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.ccaf-lang-btn.active { background: var(--primary); color: #fff; }
.ccaf-progress-bar-wrap {
  height: 3px; background: var(--border); flex-shrink: 0;
}
.ccaf-progress-bar { height: 3px; background: var(--primary); transition: width 0.3s; }
.ccaf-body {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}
/* ── 문제 목록 사이드바 ── */
.ccaf-list {
  width: 260px; flex-shrink: 0; border-right: 1px solid var(--border);
  overflow-y: auto; padding: 12px 0;
}
.ccaf-scenario-group { margin-bottom: 6px; }
.ccaf-scenario-label {
  font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.04em; padding: 6px 14px 4px; line-height: 1.3;
}
.ccaf-list-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  cursor: pointer; border-radius: 0; transition: background 0.1s; font-size: 13px;
}
.ccaf-list-item:hover:not(.ccaf-item-locked) { background: var(--bg-hover, #f3f4f6); }
.ccaf-list-item.ccaf-item-active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
:root[data-theme="dark"] .ccaf-list-item.ccaf-item-active { background: #1e1b4b; }
.ccaf-list-item.ccaf-item-locked { cursor: default; opacity: 0.45; }
.ccaf-icon { font-size: 12px; flex-shrink: 0; }
.ccaf-item-num { font-size: 12px; }
.ccaf-list-empty { padding: 20px 14px; font-size: 13px; color: var(--muted); }
/* ── 문제 상세 영역 ── */
.ccaf-detail {
  flex: 1; min-width: 0; overflow-y: auto; padding: 24px 32px;
}
.ccaf-detail-empty {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--muted); font-size: 14px;
}
.ccaf-detail-locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 260px; color: var(--muted);
}
.ccaf-detail-inner { max-width: 900px; }
.ccaf-detail-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.ccaf-scenario-tag {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
  background: var(--primary-light); color: var(--primary);
}
:root[data-theme="dark"] .ccaf-scenario-tag { background: #1e1b4b; }
.ccaf-qnum-tag { font-size: 12px; color: var(--muted); margin-left: auto; }
.ccaf-situation {
  font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 16px;
  padding: 12px 14px; border-left: 3px solid var(--border);
  background: var(--bg-card); border-radius: 0 6px 6px 0;
  white-space: pre-wrap;
}
.ccaf-question {
  font-size: 15px; font-weight: 600; line-height: 1.5; margin-bottom: 18px;
  white-space: pre-wrap;
}
.ccaf-options { display: flex; flex-direction: column; gap: 10px; }
.ccaf-opt-btn-wrap {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg-card);
  cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s;
  font-family: inherit; font-size: 13px; color: var(--text);
}
.ccaf-opt-btn-wrap:not([disabled]):hover { border-color: var(--primary); background: var(--primary-light); }
:root[data-theme="dark"] .ccaf-opt-btn-wrap:not([disabled]):hover { background: #1e1b4b; }
.ccaf-opt-btn-wrap.ccaf-opt-correct  { border-color: var(--success); background: #dcfce7; }
.ccaf-opt-btn-wrap.ccaf-opt-wrong-selected { border-color: var(--danger); background: #fee2e2; }
.ccaf-opt-btn-wrap.ccaf-opt-disabled { opacity: 0.55; cursor: default; }
:root[data-theme="dark"] .ccaf-opt-btn-wrap.ccaf-opt-correct { background: #052e16; }
:root[data-theme="dark"] .ccaf-opt-btn-wrap.ccaf-opt-wrong-selected { background: #450a0a; }
.ccaf-opt-letter {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; margin-top: 1px;
}
.ccaf-opt-text { flex: 1; line-height: 1.6; white-space: pre-wrap; }
.ccaf-feedback {
  margin-top: 18px; padding: 14px 18px; border-radius: 10px;
  border: 1.5px solid var(--success);
}
.ccaf-feedback-ok   { border-color: var(--success); background: #f0fdf4; }
.ccaf-feedback-wrong { border-color: var(--danger);  background: #fff1f2; }
:root[data-theme="dark"] .ccaf-feedback-ok    { background: #052e16; }
:root[data-theme="dark"] .ccaf-feedback-wrong { background: #450a0a; }
.ccaf-feedback-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.ccaf-feedback-exp   { font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
/* 팀 전체 정답률 (피드백 내) */
.ccaf-team-stat {
  margin-top: 12px; padding: 8px 12px; border-radius: 7px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.ccaf-team-stat-detail { font-size: 11px; color: var(--muted); }
/* 사이드바 문항 정답률 힌트 */
.ccaf-item-acc {
  font-size: 10px; color: var(--muted); margin-left: auto; flex-shrink: 0;
}
/* 시나리오 그룹 헤더 정답률 */
.ccaf-scen-acc {
  font-size: 10px; font-weight: 400; color: var(--muted);
  margin-left: 5px; vertical-align: middle;
}
/* ── 도메인별 정답률 패널 ─────────────────────────────────────────────────────── */
.ccaf-domain-panel {
  border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--bg-card);
}
.ccaf-domain-panel-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 20px; cursor: pointer; font-size: 12px; font-weight: 600;
  list-style: none; user-select: none; color: var(--text);
}
.ccaf-domain-panel-summary::-webkit-details-marker { display: none; }
.ccaf-domain-toggle-hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.ccaf-domain-grid {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 20px 12px;
}
.ccaf-domain-row {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
}
.ccaf-domain-num {
  flex-shrink: 0; width: 20px; font-weight: 700; color: var(--muted); font-size: 11px;
}
.ccaf-domain-name {
  flex-shrink: 0; width: 220px; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.ccaf-domain-bar-wrap {
  flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
  min-width: 60px;
}
.ccaf-domain-bar {
  height: 100%; background: var(--primary); border-radius: 4px;
  transition: width 0.4s ease;
}
.ccaf-domain-bar-warn  { background: #ef4444; }
.ccaf-domain-bar-empty { background: transparent; }
.ccaf-domain-pct {
  flex-shrink: 0; width: 34px; text-align: right; font-weight: 600; font-size: 12px;
}
.ccaf-domain-pct-warn  { color: #ef4444; }
.ccaf-domain-pct-empty { color: var(--muted); }
.ccaf-domain-weight {
  flex-shrink: 0; width: 32px; text-align: right; font-size: 10px; color: var(--muted);
}
.ccaf-domain-warn .ccaf-domain-name { color: #ef4444; }
@media (max-width: 480px) {
  .ccaf-domain-name { width: 130px; }
}
/* 코호트 뱃지 */
.ccaf-cohort-tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
}
:root[data-theme="dark"] .ccaf-cohort-tag { background: #451a03; color: #fde68a; border-color: #78350f; }
/* 언어 잠금 */
.ccaf-lang-locked .ccaf-lang-btn:not(.active) { opacity: 0.4; cursor: not-allowed; }
.ccaf-lang-lock-hint {
  font-size: 11px; color: var(--danger); padding: 0 8px; align-self: center; white-space: nowrap;
}

/* ── CCAF Home ── */
.ccaf-home { padding: 0 0 32px; }
.ccaf-home-hero { padding: 24px 20px 20px; text-align: center; }
.ccaf-home-hero-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.ccaf-home-hero-sub { font-size: 13px; color: var(--muted); }
.ccaf-home-hero-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ccaf-home-main { padding: 0 20px; }
.ccaf-home-section-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin: 24px 0 8px; }

/* Home – current quiz card */
.ccaf-home-quiz-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  background: var(--bg-card); cursor: pointer; transition: box-shadow .15s;
}
.ccaf-home-quiz-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.ccaf-home-quiz-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.ccaf-home-quiz-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ccaf-home-quiz-progress { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ccaf-home-quiz-score { font-size: 13px; font-weight: 600; }
.ccaf-home-quiz-done { font-size: 12px; color: var(--success); font-weight: 500; }
.ccaf-home-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.ccaf-home-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }

/* Home – history list */
.ccaf-home-history { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-card); }
.ccaf-home-history-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer;
  transition: background .12s;
}
.ccaf-home-history-row:last-child { border-bottom: none; }
.ccaf-home-history-row:hover { background: var(--bg-hover); }
.ccaf-home-history-title { flex: 1; font-weight: 500; }
.ccaf-home-history-score { font-size: 12px; color: var(--muted); }
.ccaf-home-history-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.ccaf-status-done { background: #d1fae5; color: #065f46; }
.ccaf-status-wip  { background: #fef3c7; color: #92400e; }
:root[data-theme="dark"] .ccaf-status-done { background: #064e3b; color: #6ee7b7; }
:root[data-theme="dark"] .ccaf-status-wip  { background: #451a03; color: #fde68a; }

/* Home – nav buttons */
.ccaf-home-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ccaf-nav-btn {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 12px;
  background: var(--bg-card); cursor: pointer; text-align: left; transition: box-shadow .12s, background .12s;
  font-size: 13px; font-weight: 500; color: var(--text);
}
.ccaf-nav-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); background: var(--bg-hover); }

/* Back button */
.ccaf-back-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  color: var(--muted); background: none; border: none; cursor: pointer; padding: 0; margin-bottom: 16px;
  transition: color .12s;
}
.ccaf-back-btn:hover { color: var(--text); }

/* Bank sub-nav tabs */
.ccaf-bank-nav-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.ccaf-bank-tab {
  padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .12s;
}
.ccaf-bank-tab:hover { color: var(--text); }
.ccaf-bank-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Pending selection (two-step UX) */
.ccaf-opt-selected-pending {
  border-color: var(--primary) !important;
  background: color-mix(in srgb, var(--primary) 8%, transparent) !important;
  font-weight: 600;
}

/* Domain badge */
.ccaf-domain-badge {
  display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 99px; background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; margin-right: 4px;
}
:root[data-theme="dark"] .ccaf-domain-badge { background: #2e1065; color: #c4b5fd; border-color: #4c1d95; }

/* Attempt count tag */
.ccaf-attempt-tag {
  font-size: 11px; color: var(--muted); background: var(--bg-hover);
  padding: 2px 8px; border-radius: 99px; display: inline-block;
}
.ccaf-first-wrong-note { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* Korean explanation toggle */
.ccaf-exp-ko-toggle {
  font-size: 12px; color: var(--primary); cursor: pointer; text-decoration: underline;
  display: inline-block; margin-top: 8px;
}

/* ── CCAF Home: empty state ── */
.ccaf-home-empty-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.ccaf-home-empty-icon  { font-size: 32px; margin-bottom: 10px; }
.ccaf-home-empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.ccaf-home-empty-sub   { font-size: 13px; color: var(--muted); }

/* ── CCAF Guide Panel ── */
.ccaf-guide-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.ccaf-guide-toggle {
  width: 100%;
  background: var(--bg-card, #fff);
  border: none;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ccaf-guide-toggle:hover { background: var(--bg-hover, #f5f5f5); }
.ccaf-guide-chevron { font-size: 11px; color: var(--muted); }
.ccaf-guide-body {
  padding: 0 16px 16px;
  background: var(--bg-card, #fff);
  border-top: 1px solid var(--border);
}
.ccaf-guide-section { padding-top: 14px; font-size: 13px; color: var(--text); }
.ccaf-guide-section strong {
  display: block; margin-bottom: 8px; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.ccaf-guide-section ol,
.ccaf-guide-section ul { margin: 0; padding-left: 18px; line-height: 1.8; }
.ccaf-guide-sched { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.ccaf-guide-sched th {
  text-align: left; font-weight: 600; padding: 4px 8px;
  border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted);
}
.ccaf-guide-sched td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.ccaf-guide-exam-note { margin-top: 10px; font-size: 13px; color: var(--text); }

:root[data-theme="dark"] .ccaf-guide-toggle,
:root[data-theme="dark"] .ccaf-guide-body { background: #1e1e2e; }
:root[data-theme="dark"] .ccaf-guide-toggle:hover { background: #2a2a3e; }

/* ── Home: full-width layout ── */
.ccaf-home-scroll { flex: 1; overflow-y: auto; }
.ccaf-home-content {
  max-width: 1200px; margin: 0 auto; padding: 20px 24px 40px;
}
.ccaf-home-row1 {
  display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start;
}
.ccaf-home-row2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start;
}
.ccaf-info-col { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 840px) {
  .ccaf-home-row1, .ccaf-home-row2 { grid-template-columns: 1fr; }
}

/* ── Quiz Main Card ── */
.ccaf-quiz-main-card {
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 22px; cursor: pointer; transition: box-shadow .15s;
}
.ccaf-quiz-main-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.ccaf-qmc-eyebrow {
  font-size: 10px; font-weight: 700; color: var(--primary); letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 6px;
}
.ccaf-qmc-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.ccaf-qmc-sub   { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.ccaf-qmc-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px;
}
.ccaf-qmc-stat-item {
  background: var(--bg, #f1f5f9); border-radius: 8px; padding: 10px 8px; text-align: center;
}
.ccaf-qmc-stat-item.ok    { background: #d1fae5; }
.ccaf-qmc-stat-item.wrong { background: #fee2e2; }
.ccaf-qmc-stat-val  { font-size: 18px; font-weight: 700; }
.ccaf-qmc-stat-lbl  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ccaf-qmc-stat-item.ok .ccaf-qmc-stat-val    { color: #065f46; }
.ccaf-qmc-stat-item.wrong .ccaf-qmc-stat-val { color: #991b1b; }
.ccaf-qmc-progress-meta {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px;
}
.ccaf-qmc-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.ccaf-qmc-bar      { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
:root[data-theme="dark"] .ccaf-qmc-stat-item.ok    { background: #064e3b; }
:root[data-theme="dark"] .ccaf-qmc-stat-item.wrong { background: #450a0a; }
:root[data-theme="dark"] .ccaf-qmc-stat-item.ok .ccaf-qmc-stat-val    { color: #6ee7b7; }
:root[data-theme="dark"] .ccaf-qmc-stat-item.wrong .ccaf-qmc-stat-val { color: #fca5a5; }

/* ── Quiz Empty Card ── */
.ccaf-quiz-empty-card {
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 22px;
}
.ccaf-qec-eyebrow {
  font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 6px;
}
.ccaf-qec-title  { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.ccaf-qec-when   { font-size: 13px; color: var(--primary); font-weight: 500; margin-bottom: 8px; }
.ccaf-qec-desc   { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── Exam Info Card ── */
.ccaf-exam-card {
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
}
.ccaf-exam-card-title {
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 10px;
}
.ccaf-exam-rows { display: flex; flex-direction: column; gap: 7px; }
.ccaf-exam-row  { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.ccaf-exam-row-lbl { color: var(--muted); font-size: 12px; }
.ccaf-exam-row-val { font-weight: 600; font-size: 13px; }
.ccaf-exam-row-primary { color: var(--primary); }

/* ── Toolbar exam/dday tags ── */
.ccaf-exam-tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe;
}
.ccaf-dday-tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--primary); color: #fff;
}
:root[data-theme="dark"] .ccaf-exam-tag { background: #1e1b4b; color: #a5b4fc; border-color: #3730a3; }

/* ── Quick Nav Card ── */
.ccaf-quicknav-card {
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.ccaf-quicknav-title {
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 8px;
}
.ccaf-quicknav-items { display: flex; flex-direction: column; gap: 4px; }
.ccaf-qn-btn {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  border: none; background: var(--bg, #f1f5f9); cursor: pointer; transition: background .12s; width: 100%; text-align: left;
}
.ccaf-qn-btn:hover { background: var(--primary-light, #ede9fe); }
.ccaf-qn-icon  { font-size: 15px; flex-shrink: 0; }
.ccaf-qn-label { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.ccaf-qn-count {
  font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-light, #ede9fe);
  padding: 1px 8px; border-radius: 99px;
}

/* ── History Card ── */
.ccaf-history-card {
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.ccaf-history-header {
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; padding: 12px 16px 8px;
}
.ccaf-history-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  border-top: 1px solid var(--border); font-size: 13px; cursor: pointer; transition: background .1s;
}
.ccaf-history-item:hover:not([data-locked]) { background: var(--bg-hover, #f3f4f6); }
.ccaf-history-item[data-locked] { cursor: default; opacity: 0.55; }
.ccaf-hi-no   { font-weight: 600; width: 52px; flex-shrink: 0; font-size: 13px; }
.ccaf-hi-date { font-size: 11px; color: var(--muted); width: 58px; flex-shrink: 0; }
.ccaf-hi-bar-wrap {
  flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.ccaf-hi-bar  { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }
.ccaf-hi-score{ font-size: 12px; color: var(--muted); width: 38px; text-align: right; flex-shrink: 0; }
.ccaf-hi-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; flex-shrink: 0;
}
.ccaf-st-done   { background: #d1fae5; color: #065f46; }
.ccaf-st-wip    { background: #fef3c7; color: #92400e; }
.ccaf-st-locked { background: var(--bg, #f1f5f9); color: var(--muted); }
:root[data-theme="dark"] .ccaf-st-done { background: #064e3b; color: #6ee7b7; }
:root[data-theme="dark"] .ccaf-st-wip  { background: #451a03; color: #fde68a; }

/* ── Unassigned screen ── */
.ccaf-unassigned-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px;
}
.ccaf-unassigned-card {
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 16px;
  padding: 48px 40px; text-align: center; max-width: 400px; width: 100%;
}
.ccaf-ua-icon  { font-size: 48px; margin-bottom: 20px; }
.ccaf-ua-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.ccaf-ua-desc  { font-size: 14px; color: var(--muted); line-height: 1.7; }

/* ── Bank Header ── */
.ccaf-bank-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap;
}
.ccaf-bank-header .ccaf-bank-nav-tabs { border-bottom: none; }

/* ── Stage tag (in detail header) ── */
.ccaf-stage-tag {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
}
:root[data-theme="dark"] .ccaf-stage-tag { background: #064e3b; color: #6ee7b7; border-color: #047857; }

/* ── Section labels (SITUATION / QUESTION) ── */
.ccaf-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted);
  text-transform: uppercase; margin: 16px 0 6px;
}

/* ── Feedback banner + body ── */
.ccaf-feedback-banner {
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.ccaf-feedback-ok    .ccaf-feedback-banner { color: #065f46; }
.ccaf-feedback-wrong .ccaf-feedback-banner { color: #991b1b; }
.ccaf-feedback-body { padding: 12px 16px; }
:root[data-theme="dark"] .ccaf-feedback-ok    .ccaf-feedback-banner { color: #6ee7b7; }
:root[data-theme="dark"] .ccaf-feedback-wrong .ccaf-feedback-banner { color: #fca5a5; }

/* ── Quiz Sidebar Header ── */
.ccaf-sidebar-hd { padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
.ccaf-sidebar-hd-title {
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 4px;
}
.ccaf-sidebar-hd-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ccaf-sidebar-hd-bar-wrap { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.ccaf-sidebar-hd-bar { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }

/* ── Scenario accuracy badge ── */
.ccaf-scen-acc {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 99px;
  background: var(--primary-light, #ede9fe); color: var(--primary); margin-left: 6px;
}

/* ════════════════════════════════════════════════════════════════════
   CCAF Home 2차 개편 — 페이지 헤더
════════════════════════════════════════════════════════════════════ */
.ccaf-page-hdr { padding: 20px 0 16px; }
.ccaf-page-hdr-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.ccaf-page-hdr-sub   { font-size: 13px; font-weight: 600; color: var(--primary); margin-top: 2px; }
.ccaf-page-hdr-desc  { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Quiz 메인 카드 헤더 (badge + stage) ── */
.ccaf-qmc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.ccaf-qmc-stage { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ccaf-qmc-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; flex-shrink: 0; }
.ccaf-badge-done     { background: #d1fae5; color: #065f46; }
.ccaf-badge-wip      { background: #fef3c7; color: #92400e; }
.ccaf-badge-upcoming { background: var(--bg,#f1f5f9); color: var(--muted); border: 1px solid var(--border); }

/* ── 공개 전 카드 ── */
.ccaf-quiz-upcoming-card {
  background: var(--card,#fff); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 22px;
}
.ccaf-quc-body {
  display: flex; align-items: center; gap: 20px;
  margin-top: 16px; padding: 16px; background: var(--bg,#f1f5f9); border-radius: 10px;
}
.ccaf-cal-svg { width: 80px; height: 80px; flex-shrink: 0; }
.ccaf-quc-date-info { flex: 1; }
.ccaf-quc-date-big { font-size: 15px; font-weight: 700; }
.ccaf-quc-time { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── 시험 준비 현황 — 3 미니 스탯 ── */
.ccaf-ems-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.ccaf-ems-item {
  background: var(--bg,#f1f5f9); border-radius: 8px; padding: 10px 6px;
  text-align: center;
}
.ccaf-ems-primary { background: var(--primary,#4f46e5); }
.ccaf-ems-val { font-size: 16px; font-weight: 800; line-height: 1.1; }
.ccaf-ems-primary .ccaf-ems-val { color: #fff; }
.ccaf-ems-primary .ccaf-ems-lbl { color: rgba(255,255,255,.8); }
.ccaf-ems-lbl { font-size: 10px; color: var(--muted); margin-top: 3px; }
.ccaf-exam-range {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 10px; background: var(--bg,#f1f5f9); border-radius: 6px;
}
.ccaf-exam-range-lbl { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.ccaf-exam-range-val { font-size: 12px; font-weight: 600; color: var(--text); }

/* ── 빠른 이동 2 (3개 카드 그리드) ── */
.ccaf-quicknav2 { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.ccaf-qn2-card {
  background: var(--bg,#f1f5f9); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 10px; cursor: pointer; text-align: left; transition: background .12s, box-shadow .12s;
  display: flex; flex-direction: column; gap: 4px;
}
.ccaf-qn2-card:hover { background: var(--border); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.ccaf-qn2-head { display: flex; align-items: center; justify-content: space-between; }
.ccaf-qn2-icon { font-size: 16px; }
.ccaf-qn2-count { font-size: 14px; font-weight: 800; color: var(--primary); }
.ccaf-qn2-count.ccaf-qn2-zero { color: var(--muted); }
.ccaf-qn2-label { font-size: 12px; font-weight: 700; }
.ccaf-qn2-desc  { font-size: 11px; color: var(--muted); }

/* ── 학습 로드맵 (가로 타임라인) ── */
.ccaf-roadmap-wrap { margin-top: 20px; }
.ccaf-roadmap-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px;
}
.ccaf-roadmap-scroll { overflow-x: auto; padding-bottom: 4px; }
.ccaf-roadmap-track {
  display: flex; align-items: flex-start; gap: 0; position: relative;
  min-width: max-content; padding: 8px 4px 4px;
}
.ccaf-roadmap-line {
  position: absolute; top: 26px; left: 28px; right: 28px; height: 2px;
  background: var(--border); z-index: 0;
}
.ccaf-rm-node {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 80px; position: relative; z-index: 1; cursor: default;
}
.ccaf-rm-node.ccaf-quiz-enter-btn { cursor: pointer; }
.ccaf-rm-node.ccaf-quiz-enter-btn:hover .ccaf-rm-dot { box-shadow: 0 0 0 3px rgba(79,70,229,.25); }
.ccaf-rm-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
  background: var(--card,#fff); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; transition: box-shadow .15s;
}
.ccaf-rm-done .ccaf-rm-dot  { background: #d1fae5; border-color: #34d399; color: #065f46; }
.ccaf-rm-active .ccaf-rm-dot { background: var(--primary,#4f46e5); border-color: var(--primary); color: #fff; }
.ccaf-rm-locked .ccaf-rm-dot { background: var(--bg,#f1f5f9); color: var(--muted); font-size: 10px; }
.ccaf-rm-no    { font-size: 12px; font-weight: 700; text-align: center; }
.ccaf-rm-stage { font-size: 10px; color: var(--muted); text-align: center; }
.ccaf-rm-date  { font-size: 11px; color: var(--muted); text-align: center; }

/* ── 사용 가이드 (4개 독립 카드) ── */
.ccaf-g2-section { margin-top: 20px; }
.ccaf-g2-hdr {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px;
}
.ccaf-g2-cards { display: flex; flex-direction: column; gap: 6px; }
.ccaf-g2-card {
  background: var(--card,#fff); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.ccaf-g2-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 12px 14px; font-size: 13px; font-weight: 600; background: none; border: none;
  cursor: pointer; text-align: left; gap: 8px;
}
.ccaf-g2-toggle:hover { background: var(--bg,#f1f5f9); }
.ccaf-g2-chev { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.ccaf-g2-body {
  padding: 4px 14px 12px; font-size: 13px; line-height: 1.65;
  border-top: 1px solid var(--border);
}
.ccaf-g2-body ol, .ccaf-g2-body ul { margin: 8px 0; padding-left: 18px; }
.ccaf-g2-body li { margin-bottom: 5px; }
.ccaf-g2-exam { font-size: 13px; margin-bottom: 8px; }
.ccaf-g2-body .ccaf-guide-sched { width: 100%; font-size: 12px; border-collapse: collapse; margin-top: 4px; }
.ccaf-g2-body .ccaf-guide-sched th,
.ccaf-g2-body .ccaf-guide-sched td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.ccaf-g2-body .ccaf-guide-sched th { font-weight: 700; color: var(--muted); }

:root[data-theme="dark"] .ccaf-badge-done      { background: #065f46; color: #6ee7b7; }
:root[data-theme="dark"] .ccaf-badge-wip       { background: #451a03; color: #fcd34d; }
:root[data-theme="dark"] .ccaf-badge-upcoming  { background: var(--bg); color: var(--muted); }
:root[data-theme="dark"] .ccaf-rm-done .ccaf-rm-dot  { background: #065f46; border-color: #34d399; color: #6ee7b7; }

/* ── 반응형 ── */
@media (max-width: 640px) {
  .ccaf-quc-body { flex-direction: column; gap: 12px; }
  .ccaf-cal-svg  { width: 64px; height: 64px; }
  .ccaf-quicknav2 { grid-template-columns: repeat(3,1fr); gap: 6px; }
  .ccaf-qn2-card  { padding: 10px 8px; }
  .ccaf-qn2-desc  { display: none; }
  .ccaf-roadmap-track { gap: 0; }
  .ccaf-rm-node   { min-width: 68px; }
}

/* ── 페이지 헤더 intro ("이 탭은 무엇인가요?") ── */
.ccaf-page-hdr-intro {
  margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.6;
  padding: 8px 12px; background: var(--bg,#f1f5f9); border-radius: 6px;
}
.ccaf-page-hdr-intro-q {
  font-weight: 700; color: var(--text); margin-right: 4px;
}

/* ── 로드맵 헤더 행 (타이틀 + 버튼) ── */
.ccaf-roadmap-hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}
.ccaf-rm-all-btn {
  font-size: 11px; font-weight: 600; color: var(--primary); background: none;
  border: none; cursor: pointer; padding: 2px 0; white-space: nowrap;
}
.ccaf-rm-all-btn:hover { text-decoration: underline; }

/* ── 로드맵 마커 (영어 고정 / 시험일) ── */
.ccaf-rm-dot-lock { background: #fef3c7; border-color: #fcd34d; font-size: 12px; }
.ccaf-rm-dot-exam { background: #ede9fe; border-color: #a78bfa; font-size: 12px; }
.ccaf-rm-marker .ccaf-rm-no { color: var(--muted); }

/* ── 전체 일정 모달 ── */
.ccaf-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ccaf-modal {
  background: var(--card,#fff); border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 80vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.ccaf-modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  font-size: 14px; font-weight: 700;
}
.ccaf-modal-close {
  background: none; border: none; font-size: 16px; cursor: pointer;
  color: var(--muted); padding: 2px 6px; border-radius: 4px;
}
.ccaf-modal-close:hover { background: var(--bg,#f1f5f9); }
.ccaf-modal-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.ccaf-modal table { overflow-y: auto; }
.ccaf-modal-table th,
.ccaf-modal-table td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.ccaf-modal-table th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ccaf-mrow-released td { color: var(--muted); }
.ccaf-mrow-special td { font-weight: 600; background: var(--bg,#f1f5f9); }
.ccaf-modal > .ccaf-modal-table { overflow-y: auto; }
.ccaf-modal { gap: 0; }
.ccaf-modal-table { display: block; overflow-y: auto; }

/* ════════════════════════════════════════════════════════════════════════
   CCAF 홈 v3 — 시안 기준
════════════════════════════════════════════════════════════════════════ */

/* ── 페이지 컨테이너 ── */
.ccaf-home-scroll { overflow-y: auto; flex: 1; }
.ccaf-home-v3 {
  max-width: 1440px; margin: 0 auto;
  padding: 24px 24px 48px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ── 페이지 헤더 ── */
.ccaf-phdr { margin-bottom: 4px; }
.ccaf-phdr-title {
  font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2;
}
.ccaf-phdr-sub {
  font-size: 14px; font-weight: 600; color: var(--primary); margin-top: 2px;
}
.ccaf-phdr-desc {
  font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5;
}

/* ── 2-col 대시보드 그리드 ── */
.ccaf-home-v3-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .65fr);
  gap: 20px;
  align-items: start;
}
.ccaf-quiz-col { display: flex; flex-direction: column; }
.ccaf-info-v3  { display: flex; flex-direction: column; gap: 16px; }

/* ── Quiz 카드 ── */
.ccaf-qcard {
  background: var(--card,#fff); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ccaf-qcard-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ccaf-qpill {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 99px; font-size: 11px; font-weight: 700; line-height: 1.4;
  border: 1px solid transparent; white-space: nowrap;
}
.ccaf-qpill-label   { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.ccaf-qpill-done    { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.ccaf-qpill-wip     { background: #fef3c7; color: #78350f; border-color: #fcd34d; }
.ccaf-qpill-upcoming{ background: var(--bg,#f1f5f9); color: var(--muted); border-color: var(--border); }

.ccaf-qcard-titlerow { display: flex; flex-direction: column; gap: 4px; }
.ccaf-qcard-titlerow-illus {
  flex-direction: row; align-items: flex-start; justify-content: space-between;
}
.ccaf-qcard-title {
  font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1;
}
.ccaf-qcard-stage {
  font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px;
}
.ccaf-qcard-sep { color: var(--border); margin: 0 3px; }

.ccaf-cal-illus { width: 110px; height: 95px; flex-shrink: 0; }

.ccaf-qcard-hl {
  background: #ede9fe; border-radius: 10px;
  padding: 12px 16px; display: flex; flex-direction: column; gap: 5px;
}
.ccaf-qcard-hl-date {
  font-size: 13px; font-weight: 700; color: #4f46e5;
}
.ccaf-qcard-hl-body {
  font-size: 12px; color: #4338ca; line-height: 1.5;
}

.ccaf-qcard-stats3 {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 10px;
}
.ccaf-qcs3 {
  background: var(--bg,#f1f5f9); border-radius: 10px; padding: 10px 8px;
  text-align: center;
}
.ccaf-qcs3.ok    { background: #d1fae5; }
.ccaf-qcs3.wrong { background: #fee2e2; }
.ccaf-qcs3-val   { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.1; }
.ccaf-qcs3.ok    .ccaf-qcs3-val { color: #065f46; }
.ccaf-qcs3.wrong .ccaf-qcs3-val { color: #991b1b; }
.ccaf-qcs3-lbl   { font-size: 11px; color: var(--muted); margin-top: 2px; }

.ccaf-qcard-prog-meta {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}
.ccaf-qcard-prog-wrap {
  height: 6px; background: var(--bg,#f1f5f9); border-radius: 99px; overflow: hidden;
}
.ccaf-qcard-prog-bar {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .4s ease;
}
.ccaf-qcard-cta {
  width: 100%; font-size: 14px; font-weight: 700; padding: 11px 16px;
  border-radius: 10px; cursor: pointer; text-align: center;
}

/* ── 시험 준비 현황 카드 ── */
.ccaf-esc {
  background: var(--card,#fff); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ccaf-esc-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 8px;
}
.ccaf-esc-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.ccaf-esc-badge {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: #ede9fe; border-radius: 99px; padding: 2px 10px;
  white-space: nowrap;
}
.ccaf-esc-cols {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 12px;
  margin-bottom: 14px;
}
.ccaf-esc-col    { text-align: center; }
.ccaf-esc-lbl    { font-size: 11px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.ccaf-esc-val    { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.ccaf-esc-dday   .ccaf-esc-val-dday {
  font-size: 22px; font-weight: 900; color: var(--primary); line-height: 1.1;
}
.ccaf-esc-hr     { border: none; border-top: 1px solid var(--border); margin: 0 0 12px; }
.ccaf-esc-range  {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 12px;
}
.ccaf-esc-range-lbl   { font-weight: 600; color: var(--text); white-space: nowrap; }
.ccaf-esc-range-stage { font-weight: 700; color: var(--primary); }
.ccaf-esc-range-topic { color: var(--muted); }

/* ── 빠른 이동 카드 ── */
.ccaf-qnav3 {
  background: var(--card,#fff); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ccaf-qnav3-hdr {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
}
.ccaf-qnav3-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 10px;
}
.ccaf-qn3-card {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 10px; text-align: center;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.ccaf-qn3-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(79,70,229,.12); }
.ccaf-qn3-icon    { font-size: 20px; line-height: 1; }
.ccaf-qn3-label   { font-size: 11px; font-weight: 700; color: var(--text); }
.ccaf-qn3-count   { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.ccaf-qn3-count.zero { color: var(--muted); font-size: 18px; }
.ccaf-qn3-desc    { font-size: 10px; color: var(--muted); line-height: 1.4; padding: 0 2px; min-height: 28px; }
.ccaf-qn3-cta     {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 99px; white-space: nowrap; margin-top: 2px;
}
.ccaf-qn3-cta.wrong { color: #dc2626; background: #fee2e2; }
.ccaf-qn3-cta.team  { color: #059669; background: #d1fae5; }
.ccaf-qn3-cta.bank  { color: #2563eb; background: #dbeafe; }

/* ── 학습 로드맵 카드 ── */
.ccaf-rmcard {
  background: var(--card,#fff); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ccaf-rmcard-hdr {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 18px;
}
.ccaf-rmcard-title {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.ccaf-rmcard-actions {
  display: flex; align-items: center; gap: 12px;
}
.ccaf-rmcard-meta { font-size: 12px; color: var(--muted); }

.ccaf-rmv2-scroll { overflow-x: auto; padding-bottom: 4px; }
.ccaf-rmv2-track  {
  display: flex; align-items: flex-start; gap: 0;
  position: relative; min-width: max-content;
}
.ccaf-rmv2-line {
  position: absolute; top: 15px; left: 0; right: 0; height: 2px;
  background: var(--border); z-index: 0;
}
.ccaf-rmv2-node {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; position: relative; z-index: 1;
  min-width: 110px; padding: 0 8px;
}
.ccaf-rmv2-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border: 2px solid var(--border); background: var(--card,#fff);
  color: var(--muted); flex-shrink: 0;
}
.ccaf-rmv2-active  .ccaf-rmv2-dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.ccaf-rmv2-done    .ccaf-rmv2-dot { border-color: #10b981; background: #d1fae5; color: #065f46; }
.ccaf-rmv2-locked  .ccaf-rmv2-dot { border-color: var(--border); background: var(--bg,#f1f5f9); color: var(--muted); }
.ccaf-rmv2-content { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.ccaf-rmv2-quiz    { font-size: 12px; font-weight: 700; color: var(--text); }
.ccaf-rmv2-date    { font-size: 11px; color: var(--muted); }
.ccaf-rmv2-stage   { font-size: 11px; font-weight: 600; color: var(--primary); margin-top: 2px; }
.ccaf-rmv2-topic   { font-size: 10px; color: var(--muted); max-width: 100px; line-height: 1.4; }
.ccaf-rmv2-active  .ccaf-rmv2-quiz { color: var(--primary); }
.ccaf-rmv2-locked  .ccaf-rmv2-quiz,
.ccaf-rmv2-locked  .ccaf-rmv2-date  { color: var(--muted); }

.ccaf-rmb {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px; white-space: nowrap;
}
.ccaf-rmb.done     { background: #d1fae5; color: #065f46; }
.ccaf-rmb.active   { background: #ede9fe; color: #5b21b6; }
.ccaf-rmb.upcoming { background: var(--bg,#f1f5f9); color: var(--muted); border: 1px solid var(--border); }
.ccaf-rmb.locked   { background: var(--bg,#f1f5f9); color: var(--muted); }

/* ── 사용 가이드 섹션 ── */
.ccaf-gv3-wrap {
  background: var(--card,#fff); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ccaf-gv3-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.ccaf-gv3-hdr-title { font-size: 14px; font-weight: 700; color: var(--text); }
.ccaf-gv3-collapse  {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--muted); padding: 2px 6px;
}
.ccaf-gv3-collapse:hover { color: var(--text); }
.ccaf-gv3-body  { padding: 16px 20px; }
.ccaf-gv3-cards {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
}
.ccaf-gv3-item.open .ccaf-gv3-card { border-color: var(--primary); background: #f5f3ff; }
.ccaf-gv3-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 12px;
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ccaf-gv3-card:hover { border-color: var(--primary); }
.ccaf-gv3-icon    { font-size: 20px; flex-shrink: 0; }
.ccaf-gv3-text    { flex: 1; min-width: 0; }
.ccaf-gv3-title   { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.ccaf-gv3-summary { font-size: 11px; color: var(--muted); line-height: 1.5; }
.ccaf-gv3-chev    { font-size: 16px; color: var(--muted); flex-shrink: 0; align-self: center; }
.ccaf-gv3-detail  {
  border-top: 1px solid var(--border); padding: 14px 16px;
  font-size: 12px; color: var(--text); line-height: 1.7;
  background: var(--bg,#f1f5f9); border-radius: 0 0 12px 12px;
}
.ccaf-gv3-detail ul, .ccaf-gv3-detail ol { margin: 0; padding-left: 18px; }
.ccaf-gv3-detail li { margin-bottom: 6px; }
.ccaf-guide-sched { border-collapse: collapse; width: 100%; font-size: 12px; margin-top: 8px; }
.ccaf-guide-sched th,
.ccaf-guide-sched td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.ccaf-guide-sched th  { font-weight: 700; color: var(--muted); font-size: 11px; }
.ccaf-g2-exam {
  font-size: 13px; margin-bottom: 10px;
  padding: 8px 12px; background: #ede9fe; border-radius: 8px; color: #4338ca;
}

/* ── 다크 모드 ── */
:root[data-theme="dark"] .ccaf-qcard-hl      { background: rgba(139,92,246,.18); }
:root[data-theme="dark"] .ccaf-qcard-hl-date { color: #a5b4fc; }
:root[data-theme="dark"] .ccaf-qcard-hl-body { color: #c4b5fd; }
:root[data-theme="dark"] .ccaf-qpill-label   { background: rgba(139,92,246,.25); color: #c4b5fd; border-color: rgba(167,139,250,.4); }
:root[data-theme="dark"] .ccaf-qcs3.ok       { background: rgba(16,185,129,.18); }
:root[data-theme="dark"] .ccaf-qcs3.wrong    { background: rgba(239,68,68,.18); }
:root[data-theme="dark"] .ccaf-qn3-cta.wrong { background: rgba(220,38,38,.2); color: #f87171; }
:root[data-theme="dark"] .ccaf-qn3-cta.team  { background: rgba(5,150,105,.2); color: #34d399; }
:root[data-theme="dark"] .ccaf-qn3-cta.bank  { background: rgba(37,99,235,.2); color: #60a5fa; }
:root[data-theme="dark"] .ccaf-esc-badge     { background: rgba(139,92,246,.25); color: #c4b5fd; }
:root[data-theme="dark"] .ccaf-rmb.done      { background: rgba(16,185,129,.2); color: #34d399; }
:root[data-theme="dark"] .ccaf-rmb.active    { background: rgba(139,92,246,.2); color: #c4b5fd; }
:root[data-theme="dark"] .ccaf-gv3-item.open .ccaf-gv3-card { background: rgba(139,92,246,.12); }
:root[data-theme="dark"] .ccaf-g2-exam       { background: rgba(139,92,246,.2); color: #c4b5fd; }

/* ── 반응형 ── */
@media (max-width: 900px) {
  .ccaf-home-v3-grid  { grid-template-columns: 1fr; }
  .ccaf-gv3-cards     { grid-template-columns: repeat(2,1fr); }
  .ccaf-esc-cols      { grid-template-columns: repeat(3,1fr); }
  .ccaf-cal-illus     { width: 85px; height: 74px; }
}
@media (max-width: 640px) {
  .ccaf-home-v3       { padding: 16px 16px 40px; gap: 16px; }
  .ccaf-gv3-cards     { grid-template-columns: 1fr; }
  .ccaf-qnav3-grid    { gap: 8px; }
  .ccaf-qn3-desc      { display: none; }
  .ccaf-rmv2-node     { min-width: 90px; }
  .ccaf-rmv2-topic    { display: none; }
  .ccaf-esc-cols      { gap: 6px; }
  .ccaf-esc-lbl       { font-size: 10px; }
  .ccaf-cal-illus     { width: 70px; height: 60px; }
  .ccaf-qcard-title   { font-size: 20px; }
}

/* ── 모달 날짜 열 줄바꿈 방지 ── */
.ccaf-modal-table td,
.ccaf-modal-table th { white-space: nowrap; }

/* ── 시험 준비 현황: 학습 시작일 ── */
.ccaf-esc-studystart {
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
  display: flex; align-items: center; gap: 4px;
}
.ccaf-esc-studystart strong { color: var(--text); }
