/* ════════════════════════════════════════════════════════════
   인스타 코칭 대시보드 v2 — app.css
   ════════════════════════════════════════════════════════════ */

/* ── CSS 변수 ─────────────────────────────────────────────── */
:root {
  --accent:      #4f46e5;
  --accent-light:#eef2ff;
  --accent-dark: #3730a3;
  --green:       #16a34a;
  --green-light: #dcfce7;
  --warn:        #d97706;
  --warn-light:  #fef3c7;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --blue:        #2563eb;
  --blue-light:  #dbeafe;
  --gray:        #6b7280;
  --gray-light:  #f3f4f6;
  --gray-border: #e5e7eb;

  --bg:          #f9fafb;
  --surface:     #ffffff;
  --text:        #111827;
  --text-muted:  #6b7280;
  --text-faint:  #9ca3af;

  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);

  --nav-h:       56px;
  --container:   900px;
  --font:        'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --surface-raised: #ffffff;
}

/* ── 리셋 / 베이스 ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

p { margin-bottom: .5rem; }

/* ── 레이아웃 ────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 1.5rem) 1rem 3rem;
}

/* ── 탑 네비 ─────────────────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--gray-border);
  box-shadow: var(--shadow-sm);
  z-index: 100;
}

.topnav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.topnav-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.faint { color: var(--text-faint); font-size: .875rem; }

/* ── 외부 접속 URL 칩 ────────────────────────────────────── */
.external-url-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(16,185,129,.12);
  color: var(--green, #10b981);
  border: 1px solid rgba(16,185,129,.3);
  text-decoration: none;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s;
}
.external-url-chip:hover {
  background: rgba(16,185,129,.22);
  text-decoration: none;
}

/* ── 버튼 ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn:active { opacity: .8; }

.btn-primary  { background: var(--accent);    color: #fff; }
.btn-success  { background: var(--green);     color: #fff; }
.btn-warn     { background: var(--warn);      color: #fff; }
.btn-danger   { background: var(--red);       color: #fff; }
.btn-ghost    { background: var(--gray-light); color: var(--text); }
.btn-outline  {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-light); }
.btn-sm  { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg  { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── 뱃지 ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.4;
}

/* [사실] — 파란색 실선 */
.badge-fact {
  color: var(--blue);
  border: 1.5px solid var(--blue);
  background: var(--blue-light);
}

/* [추론] — 주황색 점선 */
.badge-infer {
  color: var(--warn);
  border: 1.5px dashed var(--warn);
  background: var(--warn-light);
}

/* [데이터없음] — 회색 빗금 */
.badge-nodata {
  color: var(--gray);
  border: 1.5px solid var(--gray-border);
  background: repeating-linear-gradient(
    135deg,
    var(--gray-light),
    var(--gray-light) 3px,
    #e5e7eb 3px,
    #e5e7eb 6px
  );
}

.badge-active   { background: var(--green-light); color: var(--green); border: 1.5px solid var(--green); }
.badge-archived { background: var(--gray-light);  color: var(--gray);  border: 1.5px solid var(--gray-border); }
.badge-draft    { background: var(--warn-light);  color: var(--warn);  border: 1.5px solid var(--warn); }
.badge-confirmed { background: var(--green-light); color: var(--green); border: 1.5px solid var(--green); }

/* ── 카드 ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem .875rem;
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.card-body { padding: 1.25rem; }
.card-footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--gray-border);
  background: var(--gray-light);
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* ── 플래시 메시지 ────────────────────────────────────────── */
.flash {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 500;
  border-left: 4px solid transparent;
}
.flash.success { background: var(--green-light); border-color: var(--green); color: var(--green); }
.flash.error   { background: var(--red-light);   border-color: var(--red);   color: var(--red); }
.flash.info    { background: var(--blue-light);  border-color: var(--blue);  color: var(--blue); }
.flash.warning { background: var(--warn-light);  border-color: var(--warn);  color: var(--warn); }

/* ── 로그인 폼 ───────────────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
}

.login-logo {
  font-size: 2rem;
  text-align: center;
  margin-bottom: .5rem;
}

.login-title {
  text-align: center;
  font-size: 1.25rem;
  margin-bottom: .25rem;
}

.login-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 2rem;
}

/* ── 폼 요소 ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .375rem;
}
.form-label .req { color: var(--red); margin-left: .15rem; }

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: .5rem .875rem;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }

/* ── 섹션 헤더 ───────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: .75rem;
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ── 기수 탭 바 ──────────────────────────────────────────── */
.cohort-tabs {
  display: flex;
  gap: .375rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.cohort-tab {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .35rem .875rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1.5px solid transparent;
  transition: all .15s;
  cursor: pointer;
  text-decoration: none;
}
.cohort-tab:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.cohort-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* 새 기수 인라인 폼 */
.cohort-new-inline { list-style: none; position: relative; }
.cohort-new-inline summary { list-style: none; }
.cohort-new-inline summary::-webkit-details-marker { display: none; }
.cohort-tab-add {
  color: var(--accent);
  border-style: dashed;
  cursor: pointer;
}
.cohort-tab-add:hover { background: var(--accent-light); }
.cohort-new-form-wrap {
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 1rem;
  min-width: 460px;
}
.cohort-new-form {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ── 기수 요약 바 ────────────────────────────────────────── */
.cohort-summary {
  display: flex;
  gap: 1px;
  background: var(--gray-border);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cohort-stat {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--surface);
  text-align: center;
}

.cohort-stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: .25rem;
}

.cohort-stat-lbl {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── 수강생 카드 그리드 ───────────────────────────────────── */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.student-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.student-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.student-card-header {
  padding: 1rem 1.125rem .75rem;
  border-bottom: 1px solid var(--gray-border);
  position: relative;
}

.student-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .1rem;
  color: var(--text);
}

.student-handle {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.student-followers {
  display: flex;
  align-items: center;
  gap: .375rem;
  margin-top: .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.delta {
  font-size: .75rem;
  font-weight: 600;
  padding: .1rem .4rem;
  border-radius: 999px;
}
.delta.pos { color: var(--green); background: var(--green-light); }
.delta.neg { color: var(--red);   background: var(--red-light); }
.delta.zero { color: var(--gray); background: var(--gray-light); }

/* 최근 7일 일별 발행 현황 미니 그리드 */
.mini-pulse {
  padding: .45rem 1rem .5rem;
  background: var(--gray-light);
  border-bottom: 1px solid var(--gray-border);
}
.mini-pulse-grid {
  display: grid;
  grid-template-columns: 2rem repeat(7, 1fr);
  row-gap: .2rem;
  align-items: center;
}
.mp-corner { /* 빈 왼쪽 상단 */ }
.mp-date {
  font-size: .58rem;
  color: var(--gray);
  text-align: center;
  line-height: 1.2;
}
.mp-date.mp-today {
  font-weight: 700;
  color: var(--accent);
}
.mp-label {
  font-size: .6rem;
  font-weight: 700;
  line-height: 1;
}
.mp-label.mp-reels { color: #7c3aed; }
.mp-label.mp-feed  { color: #2563eb; }
.mp-label.mp-story { color: #db2777; }
.mp-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mp-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.mp-dot.mp-empty  { background: #e5e7eb; }
.mp-dot.mp-reels  { background: #7c3aed; }
.mp-dot.mp-feed   { background: #2563eb; }
.mp-dot.mp-story  { background: #db2777; }

.student-card-body {
  padding: .875rem 1.125rem;
}

/* 별점 */
.stars {
  display: inline-flex;
  gap: .05rem;
  font-size: 1rem;
  color: var(--warn);
  letter-spacing: -.05rem;
}
.star-empty { color: var(--gray-border); }

.score-label {
  font-size: .72rem;
  color: var(--text-muted);
  margin-left: .25rem;
}

/* ── 카테고리 미니 바 ────────────────────────────────────── */
.cat-bars {
  margin-top: .75rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.cat-bar-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.cat-bar-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 44px;
  flex-shrink: 0;
  text-align: right;
}

.cat-bar-track {
  flex: 1;
  height: 6px;
  background: var(--gray-light);
  border-radius: 999px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .3s;
}
.cat-bar-fill.low  { background: var(--red); }
.cat-bar-fill.mid  { background: var(--warn); }
.cat-bar-fill.high { background: var(--green); }

.cat-bar-val {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 22px;
  text-align: left;
  flex-shrink: 0;
}

.student-card-footer {
  padding: .75rem 1.125rem;
  border-top: 1px solid var(--gray-border);
  background: var(--gray-light);
  display: flex;
  gap: .5rem;
}

/* ── 수강생 상세 헤더 ────────────────────────────────────── */
.student-hero {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.student-hero-info h1 {
  font-size: 1.4rem;
  margin-bottom: .2rem;
}

.student-hero-info .handle {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: .5rem;
}

.student-meta-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}

.student-hero-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* ── 탭 시스템 ───────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .6rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--accent); text-decoration: none; }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-count {
  background: var(--gray-light);
  color: var(--text-muted);
  padding: .1rem .4rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
}
.tab-btn.active .tab-count {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── 평가 항목 카드 ──────────────────────────────────────── */
.eval-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .875rem;
}

@media (min-width: 600px) {
  .eval-grid { grid-template-columns: 1fr 1fr; }
}

.eval-item-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow-sm);
}

.eval-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}

.eval-item-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}

.eval-item-score {
  display: flex;
  align-items: center;
  gap: .375rem;
  flex-shrink: 0;
}

.score-bar-wrap {
  width: 60px;
  height: 6px;
  background: var(--gray-light);
  border-radius: 999px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 999px;
}
.score-bar-fill.s1 { background: var(--red);   width: 20%; }
.score-bar-fill.s2 { background: #f97316;       width: 40%; }
.score-bar-fill.s3 { background: var(--warn);   width: 60%; }
.score-bar-fill.s4 { background: #84cc16;       width: 80%; }
.score-bar-fill.s5 { background: var(--green);  width: 100%; }
.score-bar-fill.s0 { background: var(--gray-border); width: 0%; }

.eval-evidence {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: .5rem 0;
}

.confidence-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .375rem;
}
.confidence-bar-label {
  font-size: .68rem;
  color: var(--text-faint);
  width: 36px;
  flex-shrink: 0;
}
.confidence-bar-track {
  flex: 1;
  height: 4px;
  background: var(--gray-light);
  border-radius: 999px;
  overflow: hidden;
}
.confidence-bar-fill {
  height: 100%;
  background: var(--warn);
  border-radius: 999px;
}
.confidence-val {
  font-size: .68rem;
  color: var(--text-faint);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* 강사 수동 입력 섹션 */
.instructor-edit {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--gray-border);
}
.instructor-edit summary {
  font-size: .78rem;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
}
.instructor-edit summary:hover { color: var(--accent); }
.instructor-edit-form {
  margin-top: .5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ── 점수 바 (1-5) ───────────────────────────────────────── */
.score-progress {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.score-progress-track {
  flex: 1;
  height: 8px;
  background: var(--gray-light);
  border-radius: 999px;
  overflow: hidden;
}
.score-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .3s;
}

/* ── 평가 이력 타임라인 ──────────────────────────────────── */
.eval-timeline {
  position: relative;
  padding-left: 1.5rem;
}
.eval-timeline::before {
  content: '';
  position: absolute;
  left: .5rem;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--gray-border);
}

.eval-timeline-item {
  position: relative;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  box-shadow: var(--shadow-sm);
}
.eval-timeline-item::before {
  content: '';
  position: absolute;
  left: -1.1rem;
  top: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent);
}

.eval-timeline-date {
  font-size: .78rem;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: .25rem;
}
.eval-timeline-score {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}

/* ── 빈 상태 ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}
.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text);
}
.empty-state p {
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

/* ── 폼 페이지 ───────────────────────────────────────────── */
.form-page {
  max-width: 620px;
  margin: 0 auto;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-card-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--gray-border);
  background: var(--gray-light);
}

.form-card-body { padding: 1.5rem; }
.form-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── 팀 메모 ─────────────────────────────────────────────── */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.note-item {
  background: var(--gray-light);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--text-faint);
  margin-bottom: .25rem;
}
.note-author {
  font-weight: 700;
  color: var(--text-muted);
}
.note-text {
  font-size: .875rem;
  color: var(--text);
  white-space: pre-wrap;
}

/* ── 스크롤 탑 버튼 ──────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 50;
}
.scroll-top.show { opacity: 1; pointer-events: auto; }

/* ── 유틸리티 ────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm       { gap: .5rem; }
.gap-md       { gap: 1rem; }
.gap-lg       { gap: 1.5rem; }
.mt-sm        { margin-top: .5rem; }
.mt-md        { margin-top: 1rem; }
.mt-lg        { margin-top: 1.5rem; }
.mb-sm        { margin-bottom: .5rem; }
.mb-md        { margin-bottom: 1rem; }
.mb-lg        { margin-bottom: 1.5rem; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .78rem; }
.fw-bold      { font-weight: 700; }
.nowrap       { white-space: nowrap; }

.pill {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--gray-light);
  color: var(--text-muted);
}
.pill-accent { background: var(--accent-light); color: var(--accent); }
.pill-story  { background: #fdf2f8; color: #9333ea; }

/* ── 반응형 ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .student-grid { grid-template-columns: 1fr; }
  .cohort-summary { flex-wrap: wrap; }
  .cohort-stat { min-width: 50%; }
  .student-hero { flex-direction: column; }
  .eval-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  h1 { font-size: 1.25rem; }
  .btn-lg { font-size: .9rem; padding: .65rem 1.2rem; }
}

@media (max-width: 400px) {
  .tabs { gap: 0; }
  .tab-btn { padding: .5rem .625rem; font-size: .8rem; }
}

/* ── 스피너 ──────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* ── 섹션 구분선 ─────────────────────────────────────────── */
.section-divider {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid var(--gray-border);
}

/* ── 상태 아이콘 ─────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green  { background: var(--green); }
.status-dot.yellow { background: var(--warn); }
.status-dot.gray   { background: var(--gray); }

/* ── 기수 전환 select (모바일) ───────────────────────────── */
.cohort-select-mobile {
  display: none;
}
@media (max-width: 500px) {
  .cohort-tabs { display: none; }
  .cohort-select-mobile { display: block; margin-bottom: 1rem; }
}

/* ════════════════════════════════════════════════════════════
   v2 Analytics UI — 수강생 상세 개요 탭
   ════════════════════════════════════════════════════════════ */

/* === Daily Pulse Grid === */
.pulse-grid { margin-top: .25rem; }
.pulse-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pulse-label { width: 40px; font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; flex-shrink: 0; }
.pulse-dots { display: flex; gap: 4px; }
.pulse-dot {
  width: 18px; height: 18px; border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.pulse-dot.posted { background: var(--accent); }
.pulse-dot.posted .pulse-count {
  font-size: 9px; font-weight: 700; color: #fff;
  line-height: 1; user-select: none;
}
.pulse-dot.zero { background: transparent; border: 2px solid var(--gray-border); }
.pulse-dot.nodata { background: var(--gray-light); }
.pulse-dates { display: flex; gap: 4px; padding-left: 46px; margin-top: 4px; }
.pulse-date { width: 18px; font-size: 0.6rem; color: var(--text-faint); text-align: center; flex-shrink: 0; }
.pulse-date.today { color: var(--accent); font-weight: 700; }

/* === Metrics Row === */
.metrics-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 1rem 0; }
@media(max-width:600px) { .metrics-grid { grid-template-columns: repeat(2,1fr); } }
.metric-card { background: var(--surface); border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 1rem 1.125rem; }
.metric-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; margin-bottom: .375rem; }
.metric-value { font-size: 1.625rem; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -.02em; }
.metric-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: .25rem; }
.metric-delta { font-size: 0.75rem; font-weight: 600; }
.metric-delta.pos { color: var(--green); }
.metric-delta.neg { color: var(--red); }
.metric-delta.zero { color: var(--gray); }

/* === Keyword Bars === */
.keyword-list { display: flex; flex-direction: column; gap: .5rem; }
.keyword-item { display: flex; align-items: center; gap: .5rem; }
.keyword-word { font-size: .8rem; font-weight: 600; min-width: 60px; color: var(--text); }
.keyword-bar-wrap { flex: 1; background: var(--gray-light); border-radius: 99px; height: 6px; }
.keyword-bar-fill { height: 6px; border-radius: 99px; background: var(--accent); min-width: 6px; }
.keyword-count { font-size: .75rem; color: var(--text-muted); min-width: 24px; text-align: right; }

/* === Content Grid === */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.content-card { border: 1px solid var(--gray-border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.content-thumb { width: 100%; aspect-ratio: 1; background: var(--gray-light); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--text-faint); overflow: hidden; }
.content-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* 스토리는 9:16 세로 비율 */
.content-thumb-story { aspect-ratio: 9/16; }
.content-thumb-story img { object-fit: contain; background: #000; }
.content-info { padding: .75rem; }
.content-meta { display: flex; gap: .5rem; align-items: center; margin-bottom: .375rem; }
.content-hook { font-size: .8rem; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .5rem; }
.content-stats { display: flex; gap: .75rem; }
.content-stat { font-size: .75rem; color: var(--text-muted); }
.content-stat strong { color: var(--text); }

/* === Analysis Section === */
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:640px) { .analysis-grid { grid-template-columns: 1fr; } }

/* === Direction Diagnosis === */
.direction-goal { background: var(--accent-light); border-left: 3px solid var(--accent); padding: .75rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .875rem; margin-bottom: 1rem; }

/* === Section Heading (override) === */
.section-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; margin-bottom: .875rem; }

/* === Top Tab Nav (for student detail) === */
.detail-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-border); margin-bottom: 1.5rem; }
.detail-tab { padding: .625rem 1.25rem; font-size: .875rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none; white-space: nowrap; transition: color .15s; }
.detail-tab:hover { color: var(--text); text-decoration: none; }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* === Student Hero (redesigned) === */
.student-hero-v2 { display: flex; align-items: flex-start; gap: 1.5rem; margin-bottom: 1.5rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--gray-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.hero-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.375rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-body { flex: 1; min-width: 0; }
.hero-name { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.hero-handle { font-size: .875rem; color: var(--text-muted); margin-top: .125rem; }
.hero-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .625rem; align-items: center; }
.hero-goal { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; flex-shrink: 0; }
@media(max-width:600px) { .student-hero-v2 { flex-direction: column; } .hero-actions { width: 100%; } }

/* === Eval tabs (sub-tabs inside 평가 tab) === */
.eval-subtabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.eval-subtab { padding: .3rem .75rem; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600; color: var(--text-muted); background: var(--gray-light); text-decoration: none; transition: all .15s; }
.eval-subtab:hover { color: var(--text); text-decoration: none; }
.eval-subtab.active { background: var(--accent); color: #fff; }

/* === Eval score bar in overview === */
.eval-overview-bar { display: flex; align-items: center; gap: .75rem; margin-bottom: .625rem; }
.eval-cat-name { font-size: .8rem; font-weight: 600; min-width: 64px; color: var(--text); }
.eval-score-bar-wrap { flex: 1; background: var(--gray-light); border-radius: 99px; height: 8px; }
.eval-score-bar-fill { height: 8px; border-radius: 99px; background: var(--accent); }
.eval-score-val { font-size: .8rem; font-weight: 700; min-width: 28px; text-align: right; color: var(--text); }
.eval-score-nodata { font-size: .75rem; color: var(--text-faint); min-width: 28px; text-align: right; }

/* === Story Collect Status Banner === */
.story-status-banner {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem;
  border: 1px solid var(--gray-border); border-radius: var(--radius);
  font-size: .875rem; background: var(--surface);
}

/* === Content Grid (Analyzed) === */
.content-grid-analyzed { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Content card with analysis gets a subtle left accent */
.content-card-analyzed { border-left: 3px solid var(--accent); }

/* Direction badge overlay on thumbnail */
.content-thumb { position: relative; }
.content-direction-badge {
  position: absolute; bottom: 6px; right: 6px;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: .7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: var(--shadow-sm); color: #fff;
}
.dir-high { background: var(--green); }
.dir-mid  { background: var(--warn); }
.dir-low  { background: var(--red); }

/* Content analysis panel */
.content-analysis-panel {
  margin-top: .625rem;
  border-top: 1px solid var(--gray-border);
  padding-top: .625rem;
}

/* Score mini bars */
.analysis-scores { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .5rem; }
.ascore-row { display: flex; align-items: center; gap: .5rem; }
.ascore-label { font-size: .68rem; font-weight: 700; color: var(--text-muted); min-width: 34px; }
.ascore-bar-wrap { flex: 1; background: var(--gray-light); border-radius: 99px; height: 5px; overflow: hidden; }
.ascore-bar { height: 5px; border-radius: 99px; transition: width .4s; }
.ascore-val { font-size: .72rem; font-weight: 700; min-width: 22px; text-align: right; color: var(--text); }

/* Analysis detail accordion */
.analysis-detail-block { margin-top: .375rem; }
.analysis-summary {
  font-size: .72rem; color: var(--accent); cursor: pointer; font-weight: 600;
  padding: .25rem 0; list-style: none; outline: none;
}
.analysis-summary::-webkit-details-marker { display: none; }
.analysis-texts { margin-top: .5rem; display: flex; flex-direction: column; gap: .5rem; }

.atext-block { background: var(--gray-light); border-radius: var(--radius-sm); padding: .5rem .625rem; }
.atext-suggest { background: var(--accent-light); }
.atext-label { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .2rem; }
.atext-suggest .atext-label { color: var(--accent); }
.atext-body { font-size: .78rem; line-height: 1.5; color: var(--text); }

/* Per-content analyze button row */
.content-analyze-action { margin-top: .5rem; display: flex; justify-content: flex-end; }

/* danger/success CSS vars (alias) */
:root { --danger: var(--red); --success: var(--green); --purple: #8b5cf6; }

/* === Performance Facts Grid (premium) === */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .625rem;
  margin-bottom: .875rem;
}
@media(max-width:640px) { .facts-grid { grid-template-columns: repeat(2, 1fr); } }

.facts-cell {
  background: var(--surface);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  border: 1px solid var(--gray-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s;
}
.facts-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gray-border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.facts-cell:hover { box-shadow: var(--shadow); }
.facts-cell.facts-good { border-color: #86efac; background: linear-gradient(135deg, #f0fdf4 0%, #fff 60%); }
.facts-cell.facts-good::before { background: linear-gradient(90deg, var(--green), #4ade80); }
.facts-cell.facts-warn { border-color: #fcd34d; background: linear-gradient(135deg, #fffbeb 0%, #fff 60%); }
.facts-cell.facts-warn::before { background: linear-gradient(90deg, var(--warn), #fbbf24); }

.facts-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: .375rem; }
.facts-value { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -.02em; }
.facts-cell.facts-good .facts-value { color: var(--green); }
.facts-cell.facts-warn .facts-value { color: var(--warn); }
.facts-sub { font-size: .67rem; color: var(--text-faint); margin-top: .3rem; line-height: 1.4; }

.facts-trend {
  display: flex; align-items: center; gap: .375rem; padding: .5rem .875rem;
  border-radius: var(--radius-sm); font-size: .8rem; font-weight: 700;
  margin-top: .625rem; border: 1px solid transparent;
}
.facts-trend-up   { background: var(--green-light); color: var(--green);   border-color: #86efac; }
.facts-trend-down { background: var(--red-light);   color: var(--red);     border-color: #fca5a5; }
.facts-trend-flat { background: var(--warn-light);  color: var(--warn);    border-color: #fcd34d; }

/* === Performance Comparison Block === */
.perf-block { border-radius: var(--radius); padding: .875rem 1rem; }
.perf-block.perf-top { background: linear-gradient(135deg, #f0fdf4, #fff); border: 1px solid #86efac; }
.perf-block.perf-low { background: linear-gradient(135deg, #fffbeb, #fff); border: 1px solid #fcd34d; }
.perf-block-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .625rem; }

.perf-item { padding: .5rem 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.perf-item:last-child { border-bottom: none; padding-bottom: 0; }
.perf-metrics { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-bottom: .25rem; }
.perf-badge { font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; }
.perf-badge.perf-save { background: var(--green); color: #fff; }
.perf-badge.perf-view { background: var(--accent); color: #fff; }
.perf-badge.perf-low-badge { background: var(--warn); color: #fff; }
.perf-stat { font-size: .72rem; color: var(--text-muted); }
.perf-caption { font-size: .8rem; color: var(--text); line-height: 1.5; font-weight: 500; }

/* === Coaching Report === */
.coaching-section {
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  margin-bottom: .625rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.coaching-section:hover { box-shadow: var(--shadow); }
.coaching-section-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.coaching-icon { font-size: 1.1rem; }
.coaching-title { font-size: .9rem; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.coaching-status-badge {
  font-size: .65rem; font-weight: 700; padding: .15rem .5rem;
  border-radius: 99px; text-transform: uppercase; letter-spacing: .04em;
}
.status-good    { background: var(--green-light); color: var(--green); }
.status-bad     { background: var(--red-light);   color: var(--red); }
.status-warning { background: var(--warn-light);  color: var(--warn); }
.status-na      { background: var(--gray-light);  color: var(--text-muted); }

.coaching-summary { font-size: .85rem; font-weight: 600; color: var(--text); line-height: 1.5; }
.coaching-detail  { font-size: .8rem;  color: var(--text-muted); margin-top: .25rem; line-height: 1.5; }
.coaching-evidence { font-size: .75rem; color: var(--text-muted); margin-top: .375rem; background: var(--gray-light); padding: .3rem .5rem; border-radius: 4px; line-height: 1.4; }
.coaching-insight { font-size: .8rem; margin-top: .375rem; padding: .3rem .5rem; border-radius: 4px; background: var(--accent-light); line-height: 1.4; }
.coaching-insight-warn { background: var(--warn-light); }
.insight-label { font-weight: 700; margin-right: .25rem; }

/* === Coaching Points === */
.coaching-points-block { margin-top: .75rem; }
.cp-item { display: flex; flex-direction: column; gap: .25rem; padding: .6rem .75rem; border-left: 3px solid var(--accent); margin-bottom: .5rem; background: var(--accent-light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.cp-header { display: flex; align-items: center; gap: .5rem; }
.cp-priority { width: 20px; height: 20px; background: var(--accent); color: #fff; border-radius: 50%; font-size: .7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cp-title { font-size: .875rem; font-weight: 700; }
.cp-evidence { font-size: .75rem; color: var(--text-muted); padding: .2rem .4rem; background: rgba(255,255,255,.6); border-radius: 4px; }
.cp-action { font-size: .8rem; color: var(--accent-dark, var(--accent)); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   포렌식 콘텐츠 카드 (콘텐츠 탭 — 할루시네이션 0% 실측 데이터 표시)
   ═══════════════════════════════════════════════════════════ */

/* 리스트 컨테이너 */
.forensic-content-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* 개별 카드 */
.forensic-card {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.forensic-card:hover {
  box-shadow: var(--shadow);
  border-color: #d1d5db;
}

/* 티어별 왼쪽 컬러 바 */
.forensic-card.tier-high { border-left: 3px solid var(--green); }
.forensic-card.tier-low  { border-left: 3px solid var(--warn); }
.forensic-card.tier-mid  { border-left: 3px solid var(--accent); }

/* ── 왼쪽: 썸네일 영역 ── */
.forensic-left {
  flex-shrink: 0;
  width: 88px;
}

.forensic-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.forensic-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.forensic-thumb-story {
  height: 100%;
  min-height: 88px;
  border-right: 1px dashed var(--gray-border);
  background: #fdf2f8;
}

/* 성과 티어 배지 (썸네일 위 오버레이) */
.forensic-tier {
  position: absolute;
  bottom: 5px; right: 5px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  backdrop-filter: blur(2px);
  border: 1.5px solid rgba(255,255,255,.5);
}
.forensic-tier.tier-high { background: rgba(22, 163, 74, .85); }
.forensic-tier.tier-low  { background: rgba(217, 119, 6, .85); }
.forensic-tier.tier-mid  { background: rgba(79, 70, 229, .75); }

/* ── 오른쪽: 본문 영역 ── */
.forensic-body {
  flex: 1;
  min-width: 0;
  padding: .625rem .875rem;
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

/* 헤더 행: 타입 pill + 날짜 + 링크 */
.forensic-header {
  display: flex;
  align-items: center;
  gap: .375rem;
  flex-wrap: nowrap;
  min-height: 24px;
}

/* 캡션 훅 (첫 줄 요약) */
.forensic-caption-hook {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 콘텐츠 서브탭 (릴스·피드 / 스토리) ── */
.content-subtab-bar {
  display: flex;
  gap: .375rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--gray-border);
  padding-bottom: 0;
}
.content-subtab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: .45rem .9rem;
  font-size: .84rem;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border-radius: .35rem .35rem 0 0;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.content-subtab:hover { color: var(--text); }
.content-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.subtab-badge {
  background: var(--gray-light);
  color: var(--gray);
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 99px;
  min-width: 1.4rem;
  text-align: center;
}
.content-subtab.active .subtab-badge {
  background: #ede9fe;
  color: var(--accent);
}

/* 스토리 텍스트 전체 표시 */
.story-text-block {
  font-size: .84rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: #fdf4ff;
  border-left: 3px solid #db2777;
  padding: .4rem .6rem;
  border-radius: 0 .4rem .4rem 0;
  margin-bottom: .25rem;
}
.story-text-empty {
  font-size: .78rem;
  color: var(--gray);
  font-style: italic;
  margin-bottom: .25rem;
}

/* ── 포렌식 지표 행 ── */
.forensic-metrics {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  align-items: stretch;
}

/* 개별 지표 칩 */
.fm-item {
  display: flex;
  align-items: center;
  gap: .25rem;
  background: var(--gray-light);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: .25rem .5rem;
  white-space: nowrap;
}
/* 조회수는 약간 더 강조 */
.fm-item.fm-views {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.fm-icon  { font-size: .78rem; line-height: 1; }
.fm-val   { font-size: .82rem; font-weight: 800; color: var(--text); }
.fm-label { font-size: .67rem; color: var(--text-faint); font-weight: 600; }

/* 비율 배지 */
.fm-rate {
  font-size: .67rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0,0,0,.06);
  border-radius: 99px;
  padding: .05rem .3rem;
}
.fm-rate.fm-rate-high {
  color: var(--green);
  background: var(--green-light);
}

/* 계정 평균 대비 */
.fm-vs {
  font-size: .67rem;
  font-weight: 700;
  border-radius: 99px;
  padding: .05rem .3rem;
  background: rgba(0,0,0,.06);
  color: var(--text-muted);
}
.fm-vs.fm-vs-high { background: #dcfce7; color: var(--green); }
.fm-vs.fm-vs-low  { background: #fff7ed; color: var(--warn); }

/* ── 전체 캡션 accordion ── */
.forensic-caption-detail {
  margin-top: .125rem;
}
.forensic-caption-toggle {
  font-size: .72rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  outline: none;
  padding: .125rem 0;
  display: inline-block;
}
.forensic-caption-toggle::-webkit-details-marker { display: none; }
.forensic-caption-toggle::before { content: '▶ '; font-size: .6rem; }
details[open] .forensic-caption-toggle::before { content: '▼ '; }
.forensic-caption-full {
  font-size: .79rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  padding: .5rem .625rem;
  margin-top: .25rem;
  border-left: 2px solid var(--gray-border);
}

/* ── 액션 + AI 제안 ── */
.forensic-actions {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  margin-top: .125rem;
}

/* AI 제안 블록 */
.forensic-ai-suggestion {
  background: var(--accent-light);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-sm);
  padding: .4rem .625rem;
}

/* ── 반응형: 모바일에서 썸네일 크기 축소 ── */
@media(max-width: 480px) {
  .forensic-left { width: 64px; }
  .forensic-thumb { width: 64px; height: 64px; }
  .forensic-thumb-story { min-height: 64px; }
  .forensic-body { padding: .5rem .625rem; }
  .forensic-metrics { gap: .2rem; }
  .fm-item { padding: .2rem .35rem; }
}

/* ── 시각 분석 패널 (Gemini Vision) ──────────────────────────── */
.visual-analysis-panel {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: var(--radius-sm);
  padding: .625rem .75rem;
  margin-top: .5rem;
}
.va-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.va-title {
  font-size: .72rem;
  font-weight: 700;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.va-overall {
  font-size: .78rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 99px;
}
.va-good  { background: #d1fae5; color: #065f46; }
.va-mid   { background: #fef3c7; color: #92400e; }
.va-bad   { background: #fee2e2; color: #991b1b; }

/* 4대 점수 바 */
.va-scores {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .5rem;
}
.va-score-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: default;
}
.va-score-label {
  font-size: .68rem;
  color: var(--text-muted);
  min-width: 7.5rem;
  white-space: nowrap;
}
.va-score-bar-wrap {
  flex: 1;
  background: #ede9fe;
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
.va-score-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .4s;
}
.va-score-num {
  font-size: .7rem;
  font-weight: 700;
  min-width: 1.8rem;
  text-align: right;
}
.va-score-good { color: #065f46; }
.va-score-mid  { color: #92400e; }
.va-score-bad  { color: #991b1b; }

/* 핵심 문제 */
.va-issue {
  display: flex;
  align-items: flex-start;
  gap: .35rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: .3rem .5rem;
  margin-bottom: .4rem;
}
.va-issue-label {
  font-size: .65rem;
  font-weight: 700;
  color: #c2410c;
  white-space: nowrap;
}
.va-issue-text {
  font-size: .73rem;
  color: #7c2d12;
  line-height: 1.4;
}

/* 해결책 */
.va-solutions-wrap {
  margin-top: .3rem;
}
.va-solutions-toggle {
  font-size: .71rem;
  color: #7c3aed;
  cursor: pointer;
  font-weight: 600;
}
.va-solutions-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: .35rem;
}
.va-solution-item {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
}
.va-sol-priority {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  background: #7c3aed;
  color: #fff;
  border-radius: 50%;
  font-size: .6rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .05rem;
}
.va-sol-title {
  font-size: .73rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .1rem;
}
.va-sol-action {
  font-size: .71rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.va-sol-formula {
  display: inline-block;
  margin-left: .35rem;
  font-size: .65rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ff6b35, #f7c59f);
  color: #fff;
  padding: .1rem .35rem;
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: .01em;
}
.va-screenshot-wrap {
  margin-top: .3rem;
}
