/*
 * style.css — 항고 계산기
 * 모바일 우선 / 본문 17px 이상 / 버튼 48px 이상 / 명도 대비 WCAG AA 이상
 *
 * 색 구분: 민사 = 파랑(--civil), 형사 = 자주(--crim)
 * data-cat="civil" | "criminal" 이 붙은 요소 안쪽은 --accent가 그 색으로 바뀝니다.
 */

:root {
  /* 표면 */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2fa;
  --text: #101c2f;
  --text-soft: #55637a;
  --text-mute: #6b7891;
  --line: #e3e8f1;
  --line-strong: #c3cddd;

  /* 브랜드 */
  --brand: #0c2450;
  --brand-2: #153a76;
  --hero-1: #071426;
  --hero-2: #0d2a52;
  --hero-3: #16467f;
  --accent-gold: #f5b64a;
  --accent-gold-soft: #fff4dd;
  --on-dark: #ffffff;
  --on-dark-soft: #c3d4ec;

  --civil: #1d5bd6;
  --civil-soft: #eaf1ff;
  --civil-ink: #123f97;
  --criminal: #bd2352;
  --civil-dark: #9dc0ff;
  --criminal-dark: #ff9fba;
  --civil-soft-dark: #14284a;
  --criminal-dark-bg: #3a1725;

  --accent: #1b4fa8;
  --accent-soft: #eef3fc;
  --on-accent: #ffffff;

  --cta: #1c57d6;
  --cta-hover: #1448b4;
  --kakao: #fee500;
  --kakao-text: #191919;

  --sun: #d13b2e;
  --sat: #2a62c4;
  --warn-bg: #fff6e2;
  --warn-line: #c9821a;
  --warn-text: #5a3a03;
  --error-bg: #fdeceb;
  --error-line: #c0392b;
  --error-text: #7d1c12;
  --note-bg: #e9f6ee;
  --note-ink: #1d6b41;
  --past: #46536b;

  /* 형태 */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(15, 30, 60, .06), 0 2px 8px rgba(16, 32, 64, 0.05);
  --shadow: 0 2px 6px rgba(16, 32, 64, 0.04), 0 12px 28px -12px rgba(16, 32, 64, 0.16);
  --shadow-lg: 0 32px 64px -24px rgba(9, 25, 53, 0.28), 0 8px 20px -12px rgba(9, 25, 53, 0.16);
  --ring: 0 0 0 4px rgba(28, 87, 214, 0.18);
  --wrap: 900px;
  --wrap-wide: 1120px;
  --focus: #123f9c;
}

[data-civil] {
  --civil-now: var(--civil);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1017;
    --surface: #141a24;
    --surface-2: #19202c;
    --surface-3: #1f2836;
    --text: #eef2f8;
    --text-soft: #aeb9c9;
    --text-mute: #93a0b3;
    --line: #263140;
    --line-strong: #3d4b60;

    --hero-1: #060b14;
    --hero-2: #0b1930;
    --hero-3: #12335d;
    --accent-soft: #16243a;
    --accent: #8db4f7;
    --on-accent: #0a1220;

    --accent-soft: #1a2536;
    --accent: #9cc0ff;

    --civil: #7aa8ff;
    --civil-bg: #16233c;
    --civil-strong: #d7e5ff;
    --civil-soft: #16233a;
    --civil-soft: #17243a;

    --kakao: #f7dd00;

    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 40px rgba(0, 0, 0, 0.35);
    --shadow-soft: none;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
    --ring: 0 0 0 4px rgba(120, 165, 255, 0.22);
    --focus: #a9c8ff;

    --warn-bg: #3a2c10;
    --warn-line: #ffb95c;
    --warn-text: #ffe4b8;
    --error-bg: #3c1b18;
    --error-line: #ff8a80;
    --error-text: #ffd7d3;
    --note-bg: #14301f;
    --note-ink: #8fdfae;
    --past: #b9c2d1;

    --cta: #4b83f0;
    --cta-hover: #6094f5;
    --sun: #ff9b90;
    --sat: #9dc0ff;
  }
}

[data-cat="civil"] { --accent: var(--civil); --accent-soft: var(--civil-soft); }
[data-cat="criminal"] { --accent: var(--criminal); --accent-soft: var(--crim-soft); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: -0.005em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; outline-offset: 3px; }

.skip-link {
  position: absolute; left: 8px; top: -120px; z-index: 100;
  background: var(--surface); color: var(--text);
  padding: 12px 16px; border-radius: 10px; border: 2px solid var(--focus);
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.wide { max-width: var(--wrap-wide); }

/* ───────── 헤더 ───────── */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--wrap-wide); margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 14px;
}
.site-title {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px;
  font-size: 19px; font-weight: 800; color: var(--text); text-decoration: none;
  letter-spacing: -0.02em; flex: none;
}
.site-title:hover { text-decoration: none; }
.brand-mark { flex: none; display: block; border-radius: 11px; box-shadow: 0 6px 14px -6px rgba(20, 58, 118, .6); }
.site-title .brand-suffix {
  display: block; font-size: 11px; font-weight: 700; color: var(--text-mute);
  letter-spacing: .1em; line-height: 1;
}
.site-title .brand-main { display: block; line-height: 1.15; }

.site-nav { margin-left: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.site-nav li { margin: 0; }
.site-nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 11px;
  color: var(--text-soft); text-decoration: none; font-size: 16px; font-weight: 700;
  border-radius: 10px; white-space: nowrap;
}
.site-nav a:hover { background: var(--surface-3); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--cta); }
.nav-cta {
  display: none; align-items: center; gap: 6px; margin-left: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 999px;
  background: var(--cta); color: #fff !important; font-weight: 800; font-size: 15px;
  text-decoration: none; white-space: nowrap; box-shadow: 0 6px 16px -8px rgba(28, 87, 214, .9);
}
.nav-cta:hover { background: var(--cta-hover); text-decoration: none; }

/* ───────── 히어로 ───────── */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(90, 150, 255, 0.28), transparent 70%),
    linear-gradient(158deg, var(--hero-1) 0%, var(--hero-2) 48%, var(--hero-3) 100%);
  color: var(--on-dark);
  padding: 40px 0 108px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .35;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 75%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; text-align: center; }
.hero .eyebrow { margin: 0 auto 18px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #eaf2ff; font-size: 13.5px; font-weight: 700; letter-spacing: 0.01em;
  backdrop-filter: blur(4px);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-gold); box-shadow: 0 0 0 4px rgba(245, 182, 74, .18); }
.hero h1 {
  margin: 0 0 14px; font-size: clamp(30px, 6.4vw, 46px); line-height: 1.22;
  font-weight: 900; letter-spacing: -0.035em; color: #fff;
}
.hero h1 .hl {
  background: linear-gradient(180deg, #ffe6b8, var(--accent-gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero .lead {
  max-width: 620px; margin: 0 auto 22px; color: var(--on-dark-soft);
  font-size: 17px; line-height: 1.7; font-weight: 500;
}
.hero .lead strong { color: #fff; font-weight: 800; }
.hero-trust {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px;
}
.hero-trust li {
  display: inline-flex; align-items: center; gap: 7px; margin: 0;
  padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 700;
  color: #e8f0fb; background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.hero-trust svg { flex: none; color: var(--accent-gold); }

/* ───────── 계산기 카드 ───────── */
.pull { margin-top: -84px; position: relative; z-index: 2; }

.calc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px 18px 22px;
  margin: 0 0 18px;
  box-shadow: var(--shadow-lg);
  scroll-margin-top: 76px;
}
.calc > h2 {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 18px; padding: 0; font-size: 22px; letter-spacing: -0.02em;
  border: 0;
}
.calc > h2 .calc-free {
  font-size: 12.5px; font-weight: 800; color: var(--note-ink);
  background: var(--note-bg); border-radius: 999px; padding: 3px 10px; letter-spacing: 0;
}
.calc form { counter-reset: step; }
.calc .step { margin: 0 0 22px; padding: 0; min-width: 0; counter-increment: step; }
.calc .step-title {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 10px; font-size: 17px; font-weight: 800; line-height: 1.5;
}
.calc .step-title::before {
  content: counter(step); flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font-size: 14px; line-height: 26px; text-align: center; font-weight: 800;
}
.calc .hint { font-size: 15px; color: var(--text-soft); margin: -4px 0 10px; }

/* 민사·형사 */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.seg-item, .chip { position: relative; display: block; cursor: pointer; margin: 0; }
.seg-item input, .chip input {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.seg-item span {
  display: flex; align-items: center; justify-content: center; min-height: 52px;
  border: 2px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font-size: 18px; font-weight: 800; color: var(--text-soft);
}
.seg-civil span { color: var(--civil); border-color: color-mix(in srgb, var(--civil) 45%, var(--line)); }
.seg-criminal span { color: var(--criminal); border-color: color-mix(in srgb, var(--criminal) 45%, var(--line)); }
.seg-civil input:checked + span { background: var(--civil); color: #fff; border-color: var(--civil); }
.seg-criminal input:checked + span { background: var(--criminal); color: #fff; border-color: var(--criminal); }
.seg-item input:checked + span::before, .chip input:checked + span::before { content: "✓"; margin-right: 6px; }
.seg-item input:focus-visible + span, .chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 50px; padding: 6px 8px; line-height: 1.3;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  font-weight: 700; font-size: 15.5px; color: var(--text); word-break: keep-all;
}
.chip:hover span { border-color: var(--accent); background: var(--surface-2); }
.chip input:checked + span {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent); font-weight: 800;
}
.rule-summary {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 15.5px; line-height: 1.5;
  background: var(--accent-soft); border-left: 4px solid var(--accent); color: var(--text);
  font-weight: 700;
}
.calc form > .rule-summary { margin: 0 0 20px; }

/* 송달 방식 */
.options { display: grid; gap: 8px; }
.option {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 13px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer;
  margin: 0; transition: border-color .15s, background .15s;
}
.option:hover { border-color: var(--accent); }
.option input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.option-body { display: block; min-width: 0; }
.option-body strong { display: block; line-height: 1.4; font-size: 16px; }
.option-body small { display: block; font-size: 14px; line-height: 1.4; color: var(--text-soft); }
.option.is-checked { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* 달력 */
.cal { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); padding: 10px 8px 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.cal-title { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.cal-nav {
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 22px; line-height: 1;
  cursor: pointer; box-shadow: var(--shadow-sm);
}
.cal-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cal-nav:disabled { color: var(--text-mute); opacity: .5; cursor: not-allowed; box-shadow: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd { text-align: center; font-size: 13px; font-weight: 800; color: var(--text-mute); padding: 4px 0; letter-spacing: .02em; }
.cal-blank { height: 46px; }
.cal-day {
  height: 46px; padding: 0; border: 2px solid transparent; border-radius: 11px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 16px;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.cal-day:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.is-sun { color: var(--sun); }
.is-sat { color: var(--sat); }
.cal-day.is-today { border-color: var(--line-strong); }
.cal-day.is-today:hover:not(:disabled) { border-color: var(--accent); }
.cal-day.is-selected, .cal-day.is-selected:hover {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.cal-day:disabled { background: transparent; color: var(--text-mute); opacity: .45; font-weight: 400; cursor: not-allowed; }
.cal-info { margin: 10px 4px 8px; font-size: 14px; line-height: 1.55; color: var(--text-soft); }
.cal-quick { display: flex; gap: 7px; margin: 0 4px 8px; }
.btn-quick {
  flex: 1 1 0; min-height: 42px; padding: 4px 8px; border-radius: 999px;
  border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent);
  font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
}
.btn-quick:hover:not(:disabled) { background: var(--accent-soft); }
.btn-quick:disabled { border-color: var(--line); color: var(--text-mute); opacity: .6; cursor: not-allowed; }
.cal-legend, .pcal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 4px; font-size: 13px; line-height: 1.5; color: var(--text-mute); }
.cal-legend .lg::before { content: "●"; margin-right: 4px; }
.cal-legend .is-off::before { color: var(--text-mute); }
.cal-legend .is-sun::before { color: var(--sun); }
.cal-legend .is-sat::before { color: var(--sat); }

.picked {
  margin: 12px 0 0; padding: 11px 13px; border-radius: 12px; line-height: 1.5; font-size: 16px;
  background: var(--surface-2); border: 1.5px dashed var(--line-strong); color: var(--text-soft);
}
.picked.has-date { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 800; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px 18px;
  font: inherit; font-weight: 800; text-decoration: none;
  border-radius: 12px; border: 1.5px solid var(--accent); cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s;
}
.btn-primary {
  width: 100%; min-height: 58px; font-size: 19px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cta) 86%, #fff), var(--cta));
  color: #fff; border-color: transparent;
  box-shadow: 0 10px 24px -10px rgba(28, 87, 214, .75), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover { background: var(--cta-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--surface); color: var(--accent); flex: 1 1 130px; }
.btn-secondary:hover { background: var(--accent-soft); }
.btn:hover { filter: none; }

/* ───────── 결과 ───────── */
.result { margin-top: 22px; scroll-margin-top: 76px; }
.result-main {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--hero-2), var(--accent));
  color: #fff; border-radius: var(--radius-lg); padding: 22px 16px 22px; text-align: center;
  box-shadow: 0 18px 40px -22px rgba(12, 40, 90, .9);
}
.result-main.is-past { background: linear-gradient(150deg, #2a3444, var(--past)); box-shadow: none; }
.result-label { margin: 0; font-size: 14.5px; font-weight: 700; color: rgba(255, 255, 255, .82); letter-spacing: .01em; }
.result-date { margin: 6px 0 10px; font-size: 30px; font-weight: 900; line-height: 1.25; letter-spacing: -0.03em; }
.result-dday { margin: 0; font-size: 16px; font-weight: 700; color: rgba(255, 255, 255, .92); }
.dday-pill {
  display: inline-block; padding: 1px 12px; margin-right: 4px; border-radius: 999px;
  background: #fff; color: var(--hero-2); font-weight: 900; letter-spacing: 0;
}
.result-badge {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; line-height: 1.5;
  background: rgba(255, 255, 255, .14); border-left: 4px solid var(--accent-gold); color: #fff;
}
.result-heading { font-size: 17px; margin: 24px 0 10px; font-weight: 800; }
.result-list { padding-left: 20px; font-size: 16px; }
.result-steps { list-style: none; padding: 0; margin: 0 0 8px; counter-reset: rstep; }
.result-steps li {
  counter-increment: rstep; position: relative;
  padding: 11px 12px 11px 46px; margin: 0 0 8px; line-height: 1.55; font-size: 15.5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.result-steps li::before {
  content: counter(rstep); position: absolute; left: 11px; top: 11px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); color: var(--text-soft); border: 1.5px solid var(--line-strong);
  font-size: 13px; font-weight: 800; line-height: 23px; text-align: center;
}
.result-steps li.is-skip { border-style: dashed; }
.result-steps li.is-final { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.result-steps li.is-final::before { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.result-steps strong { display: block; }
.result-warn {
  margin-top: 14px; padding: 4px 14px 6px; border-radius: 12px;
  background: var(--warn-bg); border-left: 4px solid var(--warn-line); color: var(--warn-text);
  font-size: 16px;
}
.result-warn .result-heading { margin-top: 10px; }
.result-warn .result-heading::before { content: "⚠ "; }
.result-error {
  padding: 14px 14px 4px; border-radius: 12px;
  background: var(--error-bg); border-left: 4px solid var(--error-line); color: var(--error-text); font-weight: 700;
}
.result-error .small { color: var(--error-text); font-weight: 400; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 8px; }
.disclaimer {
  margin: 16px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--text-soft);
}

/* 결과 달력 */
.pcal { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); padding: 10px 8px 12px; }
.pcal-month + .pcal-month { margin-top: 14px; }
.pcal-title { margin: 0 0 4px; text-align: center; font-size: 16px; font-weight: 800; }
.pcal-cell {
  min-height: 50px; padding: 5px 0 3px; border: 2px solid transparent; border-radius: 9px;
  text-align: center; line-height: 1.15; background: var(--surface);
}
.pcal-num { display: block; font-size: 15px; font-weight: 700; }
.pcal-tag { display: block; min-height: 14px; font-size: 11px; font-weight: 800; color: var(--text); }
.p-base { border: 2px dashed var(--accent); }
.p-count { background: var(--accent-soft); }
.p-count .pcal-tag { color: var(--accent); }
.p-wait { border: 2px dotted var(--line-strong); }
.p-skip {
  background: repeating-linear-gradient(135deg, var(--surface) 0 5px, var(--line) 5px 7px);
  border-color: var(--line-strong);
}
.p-skip .pcal-tag { color: var(--text); }
.pcal-cell.p-final { background: var(--accent); border-color: var(--accent); }
.p-final .pcal-num, .p-final .pcal-tag { color: var(--on-accent); }
.p-today { box-shadow: 0 0 0 2px var(--text); }
.pcal-legend { margin-top: 12px; }
.pcal-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.lg-box { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 2px solid transparent; background: var(--surface); }
.lg-box.p-base { border: 2px dashed var(--accent); }
.lg-box.p-count { background: var(--accent-soft); border-color: var(--accent); }
.lg-box.p-wait { border: 2px dotted var(--line-strong); }
.lg-box.p-skip { background: repeating-linear-gradient(135deg, var(--surface) 0 4px, var(--line-strong) 4px 6px); border-color: var(--line-strong); }
.lg-box.p-final { background: var(--accent); border-color: var(--accent); }
.lg-box.p-today { box-shadow: 0 0 0 2px var(--text); }

/* ───────── 즐겨찾기 팁 ───────── */
.tip {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 30px; padding: 13px 15px; border-radius: 14px; font-size: 15px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}
.tip strong { display: block; color: var(--text); font-size: 15.5px; }
.tip .tip-icon { flex: none; color: var(--accent-gold); margin-top: 2px; }
kbd {
  display: inline-block; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface-2); font: inherit; font-size: 13px; font-weight: 700; line-height: 1.6;
  box-shadow: 0 1px 0 var(--line-strong);
}

/* ───────── 섹션 공통 ───────── */
main { padding: 0 0 56px; }
main > .container { padding-top: 26px; }
.section { margin: 44px 0 0; }
.section-head { margin: 0 0 18px; }
.section-head .kicker {
  display: block; font-size: 12.5px; font-weight: 800; letter-spacing: .1em;
  color: var(--accent); margin-bottom: 7px; text-transform: uppercase;
}
.section-head h2 { margin: 0; border: 0; padding: 0; }
.section-head p { margin: 8px 0 0; color: var(--text-soft); font-size: 16px; }

h1 { font-size: 28px; line-height: 1.32; margin: 8px 0 10px; letter-spacing: -0.03em; font-weight: 900; }
h2 { font-size: 22px; line-height: 1.4; margin: 38px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); letter-spacing: -0.02em; font-weight: 800; }
h3 { font-size: 18px; line-height: 1.45; margin: 26px 0 8px; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }
.lead { font-size: 17.5px; color: var(--text-soft); line-height: 1.7; }
.small { font-size: 14px; color: var(--text-soft); }
h2.sec { border-top: 0; padding: 2px 0 2px 13px; border-left: 5px solid var(--accent); scroll-margin-top: 76px; }

.badge {
  display: inline-block; padding: 1px 10px; border-radius: 999px; vertical-align: middle;
  font-size: 12.5px; font-weight: 800; line-height: 1.7; white-space: nowrap;
  background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--line);
  letter-spacing: .01em;
}
.badge-civil { background: var(--civil-soft); color: var(--civil-ink); border-color: transparent; }
.badge-criminal { background: #fdeaf0; color: #9c1a41; border-color: transparent; }
.badge-on { background: transparent; color: inherit; border-color: currentColor; }
.page-badge { margin: 6px 0 0; }

/* ───────── 30초 요약 ───────── */
.stat-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 8px; }
.stat {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.stat .stat-ico {
  flex: none; width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.stat b, .stat .stat-num { display: block; font-size: 25px; line-height: 1.15; font-weight: 900; letter-spacing: -0.03em; }
.stat .stat-txt { display: block; font-size: 14px; color: var(--text-soft); line-height: 1.45; margin-top: 3px; }
.stat .stat-tag { display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: var(--accent); }
.stat.stat-civil { --accent: var(--civil); --accent-soft: var(--civil-soft); }
.stat.stat-crim { --accent: var(--criminal); --accent-soft: #fdeaf0; }
@media (prefers-color-scheme: dark) {
  .stat.stat-crim { --accent-soft: var(--criminal-dark-bg); }
  .stat.stat-civil { --accent-soft: var(--civil-soft-dark); }
  .badge-criminal { background: #3a1725; color: var(--criminal-dark); }
  .badge-civil { background: #14284a; color: var(--civil-dark); }
}

/* ───────── 카드 목록 ───────── */
.card-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.card-list li { margin: 0; }
.card-list a {
  position: relative; display: block; height: 100%; padding: 15px 16px 16px; min-height: 48px; line-height: 1.5;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card-list a::after {
  content: "→"; position: absolute; right: 15px; bottom: 14px;
  font-size: 17px; font-weight: 800; color: var(--line-strong);
  transition: transform .14s ease, color .14s ease;
}
.card-list a strong { display: block; margin-top: 6px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; padding-right: 26px; }
.card-list a .card-desc { display: block; font-size: 14.5px; color: var(--text-soft); padding-right: 26px; }
.card-list a:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-list a:hover::after { transform: translateX(3px); color: var(--accent); }
.card-list a[data-cat="civil"] { --accent: var(--civil); }
.card-list a[data-cat="criminal"] { --accent: var(--criminal); }

/* ───────── 표 ───────── */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.5; }
caption { text-align: left; font-size: 13.5px; color: var(--text-mute); padding: 10px 12px 4px; }
th, td { border-top: 1px solid var(--line); border-right: 1px solid var(--line); padding: 11px 12px; text-align: left; vertical-align: middle; }
th:last-child, td:last-child { border-right: 0; }
thead th { background: var(--surface-2); font-size: 14px; letter-spacing: .01em; color: var(--text-soft); }
tbody tr:hover { background: var(--surface-2); }
.nowrap { white-space: nowrap; }
.quick-link { display: block; margin-top: 3px; font-weight: 800; text-decoration: none; }
.quick-link:hover { text-decoration: underline; }
table:has(th:nth-child(5)) { min-width: 640px; }

/* ───────── 글 요소 ───────── */
.example {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 16px 16px 2px; margin: 0 0 16px; box-shadow: var(--shadow-sm);
}
.example h3 { margin-top: 0; font-size: 17px; }
.faq { margin: 0; }
.faq dt { font-weight: 800; margin-top: 18px; font-size: 17px; }
.faq dt::before { content: "Q. "; color: var(--accent); }
.faq dd { margin: 6px 0 0; color: var(--text-soft); }
.notice {
  padding: 12px 14px; border-radius: var(--radius); margin: 0 0 16px;
  background: var(--warn-bg); border-left: 4px solid var(--warn-line); color: var(--warn-text); font-size: 15.5px;
}
.updated { font-size: 13.5px; color: var(--text-mute); margin-top: 30px; }
.breadcrumb { font-size: 14px; color: var(--text-mute); margin: 2px 0 10px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin: 0 7px; color: var(--line-strong); }
.breadcrumb a { color: var(--text-mute); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ───────── FAQ 아코디언 ───────── */
.acc { display: grid; gap: 10px; margin: 0 0 18px; }
.acc details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 16px; box-shadow: var(--shadow-sm);
}
.acc details[open] { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.acc summary {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  list-style: none; padding: 15px 0; font-weight: 800; font-size: 16px; line-height: 1.55;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::before {
  content: "Q"; flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 900;
  display: grid; place-items: center;
}
.acc summary::after {
  content: "+"; margin-left: auto; flex: none; font-size: 20px; font-weight: 700;
  color: var(--text-mute); line-height: 1.2;
}
.acc details[open] summary::after { content: "−"; }
.acc .acc-body { padding: 0 0 16px 34px; color: var(--text-soft); font-size: 15.5px; }
.acc .acc-body p:last-child { margin-bottom: 0; }

/* ───────── 차이 비교 ───────── */
.diff-grid { display: grid; gap: 10px; margin: 0 0 16px; }
.diff {
  padding: 16px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-top: 3px solid var(--accent);
}
.diff h3 { margin: 0 0 4px; font-size: 17px; }
.diff .diff-when { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .04em; margin-bottom: 8px; }
.diff p { margin: 0; font-size: 15px; color: var(--text-soft); }
.diff.d1 { --accent: var(--civil); }
.diff.d2 { --accent: var(--criminal); }
.diff.d3 { --accent: #7a5af5; }

/* ───────── 광고 영역 ───────── */
.ad-slot {
  position: relative; margin: 34px 0; padding: 0;
  text-align: center;
}
.ad-slot__label {
  display: block; margin: 0 auto 6px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .14em; color: var(--text-mute); text-transform: uppercase;
}
.ad-slot__ph {
  display: grid; place-items: center; gap: 2px;
  min-height: 100px; padding: 18px 14px; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); background: var(--surface-2);
  color: var(--text-mute); font-size: 12.5px; line-height: 1.5;
}
.ad-slot__ph b { display: block; font-size: 12.5px; color: var(--text-soft); }
@media (min-width: 760px) { .ad-slot__ph { min-height: 120px; } }

/* ───────── 모바일 하단 고정 버튼 ───────── */
.mcta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -12px rgba(12, 25, 50, .3);
}
.mcta a {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 50px; border-radius: 12px; text-decoration: none; font-weight: 800; font-size: 16px;
}
.mcta .mcta-main { background: var(--cta); color: #fff; box-shadow: 0 8px 20px -10px rgba(28, 87, 214, .9); }
.mcta .mcta-sub { flex: 0 0 auto; padding: 0 16px; background: var(--surface); color: var(--text); border: 1.5px solid var(--line-strong); }
.mcta.mcta--top { display: none; }
body { padding-bottom: 78px; }

/* ───────── 푸터 ───────── */
.site-footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 34px 0 40px; font-size: 14px; color: var(--text-soft);
}
.site-footer .foot-inner { max-width: var(--wrap-wide); margin: 0 auto; padding: 0 18px; }
.foot-grid { display: grid; gap: 26px; }
.foot-brand .site-title { font-size: 17px; }
.foot-brand p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--text-mute); max-width: 380px; }
.foot-col h4 { margin: 0 0 6px; font-size: 12.5px; letter-spacing: .1em; color: var(--text-mute); font-weight: 800; text-transform: uppercase; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.site-footer li { margin: 0; }
.site-footer a { display: inline-flex; align-items: center; min-height: 40px; color: var(--text-soft); text-decoration: none; font-size: 14.5px; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.foot-legal { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.7; color: var(--text-mute); }
.foot-legal p { margin: 0 0 6px; }
.foot-legal strong { color: var(--text-soft); }

/* ───────── 404 ───────── */
.center-box { text-align: center; padding: 60px 0; }
.center-box .big { font-size: 64px; font-weight: 900; color: var(--accent); letter-spacing: -.04em; margin: 0; }

/* ───────── 큰 화면 ───────── */
@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .card-list { grid-template-columns: 1fr 1fr; }
  .diff-grid { grid-template-columns: repeat(3, 1fr); }
  .calc { padding: 26px 26px 28px; }
  .calc .chips { grid-template-columns: repeat(3, 1fr); }
  .options { grid-template-columns: 1fr 1fr; }
  .result-date { font-size: 36px; }
  .cal, .pcal { padding: 14px 14px 16px; }
  .cal-grid { gap: 5px; }
  .cal-day, .cal-blank { height: 50px; }
  h1 { font-size: 32px; }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (min-width: 900px) {
  .header-inner { padding: 10px 24px; }
  .nav-cta { display: inline-flex; }
  .site-title { font-size: 20px; }
  .hero { padding: 56px 0 118px; }
  .hero .lead { font-size: 18.5px; }
  .pull { margin-top: -92px; }
  .calc { padding: 28px 30px 30px; }
  .chips { grid-template-columns: repeat(4, 1fr); }
  .chip span { min-height: 52px; }
  .cal-grid { gap: 6px; }
  .cal-day, .cal-blank { height: 52px; }
  .result-date { font-size: 40px; }
  .mcta { display: none; }
  body { padding-bottom: 0; }
}

@media (min-width: 1024px) {
  .chips { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .result-actions, .skip-link, .tip, .breadcrumb,
  .ad-slot, .mcta, .hero-trust, .nav-cta, .faq, .acc, .diff-grid, .stat-grid { display: none !important; }
  body { font-size: 12pt; background: #ffffff; padding: 0; }
  .calc { box-shadow: none; }
  .hero { background: none; color: #000; padding: 0; }
  .hero h1 { color: #000; }
  .hero .lead, .hero .eyebrow, .hero-trust { display: none; }
  .printing-result form, .printing-result article, .printing-result .calc > h2,
  .printing-result main > .container > h2, .printing-result .card-list, .printing-result .table-wrap,
  .printing-result .lead, .printing-result .updated, .printing-result .notice,
  .printing-result .section, .printing-result .ad-slot { display: none !important; }
  .printing-result .calc { border: 0; padding: 0; margin: 0; }
}
