@font-face {
  font-family: "Pretendard Variable";
  font-style: normal;
  font-weight: 45 920;
  font-display: swap;
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2");
}

:root {
  --font-sans: "Pretendard Variable", "Noto Sans KR", "Noto Sans", sans-serif;
  --product-bg: #ffffff;
  --product-surface: #f7f8f9;
  --product-soft: #f6f9fc;
  --product-rule: #e5e7e9;
  --product-rule-strong: #d1dbdf;
  --product-ink: #20272b;
  --product-ink-soft: #48535a;
  --product-muted: #55626a;
  --product-meta: #6a7a84;
  --product-dim: #8a969d;
  --product-blue: #49b3ef;
  --product-blue-dark: #1688cf;
  --product-blue-soft: #e9f6fd;
  --product-red: #f25352;
  --product-amber: #f59e0b;
  --product-green: #10b981;
  --product-red-soft: #fef2f2;
  --product-amber-soft: #fffbeb;
  --product-green-soft: #ecfdf5;
  /* PoC 판정 배너 (T2) — 풀폭 solid 판정면 전용. 기존 sev 램프(red/amber/green)는
     white 배경 위 텍스트·칩용이라 채도가 얕음 → 배너는 white 텍스트를 얹는
     진한 "strong" 램프를 별도 정의 (주문구 24px+ bold 기준 고대비). */
  --product-red-strong: #c02b36;
  --product-amber-strong: #b45309;
  --product-green-strong: #0e7f56;
  --product-gray-strong: #4b5860;
  --product-on-strong: #ffffff;
  --product-on-strong-dim: rgba(255, 255, 255, 0.85);
  --product-on-strong-chip: rgba(255, 255, 255, 0.16);
  --product-thumb-bg: #0f1419;
  --product-shadow-pop: 0 12px 32px rgba(32, 39, 43, 0.12);
  --product-shadow-canvas: 0 2px 8px rgba(0, 0, 0, 0.04), 0 24px 80px rgba(32, 39, 43, 0.08);
  --right-w: 640px;
}

html,
body.product-app {
  overflow: hidden;
  background: var(--product-bg);
}

.product-app {
  font-family: var(--font-sans);
  color: var(--product-ink);
}

.product-app button,
.product-app input {
  font: inherit;
}

.app-layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
  background: var(--product-bg);
}

.nav-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 280px;
  min-width: 280px;
  height: 100vh;
  padding: 48px 0;
  background: var(--product-surface);
  border-right: 1px solid var(--product-rule);
  overflow-y: auto;
}

.nav-menu-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.nav-item,
.nav-doc-item {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-item {
  padding: 8px 24px;
}

.nav-doc-item {
  padding: 4px 24px;
}

.nav-item-inner,
.nav-doc-inner,
.nav-section-inner {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  color: var(--product-muted);
}

.nav-doc-inner {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.nav-item.active .nav-item-inner,
.nav-doc-item.active .nav-doc-inner,
.nav-item:hover .nav-item-inner,
.nav-doc-item:hover .nav-doc-inner {
  background: #ffffff;
}

.nav-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--product-rule-strong);
}

.nav-item-icon svg {
  width: 24px;
  height: 24px;
}

.nav-item-label,
.nav-doc-label {
  font-size: 16px;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-muted);
}

.nav-doc-label {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-doc-meta,
.nav-empty {
  font-size: 12px;
  line-height: 1.4;
  color: var(--product-dim);
  letter-spacing: -0.03em;
}

.nav-empty {
  padding: 8px 32px;
}

.nav-section {
  padding: 8px 24px;
}

.nav-section-inner {
  justify-content: space-between;
  padding: 8px;
}

.nav-section-label,
.nav-section-count {
  font-size: 14px;
  color: var(--product-meta);
  letter-spacing: -0.04em;
}

.main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

/* ── 단계 헤더 (2026-07 헤더 재구성) ──────────────────────────────────
   구 top-header(사례번호/복사/아바타) 자리 — 대시보드 최상단 얇은 바로
   로딩 4단계를 완료(✓) 상태로 요약. 진행 애니메이션은 로딩 뷰 담당.
   사례번호·복사는 "분석 정보" 카드(risk-case)로 이동. */
.analysis-steps {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
  min-height: 46px;
  padding: 8px 32px;
  background: var(--product-bg);
  border-bottom: 1px solid var(--product-rule);
  overflow-x: auto;
}

.analysis-steps:empty {
  display: none;
}

.astep {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--product-ink-soft);
  white-space: nowrap;
}

.astep__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--product-rule-strong);
  border-radius: 50%;
  flex: none;
}

.astep.is-done .astep__dot {
  border-color: var(--product-blue);
  background: var(--product-blue);
}

.astep.is-done .astep__dot::after {
  content: "✓";
  color: var(--product-on-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.astep-line {
  flex: none;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: var(--product-blue);
}

.astep-elapsed {
  margin-left: auto;
  flex: none;
  padding-left: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--product-muted);
}

/* ── 포털 셸 (T4) — 2줄 헤더: 브랜드 row + 서비스 탭 row ──
   body 를 column flex 로 바꿔 포털 헤더 아래에 기존 app-layout 이 남은
   높이를 채우게 함. nav-sidebar/main-content 의 100vh 는 stretch 로 대체. */

body.product-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.portal-header {
  flex-shrink: 0;
  background: var(--product-bg);
}

.app-layout {
  flex: 1;
  min-height: 0;
}

.nav-sidebar,
.main-content {
  height: auto;
}

.portal-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--product-rule);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.portal-brand img {
  width: 105px;
  height: 28px;
  display: block;
}

.portal-brand-sub {
  padding-left: 14px;
  border-left: 1px solid var(--product-rule-strong);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--product-ink-soft);
}

.portal-session {
  padding: 5px 14px;
  border: 1px solid var(--product-rule);
  border-radius: 999px;
  background: var(--product-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--product-muted);
}

.portal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  background: var(--product-surface);
  border-bottom: 1px solid var(--product-rule);
}

.portal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px 11px;
  border: 0;
  background: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--product-ink-soft);
  cursor: pointer;
  text-decoration: none;
}

.portal-tab:hover {
  color: var(--product-ink);
}

.portal-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--product-blue);
  border-radius: 4px;
}

.portal-tab.is-active {
  color: var(--product-blue-dark);
  border-bottom-color: var(--product-blue);
  font-weight: 700;
}

.portal-tab.is-disabled {
  color: var(--product-dim);
  cursor: default;
  font-weight: 500;
}

.portal-tab.is-disabled:hover {
  color: var(--product-dim);
}

.portal-tab__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--product-rule-strong);
  flex: none;
}

.portal-tab__dot--red {
  background: var(--product-red);
}

.portal-tab__dot--blue {
  background: var(--product-blue);
}

.portal-tab__badge {
  padding: 2px 8px;
  border: 1px solid var(--product-rule);
  border-radius: 999px;
  background: var(--product-bg);
  font-size: 11px;
  font-weight: 700;
  color: var(--product-meta);
}

.upload-view {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 72px;
}

.upload-view.is-hidden {
  display: none;
}

.center-wrapper {
  width: min(916px, 100%);
}

.title-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-bottom: 48px;
  text-align: center;
}

.title-main {
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 760;
  line-height: 1.44;
  letter-spacing: -0.055em;
  color: var(--product-ink);
}

.title-sub {
  max-width: 620px;
  font-size: clamp(17px, 2.4vw, 24px);
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.035em;
  color: var(--product-ink-soft);
}

.upload-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 384px;
  width: 100%;
  gap: 18px;
  padding: 72px 24px;
  background: var(--product-soft);
  border: 2px dashed transparent;
  border-radius: 8px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  cursor: pointer;
}

.upload-area:hover,
.upload-area.is-dragover {
  background: var(--product-blue-soft);
  border-color: var(--product-blue);
}

.upload-area.has-file {
  background: var(--product-blue-soft);
  border-color: var(--product-blue);
}

.upload-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  color: var(--product-blue);
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--product-blue);
}

.upload-mark svg {
  width: 28px;
  height: 28px;
}

.upload-text {
  font-size: 18px;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink-soft);
}

.upload-formats {
  font-size: 14px;
  line-height: 1.44;
  letter-spacing: -0.03em;
  color: var(--product-meta);
}

.btn-file-select {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 48px;
  margin: 24px auto 0;
  border: 0;
  border-radius: 8px;
  background: var(--product-blue);
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn-file-select:disabled {
  cursor: not-allowed;
  background: var(--product-rule-strong);
}

.loading-view {
  display: flex;
  flex: 1;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #ffffff;
}

.loading-view[hidden] {
  display: none !important;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--product-blue-soft);
  border-top-color: var(--product-blue);
  border-radius: 50%;
  animation: product-spin 900ms linear infinite;
}

@keyframes product-spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--product-ink);
  letter-spacing: -0.04em;
}

.loading-sub,
.loading-time {
  font-size: 14px;
  color: var(--product-meta);
  letter-spacing: -0.04em;
}

.loading-progress {
  width: 280px;
  height: 6px;
  background: var(--product-surface);
  border-radius: 999px;
  overflow: hidden;
}

.loading-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--product-blue);
  border-radius: inherit;
  transition: width 240ms ease-out;
}

.dashboard {
  display: none;
}

.dashboard.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.dashboard-main {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── PoC 판정 배너 (T2) ────────────────────────────────────────────────
   대시보드 최상단 풀폭 solid 판정면. 판정의 단일 원천 — 우측 패널의
   risk-card 는 "분석 정보" 카드로 축소됨. 색은 --product-*-strong 램프만. */
.verdict-banner {
  display: flex;
  align-items: center;
  flex: none;
  gap: 20px;
  min-height: 92px;
  padding: 20px 32px;
  background: var(--product-gray-strong);
  color: var(--product-on-strong);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 360ms cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 360ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

.verdict-banner:empty {
  display: none;
}

.verdict-banner.is-shown {
  opacity: 1;
  transform: none;
}

.verdict-banner[data-state="danger"] { background: var(--product-red-strong); }
.verdict-banner[data-state="caution"] { background: var(--product-amber-strong); }
.verdict-banner[data-state="clear"] { background: var(--product-green-strong); }
.verdict-banner[data-state="unreadable"] { background: var(--product-gray-strong); }

.verdict-banner__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--product-on-strong-chip);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.verdict-banner__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.verdict-banner__main {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.verdict-banner__sub {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--product-on-strong-dim);
}

.verdict-banner__confidence {
  flex: none;
  margin-left: auto;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--product-on-strong-chip);
  text-align: right;
}

.verdict-banner__confidence-num {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
}

.verdict-banner__confidence-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--product-on-strong-dim);
}

/* 분석 정보 카드 — 구 verdict seal(risk-card) 축소형. 판정 표시 없음. */
.risk-card--meta {
  gap: 12px;
  padding: 16px 0;
}

.risk-card--meta .risk-card-header {
  padding-bottom: 12px;
}

.risk-card--meta .risk-card-header h3 {
  font-size: 16px;
}

/* ── PoC 판정 근거 리스트 (T3) ─────────────────────────────────────────
   plain-findings.js 가 렌더. results-panel 최상단 — 평이한 한국어 top-5,
   번호 뱃지가 캔버스 ①② 마크와 1:1 매칭. 시연 타깃: 헤드라인 16px+ 고대비. */
.plain-findings {
  width: calc(100% - 48px);
  margin: 0 24px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: var(--product-bg);
}

.plain-findings:empty {
  display: none;
}

.plain-findings__head {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--product-rule);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--product-ink);
}

.plain-findings__list {
  list-style: none;
  margin: 0;
  padding: 6px 12px 10px;
}

.plain-findings__list li + li {
  border-top: 1px dashed var(--product-rule);
}

.plain-findings__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 14px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: default;
}

.plain-findings__item.is-focusable {
  cursor: pointer;
}

.plain-findings__item.is-focusable:hover {
  background: var(--product-soft);
}

.plain-findings__item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--product-blue);
}

.plain-findings__no {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--product-red);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.plain-findings__no--info {
  background: var(--product-dim);
}

.plain-findings__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.plain-findings__title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--product-ink);
}

.plain-findings__detail {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--product-ink-soft);
}

.plain-findings__conf {
  flex: none;
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--product-red-soft);
  color: var(--product-red-strong);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  height: fit-content;
}

.plain-findings__conf--na {
  background: var(--product-surface);
  color: var(--product-meta);
  font-family: var(--font-sans);
}

.plain-findings__clear {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--product-ink);
}

.plain-findings__clear-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--product-green-soft);
  color: var(--product-green);
  font-weight: 800;
}

/* ── 전문 분석 상세 — report-card 접이식 격하 (T3) ───────────────────
   기본 접힘. summary 가 카드 헤더 역할. */
details.report-collapse {
  padding-top: 0;
}

details.report-collapse > summary {
  list-style: none;
}

details.report-collapse > summary::-webkit-details-marker {
  display: none;
}

.report-collapse__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--product-muted);
}

.report-collapse__summary:hover {
  color: var(--product-ink);
}

.report-collapse__summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--product-blue);
  border-radius: 8px;
}

.report-collapse__chev {
  font-size: 16px;
  line-height: 1;
  color: var(--product-dim);
  transition: transform 120ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

details.report-collapse[open] .report-collapse__chev {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .verdict-banner {
    transition: none;
    transform: none;
  }
}

.doc-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  background: var(--product-surface);
}

.app-controls-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 12px;
  min-height: 64px;
  padding: 12px 40px;
  background: #ffffff;
  border-bottom: 1px solid var(--product-rule);
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.app-controls-bar.is-collapsed {
  display: none;
}

/* "보기 도구" 토글 — doc-pager 우측, controlsBar(아래 도구 바) 개폐. */
.controls-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  margin-left: auto;
  margin-right: 16px;
  padding: 0 12px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: var(--product-bg);
  color: var(--product-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}

.controls-toggle:hover {
  border-color: var(--product-rule-strong);
  color: var(--product-ink);
}

.controls-toggle.is-open {
  border-color: var(--product-blue);
  background: var(--product-blue-soft);
  color: var(--product-blue-dark);
}

.controls-toggle__caret {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease-out;
}

.controls-toggle.is-open .controls-toggle__caret {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .controls-toggle__caret {
    transition: none;
  }
}

@media (max-width: 900px) {
  .app-controls-bar .ctrl-group__label {
    display: none;
  }
  .app-controls-bar {
    padding: 12px 20px;
  }
}

.canvas-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.ctrl-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.doc-pager-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ctrl-group__label,
.ctrl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--product-dim);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.ctrl-sep {
  width: 1px;
  height: 20px;
  color: transparent;
  background: var(--product-rule);
  flex-shrink: 0;
}

.mode-tabs,
.filter-pills,
.filter-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.filter-select-wrap {
  position: relative;
  display: inline-flex;
}

.filter-select {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 32px;
  min-width: 110px;
  max-width: 130px;
  padding: 0 10px;
  border: 1px solid var(--product-rule);
  border-radius: 7px;
  background: #ffffff;
  color: var(--product-meta);
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.filter-select.is-active {
  color: var(--product-muted);
}

.filter-select.is-open {
  border-color: var(--product-blue);
}

.filter-select__label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.filter-select__caret {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  box-shadow: var(--product-shadow-pop);
  z-index: 30;
}

.filter-menu[hidden] {
  display: none;
}

.filter-menu__item {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.04em;
  color: var(--product-meta);
  white-space: nowrap;
}

.filter-menu__item:hover {
  background: var(--product-soft);
}

.filter-menu__item.is-selected {
  background: var(--product-blue-soft);
  color: var(--product-blue-dark);
}

.mode-tab,
.filter-pill,
.ctrl-toggle,
.ctrl-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--product-meta);
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.mode-tab {
  padding: 0 10px;
  background: var(--product-soft);
}

.mode-tab__num {
  display: none;
}

.mode-tab.is-active,
.filter-pill.is-active,
.ctrl-toggle.is-active {
  background: #ffffff;
  border-color: var(--product-rule);
  color: var(--product-muted);
}

.filter-pill {
  padding: 0 10px;
  border-color: var(--product-rule);
  color: var(--product-dim);
}

.ctrl-readout {
  min-width: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--product-muted);
  text-align: right;
}

.ctrl-icon {
  width: 16px;
  height: 16px;
}

.ctrl-icon-btn {
  width: 32px;
  border-color: var(--product-rule);
  background: #ffffff;
}

.opacity-control {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: #ffffff;
  flex-shrink: 0;
}

.opacity-control label {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-meta);
}

.opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  border-radius: 999px;
  background: var(--product-rule);
  outline: none;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--product-blue);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--product-blue);
}

.opacity-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--product-blue);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--product-blue);
}

.opacity-value {
  min-width: 36px;
  text-align: right;
  font-weight: 500;
  font-size: 14px;
  color: var(--product-ink-soft);
  letter-spacing: -0.04em;
}

.doc-pager {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 40px;
  background: #ffffff;
  flex-shrink: 0;
}

.doc-pager-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.doc-pager-meta {
  min-width: 0;
  overflow: hidden;
}

/* 좁은 폭에서 파일명이 우선 — 페이지 메타가 먼저 줄어든다. */
.pager-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--product-ink-soft);
  letter-spacing: -0.04em;
  flex: none;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pager-meta {
  font-size: 13px;
  color: var(--product-dim);
  letter-spacing: -0.03em;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-canvas {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
  padding: 72px 96px;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(32, 39, 43, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 39, 43, 0.035) 1px, transparent 1px),
    var(--product-surface);
  background-size: 32px 32px;
}

.doc-canvas canvas {
  display: block;
  background: #ffffff;
  box-shadow: var(--product-shadow-canvas);
}

.doc-canvas.is-missing-image::after {
  content: "저장된 원본 이미지가 없습니다";
  color: var(--product-dim);
}

.results-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
  width: var(--right-w);
  min-width: var(--right-w);
  padding: 40px 0;
  background: #ffffff;
  border-left: 1px solid var(--product-rule);
  overflow-y: auto;
}

.results-heading {
  padding: 0 24px;
  width: 100%;
}

.results-heading h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.44;
  color: var(--product-ink);
  letter-spacing: -0.04em;
}

.results-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.risk-card,
.report-card {
  width: calc(100% - 48px);
  margin: 0 24px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: #ffffff;
}

.risk-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 0;
}

.risk-card-header,
.report-card-header {
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--product-rule);
}

.risk-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.risk-card-header h3,
.report-card-header h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.44;
  color: var(--product-ink);
  letter-spacing: -0.04em;
}

.risk-card-doctype {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.risk-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 24px;
}

.risk-percent {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-red);
}

.risk-card[data-severity="medium"] .risk-percent {
  color: var(--product-amber);
}

.risk-card[data-severity="low"] .risk-percent,
.risk-card[data-severity="clear"] .risk-percent {
  color: var(--product-green);
}

.risk-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.risk-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink);
}

/* §X3 내용 일관성 게이지 — risk-percent 와 같은 색 방향(높을수록 모순). */
.semantic-gauge {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 4px 16px;
}

.semantic-gauge__pct {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: var(--product-green);
}

.semantic-gauge[data-severity="high"] .semantic-gauge__pct {
  color: var(--product-red);
}

.semantic-gauge[data-severity="medium"] .semantic-gauge__pct {
  color: var(--product-amber);
}

.semantic-gauge__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.semantic-gauge__verdict {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--product-ink);
}

.semantic-gauge__sub {
  font-size: 12px;
  color: var(--product-muted, #6b7680);
}

.semantic-vs {
  color: var(--product-muted, #6b7680);
  padding: 0 4px;
}

.risk-sub {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.44;
  color: var(--product-ink-soft);
  letter-spacing: -0.04em;
}

/* 사례번호 행 — 구 top-header 에서 이동 (2026-07). 행 전체 클릭 → 복사. */
.risk-case {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 4px 10px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: var(--product-bg);
  cursor: pointer;
}

.risk-case:hover {
  border-color: var(--product-rule-strong);
}

.risk-case__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--product-meta);
}

.risk-case__value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--product-ink-soft);
}

.doc-type-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 10px;
  border: 1px solid var(--product-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--product-ink-soft);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-type-strip__label {
  color: var(--product-dim);
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.doc-type-strip__name {
  color: var(--product-ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-type-strip__conf {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--product-blue-dark);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.doc-type-strip__conf[data-state="unknown"] {
  background: transparent;
  color: var(--product-dim);
}

.report-card {
  display: flex;
  flex-direction: column;
  padding-top: 24px;
}

.rpt-tabs {
  display: flex;
  width: 100%;
  border-bottom: 1px solid var(--product-rule);
}

.rpt-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rpt-tab:first-child {
  padding-left: 24px;
}

.rpt-tab-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 0 12px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--product-dim);
  letter-spacing: -0.04em;
  transition: color 160ms ease, border-color 160ms ease;
}

.rpt-tab:hover .rpt-tab-inner {
  color: var(--product-meta);
}

.rpt-tab.active .rpt-tab-inner {
  margin-bottom: -1px;
  border-bottom-color: var(--product-blue);
  color: var(--product-blue);
  font-weight: 600;
}

.report-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
}

.verify-tab-view,
.report-tab-view {
  display: none;
}

.verify-tab-view.active,
.report-tab-view.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.verify-tabs-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--product-rule);
}

.verify-selector {
  position: relative;
  width: 100%;
}

.verify-selector__trigger,
.verify-selector__option {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--product-rule);
  background: #ffffff;
  color: var(--product-ink-soft);
  cursor: pointer;
  letter-spacing: -0.04em;
}

.verify-selector__trigger {
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 18px;
}

.verify-selector__current {
  display: flex;
  align-items: center;
  gap: 8px;
}

.verify-selector__chev {
  color: var(--product-muted);
  transition: transform 160ms ease;
}

.verify-selector.is-open .verify-selector__chev {
  transform: rotate(180deg);
}

.verify-selector__menu {
  position: absolute;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 2px;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--product-shadow-pop);
}

.verify-selector.is-open .verify-selector__menu {
  display: flex;
}

.verify-selector__option {
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  font-size: 15px;
}

.verify-selector__option:hover,
.verify-selector__option.is-active {
  background: var(--product-soft);
  color: var(--product-ink);
}

.verify-selector__name {
  flex: 1;
  text-align: left;
}

.findings-strip-wrap {
  position: relative;
  width: 100%;
  display: none;
}

.findings-strip-wrap::before,
.findings-strip-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: 2;
}

.findings-strip-wrap::before {
  left: 0;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

.findings-strip-wrap::after {
  right: 0;
  background: linear-gradient(270deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

.findings-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 2px 18px 4px;
  background: transparent;
  border: 0;
  scrollbar-width: none;
}

.findings-strip::-webkit-scrollbar {
  display: none;
}

.findings-chip {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--product-rule);
  border-radius: 999px;
  background: #ffffff;
  color: var(--product-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.findings-chip:hover {
  background: var(--product-soft);
}

.findings-chip.is-active {
  border-color: var(--product-ink);
  background: var(--product-ink);
  color: #ffffff;
  box-shadow: none;
}

.findings-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--product-green);
  flex-shrink: 0;
}

.findings-chip[data-severity="high"] .findings-chip__dot,
.verify-selector__option[data-severity="high"] .findings-chip__dot,
.findings-chip__dot[data-severity="high"] {
  background: var(--product-red);
}

.findings-chip[data-severity="med"] .findings-chip__dot,
.verify-selector__option[data-severity="med"] .findings-chip__dot,
.findings-chip__dot[data-severity="med"] {
  background: var(--product-amber);
}

.findings-chip[data-severity="info"] .findings-chip__dot,
.verify-selector__option[data-severity="info"] .findings-chip__dot,
.findings-chip__dot[data-severity="info"] {
  background: var(--product-rule-strong);
}

.findings-chip__count {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--product-surface);
  color: var(--product-ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.findings-chip.is-active .findings-chip__count {
  background: #ffffff;
  color: var(--product-red);
}

.detail-pane {
  display: block;
  flex: none;
  min-height: 0;
  overflow: visible;
  background: transparent;
  border-top: 0;
}

.detail-pane__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--product-rule);
}

.detail-pane__section {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--product-blue-dark);
}

.detail-pane__name {
  font-size: 18px;
  font-weight: 720;
  color: var(--product-ink);
  letter-spacing: -0.04em;
}

.detail-pane__body {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0 0;
  overflow: visible;
  background: transparent;
}

.e-item,
.panel-hint,
.panel-empty {
  border-radius: 8px;
  border: 1px solid transparent;
  background: #ffffff;
}

.report-card-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-radius: 8px;
  background: #ffffff;
}

.report-card-item.shaded {
  background: var(--product-soft);
}

.report-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 9999px;
}

.report-card-icon.success {
  background: var(--product-green-soft);
}

.report-card-icon.danger {
  background: var(--product-red-soft);
}

.report-card-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.report-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink);
}

.report-card-sub {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink-soft);
}

/* detail-pane 내 e-item → report-card-item 룩 (§4.1 redesign).
   --meta/--ref 는 summary/grid 변형이므로 원래 레이아웃 유지. */
.detail-pane__body .e-item:not(.e-item--meta):not(.e-item--ref) {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-auto-rows: auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 6px;
  margin: 0;
  padding: 16px 4px;
  border: 0;
  border-bottom: 1px solid var(--product-rule);
  border-radius: 0;
  background: transparent;
  color: var(--product-ink);
}

.detail-pane__body .e-item:not(.e-item--meta):not(.e-item--ref):last-child {
  border-bottom: 0;
}

.detail-pane__body .e-item:not(.e-item--meta):not(.e-item--ref)::before {
  content: "";
  position: static;
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 9999px;
  background-color: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><circle cx='12' cy='12' r='10' fill='%2310B981'/><path d='M7.5 12.5L10.5 15.5L16.5 9.5' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
  pointer-events: none;
}

.detail-pane__body .e-item--suspicious::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><circle cx='12' cy='12' r='10' fill='%23F25352'/><path d='M12 8V13' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/><circle cx='12' cy='16' r='1' fill='%23ffffff'/></svg>");
}

.detail-pane__body .e-item--warning::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><circle cx='12' cy='12' r='10' fill='%23F59E0B'/><path d='M12 8V13' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/><circle cx='12' cy='16' r='1' fill='%23ffffff'/></svg>");
}

.detail-pane__body .e-item--excluded::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><circle cx='12' cy='12' r='10' fill='%239aa6ae'/><path d='M8 12h8' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/></svg>");
}

.detail-pane__body .e-item--ai-edge::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><circle cx='12' cy='12' r='10' fill='%23C026D3'/><path d='M12 7v10M7 12h10' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/></svg>");
}

.detail-pane__body .e-item:not(.e-item--meta):not(.e-item--ref) > * {
  grid-column: 2;
  min-width: 0;
}

.detail-pane__body .e-item-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink);
  text-transform: none;
}

.detail-pane__body .e-item-value {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink-soft);
}

.detail-pane__body .e-item-detail,
.panel-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.035em;
  color: var(--product-meta);
}

.detail-pane__body .e-item__sev {
  font-family: var(--font-mono);
  font-size: 11px;
}

.section-title {
  margin: 18px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--product-rule);
}

.report-export {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.rpt-sec {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rpt-sec-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rpt-sec-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink);
}

.rpt-sec-desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-meta);
}

.rpt-field-sub {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-meta);
}

.rpt-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rpt-field-label {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink-soft);
}

.rpt-dropdown {
  position: relative;
}

.rpt-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: #ffffff;
  color: var(--product-ink-soft);
  cursor: pointer;
  font-size: 18px;
  letter-spacing: -0.04em;
}

.rpt-select-chev {
  transition: transform 160ms ease;
}

.rpt-dropdown.open .rpt-select-chev {
  transform: rotate(180deg);
}

.rpt-dropdown-menu {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--product-shadow-pop);
}

.rpt-dropdown.open .rpt-dropdown-menu {
  display: flex;
}

.rpt-dropdown-opt {
  padding: 12px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--product-ink-soft);
  cursor: pointer;
  font-size: 16px;
  letter-spacing: -0.04em;
  text-align: left;
  transition: background 120ms ease;
}

.rpt-dropdown-opt:hover {
  background: var(--product-soft);
  color: var(--product-ink);
}

.rpt-dropdown-opt.selected {
  background: var(--product-surface);
  color: var(--product-ink);
  font-weight: 600;
}

.rpt-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  padding: 0 24px;
  gap: 4px;
  border: 1px solid var(--product-rule-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--product-muted);
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: background 160ms ease, border-color 160ms ease;
}

.rpt-btn-outline:hover {
  background: var(--product-surface);
  border-color: var(--product-muted);
}

.rpt-box {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: var(--product-surface);
  color: var(--product-ink-soft);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.04em;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
}

.rpt-box-button {
  cursor: pointer;
}

.rpt-box-tall {
  min-height: 240px;
  max-height: 260px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.rpt-artifacts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.rpt-artifact {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--product-rule);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
}

.rpt-artifact:hover {
  border-color: var(--product-muted);
}

.rpt-artifact-thumb {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 128px;
  object-fit: cover;
  background: var(--product-thumb-bg);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.rpt-artifact-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  border-top: 1px solid var(--product-surface);
}

.rpt-artifact-name,
.rpt-artifact-dl {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.04em;
  color: var(--product-ink-soft);
}

.rpt-artifact-dl {
  color: var(--product-blue-dark);
  font-weight: 700;
}

.lightbox {
  background: rgba(8, 14, 20, 0.78);
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--product-ink);
  color: #ffffff;
  font-size: 13px;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1280px) {
  :root {
    --right-w: 520px;
  }

  .doc-canvas {
    padding: 48px;
  }
}

@media (max-width: 1024px) {
  html,
  body.product-app {
    overflow: auto;
  }

  .app-layout {
    min-height: 100vh;
  }

  .main-content {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .dashboard-main {
    flex-direction: column;
  }

  .results-panel {
    width: 100%;
    min-width: 0;
    border-left: 0;
    border-top: 1px solid var(--product-rule);
  }

  .doc-panel {
    min-height: 70vh;
  }
}

@media (max-width: 768px) {
  .nav-sidebar {
    display: none;
  }

  .analysis-steps {
    padding: 8px 20px;
  }

  .astep-elapsed,
  .controls-toggle__label {
    display: none;
  }

  .upload-view {
    padding: 32px 20px;
  }

  .upload-area {
    min-height: 280px;
    padding: 48px 16px;
  }

  .app-controls-bar,
  .doc-pager {
    padding-left: 20px;
    padding-right: 20px;
  }

  .ctrl-group__label,
  .ctrl-sep,
  .opacity-control label,
  .ctrl-toggle__label {
    display: none;
  }

  .doc-canvas {
    padding: 24px;
  }

  .risk-card,
  .report-card,
  .doc-type-strip,
  .context-cta {
    width: calc(100% - 32px);
    margin-left: 16px;
    margin-right: 16px;
  }

  .rpt-artifacts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Layer 2 — context (deep semantic) view ───────────────────────────
   Product design system (FRONTEND_DESIGN §3): --product-* tokens only,
   --right-w geometry, severity → solid product color, emphasis via 1px
   rule + neutral tint surface (no glow/shadow, no hardcoded hex). */
.context-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  width: calc(100% - 48px); margin: 12px 24px;
  border: 1px solid var(--product-rule); border-radius: 10px;
  background: var(--product-soft); color: var(--product-ink);
}
.context-cta__title { font-weight: 600; display: block; }
.context-cta__sub { font-size: 12px; color: var(--product-muted); }
.context-cta__btn {
  padding: 8px 14px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--product-blue-dark); color: #fff; font-weight: 600;
}
.context-view[hidden] { display: none; }
.context-view { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--product-bg); color: var(--product-ink); z-index: 5; }
.context-view__bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--product-rule); }
.context-view__back { background: none; border: none; color: var(--product-muted); cursor: pointer; font-size: 14px; }
.context-view__verdict { margin-left: auto; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: var(--product-soft); border: 1px solid var(--product-rule); color: var(--product-ink); }
.context-view__verdict[data-verdict="모순"] { color: var(--product-red); border-color: var(--product-red); }
.context-view__verdict[data-verdict="의심"] { color: var(--product-amber); border-color: var(--product-amber); }
.context-view__verdict[data-verdict="일관"] { color: var(--product-green); border-color: var(--product-green); }
.context-view__body { flex: 1; display: grid; grid-template-columns: 1fr var(--right-w); min-height: 0; }
.context-view__canvas-wrap { position: relative; min-height: 0; }
#contextCanvas { width: 100%; height: 100%; display: block; }
.context-view__panel { border-left: 1px solid var(--product-rule); overflow-y: auto; padding: 16px; }
.context-gauge { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.context-gauge__verdict { font-size: 22px; font-weight: 800; }
.context-gauge__score { color: var(--product-muted); }
.context-gauge[data-sev="high"] .context-gauge__verdict { color: var(--product-red); }
.context-gauge[data-sev="medium"] .context-gauge__verdict { color: var(--product-amber); }
.context-gauge[data-sev="clear"] .context-gauge__verdict { color: var(--product-green); }
.context-findings { list-style: none; margin: 0; padding: 0; }
.ctx-finding-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ctx-finding { padding: 10px 12px; border: 1px solid var(--product-rule); border-radius: 8px; cursor: default; }
.ctx-finding:hover { border-color: var(--product-blue); }
.ctx-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--product-surface); border: 1px solid var(--product-rule); color: var(--product-muted); margin-right: 4px; }
.ctx-badge--promoted { color: var(--product-red); border-color: var(--product-red); }
.ctx-badge--novel { color: var(--product-blue-dark); border-color: var(--product-blue); }
.ctx-finding__quotes { margin: 6px 0; font-size: 13px; }
.ctx-quote { background: var(--product-soft); padding: 1px 4px; border-radius: 3px; }
.ctx-quote__vs { margin: 0 6px; color: var(--product-dim); }
.ctx-finding__reason { font-size: 12px; color: var(--product-muted); }
.ctx-finding__promo { font-size: 11px; color: var(--product-red); margin-top: 4px; }
.context-empty, .context-status { color: var(--product-dim); font-size: 13px; padding: 12px 0; }

/* ── PoC 로딩 4스텝 체인 (T5) ──────────────────────────────────────────
   loading-progress.js 가 [data-step]/[data-step-line] 에 is-done/is-now 토글.
   스피너 대신 스텝 체인이 진행의 주인공 — 기존 토큰만, 라벨 15px+. */
.loading-steps {
  display: flex;
  align-items: flex-start;
  list-style: none;
  margin: 8px 0 4px;
  padding: 0;
}

.loading-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 128px;
}

.loading-step__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--product-rule-strong);
  border-radius: 50%;
  background: var(--product-bg);
  color: var(--product-dim);
  font-size: 15px;
  font-weight: 700;
  transition: background 240ms ease-out, border-color 240ms ease-out,
              box-shadow 240ms ease-out;
}

.loading-step__label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--product-meta);
  text-align: center;
}

/* 스텝 폭 128·점 36 기준: 점 가장자리↔다음 점 가장자리를 정확히 잇는 선.
   (128−36)/2 = 46 → 음수 마진 −46, 선 길이 46+48+46 = 140. */
.loading-step-line {
  flex: none;
  width: 140px;
  height: 2px;
  margin: 17px -46px 0;
  border-radius: 999px;
  background: var(--product-rule);
  transition: background 240ms ease-out;
}

.loading-step-line.is-done {
  background: var(--product-blue);
}

.loading-step.is-now .loading-step__dot {
  border-color: var(--product-blue);
  color: var(--product-blue-dark);
  box-shadow: 0 0 0 5px var(--product-blue-soft);
  animation: product-step-pulse 1.6s ease-in-out infinite;
}

.loading-step.is-now .loading-step__label {
  color: var(--product-ink);
}

.loading-step.is-done .loading-step__dot {
  border-color: var(--product-blue);
  background: var(--product-blue);
  color: transparent;
}

.loading-step.is-done .loading-step__dot::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--product-on-strong);
  font-size: 17px;
  font-weight: 800;
}

.loading-step.is-done .loading-step__label {
  color: var(--product-ink-soft);
}

@keyframes product-step-pulse {
  50% { box-shadow: 0 0 0 9px var(--product-blue-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .loading-step.is-now .loading-step__dot { animation: none; }
}

/* ── PoC 샘플 갤러리 (T5) ─────────────────────────────────────────────
   업로드 화면 카드 3종 + 사이드바 진입점. sample-gallery.js 가 렌더. */
.sample-gallery {
  margin-top: 44px;
}

.sample-gallery__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--product-meta);
}

.sample-gallery__rule {
  width: 96px;
  height: 1px;
  background: var(--product-rule);
}

.sample-gallery__row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.sample-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 204px;
  padding: 16px 18px;
  border: 1px solid var(--product-rule);
  border-radius: 10px;
  background: var(--product-bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out,
              transform 160ms ease-out;
}

.sample-card:hover {
  border-color: var(--product-rule-strong);
  box-shadow: var(--product-shadow-pop);
  transform: translateY(-2px);
}

.sample-card:focus-visible {
  outline: 2px solid var(--product-blue-dark);
  outline-offset: 2px;
}

.sample-card__tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sample-card--red .sample-card__tag {
  background: var(--product-red-soft);
  color: var(--product-red-strong);
}

.sample-card--green .sample-card__tag {
  background: var(--product-green-soft);
  color: var(--product-green-strong);
}

.sample-card__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--product-ink);
}

.sample-card__meta {
  font-size: 13px;
  letter-spacing: -0.02em;
  color: var(--product-meta);
}

.nav-sample-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 1px;
}

.nav-sample-dot--red { background: var(--product-red); }
.nav-sample-dot--green { background: var(--product-green); }

/* ── PoC 판독불가 뷰 (T5) ─────────────────────────────────────────────
   분석 실패·미지원 포맷 → verdict-banner 회색 상태 재사용 + 업로드 복귀.
   에러 화면·alert 절대 금지. */
.unreadable-view {
  display: flex;
  flex: 1;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--product-bg);
}

.unreadable-view[hidden] {
  display: none !important;
}

.unreadable-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: min(760px, 100%);
}

.unreadable-frame > div {
  width: 100%;
}

.unreadable-frame .verdict-banner {
  border-radius: 12px;
}

.unreadable-retry {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 8px;
  background: var(--product-blue);
  color: var(--product-on-strong);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.unreadable-retry:focus-visible {
  outline: 2px solid var(--product-blue-dark);
  outline-offset: 2px;
}
