/* ======================================================================
   소멸시효 계산기 · 2026-10-09 신설 (형기·가석방·공소시효 계산기의 styles.css 를 틀로)
   틀은 법정기간 자동 계산기(업무 앱 표준 · 헌법 §7)에서 가져왔다. 색은 홈 「청람」 토큰.
   형기 계산기에서 물려받은 부품은 «형사 계산기에서 물려받음» 절, 이 앱에만 있는 부품은 맨 끝 «소멸시효 계산기 전용» 절.
   ====================================================================== */
:root {
    --ground: #f2f5f8;
    --card: #ffffff;
    --line: #d9e2ea;
    --line-strong: #c3d0dc;
    --ink: #10203a;
    --ink-soft: #44546a;
    --ink-light: #7b8899;
    --accent: #0b4a76;
    --accent-2: #2d7fc0;
    --accent-soft: #e3eef7;
    --accent-soft-2: #d3e4f3;
    --seal: #c8432f;
    --seal-soft: #fbe9e6;
    --amber: #9a6a0c;
    --amber-soft: #fdf3dc;
    --ok: #1f6f4a;
    --r: 18px;
    --shadow: 0 1px 2px rgba(16, 32, 58, .04), 0 8px 24px rgba(16, 32, 58, .06);
    --font: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
    --serif: 'Noto Serif KR', 'Nanum Myeongjo', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--ground);
    background-image: radial-gradient(1200px 420px at 50% -120px, #dfeaf5 0%, rgba(223, 234, 245, 0) 70%);
    background-repeat: no-repeat;
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

/* ── 머리 ─────────────────────────────── */
.top {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.top-in {
    max-width: 1120px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-seal {
    width: 36px; height: 36px; border-radius: 9px; flex: none;
    display: grid; place-items: center;
    background: var(--ink); color: #fff;
    font-family: var(--serif); font-weight: 900; font-size: 20px; line-height: 1;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.brand-txt small { font-size: 12px; color: var(--ink-light); }
.head-tools { display: flex; gap: 8px; }
.tool-btn {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: #fff; border: 1px solid var(--line-strong); color: var(--ink-soft);
    transition: border-color .15s, color .15s, transform .15s;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.tool-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── 본문 틀 ─────────────────────────── */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }

.hero {
    padding: 30px 0 18px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px;
    grid-template-areas: "txt char" "facts facts" "note note";
}
.hero-txt { grid-area: txt; min-width: 0; }
.hero .facts { grid-area: facts; }
.hero .notice-line { grid-area: note; }
.hero-char { grid-area: char; align-self: end; position: relative; width: 104px; }
.hero-char img { display: block; width: 100%; height: auto; animation: charIn .6s ease both .1s; }
.hero-bubble { display: none; }
@keyframes charIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (min-width: 760px) {
    .hero { grid-template-areas: "txt char" "facts char" "note char"; padding-bottom: 0; }
    .hero-char { width: 218px; margin: -8px 24px -30px 0; }   /* 허리 아래가 카드 뒤로 숨는다 */
    .hero-bubble {
        position: absolute; right: calc(100% + 4px); top: 34px; width: 196px; margin: 0;
        background: #fff; border: 1px solid var(--line-strong); border-radius: 16px; padding: 11px 13px;
        font-size: 13px; line-height: 1.55; color: var(--ink-soft); box-shadow: var(--shadow);
        animation: charIn .6s ease both .35s;
    }
    .hero-bubble b { color: var(--accent); }
    .hero-bubble::after {
        content: ''; position: absolute; right: -8px; top: 26px; width: 14px; height: 14px; background: #fff;
        border-right: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); transform: rotate(45deg);
    }
    .board { position: relative; z-index: 1; }
}
/* 말풍선은 본문이 최대 폭(1120px)일 때만 — 폴드 안쪽·태블릿 폭에서는 제목·설명을 가렸다(2026-09-19 조변 실기기) */
@media (min-width: 1120px) { .hero-bubble { display: block; } }
.eyebrow {
    margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--accent);
}
.hero h1 {
    margin: 0; font-family: var(--serif); font-weight: 900;
    font-size: clamp(30px, 6.4vw, 46px); line-height: 1.18; letter-spacing: -.02em;
}
.hero h1 span { color: var(--accent); }
.h1-sub { margin: 8px 0 0; font-size: clamp(16px, 2.6vw, 19px); font-weight: 800; color: var(--accent); letter-spacing: -.01em; }
.lead { margin: 12px 0 0; font-size: clamp(15px, 2.4vw, 17px); color: var(--ink-soft); max-width: 640px; }
.facts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li {
    font-size: 13px; color: var(--ink-soft); background: #fff;
    border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.facts b { color: var(--accent); font-weight: 800; }
.notice-line {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 14px 0 0; padding: 9px 12px; font-size: 13px; color: var(--ink-soft);
    background: rgba(0, 0, 0, .035); border: 1px solid rgba(0, 0, 0, .09); border-radius: 10px;
    max-width: 640px;
}
.notice-line svg { width: 15px; height: 15px; flex: none; margin-top: 3px; fill: none; stroke: currentColor; stroke-width: 2; opacity: .5; }

/* ── 보드: 폰은 한 줄, 넓으면 입력 | 결과 ── */
.board { display: grid; gap: 16px; margin-top: 8px; }
.side { display: grid; gap: 16px; min-width: 0; align-content: start; }
@media (min-width: 980px) {
    .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 22px; }
    .result { position: sticky; top: 76px; }
}

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--shadow); padding: 20px; min-width: 0;
    scroll-margin-top: 72px;
}
.step h2 {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 14px; font-size: 18px; font-weight: 800; letter-spacing: -.01em;
}
.no {
    width: 26px; height: 26px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-size: 14px; font-weight: 800;
    background: var(--accent); color: #fff;
}

/* 검색 */
.search {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 12px;
    background: #fbfcfd; transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(45, 127, 192, .15); }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink-light); stroke-width: 2; stroke-linecap: round; }
.search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 16px; padding: 11px 0; color: var(--ink);
}

/* 분야 탭 */
.tabs {
    display: flex; gap: 6px; margin: 12px -4px 0; padding: 0 4px 2px;
    overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
    flex: none; cursor: pointer; border: 1px solid var(--line-strong); background: #fff;
    color: var(--ink-soft); font-size: 14px; font-weight: 700;
    padding: 7px 14px; border-radius: 999px; transition: all .15s;
}
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs button:not([aria-selected="true"]):hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 400px) {
    .tabs { gap: 5px; }
    .tabs button { font-size: 13px; padding: 6px 10px; }
}
.tabs.searching button[aria-selected="true"] { background: #fff; color: var(--ink-soft); border-color: var(--line-strong); }

/* 절차 목록 */
.procs { display: grid; gap: 8px; margin-top: 12px; }
@media (min-width: 560px) { .procs { grid-template-columns: 1fr 1fr; } }
.proc {
    position: relative; text-align: left; cursor: pointer;
    display: flex; align-items: center; gap: 10px; min-width: 0;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 11px 12px; transition: border-color .15s, background .15s, transform .15s;
}
.proc:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.proc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.proc-txt b { font-size: 15px; font-weight: 700; }
.proc-txt b em { font-style: normal; font-weight: 600; color: var(--ink-light); font-size: 13px; }
.proc-txt small { font-size: 12.5px; color: var(--ink-light); margin-top: 2px; }
.proc-tag { font-size: 11.5px; color: var(--accent); font-weight: 700; }
.pill {
    flex: none; font-size: 13px; font-weight: 800; color: var(--accent);
    background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.proc[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.proc[aria-selected="true"] .pill { background: var(--accent); color: #fff; }
.procs-empty { margin: 12px 0 0; font-size: 14px; color: var(--ink-soft); }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* 직접 입력 */
.custom { margin-top: 12px; display: grid; gap: 10px; }
.custom-row { display: flex; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.field.num { flex: 1.2; } .field.unit { flex: 1; }
.field input, .field select {
    font: inherit; font-size: 17px; font-weight: 700; color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus { outline: 0; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(45, 127, 192, .15); }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check small { display: block; font-size: 12.5px; color: var(--ink-light); margin-top: 2px; line-height: 1.5; }
.check.esong { margin-top: 14px; padding: 12px; border-radius: 12px; background: #f6f9fc; border: 1px dashed var(--line-strong); }

/* ② 날짜 */
.base-label { margin: 0 0 10px; font-size: 15px; color: var(--ink-soft); }
.base-label b { color: var(--ink); font-weight: 800; }
.date-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.date-row input[type="date"] {
    flex: 1 1 200px; min-width: 0; font: inherit; font-size: 18px; font-weight: 700; color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; background: #fff; min-height: 50px;
}
.date-row input[type="date"]:focus { outline: 0; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(45, 127, 192, .15); }
.date-row input:disabled { background: #f4f6f8; color: var(--ink-light); }
.chip {
    flex: none; cursor: pointer; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
    font-size: 14px; font-weight: 700; padding: 0 16px; border-radius: 12px; min-height: 50px;
}
.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: .45; cursor: default; }

/* ③ 결과 */
.result { padding: 22px; }
.empty { margin: 0; font-size: 14px; color: var(--ink-light); line-height: 1.55; }
.empty b { color: var(--ink-soft); font-size: 15px; }

.out { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.out-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kicker { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.badge { font-size: 12px; font-weight: 800; color: var(--seal); border: 1.5px solid var(--seal); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }

.deadline { margin: 10px 0 0; }
.dl-label { font-size: 13px; color: var(--ink-light); font-weight: 600; }
.dl-date {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px;
    font-size: clamp(34px, 8.4vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.dl-date small { font-size: .5em; font-weight: 700; color: var(--ink-soft); letter-spacing: 0; }
.dday {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
    font-size: 14px; font-weight: 800; border-radius: 999px; padding: 5px 12px;
    background: var(--accent-soft); color: var(--accent);
}
.dday.soon { background: var(--amber-soft); color: var(--amber); }
.dday.today { background: var(--seal); color: #fff; }
.dday.past { background: var(--seal-soft); color: var(--seal); }
.dl-sentence { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-soft); }
.dl-sentence b { color: var(--ink); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.two .deadline { margin: 0; padding: 12px; border-radius: 14px; background: #f6f9fc; border: 1px solid var(--line); }
.two .deadline.main { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.two .dl-date { font-size: clamp(22px, 5.6vw, 28px); }
.two .dday { margin-top: 8px; font-size: 12.5px; padding: 3px 10px; }

.path { list-style: none; margin: 18px 0 0; padding: 0; position: relative; }
.path::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.path li { position: relative; padding: 0 0 10px 26px; font-size: 14px; color: var(--ink-soft); }
.path li:last-child { padding-bottom: 0; }
.path li::before {
    content: ''; position: absolute; left: 1px; top: 5px; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 2px solid var(--line-strong);
}
.path li b { color: var(--ink); font-weight: 700; }
.path li.shift::before { border-color: var(--amber); }
.path li.shift { color: var(--amber); }
.path li.end::before { background: var(--accent); border-color: var(--accent); }
.path li.end { color: var(--ink); }

.note {
    margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.6;
    background: #f6f9fc; border: 1px solid var(--line); color: var(--ink-soft);
}
.note b { color: var(--ink); }
.note.warn { background: var(--amber-soft); border-color: #f0dca8; color: #6b4a07; }
.note.law { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: none; border: 0; padding: 0; }
.law-chip { font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; }

.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.act {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
    font-size: 14px; font-weight: 700; padding: 9px 13px; border-radius: 11px;
    transition: border-color .15s, color .15s;
}
.act:hover { border-color: var(--accent); color: var(--accent); }
.act svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal-menu { position: relative; }
.cal-pop {
    position: absolute; left: 0; top: calc(100% + 6px); z-index: 5; min-width: 230px;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow);
    padding: 6px; display: flex; flex-direction: column;
}
.cal-pop a, .cal-pop button {
    text-align: left; text-decoration: none; border: 0; background: none; cursor: pointer;
    font-size: 14px; font-weight: 600; padding: 9px 10px; border-radius: 8px;
}
.cal-pop a:hover, .cal-pop button:hover { background: var(--accent-soft); color: var(--accent); }

/* 달력 — 늘 보인다. 누르면 기준일 */
.calbox { margin-top: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-title { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; text-align: center; flex: 1; }
.cal-nav {
    width: 36px; height: 36px; border-radius: 10px; flex: none; cursor: pointer;
    display: grid; place-items: center; background: #fff; border: 1px solid var(--line-strong); color: var(--ink-soft);
}
.cal-nav:hover { border-color: var(--accent); color: var(--accent); }
.cal-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#calWrap { display: grid; gap: 14px; }
@media (min-width: 560px) and (max-width: 979px) { #calWrap.multi { grid-template-columns: 1fr 1fr; } }
.mon h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 800; color: var(--ink-soft); }
.mon-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mon-grid .dow { font-size: 11.5px; text-align: center; color: var(--ink-light); font-weight: 700; padding: 2px 0; }
.mon-grid .dow:first-child, .mon-grid .dow:last-child { color: var(--seal); }
.dcell {
    position: relative; min-height: 48px; border-radius: 9px; border: 0; background: #f7f9fb; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; padding: 5px 1px 4px;
    font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 0;
    transition: box-shadow .12s;
}
.dcell:hover { box-shadow: inset 0 0 0 2px var(--accent-2); }
.dcell.pad { visibility: hidden; pointer-events: none; }
.dcell.off { color: var(--seal); }
.dcell i, .dcell em {
    font-style: normal; line-height: 1.1; text-align: center; max-width: 100%;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 1px;
}
.dcell i { font-size: 10px; font-weight: 800; color: var(--accent); }
.dcell em { font-size: 9px; font-weight: 600; color: var(--seal); }
.dcell.today::after { content: ''; position: absolute; top: 4px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); }
.dcell.in { background: var(--accent-soft); }
.dcell.base { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
.dcell.base i { color: var(--ink); }
.dcell.raw { box-shadow: inset 0 0 0 2px var(--amber); }
.dcell.raw i { color: var(--amber); }
.dcell.shiftday { background: var(--amber-soft); }
.dcell.mid { box-shadow: inset 0 0 0 2px var(--accent-2); }
.dcell.ext { background: #eef1f5; }
.dcell.ext i { color: var(--ink-soft); }
.dcell.end { background: var(--accent); color: #fff; box-shadow: none; }
.dcell.end i, .dcell.end em { color: #fff; }
.dcell.xend { background: var(--ink); color: #fff; }
.dcell.xend i, .dcell.xend em { color: #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--ink-light); margin: 10px 0 0; }
.cal-legend span::before { content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.lg-base::before { box-shadow: inset 0 0 0 2px var(--ink); }
.lg-in::before { background: var(--accent-soft); }
.lg-shift::before { background: var(--amber-soft); box-shadow: inset 0 0 0 2px var(--amber); }
.lg-end::before { background: var(--accent); }
.lg-ext::before { background: #eef1f5; }
.lg-xend::before { background: var(--ink); }
.cal-legend .lg-off::before, .cal-legend .lg-tip::before { display: none; }
.cal-legend .lg-off b { color: var(--seal); font-weight: 700; }
.cal-legend .lg-tip { color: var(--accent); font-weight: 600; }
@media (min-width: 980px) { .dcell { min-height: 54px; font-size: 15px; } .dcell i { font-size: 10.5px; } }

/* 조변 버튼 — 결과 화면에 하나만(헌법 §5) */
.cta {
    display: flex; align-items: center; gap: 12px; margin-top: 18px; text-decoration: none;
    background: linear-gradient(135deg, #10203a 0%, #163257 100%); color: #fff;
    border-radius: 16px; padding: 12px 14px; transition: transform .15s, box-shadow .15s;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16, 32, 58, .22); }
.cta img { width: 56px; height: 56px; border-radius: 50%; flex: none; background: #dce8f4; object-fit: cover; border: 2px solid rgba(255, 255, 255, .7); }
.cta-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.cta-txt b { font-size: 15px; font-weight: 800; }
.cta-txt span { font-size: 13px; color: #c9d6e6; }
.cta-go {
    flex: none; font-size: 13px; font-weight: 800; color: var(--ink); background: #fff;
    border-radius: 999px; padding: 7px 12px; white-space: nowrap;
}
@media (max-width: 440px) {
    .cta { flex-wrap: wrap; }
    .cta-go { width: 100%; text-align: center; margin-left: 68px; width: calc(100% - 68px); }
}

/* ── 참고 표 ─────────────────────────── */
.ref, .rules, .faq { margin-top: 40px; }
.ref h2, .rules h2, .faq h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.ref-lead { margin: 0 0 6px; color: var(--ink-soft); font-size: 14.5px; }
.ref h3 { margin: 22px 0 8px; font-size: 16px; font-weight: 800; color: var(--accent); }
.table { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tr {
    display: grid; grid-template-columns: 1.3fr .7fr 1.5fr 1.3fr; gap: 10px; align-items: center;
    width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; font-size: 14px;
    border-top: 1px solid var(--line); color: var(--ink-soft);
}
.tr:first-child { border-top: 0; }
button.tr { cursor: pointer; transition: background .12s; }
button.tr:hover { background: #f6f9fc; }
.tr span:first-child { color: var(--ink); font-weight: 700; }
.tr span:nth-child(2) { color: var(--accent); font-weight: 800; white-space: nowrap; }
.tr em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--ink-light); margin-left: 2px; }
.tr span:nth-child(4) { font-size: 12.5px; color: var(--ink-light); }
.tr.th { background: #f6f9fc; font-size: 12px; font-weight: 800; color: var(--ink-light); padding-top: 8px; padding-bottom: 8px; }
.tr.th span { color: var(--ink-light) !important; font-weight: 800 !important; font-size: 12px !important; }
.tr.info span:nth-child(2) { color: var(--ink-light); }
.tr.flash { animation: flash 1.2s ease; }
.proc.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--accent-soft-2); } 100% { background: transparent; } }
@media (max-width: 720px) {
    .tr { grid-template-columns: 1fr auto; gap: 2px 10px; }
    .tr span:nth-child(3), .tr span:nth-child(4) { grid-column: 1 / -1; }
    .tr span:nth-child(3) { font-size: 13px; }
    .tr.th { display: none; }
    .table > .tr:nth-child(2) { border-top: 0; }
}
.ref-note { margin: 8px 2px 0; font-size: 13px; color: var(--ink-light); }

.rules ol { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 8px; }
.rules li {
    counter-increment: r; position: relative; padding: 12px 14px 12px 48px; font-size: 14.5px; color: var(--ink-soft);
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
}
.rules li::before {
    content: counter(r); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--ink); color: #fff;
}
.rules li b { color: var(--ink); }
.rules-foot { margin: 8px 2px 0; font-size: 13px; color: var(--ink-light); }

.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-top: 8px; }
.faq summary { cursor: pointer; padding: 13px 16px; font-weight: 700; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-weight: 800; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0; padding: 0 16px 14px; font-size: 14.5px; color: var(--ink-soft); }

/* ── 바닥 ─────────────────────────── */
.foot { margin-top: 48px; background: var(--ink); color: #c9d6e6; }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 26px 20px 30px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot-links a { color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-note { margin: 14px 0 0; font-size: 13px; line-height: 1.7; max-width: 760px; }
.foot-note a { color: #fff; }
.foot-copy { margin: 10px 0 0; font-size: 12px; color: #8fa1b8; }
.foot-copy span { font-family: var(--serif); font-weight: 900; }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(10px);
    max-width: min(88vw, 420px); text-align: center; background: rgba(16, 32, 58, .95); color: #fff;
    font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 999px; z-index: 100;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 480px) {
    .wrap { padding: 0 16px 32px; }
    .top-in { padding: 9px 16px; }
    .card { padding: 16px; }
    .result { padding: 18px 16px; }
    .hero { padding-top: 22px; }
    .two { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    /* 바닥글: 남색 띠·링크 줄은 빼고 참고용 안내와 사무소 표기만 작게(2026-09-19 인쇄 점검 · 이자 계산기는 끝줄 하나로 빈 2쪽이 생겼다) */
    .foot { margin-top: 14px; background: none !important; color: #555 !important; break-inside: avoid; }
    .foot-in { max-width: none; padding: 8px 20px 0; border-top: 1px solid #ccc; }
    .foot-links { display: none !important; }
    .foot-note { margin: 0; max-width: none; font-size: 8.5pt; line-height: 1.5; }
    .foot-note a { color: inherit; }
    .foot-copy { margin: 3px 0 0; font-size: 8pt; color: #777 !important; }
    .top, .hero, .modes, .board > .step, .ref, .rules, .faq, .acts, .cta, .toast { display: none !important; }
    .board { display: block; }
    body { background: #fff; }
    .card { box-shadow: none; border: 0; }
}

/* ======================================================================
   형사 계산기에서 물려받음(쓰지 않는 규칙도 남겨 둔다)
   ====================================================================== */
/* 계산 종류: 큰 세 칸 */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 14px; position: relative; z-index: 2; }
.modes button {
    display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; min-width: 0;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px;
    transition: border-color .15s, background .15s, transform .15s;
}
.modes button:hover { border-color: var(--accent); transform: translateY(-1px); }
.modes svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.modes span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.modes b { font-size: 15.5px; font-weight: 800; }
.modes small { font-size: 12.5px; color: var(--ink-light); }
.modes button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.modes button[aria-selected="true"] svg { stroke: #9cc6ec; }
.modes button[aria-selected="true"] small { color: #b8c7da; }
@media (max-width: 560px) {
    .modes { gap: 6px; }
    .modes button { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 10px; }
    .modes svg { width: 22px; height: 22px; }
    .modes b { font-size: 14px; }
    .modes small { font-size: 11.5px; }
}

.pane { display: grid; gap: 12px; }
.pane > h2 { margin-bottom: 2px; }
.lab-line { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.lab-line small { font-weight: 600; color: var(--ink-light); margin-left: 4px; }
.field .lab { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.field .lab em { font-style: normal; font-weight: 600; color: var(--ink-light); }
.field.date input { min-height: 50px; }
.hint { margin: -4px 2px 0; font-size: 12.5px; color: var(--ink-light); line-height: 1.55; }

/* 둘·셋 중 하나 */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #eef2f6; border-radius: 12px; padding: 4px; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.seg label { cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 42px;
    border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--ink-soft); padding: 6px 8px; line-height: 1.3;
}
.seg span small { font-size: 11.5px; font-weight: 600; color: var(--ink-light); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 32, 58, .14); }
.seg input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 1px; }

/* 형기 년·월·일 */
.ymd { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ymd .field input { text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-s {
    cursor: pointer; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
    font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
}
.chip-s:hover { border-color: var(--accent); color: var(--accent); }
.chip-s.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* 구금 기간 줄 */
.custody { border-top: 1px dashed var(--line-strong); padding-top: 12px; display: grid; gap: 8px; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.crow input[type="date"] {
    min-width: 0; width: 100%; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 8px; background: #fff; min-height: 44px;
}
.crow input[type="date"]:disabled { background: #f4f6f8; color: var(--ink-light); }
.crow .tilde { color: var(--ink-light); font-weight: 700; }
.crow .del { border: 0; background: none; color: var(--ink-light); cursor: pointer; font-size: 20px; line-height: 1; padding: 4px 6px; }
.crow .del:hover { color: var(--seal); }
.crow .del[hidden] { display: block !important; visibility: hidden; }
.crow .cnt { grid-column: 1 / 2; font-size: 12.5px; color: var(--accent); font-weight: 700; }
.crow .until { grid-column: 3 / 5; font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.crow .until input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.custody-tools { display: flex; justify-content: flex-start; }

/* 공소시효 */
.radios { display: grid; gap: 6px; }
.radios label { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; }
.radios input { accent-color: var(--accent); width: 17px; height: 17px; flex: none; margin: 0; }
.radios label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.direct { display: grid; gap: 10px; }
.crime-card { margin: 0; padding: 10px 12px; border-radius: 12px; background: #f6f9fc; border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.crime-card:empty { display: none; }
.crime-card b { color: var(--ink); }
.special { display: grid; gap: 10px; }

/* 결과 */
.big { margin: 8px 0 0; }
.big .dl-date { font-size: clamp(32px, 7.8vw, 44px); }
.big.none .dl-date { font-size: clamp(26px, 6.4vw, 36px); color: var(--seal); }
.sub2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sub2 > div { padding: 11px 12px; border-radius: 14px; background: #f6f9fc; border: 1px solid var(--line); min-width: 0; }
.sub2 .dl-label { display: block; }
.sub2 .v { display: block; font-size: 19px; font-weight: 800; color: var(--ink); margin-top: 2px; font-variant-numeric: tabular-nums; }
.sub2 .v small { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.sub2 .s { display: block; font-size: 12.5px; color: var(--ink-light); margin-top: 3px; line-height: 1.45; }
.sub2 .parole { background: var(--accent-soft); border-color: var(--accent-soft-2); }
@media (max-width: 400px) { .sub2 { grid-template-columns: 1fr; } }

/* 기간 막대 */
.bar { margin: 18px 0 4px; }
.bar-track { position: relative; height: 12px; border-radius: 999px; background: #e9eef3; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #2d7fc0, #0b4a76); }
.bar-cred { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px 0 0 999px; background: repeating-linear-gradient(135deg, #8fb2d2 0 5px, #a9c4dd 5px 10px); }
.bar-mark { position: absolute; top: -5px; width: 3px; height: 22px; border-radius: 2px; transform: translateX(-1px); }
.bar-mark.p { background: var(--accent); }
.bar-mark.t { background: var(--seal); }
.bar-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 9px; font-size: 12px; color: var(--ink-soft); }
.bar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.bar-legend .lg-cred { background: repeating-linear-gradient(135deg, #8fb2d2 0 3px, #a9c4dd 3px 6px); }
.bar-legend .lg-run { background: #1f68a0; }
.bar-legend .lg-p { background: var(--accent); width: 3px; }
.bar-legend .lg-t { background: var(--seal); width: 3px; }
.bar-ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--ink-light); font-variant-numeric: tabular-nums; }

/* 단계 사다리(구속기간) */
.ladder { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.ladder li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #f6f9fc; border: 1px solid var(--line); }
.ladder li b { font-size: 14.5px; }
.ladder li .d { font-size: 14px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ladder li small { grid-column: 1 / -1; font-size: 12px; color: var(--ink-light); }
.ladder li.last { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.ladder li.opt { background: #fff; border-style: dashed; }

/* 참고 표 3·4칸 */
.table.t3 .tr { grid-template-columns: 1.4fr 1fr 1.4fr; }
.table.t4 .tr { grid-template-columns: 1.15fr 1.6fr .7fr 1.25fr; }
.table .tr span em { display: block; margin: 2px 0 0; }
.table.t3 .tr span:nth-child(2), .table.t4 .tr span:nth-child(2) { white-space: normal; }
.table.t4 .tr span:nth-child(2) { color: var(--ink-soft); font-weight: 500; font-size: 13.5px; }
.table.t4 .tr span:nth-child(3) { color: var(--accent); font-weight: 800; }
.table.t4:not(.crimes) .tr span:nth-child(2) { color: var(--ink); }
.table.t4:not(.crimes) .tr span:nth-child(3) { color: var(--ink-light); font-weight: 500; font-size: 12.5px; }
.table .tg { margin: 0; padding: 9px 14px 7px; font-size: 13px; font-weight: 800; color: var(--accent); background: #f6f9fc; border-top: 1px solid var(--line); }
.table .tg + .tr { border-top: 0; }
@media (max-width: 720px) {
    .table.t3 .tr, .table.t4 .tr { grid-template-columns: 1fr auto; }
    .table.t3 .tr span:nth-child(3), .table.t4 .tr span:nth-child(4) { grid-column: 1 / -1; }
    .table.t4 .tr span:nth-child(2) { grid-column: 1 / -1; order: 3; }
    .table.t4 .tr span:nth-child(3) { order: 2; text-align: right; }
    .table.t4 .tr span:nth-child(4) { order: 4; }
}
.ref h3 { scroll-margin-top: 80px; }
.ref-note a { color: var(--accent); font-weight: 700; }
.ref-lead { margin-top: -2px; }

/* ======================================================================
   소멸시효 계산기 전용
   ====================================================================== */
.step h2.h2-gap { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.h2-opt { font-size: 12.5px; font-weight: 600; color: var(--ink-light); }
.step > .field, .step > .seg, .step > .radios, .step > .crime-card, .step > .hint, .step > #start2Box { margin-top: 10px; }
.step > .hint { margin: 6px 2px 0; }
.seg.side span { min-height: 52px; }
#merchantBox .lab-line { margin-bottom: 2px; }
#start2Box { display: grid; gap: 6px; }
#start2Box[hidden] { display: none; }
.warn-hint { margin-top: 10px !important; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); color: #6b4a07; }

/* 그 뒤에 있었던 일 */
#events { display: grid; gap: 10px; margin-top: 10px; }
#events:empty { display: none; }
.ev { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: #f6f9fc; border: 1px solid var(--line); }
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ev-head b { font-size: 14.5px; }
.ev .del { border: 0; background: none; color: var(--ink-light); cursor: pointer; font-size: 20px; line-height: 1; padding: 2px 6px; }
.ev .del:hover { color: var(--seal); }
.ev .hint { margin: 0 2px; }
.ev-res { display: grid; gap: 6px; }
.ev-res label { display: flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ev-res input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; margin: 0; }
.ev-res label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ev-v { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.ev-v:empty { display: none; }
.ev-v span { font-weight: 800; }
.v-cut { color: var(--accent); }
.v-hold { color: var(--accent); }
.v-open { color: var(--amber); }
.v-late, .v-none { color: var(--seal); }
.ev-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ev-add .chip-s { padding: 7px 12px; }
.ev-add .chip-s[hidden] { display: none; }
.chip-s.soft { color: var(--ink-light); border-style: dashed; }

/* 결과 */
.big.held .dl-date { font-size: clamp(26px, 6.4vw, 36px); color: var(--accent); }
.big.past .dl-date { color: var(--seal); }
.big.rescue .dl-date { color: var(--amber); }
#resRuns:empty { display: none; }
.bar .seg-run { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.bar .seg-run.r0 { background: linear-gradient(90deg, #2d7fc0, #0b4a76); }
.bar .seg-run.r1 { background: linear-gradient(90deg, #5aa0d6, #1f68a0); }
.bar .seg-run.r2 { background: linear-gradient(90deg, #8fb2d2, #2d7fc0); }

/* 참고 표 */
.table.cuts .tr span:nth-child(2) { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.table.cuts .tr span:nth-child(3) { color: var(--accent); font-weight: 700; font-size: 13px; }
#claimTable button.tr.on { background: var(--accent-soft); }
