:root {
  --bg: #07111f;
  --panel: rgba(13, 24, 40, 0.96);
  --panel2: rgba(19, 32, 52, 0.96);
  --gold: #f4c542;
  --gold2: #d8a31d;
  --text: #e8eefc;
  --muted: #aebbd3;
  --line: rgba(212, 175, 55, 0.28);
  --danger: #f87171;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #17243a 0, var(--bg) 42%, #030712 100%);
  color: var(--text);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  backdrop-filter: blur(10px);
  background: rgba(3, 7, 18, 0.72);
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
}
.brand {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 18px;
  font-weight: 950;
}
.header-badge, .kicker {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.app-shell {
  width: min(1040px, calc(100% - 28px));
  margin: 26px auto 48px;
}
.screen { display: none; }
.screen.active { display: block; }
.hero-card, .panel, .loading-card, .report-result {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: 0 24px 70px rgba(0,0,0,0.34), inset 0 0 0 1px rgba(255,255,255,0.03);
  padding: 26px;
}
.hero-card h1 {
  margin: 8px 0 16px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.16;
  letter-spacing: -0.05em;
}
.hero-desc, .panel p, .modal-body p, .report-card p {
  color: #d6e2f7;
  line-height: 1.78;
}
.hero-actions, .button-row, .result-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}
.primary-btn, .ghost-btn, .back-btn, .icon-btn {
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 900;
}
.primary-btn {
  border: 1px solid rgba(255, 219, 117, 0.85);
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #111827;
  box-shadow: 0 12px 28px rgba(212,175,55,0.22);
}
.ghost-btn, .back-btn, .icon-btn {
  border: 1px solid rgba(212, 175, 55, 0.36);
  background: rgba(255,255,255,0.04);
  color: #fff6cf;
}
.full { width: 100%; }
.report-outline-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.outline-card {
  min-height: 116px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  padding: 16px;
}
.outline-card strong { display: block; color: var(--gold); margin-bottom: 8px; }
.outline-card span { color: #dbe8ff; line-height: 1.55; }
.outline-card.highlight { border-color: rgba(255,219,117,0.6); background: rgba(244,197,66,0.08); }
.premium-form { display: grid; gap: 14px; margin-top: 18px; }
.premium-form label { display: grid; gap: 7px; color: #eaf2ff; font-weight: 800; }
input, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.055);
  color: var(--text);
  padding: 12px 13px;
}
select option { color: #111827; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checkbox-line {
  display: flex !important;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  gap: 9px !important;
  color: #dbe8ff !important;
}
.checkbox-line input { width: auto; }
.checkbox-line.strong { margin: 16px 0; }
.muted { color: var(--muted); font-size: 12px; font-weight: 600; }
.notice-box, .confirm-box {
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 16px;
  background: rgba(244, 197, 66, 0.07);
  color: #dbe8ff;
  padding: 14px;
  line-height: 1.68;
}
.confirm-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; }
.confirm-grid b { color: var(--gold); }
.loading-card { text-align: center; max-width: 560px; margin: 90px auto; }
.spinner {
  width: 48px; height: 48px; margin: 0 auto 18px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.report-title {
  margin: 0 0 18px;
  color: #fff6cf;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.04em;
}
.report-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 22px;
}
.meta-item, .report-card {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  padding: 14px;
}
.meta-item small { display: block; color: var(--muted); margin-bottom: 4px; }
.meta-item strong { color: #fff; }
.report-card { margin-top: 16px; }
.report-card h3 { margin: 0 0 12px; color: var(--gold); }
.report-subtitle {
  margin: 26px 0 13px;
  color: #fff6cf;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.02em;
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  background: rgba(244,197,66,0.07);
}
.report-card p {
  margin: 0 0 15px;
  line-height: 1.92;
  word-break: keep-all;
}
.report-card p + p { margin-top: 4px; }
.report-card h3 + p { margin-top: 6px; }
.report-card .report-subtitle + p { margin-top: 0; }
.site-footer {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto 34px;
  border-top: 1px solid rgba(212,175,55,0.18);
  padding-top: 20px;
  color: var(--muted);
  text-align: center;
}
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.site-footer button { border: 0; background: transparent; color: #dbe8ff; font-weight: 800; }
/* 2026-08-28: 전자상거래법상 필수 고지(상호/대표자/사업자등록번호/통신판매업신고번호/주소/연락처) */
.site-footer-business { margin-top: 14px; font-size: 11px; line-height: 1.7; opacity: 0.85; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; justify-content: center; align-items: center;
  padding: 18px;
  background: rgba(3, 7, 18, 0.76);
  backdrop-filter: blur(6px);
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  width: min(820px, 100%);
  max-height: 84vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
}
.modal-header, .modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(212,175,55,0.16);
}
.modal-footer { justify-content: flex-end; border-top: 1px solid rgba(212,175,55,0.16); border-bottom: 0; }
.modal-header h2 { margin: 0; color: var(--gold); }
.modal-body { overflow-y: auto; padding: 18px; }
@media (max-width: 760px) {
  .report-outline-grid, .form-row, .report-meta { grid-template-columns: 1fr; }
  .hero-card, .panel, .report-result { padding: 18px; border-radius: 18px; }
  .confirm-grid { grid-template-columns: 1fr; }
  .primary-btn, .ghost-btn, .back-btn { width: 100%; }
}

/* v2 내부공사: 제5장 하위 섹션 분리 */
.report-card-with-sections {
  margin-bottom: 10px;
}
.report-section-stack {
  display: grid;
  gap: 16px;
  margin: 12px 0 22px;
}
.report-section-card {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.028);
  padding: 16px 18px;
}
.report-section-card p {
  margin: 0 0 15px;
  line-height: 1.94;
  word-break: keep-all;
}
.report-section-title {
  margin: 0 0 14px;
  color: #fff6cf;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: -0.03em;
  padding: 12px 14px;
  border-left: 5px solid var(--gold);
  border-radius: 12px;
  background: rgba(244,197,66,0.075);
}
.report-section-health {
  border-color: rgba(244,197,66,0.34);
  background: linear-gradient(180deg, rgba(244,197,66,0.055), rgba(255,255,255,0.025));
}
.report-section-health .report-section-title::before {
  content: "별도 섹션 · ";
  color: var(--gold);
  font-size: 13px;
  letter-spacing: -0.02em;
}
.report-inner-block {
  margin-top: 18px;
  padding: 14px 15px 8px;
  border-radius: 14px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.07);
}
.report-inner-block h5 {
  margin: 0 0 12px;
  color: #ffe08a;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.025em;
}
.report-inner-block p:last-child,
.report-section-card p:last-child {
  margin-bottom: 0;
}
@media (max-width: 720px) {
  .report-section-card { padding: 14px; }
  .report-section-title { font-size: 17px; padding: 10px 12px; }
  .report-inner-block { padding: 12px 12px 8px; }
}

/* v2 내부공사: 장별 독립 보기 + 카드형 문단 분리 */
.report-document {
  max-width: 1060px;
  margin: 0 auto;
}
.report-document-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 8px 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
}
.report-subdesc {
  margin: 8px 0 0;
  color: #c9d6eb;
  line-height: 1.75;
}
.report-header-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  color: #cbd7ec;
  font-size: 13px;
  font-weight: 850;
}
.report-header-actions span {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255,255,255,0.035);
}
.report-reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 24px;
  align-items: start;
  margin-top: 26px;
}
.chapter-panels {
  min-width: 0;
  display: grid;
  gap: 44px;
}
.report-chapter-panel {
  display: block;
  scroll-margin-top: 88px;
}

.report-chapter-panel + .report-chapter-panel {
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.report-section-card {
  scroll-margin-top: 88px;
}

.chapter-header-card {
  border: 1px solid rgba(244,197,66,0.28);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(244,197,66,0.075), rgba(255,255,255,0.035));
  padding: 22px 24px;
  margin-bottom: 16px;
}
.chapter-header-card h2 {
  margin: 4px 0 10px;
  color: #fff6cf;
  font-size: clamp(25px, 3.2vw, 34px);
  letter-spacing: -0.04em;
}
.chapter-header-card p {
  margin: 0;
  color: #d7e5fb;
  line-height: 1.8;
}
.chapter-kicker {
  margin: 0 !important;
  color: var(--gold) !important;
  font-size: 14px;
  font-weight: 950;
}
.chapter-section-stack {
  display: grid;
  gap: 18px;
}
.report-section-card {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.052), rgba(255,255,255,0.026));
  padding: 22px 24px;
  box-shadow: 0 16px 42px rgba(0,0,0,0.18);
}
.report-section-title {
  margin-bottom: 18px;
  font-size: 20px;
  background: linear-gradient(90deg, rgba(244,197,66,0.13), rgba(255,255,255,0.035));
}
.report-section-card p {
  margin: 0 0 18px;
  line-height: 2.02;
  word-break: keep-all;
  color: #e1ecff;
  letter-spacing: -0.01em;
}
.report-section-card p + p {
  margin-top: 2px;
}
.report-section-card p:last-child {
  margin-bottom: 0;
}
.report-inner-block {
  margin-top: 20px;
  padding: 18px 18px 14px;
  border-radius: 18px;
  background: rgba(3,7,18,0.25);
}
.report-inner-block h5 {
  color: #fff2bd;
  font-size: 17px;
  margin-bottom: 14px;
}
.chapter-rail {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 9px;
  z-index: 5;
}
.chapter-nav-btn {
  width: 132px;
  min-height: 66px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: #dfe9fa;
  padding: 7px 9px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}
.chapter-nav-btn strong {
  display: block;
  font-size: 15px;
  color: #fff6cf;
}
.chapter-nav-btn span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
  opacity: 0.88;
}
.chapter-nav-btn.active {
  border-color: rgba(244,197,66,0.75);
  background: linear-gradient(135deg, rgba(244,197,66,0.98), rgba(216,163,29,0.98));
  color: #111827;
}
.chapter-nav-btn.active strong {
  color: #111827;
}
.report-intro-card,
.report-notice-card {
  padding: 20px 22px;
}
.report-section-health {
  border-color: rgba(244,197,66,0.40);
  background: linear-gradient(180deg, rgba(244,197,66,0.085), rgba(255,255,255,0.028));
}
.report-section-health .report-section-title::before {
  content: "";
}
.modal-body h3 {
  color: #fff2bd;
  margin: 22px 0 8px;
  font-size: 18px;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body ul,
.modal-body ol {
  margin: 8px 0 18px 20px;
  padding: 0;
  color: #d6e2f7;
  line-height: 1.82;
}
.modal-body li { margin-bottom: 6px; }
.modal-body .policy-note {
  border-left: 4px solid var(--gold);
  background: rgba(244,197,66,0.07);
  padding: 12px 14px;
  border-radius: 12px;
}
@media (max-width: 900px) {
  .report-reader-layout { grid-template-columns: 1fr; }
  .chapter-rail {
    position: sticky;
    top: 64px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    order: -1;
    background: rgba(7,17,31,0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 8px;
  }
  .chapter-nav-btn {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
  }
  .report-document-header { flex-direction: column; }
}
@media (max-width: 640px) {
  .report-result { padding: 14px; }
  .chapter-header-card,
  .report-section-card {
    padding: 17px 16px;
    border-radius: 18px;
  }
  .report-section-card p { line-height: 1.86; margin-bottom: 16px; }
  .report-section-title { font-size: 18px; }
  .chapter-nav-btn strong { font-size: 13px; }
}

/* v2 근거표 복구 패치: 근거/정리 섹션 강조 */
.report-section-basis {
  border-color: rgba(244,197,66,0.48);
  background: linear-gradient(180deg, rgba(244,197,66,0.095), rgba(255,255,255,0.028));
}
.report-section-basis .report-section-title::before {
  content: "근거 · ";
  color: var(--gold);
  font-size: 14px;
  letter-spacing: -0.02em;
}
.report-section-summary {
  border-color: rgba(174,187,211,0.24);
  background: linear-gradient(180deg, rgba(174,187,211,0.065), rgba(255,255,255,0.022));
}
.report-section-summary .report-section-title::before {
  content: "정리 · ";
  color: var(--gold);
  font-size: 14px;
  letter-spacing: -0.02em;
}
