/* OI Factory — Omelet design system
 *
 * 출처: oi-foundry/shared/ui-foundation/tokens/tokens.json (Figma 토큰)와
 *       oi-foundry/applications/oi-studio 실사용 색상.
 * 규칙은 docs/design-tokens.md 에 문서화돼 있다. 색을 새로 만들지 말 것.
 *
 *   중립 그레이   화면의 대부분. 바탕·본문·경계.
 *   purple #7B5BFF  "지금 여기" — 선택·현재 단계·포커스·다음 행동
 *   green  #00C2A4  "사람이 확인함 / 검사 통과"
 *   purple→green    오믈렛 시그니처 그라데이션. 히어로 한 곳에만.
 *   orange #FF8845  경고 전용 (노란 계열은 브랜드 색이 아니다)
 *   red    #FF5345  실패·차단 전용
 */

:root {
  --purple-25: #f9f7ff;
  --purple-50: #f2efff;
  --purple-100: #d6ccff;
  --purple-500: #7b5bff;
  --purple-600: #7053e8;
  --purple-700: #5741b5;
  --green-50: #e6f9f6;
  --green-100: #c2f0e9;
  --green-500: #00c2a4;
  --green-700: #008a74;
  --orange-50: #fff3ec;
  --orange-500: #ff8845;
  --orange-700: #b56131;
  --red-50: #ffeeec;
  --red-500: #ff5345;
  --red-700: #b53b31;

  --gray-25: #fafbfc;
  --gray-50: #f6f8fb;
  --gray-100: #f0f3f7;
  --gray-200: #e4e7ec;
  --gray-300: #d0d5dd;
  --gray-400: #98a2b3;
  --gray-500: #667085;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-800: #1d2939;
  --navy: #101828;

  --canvas: #f9fafb;
  --surface: #ffffff;
  --ink: var(--navy);
  --ink-2: var(--gray-600);
  --muted: var(--gray-500);
  --caption: var(--gray-400);
  --line: rgba(16, 24, 40, .08);
  --line-strong: rgba(16, 24, 40, .14);

  --radius: 6px;
  --radius-lg: 10px;
  --pill: 20px;
  --shadow: 6px 6px 30px rgba(0, 0, 0, .06);
  --shadow-modal: 0 0 8px rgba(0, 0, 0, .08), 0 8px 16px rgba(0, 0, 0, .08), 0 16px 20px rgba(0, 0, 0, .12);
  --font: Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; }
/* The advisor is a main workspace; only the conversation and source scroll. */
body.assistant-mode { height: var(--assistant-height, 100dvh); overflow: hidden; }
.assistant-mode .app-shell { height: var(--assistant-height, 100dvh); min-height: 0; }
.assistant-mode .app-shell > main { display: flex; flex-direction: column; min-height: 0; padding: 0 32px; background: var(--surface); }
.assistant-mode .topbar { min-height: 84px; flex-shrink: 0; }
.assistant-mode .topbar h1 { font-size: 22px; }
.assistant-mode .topbar .eyebrow { margin-bottom: 5px; }
.assistant-mode .top-actions { display: none; }
.assistant-mode #notice { flex-shrink: 0; }
#view-assistant.active { display: flex; flex: 1; min-height: 0; animation: none; }
.case-assistant { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.case-assistant-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; flex-shrink: 0; }
.case-assistant-top small { color: var(--muted); font-size: 12.5px; }
.case-conversation { overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; flex: 1; min-height: 0; padding: 24px; scroll-padding: 24px; scrollbar-gutter: stable; }
#case-assistant-messages { display: flex; flex-direction: column; width: min(100%, 760px); min-height: 100%; margin-inline: auto; }
.case-welcome { text-align: center; padding: 32px 0 56px; max-width: 650px; margin: auto; }
.case-welcome-icon { display: inline-grid; place-items: center; height: 40px; width: 40px; border-radius: var(--radius-lg); background: var(--ink); color: white; font-size: 13px; }
.case-welcome h2 { font-size: clamp(21px, 2.5vw, 28px); margin: 16px 0 10px; letter-spacing: -.04em; }
.case-welcome p { color: var(--muted); white-space: pre-line; font-size: 14px; line-height: 1.8; }
.case-chat-examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.case-example { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--pill); padding: 9px 14px; font-size: 13px; cursor: pointer; }
.case-example:hover { background: var(--canvas); }
.case-composer-dock { flex-shrink: 0; width: min(100%, 808px); margin-inline: auto; padding: 8px 24px max(24px, env(safe-area-inset-bottom)); }
#case-assistant-form { margin: 0; }
#case-assistant-controls { border: 0; padding: 0; margin: 0; min-width: 0; }
.case-composer { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--canvas); padding: 14px 16px 10px; }
.case-assistant .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.case-composer:focus-within { border-color: var(--purple-600); box-shadow: 0 0 0 2px var(--purple-50); }
#case-assistant-question { width: 100%; display: block; resize: vertical; min-height: 72px; max-height: 140px; background: transparent; border: none; outline: none; box-shadow: none; padding: 0; font-size: 15px; line-height: 1.65; }
.case-composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.case-composer-bottom span { font-size: 12.5px; color: var(--muted); }
#case-assistant-submit { border-radius: var(--radius-lg); min-height: 36px; padding: 8px 14px; white-space: nowrap; }
#case-assistant-status { margin: 7px 0 0; font-size: 12.5px; }
#case-assistant-status:empty { display: none; }
.case-assistant-footnote { font-size: 12.5px; color: var(--muted); text-align: center; padding: 10px 0 0; margin: 0; line-height: 1.5; }
.case-message { flex-shrink: 0; font-size: 15px; line-height: 1.8; margin: 0 0 24px; overflow-wrap: anywhere; }
.case-message p { white-space: pre-wrap; margin: 8px 0; }
.case-message-author { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.case-message-user { background: var(--canvas); border-radius: var(--radius-lg) var(--radius-lg) var(--radius) var(--radius-lg); padding: 12px 18px; max-width: 85%; width: fit-content; margin-left: auto; }
.case-message-user p { margin: 0; }
.case-message h3 { font-size: 16px; margin: 24px 0 12px; }
.case-message h4 { font-size: 15px; margin: 8px 0; }
.case-advice, .case-lesson { margin-bottom: 16px; }
.case-aggregate-table { width: 100%; max-width: 520px; border-collapse: collapse; margin: 14px 0; table-layout: fixed; }
.case-aggregate-table th, .case-aggregate-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.case-aggregate-table th:last-child, .case-aggregate-table td:last-child { width: 110px; text-align: right; }
.case-aggregate-table th { color: var(--muted); font-size: 12px; font-weight: 500; }
.case-caveat { color: var(--muted); font-size: 13px; }
.case-lesson blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--line-strong); background: var(--canvas); font-size: 13px; white-space: pre-wrap; }
.case-citation { display: inline-block; background: var(--purple-50); border: 0; border-radius: var(--radius-lg); padding: 5px 9px; font-size: 12.5px; cursor: pointer; margin: 4px 6px 4px 0; }
.case-source-list { margin: 18px 0 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.case-source-list summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.case-assistant-result { border-bottom: 1px solid var(--line); padding: 14px 0; }
.case-assistant-result pre, .case-source-content { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
.case-assistant-result pre { max-height: 180px; overflow: auto; background: var(--canvas); padding: 10px; border-radius: 6px; }
.case-source-panel { display: flex; flex-direction: column; flex: 0 0 38%; min-width: 300px; min-height: 0; margin-left: 20px; border-left: 1px solid var(--line); padding: 20px 0 24px 20px; background: var(--surface); }
.case-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.case-source-heading h2 { font-size: 18px; margin: 0; }
.case-source-heading .eyebrow { margin-bottom: 4px; }
#case-source-close { font-size: 12.5px; padding: 8px; }
#case-source-location { overflow-wrap: anywhere; line-height: 1.6; }
#case-source-status:empty { display: none; }
#case-source-retry { align-self: flex-start; }
.case-source-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; margin-bottom: 0; padding: 12px; background: var(--canvas); border-radius: var(--radius); }
.case-source-content:empty { display: none; }
.case-source-content mark { display: block; background: var(--purple-50); color: inherit; }
.case-assistant-result small { display: block; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .case-source-panel { position: fixed; inset: 0; z-index: 80; margin: 0; min-width: 0; padding: 24px max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)); border: 0; }
}
@media (max-width: 760px) {
  .assistant-mode .app-shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .assistant-mode .app-shell > main { padding: 0 12px; }
  .assistant-mode .topbar { display: none; }
  .assistant-mode .topbar .eyebrow { display: none; }
  .assistant-mode .topbar h1 { font-size: 18px; }
  .case-assistant-top { padding: 10px 0; }
  .case-assistant-top small { max-width: 54%; line-height: 1.5; }
  .case-conversation { padding: 16px 4px; scrollbar-gutter: auto; }
  .case-welcome { padding: 16px 4px 24px; }
  .case-welcome h2 { font-size: 20px; }
  .case-welcome p { font-size: 13px; }
  .case-example { padding: 8px 10px; }
  .case-composer-dock { padding: 8px 0 max(24px, env(safe-area-inset-bottom)); }
  .case-composer { padding: 10px 12px; }
  #case-assistant-question { font-size: 16px; min-height: 64px; max-height: 105px; }
  .case-composer-bottom span { max-width: 150px; font-size: 12.5px; }
  .case-assistant-footnote { padding: 8px 2px 0; font-size: 12.5px; }
}
.assistant-mode.assistant-short .sidebar .brand { display: none; }
.assistant-mode.assistant-short .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.assistant-mode.assistant-short .sidebar .nav-item span { display: none; }
.assistant-short .case-welcome { padding: 8px 0; }
.assistant-short .case-welcome h2 { margin: 0; font-size: 18px; }
.assistant-short .case-welcome-icon, .assistant-short .case-welcome p, .assistant-short .case-chat-examples { display: none; }
.assistant-compact .case-assistant-top { padding: 6px 0; justify-content: flex-end; }
.assistant-compact .case-assistant-top small, .assistant-compact .case-assistant-footnote { display: none; }
.assistant-compact #case-assistant-question { height: 64px; }
body.dialog-open { overflow: hidden; }
button, input, textarea, select { font-family: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--purple-500); outline-offset: 2px; border-radius: var(--radius); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
::selection { background: var(--purple-50); }

.eyebrow { margin: 0 0 9px; font-size: 12.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--caption); }
h1, h2, h3 { font-weight: 600; letter-spacing: -.015em; color: var(--ink); }

/* ---------- auth ---------- */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(900px 460px at 80% -12%, var(--purple-25), transparent 60%), var(--canvas); }
.auth-card { width: min(520px, 100%); padding: 52px 46px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.auth-card h1 { font-size: clamp(32px, 5.2vw, 40px); font-weight: 600; line-height: 1.26; letter-spacing: -.028em; margin: 24px 0 16px; }
.auth-card p:not(.eyebrow) { color: var(--ink-2); line-height: 1.68; font-size: 16px; margin-bottom: 32px; }

.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--radius-lg); background: var(--navy); color: var(--surface); font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.brand-mark.small { width: 34px; height: 34px; border-radius: var(--radius-lg); font-size: 13px; flex: 0 0 auto; }

/* ---------- shell ---------- */
.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 14px 18px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 28px; text-decoration: none; color: var(--ink); }
.brand b, .profile b { display: block; font-size: 15px; font-weight: 600; }
.brand small, .profile small, .sidebar-note small { display: block; font-size: 12.5px; font-weight: 500; color: var(--caption); margin-top: 3px; line-height: 1.45; }
nav { display: grid; gap: 2px; }
.nav-item { position: relative; width: 100%; border: 0; background: transparent; color: var(--gray-600); padding: 10px 12px; border-radius: var(--radius); display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left; font-size: 15px; font-weight: 500; transition: background .14s ease, color .14s ease; }
.nav-item span { width: 18px; text-align: center; font-size: 15px; color: var(--gray-400); }
.nav-item b { font-weight: inherit; white-space: nowrap; }
.nav-item em { margin-left: auto; background: var(--gray-100); color: var(--gray-500); border-radius: var(--pill); font-style: normal; font-size: 12.5px; font-weight: 600; min-width: 22px; text-align: center; padding: 2px 8px; }
.nav-item:hover { background: var(--gray-50); color: var(--ink); }
.nav-item.active { background: var(--purple-25); color: var(--ink); font-weight: 600; }
.nav-item.active span { color: var(--purple-500); }
.nav-item.active em { background: var(--purple-50); color: var(--purple-700); }
.sidebar-note { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 15px 10px 13px; border-top: 1px solid var(--line); }
.sidebar-note b { font-size: 13px; font-weight: 600; display: block; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 4px var(--green-50); flex: 0 0 auto; }
.profile { display: flex; gap: 11px; align-items: center; padding: 15px 10px 0; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--gray-100); color: var(--gray-600); font-size: 12.5px; font-weight: 600; flex: 0 0 auto; }

/* ---------- main frame ---------- */
main { min-width: 0; padding: 0 38px 76px; }
.topbar { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 26px; font-weight: 600; margin: 0; }
.top-actions { display: flex; gap: 8px; }
.button { border: 1px solid transparent; border-radius: var(--radius); padding: 10px 18px; cursor: pointer; font-size: 15px; font-weight: 500; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 6px; transition: background .14s ease, border-color .14s ease, color .14s ease; }
.button.primary { background: var(--navy); color: var(--surface); }
.button.primary:hover { background: var(--gray-800); }
.button.secondary { background: var(--surface); color: var(--gray-700); border-color: var(--gray-300); }
.button.secondary:hover { border-color: var(--gray-400); color: var(--ink); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.primary:disabled:hover { background: var(--navy); }
.button.full { width: 100%; padding-block: 12px; }
.text-button { border: 0; padding: 4px 0; background: transparent; color: var(--purple-700); font-size: 14px; font-weight: 500; cursor: pointer; }
.text-button:hover { color: var(--purple-500); }
.text-button.back { margin: 26px 0 8px; color: var(--muted); }
.text-button.back:hover { color: var(--ink); }
.notice { margin-top: 18px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); font-size: 14px; }
.notice.error { border-color: var(--red-500); background: var(--red-50); color: var(--red-700); }
.notice.success { border-color: var(--green-100); background: var(--green-50); color: var(--green-700); }

/* ---------- views ---------- */
.view { display: none; }
.view.active { display: block; animation: rise .28s cubic-bezier(.2, .7, .3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* 오믈렛 시그니처 그라데이션은 이 히어로 한 곳에만 쓴다. */
.mission-panel { margin: 30px 0 42px; padding: 38px 42px 28px; background: linear-gradient(126deg, var(--purple-600) 0%, var(--purple-500) 46%, var(--green-500) 100%); color: var(--surface); border-radius: var(--radius-lg); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 22px 46px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.mission-panel::after { content: ""; width: 300px; height: 300px; border-radius: 50%; position: absolute; right: -100px; top: -140px; background: radial-gradient(circle at 42% 42%, rgba(255,255,255,.2), transparent 68%); }
.mission-panel .eyebrow { color: rgba(255, 255, 255, .78); }
.mission-panel h2 { margin: 0; color: var(--surface); font-size: clamp(25px, 3vw, 31px); font-weight: 600; line-height: 1.32; letter-spacing: -.018em; }
.mission-panel > p { color: rgba(255, 255, 255, .84); line-height: 1.72; margin: 22px 0 0; max-width: 460px; font-size: 15px; }
.mission-flow { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .22); }
.mission-flow span { background: rgba(255, 255, 255, .16); padding: 7px 15px; border-radius: var(--pill); font-size: 13px; font-weight: 500; }
.mission-flow i { color: rgba(255, 255, 255, .8); font-style: normal; }

.section-heading, .panel-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.section-heading { margin: 34px 0 16px; }
.section-heading h2, .intro-copy h2, .reference-intro h2 { font-size: 21px; font-weight: 600; margin: 0; }
.panel-heading { padding-bottom: 15px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.panel-heading h3 { margin: 0; font-size: 16px; font-weight: 600; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-grid.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-card { min-height: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gray-300); }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.status-chip, .tag, .count-pill { font-size: 12.5px; font-weight: 500; padding: 4px 11px; border-radius: var(--pill); background: var(--gray-100); color: var(--gray-600); white-space: nowrap; }
.status-chip { font-weight: 600; color: var(--gray-700); }
.count-pill { background: var(--purple-50); color: var(--purple-700); font-weight: 600; }
.tag { color: var(--caption); background: transparent; border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; }
.project-card h3 { margin: 14px 0 6px; font-size: 16px; font-weight: 600; line-height: 1.42; }
.project-card .domain { color: var(--caption); font-size: 13px; font-weight: 500; }
.project-categories { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; }
.project-category { min-width: 0; display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 0; color: var(--gray-600); }
.project-category small { color: var(--caption); font-size: 12.5px; line-height: 1.3; }
.project-category b { color: var(--gray-700); font-size: 12.5px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.next-action { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); }
.next-action small { display: block; color: var(--purple-700); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin-bottom: 6px; }
.next-action p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.two-column, .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; }
.compact-list { display: grid; }
.compact-item { padding: 15px 0; border-bottom: 1px solid var(--line); }
.compact-item:last-child { border: 0; padding-bottom: 2px; }
.compact-item b { display: block; font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.compact-item span { font-size: 13px; color: var(--caption); }
.compact-item.clickable { cursor: pointer; }
.compact-item.clickable:hover b { color: var(--purple-700); }
.empty { padding: 30px 0; color: var(--caption); font-size: 14px; text-align: center; }

/* ---------- projects & detail ---------- */
.filter-row { display: flex; justify-content: space-between; align-items: center; margin: 30px 0 18px; gap: 20px; }
.search { flex: 1; max-width: 460px; position: relative; }
.search span { position: absolute; top: 11px; left: 14px; color: var(--gray-400); }
.search input { width: 100%; padding: 11px 13px 11px 38px; border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--surface); }
.project-hero { margin: 14px 0 16px; padding: 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.project-hero .card-meta, .project-hero h2, .project-hero > p { grid-column: 1; }
.project-hero h2 { margin: 9px 0 5px; font-size: 22px; font-weight: 600; }
.project-hero p { color: var(--ink-2); margin: 0; font-size: 15px; line-height: 1.65; }
.hero-actions { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { grid-template-columns: minmax(0, 1.55fr) minmax(250px, .65fr); }
.sticky { position: sticky; top: 18px; }
.question-list { display: grid; }
.question { padding: 17px 0; border-bottom: 1px solid var(--line); }
.question:last-child { border-bottom: 0; }
.question-top { display: flex; gap: 12px; align-items: flex-start; }
.question-id { font-size: 12.5px; font-weight: 600; background: var(--gray-100); color: var(--gray-600); border-radius: var(--pill); padding: 4px 10px; flex: 0 0 auto; }
.question p { margin: 2px 0 9px; font-size: 15px; line-height: 1.62; }
.question .question-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-left: 50px; }
.health-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.health-row:last-child { border-bottom: 0; }
.health-row b { font-size: 13px; font-weight: 600; }
.health-row b.good { color: var(--green-700); }
.health-row b.warn { color: var(--orange-700); }
.detail-asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 30px; }
.detail-asset-grid.single { grid-template-columns: 1fr; }
.asset-list { display: grid; margin-top: 8px; }
.asset-item { display: grid; grid-template-columns: 56px 1fr; gap: 13px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.asset-item:last-child { border-bottom: 0; }
.asset-item b { display: block; font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.asset-item code { color: var(--muted); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.asset-level { width: max-content; padding: 4px 10px; border-radius: var(--pill); background: var(--gray-100); color: var(--gray-600); font-size: 12.5px; font-weight: 600; }

/* ---------- project journey, history & development ---------- */
.portfolio-intro { margin: 30px 0 8px; padding-bottom: 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.portfolio-intro h2 { margin: 0; font-size: 22px; font-weight: 600; }
.portfolio-intro > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.project-scope-tabs { width: max-content; margin-top: 20px; padding: 4px; display: flex; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--gray-100); }
.project-scope-tab { min-width: 126px; padding: 9px 13px; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.project-scope-tab span { margin-left: 5px; padding: 2px 7px; border-radius: var(--pill); background: var(--gray-200); font-size: 12.5px; }
.project-scope-tab.active { background: var(--surface); color: var(--ink); box-shadow: none; }
.project-scope-tab.active span { background: var(--purple-50); color: var(--purple-700); }
.project-mini-journey { display: grid; grid-template-columns: repeat(var(--journey-parts, 3), minmax(0, 1fr)); gap: 5px; margin: 12px 0; }
.project-mini-journey span { position: relative; padding-top: 10px; border-top: 3px solid var(--gray-200); color: var(--caption); }
.project-mini-journey span.complete { border-color: var(--green-100); color: var(--green-700); }
.project-mini-journey span.current { border-color: var(--green-500); color: var(--ink); }
.project-mini-journey b, .project-mini-journey small { display: block; }
.project-mini-journey b { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.project-mini-journey small { margin-top: 3px; font-size: 12.5px; overflow-wrap: anywhere; }
.project-section-tabs { position: sticky; top: 0; z-index: 4; margin: 0 0 16px; padding: 5px; display: flex; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(249, 250, 251, .94); backdrop-filter: blur(8px); }
.project-section-tab { min-width: 105px; padding: 10px 15px; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.project-section-tab:hover { color: var(--ink); }
.project-section-tab.active { background: var(--surface); color: var(--ink); box-shadow: none; font-weight: 600; }
.project-section-panel { display: none; }
.project-section-panel.active { display: block; animation: rise .2s ease; }
.project-journey-panel { margin-bottom: 12px; padding: 18px 22px; }
.project-journey-heading { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.project-journey-heading h2 { margin: 0; font-size: 18px; font-weight: 600; }
.project-journey-parts { display: grid; grid-template-columns: repeat(var(--journey-parts, 3), minmax(0, 1fr)); margin-top: 15px; }
.project-journey-step { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 2px 20px 2px 0; color: var(--caption); }
.project-journey-step:not(:last-child)::after { content: ""; position: absolute; top: 15px; right: 5px; width: 11px; border-top: 1px solid var(--gray-300); }
.project-journey-step.current { color: var(--ink); }
.project-journey-step.complete { color: var(--green-700); }
.journey-part-number { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--gray-300); border-radius: 50%; background: var(--surface); color: var(--caption); font-size: 12.5px; font-weight: 600; }
.project-journey-step.current .journey-part-number { border-color: var(--purple-500); background: var(--purple-500); color: var(--surface); box-shadow: 0 0 0 5px var(--purple-50); }
.project-journey-step.complete .journey-part-number { border-color: var(--green-500); background: var(--green-500); color: var(--surface); }
.journey-part-copy small, .journey-part-copy b, .journey-part-copy p, .journey-part-copy em { display: block; }
.journey-part-copy small { color: inherit; font-size: 12.5px; font-weight: 600; }
.journey-part-copy b { margin-top: 2px; font-size: 14px; font-weight: 600; }
.journey-part-copy p { margin: 5px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.journey-part-copy em { margin-top: 3px; color: inherit; font-size: 12.5px; font-style: normal; font-weight: 500; }
.project-primary-grid { display: block; margin-bottom: 12px; }
.next-step-panel { padding: 22px 24px; }
.next-step-panel .eyebrow { color: var(--purple-700); }
.next-step-panel h3 { margin: 0 0 12px; font-size: 22px; font-weight: 600; }
.next-step-panel > p:not(.eyebrow) { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.next-step-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.project-overview-summary { margin-bottom: 16px; padding: 14px 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.project-overview-summary > div { min-width: 0; padding: 0 18px; border-right: 1px solid var(--line); }
.project-overview-summary > div:first-child { padding-left: 0; }
.project-overview-summary > div:last-child { padding-right: 0; border-right: 0; }
.project-overview-summary small, .project-overview-summary b { display: block; }
.project-overview-summary small { margin-bottom: 5px; color: var(--muted); font-size: 12.5px; }
.project-overview-summary b { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.meeting-history-panel { margin-bottom: 16px; padding: 22px 24px; }
.meeting-history { display: grid; max-height: 310px; overflow-y: auto; }
.meeting-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.meeting-item:last-child { border-bottom: 0; }
.meeting-marker { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--gray-100); color: var(--caption); font-size: 12.5px; }
.meeting-item.active .meeting-marker { background: var(--purple-50); color: var(--purple-700); }
.meeting-copy small, .meeting-copy b, .meeting-copy p { display: block; }
.meeting-copy small { color: var(--caption); font-size: 12.5px; }
.meeting-copy b { margin: 5px 0; font-size: 14px; font-weight: 600; }
.meeting-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.text-button.danger { color: var(--red-700); }
.related-reference-panel { margin: 16px 0 30px; }
.problem-graph-panel { margin: 16px 0 30px; }
.knowledge-guidance-panel { margin: 16px 0 30px; }
.knowledge-guidance-panel.evidence-required { border-color: var(--line); }
.knowledge-guidance-panel.ready { border-color: var(--line); }
.knowledge-readiness-progress { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.knowledge-readiness-item { padding: 12px; border-radius: var(--radius); background: var(--gray-50); }
.knowledge-readiness-item small, .knowledge-readiness-item b { display: block; }
.knowledge-readiness-item small { color: var(--muted); font-size: 12.5px; }
.knowledge-readiness-item b { margin-top: 4px; font-size: 16px; font-weight: 600; }
.knowledge-candidate-row { grid-column: 1 / -1; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.knowledge-candidate-row:hover { border-color: var(--purple-100); background: var(--purple-25); }
.knowledge-candidate-copy { display: grid; gap: 3px; }
.knowledge-candidate-copy small { color: var(--muted); font-size: 12.5px; }
.guidance-card { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--gray-25); }
.guidance-card.question { border-color: var(--purple-100); }
.guidance-card.risk { border-color: var(--orange-500); }
.guidance-card-heading, .guidance-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.guidance-card h4 { margin: 12px 0 6px; font-size: 16px; font-weight: 600; }
.guidance-risk { margin: 0; color: var(--ink-2); line-height: 1.6; }
.guidance-source { margin: 10px 0 14px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.55; }
.guidance-more { margin-top: 10px; }
.guidance-more > summary { cursor: pointer; color: var(--purple-700); font-size: 13px; font-weight: 500; }
.interview-guidance-card { display: grid; gap: 5px; margin-top: 8px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-50); }
.interview-guidance-card b { font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.interview-guidance-card small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.section-help { margin: -8px 0 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.reference-assets-heading { margin-top: 38px; }
.profile-heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.problem-summary { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 14px 0 4px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.problem-summary-card { min-width: 150px; padding: 0; border: 0; background: transparent; }
.problem-summary-card small, .problem-summary-card b, .problem-summary-card span { display: block; }
.problem-summary-card small { color: var(--muted); font-size: 12.5px; }
.problem-summary-card b { margin: 4px 0 2px; font-size: 15px; font-weight: 600; }
.problem-summary-card span { color: var(--orange-700); font-size: 12.5px; }
.problem-summary-card span.confirmed { color: var(--green-700); }
.problem-summary-card .profile-reason { margin-top: 4px; padding: 0; font-size: 12.5px; }
.problem-graph-details { margin-top: 12px; }
.problem-graph-details > summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; }
.problem-graph-details[open] > summary { color: var(--ink); }
.problem-decisions, .problem-lenses { margin-top: 18px; }
.problem-decisions h4, .problem-lenses h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.problem-decision { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.problem-decision.proposed, .problem-decision.unresolved { margin-top: 4px; padding-inline: 9px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.problem-dependency { background: var(--gray-25); }
.problem-decision b { display: block; font-size: 14px; font-weight: 600; }
.problem-decision p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.problem-lens { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; }
.problem-lens p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.current-wiki-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .65fr); gap: 16px; margin-bottom: 16px; }
.wiki-document-panel { margin: 0 0 30px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.wiki-document-panel > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 17px 20px; cursor: pointer; }
.wiki-document-panel > summary::-webkit-details-marker { display: none; }
.wiki-document-panel > summary span, .wiki-document-panel > summary b, .wiki-document-panel > summary small { display: block; }
.wiki-document-panel > summary b { font-size: 14px; font-weight: 600; }
.wiki-document-panel > summary small { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.wiki-document-panel > summary em { color: var(--purple-700); font-size: 13px; font-style: normal; font-weight: 500; }
.wiki-document-panel[open] > summary { border-bottom: 1px solid var(--line); }
.wiki-document-panel[open] > summary em { font-size: 0; }
.wiki-document-panel[open] > summary em::after { content: "접기"; font-size: 13px; }
.document-view { margin: 0; max-height: 62vh; overflow: auto; padding: 22px; background: var(--gray-25); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.65 var(--mono); }
.project-history-panel { margin-bottom: 30px; }
.project-history-layout { display: grid; grid-template-columns: minmax(220px, .38fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.project-history-list { display: grid; align-content: start; max-height: 720px; overflow-y: auto; border-right: 1px solid var(--line); padding-right: 12px; }
.history-entry { width: 100%; padding: 13px 12px; display: grid; gap: 6px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.history-entry:hover { background: var(--gray-50); }
.history-entry.active { border-color: var(--gray-300); background: var(--gray-50); }
.history-entry-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.history-entry-heading b { font-size: 14px; font-weight: 600; }
.history-entry-heading code { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.history-entry-subject { font-size: 13px; line-height: 1.5; }
.history-entry small { color: var(--muted); font-size: 12.5px; }
.project-history-detail { min-width: 0; }
.history-snapshot-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.history-snapshot-header h3 { margin: 0; font-size: 20px; font-weight: 600; }
.history-snapshot-meta { margin: 7px 0 0; color: var(--muted); font-size: 12.5px; }
.history-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.history-metric { padding: 11px; border-radius: var(--radius); background: var(--gray-50); }
.history-metric small, .history-metric b { display: block; }
.history-metric small { color: var(--muted); font-size: 12.5px; }
.history-metric b { margin-top: 5px; font-size: 14px; font-weight: 600; }
.history-part-states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 17px; }
.history-part-state { padding: 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.history-part-state b { font-size: 13px; font-weight: 500; }
.history-questions { margin: 0 0 14px; }
.history-questions h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.history-question { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.history-question > b { color: var(--purple-700); font-size: 12.5px; }
.history-question.closed { opacity: .6; }
.history-question.inactive, .question.inactive { opacity: .6; background: var(--gray-50); }
.history-document { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.history-document > summary { padding: 12px 14px; background: var(--gray-50); cursor: pointer; font-size: 13px; font-weight: 500; }
.history-document[open] > summary { border-bottom: 1px solid var(--line); }
.history-diff { min-height: 220px; max-height: 52vh; border: 0; border-radius: 0; }
.history-profile { margin: 0 0 16px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-25); }
.history-profile h4 { margin: 0 0 9px; font-size: 14px; font-weight: 600; }
.history-profile-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.development-panel { margin: 0 0 30px; }
.development-panel > .panel-heading .eyebrow { color: var(--purple-700); }
.development-part-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.development-part-tab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-50); color: var(--muted); text-align: left; cursor: pointer; }
.development-part-tab > span { font-size: 12.5px; font-weight: 500; text-transform: uppercase; }
.development-part-tab > b { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.development-part-tab > small { font-size: 12.5px; }
.development-part-tab.active { border-color: var(--gray-300); background: var(--surface); color: var(--ink); box-shadow: none; }
.development-focus { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.development-focus-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.development-focus-heading h4 { margin: 6px 0 0; font-size: 24px; font-weight: 600; }
.development-lead { margin: 12px 0 20px; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.development-stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; }
.development-step { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: start; padding: 14px 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--gray-50); color: var(--caption); }
.development-step:first-child { border-left: 1px solid var(--line); border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.development-step:last-child { border-right: 1px solid var(--line); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.development-step + .development-step { border-left: 1px solid var(--line); }
.development-step.current { background: var(--purple-25); color: var(--ink); box-shadow: inset 0 3px var(--purple-500); }
.development-step.complete { background: var(--green-50); color: var(--green-700); }
.development-step-number { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--gray-300); border-radius: 50%; background: var(--surface); font-size: 12.5px; font-weight: 600; }
.development-step.current .development-step-number { border-color: var(--purple-500); background: var(--purple-500); color: var(--surface); }
.development-step.complete .development-step-number { border-color: var(--green-500); background: var(--green-500); color: var(--surface); }
.development-step b, .development-step small { display: block; }
.development-step b { font-size: 13px; font-weight: 600; }
.development-step small { margin-top: 5px; font-size: 12.5px; line-height: 1.5; }
.development-action-area { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 17px; border-radius: var(--radius-lg); background: var(--navy); color: var(--surface); }
.development-action-area small, .development-action-area b { display: block; }
.development-action-area small { color: var(--gray-400); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.development-action-area b { margin-top: 5px; font-size: 14px; font-weight: 600; }
.development-primary-action { display: flex; gap: 8px; align-items: center; }
.development-primary-action select { min-width: 180px; border-color: var(--gray-300); background: var(--surface); font-size: 14px; }
.development-technical { margin-top: 13px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.development-technical > summary { padding: 13px 15px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.development-technical[open] > summary { border-bottom: 1px solid var(--line); }
.development-command { display: block; padding: 10px; border-radius: var(--radius); background: var(--gray-100); color: var(--ink); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.development-handoff { display: grid; gap: 8px; margin: 0; padding: 14px; }
.development-handoff > small { color: var(--muted); font-size: 12.5px; }
.development-handoff > code:not(.development-command) { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.development-handoff .development-command { white-space: pre-wrap; line-height: 1.6; }
.development-workspace-help { line-height: 1.5; }
.queue-health-panel, .build-request-panel { margin-bottom: 16px; }
.queue-health { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.queue-metric { padding: 12px; border-radius: var(--radius-lg); background: var(--gray-50); }
.queue-metric small, .queue-metric b { display: block; }
.queue-metric small { color: var(--muted); font-size: 12.5px; }
.queue-metric b { margin-top: 5px; font-size: 18px; font-weight: 600; }
.queue-next { grid-column: 1 / -1; margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.count-pill.warning { background: var(--orange-50); color: var(--orange-700); }
.build-request-list { display: grid; margin-top: 8px; }
.build-request-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.build-request-card:last-child { border-bottom: 0; }
.build-request-card b, .build-request-card small { display: block; }
.build-request-card b { font-size: 14px; font-weight: 600; }
.build-request-card small { margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.build-request-actions { display: flex; gap: 7px; }
.button.compact { padding: 8px 12px; font-size: 13px; }

.readiness-dialog { width: min(920px, calc(100vw - 40px)); }
.readiness-dialog section, .readiness-dialog details { margin: 22px 0; }
.readiness-dialog label.contract-field { display: grid; gap: 6px; margin: 12px 0; }
.readiness-dialog textarea { width: 100%; min-height: 64px; }
.dialog.document-dialog { width: min(920px, 100%); }
.document-dialog section, .document-dialog details { margin: 22px 0; }
.document-dialog label { display: grid; gap: 6px; margin: 12px 0; }
.document-dialog textarea { min-height: 64px; }
.document-edit-actions { position: sticky; top: 0; z-index: 2; padding: 12px 0; background: var(--surface); display: flex; justify-content: flex-end; }
.document-reader { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.document-reader .document-view { max-height: none; overflow: visible; padding: 10px 0; border: 0; }
.document-reader .handoff-document { min-width: 0; }
.document-workspace .panel-heading { gap: 12px; align-items: flex-start; }
.document-change { border-bottom: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere; }
.document-change p { white-space: pre-wrap; margin: 8px 0 0; }
#preview-back-button { margin: 12px 0; }
.readiness-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; line-height: 1.6; }
.readiness-check input { width: auto; flex: 0 0 auto; margin-top: 6px; }
.question-context { padding: 0 0 8px 52px; color: var(--muted); font-size: 12px; }
.question-context p { margin: 4px 0; }
#engineering-handoff { margin-top: 20px; }
.handoff-contract-section { margin: 16px 0; }
.handoff-contract-section pre { max-height: 320px; overflow: auto; white-space: pre-wrap; }
.dialog-notice { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-50); line-height: 1.6; }
.dialog-notice.error { border-color: #a12330; color: #8c1d2a; background: #fff4f4; }
[aria-invalid="true"] { outline: 2px solid #a12330; outline-offset: 2px; }
#readiness-draft-status { padding: 0 12px; border-left: 3px solid var(--purple-500); }
.handoff-document, .handoff-contract-section { min-width: 0; }
.handoff-table-scroll { max-width: 100%; overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.handoff-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; line-height: 1.6; }
.handoff-table caption { padding: 10px 14px; text-align: left; color: var(--muted); }
.handoff-table th, .handoff-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; min-width: 135px; max-width: 400px; overflow-wrap: anywhere; }
.handoff-table th { background: var(--gray-50); font-weight: 600; }
.handoff-table tr:focus { outline: 2px solid var(--purple-500); outline-offset: -2px; }
.handoff-original { margin: 12px 0; font-size: 12px; }
.handoff-evidence-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.handoff-questions { padding-left: 24px; }
.handoff-questions li { margin: 18px 0; }
.handoff-questions small { display: block; margin-top: 8px; }
.handoff-artifact-status { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- approvals & updates ---------- */
.intro-copy, .reference-intro { margin: 32px 0 24px; max-width: 720px; }
.intro-copy p, .reference-intro p:not(.eyebrow) { color: var(--ink-2); line-height: 1.72; font-size: 15px; }
.approval-list { display: grid; gap: 10px; margin-bottom: 24px; }
.approval-card { display: grid; grid-template-columns: 78px minmax(0, 1fr) minmax(180px, auto); align-items: center; gap: 18px; padding: 19px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: box-shadow .18s ease, border-color .18s ease; }
.approval-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow); }
.approval-number { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--gray-700); }
.approval-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.approval-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.approval-card .approval-review { margin-top: 5px; color: var(--ink-2); }
.approval-card .approval-changes { margin-top: 5px; color: var(--ink-2); }
.review-header { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.review-header > div { flex: 1; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.review-doc-controls { display: flex; align-items: center; gap: 12px; }
.review-doc-controls select { max-width: 260px; }
.review-document { margin: 12px 0 0; padding: 16px; max-height: 62vh; overflow: auto; background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.review-document .diff-line { display: block; }
.review-document .diff-line.added { background: var(--green-50); color: var(--green-700); }
.review-document .diff-line.removed { background: var(--red-50); color: var(--red-700); }
.review-document .diff-line.hunk { color: var(--purple-500); }
.review-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.review-chat-log { display: flex; flex-direction: column; gap: 12px; max-height: 40vh; overflow: auto; }
.review-message { padding: 12px 14px; background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius); }
.review-message.mine { background: var(--purple-50); border-color: var(--purple-100); }
.review-message p { margin: 6px 0 0; white-space: pre-wrap; }
.review-chat-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.review-decision-panel { margin-top: 18px; }
.review-comment-label { display: block; margin: 12px 0; }
@media (max-width: 1100px) { .review-layout { grid-template-columns: minmax(0, 1fr); } }
.approval-card .approval-risks { margin-top: 5px; color: var(--orange-700); }
.check-state { font-size: 12.5px; font-weight: 600; border-radius: var(--pill); padding: 6px 12px; background: var(--green-50); color: var(--green-700); white-space: nowrap; }
.check-state.pending { background: var(--orange-50); color: var(--orange-700); }
.check-state.failed { background: var(--red-50); color: var(--red-700); }
.approval-side { display: grid; justify-items: end; gap: 9px; }
.approval-link { text-decoration: none; }
.approval-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 7px; max-width: 390px; }
.approval-actions .button { padding: 8px 13px; font-size: 14px; }
.approval-explanation { flex-basis: 100%; color: var(--muted); font-size: 12.5px; line-height: 1.55; text-align: right; }
.timeline { margin-left: 6px; border-left: 1px solid var(--gray-200); }
.timeline-item { position: relative; padding: 0 0 26px 26px; }
.timeline-item::before { content: ""; position: absolute; left: -4.5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-300); border: 2px solid var(--canvas); }
.timeline-item:first-child::before { background: var(--purple-500); }
.timeline-item h3 { margin: 0 0 5px; font-size: 15px; font-weight: 500; }
.timeline-item p { margin: 0; color: var(--caption); font-size: 13px; }

.review-notification-panel { margin: 24px 0; padding: 22px; border: 1px solid var(--purple-100); border-radius: var(--radius-lg); background: var(--purple-25); }
.review-notification-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.review-notification-heading h2 { margin: 0; font-size: 20px; font-weight: 600; }
.review-notification-list { display: grid; gap: 8px; }
.review-notification { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; color: var(--ink); cursor: pointer; }
.review-notification:hover { border-color: var(--gray-300); }
.review-notification-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--purple-50); color: var(--purple-700); font-weight: 600; font-size: 13px; }
.review-notification.changes-requested .review-notification-icon { background: var(--orange-50); color: var(--orange-700); }
.review-notification-copy b, .review-notification-copy small { display: block; }
.review-notification-copy b { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.review-notification-copy small, .review-notification-reviewer { color: var(--muted); font-size: 12.5px; }

/* ---------- dialogs & forms ---------- */
.dialog-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16, 24, 40, .48); display: grid; place-items: center; padding: 24px; backdrop-filter: blur(3px); }
.dialog { width: min(580px, 100%); max-height: 90vh; overflow: auto; position: relative; background: var(--surface); border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow-modal); animation: rise .22s cubic-bezier(.2, .7, .3, 1); }
#project-dialog .dialog { width: min(820px, 100%); }
.historical-dialog { width: min(760px, 100%); }
.preview-dialog { width: min(940px, 100%); }
.dialog-close { position: absolute; right: 16px; top: 14px; border: 0; background: transparent; font-size: 23px; color: var(--gray-400); cursor: pointer; line-height: 1; padding: 4px 9px; border-radius: var(--radius); }
.dialog-close:hover { color: var(--ink); background: var(--gray-100); }
.dialog h2 { font-size: 23px; font-weight: 600; margin: 0; }
.dialog-prompt { color: var(--ink-2); line-height: 1.65; font-size: 15px; }
form { display: grid; gap: 17px; margin-top: 24px; }
form label { display: grid; gap: 8px; font-size: 14px; font-weight: 500; color: var(--gray-700); }
.field-help { color: var(--caption); font-size: 13px; font-weight: 400; line-height: 1.55; }
input, textarea, select { width: 100%; border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--surface); padding: 11px 13px; color: var(--ink); font-size: 15px; }
input::placeholder, textarea::placeholder { color: var(--gray-400); }
input[readonly] { background: var(--gray-50); color: var(--muted); font-family: var(--mono); }
textarea { min-height: 128px; resize: vertical; line-height: 1.65; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--purple-500); box-shadow: 0 0 0 3px var(--purple-50); }
.safety-note { padding: 13px 15px; background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-2); font-size: 13.5px; line-height: 1.65; }
.safety-note.warn { background: var(--red-50); border-color: var(--red-500); color: var(--red-700); }
.check-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 13px; }
.check-item { padding: 7px 13px; background: var(--green-50); color: var(--green-700); border-radius: var(--pill); font-size: 13px; font-weight: 600; }
.check-item.failed { background: var(--red-50); color: var(--red-700); }
.preview-file-summary { margin: 18px 0 12px; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-25); }
.preview-file-summary h3 { margin: 0 0 7px; font-size: 14px; font-weight: 600; }
.file-list { font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-technical-details { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.preview-technical-details summary { padding: 13px 15px; cursor: pointer; color: var(--gray-700); font-size: 14px; font-weight: 500; }
.preview-technical-details summary span { float: right; margin-left: 12px; color: var(--caption); font-family: var(--mono); font-size: 12.5px; font-weight: 400; }
.preview-technical-details[open] summary { border-bottom: 1px solid var(--line); }
.diff { min-height: 280px; max-height: 48vh; overflow: auto; white-space: pre; padding: 17px; border-radius: var(--radius); background: var(--navy); color: var(--gray-300); font-family: var(--mono); font-size: 12.5px; line-height: 1.68; }
.preview-technical-details .diff { margin: 0; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- field interview ---------- */
.interview-intro { max-width: 780px; margin: 45px auto; padding: 44px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.interview-intro h2 { margin: 0 0 16px; font-size: 30px; font-weight: 600; line-height: 1.28; letter-spacing: -.025em; }
.interview-intro > p:not(.eyebrow) { color: var(--ink-2); line-height: 1.72; font-size: 15px; }
.capture-bar { margin: 22px 0 16px; padding: 15px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-radius: var(--radius-lg); background: var(--navy); color: var(--surface); }
.capture-identity { min-width: 220px; display: flex; align-items: center; gap: 11px; }
.capture-identity b, .capture-identity small { display: block; }
.capture-identity b { font-size: 15px; font-weight: 600; }
.capture-identity small { margin-top: 4px; color: var(--gray-400); font-size: 12.5px; }
.rec-dot { width: 10px; height: 10px; border: 2px solid var(--gray-500); border-radius: 50%; flex: 0 0 auto; }
.rec-dot.recording { border-color: var(--red-500); background: var(--red-500); box-shadow: 0 0 0 5px rgba(255, 83, 69, .18); }
.capture-controls { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.capture-controls .button { border-color: rgba(255, 255, 255, .28); color: var(--surface); background: transparent; }
.capture-controls .button:hover { border-color: var(--surface); }
.capture-controls .button.primary { background: var(--surface); color: var(--navy); border-color: transparent; }
.capture-controls .button.primary:hover { background: var(--gray-100); }
.recording-upload-row { flex-basis: 100%; display: flex; align-items: center; gap: 8px; color: var(--gray-400); font-size: 12.5px; }
.recording-upload-row.warn { color: var(--orange-500); }
#capture-meta.warn { color: var(--orange-700); }
.recording-upload-row.ready { color: var(--green-500); }
/* 캡처 바는 어두운 바탕이지만 secondary 버튼은 흰 바탕이다. 글자까지 흰색으로
   덮으면 라벨이 사라져 복구 버튼을 찾을 수 없다. 바탕을 투명하게 두고 글자를
   밝게 한다. */
.recording-upload-row .button { min-height: 32px; padding: 6px 12px; background: transparent; border-color: rgba(255, 255, 255, .38); color: var(--surface); }
.recording-upload-row .button:hover { background: rgba(255, 255, 255, .12); border-color: var(--surface); color: var(--surface); }
.recording-upload-row a { text-decoration: none; }
.capture-audio { flex-basis: 100%; width: 100%; height: 34px; }
.inline-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--gray-300); }
.inline-check input, .consent-row input, .start-mode input { width: auto; flex: 0 0 auto; accent-color: var(--purple-500); }
.interview-guidance { padding: 13px 17px; border: 1px solid var(--purple-100); border-radius: var(--radius); background: var(--purple-25); color: var(--gray-700); font-size: 14px; line-height: 1.65; }
.journey-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; padding: 0; list-style: none; }
.journey-steps li { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.journey-steps li > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--gray-100); color: var(--gray-500); font-size: 12.5px; font-weight: 600; flex: 0 0 auto; }
.journey-steps b, .journey-steps small { display: block; }
.journey-steps b { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.journey-steps small { margin-top: 4px; color: var(--caption); font-size: 12.5px; line-height: 1.5; }
.journey-steps li.current { border-color: var(--purple-100); background: var(--purple-25); }
.journey-steps li.current > span { background: var(--purple-500); color: var(--surface); }
.journey-steps li.current b { color: var(--ink); font-weight: 600; }
.journey-steps li.complete > span { background: var(--green-500); color: var(--surface); }
.interview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 16px; align-items: start; }
.interview-question-panel { padding-bottom: 6px; }
.interview-notes-column { display: grid; align-content: start; gap: 16px; }
.panel-help { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.6; }
.interview-part-switcher { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 16px; }
.interview-part-tab { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-25); color: var(--ink-2); text-align: left; cursor: pointer; }
.interview-part-tab:hover { border-color: var(--gray-300); background: var(--surface); }
.interview-part-tab.current { border-color: var(--purple-100); background: var(--purple-25); box-shadow: none; }
.interview-part-tab span, .interview-part-tab b, .interview-part-tab small { display: block; overflow: hidden; text-overflow: ellipsis; }
.interview-part-tab .interview-part-number { color: var(--purple-600); font-size: 12.5px; font-weight: 600; }
.interview-part-tab b { margin-top: 3px; color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.interview-part-tab small { margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.guide-question { padding: 16px 0 18px; }
.interview-question-list { display: grid; margin-top: 14px; border-top: 1px solid var(--line); }
.interview-question-card { padding: 20px 4px 22px; transition: background .15s ease; }
.interview-question-card.answered { background: var(--green-50); box-shadow: none; }
.interview-question-card .question-top p { flex: 1; }
.question-completion { flex: 0 0 auto; margin-top: 2px; padding: 4px 9px; border-radius: var(--pill); background: var(--gray-100); color: var(--muted); font-size: 12.5px; font-weight: 500; }
.question-completion.complete { background: var(--green-50); color: var(--green-700); }
.guide-question .question-actions { margin-bottom: 10px; }
.question-context { display: grid; gap: 3px; margin: 6px 0 13px 50px; }
.question-context small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.question-note-field { margin-left: 50px; display: grid; gap: 7px; }
.question-note-label { color: var(--gray-700); font-size: 13px; font-weight: 500; }
.question-note-input { min-height: 76px; padding: 12px 13px; background: var(--gray-25); font-size: 14px; }
.question-note-status.saved { color: var(--green-700); }
.question-note-status.error { color: var(--red-700); }
.key-notes-panel textarea { min-height: 190px; margin: 10px 0 6px; background: var(--gray-25); }
.segment-list { max-height: 430px; overflow-y: auto; }
.segment-group { padding: 13px 0; border-bottom: 1px solid var(--line); }
.segment-group:last-child { border-bottom: 0; }
.segment-group small { display: block; margin-bottom: 5px; color: var(--purple-700); font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.segment-group p { margin: 0; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.transcript-group { padding: 13px 0; border-bottom: 1px solid var(--line); }
.transcript-group:last-child { border-bottom: 0; }
.transcript-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.transcript-heading b { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.transcript-heading .transcript-range { margin-left: auto; color: var(--caption); font-family: var(--mono); font-size: 12.5px; }
.transcript-heading select { width: auto; min-width: 130px; padding: 7px 28px 7px 9px; font-size: 12.5px; }
.speaker-review-row { display: grid; grid-template-columns: minmax(0, 1fr) 138px; gap: 10px; align-items: start; padding: 8px 0; }
.speaker-review-copy { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; }
.speaker-review-copy small { color: var(--purple-700); font-family: var(--mono); font-size: 12.5px; }
.speaker-review-copy p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.speaker-review-row select { padding: 8px 28px 8px 9px; font-size: 12.5px; }
.registration-panel { margin: 16px 0 0; padding: 24px 26px; display: flex; justify-content: space-between; align-items: center; gap: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.registration-panel h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.registration-panel p:not(.eyebrow) { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; line-height: 1.62; }
.registration-domain-field { display: block; max-width: 440px; margin-top: 16px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.registration-domain-field select { margin-top: 7px; background: var(--surface); }
.registration-domain-field .field-help { display: block; margin-top: 6px; font-weight: 400; }
.registration-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.interview-structure-panel, .interview-wiki-review-panel { display: grid; gap: 18px; margin-top: 16px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.structure-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.structure-heading h2 { margin: 0 0 8px; font-size: 22px; font-weight: 600; }
.structure-heading p:not(.eyebrow) { max-width: 780px; margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.structure-next { margin: 0; padding: 12px 14px; border: 1px solid var(--purple-100); border-radius: var(--radius); background: var(--purple-25); color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.interview-structure-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.structure-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-25); }
.structure-card > small { color: var(--purple-600); font-size: 12.5px; font-weight: 600; }
.structure-card h3 { margin: 8px 0; font-size: 17px; font-weight: 600; line-height: 1.45; }
.structure-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.structure-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.structure-summary-item { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.structure-summary-item small, .structure-summary-item b { display: block; }
.structure-summary-item small { color: var(--caption); font-size: 12.5px; }
.structure-summary-item b { margin-top: 4px; color: var(--ink); font-size: 14px; font-weight: 600; }
.structure-actions { display: flex; justify-content: flex-end; gap: 10px; }
.wiki-review-summary { padding: 12px 14px; border-radius: var(--radius); background: var(--gray-50); color: var(--ink-2); font-size: 14px; }
.wiki-review-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wiki-review-group, .wiki-question-review, .wiki-conflict-review { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--gray-25); }
.wiki-review-group h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.wiki-review-list { display: grid; gap: 8px; margin-top: 12px; }
.wiki-review-card { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.wiki-review-card:hover { border-color: var(--gray-300); }
.wiki-review-card input { width: auto; margin-top: 3px; flex: 0 0 auto; accent-color: var(--purple-500); }
.wiki-review-card:has(input:checked) { border-color: var(--purple-100); background: var(--purple-25); }
.wiki-review-card:has(input:disabled) { color: var(--muted); cursor: default; opacity: .72; }
.wiki-review-card-body { display: grid; gap: 5px; min-width: 0; }
.wiki-review-card-body b { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.55; }
.wiki-review-kind { color: var(--purple-700); font-size: 12.5px; font-weight: 600; }
.wiki-review-evidence { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.wiki-review-card.conflict .wiki-review-kind { color: var(--orange-700); }
.wiki-review-card.no_change .wiki-review-kind { color: var(--green-700); }
.wiki-review-more { padding-top: 6px; }
.wiki-review-more summary { color: var(--purple-700); font-size: 13px; font-weight: 500; cursor: pointer; }
.wiki-review-more .wiki-review-card { margin-top: 8px; }
.registration-state { display: inline-block; padding: 5px 11px; border-radius: var(--pill); background: var(--gray-100); color: var(--gray-500); font-size: 12.5px; font-weight: 600; }
.registration-state.ready { background: var(--green-50); color: var(--green-700); }
.registration-state.pending { background: var(--orange-50); color: var(--orange-700); }

.problem-graph-fieldset { display: grid; gap: 12px; margin: 2px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--gray-25); }
.problem-graph-fieldset legend { padding: 0 7px; color: var(--ink); font-size: 15px; font-weight: 600; }
.problem-graph-fieldset > .field-help { margin: -3px 0 3px; }
.problem-graph-fieldset.prediction-only .decision-input-card,
.problem-graph-fieldset.prediction-only > .problem-axis-heading,
.problem-graph-fieldset.prediction-only > .problem-axis-list { display: none; }
.decision-definition { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.problem-input-heading { display: grid; gap: 5px; }
.problem-input-kicker { color: var(--purple-600); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; }
.problem-input-heading h3, .problem-axis-heading h3 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 600; }
.problem-input-heading p, .problem-axis-heading p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.problem-input-heading p b { color: var(--ink-2); font-weight: 600; }
.problem-axis-heading { display: grid; gap: 5px; margin-top: 5px; padding: 16px 2px 2px; border-top: 1px solid var(--line-strong); }
.prediction-only-choice span { display: grid; gap: 3px; }
.prediction-only-choice .field-help { margin: 0; }
.decision-input-card { display: grid; gap: 9px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-25); }
.decision-number { width: max-content; padding: 4px 9px; border-radius: var(--pill); background: var(--purple-50); color: var(--purple-700); font-size: 12.5px; font-weight: 600; }
.problem-axis-list { display: grid; gap: 10px; }
.problem-axis-question { display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.problem-axis-question > legend { padding: 0 5px; color: var(--ink); font-size: 14px; font-weight: 600; }
.problem-axis-question > legend span { display: inline-grid; width: 24px; height: 24px; margin-right: 7px; place-items: center; border-radius: var(--pill); background: var(--purple-50); color: var(--purple-700); font-size: 12.5px; }
.problem-axis-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.problem-axis-options.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.problem-axis-options label { position: relative; display: block; cursor: pointer; }
.problem-axis-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.problem-axis-options label > span { display: grid; align-content: start; min-height: 76px; padding: 12px 13px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--gray-25); transition: border-color .14s ease, background .14s ease, box-shadow .14s ease; }
.problem-axis-options label:hover > span { border-color: var(--gray-400); }
.problem-axis-options input:focus-visible + span { outline: 2px solid var(--purple-500); outline-offset: 2px; }
.problem-axis-options input:checked + span { border-color: var(--purple-100); background: var(--purple-25); box-shadow: none; }
.problem-axis-options b, .problem-axis-options small { display: block; }
.problem-axis-options b { color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.problem-axis-options small { margin-top: 5px; color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.45; }
.second-decision-simple { padding-top: 3px; }
.profile-input-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.profile-input-grid label { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.profile-input-grid select { min-height: 44px; font-size: 13px; }
.problem-attribute-inputs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.problem-attribute-inputs > span { flex-basis: 100%; color: var(--gray-700); font-size: 13px; font-weight: 600; }
.problem-attribute-inputs label { display: flex; grid-template-columns: none; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.problem-attribute-inputs input { width: auto; accent-color: var(--purple-500); }
.profile-draft-summary { padding: 11px 13px; border: 1px solid var(--purple-100); border-radius: var(--radius); background: var(--purple-25); color: var(--gray-700); font-size: 13px; line-height: 1.55; }
.profile-dialog { width: min(880px, calc(100vw - 32px)); }
.profile-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.profile-editor-heading h3 { margin: 0; font-size: 15px; font-weight: 600; }
.profile-coverage { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-25); }
.profile-coverage .profile-editor-heading { margin-top: 0; }
.profile-coverage-map { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-coverage-item { min-height: 34px; padding: 6px 10px; border: 1px solid var(--gray-300); border-radius: 20px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; }
.profile-coverage-item.confirmed { border-color: var(--green-100); background: var(--green-50); color: var(--green-700); }
.profile-coverage-item.proposed { border-color: var(--purple-100); background: var(--purple-25); color: var(--purple-700); }
.profile-coverage-item.unresolved { border-style: dashed; color: var(--muted); }
.profile-coverage-item.not-applicable { border-color: var(--line); background: var(--gray-100); color: var(--muted); }
.profile-editor-list { display: grid; gap: 10px; }
.profile-editor-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-25); }
.profile-origin-target { outline: 2px solid var(--purple-500); outline-offset: 3px; }
.development-problem-handoff { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--gray-25); }
.development-problem-handoff-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.development-problem-handoff-heading div { display: grid; gap: 3px; }
.development-problem-handoff-heading small { color: var(--purple-700); font-size: 12.5px; font-weight: 500; letter-spacing: .08em; }
.development-problem-handoff-heading b { font-size: 15px; font-weight: 600; }
.development-problem-handoff-help { margin: 0; color: var(--ink-2); font-size: 13px; }
.development-problem-role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.development-problem-role { display: grid; align-content: start; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.development-problem-role > b { font-size: 13px; font-weight: 600; }
.development-problem-role > small, .development-problem-role > p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.development-problem-role ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.development-problem-role li { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 13px; }
.profile-editor-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profile-editor-card-heading b { font-size: 13px; font-weight: 600; }
.profile-editor-evaluations { display: grid; gap: 8px; }
.profile-editor-evaluation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 8px; }
.profile-editor-dependency { display: grid; grid-template-columns: 1fr auto 1fr 1fr auto; align-items: end; gap: 8px; }
.profile-editor-arrow { padding-bottom: 13px; color: var(--caption); }
.profile-editor-commitment { display: grid; gap: 9px; margin: 2px 0; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.profile-editor-commitment legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.profile-commitment-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-bulk-confirm { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.profile-bulk-confirm input { width: auto; margin-top: 2px; accent-color: var(--purple-500); }
.profile-editor-attributes { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 6px 0 0; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); }
.profile-editor-attributes legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.profile-editor-attributes label { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.profile-editor-attributes input { width: auto; accent-color: var(--purple-500); }

.start-mode-fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.start-mode-fieldset legend { margin-bottom: 8px; color: var(--gray-700); font-size: 14px; font-weight: 500; }
.start-mode { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .14s ease, background .14s ease; }
.start-mode:hover { border-color: var(--gray-400); }
.start-mode:has(input:checked) { border-color: var(--purple-500); background: var(--purple-25); }
.start-mode span, .start-mode b, .start-mode small { display: block; }
.start-mode b { font-size: 14.5px; font-weight: 500; line-height: 1.42; }
.start-mode small { margin-top: 5px; color: var(--muted); font-weight: 400; line-height: 1.5; font-size: 12.5px; }
.mode-panel { display: grid; gap: 13px; padding: 15px; border-radius: var(--radius); background: var(--gray-25); border: 1px solid var(--line); }
.consent-row { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; line-height: 1.55; font-weight: 400; color: var(--ink); font-size: 14px; }
.upload-box { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px dashed var(--gray-300); border-radius: var(--radius); background: var(--gray-25); }
.upload-box input { width: auto; padding: 0; border: 0; background: transparent; font-size: 13px; }
.upload-box b, .upload-box small { display: block; }
.upload-box b { font-size: 14px; font-weight: 500; }
.upload-box small { margin-top: 5px; color: var(--caption); font-weight: 400; font-size: 12.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .project-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interview-grid { grid-template-columns: 1fr; }
  .interview-structure-grid { grid-template-columns: 1fr; }
  .wiki-review-groups { grid-template-columns: 1fr; }
  .journey-steps { grid-template-columns: 1fr; }
  main { padding-inline: 26px; }
  .project-primary-grid { grid-template-columns: 1fr; }
  .project-history-layout { grid-template-columns: 1fr; }
  .project-history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 310px; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; gap: 4px; }
  .sidebar-note, .profile, .brand small { display: none; }
  .brand { padding-bottom: 10px; }
  .nav-item { width: 100%; min-width: 0; justify-content: center; gap: 4px; padding: 9px 3px; white-space: nowrap; font-size: 12.5px; }
  .nav-item span { width: auto; font-size: 13px; }
  .nav-item em { display: none; }
  main { padding: 0 16px 56px; }
  .topbar { min-height: 84px; flex-wrap: wrap; padding: 12px 0; gap: 10px; }
  .top-actions { flex-wrap: wrap; }
  .top-actions #refresh-button { display: none; }
  .mission-panel, .two-column, .detail-grid, .detail-asset-grid, .project-primary-grid, .current-wiki-grid, .problem-summary, .profile-input-grid { grid-template-columns: 1fr; }
  .development-stepper, .queue-health { grid-template-columns: 1fr; }
  .development-part-switcher { grid-template-columns: 1fr; }
  .development-focus { padding: 16px; }
  .development-focus-heading { align-items: flex-start; flex-direction: column; }
  .development-step { border: 1px solid var(--line); border-radius: 0; }
  .development-step:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .development-step:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .development-action-area, .development-primary-action { align-items: stretch; flex-direction: column; }
  .development-action-area .button, .development-primary-action select { width: 100%; }
  .mission-panel { padding: 28px 22px 22px; }
  .project-grid, .project-grid.wide { grid-template-columns: 1fr; }
  .portfolio-intro, .project-journey-heading { align-items: flex-start; flex-direction: column; }
  .project-scope-tabs { width: 100%; }
  .project-scope-tab { flex: 1; min-width: 0; }
  .project-section-tabs { overflow-x: auto; }
  .project-section-tab { flex: 0 0 auto; min-width: 92px; }
  .project-hero { display: block; padding: 18px; }
  .hero-actions { margin-top: 14px; }
  .project-overview-summary { grid-template-columns: 1fr; }
  .project-overview-summary > div { padding: 10px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-overview-summary > div:first-child { padding-top: 0; }
  .project-overview-summary > div:last-child { padding-bottom: 0; border-bottom: 0; }
  .project-journey-parts { grid-template-columns: 1fr; gap: 16px; }
  .project-journey-step:not(:last-child)::after { top: auto; bottom: -9px; left: 17px; width: 1px; height: 12px; border-top: 0; border-left: 1px solid var(--gray-300); }
  .approval-card { grid-template-columns: 62px 1fr; }
  .approval-side { grid-column: 2; justify-items: start; }
  .approval-actions { justify-content: flex-start; }
  .approval-explanation { text-align: left; }
  .build-request-card { align-items: flex-start; flex-direction: column; }
  .build-request-actions { width: 100%; }
  .capture-controls { margin-left: 0; }
  .interview-part-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-context, .question-note-field { margin-left: 0; }
  .interview-question-card .question-top { flex-wrap: wrap; }
  .interview-question-card .question-top p { flex-basis: calc(100% - 60px); }
  .question-completion { margin-left: 48px; }
  .start-mode-fieldset { grid-template-columns: 1fr; }
  .problem-axis-options, .problem-axis-options.three { grid-template-columns: 1fr; }
  .profile-editor-evaluation, .profile-editor-dependency, .profile-commitment-fields, .development-problem-role-grid { grid-template-columns: 1fr; }
  .profile-editor-arrow { display: none; }
  .project-history-list, .history-summary-grid, .history-part-states { grid-template-columns: 1fr; }
  .registration-panel { align-items: stretch; flex-direction: column; }
  .registration-actions, .structure-actions { align-items: stretch; flex-direction: column-reverse; }
  .interview-intro { padding: 30px 22px; margin: 24px auto; }
  .dialog { padding: 28px 20px; }
}
.bundle-file-list { max-height: 15rem; overflow: auto; }
.bundle-file-list label { overflow-wrap: anywhere; }
.case-search-controls { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin: 20px 0; }
.case-search-controls label { display: grid; gap: 6px; min-width: 0; }
.case-search-controls input, .case-search-controls select { width: 100%; min-width: 0; }
.case-search-source, .case-search-excerpt { overflow-wrap: anywhere; }
.case-match { display: grid; gap: 5px; width: 100%; padding: 12px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); cursor: pointer; }
.case-match span, .case-match small { color: var(--muted); overflow-wrap: anywhere; }
.case-note { border-top: 1px solid var(--line); padding: 14px 0; }
.case-note summary { cursor: pointer; margin-bottom: 10px; }
.case-note p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 14px; }
@media (max-width: 700px) { .case-search-controls { grid-template-columns: 1fr; } }

/* Loading is distinct from an empty portfolio; keep existing content during refresh. */
.load-status { margin: 12px 0; color: var(--muted); }
.loading-message { display: flex; align-items: center; gap: 10px; padding: 16px 0; grid-column: 1 / -1; }
.loading-spinner { width: 18px; height: 18px; border: 2px solid #e4e2ed; border-top-color: #8062e8; border-radius: 50%; animation: loading-spin .8s linear infinite; flex-shrink: 0; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation: none; } }
