/* AI Hub — 화면 규칙
 * 색은 '지금 누구 차례인가' 를 뜻한다: 주황 = 담당자 차례, 파랑 = AI 작업 중, 초록 = 운영 반영, 빨강 = 확인 필요.
 * 파랑은 노선도(진행 단계)와 AI 에만 쓰고, 기본 버튼·링크는 먹색. 그림자·그라데이션 없음.
 * 힘을 주는 곳은 노선도(.rail) 하나. 나머지는 줄(rule)과 여백으로 조용하게.
 */
:root {
  --paper: #f3f5f7;
  --surface: #ffffff;
  --ink: #1c2230;
  --ink-2: #3a4252;
  --quiet: #5e6879;
  --rule: #dde2e9;
  --rail: #2648c9;
  --rail-rgb: 38, 72, 201;
  --rail-off: #d5dbe4;
  --human: #d98a07;
  --human-bg: #fff3dc;
  --ai: #2648c9;
  --ai-bg: #e7ecfb;
  --done: #1f8a57;
  --done-bg: #e3f3ea;
  --bad: #cf3b33;
  --bad-bg: #fbe6e4;
  --off: #8a93a3;
  --off-bg: #eceff3;
  --radius: 12px;
  font-family: 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--rail); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }

/* ── 틀 ── */
header.top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--rule); }
header.top .brand { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
header.top .spacer { flex: 1; }
header.top select { width: auto; max-width: 200px; padding: 6px 10px; }
nav.tabs { display: flex; gap: 2px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--rule); }
nav.tabs a { padding: 11px 12px 9px; text-decoration: none; color: var(--quiet); border-bottom: 2px solid transparent; }
nav.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.wrap { max-width: 820px; margin: 0 auto; padding: 20px 16px 48px; }
.crumb { color: var(--quiet); font-size: 12px; margin: 0 0 6px; }
.crumb a { color: var(--quiet); }

.row > h1 { margin: 0; }
.row:has(> h1) { margin-bottom: 14px; }
h1 { font-size: 23px; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 14px; font-weight: 700; }
h2 { font-size: 15px; line-height: 1.35; margin: 28px 0 10px; font-weight: 700; }
.muted { color: var(--quiet); font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 140px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.hidden { display: none !important; }
.full { width: 100%; }
.scroll-x { overflow-x: auto; }
.scroll-x td, .scroll-x th { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; line-height: 1.65; }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.center { max-width: 400px; margin: 56px auto; }

/* ── 입력 ── */
label { display: block; font-size: 12px; color: var(--ink-2); margin: 12px 0 5px; font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; width: 100%;
  background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); }
textarea { resize: vertical; }
.row input, .row select { width: auto; flex: 1; }
.grow select, .grow input { width: 100%; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink); margin: 0 0 12px; }
.check input { width: auto; }

button, a.btn {
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.4;
}
button:hover, a.btn:hover { border-color: var(--ink-2); }
button.primary, a.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
button.primary:hover, a.btn.primary:hover { background: var(--ink-2); }
button.danger { color: var(--bad); }
button.danger:hover { border-color: var(--bad); }
button.small { padding: 5px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

.msg { padding: 11px 14px; border-radius: 8px; margin: 12px 0; font-size: 13px; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--done-bg); color: var(--done); }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { color: var(--quiet); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.linkbox { display: flex; gap: 6px; }
.linkbox input { font-size: 12px; }

/* ── 상태 표시: 색 = 누구 차례 ── */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--off-bg); color: var(--ink-2); white-space: nowrap; }
.badge.gray { background: var(--off-bg); color: var(--quiet); }
.badge.good, .tone-done .badge { background: var(--done-bg); color: var(--done); }
.badge.bad, .tone-bad .badge { background: var(--bad-bg); color: var(--bad); }
.badge.warn, .tone-human .badge { background: var(--human-bg); color: #9a5f00; }
.tone-ai .badge { background: var(--ai-bg); color: var(--ai); }
.tone-off .badge { background: var(--off-bg); color: var(--off); }
.urgent { color: var(--bad); font-weight: 700; font-size: 12px; }

/* ── 노선도 (진행 단계) ──
 * <ol class="rail"> 역마다 <li class="done|now">. 선은 각 역의 ::before 가 앞 역에서 이어 그린다.
 * 지난 구간·역 = 파랑, 지금 역 = 차례 색(주황/파랑/초록/빨강), 남은 구간 = 회색. AI 작업 중일 때만 지금 역이 숨 쉰다.
 */
.rail { --cur: var(--rail); display: flex; list-style: none; margin: 6px 0 22px; padding: 0; }
.tone-human .rail { --cur: var(--human); }
.tone-ai .rail { --cur: var(--ai); }
.tone-done .rail { --cur: var(--done); }
.tone-bad .rail { --cur: var(--bad); }
.rail li { flex: 1; position: relative; text-align: center; padding-top: 30px; font-size: 12px; color: var(--quiet); line-height: 1.3; white-space: nowrap; }
@media (max-width: 480px) { .rail:not(.mini) li { font-size: 12px; letter-spacing: -0.02em; } }
.rail li::before { content: ''; position: absolute; top: 9px; left: -50%; right: 50%; height: 6px; background: var(--rail-off); z-index: 1; }
.rail li:first-child::before { display: none; }
.rail li.done::before, .rail li.now::before { background: var(--rail); }
.rail li::after {
  content: ''; position: absolute; top: 3px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--rail-off); box-sizing: border-box; z-index: 2; /* 역이 선 위에 */
}
.rail li.done::after { border-color: var(--rail); }
.rail li.now::after { width: 24px; height: 24px; margin-left: -12px; top: 0; border: 6px solid var(--cur); }
.rail li.done { color: var(--ink-2); }
.rail li.now { color: var(--ink); font-weight: 700; }
.tone-ai .rail li.now::after { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px rgba(var(--rail-rgb), .16); } }
@media (prefers-reduced-motion: reduce) { .rail li.now::after { animation: none !important; } }

/* 목록용 작은 노선도: 역 이름 없이 선과 점만 */
.rail.mini { margin: 0; width: 150px; flex: none; }
.rail.mini li { padding-top: 0; height: 14px; font-size: 0; }
.rail.mini li::before { top: 5px; height: 4px; }
.rail.mini li::after { top: 2px; width: 10px; height: 10px; margin-left: -5px; border-width: 3px; }
.rail.mini li.now::after { top: 0; width: 14px; height: 14px; margin-left: -7px; border-width: 4px; }

/* ── 목록: 한 판 위의 줄 ── */
.list { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.list > a, .list > .empty { display: flex; gap: 16px; align-items: center; padding: 14px 18px; text-decoration: none; color: inherit; border-top: 1px solid var(--rule); }
.list > a:first-child, .list > .empty:first-child { border-top: 0; }
.list > a:hover { background: #f8f9fb; }
.list .main { flex: 1; min-width: 0; }
.list .title { font-weight: 600; display: block; }
.list .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--quiet); font-size: 12px; margin-top: 2px; }
.list .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.list > .empty { color: var(--quiet); }
@media (max-width: 560px) {
  .list > a { flex-direction: column; align-items: stretch; gap: 10px; }
  .list .side { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
}
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.seg button { border: 0; border-radius: 0; font-weight: 500; padding: 7px 14px; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button.on { background: var(--ink); color: #fff; }

/* ── 요구사항 상세 ── */
.ticket-head .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; color: var(--quiet); font-size: 12px; margin: -6px 0 14px; }
.next { border-left: 4px solid var(--cur, var(--rail-off)); }
.tone-human .next { --cur: var(--human); }
.tone-ai .next { --cur: var(--ai); }
.tone-done .next { --cur: var(--done); }
.tone-bad .next { --cur: var(--bad); }
.next .say { font-weight: 600; margin: 0; }
.next .act { margin-top: 14px; }
.next .act + .act { border-top: 1px solid var(--rule); padding-top: 14px; }
.next textarea { margin-bottom: 8px; }
.next details summary { cursor: pointer; color: var(--quiet); font-size: 12px; }
.preview-link { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; word-break: break-all; margin: 12px 0 0; padding: 10px 12px; background: var(--ai-bg); border-radius: 8px; }
.preview-link a { color: var(--ai); font-weight: 600; }
dl.fields { margin: 0; }
dl.fields dt { font-size: 12px; color: var(--quiet); font-weight: 600; margin-top: 16px; }
dl.fields dt:first-child { margin-top: 0; }
dl.fields dd { margin: 4px 0 0; }

/* 진행 기록: 세로 노선 */
.timeline { list-style: none; padding: 0; margin: 0 0 16px 8px; border-left: 2px solid var(--rule); }
.timeline .ev { padding: 6px 0 14px 18px; position: relative; }
.timeline .ev::before { content: ''; position: absolute; left: -7px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--rail-off); box-sizing: border-box; }
.timeline .ev .what { font-weight: 600; }
.timeline .ev .who, .timeline .ev .when { color: var(--quiet); font-size: 12px; }
.timeline .ev .pre { margin-top: 6px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.timeline .ev-status::before, .timeline .ev-pr_opened::before, .timeline .ev-preview::before, .timeline .ev-merged::before { border-color: var(--rail); }
.timeline .ev-accepted::before, .timeline .ev-approved::before, .timeline .ev-deploy_requested::before { border-color: var(--human); }
.timeline .ev-deployed::before { border-color: var(--done); background: var(--done); }
.timeline .ev-rejected::before, .timeline .ev-deploy_failed::before { border-color: var(--bad); }
.timeline details summary { cursor: pointer; color: var(--quiet); margin-top: 4px; }

/* ════════════ PC 중심 레이아웃: 상단바 + 왼쪽 사이드바 + 본문 ════════════ */
.topbar { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--rule); }
.topbar .brand { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; }
.topbar .ws { color: var(--quiet); padding-left: 14px; border-left: 1px solid var(--rule); }
.topbar select { width: auto; max-width: 220px; padding: 6px 10px; }
.topbar .who { color: var(--ink-2); text-decoration: none; font-size: 13px; }
.nav-toggle { display: none; }
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.sidebar { background: #eceff3; border-right: 1px solid var(--rule); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 13px; }
.sidebar a:hover { background: #e2e6ec; }
.sidebar a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--ink); }
.sidebar .side-title { color: var(--quiet); font-size: 12px; font-weight: 600; }
.sidebar .side-title.on { box-shadow: none; }
.sidebar .side-bottom { margin-top: auto; border-top: 1px solid var(--rule); padding-top: 12px; }
.sidebar .pad { padding: 0 10px; }
.mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.sidebar .sub { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 8px 22px; padding-left: 12px; border-left: 2px solid var(--rule); }
.sidebar .sub a { padding: 5px 10px; font-size: 12.5px; justify-content: space-between; }
.sidebar .sub a.on { box-shadow: none; }
.sidebar .count { color: var(--quiet); font-size: 12px; font-weight: 400; }
.content { padding: 24px 32px 64px; min-width: 0; max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .crumb { margin-bottom: 4px; }

/* 툴바 + 표 */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 320px; padding: 8px 12px; }
.table-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow-x: auto; }
table.issues { font-size: 13px; }
table.issues th { background: #f8f9fb; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--rule); }
table.issues td { padding: 10px 12px; }
table.issues tbody tr[data-href] { cursor: pointer; }
table.issues tbody tr[data-href]:hover { background: #f6f8fb; }
table.issues .c-title a { text-decoration: none; font-weight: 600; }
table.issues .c-title a:hover { text-decoration: underline; }
table.issues .c-key, table.issues .c-when { color: var(--quiet); white-space: nowrap; font-size: 12px; }
table.issues .c-who { white-space: nowrap; }
table.issues .c-rail { width: 160px; }
table.issues tr.empty td { color: var(--quiet); padding: 28px 16px; text-align: center; }
.kind { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.kind-bug { border-color: #f1c4c0; color: var(--bad); }
.kind-ui { border-color: #cdd6f4; color: var(--rail); }
.proj-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }

/* 배지: 차례 색 (badge 자체에 tone-* 를 붙여 쓴다) */
.badge.tone-human { background: var(--human-bg); color: #9a5f00; }
.badge.tone-ai { background: var(--ai-bg); color: var(--ai); }
.badge.tone-done { background: var(--done-bg); color: var(--done); }
.badge.tone-bad { background: var(--bad-bg); color: var(--bad); }
.badge.tone-off { background: var(--off-bg); color: var(--off); }
.rail.tone-human { --cur: var(--human); }
.rail.tone-ai { --cur: var(--ai); }
.rail.tone-done { --cur: var(--done); }
.rail.tone-bad { --cur: var(--bad); }
.rail.tone-ai li.now::after { animation: breathe 1.8s ease-in-out infinite; }

/* 상세: 본문 | 세부 정보 */
.issue-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.issue-main h1 { font-size: 24.5px; margin-bottom: 18px; }
.issue-main section { margin-bottom: 8px; }
.issue-side { position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
dl.props { display: grid; grid-template-columns: 84px 1fr; gap: 10px 12px; margin: 0; font-size: 12.5px; align-items: baseline; }
dl.props dt { color: var(--quiet); font-weight: 600; font-size: 12px; }
dl.props dd { margin: 0; min-width: 0; word-break: break-word; }
dl.props .links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
section.next { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--cur, var(--rail-off)); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.tone-human section.next { --cur: var(--human); }
.tone-ai section.next { --cur: var(--ai); }
.tone-done section.next { --cur: var(--done); }
.tone-bad section.next { --cur: var(--bad); }
section.next .say { font-weight: 600; margin: 0; }
section.next .act { margin-top: 14px; }
section.next .act + .act { border-top: 1px solid var(--rule); padding-top: 14px; }
section.next .act label { margin-top: 0; }
section.next details summary { cursor: pointer; color: var(--quiet); font-size: 12px; }
.desc h2:first-child { margin-top: 8px; }
.desc .md { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 18px; }
.form-page { max-width: 860px; }
.comment-form { margin-top: 8px; }
button.link { background: none; border: 0; padding: 4px 0; color: var(--quiet); font-weight: 600; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

/* 진행 기록 */
.timeline .ev-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.timeline .ev-head .what { font-weight: 600; }
.timeline .ev-head .who, .timeline .ev-head .when, .timeline .ev-head .gh { color: var(--quiet); font-size: 12px; }
.timeline .ev-body { margin-top: 6px; }
.timeline .ev-body.md { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; }
.timeline .ev-body.clamp { max-height: 240px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }

/* Markdown 본문 (GitHub 과 같은 모양을 조용하게) */
.md { line-height: 1.65; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { font-size: 14px; margin: 16px 0 6px; }
.md h1, .md h2 { font-size: 15px; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; }
.md input[type=checkbox] { width: 15px; height: 15px; padding: 0; margin: 0 7px 0 0; border: 0; vertical-align: -2px; accent-color: var(--done); }
.md li:has(> input[type=checkbox]) { list-style: none; margin-left: -18px; }
.md code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.88em; background: #eef1f5; padding: 1px 5px; border-radius: 5px; }
.md pre { background: #f4f6f9; border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--rule); padding-left: 12px; color: var(--ink-2); }
.md table { border-collapse: collapse; font-size: 12px; display: block; max-width: 100%; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--rule); padding: 5px 10px; }
.md a { color: var(--rail); }
.md img { max-width: 100%; }
.md hr { border: 0; border-top: 1px solid var(--rule); }

/* Markdown 에디터 */
.md-editor { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.md-editor:focus-within { border-color: var(--ink-2); }
.md-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-bottom: 1px solid var(--rule); background: #f8f9fb; border-radius: 10px 10px 0 0; }
.md-tabs { display: flex; gap: 2px; }
.md-tabs button { border: 0; background: none; padding: 5px 10px; font-size: 12px; font-weight: 500; color: var(--quiet); border-radius: 6px; }
.md-tabs button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--rule); }
.md-tools { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.md-tools button { border: 0; background: none; padding: 4px 8px; font-size: 12px; font-weight: 500; color: var(--ink-2); border-radius: 6px; }
.md-tools button:hover { background: #e9edf2; }
.md-editor textarea { border: 0; border-radius: 0; min-height: 96px; display: block; }
.md-editor textarea:focus { border: 0; }
.md-preview { padding: 12px 14px; min-height: 96px; }
.md-hint { font-size: 12px; color: var(--quiet); padding: 4px 10px 6px; border-top: 1px solid var(--rule); }

/* ════════════ 진행 표시: 버튼 스피너 + 상단 막대 ════════════ */
button.busy { position: relative; color: transparent !important; pointer-events: none; }
button.busy::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid var(--spin, var(--ink)); border-right-color: transparent; animation: spin .7s linear infinite;
}
button.primary.busy { --spin: #fff; }
button.danger.busy { --spin: var(--bad); }
button:disabled.busy { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
html.loading::before {
  content: ''; position: fixed; top: 0; left: 0; z-index: 50; height: 3px; width: 40%; background: var(--rail);
  animation: loadbar 1.1s ease-in-out infinite;
}
@keyframes loadbar { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  button.busy::after { animation-duration: 1.6s; }
  html.loading::before { animation: none; left: 0; width: 100%; opacity: .5; }
}

/* ════════════ 좁은 화면: 사이드바를 메뉴로 접는다 ════════════ */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-block; padding: 6px 10px; font-size: 12px; }
  .sidebar { position: fixed; z-index: 30; top: 56px; left: 0; bottom: 0; width: 270px; height: auto; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 0 100vmax rgba(20, 24, 33, 0); }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(20, 24, 33, .25); }
  .content { padding: 18px 16px 48px; }
  .issue-grid { grid-template-columns: minmax(0, 1fr); }
  .issue-side { position: static; order: -1; }
  .topbar .who { display: none; }
  table.issues .c-rail, table.issues .c-who, table.issues .c-kind { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
.preview-link.prod { background: var(--done-bg); }
.preview-link.prod a { color: var(--done); }

/* 입력칸: 터치 기기는 16px(iOS 확대 방지), 마우스를 쓰는 PC 는 본문과 같은 크기로 */
@media (hover: hover) and (pointer: fine) {
  input, select, textarea { font-size: 14px; padding: 8px 11px; }
  .linkbox input { font-size: 13px; }
}

/* ════════════ 관리 화면: 탭 · 창(dialog) · 단계 · 점검표 ════════════ */
.page-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin: -4px 0 18px; }
.page-tabs a { padding: 8px 12px 9px; text-decoration: none; color: var(--quiet); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.page-tabs a:hover { color: var(--ink); }
.page-tabs a.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.page-tabs .count { color: var(--quiet); font-weight: 400; font-size: 12px; margin-left: 2px; }
table.issues .c-act { width: 1%; text-align: right; }
.row.nowrap { flex-wrap: nowrap; justify-content: flex-end; }
table.issues tr.archived td { opacity: .55; }
select.compact { width: auto; padding: 4px 8px; }
.empty-box { background: var(--surface); border: 1px dashed var(--rule); border-radius: var(--radius); padding: 28px; text-align: center; }
.empty-box p { margin: 4px 0; }

dialog.dlg { border: 1px solid var(--rule); border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--ink); box-shadow: 0 18px 48px rgba(20, 24, 33, .18); }
dialog.dlg.wide { width: min(680px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(20, 24, 33, .35); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.dlg-head h2 { margin: 0; }
.dlg-x { border: 0; background: none; color: var(--quiet); font-size: 13px; padding: 4px 6px; }
.dlg-body { padding: 16px 18px 18px; overflow-y: auto; }
.form-grid label:not(.check) { margin-top: 12px; }
.form-grid label:first-child { margin-top: 0; }
.form-grid label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-top: 12px; color: var(--ink); }
.form-grid label.check input { width: auto; }
.hint { font-size: 12px; color: var(--quiet); margin: 4px 0 0; }
.dlg-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }

ol.steps { list-style: none; counter-reset: st; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
ol.steps li { counter-increment: st; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px 12px 46px; position: relative; display: flex; flex-direction: column; gap: 4px; }
ol.steps li::before { content: counter(st); position: absolute; left: 14px; top: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--off-bg); color: var(--ink-2); }
ol.steps li.done::before { content: '✓'; background: var(--done); color: #fff; }
ol.steps .muted { font-size: 12px; }

ul.checklist { list-style: none; padding: 0; margin: 12px 0 0; border: 1px solid var(--rule); border-radius: 10px; }
ul.checklist li { display: flex; gap: 10px; padding: 9px 12px; align-items: flex-start; }
ul.checklist li + li { border-top: 1px solid var(--rule); }
ul.checklist li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; word-break: break-word; }
ul.checklist .ck { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
ul.checklist li.ok .ck { background: var(--done); }
ul.checklist li.ok .ck::before { content: '✓'; }
ul.checklist li.bad .ck { background: var(--bad); }
ul.checklist li.bad .ck::before { content: '!'; }
ul.checklist li.bad strong { color: var(--bad); }
@media (max-width: 900px) { ol.steps { grid-template-columns: minmax(0, 1fr); } }
button, .btn { white-space: nowrap; }
.linkbox input { min-width: 0; }
table.issues.nowrap-cells td { white-space: nowrap; }
