:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --border: #e5e8f0;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --accent: #2563eb;
  --accent-soft: #e8f0fe;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);

  --green: #16a34a;   --green-bg: #e7f6ec;
  --blue: #2563eb;    --blue-bg: #e8f0fe;
  --amber: #d97706;   --amber-bg: #fdf0db;
  --red: #dc2626;     --red-bg: #fbe9e9;
  --gray: #6b7280;    --gray-bg: #eef0f4;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ===================== Login ===================== */
.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2fb, #f5f7fb);
}
.login-card {
  width: min(360px, 100% - 32px); background: var(--panel); border-radius: 16px;
  padding: 32px; box-shadow: 0 12px 40px rgba(17, 24, 39, 0.12);
}
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card h1 { font-size: 18px; margin: 0; }
.login-card p { color: var(--muted); margin: 4px 0 22px; font-size: 13px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card .btn-primary { width: 100%; margin-top: 20px; padding: 11px; }
.login-error { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 16px; }
.login-hint { margin-top: 18px; font-size: 11px; color: var(--muted-2); text-align: center; }

.logo-badge {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, #1fb6b0, #2563eb);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

/* ===================== Header ===================== */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 12px 22px;
}
.header-top { display: flex; align-items: center; gap: 14px; }
.header-top .titles h1 { font-size: 16px; margin: 0; }
.header-top .titles span { font-size: 12px; color: var(--muted); }
.header-top .spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-top button, .header-top .user-chip { white-space: nowrap; flex: none; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 10px 5px 6px; font-size: 13px;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.btn-ghost {
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; color: var(--text);
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--bg); }
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.btn-primary:hover { background: #1d4ed8; }

/* 비활성 버튼: 명확한 회색 처리 + hover 효과 무력화 */
button:disabled { cursor: not-allowed; }
.btn-primary:disabled, .btn-primary:disabled:hover {
  background: var(--gray-bg); color: var(--muted); opacity: .7;
}
.btn-ghost:disabled, .btn-ghost:disabled:hover {
  background: transparent; color: var(--muted); opacity: .6;
}

/* KPIs */
.kpi-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.kpi {
  flex: 1; min-width: 120px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
}
.kpi .val { font-size: 22px; font-weight: 700; }
.kpi .lbl { font-size: 12px; color: var(--muted); }
.kpi.warn .val { color: var(--amber); }
.kpi.danger .val { color: var(--red); }

/* ===================== Layout ===================== */
.workspace {
  display: grid;
  grid-template-columns: 260px 1fr 380px;
  gap: 16px; padding: 16px 22px; align-items: start;
}
/* 그리드 아이템의 기본 min-width:auto 는 긴 내용(가로 스크롤 스트립·코드)이 열을 밀어내게 한다 */
.workspace > * { min-width: 0; }
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel-h { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.panel-b { padding: 14px 16px; }

/* Sidebar */
.side-section { margin-bottom: 18px; }
.side-section > .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); margin-bottom: 8px; }
.mod-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.mod-item:hover { background: var(--bg); }
.mod-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mod-item .count { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.filter-group { margin-bottom: 12px; }
.filter-group label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.filter-group select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; background: #fff;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Center toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar input.search {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
}
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-toggle button { background: #fff; border: none; padding: 7px 14px; font-size: 13px; color: var(--muted); }
.view-toggle button.active { background: var(--accent); color: #fff; }

/* Table */
table.feature-table { width: 100%; border-collapse: collapse; }
.feature-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted-2); padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.feature-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
.feature-table tr { cursor: pointer; }
.feature-table tbody tr:hover { background: var(--bg); }
.feature-table tr.selected { background: var(--accent-soft); }
.feat-title { font-weight: 600; }
.feat-sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }

/* Badges & pills */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.blue  { background: var(--blue-bg);  color: var(--blue); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red   { background: var(--red-bg);   color: var(--red); }
.badge.gray  { background: var(--gray-bg);  color: var(--gray); }
.pill { display: inline-block; min-width: 20px; text-align: center; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--gray-bg); color: var(--gray); }
.pill.has { background: var(--amber-bg); color: var(--amber); }

/* Board */
.board { display: flex; gap: 12px; padding: 14px 16px; overflow-x: auto; }
.lane { flex: none; width: 220px; background: var(--bg); border-radius: 10px; padding: 10px; }
.lane-h { font-size: 12px; font-weight: 700; margin-bottom: 8px; display: flex; justify-content: space-between; }
.lane-h .count { color: var(--muted-2); }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  padding: 10px; margin-bottom: 8px; cursor: pointer;
}
.card:hover { border-color: var(--accent); }
.card .t { font-weight: 600; font-size: 13px; }
.card .m { font-size: 11px; color: var(--muted); margin-top: 2px; }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* TBD queue */
.tbd-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.tbd-item:last-child { border-bottom: none; }
.tbd-q { font-size: 13px; }
.tbd-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Detail */
.detail-empty { color: var(--muted-2); text-align: center; padding: 60px 20px; font-size: 13px; }
.detail-h { padding: 16px; border-bottom: 1px solid var(--border); }
.detail-h .crumb { font-size: 11px; color: var(--muted); }
.detail-h h2 { font-size: 16px; margin: 4px 0 8px; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-section { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.detail-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); margin: 0 0 10px; }
/* Figma 출처 — 링크 라벨을 항목별 한 줄씩 (긴 URL 대신) */
.figma-links { margin: 0; padding-left: 16px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.figma-links li { list-style: disc; margin-bottom: 2px; }
.figma-links li::marker { color: var(--muted-2); }
.figma-links a { color: var(--accent); text-decoration: none; }
.figma-links a:hover { text-decoration: underline; }
.kv { display: flex; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.kv .k { width: 70px; color: var(--muted); flex: none; }
.kv .v { flex: 1; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.ac-list, .tbd-list { margin: 0; padding-left: 0; list-style: none; }
.ac-list li { display: flex; gap: 8px; font-size: 13px; margin-bottom: 7px; }
.ac-list li .id { font-family: ui-monospace, monospace; font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; height: fit-content; }
.assignee-row { display: flex; align-items: center; gap: 10px; }
.assignee-row select { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.source-links { display: flex; flex-direction: column; gap: 6px; }
.source-links a { font-size: 13px; color: var(--accent); text-decoration: none; }
.source-links a:hover { text-decoration: underline; }
.source-links a.disabled { color: var(--muted-2); pointer-events: none; }

/* Badge tooltip cue */
.badge[title] { cursor: help; }
/* 피쳐 목록 상태 칸 — 상태 뱃지 + (있을 때만) TBD 잔여 건수 */
.status-cell { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ===================== Modal (상태 안내) ===================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 39, 0.45);
}
.modal-card {
  width: 640px; max-width: calc(100vw - 40px); max-height: 86vh; overflow: auto;
  background: var(--panel); border-radius: 16px; box-shadow: 0 20px 60px rgba(17, 24, 39, 0.25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.modal-head h2 { margin: 0; font-size: 16px; }
/* 헤더 우측 액션 — auto 마진으로 닫기 버튼 옆에 붙인다(가운데 힌트와 벌어지지 않게) */
.head-dl { margin-left: auto; margin-right: 12px; padding: 4px 10px; font-size: 12px; }
.modal-close { background: transparent; border: none; font-size: 24px; line-height: 1; color: var(--muted); }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 22px; }
.legend-block { margin-bottom: 24px; }
.legend-block > h3 { font-size: 13px; margin: 0 0 4px; }
.legend-block > .desc { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.legend-h {
  font-size: 13px; font-weight: 700; color: var(--text); margin: 22px 0 6px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.legend-h:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.legend-table { width: 100%; border-collapse: collapse; }
.legend-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
.legend-table td:first-child { width: 96px; white-space: nowrap; }
.legend-table td .meaning { color: var(--text); }
.legend-note {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: 12px; color: var(--muted);
}
.legend-note b { color: var(--text); }

/* 역할별 사용법 탭 */
.role-tabs { display: flex; gap: 6px; margin-left: auto; margin-right: 12px; }
.role-tab {
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.role-tab:hover { color: var(--text); }
.role-tab.active { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
#roleguide-body .skill-steps { line-height: 2.0; }
#roleguide-body .skill-steps li { margin-bottom: 4px; }

.modal-card.modal-wide { width: 720px; }
.modal-card.modal-xwide { width: 1040px; }
#spec-modal-body { padding: 22px 26px; }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--panel);
}
.modal-foot .spacer { flex: 1; }
.editor-msg { font-size: 12px; color: var(--muted); }
.editor-msg.error { color: var(--red); }

.paste-help {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}

/* 업로드: 첨부 슬롯 ↔ 프리뷰 2단 (붙여넣기 편집창 폐기 — 파일 첨부만) */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.upload-grid > *, .prd-grid > * { min-width: 0; }
.upload-preview { position: sticky; top: 0; }
.upload-preview .lbl { margin-bottom: 6px; }
.preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.preview-head .lbl { margin-bottom: 0; }
.up-preview {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  max-height: 64vh; overflow: auto; background: var(--bg);
}
@media (max-width: 900px) { .upload-grid { grid-template-columns: 1fr; } }

/* 문서 탭 (업로드 프리뷰 · 버전 diff) */
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-tab {
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; color: var(--muted); white-space: nowrap;
}
.doc-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.doc-tab:disabled { opacity: .4; cursor: not-allowed; }

/* 첨부 슬롯 — spec.md / quality/spec-checklist.md 각각 한 칸 */
.up-slots { display: flex; flex-direction: column; gap: 8px; }
.up-slot {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.up-slot.empty { border-style: dashed; }
.up-slot.filled { background: var(--bg); }
.up-slot .slot-ico { font-size: 18px; line-height: 1; }
.up-slot .slot-main { flex: 1; min-width: 0; }
.slot-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.slot-hint { font-weight: 400; font-size: 11px; }
.slot-name { font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.slot-meta { font-size: 11.5px; margin-top: 2px; }
.up-doc-group + .up-doc-group { margin-top: 6px; }
.up-doc-label { font-size: 11px; opacity: .8; padding-top: 4px; }

/* 체크리스트 요약 (상세 패널 문서 섹션) */
.checklist-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

/* 문서 단계 */
.stage-row { display: flex; gap: 8px; }
.stage {
  flex: 1; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px;
  font-size: 12px; display: flex; flex-direction: column; gap: 4px;
}
.stage b { font-size: 13px; }
.stage.ok { border-color: var(--green); background: var(--green-bg); }
.stage.lock { opacity: 0.55; }
.stage button { align-self: flex-start; font-size: 11px; padding: 4px 10px; }

/* 태스크 체크리스트 */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { margin-bottom: 7px; font-size: 13px; }
.task-list label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.task-list input { margin-top: 3px; }

/* AC 추적성 */
.ac-chip {
  display: inline-block; font-family: ui-monospace, monospace; font-size: 10px;
  color: var(--accent); background: var(--accent-soft); border-radius: 5px;
  padding: 0 5px; margin-left: 3px; vertical-align: middle;
}
.task-coverage { font-size: 12px; margin: 0 0 10px; padding: 6px 10px; border-radius: 7px; }
.task-coverage.ok { color: #047857; background: #ecfdf5; }
.task-coverage.warn { color: #b45309; background: #fffbeb; }
.task-coverage .mono { color: inherit; }

/* 태스크 원문 접기 */
.task-detail { margin-top: 10px; }
.task-detail summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.task-detail .md { margin-top: 8px; padding-left: 4px; border-left: 2px solid var(--border); }

/* spec·PRD 마크다운 렌더 — 마크다운 프리뷰(GitHub·IDE)와 같은 그림이 목표다 */
.md { font-size: 13px; line-height: 1.7; word-break: break-word; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 18px 0 6px; line-height: 1.35; font-weight: 600; }
.md > :first-child { margin-top: 0; }
.md h1 { font-size: 19px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.md h2 { font-size: 16px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.md h3 { font-size: 14px; }
.md h4, .md h5, .md h6 { font-size: 13px; }
.md h5, .md h6 { color: var(--muted); }
.md ul, .md ol { padding-left: 22px; margin: 6px 0; }
.md li { margin: 2px 0; }
.md li > ul, .md li > ol { margin: 2px 0; }
.md li.task { list-style: none; margin-left: -18px; }
.md li.task input { margin-right: 6px; vertical-align: -1px; }
.md p { margin: 6px 0; }
.md code { background: var(--bg); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.md pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin: 8px 0; overflow-x: auto; }
.md pre code { background: none; padding: 0; font-size: 12px; line-height: 1.5; white-space: pre; }
.md blockquote {
  margin: 8px 0; padding: 2px 0 2px 12px;
  border-left: 3px solid var(--border); color: var(--muted);
}
.md blockquote > :first-child { margin-top: 0; }
.md blockquote > :last-child { margin-bottom: 0; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.md del { color: var(--muted); }
.md a { color: var(--accent); }
.md img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; margin: 6px 0; display: block; }
.md img.asset-loading { min-height: 60px; background: var(--border); opacity: .5; }
.asset-missing { border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; margin: 6px 0; }
.md table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.md th { background: var(--bg); font-weight: 600; white-space: nowrap; }

/* Editor form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-size: 12px; color: var(--muted); }
.form-row input, .form-row select, .form-row textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; width: 100%;
}
.form-row textarea { resize: vertical; min-height: 60px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--accent);
}
.editor-section { margin-top: 18px; }
.editor-section > .h {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted-2); margin-bottom: 8px;
}
.list-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.list-row input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.list-row .k { width: 70px; flex: none; }
.list-row .grow { flex: 1; }
/* Spec Item 편집 행: 항목당 입력이 많아 줄바꿈 허용 */
.list-row.item-row { flex-wrap: wrap; align-items: stretch; border: 1px solid var(--border); border-radius: 9px; padding: 8px; }
.list-row.item-row .item-id { width: 130px; flex: none; font-family: ui-monospace, monospace; }
.list-row.item-row .item-title { width: 110px; flex: none; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.list-row.item-row .item-status { flex: none; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.list-row.item-row .task-items { width: 100%; }
.list-row .task-items { width: 150px; flex: none; font-family: ui-monospace, monospace; font-size: 12px; }

/* Spec Item 상세 표시 */
.spec-item-list { margin: 0; padding-left: 0; list-style: none; }
.spec-item { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.spec-item:last-child { border-bottom: none; }
.spec-item-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.spec-item-h .mono { color: var(--accent); font-size: 11px; }
.spec-item-b { font-size: 12px; color: var(--muted); line-height: 1.5; }
.spec-item-b .when { color: var(--text); }
.spec-item-b .then { color: var(--text); }
.btn-add { background: var(--accent-soft); color: var(--accent); border: none; border-radius: 7px; padding: 5px 12px; font-size: 12px; font-weight: 600; }
.btn-del { background: transparent; border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; color: var(--muted); flex: none; }
.btn-del:hover { color: var(--red); border-color: var(--red); }

/* Detail action buttons */
.detail-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.detail-actions button, .detail-actions a { font-size: 12px; padding: 6px 12px; border-radius: 8px; text-decoration: none; }
.btn-ghost.danger { color: var(--red); border-color: var(--red); }

/* ===================== v2 components ===================== */

/* Login — GitHub mock 사용자 선택 */
.login-users { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.login-user {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--card, #fff); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; text-align: left;
}
.login-user:hover { border-color: var(--accent); background: var(--accent-soft); }
.login-user .lu-name { font-weight: 600; }
.login-user .lu-gh { margin-left: auto; font-size: 11px; color: var(--muted); }
.lu-role { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.lu-role.developer { background: var(--blue-bg); color: var(--blue); }
.lu-role.designer { background: var(--amber-bg); color: var(--amber); }
.lu-role.guest { background: var(--gray-bg); color: var(--muted); margin-left: auto; }
/* 게스트 진입(P10) — 팀원 버튼과 구분선으로 분리, 눌러도 "로그인" 처럼 보이지 않게 점선 */
.login-or { font-size: 11px; color: var(--muted); text-align: center; margin: 6px 0 0; }
.login-user.guest { border-style: dashed; }
.login-user.guest:hover { border-style: solid; }
.guest-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 12px; font-size: 12px;
  background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); border-radius: 8px;
}
.guest-banner .btn-link { margin-left: auto; color: inherit; text-decoration: underline; }
.prd-compose.guest-note { font-size: 12px; color: var(--muted); }

/* Pipeline stepper */
.stepper { display: flex; align-items: center; gap: 4px; margin: 14px 0 4px; flex-wrap: wrap; }
/* 라벨이 dot 보다 넓어도 패널 밖으로 밀리지 않게 — 마지막 스텝 라벨 잘림 방지 */
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 44px; flex-shrink: 0; }
.step .dot { width: 12px; height: 12px; border-radius: 999px; background: var(--gray-bg); border: 2px solid var(--border); }
.step .slabel { font-size: 10px; color: var(--muted); white-space: nowrap; }
.step.active .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step.active .slabel { color: var(--accent); font-weight: 700; }
.step.done .dot { background: var(--green); border-color: var(--green); }
/* 무검토 승인 — 거치지 않은 단계. done(초록)과 구분되게 점선 테두리 + 흐린 라벨 */
.step.skipped .dot { background: transparent; border-style: dashed; border-color: var(--muted); }
.step.skipped .slabel { color: var(--muted); text-decoration: line-through; }
.sline { flex: 1; height: 2px; background: var(--border); min-width: 10px; margin-top: -14px; }

/* 디자인/기능 스펙 탭 — 배타 축(모든 스펙이 정확히 하나) */
.kind-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.kind-tab {
  appearance: none; background: none; border: none; cursor: pointer;
  padding: 9px 12px 8px; margin-bottom: -1px; font-size: 13px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px;
}
.kind-tab:hover { color: var(--text); }
.kind-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.kind-tab .tab-count {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--gray-bg); border-radius: 999px; padding: 1px 7px;
}
.kind-tab.active .tab-count { color: var(--accent); background: var(--accent-soft); }

/* 폰 전용 요소(P11) — 데스크톱 기본은 숨김, 아래 모바일 섹션에서 켠다 */
.detail-mobile-bar, .dz-hint-touch { display: none; }

/* Dropzone & assets */
.dropzone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center;
  color: var(--muted); font-size: 13px; margin-bottom: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* base 브랜치 선택 (업로드 모달) — /issue 가 만든 `…/base` 목록 */
.base-branch-row { display: flex; gap: 6px; align-items: center; margin: 4px 0 6px; }
.base-select {
  flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.base-select:focus { outline: none; border-color: var(--accent); }

/* Validation errors/warnings — 편집기 최상단. 비어 있으면 자리를 차지하지 않는다. */
.up-errors-box, .up-warns { padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; }
.up-errors-box { border: 1px solid var(--red); background: var(--red-bg); }
/* 경고 = DRAFT · [TBD] 잔여. 저장을 막지 않고 검수 포인트만 알린다. */
.up-warns { border: 1px solid var(--amber); background: var(--amber-bg); }
.up-err, .up-warn { font-size: 12px; padding: 4px 0; border-top: 1px solid var(--border); }
.up-err { color: var(--red); }
.up-warn { color: var(--amber); }
.up-err .ecode, .up-warn .ecode { font-weight: 700; font-family: ui-monospace, monospace; margin-right: 6px; }

/* 미완성 스펙 안내 (DRAFT · [TBD] 잔여) — 상세 패널 문서 섹션 */
.spec-draft-note {
  margin-top: 6px; padding: 6px 8px; font-size: 12px; border-radius: 6px;
  border: 1px solid var(--amber); background: var(--amber-bg); color: var(--amber);
}
.spec-draft-note code { font-family: ui-monospace, monospace; }

/* Review (designer) — 컨펌 이력 (상세 패널) */
.review-item { padding: 8px 0; border-top: 1px solid var(--border); }
.review-comments { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.review-comments b { color: var(--text); }

/* 변경 이력(버전 로그) */
.ver-item { padding: 8px 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ver-num { font-weight: 700; font-size: 13px; }
.ver-reason { flex-basis: 100%; font-size: 13px; color: var(--text); margin-top: 2px; }
.ver-edit { background: none; border: none; cursor: pointer; padding: 0 2px; font-size: 12px; opacity: .6; }
.ver-edit:hover { opacity: 1; }
.ver-diff { background: none; border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  padding: 1px 8px; font-size: 11px; color: var(--muted); }
.ver-diff:hover { border-color: var(--accent); color: var(--accent); }

/* 재검토 변경분 배너 (리뷰 모달 상단) */
.rereview-banner {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid var(--amber); background: var(--amber-bg); color: var(--amber);
  border-radius: 10px; font-size: 13px; font-weight: 600;
}
.rereview-banner button { margin-left: auto; }

/* 버전 diff 뷰 */
.diff-legend { display: flex; gap: 14px; margin-bottom: 10px; font-size: 12px; font-weight: 600; }
.diff-legend .del { color: var(--red); }
.diff-legend .add { color: var(--green); }
.diff-view {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 66vh;
}
.diff-line { display: flex; gap: 8px; padding: 0 12px; white-space: pre-wrap; word-break: break-word; }
.diff-line .diff-sign { flex: 0 0 12px; text-align: center; opacity: .7; user-select: none; }
.diff-line.same { color: var(--muted); }
.diff-line.add { background: var(--green-bg); color: var(--green); }
.diff-line.del { background: var(--red-bg); color: var(--red); }
.diff-gap { padding: 3px 12px; color: var(--muted); font-size: 11px; text-align: center; background: var(--gray-bg); }

/* GitHub 권한 안내 모달 */
.auth-help-detail { font-size: 13.5px; color: var(--text); margin-bottom: 14px; }
.auth-help-causes { margin-bottom: 16px; }
.auth-help-causes ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.auth-help-causes li { margin: 4px 0; }
.auth-help-causes b { color: var(--text); }
.auth-help-actions { display: flex; gap: 10px; align-items: center; }

/* Skill guide */
.skill-steps { margin: 6px 0; padding-left: 20px; line-height: 1.9; }
.skill-steps code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Doc row */
.doc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Spec 미리보기 인라인 코멘트 (Notion식 리뷰 모드) */
.review-hint { font-size: 12px; color: var(--accent); margin-left: 10px; }
.review-count { font-size: 12px; color: var(--muted); align-self: center; }
.review-mode :is(h1, h2, h3, h4, h5, h6) { position: relative; }
.cmt-add {
  border: none; background: transparent; cursor: pointer; font-size: 13px;
  opacity: 0; margin-left: 8px; vertical-align: middle; transition: opacity .12s;
}
.review-mode :is(h1, h2, h3, h4, h5, h6):hover .cmt-add, .cmt-add:focus { opacity: 1; }
.cmt-thread { margin: 6px 0 10px; }
.cmt-input { display: flex; gap: 6px; margin: 6px 0; }
.cmt-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: 13px;
}
.cmt-input input:focus { outline: none; border-color: var(--accent); }
.cmt-bubble {
  background: var(--amber-bg); border-left: 3px solid var(--amber); border-radius: 0 8px 8px 0;
  padding: 7px 10px; margin: 6px 0; font-size: 13px; color: var(--text);
  display: flex; align-items: baseline; gap: 8px;
}
.cmt-bubble .cmt-sec { flex: none; font-size: 11px; font-weight: 700; color: var(--amber); }
.cmt-bubble .cmt-body { flex: 1; }
.cmt-bubble .cmt-del {
  flex: none; border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px;
}
.cmt-bubble .cmt-del:hover { color: var(--red); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  /* 태블릿·폰 가로 — 헤더 버튼 7개가 한 줄에 안 들어가면 줄바꿈(넘치면 레이아웃 뷰포트가 늘어난다) */
  .header-top, .header-actions { flex-wrap: wrap; row-gap: 8px; }
  /* 사이드바 — 상태 목록을 가로 칩 스트립으로 */
  .workspace > aside:first-child .panel-b { padding: 10px 12px; }
  .side-section { margin-bottom: 10px; }
  .side-section:last-child { margin-bottom: 0; }
  #status-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
  #status-list::-webkit-scrollbar { display: none; }
  .mod-item {
    flex: none; gap: 6px; padding: 6px 11px; font-size: 12px; white-space: nowrap;
    border: 1px solid var(--border); border-radius: 999px; min-height: 34px;
  }
  .mod-item.active { border-color: var(--accent); }
  .mod-item .count { padding: 0 6px; }
}
/* 짧은 뷰포트(폰 가로) — sticky 헤더가 화면 절반을 먹는다 */
@media (max-height: 520px) {
  .app-header { position: static; }
}

/* ===================== PRD (P8) ===================== */
.prd-chip.warn { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); }
.prd-chip .mono { color: inherit; }

.prd-empty { padding: 8px 0; }
.prd-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border);
}
.prd-head .feat-sub { flex: 1; }

/* 좌 본문 / 우 논의 2단 — 노션식 문서+스레드 */
.prd-grid { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
.prd-doc {
  max-height: 62vh; overflow-y: auto; padding-right: 8px;
  border-right: 1px solid var(--border);
}
.prd-thread { display: flex; flex-direction: column; max-height: 62vh; }
.prd-thread-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }
.prd-thread-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.pc { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--panel); }
.pc.reply { margin-left: 18px; border-left: 3px solid var(--accent-soft); }
.pc.deleted { background: var(--bg); border-style: dashed; }
.pc-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.pc-who { font-weight: 600; font-size: 13px; }
.pc-body { font-size: 13px; overflow-wrap: anywhere; }
.pc-actions { display: flex; gap: 8px; margin-top: 6px; }
.pc-edit-input { width: 100%; min-height: 64px; font: inherit; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
.pc-replying { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pc-anchor {
  font-size: 11px; color: var(--muted); background: var(--gray-bg);
  padding: 1px 8px; border-radius: 999px; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-anchor.on { background: var(--accent-soft); color: var(--accent); max-width: none; }
.pc-anchor-x { border: 0; background: none; color: inherit; font-size: 13px; padding: 0 0 0 4px; }
.mention { color: var(--accent); font-weight: 600; }
/* 팀원으로 해석되지 않는 핸들 — 오타·외부인이라 핑이 안 간다는 신호 */
.mention.unknown { color: var(--muted-2); font-weight: 500; }

/* @멘션 자동완성 — body 에 fixed 로 띄운다(모달·스레드 목록의 overflow 클리핑 회피) */
.mention-pop {
  position: fixed; z-index: 60; min-width: 200px; max-height: 220px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .12); padding: 4px;
}
.mention-pop.hidden { display: none; }
.mp-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-radius: 7px; cursor: pointer; font-size: 13px;
}
.mp-item.on { background: var(--accent-soft); }
.mp-item:hover { background: var(--bg); }
.mp-name { font-weight: 600; white-space: nowrap; }
.mp-handle {
  color: var(--muted); font-size: 12px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.prd-compose { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.prd-compose textarea {
  width: 100%; min-height: 66px; font: inherit; padding: 8px;
  border: 1px solid var(--border); border-radius: 8px; resize: vertical;
}
.prd-compose textarea:focus { outline: none; border-color: var(--accent); }
.prd-compose-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

.cmt-add.on { background: var(--accent); color: #fff; }
.btn-link { border: 0; background: none; color: var(--accent); font-size: 12px; padding: 0; }
.btn-link.danger { color: var(--red); }

.prd-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.prd-vercompare { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* diff 변경 섹션 요약 */
.diff-sections { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sec-chip { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--gray-bg); color: var(--gray); }
.sec-chip.add { background: var(--green-bg); color: var(--green); }
.sec-chip.chg { background: var(--amber-bg); color: var(--amber); }
.sec-chip.del { background: var(--red-bg); color: var(--red); }

@media (max-width: 1100px) {
  .prd-grid { grid-template-columns: 1fr; }
  .prd-doc { border-right: 0; max-height: 40vh; }
}

/* PRD 섹션 앵커 — 리뷰 모드(.review-mode)가 아니라 상시 노출이므로 기본 opacity:0 을 되돌린다.
   댓글이 달린 섹션은 항상 진하게 보여 "여기 논의가 있다"를 드러낸다. */
.prd-doc :is(h1, h2, h3, h4, h5, h6) { position: relative; }
.prd-doc .cmt-add { opacity: .38; }
.prd-doc :is(h1, h2, h3, h4, h5, h6):hover .cmt-add,
.prd-doc .cmt-add.has,
.prd-doc .cmt-add.on { opacity: 1; }
.prd-doc .cmt-add.has { color: var(--accent); font-weight: 600; }
.prd-doc .cmt-add.on { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; }

/* ===================== Mobile (P11) =====================
   브레이크포인트 720px = app.js 의 isMobile() 과 같은 값.
   원칙: 3단 → 1단은 1180px 에서 이미 처리. 여기서는 폰 폭에서 "가로로 넘치는 것"과
   "손가락으로 못 누르는 것"만 고친다. 상세 패널·모달은 전체화면 시트가 된다. */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
  body.sheet-open, body.modal-open { overflow: hidden; }

  /* 헤더 — sticky 해제(폰에선 화면의 1/4을 먹는다) · 보조 액션은 둘째 줄 가로 스크롤 스트립 */
  .app-header { position: static; padding: 10px 14px; }
  .header-top { flex-wrap: wrap; gap: 8px 10px; }
  .header-top .titles h1 { font-size: 15px; }
  .header-top .titles span { display: none; }
  .header-actions {
    order: 10; flex-basis: 100%; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -14px; padding: 2px 14px;
  }
  .header-actions::-webkit-scrollbar { display: none; }
  .user-chip { padding: 3px; gap: 0; }
  .user-chip > :not(.avatar) { display: none; }
  .guest-banner { gap: 6px; }
  .guest-banner .btn-link { margin-left: 0; }

  /* KPI — 한 줄 가로 스크롤 */
  .kpi-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 10px -14px 0; padding: 0 14px 2px; }
  .kpi-row::-webkit-scrollbar { display: none; }
  .kpi { flex: none; min-width: 0; padding: 8px 12px; }
  .kpi .val { font-size: 18px; }

  .workspace { padding: 10px 12px; gap: 10px; }

  /* 목록 — 검색창 한 줄 + 버튼 한 줄, 버전·PR 열은 숨김(상세에 있다) */
  .toolbar { padding: 10px 12px; flex-wrap: wrap; }
  .toolbar input.search { flex: 1 1 100%; min-width: 0; }
  .toolbar .btn-primary { flex: 1; }
  .kind-tabs { padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
  .kind-tab { white-space: nowrap; }
  .feature-table th:nth-child(n+3), .feature-table td:nth-child(n+3) { display: none; }
  .feature-table td { padding: 12px; }

  /* 상세 — 선택 전엔 숨기고, 선택하면 전체화면 시트(app.js 가 sheet-open 토글) */
  #detail-panel { display: none; }
  #detail-panel.sheet-open {
    display: block; position: fixed; inset: 0; z-index: 40; overflow-y: auto;
    border: 0; border-radius: 0; box-shadow: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .detail-mobile-bar {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    position: sticky; top: 0; z-index: 1; background: var(--panel); border-bottom: 1px solid var(--border);
  }
  .detail-mobile-bar .feat-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stepper { gap: 2px; margin: 12px 0 2px; padding: 0 8px; }
  .step { min-width: 40px; }
  .sline { min-width: 6px; }

  /* 모달 — 전체화면 시트. 헤더는 제목+닫기 첫 줄, 탭·힌트·다운로드는 둘째 줄 */
  .modal-overlay { align-items: stretch; justify-content: stretch; }
  .modal-card, .modal-card.modal-wide, .modal-card.modal-xwide {
    width: 100%; max-width: 100%; height: 100%; max-height: none; border-radius: 0;
  }
  .modal-head { flex-wrap: wrap; padding: 12px 14px; }
  .modal-head h2 { flex: 1; min-width: 0; font-size: 15px; }
  .modal-close { padding: 0 6px; font-size: 26px; }
  .modal-head > :not(h2):not(.modal-close):not(.head-dl) { order: 2; flex-basis: 100%; margin: 0; }
  .modal-head .role-tabs, .modal-head .doc-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .modal-head .head-dl { margin-left: auto; margin-right: 4px; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 10px 14px; flex-wrap: wrap; }
  .legend-table td:first-child { width: auto; white-space: normal; }

  /* 마크다운 — 넓은 표·코드는 제자리에서 가로 스크롤 */
  .md table { display: block; width: max-content; max-width: 100%; overflow-x: auto; }
  .md pre { max-width: 100%; }

  /* 업로드 — 프리뷰를 slot 아래 흐름에 두고(sticky 해제), drag-drop 문구 대신 파일 선택 안내 */
  .upload-preview { position: static; }
  .up-preview { max-height: 50vh; }
  .dz-hint { display: none; }
  .dz-hint-touch { display: inline; }
  .up-slot { flex-wrap: wrap; }
  .up-slot .btn-add { margin-left: auto; }

  /* PRD — 본문·논의를 한 흐름으로(각각의 62vh 스크롤 박스 해제)
     40vh 박스 안에서 긴 문서를 읽게 하지 않는다. 모달 자체가 스크롤한다. */
  .prd-doc { max-height: none; overflow: visible; padding-right: 0; }
  .prd-thread { max-height: none; }
  .prd-thread-list { overflow: visible; }
  .pc.reply { margin-left: 10px; }
  .pc-anchor { max-width: 140px; }
  .prd-head { flex-wrap: wrap; }
  .rereview-banner { flex-wrap: wrap; }
  .rereview-banner button { margin-left: 0; }
  .auth-help-actions { flex-wrap: wrap; }
  .stage-row { flex-direction: column; }
  .diff-view { max-height: none; }

  /* 입력 — 16px 미만이면 iOS 가 포커스 시 화면을 확대한다 */
  input, select, textarea { font-size: 16px !important; }

  /* 탭 타겟 — 44px 권고, 최소 36px */
  .btn-ghost, .btn-primary, .btn-add, .btn-del, .chip, .doc-tab, .role-tab, .kind-tab, .login-user,
  .detail-actions button, .detail-actions a { min-height: 36px; }
  .ver-edit, .ver-diff, .cmt-bubble .cmt-del, .pc-anchor-x, .btn-link, .cmt-add { min-height: 32px; min-width: 32px; }
  .cmt-add { padding: 0 6px; }
  .pc-actions { gap: 14px; }
  .detail-actions { gap: 8px; }
  .figma-links { line-height: 2; }
}

/* 터치 기기 — hover 로만 드러나던 것들을 상시 노출 */
@media (hover: none) {
  .review-mode .cmt-add { opacity: .45; }
  .review-mode .cmt-add.on, .review-mode .cmt-add.has { opacity: 1; }
  .prd-doc .cmt-add { opacity: .55; }
  .ver-edit { opacity: .85; }
}
