:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e4e7ec;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #047857;
  --header-bg: #1e293b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ---------- 헤더 / 내비 ---------- */
.site-header {
  background: var(--header-bg);
  color: #e2e8f0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 56px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.site-header .brand {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  white-space: nowrap;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
}
.site-header nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 14px;
  white-space: nowrap;
}
.site-header nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-header nav a.active { background: var(--accent); color: #fff; }
.site-header .user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  white-space: nowrap;
}
.site-header .user form { margin: 0; }
.site-header .nav-db {
  color: #cbd5e1;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 14px;
  white-space: nowrap;
}
.site-header .nav-db:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-header .nav-db.active { background: var(--accent); color: #fff; }
.nav-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 24px;
  background: rgba(0,0,0,.04);
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.nav-subtabs a {
  color: #475569;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.nav-subtabs a:hover { background: rgba(0,0,0,.06); }
.nav-subtabs a.active { background: var(--accent); color: #fff; }

/* ---------- 레이아웃 ---------- */
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}
h1 { font-size: 22px; margin: 4px 0 20px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; color: var(--muted); margin: 18px 0 8px; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
p { margin: 8px 0; }

/* section을 카드로 */
section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ---------- 표 ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
  margin: 8px 0;
}
th, td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
thead th, table tr:first-child th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
}
tbody tr:nth-child(even), table tr:nth-child(even) { background: #fbfcfd; }

/* ---------- 폼 ---------- */
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
input, textarea, select {
  font: inherit;
  color: var(--text);
  width: 100%;
  max-width: 640px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
/* 제목은 입력칸 위에 둔다 — 컨테이너 폭에 따라 좌우로 갈라지지 않게(체크박스·라디오는 그대로). */
label > input:not([type="checkbox"]):not([type="radio"]), label > select, label > textarea {
  display: block; margin-top: 4px;
}
/* 코드가 제목으로 옮기는 포커스(tabindex=-1)에는 포커스 링을 그리지 않는다. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 90px; resize: vertical; }
form p { margin: 12px 0; }

/* 긴 프롬프트 편집기: 넓고 높게, 모노스페이스, 세로 줄바꿈(가로 스크롤 없음) */
.prompt-editor {
  max-width: none;
  width: 100%;
  min-height: 58vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
}
.prompt-editor.tall { min-height: 86vh; }

/* ---------- 버튼 ---------- */
button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
button:hover, .button:hover { background: var(--accent-hover); color: #fff; }
button.secondary, .button.secondary {
  background: #fff;
  color: var(--text);
  border-color: #cbd5e1;
}
button.secondary:hover, .button.secondary:hover { background: #f8fafc; }
/* 작업을 잃거나 목록에서 내리는 행동(폐기·삭제·전체 되돌리기). 색만으로 구분하지 않게 라벨에 행동을 쓴다. */
button.danger, .button.danger {
  background: #fff;
  color: #b42318;
  border-color: #f0a29a;
}
button.danger:hover, .button.danger:hover { background: #fef3f2; color: #912018; }

/* ---------- 유틸 ---------- */
.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
}
/* 리커넥트 명칭 검출 경고(app/generation/name_leak.py) — 검수자에게 보이기만 하고
   자동으로 고치지 않는다. .error(위반)와 구분되는 주의 색으로 둔다. */
.warn {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
}
/* 저장 결과 안내(팩트훅 저작 등). .warn과 색을 가른다 — 성공을 주의 색으로 내면
   사용자가 저장이 반쯤 실패한 것으로 읽는다. */
.ok {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
}
.muted { color: var(--muted); }
pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}

/* 검수 상세의 본문성 pre(전후 비교·입력 스냅샷). 위 전역 다크 테마를 상속하면
   화면이 검게 보이고, 밝은 배경의 +/- 하이라이트 위에 밝은 글자색이 얹혀 판독이
   불가능해진다. 반드시 전역 pre 규칙보다 뒤에 와야 캐스케이드에서 이긴다. */
.snapshot-pre,
.diff-pre {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  max-height: 420px;
  overflow-y: auto;
}
.diff-pre .ins { background: #e6ffed; color: #044317; }
.diff-pre .del { background: #ffeef0; color: #6b0a17; }
ul { padding-left: 20px; }

/* 인라인 border 속성(table border="1") 잔재 정리 */
table[border] { border: 1px solid var(--border); }

/* ---------- 로그인 화면 ---------- */
body.auth {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef2ff 0%, #f5f6f8 60%);
}
body.auth main { padding: 0; width: 100%; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16,24,40,.10);
  padding: 32px 30px;
  max-width: 380px;
  margin: 0 auto;
}
.auth-card h1 { text-align: center; font-size: 20px; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card input { max-width: none; }
.auth-card button { width: 100%; margin-top: 8px; padding: 10px; }

/* ---------- 골드셋 예시 카드 ---------- */
.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.example-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.example-card .head-fields { display: flex; gap: 18px; flex-wrap: wrap; }
label.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px 0 0;
  font-weight: 600;
}
label.inline select, label.inline input { width: auto; }
.example-card > label { margin-top: 10px; }
.example-card textarea,
.example-card > input { max-width: none; width: 100%; }
/* 카드 본문은 항상 세로 줄바꿈(가로 스크롤 금지) */
.example-card textarea {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}
.example-card .struct { margin: 12px 0; }
.example-card .struct-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--muted);
}
.example-card .struct-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.example-card .struct-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.example-card .struct-row input { max-width: none; font-weight: 400; color: var(--text); }
@media (max-width: 640px) {
  .example-card .struct-row { grid-template-columns: 1fr; }
}

/* ---------- 승인 pool(골드셋 편집)·정석화 원천 — 세로 리스트 + 스크롤(C1) ---------- */
.pool-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.pool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: var(--shadow);
}
.pool-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  flex: 0 0 auto;
}
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.pool-summary { font-size: 14px; margin: 0; color: var(--text); flex: 1 1 auto; }
.pool-card-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ---------- 모달(경량, 라이브러리 없음) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 50;
  overflow-y: auto;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(16,24,40,.25);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-head h2 { margin: 0; }
/* 모달 본문(pre)은 가로 스크롤 말고 세로 줄바꿈 */
.modal pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

/* ---------- 화법 채팅 ---------- */
body.chat main { max-width: 1280px; }

.chat-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.chat-topbar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.chat-topbar button { margin-left: auto; }

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  /* row를 minmax(0,1fr)로 고정해야 콘텐츠가 길어도 row가 커지지 않고(=definite height),
     chat-log가 flex:1+min-height:0으로 자체 스크롤한다. auto row면 컨테이너 height 무시됨. */
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  height: max(420px, calc(100vh - 230px));
}
.chat-prompt,
.chat-main,
.chat-sessions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.chat-prompt { display: flex; flex-direction: column; }
.chat-prompt-help { font-size: 12px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.chat-prompt-actions { display: flex; gap: 8px; align-self: flex-start; }
.chat-prompt label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.chat-prompt textarea {
  width: 100%;
  flex: 1;
  min-height: 260px;
  margin: 10px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

/* 채팅 본문: 로그(내부 스크롤) + 하단 고정 입력창 */
.chat-main { display: flex; flex-direction: column; }
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;  /* flex 자식이 콘텐츠보다 줄어들어 내부 스크롤이 생기게 한다 */
  overflow-y: auto;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.chat-msg {
  max-width: 82%;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.chat-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-user a { color: #fff; text-decoration: underline; }
.chat-assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-role {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 5px;
  padding: 1px 8px;
  border-radius: 999px;
}
.chat-user .chat-role { background: rgba(255,255,255,.22); color: #fff; }
.chat-assistant .chat-role { background: var(--accent-soft); color: var(--accent); }
.chat-plain { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-md { overflow-wrap: anywhere; }
.chat-md > :first-child { margin-top: 0; }
.chat-md > :last-child { margin-bottom: 0; }
.chat-md p { margin: 8px 0; }
.chat-md ul, .chat-md ol { margin: 8px 0; padding-left: 20px; }
.chat-md li { margin: 2px 0; }
.chat-md h1, .chat-md h2, .chat-md h3 { margin: 12px 0 6px; color: var(--text); }
.chat-md code { background: var(--bg); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.chat-md pre { background: var(--bg); padding: 10px; border-radius: 8px; overflow-x: auto; }
.chat-md pre code { background: none; padding: 0; }
.chat-usage { margin-top: 6px; color: var(--muted); }

/* 입력창 */
.chat-composer { display: flex; gap: 10px; align-items: flex-end; }
.chat-composer textarea { flex: 1; resize: vertical; }
.chat-empty { color: var(--muted); }

.chat-sessions { margin-top: 16px; }
.chat-sessions ul { margin: 0; padding-left: 18px; }

@media (max-width: 860px) {
  /* 세로 1단에서는 높이 고정을 풀고, 로그만 자체 스크롤한다. */
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-log { max-height: 60vh; }
}

/* ---------- 푸터 ---------- */
.site-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 검수 목록: 필터 바 + 칩 ---------- */
/* 열 헤더 팝오버는 이벤트 61개·담보군 11개가 한 목록에 쌓여 드롭다운이 감당이 안 됐다.
   필터는 표 위 필터 바에서 고르고(팝오버에 먼저 뜨는 건 값이 아니라 필드 목록),
   지금 걸린 필터는 칩으로 한눈에 보인다. 신규 JS 없이 <details> + htmx로만 동작한다. */
.filter-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.filter-add { position: relative; flex: none; }
.filter-add > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  white-space: nowrap;
}
.filter-add > summary::-webkit-details-marker { display: none; }
.filter-add[open] > summary { border-style: solid; border-color: var(--accent); }

.filter-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 8px;
}

/* 팝오버 머리: 닫는 방법을 눈에 보이게 둔다(바깥 클릭·Esc로도 닫힌다). */
.filter-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 4px 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.filter-close {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.6;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
}
.filter-close:hover { background: var(--accent-soft); }

/* 필드 목록: 값이 아니라 필드라 길이가 스키마 필드 수(현재 11)로 고정된다. */
.filter-fields { list-style: none; margin: 0; padding: 0; }
.filter-fields a, .filter-value {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.filter-fields a:hover, .filter-value:hover { background: var(--accent-soft); }
.filter-count {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
}
.filter-many { margin-left: auto; font-size: 11px; }

/* 값 목록: 61개짜리도 검색으로 좁히고, 남은 것은 이 안에서만 스크롤한다.
   공용 reset과 합치면 회귀 가드가 엉뚱한 규칙을 읽으므로 단독 규칙으로 둔다. */
.filter-values {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}
.filter-value.is-on { font-weight: 600; color: var(--accent); }
.filter-box { flex: none; }

.filter-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.filter-panel-back { font-size: 12px; }
.filter-search { width: 100%; margin: 0 0 6px; padding: 5px 8px; font-size: 13px; }
.filter-empty, .filter-hint { margin: 6px 4px; font-size: 12px; }
.filter-date { display: block; font-size: 13px; margin: 4px 0; }
.filter-date-form button { margin-top: 4px; }
/* 화법 번호 입력(선택지를 열거할 수 없는 축). 검색 입력과 같은 폭·크기로 맞춘다. */
.filter-number { width: 100%; margin: 0 0 2px; padding: 5px 8px; font-size: 13px; }
.filter-number-form button { margin-top: 4px; }

/* 적용된 필터 칩 */
.filter-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: var(--accent-soft);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 2px 6px 2px 11px;
  font-size: 13px;
  line-height: 1.6;
}
.filter-chip b { color: var(--accent); font-weight: 600; }
.filter-chip-x {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 0 4px;
  border-radius: 999px;
}
.filter-chip-x:hover { background: #c7d2fe; color: var(--text); }
.filter-clear { font-size: 12px; margin-left: 4px; }

/* 열 헤더는 정렬 전용 */
.review-table { width: 100%; }
.sort-link { text-decoration: none; color: inherit; white-space: nowrap; }
.sort-link:hover { color: var(--accent); }
.sort-link.is-active { color: var(--accent); font-weight: 700; }

/* 목록 위 상태 요약 한 줄. 좁은 화면에서 줄바꿈되도록 wrap을 준다. */
.review-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.review-summary a {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  color: inherit;
}
.review-summary a:hover { background: var(--accent-soft); }
.review-summary a.is-active { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.review-summary b { font-variant-numeric: tabular-nums; }

.review-pager { display: flex; gap: 12px; align-items: center; margin: 10px 0; }
.review-scope {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 8px 0;
}

/* ---------- 터치팁 목록(조회 전용) ---------- */
/* 편집 폼(/goldset)은 전체 교체라 필터를 붙일 수 없어 조회를 분리했다.
   커버리지 요약은 0건 이벤트를 흐리게 보여준다 — 재료 공백이 보이는 것이 목적이다. */
.coverage-summary { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }

.chip {
  display: inline-block;
  border: 1px solid #e0e7ff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: #eef2ff;
  white-space: nowrap;
}
/* 0건 = 재료 미도착. 눌러 죽여서 채워진 것과 한눈에 구분되게 한다. */
.chip-empty { color: var(--muted); background: var(--surface); border-color: #e5e7eb; }

.touch-list { list-style: none; padding: 0; margin: 0; }
.touch-list > li {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface);
}
.touch-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.touch-body { margin: 0; white-space: pre-wrap; }

/* ── 콘텐츠 자산 통합 조회(/content) ─────────────────────────────────────────
   분류 색이 이 화면의 전부다. 운영자는 색으로 「어디에 있고 어디에 없는가」를 먼저 본다.
   ⚠ `both`만 무채색이다 — 정상인 것이 눈에 띄면 이상한 것이 묻힌다. */
.chip-on { outline: 2px solid var(--accent); outline-offset: 1px; }

.chip-both { color: var(--muted); background: var(--surface); border-color: #e5e7eb; }
.chip-file_only { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.chip-const_only { color: #9f1239; background: #ffe4e6; border-color: #fecdd3; }
.chip-db_only { color: #3730a3; background: #e0e7ff; border-color: #c7d2fe; }
.chip-reference { color: var(--muted); background: transparent; border-color: #e5e7eb; }

.content-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.content-table th,
.content-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.content-table th { background: var(--surface); font-weight: 600; white-space: nowrap; }
.content-table code { font-size: 12px; word-break: break-all; }
.content-table .src { color: var(--muted); font-size: 12px; max-width: 260px; word-break: break-all; }
.content-table details summary { cursor: pointer; white-space: nowrap; }
.content-table pre { margin: 6px 0; font-size: 12px; }

/* 정상 행은 배경을 주지 않는다 — 위 주석과 같은 이유. */
.content-table tr.cls-file_only { background: #fffbeb; }
.content-table tr.cls-const_only { background: #fff1f2; }
.content-table tr.cls-db_only { background: #eef2ff; }

.pager { display: flex; gap: 14px; margin: 14px 0; }

.workflow-status { padding: 1rem; margin-bottom: 1.5rem; border: 1px solid #b8c8da; border-radius: 10px; background: #f4f8fc; }
.workflow-status dl { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: .8rem; }
.workflow-status dt { font-weight: bold; }
.workflow-status dd { margin: .3rem 0 0; overflow-wrap: anywhere; }
.nav-subtabs { flex-wrap: wrap; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.release-table { width: 100%; }
.release-table td { overflow-wrap: anywhere; vertical-align: top; }
.release-table form { display: grid; gap: .4rem; }
@media(max-width:700px) { .release-table, .release-table tbody, .release-table tr, .release-table td { display:block; } .release-table th { display:none; } .release-table tr { padding:.8rem; border-bottom:1px solid #bbb; } }

.selected-release { background:#eff6ff; outline:2px solid #2563eb; }

.workflow-progress { display:flex; flex-wrap:wrap; gap:.7rem; padding:0; list-style:none; }
.workflow-progress li { padding:.45rem .75rem; border-radius:1rem; background:#e5e9ef; }
.workflow-progress li.complete { background:#d7efdf; }
.workflow-progress li.current { background:#4338ca; color:white; font-weight:bold; }
.workflow-action { display:inline-block; padding:.7rem 1.1rem; background:#4338ca; color:white; border-radius:.4rem; text-decoration:none; }
.workflow-action[hidden] { display: none; }
.workflow-status #workflow-view { display: none; }
.workflow-action:focus-visible { outline:3px solid #e59b21; outline-offset:3px; }
.workflow-status pre { white-space:pre-wrap; overflow-wrap:anywhere; }

.application-counts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; }
.application-confirm pre { white-space:pre-wrap; overflow-wrap:anywhere; }
