/* 미리안다 — 종이·공문서 디자인 시스템
   종이(아이보리) 위에 잉크(먹색)로 쓰고, 인주(도장 빨강)로 강조한다.
   제목: Noto Serif KR(명조) / 본문: Pretendard */

:root {
  --paper: #f5f1e8;        /* 배경 종이 */
  --card: #fffdf7;         /* 카드 백지 */
  --ink: #26221c;          /* 먹색 */
  --sub: #6f6759;          /* 옅은 먹 */
  --line: #e2d9c6;         /* 괘선 */
  --line-dark: #c9bda2;
  --seal: #b23c2e;         /* 인주(도장) */
  --seal-soft: #f7e9e5;
  --ok: #55683f;           /* 먹빛 초록 */
  --ok-soft: #eef0e2;
  --warn-ink: #8a6c26;
  --danger: #b23c2e;       /* 필수 항목 미선택 경고 (인주색과 동일) */
  --radius: 10px;
  --serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  --sans: "Pretendard", "Pretendard Variable", "Malgun Gothic", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 26px 16px 64px; }

/* ---------------- 헤더: 제호 배너 ---------------- */
header.site { padding: 6px 0 8px; border-bottom: 3px double var(--line-dark); margin-bottom: 4px; }
.banner { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.law-line { color: var(--sub); font-size: 12.5px; margin-top: 8px; text-align: right; }

.progress { display: flex; gap: 5px; margin: 16px 0 20px; }
.progress span { flex: 1; height: 3px; background: var(--line); }
.progress span.on { background: var(--seal); }

.step-title { font-family: var(--serif); font-size: 20px; font-weight: 700; margin-bottom: 5px; }
.step-sub { color: var(--sub); font-size: 13.5px; margin-bottom: 16px; }

/* ---------------- 카드(문서) ---------------- */
.cards { display: flex; flex-direction: column; gap: 10px; }
/* 첫 화면 묶음: '무슨 일이 있었나' 제목 + 결과로 무엇을 보게 되는지 한 줄 */
.law-group { margin-bottom: 22px; }
.law-group .lg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 0 2px 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line-dark); }
.law-group .lg-icon { font-size: 17px; line-height: 1; }
.law-group h3 { font-family: var(--serif); font-size: 16.5px; font-weight: 700; color: var(--ink); }
/* 안내 문구가 길어 nowrap 을 두면 좁은 창에서 가로로 넘친다 — 넘치느니 줄바꿈한다 */
.law-group .lg-result { font-size: 12.5px; color: var(--seal); margin-left: auto; text-align: right; }
/* 제목(최대 175px) + 문구(최대 359px) + 아이콘·여백이 700px 아래에서는 한 줄에 안 들어간다 */
@media (max-width: 700px) { .law-group .lg-result { margin-left: 0; width: 100%; padding-left: 27px; text-align: left; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 15px 17px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: var(--ink);
  transition: border-color .12s, background .12s, transform .06s;
}
.card:hover { border-color: var(--seal); border-top-color: var(--seal); background: #fffcf2; }
.card:active { transform: translateY(1px); }
.card .t { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.card .d { font-size: 13px; color: var(--sub); margin-top: 3px; }
.card .legal { font-size: 11.5px; color: #a39a87; margin-top: 7px; }

.back { background: none; border: none; color: var(--sub); font-size: 13px; cursor: pointer; padding: 4px 0; margin-bottom: 10px; font-family: var(--sans); }
.back:hover { color: var(--seal); }

/* ---------------- 입력 문서 ---------------- */
.opt-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 13px; }
.opt-group h3 { font-size: 14.5px; margin-bottom: 10px; font-weight: 700; }
.opt-group h3 u { text-decoration-color: var(--seal); text-underline-offset: 3px; }
.opt-group label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.opt-group label:hover { background: var(--seal-soft); }
.opt-group input[type="radio"], .opt-group input[type="checkbox"] { margin-top: 4px; accent-color: var(--seal); }
.opt-group .note { font-size: 12px; color: var(--sub); margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
/* 필수 항목 미선택 — 테두리가 붉어지고 살짝 흔들리며, 안내 문구가 위에 찍힌다 */
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.opt-group.missing { border-color: var(--danger); box-shadow: 0 0 0 3px var(--seal-soft); animation: shake .4s ease; }
.opt-group .missing-msg { display: none; }
.opt-group.missing .missing-msg { display: block; color: var(--danger); font-size: 13px; font-weight: 700; margin-bottom: 8px; }

.revenue-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.revenue-row input[type="text"] { flex: 1; min-width: 160px; padding: 10px 12px; border: 1px solid var(--line-dark); border-radius: 8px; font: inherit; font-size: 14px; background: #fffef9; color: var(--ink); }
.revenue-row input[type="text"]:focus { outline: 2px solid var(--seal); outline-offset: 1px; border-color: var(--seal); }
.chip { border: 1px solid var(--line-dark); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-family: var(--sans); color: var(--ink); }
.chip:hover { border-color: var(--seal); color: var(--seal); }
.revenue-view { font-size: 13px; color: var(--ok); font-weight: 700; margin-top: 6px; }

.primary {
  display: block; width: 100%;
  background: var(--ink); color: var(--card);
  border: none; border-radius: 8px;
  padding: 15px; font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: var(--serif); letter-spacing: 1px;
  margin-top: 8px;
}
.primary:hover { background: #3a342a; }

/* ---------------- 결과 문서 + 도장 ---------------- */
.result-head {
  position: relative;
  background: var(--card); border: 1px solid var(--line-dark); border-radius: var(--radius);
  padding: 22px 18px 20px; margin-bottom: 14px;
  border-top: 3px double var(--line-dark);
  overflow: hidden;
}
.result-head::after {
  content: "미리안다";
  position: absolute; right: 18px; top: 16px;
  font-family: var(--serif); font-size: 21px; font-weight: 700;
  color: var(--seal); border: 3px solid var(--seal); border-radius: 5px;
  padding: 9px 14px; transform: rotate(6deg); opacity: .75;
  letter-spacing: 4px;
}
.result-head .picked { font-size: 12.5px; color: var(--sub); margin-bottom: 8px; padding-right: 160px; }
@media (max-width: 520px) {
  .result-head::after { font-size: 16px; padding: 7px 10px; letter-spacing: 3px; right: 12px; top: 12px; }
  .result-head .picked { padding-right: 120px; }
}
.result-head .headline { font-family: var(--serif); font-size: 25px; font-weight: 700; line-height: 1.35; }
.result-head .headline.suspension { color: var(--seal); }
.result-head .headline.warning { color: var(--warn-ink); }
.result-head .headline.revoke { color: #8c2318; }
.result-head .surcharge-line { font-size: 15.5px; margin-top: 7px; font-weight: 600; }
/* 헤드라인 아래 '형사처벌 병행' 한 줄 — 처분 색과 같되 작게. 누르면 형사처벌 박스로 */
.result-head .crim-line { font-size: 13px; margin-top: 8px; cursor: pointer; opacity: .9; }
.result-head .crim-line:hover { text-decoration: underline; }
.result-head .crim-line.suspension { color: var(--seal); }
.result-head .crim-line.warning { color: var(--warn-ink); }
.result-head .crim-line.revoke { color: #8c2318; }
.result-screen .result-head .crim-line { animation: rise .35s cubic-bezier(.2,.7,.2,1) .4s both; }

.extra { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; font-size: 14px; }
.extra h4 { font-size: 13.5px; margin-bottom: 6px; font-weight: 700; }
.extra ul { padding-left: 18px; }
.extra li { margin: 3px 0; }
.extra .amount { font-weight: 700; color: var(--seal); }

details.calc { background: var(--card); border: 1px dashed var(--line-dark); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
details.calc summary { font-size: 14px; font-weight: 700; cursor: pointer; }
details.calc ol { margin: 10px 0 4px; padding-left: 4px; list-style: none; font-size: 13px; color: var(--sub); }
details.calc li { margin: 5px 0; }

.warn-box { background: #f9f3e2; border: 1px solid #e3d3a2; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; font-size: 13px; color: #77601f; }
.warn-box li { margin-left: 16px; }

/* 개선 경로(다퉈볼 수 있는 길) — 한지 초록 */
.benefit {
  background: var(--ok-soft); border: 1px solid #cfd4b4; border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
}
.benefit h3 { font-family: var(--serif); font-size: 16.5px; color: var(--ok); margin-bottom: 10px; }
.loss-line { font-size: 14px; color: #3d4433; background: var(--card); border: 1px solid #dcdfc6; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.rule-line { font-size: 13px; color: #3d4433; background: var(--card); border: 1px dashed #b9c19a; border-radius: 8px; padding: 9px 12px; margin-bottom: 10px; }
.levers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 4px 0 10px; }
.levers.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* 타일 4장(면제 포함) = 2×2 */
@media (max-width: 480px) { .levers.cols-2 { grid-template-columns: 1fr; } }
.lever { background: var(--card); border: 1px solid #d4d8bb; border-radius: 8px; padding: 12px; }
.lever .lv-t { font-size: 13.5px; font-weight: 700; color: var(--ink); padding-bottom: 6px; border-bottom: 1px solid #e3e6d0; margin-bottom: 4px; }
.lever .lv-big { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--ok); margin: 4px 0 0; }
.lever .lv-f { font-size: 12px; color: var(--ok); font-weight: 700; margin: 1px 0 5px; }
.lever .lv-d { font-size: 12.5px; color: #55503f; line-height: 1.5; }
.benefit-note { font-size: 12.5px; color: #5c6247; line-height: 1.65; }
/* 법 제75조①단서 면제 — 인주색 강조 */
.exempt-line { border-color: var(--seal) !important; background: var(--seal-soft) !important; color: #6b2a20 !important; }
.exempt-line .exempt-basis { font-size: 11.5px; color: #9a6b62; margin-top: 8px; padding-top: 6px; border-top: 1px dashed #e2c9c2; font-weight: 400; }
.lever.exempt-tile { border-color: var(--seal); background: #fff8f5; }
.lever.exempt-tile .lv-big, .lever.exempt-tile .lv-f { color: var(--seal); }
.opt-group.exempt-group { border-color: #e2c9c2; }

/* 공개 처분 통계 — "같은 위반으로 처분받은 사람들" (종이 카드 + 인주 포인트) */
.stats-box {
  background: var(--card); border: 1px solid var(--line-dark); border-top: 3px double var(--line-dark);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.stats-box h3 { font-family: var(--serif); font-size: 16.5px; color: var(--ink); margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.stats.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .stats.cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }
.stat { background: #fffef9; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.stat .st-t { font-size: 13.5px; font-weight: 700; color: var(--ink); padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.stat .st-big { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--seal); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat .st-d { font-size: 12.5px; color: #55503f; line-height: 1.5; }
.stats-src { font-size: 11.5px; color: #a39a87; line-height: 1.6; }
.stats-intro { font-size: 13px; color: #55503f; line-height: 1.6; margin: -4px 0 12px; }

/* 형사처벌 박스 — 행정처분(인주·먹)과 다른 범주라 남색 계열로 구분 */
#crimBox { background: #f3f5f9; border-color: #c5cddb; border-top: 3px double #9aa8c2; }
#crimBox h4 { color: #2f3e5c; }
#crimBox .amount { color: #35507f; }
#crimBox .crim-stats { border-top-color: #d3dae6; }
#crimBox .crim-stats .cs-title { color: #2f3e5c; }
#crimBox .crim-stats .stat { background: #fbfcfe; border-color: #d3dae6; }
#crimBox .crim-stats .st-t { border-bottom-color: #e1e6ef; color: #2f3e5c; }
#crimBox .crim-stats .st-big { color: #35507f; }

/* 형사처벌 박스 안의 검찰 처분 지표 */
.crim-stats { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.crim-stats .cs-title { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.crim-stats .stats { margin-bottom: 6px; }
.crim-stats .stat { background: #faf7ef; }
.result-screen .stats-box .stat { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }

/* CTA — 봉투 느낌 */
.cta {
  background: var(--ink); color: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px; margin: 18px 0 12px;
  border: 1px solid var(--ink);
}
.cta h3 { font-family: var(--serif); font-size: 17px; margin-bottom: 5px; letter-spacing: .5px; }
.cta p { font-size: 13.5px; opacity: .85; }
.cta button {
  margin-top: 12px; background: var(--card); color: var(--ink);
  border: none; border-radius: 8px; padding: 11px 18px;
  font-size: 14.5px; font-weight: 700; cursor: pointer; font-family: var(--sans);
}
.report-cta { background: #55683f; border-color: #55683f; }
.report-cta button { color: #445232; }

.disclaimer { font-size: 11.5px; color: #a39a87; line-height: 1.65; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.restart { background: none; border: 1px solid var(--line-dark); border-radius: 8px; width: 100%; padding: 11px; font: inherit; font-size: 14px; color: var(--sub); cursor: pointer; margin-top: 6px; }
.restart:hover { border-color: var(--seal); color: var(--seal); }
.save-case { border-color: #c3cba8; color: var(--ok); margin-top: 6px; }
.save-case:hover { border-color: var(--ok); color: var(--ok); }

/* ---------------- 보고서 모달 ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(38, 34, 28, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: var(--radius);
  max-width: 640px; width: 100%; padding: 14px 18px 22px;
  border: 1px solid var(--line-dark);
  box-shadow: 0 12px 40px rgba(38, 34, 28, .3);
}
.modal-bar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 8px; }
/* 확인 팝업(사건 병합 전 안내) — 화면 가운데 작은 창 */
.modal-overlay.center { align-items: center; }
.modal.confirm { max-width: 420px; padding: 26px 24px 22px; text-align: center; }
.modal.confirm .confirm-icon { font-size: 30px; color: var(--seal); margin-bottom: 6px; }
.modal.confirm h3 { font-family: var(--serif); font-size: 17px; margin-bottom: 10px; }
.modal.confirm p { font-size: 14.5px; line-height: 1.65; color: var(--ink); margin-bottom: 18px; }
.modal.confirm .confirm-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.modal.confirm .confirm-actions .primary { width: auto; margin: 0; padding: 10px 16px; font-size: 14px; }
.report-sheet h2 { font-family: var(--serif); font-size: 19px; margin-bottom: 2px; }
.report-sheet .rp-sub { font-size: 12px; color: var(--sub); margin-bottom: 14px; }
.rp-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13.5px; }
.rp-table th, .rp-table td { border: 1px solid var(--line-dark); padding: 7px 10px; text-align: left; vertical-align: top; }
.rp-table th { width: 128px; background: #f2ecdd; font-weight: 700; white-space: nowrap; }
.rp-table tr.hl th { background: var(--seal-soft); }
.rp-table tr.hl td { background: #fdf6f0; font-weight: 700; }
.report-sheet h3 { font-family: var(--serif); font-size: 14.5px; margin: 12px 0 6px; }
.rp-steps { font-size: 12.5px; color: var(--sub); padding-left: 18px; }
.rp-steps li { margin: 4px 0; }
.rp-levers { font-size: 13px; padding-left: 18px; margin-bottom: 8px; }
.rp-levers li { margin: 5px 0; line-height: 1.6; }
/* 보고서 — 단계별 절차 및 권리 (현재 단계 강조) */
.rp-stage { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; break-inside: avoid; page-break-inside: avoid; }
.rp-stage.cur { border-color: var(--seal); background: #fffaf8; }
.rp-stage h4 { font-family: var(--serif); font-size: 14px; margin: 0 0 4px; }
.rp-stage h4 small { font-family: var(--sans); font-weight: 400; color: var(--sub); font-size: 12px; }
.rp-cur { display: inline-block; margin-left: 8px; font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--seal); border: 1px solid var(--seal); border-radius: 4px; padding: 0 6px; vertical-align: middle; }
.rp-stage-intro { font-size: 12.5px; color: #4a4536; line-height: 1.6; margin-bottom: 6px; }
.rp-stage .rp-levers { margin-bottom: 0; }
.rp-stats { background: #f7f4ec; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 10px 28px; font-size: 12.5px; color: #4a4536; }
.rp-stats li { margin: 4px 0; }
.rp-consult { font-size: 12.5px; background: var(--ok-soft); border: 1px solid #cfd4b4; border-radius: 8px; padding: 9px 12px; color: #445232; }
.rp-disclaimer { font-size: 11px; color: #a39a87; margin-top: 14px; line-height: 1.6; }
.rp-case-title { font-size: 13px; margin: 10px 0 4px; color: var(--sub); font-weight: 700; }
.rp-sub-table th { width: 150px; }

/* 보고서 쪽 구분 — 화면에선 점선+라벨, 인쇄에선 실제 페이지 넘김 */
.rp-break { border-top: 1px dashed var(--line-dark); margin: 22px 0 16px; position: relative; height: 0; }
.rp-break::after { content: "— 다음 쪽 —"; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); background: var(--card); padding: 0 10px; font-size: 11px; color: #a39a87; }

@media print {
  @page { size: A4 portrait; margin: 16mm 15mm; }
  html, body { background: #fff; }
  body * { visibility: hidden; }
  .modal-overlay { position: static; padding: 0; background: none; overflow: visible; }
  .modal { box-shadow: none; max-width: none; border: none; padding: 0; }
  .modal-bar { display: none; }
  .report-sheet, .report-sheet * { visibility: visible; }
  .report-sheet { position: absolute; top: 0; left: 0; width: 100%; font-size: 12.5px; }
  /* 표·목록·안내는 페이지 중간에서 자르지 않는다 */
  .rp-table, .rp-table tr, .rp-levers, .rp-steps, .rp-stats, .rp-consult, .rp-sub-table { break-inside: avoid; page-break-inside: avoid; }
  .report-sheet h2, .report-sheet h3, .rp-case-title { break-after: avoid; page-break-after: avoid; }
  .rp-break { break-before: page; page-break-before: always; border: none; margin: 0; height: 0; }
  .rp-break::after { content: none; }
}

/* ---------------- 내 사건함 ---------------- */
.tray-toggle {
  position: fixed; right: 14px; bottom: 18px; z-index: 40;
  background: var(--ink); color: var(--card); border: none; border-radius: 999px;
  padding: 11px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgba(38, 34, 28, .35); font-family: var(--sans);
}
.tray-drawer {
  position: fixed; right: 14px; bottom: 66px; z-index: 41;
  width: min(340px, calc(100vw - 28px)); max-height: 70vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-dark); border-radius: 12px;
  padding: 14px; box-shadow: 0 12px 40px rgba(38, 34, 28, .28); font-size: 13px;
}
.tray-head { display: flex; justify-content: space-between; align-items: center; }
.tray-head b { font-family: var(--serif); }
.tray-drawer .note { font-size: 12px; color: var(--sub); }
.tray-group { border-top: 1px solid var(--line); padding: 10px 0; }
.tray-group .tg-title { font-size: 12px; color: var(--sub); font-weight: 700; margin-bottom: 6px; }
.tray-item { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 6px 0; }
.tray-item .ti-main { font-size: 12.5px; line-height: 1.45; cursor: pointer; border-radius: 6px; padding: 4px 6px; margin-left: -6px; flex: 1; }
.tray-item .ti-main:hover { background: var(--seal-soft); }
.tray-item small { color: var(--sub); }
.ti-open { color: var(--seal) !important; font-weight: 700; }
.tray-merge { margin-top: 6px; padding: 10px; font-size: 13.5px; }
.tray-merge:disabled { background: #b9b3a6; color: #fff; cursor: not-allowed; transform: none; box-shadow: none; }
/* 병합 대상 체크박스 — 사건 행 왼쪽 */
.tray-item .ti-check { display: flex; align-items: center; padding-top: 6px; cursor: pointer; }
.tray-item .ti-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--seal); cursor: pointer; }
.tray-item.unchecked .ti-main { opacity: .55; }
/* 병합 불가(다른 법·업종, 규칙 없음): 체크 잠금 + 이유 한 줄 */
.tray-item.blocked .ti-check { cursor: not-allowed; }
.tray-item.blocked .ti-check input { cursor: not-allowed; opacity: .35; }
.tray-item .ti-why { display: block; color: var(--seal); font-size: 11.5px; margin: 2px 0 1px; }
.tray-mergebar { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }

/* 쿠키 안내 배너 */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--card); border-top: 3px double var(--line-dark);
  padding: 12px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  box-shadow: 0 -6px 24px rgba(38, 34, 28, .12);
}
.cookie-bar p { font-size: 13px; color: var(--ink); margin: 0; }
.cookie-bar a { color: var(--seal); }
.cb-btns { display: flex; gap: 8px; flex: none; }
.cb-ok { background: var(--ink); color: var(--card); border-color: var(--ink); }
.cb-ok:hover { color: var(--card); border-color: var(--ink); background: #3a342a; }

footer.site-foot { margin-top: 28px; padding-top: 14px; border-top: 3px double var(--line-dark); }
footer.site-foot p { font-size: 11.5px; color: #a39a87; line-height: 1.7; }
footer.site-foot a { color: #8a7f68; }

/* ================= 모션 — "종이를 한 장 앞에 놓고, 도장을 찍는다" =================
   원칙: 한 화면에 눈에 띄게 움직이는 것은 하나. 나머지는 손맛(hover/active) 수준. */

@keyframes rise     { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes riseBack { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp  { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes barUp    { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fill     { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop      { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
/* 도장: 위에서 눌러 찍히는 느낌 — 크게 시작해 눌리며 제자리, 순간 진하게 */
@keyframes stamp {
  0%   { opacity: 0; transform: rotate(6deg) scale(1.9); }
  55%  { opacity: 1; transform: rotate(6deg) scale(.94); }
  75%  { transform: rotate(6deg) scale(1.04); }
  100% { opacity: .75; transform: rotate(6deg) scale(1); }
}
@keyframes headlineIn {
  0%   { opacity: 0; transform: translateY(6px) scale(1.04); filter: blur(2px); }
  60%  { opacity: 1; filter: none; }
  100% { transform: none; }
}

/* 단계 전환 — 앞으로 갈 땐 아래서 떠오르고, 이전으로 갈 땐 위에서 내려온다 */
.screen.fwd { animation: rise .28s cubic-bezier(.2,.7,.2,1) both; }
.screen.bwd { animation: riseBack .24s cubic-bezier(.2,.7,.2,1) both; }

/* 진행 바 — 방금 도달한 칸만 붉게 흘러 들어온다 */
.progress span { position: relative; overflow: hidden; }
.progress span.on { background: var(--line); }
.progress span.on::after { content: ""; position: absolute; inset: 0; background: var(--seal); transform-origin: left; }
.progress span.on.new::after { animation: fill .5s cubic-bezier(.2,.7,.2,1) both; }

/* 손맛 — 카드는 살짝 떠오르고, 버튼은 눌린다 */
.card { transition: border-color .15s, background .15s, transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(38, 34, 28, .09); }
.card:active { transform: translateY(1px); box-shadow: none; transition-duration: .06s; }
.opt-group label { transition: background .15s; }
.opt-group label:has(input:checked) { background: var(--seal-soft); box-shadow: inset 3px 0 0 var(--seal); }
.primary { transition: background .15s, transform .12s, box-shadow .15s; }
.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(38, 34, 28, .22); }
.primary:active { transform: translateY(1px); box-shadow: none; }
.chip, .restart, .back { transition: color .15s, border-color .15s, background .15s, transform .1s; }
.chip:active, .restart:active { transform: scale(.97); }
.cta button { transition: transform .12s, box-shadow .15s; }
.cta button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.cta button:active { transform: translateY(1px); box-shadow: none; }

/* 결과 화면 — 처분 헤드라인이 먼저, 도장이 찍히고, 나머지는 차례로 따라온다 */
.result-screen > * { animation: rise .38s cubic-bezier(.2,.7,.2,1) both; }
.result-screen > .back { animation: none; }
.result-screen > .disclaimer { animation: none; }   /* 구분선 아래 면책 문구는 처음부터 그대로 */
.result-screen > .result-head { animation: fadeIn .2s both; }
.result-screen > .result-head .headline { animation: headlineIn .5s cubic-bezier(.2,.7,.2,1) .1s both; }
.result-screen > .result-head::after { animation: stamp .42s cubic-bezier(.3,1.2,.4,1) .45s both; }
.result-screen > :nth-child(3) { animation-delay: .55s; }
.result-screen > :nth-child(4) { animation-delay: 1.7s; }
.result-screen > :nth-child(5) { animation-delay: 1.8s; }
.result-screen > :nth-child(6) { animation-delay: 1.9s; }
.result-screen > :nth-child(7) { animation-delay: 2.0s; }
.result-screen > :nth-child(n+8) { animation-delay: 2.1s; }
/* 초록 패널: 도장(~0.9s) 뒤 숨 고르고 1.4s 에 상자가 먼저 뜨고, 0.5s 버퍼 뒤 타일이 한 장씩 */
.result-screen > .benefit { animation-delay: 1.4s; }
/* 패널 안 항목은 한 개씩 순서대로 — 타일(식품·게임)이든 문장 박스(음주·학폭·벌점)든 같은 규칙.
   등장 시점은 app.js sequenceBenefit() 이 항목 수를 보고 인라인 animation-delay 로 준다 (SEQ 상수) */
.result-screen .benefit > :not(h3):not(.levers):not(.benefit-more),
.result-screen .levers .lever,
.result-screen .after-tiles, .result-screen .benefit-note { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.after-tiles { margin-top: 2px; }
/* 초록 패널 하단부 — 기본(정지) 상태는 펼쳐진 1fr. 결과 화면에서만 0fr 에서 자라난다 (animationend 후 animation 이 해제돼도 펼쳐진 채 유지) */
@keyframes expand { from { grid-template-rows: 0fr; } to { grid-template-rows: 1fr; } }
.benefit-more { display: grid; grid-template-rows: 1fr; }
.benefit-more-in { min-height: 0; overflow: hidden; }
.result-screen .benefit-more { animation: expand .6s cubic-bezier(.2,.7,.2,1) both; }
.lv-big { font-variant-numeric: tabular-nums; }

/* 보고서 — 종이가 아래서 올라온다 */
.modal-overlay { animation: fadeIn .2s both; }
.modal { animation: sheetUp .34s cubic-bezier(.2,.8,.2,1) both; }

/* 사건함 */
.tray-toggle { transition: transform .15s, box-shadow .15s; }
.tray-toggle:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(38, 34, 28, .4); }
.tray-toggle.pop { animation: pop .45s cubic-bezier(.3,1.4,.4,1) both; }
.tray-drawer { animation: rise .26s cubic-bezier(.2,.7,.2,1) both; }

/* 쿠키 배너 — 아래서 올라온다 */
.cookie-bar { animation: barUp .45s cubic-bezier(.2,.8,.2,1) .4s both; }

/* 제목 속 작은 도장 — 결과 문서의 '미리안다' 인장과 같은 결(인주색 테두리·기울임), 크기만 작게 */
.stamp-word {
  display: inline-block; font-family: var(--serif); font-size: 13px; font-weight: 700;   /* 두 제목(16.5/17px)에서 같은 크기 */
  color: var(--seal); border: 2px solid var(--seal); border-radius: 4px;
  padding: 1px 7px 0; margin-left: 4px; letter-spacing: 2px; line-height: 1.5;
  transform: rotate(-4deg) translateY(-3px); vertical-align: middle; opacity: .9;   /* translate 라 주변 여백엔 영향 없음 */
}
.stamp-word.white { color: #fff8f5; border-color: #fff8f5; }

/* "지금 어느 단계인가요?" — 단계 선택 + 지금 할 일 */
.stage-box { background: var(--card); border: 1px solid var(--line-dark); border-top: 3px double var(--line-dark); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.stage-box h3 { font-family: var(--serif); font-size: 16.5px; margin-bottom: 4px; }
.stage-hint { font-size: 12.5px; color: var(--sub); margin-bottom: 12px; }
.stage-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .stage-btns { grid-template-columns: 1fr; } }
.stage-btn { background: #fffef9; border: 1px solid var(--line-dark); border-radius: 8px; padding: 11px 12px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.stage-btn .sb-l { display: block; font-weight: 700; font-size: 14px; }
.stage-btn .sb-s { display: block; font-size: 12px; color: var(--sub); margin-top: 2px; }
.stage-btn:hover { border-color: var(--seal); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(38, 34, 28, .08); }
.stage-btn.on { background: var(--seal); border-color: var(--seal); color: #fff8f5; }
.stage-btn.on .sb-s { color: #f7dcd6; }
.stage-body { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px; }
.stage-body h4 { font-family: var(--serif); font-size: 15px; margin-bottom: 6px; }
.stage-intro { font-size: 13.5px; color: #4a4536; line-height: 1.65; margin-bottom: 12px; }
.stage-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 480px) { .stage-opts { grid-template-columns: 1fr; } }
.stage-opt { background: #fffef9; border: 1px solid var(--line-dark); border-radius: 8px; padding: 10px 12px; text-align: left; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.stage-opt small { display: block; font-size: 12px; font-weight: 400; color: var(--sub); margin-top: 2px; }
.stage-opt.on { border-color: var(--seal); background: var(--seal-soft); box-shadow: inset 3px 0 0 var(--seal); }
.stage-pick { font-size: 13px; color: var(--sub); }
.stage-notice { font-size: 12px; color: #9a6b62; background: var(--seal-soft); border-radius: 6px; padding: 7px 10px; margin-bottom: 12px; }
/* 절차·권리 안내 항목 — 체크리스트가 아니라 설명 문단 (번호·체크 표시 없음) */
.guides { border-top: 1px solid var(--line); }
.guide { padding: 11px 2px; border-bottom: 1px solid var(--line); }
.guide-t { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.guide-d { font-size: 13px; color: #4a4536; line-height: 1.65; }
.stage-box .stats-src { margin-top: 10px; }

/* 죄명 카드 — 명예훼손·모욕·업무방해 흐름 */
.offense-card { padding: 16px 18px; border-left: 4px solid var(--line-dark); }
.offense-card.likely { border-left-color: var(--seal); }
.offense-card.possible { border-left-color: #c9962b; }
.offense-card.unlikely { border-left-color: #b9b3a6; opacity: .82; }
.oc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.oc-title { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.oc-law { font-size: 12px; color: var(--sub); margin-top: 2px; }
.oc-badge { flex-shrink: 0; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.likely .oc-badge { background: var(--seal-soft); color: var(--seal); }
.possible .oc-badge { background: #fbf3dc; color: #8a6414; }
.unlikely .oc-badge { background: #eeebe3; color: var(--sub); }
.oc-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: #55503f; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); margin-bottom: 8px; }
.oc-elems { list-style: none; padding: 0; margin: 0 0 8px; }
.oc-elems li { font-size: 13px; line-height: 1.55; padding: 4px 0 4px 22px; position: relative; }
.oc-elems .el-mark { position: absolute; left: 2px; top: 4px; font-weight: 700; }
.oc-elems .el-met .el-mark { color: var(--ok); }
.oc-elems .el-partial .el-mark { color: #c9962b; }
.oc-elems .el-unmet .el-mark { color: var(--seal); }
.oc-elems .el-note { font-size: 12px; color: #7a6a3a; background: #fbf7ea; border-radius: 6px; padding: 5px 8px; margin-top: 3px; }
.oc-just { font-size: 12.5px; color: #55503f; line-height: 1.6; }
.proc-box .guide-intro { font-size: 13.5px; color: #3d4433; line-height: 1.6; margin-bottom: 8px; }
.proc-box .guide > div { font-size: 13px; color: #55503f; line-height: 1.6; margin-top: 3px; }
.rp-offenses th { width: 150px; white-space: normal; }
.rp-stage-item { font-size: 12.5px; line-height: 1.6; margin: 5px 0; }
input[type="date"] { font: inherit; padding: 8px 10px; border: 1px solid var(--line-dark); border-radius: 8px; background: var(--card); color: var(--ink); }

/* 통계 접기 — [처분 통계 살펴보기] 버튼을 누르기 전까지 통계·형사 박스는 숨김 */
.gated { display: none !important; }
.stats-gate { margin: 0 0 14px; }
.result-screen > .stats-gate { animation: rise .4s cubic-bezier(.2,.7,.2,1) both; }
/* 인주색 봉투 — 결과 화면에서 유일하게 '눌러보고 싶은' 색 */
.stats-reveal {
  display: block; width: 100%; position: relative;
  background: var(--seal); color: #fff8f5;
  border: 1px solid #8c2318; border-radius: var(--radius);
  padding: 17px 52px 17px 20px; font: inherit; font-family: var(--serif); font-size: 17px; font-weight: 700; cursor: pointer;
  text-align: left; letter-spacing: .3px;
  box-shadow: 0 6px 18px rgba(178, 60, 46, .28);
  transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s, background .15s;
}
.stats-reveal::after { content: "›"; position: absolute; right: 20px; top: 50%; transform: translateY(-52%); font-size: 30px; font-family: var(--sans); opacity: .85; transition: transform .18s; }
.stats-reveal small { display: block; font-family: var(--sans); font-size: 12.5px; font-weight: 400; color: #f7dcd6; margin-top: 5px; letter-spacing: 0; }
.stats-reveal:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(178, 60, 46, .38); background: #c04a3b; }
.stats-reveal:hover::after { transform: translate(4px, -52%); }
.stats-reveal:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(178, 60, 46, .3); }

/* 사건함에서 이미 본 결과를 다시 열 때 — 등장 애니메이션 없이 바로 완성 상태 */
.screen.no-anim, .screen.no-anim *, .screen.no-anim *::before, .screen.no-anim *::after { animation: none !important; }

/* 움직임 줄이기 설정을 켠 사용자에겐 모두 끈다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- 찾아보기 (떠 있는 버튼 + 검색 패널) ----------------
   구글식 알약이 아니라 사이트의 인장 결을 따른다 — 사각에 가까운 낮은 라운드, 인주 바탕.
   사건함 버튼이 있을 때는 .up 으로 그 위에 선다. */
.find-toggle {
  position: fixed; right: 14px; bottom: 18px; z-index: 42;
  width: 46px; height: 46px; padding: 0; border: none; border-radius: 12px;
  background: var(--seal); color: #fff; font-size: 19px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 20px rgba(178, 60, 46, .38);
  transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s, bottom .18s;
}
.find-toggle::after {                      /* 인장 안쪽 흰 테두리 — 배너 도장과 같은 규격 */
  content: ""; position: absolute; inset: 3px; border: 1.5px solid rgba(245,241,232,.85); border-radius: 9px;
}
.find-toggle.up { bottom: 74px; }
.find-toggle:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(178, 60, 46, .45); }
.find-toggle:active { transform: translateY(1px); }

.find-panel {
  position: fixed; right: 14px; bottom: 74px; z-index: 43;
  width: min(400px, calc(100vw - 28px)); max-height: min(70vh, 560px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line-dark); border-radius: 12px;
  box-shadow: 0 14px 44px rgba(38, 34, 28, .3);
  animation: findIn .18s cubic-bezier(.2,.7,.2,1);
}
.find-panel.up { bottom: 130px; }
@keyframes findIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.find-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.find-ico { font-size: 15px; opacity: .65; flex: none; }
.find-bar input {
  flex: 1; min-width: 0; border: none; background: none; font: inherit; font-size: 15px; color: var(--ink);
  padding: 4px 0;
}
.find-bar input:focus { outline: none; }
.find-bar input::placeholder { color: #a39a87; }
.find-x { border: none; background: none; color: var(--sub); font-size: 15px; cursor: pointer; padding: 4px 6px; border-radius: 6px; flex: none; }
.find-x:hover { background: var(--paper); color: var(--ink); }

.find-results { overflow-y: auto; padding: 4px 0 8px; }
.find-empty { padding: 14px 14px 10px; }
.find-empty .note { font-size: 12.5px; color: var(--sub); margin: 0 0 10px; line-height: 1.6; }
.find-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.find-chip {
  border: 1px solid var(--line-dark); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.find-chip:hover { border-color: var(--seal); color: var(--seal); }

.find-group { border-top: 1px solid var(--line); padding: 8px 0 2px; }
.find-group:first-child { border-top: none; }
.fg-head { font-size: 11.5px; font-weight: 700; color: var(--sub); padding: 2px 14px 6px; }
.fg-head small { font-weight: 400; color: #a39a87; margin-left: 6px; }
.fg-more { font-size: 11.5px; color: #a39a87; padding: 2px 14px 8px; }

.fr { padding: 8px 14px 10px; border-radius: 8px; }
.fr:hover { background: #fffcf2; }
.fr-t { font-family: var(--serif); font-size: 14px; font-weight: 700; line-height: 1.45; }
.fr-law { font-family: var(--sans); font-size: 11px; font-weight: 400; color: var(--sub); margin-left: 6px; white-space: nowrap; }
.fr-d { font-size: 12px; color: var(--sub); line-height: 1.6; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fr-acts { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.fr-act {
  border: 1px solid var(--seal); background: var(--seal); color: #fff;
  border-radius: 7px; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.fr-act.ghost { background: none; color: var(--seal); }
.fr-act:hover { filter: brightness(1.06); }
.fr-act.ghost:hover { background: var(--seal-soft); }

@media (max-width: 480px) {
  .find-panel { right: 8px; left: 8px; width: auto; max-height: 68vh; }
  .find-toggle { right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .find-panel { animation: none; }
  .find-toggle { transition: none; }
}

/* 쿠키 배너는 화면 아래 전체를 덮는다 — 떠 있는 버튼들이 그 위로 비켜선다.
   배너를 닫으면(선택을 하면) 자동으로 제자리로 돌아온다. */
body:has(.cookie-bar) .find-toggle { bottom: 96px; }
body:has(.cookie-bar) .find-toggle.up { bottom: 152px; }
body:has(.cookie-bar) .find-panel { bottom: 152px; max-height: min(60vh, 460px); }
body:has(.cookie-bar) .find-panel.up { bottom: 208px; }
body:has(.cookie-bar) .tray-toggle { bottom: 96px; }
body:has(.cookie-bar) .tray-drawer { bottom: 144px; max-height: 56vh; }
@media (max-width: 480px) {
  body:has(.cookie-bar) .find-toggle { bottom: 128px; }
  body:has(.cookie-bar) .find-toggle.up { bottom: 184px; }
  body:has(.cookie-bar) .find-panel { bottom: 184px; max-height: 52vh; }
  /* 사건함이 있으면 버튼이 184px 로 올라간다 — 패널은 그 버튼 위에서 시작해야 겹치지 않는다 */
  body:has(.cookie-bar) .find-panel.up { bottom: 240px; max-height: 44vh; }
  body:has(.cookie-bar) .tray-toggle { bottom: 128px; }
}
