/* DEV-0425-KAREN-V2 (Vinci): 데스크탑 master-detail + 모바일 stack */
/* 디자인 토큰: dashboard-v2/static/style.css 의 --bg / --border / --text / --text-muted / #C9A84C 재사용 */

.kv2-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  /* OPS-0427-002: 바텀 컴포저 제거 — padding-bottom 불필요 */
}

/* ── Top bar ───────────────────────────────────────────── */
.kv2-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.kv2-page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}
/* OPS-0427-002: topbar 우측 액션 영역 (새 요청 버튼 + lang) */
.kv2-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.kv2-new-btn {
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
}
.kv2-lang {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  font-size: 0.78rem;
}
.kv2-lang-btn {
  padding: 6px 12px;
  text-decoration: none;
  color: var(--text);
  min-width: 40px;
  text-align: center;
}
.kv2-lang-btn.is-active {
  background: #C9A84C;
  color: #fff;
  font-weight: 600;
}

/* ── Tabs ──────────────────────────────────────────────── */
.kv2-filters {
  display: flex;
  gap: 6px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.kv2-filter {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: all 0.12s;
  min-height: 44px; /* WCAG AA 터치타겟 */
}
.kv2-filter:hover { color: var(--text); background: rgba(201,168,76,0.08); }
.kv2-filter.is-active {
  color: var(--text);
  background: rgba(201,168,76,0.14);
  border-color: rgba(201,168,76,0.4);
  font-weight: 600;
}

/* ── Layout: 3-column 데스크탑 (≥1024) / stack 모바일 ────
   OPS-0426-KAREN-WS-C-IMPL M6: master 360px 고정 + detail flex.
   Phase B §2 wireframe 정합 (sidebar는 base.html이 담당). */
.kv2-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  flex: 1;
  align-items: stretch; /* stretch: detail 패널이 master 높이까지 늘어남 */
}
.kv2-master {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg);
  /* OPS-0427-002: 240px → 160px — topbar(46px)+filters(54px)+padding(36px) = 136px
     기존 240px 할인은 80px 낭비. 화면 공간 최대 활용. */
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.kv2-detail {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg);
  min-height: 60vh;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
/* detail 내부 컨테이너: 패널 전체 높이 채우기 */
.kv2-detail-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
}
.kv2-pane { padding: 0; min-height: 200px; }

/* 1024-1279: master 320px 축소 (Phase B §2 변형) */
@media (max-width: 1279px) and (min-width: 1024px) {
  .kv2-layout { grid-template-columns: 320px 1fr; }
}

/* <1024: stack — thread 선택 시 master 숨김 */
@media (max-width: 1023px) {
  .kv2-layout { grid-template-columns: 1fr; }
  .kv2-master, .kv2-detail { max-height: none; }
  body.kv2-thread-active .kv2-master { display: none; }
  body:not(.kv2-thread-active) .kv2-detail { display: none; }
}

/* ── Empty / placeholder ───────────────────────────────── */
.kv2-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.kv2-detail-placeholder {
  padding: 80px 24px;
  text-align: center;
  color: var(--text-muted);
}
.kv2-detail-placeholder-icon { font-size: 2.4rem; }
.kv2-detail-placeholder-text { font-size: 0.95rem; line-height: 1.6; margin-top: 12px; }

/* ── List rows (Inbox) ─────────────────────────────────── */
.kv2-list { display: flex; flex-direction: column; }
.kv2-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  align-items: start;
  cursor: pointer;
}
.kv2-row:hover { background: rgba(201,168,76,0.06); }
.kv2-row-deliverable { background: rgba(31,90,58,0.06); }
.kv2-row-deliverable:hover { background: rgba(31,90,58,0.12); }
.kv2-row-icon { font-size: 1.2rem; line-height: 1; padding-top: 2px; }
.kv2-row-body { min-width: 0; }
.kv2-row-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kv2-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.kv2-row-preview { color: var(--text-muted); }
.kv2-row-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
  padding-top: 4px;
}

/* ── Cards (Requests) ──────────────────────────────────── */
.kv2-card {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}
.kv2-card:hover { background: rgba(201,168,76,0.06); }
.kv2-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.kv2-card-title {
  font-size: 0.94rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kv2-card-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── Status pills (5-state + 보조 2) — M6 ──────────────── */
.kv2-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.kv2-pill-received  { background: #e7e1d2; color: #4a3f24; }
.kv2-pill-routing   { background: #dbe6f0; color: #1f4a7a; }   /* Phase B §7 신규 */
.kv2-pill-analyzing { background: #C9A84C; color: #1E1B16; }   /* 기존 working 자리 */
.kv2-pill-working   { background: #C9A84C; color: #1E1B16; }   /* legacy 호환 */
.kv2-pill-review    { background: #d6e8e1; color: #1f5a3a; }
.kv2-pill-done      { background: #1f5a3a; color: #fff; }
.kv2-pill-blocked   { background: #7a1f1f; color: #fff; }
.kv2-pill-cancelled { background: #cccccc; color: #555; }

/* ── Steps (4-dot progress) ────────────────────────────── */
.kv2-steps {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.kv2-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.kv2-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
}
.kv2-step.kv2-step-on .kv2-step-dot { background: #C9A84C; }
.kv2-step-label {
  font-size: 0.66rem;
  color: var(--text-muted);
}
.kv2-step.kv2-step-on .kv2-step-label { color: var(--text); font-weight: 500; }
.kv2-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 2px;
  margin-bottom: 16px;
  min-width: 16px;
}
.kv2-step-line.kv2-step-on { background: #C9A84C; }
.kv2-steps-thread { padding: 12px 16px; border-bottom: 1px solid var(--border); }

/* ── Files list ────────────────────────────────────────── */
.kv2-files { display: flex; flex-direction: column; }
.kv2-file {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.kv2-file:hover { background: rgba(201,168,76,0.06); }
.kv2-file-icon { font-size: 1.3rem; }
.kv2-file-body { min-width: 0; }
.kv2-file-name {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kv2-file-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.kv2-file-meta a { color: var(--accent, #C9A84C); text-decoration: none; }
.kv2-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
}
.kv2-file-btn:hover { background: rgba(201,168,76,0.12); }
.kv2-file-btn-primary {
  background: #C9A84C;
  color: #1E1B16;
}
.kv2-file-btn-primary:hover { background: #b8973f; color: #1E1B16; }

/* ── Thread (detail) ──────────────────────────────────── */
.kv2-thread {
  display: flex;
  flex-direction: column;
  flex: 1;        /* detail-inner 의 flex 공간을 전부 차지 */
  min-height: 0;  /* flex 자식이 overflow 없이 축소 가능하도록 */
}
.kv2-thread-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* row1: 제목 + primary action */
.kv2-thread-row1 {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.kv2-thread-title {
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* row2: pill + 메타 + overflow */
.kv2-thread-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.kv2-thread-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
/* ··· overflow menu */
.kv2-overflow-menu {
  position: relative;
  flex-shrink: 0;
}
.kv2-overflow-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 4px 10px;
  font-size: 1rem;
  letter-spacing: 2px;
  line-height: 1;
}
.kv2-overflow-menu > summary::-webkit-details-marker { display: none; }
.kv2-overflow-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}
.kv2-overflow-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
  transition: background 0.1s;
}
.kv2-overflow-item:last-child { border-bottom: none; }
.kv2-overflow-item:hover { background: rgba(201,168,76,0.08); }
.kv2-overflow-item-danger { color: #b03a48; }
.kv2-overflow-item-danger:hover { background: rgba(176,58,72,0.08); }
.kv2-thread-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.kv2-section-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.kv2-desc {
  font-family: inherit;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  background: rgba(0,0,0,0.02);
  padding: 12px;
  border-radius: 6px;
  /* OPS-0427-002: 160px → 320px — detail 패널이 자체 스크롤하므로 내부 제한 완화 */
  max-height: 320px;
  overflow-y: auto;
}

/* deliverable — green border (Linear/HoneyBook 패턴) */
.kv2-file-deliverable {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid #1f5a3a;
  border-radius: 8px;
  background: rgba(31,90,58,0.05);
  margin-bottom: 8px;
}
.kv2-file-deliverable .kv2-file-name { font-weight: 600; }

/* activity log */
.kv2-activity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 8px 0;
}
.kv2-activity-icon { font-size: 1.05rem; line-height: 1.4; }
.kv2-activity-text { font-size: 0.86rem; line-height: 1.5; color: var(--text); }
.kv2-activity-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ── Reply form (in thread) ───────────────────────────── */
.kv2-reply-form { display: flex; flex-direction: column; gap: 8px; }
.kv2-reply-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.5;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 70px;
}
.kv2-reply-form button { align-self: flex-end; }

/* ── Buttons ───────────────────────────────────────────── */
.kv2-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px; /* WCAG AA 터치타겟 — OPS-0426-KAREN-WS-D-REVIEW */
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kv2-btn:hover { background: rgba(201,168,76,0.12); }
.kv2-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.kv2-btn-primary {
  background: #C9A84C;
  color: #1E1B16;
  border-color: #C9A84C;
  font-weight: 600;
}
.kv2-btn-primary:hover { background: #b8973f; }
.kv2-btn-success {
  background: #1f5a3a;
  color: #fff;
  border-color: #1f5a3a;
  font-weight: 600;
}
.kv2-btn-success:hover { background: #164a2d; }

/* ── Composer (bottom-fixed on mobile, inline on desktop) ─ */
.kv2-composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
@media (min-width: 769px) {
  /* 769px: rail(sidebar) 출현 기준과 정합 (style.css @media max-width:768px) */
  .kv2-composer {
    left: var(--sidebar-w, 240px); /* sidebar 폭 CSS var → fallback 240px */
  }
}
.kv2-composer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: end;
}
.kv2-composer-attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
}
.kv2-composer-attach:hover { background: rgba(201,168,76,0.12); }
.kv2-composer-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.kv2-composer textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 40px;
  max-height: 240px;
}
.kv2-composer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  flex-wrap: wrap;
}
.kv2-composer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.kv2-composer-chips:empty { display: none; }
.kv2-composer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.74rem;
  color: var(--text);
  max-width: 280px;
}
.kv2-composer-chip[hidden] { display: none !important; }
.kv2-composer-chip .kv2-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.kv2-composer-chip .kv2-chip-size {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
}
.kv2-composer-chip .kv2-chip-x,
.kv2-composer-chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 2px;
}
.kv2-composer-chip .kv2-chip-x:hover { color: #C9A84C; }
.kv2-composer-hint { flex: 1; }
.kv2-composer-count { font-variant-numeric: tabular-nums; }

/* ============================================================
 * OPS-0426-KAREN-WS-C-IMPL M6 — 신규 컴포넌트
 * Phase B §6.1 (.kv2-stepper-v), §6.2 (.kv2-files-section),
 *           §6.3 (.kv2-skeleton-row), §6.4 (.kv2-back-btn)
 * ============================================================ */

/* ── Skeleton (Loading 텍스트 대체) — Phase B §6.3 ─────── */
.kv2-skeleton-list {
  display: flex; flex-direction: column;
  gap: 6px; padding: 10px;
}
.kv2-skeleton-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 6px;
  border-bottom: 1px dashed transparent;
}
.kv2-skel-icon, .kv2-skel-line {
  background: linear-gradient(90deg, #e7e1d2 0%, #f4efe2 50%, #e7e1d2 100%);
  background-size: 200% 100%;
  animation: kv2-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
.kv2-skel-icon { width: 22px; height: 22px; }
.kv2-skel-line { height: 12px; }
.kv2-skel-line.w-20 { width: 20%; }
.kv2-skel-line.w-30 { width: 30%; }
.kv2-skel-line.w-60 { width: 60%; }
.kv2-skel-line.w-70 { width: 70%; }
.kv2-skel-line.w-80 { width: 80%; }
@keyframes kv2-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Vertical stepper (5단계) — Phase B §6.1 ───────────── */
/* thread body: 좌 220px stepper + 우 flex main
   OPS-0427-002: 280px → 220px 스텝퍼 축소, 콘텐츠 영역 60px 확보 */
.kv2-thread-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  align-items: stretch;
  flex: 1;       /* .kv2-thread flex 남은 공간 모두 차지 */
  min-height: 0;
}
/* LG workspace: 스텝퍼 없는 단일 컬럼 레이아웃 */
.kv2-thread-body--single {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  grid-template-columns: unset; /* 혹시 상속된 grid 속성 무력화 */
}
.kv2-thread-main {
  border-left: 1px solid var(--border);
  min-width: 0;
  flex: 1; /* grid 컨텍스트에서는 무시, flex 단일 컬럼 컨텍스트에서 남은 공간 채움 */
}
/* LG 단일 컬럼 컨텍스트: 좌측 border 불필요 */
.kv2-thread-body--single .kv2-thread-main {
  border-left: none;
}
.kv2-stepper-v {
  list-style: none;
  padding: 18px 0;
  margin: 0;
  position: relative;
  background: rgba(0,0,0,0.015);
}
.kv2-stepper-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 10px 16px;
  position: relative;
}
.kv2-stepper-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 36px;
  bottom: -10px;
  width: 2px;
  background: var(--border);
}
.kv2-stepper-step.is-done::after { background: #C9A84C; }
.kv2-stepper-step.is-active::after { background: linear-gradient(180deg, #C9A84C 0%, var(--border) 100%); }
.kv2-stepper-mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  flex-shrink: 0;
}
.kv2-stepper-step.is-done .kv2-stepper-mark {
  background: #C9A84C; color: #fff;
}
.kv2-stepper-step.is-active .kv2-stepper-mark {
  background: #3B82F6; color: #fff;
  animation: kv2-pulse 1.6s ease-in-out infinite;
}
.kv2-stepper-step.is-pending .kv2-stepper-mark {
  border: 2px solid var(--border); background: transparent;
  color: transparent;
}
.kv2-stepper-step.is-failed .kv2-stepper-mark {
  background: #C2553A; color: #fff;
}
@keyframes kv2-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}
.kv2-stepper-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  min-width: 0;  /* OPS-0427-002: 160px min-width 제거 → 스텝퍼 컬럼 220px 내 유연하게 */
  word-break: keep-all;
}
.kv2-stepper-step.is-pending .kv2-stepper-label { color: var(--text-muted); font-weight: 500; }
.kv2-stepper-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.kv2-stepper-pending { font-style: italic; opacity: 0.7; }

/* ── Files 3 섹션 — Phase B §6.2 ──────────────────────── */
.kv2-files-stack {
  display: flex; flex-direction: column;
  gap: 14px;
  padding: 12px;
}
.kv2-files-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}
.kv2-files-section[data-kind="deliverables"] {
  border: 2px solid #1f5a3a;
  background: rgba(31,90,58,0.04);
}
.kv2-files-section[data-kind="side"] {
  border-style: dashed;
}
.kv2-files-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
}
.kv2-files-section[data-kind="deliverables"] .kv2-files-head {
  background: rgba(31,90,58,0.08);
  border-bottom-color: rgba(31,90,58,0.3);
  color: #1f5a3a;
}
.kv2-files-title { flex: 1; min-width: 0; }
.kv2-files-count {
  background: var(--text-muted); color: #fff;
  padding: 1px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600;
  min-width: 22px; text-align: center;
}
.kv2-files-section[data-kind="deliverables"] .kv2-files-count {
  background: #1f5a3a;
}
.kv2-files-list {
  list-style: none; padding: 0; margin: 0;
  max-height: 320px;
  overflow-y: auto;
}
.kv2-files-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.kv2-file-version {
  background: var(--text-muted);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  margin-left: 6px;
}

/* ── Mobile back button — Phase B §6.4 ────────────────── */
.kv2-back-btn {
  display: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 8px;
  font-size: 0.86rem;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  gap: 8px;
  min-height: 44px; /* WCAG AA 터치타겟 */
}
.kv2-back-btn:hover { background: rgba(201,168,76,0.12); }
@media (max-width: 1023px) {
  .kv2-back-btn { display: inline-flex; }
  /* 모바일에서 thread body 컬럼 → 단일 컬럼 stack */
  .kv2-thread-body {
    grid-template-columns: 1fr;
  }
  .kv2-thread-main { border-left: none; border-top: 1px solid var(--border); }
  .kv2-stepper-v {
    padding: 12px 0;
  }
  .kv2-stepper-label { min-width: auto; }
}

/* ── WCAG AA 색대비 보정 ──────────────────────────────── */
/* analyzing 진행 중 step 텍스트 가독성 — Phase B §1 헌법 정합 */
.kv2-stepper-step.is-active .kv2-stepper-label { color: var(--text); }
.kv2-stepper-step.is-active .kv2-stepper-meta { color: var(--text); font-weight: 500; }

/* deliverable 보더 — 기존 정의 재사용 OK (이미 .kv2-file-deliverable 있음) */

/* ─────────────────────────────────────────────────────────
   OPS-0426-KAREN-WS-E M4: 피드백 버튼 (reject/rework/comment) + 모달
   M6 bundling: kv2-file-btn 44x44 (AA 터치타겟) + .kv2-file-deliverable 클래스 충돌 정리
   ───────────────────────────────────────────────────────── */

/* kv2-feedback-actions — 구 스타일, 참조용으로만 유지 (템플릿에서 미사용) */
.kv2-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.kv2-fb-inline { display: inline; }
.kv2-fb-inline button { vertical-align: middle; }

/* 신규 버튼 variant */
.kv2-btn-danger {
  background: #b03a48;
  color: #fff;
  border-color: #b03a48;
  font-weight: 600;
}
.kv2-btn-danger:hover { background: #8e2d39; color: #fff; }
.kv2-btn-warn {
  background: #C9A84C;
  color: #1E1B16;
  border-color: #C9A84C;
  font-weight: 600;
}
.kv2-btn-warn:hover { background: #b8973f; color: #1E1B16; }
.kv2-btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.kv2-btn-secondary:hover { background: rgba(201,168,76,0.12); }

/* M6 P1: 파일 버튼 44x44 — AA 터치타겟 (이전 36x36 미달 수정) */
.kv2-file-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  font-size: 1.05rem;
}

/* M5 P0: .kv2-file-deliverable 그리드 충돌 정리 — .kv2-files-section 컨텍스트로 통합 */
/* 기존 :345 .kv2-file-deliverable {display:grid; ...} 가 .kv2-file (이미 grid)와 grid 정의 중복으로
   border 2px 가 row 높이 +4px 어긋남 발생. files-section 안에서는 grid 정의 제거 + border만 유지 */
.kv2-files-section[data-kind="deliverables"] .kv2-file.kv2-file-deliverable {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  border: 2px solid #1f5a3a;
  border-radius: 8px;
  background: rgba(31,90,58,0.05);
  margin-bottom: 8px;
  padding: 12px 14px;
}
/* files-section 컨텍스트에서는 단일 정의만 작동 — :345 .kv2-file-deliverable 정의는 카드/list 외 영역 호환용으로 잔존 */

/* ── 피드백 모달 ──────────────────────────────────── */
.kv2-modal {
  position: fixed;
  inset: 0;
  background: rgba(30,27,22,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.kv2-modal[hidden] { display: none; }
.kv2-modal-card {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.kv2-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.kv2-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.kv2-modal-close {
  width: 44px;  /* WCAG AA 터치타겟 — OPS-0426-KAREN-WS-D-REVIEW */
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kv2-modal-close:hover { background: rgba(201,168,76,0.12); color: var(--text); }
.kv2-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 20px;
}
.kv2-modal-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 8px;
}
.kv2-modal-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}
.kv2-modal-body select,
.kv2-modal-body input[type="text"],
.kv2-modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
  min-height: 44px;  /* AA 터치타겟 */
}
.kv2-modal-body textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}
.kv2-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* 모바일 — row1 버튼 전폭, overflow 드롭다운 좌측 정렬 */
@media (max-width: 600px) {
  .kv2-thread-row1 { flex-wrap: wrap; }
  .kv2-thread-row1 .kv2-fb-inline { width: 100%; }
  .kv2-thread-row1 .kv2-fb-inline button { width: 100%; justify-content: center; }
  .kv2-overflow-dropdown { right: auto; left: 0; }
  .kv2-modal { padding: 8px; align-items: flex-end; }
  .kv2-modal-card { max-height: 92vh; border-radius: 12px 12px 0 0; }
}

/* ─────────────────────────────────────────────────────────
   OPS-0426-KAREN-THREAD-FILES (2026-04-26)
   대표님 요청:
   1. 산출물 → 위, 첨부 → 아래
   2. 첨부는 컴팩트 (등록만 하면 끝)
   3. 헤더에 최신 산출물 quick download 버튼
   4. 모든 파일에 시간 표기
   ───────────────────────────────────────────────────────── */

/* 헤더 — main 한 그리드, quick download 버튼 우측 */
.kv2-thread-head-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.kv2-head-deliv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 10px 6px 8px;
  border: 1px solid #1f5a3a33;
  background: rgba(31,90,58,0.08);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
  align-self: flex-start;
  max-width: 100%;
  transition: background 0.15s;
}
.kv2-head-deliv:hover {
  background: rgba(31,90,58,0.16);
  border-color: #1f5a3a66;
}
.kv2-head-deliv-icon { font-size: 1.05rem; flex-shrink: 0; }
.kv2-head-deliv-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.kv2-head-deliv-meta {
  color: var(--text-muted);
  font-size: 0.74rem;
  flex-shrink: 0;
}
.kv2-head-deliv-dl {
  margin-left: 4px;
  color: #1f5a3a;
  font-weight: 700;
  flex-shrink: 0;
}

/* deliverables — 강조 */
.kv2-files-deliv {
  border: 1px solid rgba(31,90,58,0.25);
  border-radius: 8px;
  background: rgba(31,90,58,0.04);
  overflow: hidden;
}
.kv2-files-deliv .kv2-files-head {
  background: rgba(31,90,58,0.10);
}
.kv2-file-latest {
  background: rgba(31,90,58,0.06);
}
.kv2-badge-latest {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  background: #1f5a3a;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 600;
  border-radius: 999px;
  vertical-align: middle;
}

/* file-meta 안의 시간 표기 */
.kv2-file-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.kv2-file-ts {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* inputs — 컴팩트, default-collapsed (details/summary) */
.kv2-files-inputs {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.kv2-files-head-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kv2-files-head-summary::-webkit-details-marker { display: none; }
.kv2-files-head-summary::before {
  content: "▶";
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.kv2-files-inputs[open] .kv2-files-head-summary::before { transform: rotate(90deg); }
.kv2-files-toggle-hint {
  margin-left: auto;
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 400;
}
.kv2-files-list-compact {
  padding: 0;
  margin: 0;
  list-style: none;
}
.kv2-file-compact {
  padding: 6px 12px !important;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border);
}
.kv2-file-compact:last-child { border-bottom: none; }
.kv2-file-compact .kv2-file-icon { font-size: 1rem; }
.kv2-file-compact .kv2-file-name { font-weight: 500; font-size: 0.82rem; }
.kv2-file-compact .kv2-file-meta { font-size: 0.68rem; }
.kv2-file-btn-sm {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.85rem !important;
}

/* 모바일 — header quick download 버튼 wrap */
@media (max-width: 600px) {
  .kv2-head-deliv-name { max-width: 160px; }
  .kv2-head-deliv-meta { font-size: 0.68rem; }
}

/* OPS-0426-KAREN-FB-V2: 피드백 모달 만족도 슬라이더 + 카테고리 체크박스 */
.kv2-fb-score-row {
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.kv2-fb-score-row .kv2-modal-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.kv2-fb-score-display {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--text, #2a2a2a);
}
.kv2-fb-score-stars {
  color: #C9A84C;  /* gold accent */
  letter-spacing: 1px;
  font-size: 1.05rem;
}
.kv2-fb-score-num {
  font-family: var(--mono, monospace);
  color: var(--muted, #6e6e6e);
  font-size: 0.85rem;
}
#kv2-fb-score {
  width: 100%;
  height: 6px;
  cursor: pointer;
  accent-color: #C9A84C;
}
.kv2-fb-score-marks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  font-size: 0.7rem;
  color: var(--muted, #888);
  text-align: center;
  margin-top: 0.1rem;
}
.kv2-fb-score-marks span:first-child { text-align: left; }
.kv2-fb-score-marks span:last-child  { text-align: right; }
.kv2-fb-score-marks small {
  display: inline-block;
  margin-top: 0.1rem;
  font-size: 0.65rem;
  color: var(--muted, #888);
}

.kv2-fb-cat-row {
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.kv2-fb-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 0.8rem;
}
@media (min-width: 480px) {
  .kv2-fb-cat-grid { grid-template-columns: repeat(4, 1fr); }
}
.kv2-fb-cat-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border, #e0d8c8);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  min-height: 44px;  /* WCAG AA touch target */
  transition: background-color 120ms, border-color 120ms;
}
.kv2-fb-cat-item:hover {
  background: rgba(201, 168, 76, 0.08);
}
.kv2-fb-cat-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #C9A84C;
  cursor: pointer;
}
.kv2-fb-cat-item:has(input:checked) {
  background: rgba(201, 168, 76, 0.15);
  border-color: #C9A84C;
}

/* OPS-0426-KAREN-FB-V2 INTENT: 액션별 모달 시각 차별화
 * data-action 속성으로 reject/rework/comment 분기 — 색·배너·강조 다 다름 */

/* 부제 (서브타이틀) */
.kv2-fb-subtitle {
  margin: 0.2rem 0 0 0;
  font-size: 0.85rem;
  color: var(--muted, #888);
  font-weight: 400;
}
.kv2-fb-head-text { flex: 1; }

/* 의도 안내 배너 — 액션별 색 (사용자가 "왜 이거 누르는지" 한눈에) */
.kv2-fb-intent {
  margin: 0 0 1rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border-left: 4px solid transparent;
  font-size: 0.88rem;
  line-height: 1.5;
  background: #f8f4e8;
  color: #5a5040;
  display: none;  /* 기본 숨김, data-action 셋팅 시 표시 */
}
.kv2-fb-intent[data-action="reject"] {
  display: block;
  background: #fcecec;
  border-left-color: #c94c4c;
  color: #6a2020;
}
.kv2-fb-intent[data-action="rework"] {
  display: block;
  background: #fcf4dd;
  border-left-color: #C9A84C;
  color: #5a4820;
}
.kv2-fb-intent[data-action="comment"] {
  display: block;
  background: #eef4f2;
  border-left-color: #6a8a82;
  color: #2e463e;
}

/* 카드 헤더 색 액션별 — 좌측 굵은 띠 */
.kv2-modal-card[data-action="reject"] {
  border-top: 5px solid #c94c4c;
}
.kv2-modal-card[data-action="rework"] {
  border-top: 5px solid #C9A84C;
}
.kv2-modal-card[data-action="comment"] {
  border-top: 5px solid #6a8a82;
}

/* 모달 헤더 layout — head-text + close 가로 배치 */
.kv2-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

/* ══════════════════════════════════════════════════════
   OPS-0426-KAREN-REDESIGN-FULL
   기획: 01_brief.md / 디자인: 02_design.md
   ══════════════════════════════════════════════════════ */

/* ── HTMX 로딩 인디케이터 ─────────────────────────── */
.kv2-master { position: relative; overflow: hidden; }
/* htmx-indicator: 마스터 상단 gold progress bar */
.kv2-htmx-bar {
  position: absolute;
  top: 0; left: -100%; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #C9A84C, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
  animation: kv2-bar-slide 1.2s ease-in-out infinite;
  animation-play-state: paused;
}
.kv2-master .htmx-request ~ .kv2-htmx-bar,
#kv2-master-list.htmx-request + .kv2-htmx-bar,
.kv2-htmx-bar.is-loading {
  opacity: 1;
  animation-play-state: running;
}
@keyframes kv2-bar-slide {
  0%   { left: -60%; right: 160%; }
  100% { left: 100%;  right: -60%; }
}
/* detail thread 로딩 — 우측 스피너 */
#karen-thread .htmx-indicator,
.kv2-thread-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: #C9A84C;
  border-radius: 50%;
  animation: kv2-spin 0.7s linear infinite;
  flex-shrink: 0;
}
#karen-thread.htmx-request .kv2-thread-spinner { display: inline-block; }
@keyframes kv2-spin {
  to { transform: rotate(360deg); }
}

/* ── 마스터 리스트 헤더 ────────────────────────────── */
.kv2-master-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.015);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kv2-master-count {
  background: var(--border);
  color: var(--text);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* ── Description 박스 border 추가 ─────────────────── */
.kv2-desc {
  border: 1px solid var(--border);
  font-family: inherit;
}

/* ── 스텝퍼 마크: 번호 기반 + 아이콘 ──────────────── */
/* 기존 mark content를 CSS counter로 교체 지원 */
.kv2-stepper-mark {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
}
.kv2-stepper-step.is-pending .kv2-stepper-mark {
  color: var(--text-muted);
  font-weight: 600;
}
/* done: 체크마크 표시 (내용은 template에서 ✓로 교체) */
.kv2-stepper-step.is-done .kv2-stepper-mark { font-size: 0.9rem; }
/* active: 번호 표시 (배경색으로 구분) */
.kv2-stepper-step.is-active .kv2-stepper-mark { font-size: 0.78rem; }
/* failed: X 표시 */
.kv2-stepper-step.is-failed .kv2-stepper-mark { font-size: 0.9rem; }

/* ── 마스터 리스트 빈 상태 개선 ───────────────────── */
.kv2-empty-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}
.kv2-empty-cta-icon { font-size: 2rem; opacity: 0.6; }
.kv2-empty-cta-text { font-size: 0.88rem; line-height: 1.5; }
.kv2-empty-cta-hint { font-size: 0.78rem; color: var(--text-muted); opacity: 0.8; }

/* ── 필터 pill 카운트 배지 ─────────────────────────── */
.kv2-filter-count {
  display: inline-block;
  background: var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0 5px;
  font-size: 0.66rem;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
  margin-left: 2px;
  line-height: 1.6;
}
.kv2-filter.is-active .kv2-filter-count {
  background: rgba(201,168,76,0.4);
  color: var(--text);
}

/* ── 스텝퍼 연결선 위치 보정 ──────────────────────── */
.kv2-stepper-step:not(:last-child)::after {
  left: 27px; /* mark 중앙 보정: 16+padding(10)+half(1) */
}

/* ── thread section 간격 마지막 border 제거 ──────── */
.kv2-thread-main .kv2-thread-section:last-child {
  border-bottom: none;
}

/* ══════════════════════════════════════════════════════
   OPS-0427-002: 새 요청 슬라이드 패널 스타일
   ══════════════════════════════════════════════════════ */

/* ── 슬라이드 패널 오버레이 ─────────────────────── */
.kv2-new-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}
.kv2-new-panel[hidden] { display: none !important; }

.kv2-new-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.kv2-new-panel-card {
  position: relative;
  width: 480px;
  max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0,0,0,0.18);
  animation: kv2-slide-in 0.22s ease;
}
@keyframes kv2-slide-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@media (max-width: 600px) {
  .kv2-new-panel { align-items: flex-end; }
  .kv2-new-panel-card {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
    animation: kv2-slide-up 0.22s ease;
  }
  @keyframes kv2-slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
}

/* ── 패널 헤더 ─────────────────────────────────── */
.kv2-new-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.kv2-new-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.kv2-new-panel-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.kv2-new-panel-close:hover { background: rgba(201,168,76,0.1); color: var(--text); }

/* ── 폼 필드 ─────────────────────────────────── */
.kv2-new-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px;
  flex: 1;
}
.kv2-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.kv2-form-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.kv2-form-hint {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-muted);
}
.kv2-required {
  color: #b03a48;
  font-size: 0.9em;
}
.kv2-form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.12s;
}
.kv2-form-input:focus {
  outline: none;
  border-color: #C9A84C;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}
.kv2-form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.12s;
}
.kv2-form-textarea:focus {
  outline: none;
  border-color: #C9A84C;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}
.kv2-form-char-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
}

/* ── 드롭존 ─────────────────────────────────── */
.kv2-form-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: border-color 0.12s, background 0.12s;
  position: relative;
}
.kv2-form-dropzone:hover,
.kv2-form-dropzone.kv2-dz-active {
  border-color: #C9A84C;
  background: rgba(201,168,76,0.06);
  color: var(--text);
}
.kv2-dropzone-icon { font-size: 1.6rem; }
.kv2-dropzone-text { font-size: 0.82rem; }

.kv2-new-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* ── 이어받기 행 ─────────────────────────────── */
.kv2-form-resume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 14px;
}
.kv2-resume-ref-label { color: var(--text-muted); }
.kv2-resume-ref-eid { font-weight: 600; color: var(--text); flex: 1; }
.kv2-resume-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 2px 4px;
}
.kv2-resume-clear:hover { color: #b03a48; }

/* ── 폼 액션 버튼 행 ─────────────────────────── */
.kv2-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════
   OPS-0427-002: 완료 이어받기 배너
   ══════════════════════════════════════════════════════ */
.kv2-resume-section {
  background: rgba(31,90,58,0.04);
}
.kv2-resume-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.kv2-resume-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}
.kv2-resume-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.kv2-resume-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.kv2-resume-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.kv2-resume-btn {
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   OPS-0427-002: 공간 활용 개선 — stepper 반응형 축소
   ══════════════════════════════════════════════════════ */
@media (max-width: 1280px) and (min-width: 1024px) {
  /* 1024~1280px: stepper 240px으로 축소해 main 영역 확보 */
  .kv2-thread-body { grid-template-columns: 200px 1fr; }
  .kv2-stepper-v { min-width: 0; }
  .kv2-stepper-label { font-size: 0.74rem; }
  .kv2-stepper-meta { font-size: 0.7rem; }
}

/* detail 패널 최대 높이 개선 — topbar/filter 공간 정확히 계산 */
.kv2-master,
.kv2-detail {
  max-height: calc(100vh - 180px); /* 개선: 240 → 180 (topbar60+filter50+gap16+page-pad14) */
}

/* ══════════════════════════════════════════════════════
   DEV-0430-WORKBENCH-UX: 워크벤치 신규 컴포넌트
   ══════════════════════════════════════════════════════ */

/* ── 패널 내 2-col 메타 행 ─────────────────────────── */
.kv2-form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .kv2-form-row-2col { grid-template-columns: 1fr; }
}

/* date input: 기존 kv2-form-input과 동일하나 min-height 보정 */
.kv2-form-input[type="date"] {
  min-height: 44px;
  cursor: pointer;
}

/* ── 코멘트 컴포넌트 ───────────────────────────────── */
.wb-comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.wb-comment-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
}

.wb-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(201,168,76,0.15);
  color: #C9A84C;
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(201,168,76,0.3);
}

.wb-avatar-self {
  background: rgba(31,90,58,0.12);
  color: #1f5a3a;
  border-color: rgba(31,90,58,0.3);
}

.wb-comment-body {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}

.wb-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.wb-comment-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.wb-comment-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

/* 입력 행 */
.wb-comment-input-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}

.wb-comment-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  transition: border-color 0.12s;
  box-sizing: border-box;
}

.wb-comment-textarea:focus {
  outline: none;
  border-color: #C9A84C;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}

.wb-comment-actions {
  display: flex;
  justify-content: flex-end;
}

.wb-comment-submit {
  min-height: 36px; /* 데스크탑 전용 — 모바일은 kv2-btn 44px 상속 */
}

@media (max-width: 600px) {
  .wb-comment-submit { width: 100%; justify-content: center; min-height: 44px; }
}

/* ── 워크벤치 stage 뱃지 — kv2-pill 기반 확장 ─────── */
.wb-stage {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* 1. requirements — 라벤더 (초기 수집, 중립) */
.wb-stage-requirements {
  background: #ede9f8;
  color: #4a3080;
  border: 1px solid #c5b8ef;
}

/* 2. planning — 연한 사파이어 (계획, 신뢰) */
.wb-stage-planning {
  background: #e0eaf8;
  color: #1a3d6e;
  border: 1px solid #a8c4e8;
}

/* 3. design — 앰버 gold wash (브랜드 포인트) */
.wb-stage-design {
  background: rgba(201,168,76,0.16);
  color: #6b4c00;
  border: 1px solid rgba(201,168,76,0.45);
}

/* 4. development — 딥 사파이어 (구현, 집중) */
.wb-stage-development {
  background: #dbe6f0;
  color: #1f4a7a;
  border: 1px solid #9bbad8;
}

/* 5. testing — 주황 (검증, 주의) */
.wb-stage-testing {
  background: #fdf0e0;
  color: #7a3d00;
  border: 1px solid #f0c080;
}

/* 6. done — 딥 그린 */
.wb-stage-done {
  background: #1f5a3a;
  color: #fff;
  border: 1px solid #1f5a3a;
}

/* ── 보기 토글 버튼 ─────────────────────────────────── */
.wb-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.wb-view-btn {
  border: none;
  border-radius: 0;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.84rem;
}

/* 모바일: 터치타겟 44px 확보 */
@media (max-width: 768px) {
  .wb-view-btn { min-height: 44px; }
}

.wb-view-btn + .wb-view-btn {
  border-left: 1px solid var(--border);
}

.wb-view-btn--active {
  background: rgba(201,168,76,0.14);
  color: var(--text);
  font-weight: 600;
}

/* ── 칸반 컨테이너 ─────────────────────────────────── */
.wb-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-top: 12px;
}

@media (max-width: 1280px) {
  .wb-kanban { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
  .wb-kanban { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}

.wb-kanban-col {
  background: rgba(0,0,0,0.015);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 200px;
}

.wb-kanban-col-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.wb-kanban-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wb-kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.84rem;
  cursor: pointer;
  transition: box-shadow 0.12s, border-color 0.12s;
  min-height: 44px; /* 터치타겟 */
}

.wb-kanban-card:hover {
  border-color: rgba(201,168,76,0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── execCommand 서식 버튼 활성 표시 ──────────────── */
.toolbar-btn:active,
.toolbar-btn[aria-pressed="true"] {
  background: rgba(201,168,76,0.2);
  color: var(--text);
  border-color: rgba(201,168,76,0.5);
}

/* 모바일 툴바 버튼 터치타겟 보강 */
@media (max-width: 768px) {
  .toolbar-btn { min-height: 44px; padding: 8px 10px; }
}

/* ── DEV-0431: 데스크탑 컴팩트 버튼 (내부 워크벤치 전용)
   WCAG AA 44px는 모바일 터치 기준 — 데스크탑 마우스 인터페이스는 32px 허용.
   .kv2-thread 범위로 한정해 다른 페이지 버튼 영향 없음. ─────── */
@media (min-width: 769px) {
  .kv2-thread .kv2-btn {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 0.82rem;
  }
  .kv2-thread .kv2-file-btn,
  .kv2-thread .kv2-file-btn-primary {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    font-size: 0.9rem;
  }
  .kv2-thread .wb-comment-submit {
    min-height: 30px;
    padding: 4px 14px;
  }
}

/* ── DEV-0431: 코멘트 전체폭 스트립 (.kv2-thread 직속 자식) ─── */
.kv2-thread-comment-strip {
  border-top: 1px solid var(--border);
  padding: 16px 20px 20px;
  background: var(--bg);
  flex-shrink: 0;
}
.kv2-thread-comment-strip .kv2-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #6B7280);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kv2-thread-comment-strip .wb-comment-input-row {
  margin-bottom: 8px;
}
.kv2-thread-comment-strip .wb-comment-form {
  margin-top: 12px;
}

/* ── DEV-0431: 파일 첨부 버튼 ──────────────────────────────── */
.wb-file-attach-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-muted, #6B7280);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: background 0.12s;
  flex-shrink: 0;
}
.wb-file-attach-label:hover {
  background: rgba(201,168,76,0.1);
  color: var(--text);
}
.wb-file-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14,165,160,0.08);
  border: 1px solid rgba(14,165,160,0.25);
  border-radius: 999px;
  padding: 2px 10px 2px 8px;
  font-size: 0.78rem;
  color: #0EA5A0;
  margin-top: 6px;
}
.wb-file-preview-chip[hidden] { display: none !important; }
.wb-file-preview-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 0.85rem;
  padding: 0;
  line-height: 1;
}
.wb-comment-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════
   DEV-0432: 검색바 + SLA 배지 + CSAT 모달
   ══════════════════════════════════════════════════════ */

/* ── 검색바 ─────────────────────────────────────────── */
.kv2-search-wrap { flex: 1; max-width: 220px; }
.kv2-search-input {
  width: 100%; padding: .35rem .7rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--input-bg, var(--bg));
  color: var(--text); font-size: .82rem;
  min-height: 36px;
}
.kv2-search-input:focus { outline: none; border-color: var(--accent, #4f8ef7); }

/* ── SLA 배지 ────────────────────────────────────────── */
.kv2-sla-badge { font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; white-space: nowrap; }
.sla-over { background: #dc354522; color: #dc3545; border: 1px solid #dc354555; }
.sla-warn { background: #fd7e1422; color: #fd7e14; border: 1px solid #fd7e1455; }

/* ── CSAT 모달 ───────────────────────────────────────── */
.kv2-csat-overlay { position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:9999;display:flex;align-items:center;justify-content:center; }
.kv2-csat-overlay[hidden] { display: none; }
.kv2-csat-box { background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:2rem;text-align:center;min-width:280px; }
.kv2-csat-title { font-size:1rem;font-weight:600;margin-bottom:.5rem; }
.kv2-csat-sub { font-size:.85rem;color:var(--text-muted);margin-bottom:1rem; }
.kv2-star { font-size:1.75rem;background:none;border:none;cursor:pointer;color:var(--border);transition:color .1s; }
.kv2-star.active { color:#f5c518; }

/* ── DEV-0432: LG 피드백 미니 버튼 ──────────────────────── */
.kv2-fb-mini-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.75rem; padding: 3px 9px; border-radius: 5px;
  border: 1px solid var(--border); background: none;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
  text-decoration: none; transition: color .1s, border-color .1s;
}
.kv2-fb-mini-btn:hover { color: var(--text); border-color: var(--text-muted); }
.kv2-fb-rework:hover { color: #fd7e14; border-color: #fd7e14; }
.kv2-fb-comment:hover { color: #4f8ef7; border-color: #4f8ef7; }

/* ── DEV-0432: textarea + 파일첨부 통합 ──────────────── */
.kv2-textarea-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
  background: var(--bg);
}
.kv2-textarea-wrap:focus-within,
.kv2-textarea-wrap.kv2-dz-active {
  border-color: #C9A84C;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}
.kv2-dropzone-ta {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  resize: vertical;
  background: transparent;
}
.kv2-dropzone-ta:focus { outline: none; box-shadow: none !important; border-color: transparent !important; }
.kv2-ta-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  background: var(--sidebar-bg, var(--bg));
}
.kv2-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: none;
  transition: color 0.1s, border-color 0.1s;
  position: relative;
}
.kv2-attach-btn:hover { color: #C9A84C; border-color: #C9A84C; }
.kv2-new-chips { padding: 6px 10px; gap: 5px; }

/* ── DEV-0433: 예상 작업 시간 섹션 ─────────────────────────────────────── */
.kv2-est-section { padding: 10px 0 8px; }
.kv2-est-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.kv2-est-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.kv2-est-hours {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold, #C9A84C);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kv2-est-bar-wrap {
  height: 5px;
  background: var(--border, #e5e1d8);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.kv2-est-bar {
  height: 100%;
  background: var(--gold, #C9A84C);
  border-radius: 3px;
  min-width: 4px;
  transition: width 0.4s ease;
}
.kv2-est-rationale {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}
