/* ======================================================================
   소장 작성 AI · 2026-09-19 전면 개선 · 틀과 색은 내용증명 작성 AI(문서 AI 앱 정본)에서 가져왔다
   법률 업무 앱 표준(헌법 §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;
    --ok-soft: #e4f3ea;
    --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, input, select, output { 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: 206px; margin: -8px 24px -36px 0; }   /* 허리 아래가 카드 뒤로 숨는다 */
    .hero-bubble {
        position: absolute; right: calc(100% + 4px); top: 30px; width: 208px; 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); }
.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; }
.inputs { 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; }
    .inputs.stick { position: sticky; top: 76px; }   /* 화면에 다 들어올 때만(script.js fitSticky) */
}

.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 12px; 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;
}
.step-lead { margin: -4px 0 12px 36px; font-size: 13.5px; color: var(--ink-light); line-height: 1.55; }


/* ── 결과 ─────────────────────────── */
.result { padding: 22px; }
.empty { margin: 0 0 16px; font-size: 14px; color: var(--ink-light); line-height: 1.55; }
.empty b { color: var(--ink-soft); font-size: 15px; }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; }

.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(--accent); border: 1.5px solid var(--accent); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.badge.paper { color: var(--ink-soft); border-color: var(--ink-light); }

.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.warn b { color: #4d3505; }
.note.law { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: none; border: 0; padding: 0; margin-top: 14px; }
.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-note { margin: 9px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-light); }
.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; }

/* 조변 버튼 — 결과 화면에 하나만(헌법 §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 { margin-left: 68px; width: calc(100% - 68px); text-align: center; }
}

/* ── 참고 표(= 계산 데이터) · 법정기간 계산기와 같은 행 모양 ── */
.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 10px; color: var(--ink-soft); font-size: 14.5px; }
.ref-lead b { color: var(--ink); }
.ref h3 { margin: 24px 0 8px; font-size: 16px; font-weight: 800; color: var(--accent); }
.ref h3 em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--ink-light); margin-left: 4px; }
.table { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tr {
    display: grid; grid-template-columns: 1.2fr .7fr 1.6fr 1.2fr; 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.t3 { grid-template-columns: 1.3fr 1.4fr 1.2fr; }
.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; }
.tr em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--ink-light); margin-left: 2px; }
.tr span:nth-child(4), .tr.t3 span:nth-child(3) { 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.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
@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.t3 { grid-template-columns: 1fr auto; }
    .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); line-height: 1.6; }
.ref-note b { color: var(--ink-soft); }

.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%); }


/* ── 입력 공통 ── */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-top: 12px; min-width: 0; }
.field em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--ink-light); }
.field input[type="text"], .field input[type="date"], .field textarea {
    font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); width: 100%; min-width: 0;
    border: 1px solid var(--line-strong); border-radius: 11px; padding: 9px 11px; background: #fff; min-height: 44px;
}
.field textarea { resize: vertical; line-height: 1.55; font-weight: 500; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(45, 127, 192, .15); }
.hint2 { font-size: 12px; font-weight: 500; color: var(--ink-light); }
.money { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; padding: 0 12px; }
.money:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(45, 127, 192, .15); }
.field .money input { border: 0; box-shadow: none; padding: 9px 0; text-align: right; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.field .money input:focus { box-shadow: none; }
.money i { font-style: normal; font-weight: 700; color: var(--ink-soft); }
.money.pct { max-width: 160px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { cursor: pointer; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft); font-size: 14px; font-weight: 700; padding: 7px 13px; border-radius: 999px; transition: all .15s; }
.seg button:hover { border-color: var(--accent); color: var(--accent); }
.seg button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
    border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px 6px 10px; background: #fff; }
.chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.chk:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chk.yes { display: flex; align-items: flex-start; border-radius: 12px; margin-top: 12px; padding: 10px 12px; }
.chk.yes input { margin-top: 2px; }
.chk.yes small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-light); margin-top: 2px; }

/* ① 목적 */
.pgroup { margin: 12px 0 6px; font-size: 12.5px; font-weight: 800; color: var(--accent); letter-spacing: .04em; }
.pgroup:first-child { margin-top: 0; }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1120px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.purpose { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-width: 0;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; transition: border-color .15s, background .15s, transform .15s; }
.purpose:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.purpose b { font-size: 14.5px; font-weight: 800; line-height: 1.3; }
.purpose small { font-size: 12px; color: var(--ink-light); line-height: 1.35; }
.purpose[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* ② 당사자 */
.who, .recv { margin-top: 4px; }
.recv { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 14px; }
.who-label { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 13px; font-weight: 800; color: var(--accent); }
.pair { display: grid; gap: 0 10px; }
@media (min-width: 480px) { .pair { grid-template-columns: 1.3fr 1fr; } }
.x { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-light); }
.x:hover { border-color: var(--seal); color: var(--seal); }
.x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.add-row { margin-top: 12px; width: 100%; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
    border: 1.5px dashed var(--line-strong); background: #fff; color: var(--accent); font-size: 14px; font-weight: 800; padding: 9px; border-radius: 12px; }
.add-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.add-row svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.field.more { margin-top: 16px; }

/* ④ 쓰기 */
.go { margin-top: 18px; width: 100%; min-height: 54px; cursor: pointer; border: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, #0b4a76 0%, #10203a 100%); color: #fff; font-size: 17px; font-weight: 800;
    box-shadow: 0 8px 20px rgba(11, 74, 118, .25); transition: transform .15s, box-shadow .15s, opacity .15s; }
.go:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(11, 74, 118, .3); }
.go:disabled { opacity: .55; cursor: wait; transform: none; }
.go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.limit-inline { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 9px 12px; font-size: 13px; line-height: 1.6;
    background: rgba(128, 128, 128, .12); border: 1px solid rgba(128, 128, 128, .32); border-radius: 10px; color: var(--ink-soft); }
.limit-inline svg { width: 14px; height: 14px; flex: none; margin-top: 3px; fill: none; stroke: currentColor; stroke-width: 1.8; opacity: .55; }
.limit-inline b { color: var(--ink); }
.limit-inline.low b { color: var(--seal); }
.limit-inline .dots { display: inline-flex; gap: 3px; vertical-align: 1px; margin: 0 4px; }
.limit-inline .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.limit-inline .dots i.used { background: #c9d3de; }
.err { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; background: var(--seal-soft); border: 1px solid #f1c7bf; color: #8c2b1c; font-weight: 600; }

/* ── 기한 타임라인(핵심 시각화) ── */
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tl-title { margin: 0; font-size: 15px; font-weight: 800; }
.tl-sub { font-size: 12.5px; color: var(--ink-light); font-weight: 600; }
.tl { position: relative; height: 26px; margin: 6px 6px 4px; }
.tl-bar { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 3px; background: linear-gradient(90deg, var(--accent-soft-2), var(--accent)); }
.tl-dot { position: absolute; top: 5px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 3px solid #fff; background: var(--accent); box-shadow: 0 1px 4px rgba(16, 32, 58, .25); }
.tl-far { position: absolute; right: -4px; top: -14px; font-size: 11px; font-weight: 700; color: var(--ink-light); }
.tl-ghost { display: flex; gap: 8px; align-items: center; height: 26px; }
.tl-ghost i { flex: 1; height: 4px; border-radius: 3px; background: repeating-linear-gradient(90deg, #eef2f6 0 10px, #e4eaf0 10px 12px); }
.k-now { --kc: var(--ink); } .k-arrive { --kc: var(--accent-2); } .k-due { --kc: var(--amber); } .k-suit { --kc: var(--seal); }
.k-expiry, .k-expiry2 { --kc: #6b3fa0; } .k-end { --kc: var(--ok); } .k-win { --kc: var(--accent); }
.tl-dot { background: var(--kc, var(--accent)); }
.tl-list { list-style: none; margin: 10px 0 0; padding: 0; position: relative; }
.tl-list::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-list li { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; padding: 6px 0 6px 22px; font-size: 13px; }
.tl-list li::before { content: ''; position: absolute; left: 0; top: 10px; width: 14px; height: 14px; border-radius: 50%; background: var(--kc, var(--accent)); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.tl-list li.past { opacity: .55; }
.tl-when b { display: block; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tl-when small, .tl-what small { display: block; font-size: 12px; color: var(--ink-light); font-weight: 500; line-height: 1.45; }
.tl-what b { color: var(--kc, var(--ink)); font-size: 14px; }
.tl-list .law-chip { align-self: center; white-space: nowrap; }
@media (max-width: 520px) { .tl-list li { grid-template-columns: 92px minmax(0, 1fr); } .tl-list .law-chip { grid-column: 2; justify-self: start; } }
.tnote { margin: 8px 0 0; padding: 9px 12px; border-radius: 11px; font-size: 13.5px; line-height: 1.6; background: #f6f9fc; border: 1px solid var(--line); color: var(--ink-soft); }
.tnote.ok { background: var(--ok-soft); border-color: #cbe7d6; color: #1c5a3c; }
.tnote.warn { background: var(--amber-soft); border-color: #f0dca8; color: #6b4a07; }
.tnote.danger { background: var(--seal-soft); border-color: #f1c7bf; color: #8c2b1c; font-weight: 600; }
.tnote .law-chip { margin-left: 2px; }
a.law-chip { text-decoration: none; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; }
a.law-chip:hover { text-decoration: underline; }
#resultEmpty { margin-top: 16px; }
.dim { color: var(--ink-light); font-size: 13px; font-weight: 500; }

/* 불러오는 중 */
.loading { text-align: center; padding: 18px 0 8px; }
.scan { position: relative; width: 92px; height: 116px; margin: 0 auto 14px; padding: 16px 14px; background: #fff; border: 1.5px solid var(--line-strong); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; gap: 9px; box-shadow: var(--shadow); }
.scan i { display: block; height: 5px; border-radius: 3px; background: #dfe6ee; }
.scan i:nth-child(2) { width: 80%; } .scan i:nth-child(4) { width: 64%; }
.scan b { position: absolute; left: 0; right: 0; top: 0; height: 26px; background: linear-gradient(180deg, rgba(45, 127, 192, 0) 0%, rgba(45, 127, 192, .28) 100%); border-bottom: 2px solid var(--accent-2); animation: scan 1.8s ease-in-out infinite; }
@keyframes scan { 0% { transform: translateY(-26px); } 100% { transform: translateY(116px); } }
.load-msg { margin: 0; font-size: 16px; font-weight: 800; }
.load-sub { margin: 4px 0 0; font-size: 13px; color: var(--ink-light); font-variant-numeric: tabular-nums; }
.demo-flag { margin: 8px 0 0; font-size: 13px; color: #6b4a07; background: var(--amber-soft); border: 1px solid #f0dca8; border-radius: 10px; padding: 6px 10px; }
#letterBox { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }

/* ── 종이(내용증명) ── */
.paper {
    margin-top: 12px; background: #fffefb; border: 1px solid #e3ddcf; border-radius: 6px; padding: 28px 26px 30px;
    box-shadow: 0 1px 0 #efe9da, 0 10px 26px rgba(16, 32, 58, .10);
    font-family: var(--serif); color: #1b1b1b; line-height: 1.85; font-size: 15px;
}
.p-title { margin: 0 0 16px; text-align: center; font-size: 22px; font-weight: 900; letter-spacing: .3em; }
.p-parties { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 14px; }
.p-parties th { width: 76px; text-align: left; vertical-align: top; font-weight: 700; padding: 3px 8px 3px 0; white-space: nowrap; letter-spacing: .08em; }
.p-parties td { padding: 3px 0; }
.p-parties .pn { display: block; font-weight: 700; }
.p-parties .pa { display: block; color: #444; font-size: 13.5px; }
.p-subject { margin: 0 0 12px; font-weight: 700; border-top: 1px solid #d9d2c1; border-bottom: 1px solid #d9d2c1; padding: 6px 0; }
.p-body { margin: 0; padding-left: 1.4em; }
.p-body li { margin: 0 0 8px; padding-left: 2px; }
.p-closing { margin: 12px 0 0; }
.p-date { margin: 20px 0 0; text-align: right; }
.p-sign { margin: 4px 0 0; text-align: right; }
.p-seal { color: #666; font-size: 13px; }
.paper [contenteditable="true"] { border-radius: 4px; outline: 0; transition: background .15s; }
.paper [contenteditable="true"]:hover { background: rgba(45, 127, 192, .06); }
.paper [contenteditable="true"]:focus { background: rgba(45, 127, 192, .10); box-shadow: 0 0 0 2px rgba(45, 127, 192, .25); }
@media (max-width: 480px) { .paper { padding: 20px 16px 22px; font-size: 14.5px; } .p-parties th { width: 62px; } }

.act.primary { background: var(--accent); border-color: var(--accent); color: #fff; justify-content: center; white-space: nowrap; }
.act.primary:hover { background: #093d62; color: #fff; }
.act:disabled { opacity: .5; cursor: default; }
.revise { display: flex; gap: 8px; align-items: flex-end; margin-top: 14px; }
.revise .field { flex: 1; margin-top: 0; }
.revise.off { opacity: .6; }
@media (max-width: 480px) { .revise { flex-direction: column; align-items: stretch; } }
.checklist { margin-top: 14px; }
.cl-title { margin: 0 0 4px; font-size: 14px; font-weight: 800; }
.checklist ul { margin: 0; padding-left: 1.2em; font-size: 14px; color: var(--ink-soft); }
.checklist li { margin: 3px 0; }
.laws { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.lc-label { font-size: 12.5px; font-weight: 800; color: var(--ink-light); margin-right: 2px; }

/* 조문 표 행 = 링크 · 기한 표 */
a.tr { text-decoration: none; transition: background .12s; }
a.tr:hover { background: #f6f9fc; }
.tr.law { grid-template-columns: 1.15fr 1fr 2fr; }
.tr.law span:nth-child(2) { color: var(--ink-soft); font-weight: 700; }
#limitTable .tr { grid-template-columns: 1fr 1.6fr 1.1fr 1.1fr; }
#limitTable .tr span:nth-child(2) { color: var(--ink); font-weight: 700; }
@media (max-width: 720px) { .tr.law, #limitTable .tr { grid-template-columns: 1fr; } .tr.law span:nth-child(2) { font-size: 13px; } }

@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; }
    .step-lead { margin-left: 0; }
    .act { padding: 9px 11px; font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 인쇄: 결과가 있으면 종이만 3통(원본 1 + 등본 2) · A4 · 쪽 여백은 표 머리·꼬리(script.js buildPrint)
   결과가 없을 때 Ctrl+P 는 화면 그대로 찍힌다(아래 @page 여백). */
@page { size: A4; margin: 20mm 18mm; }
#printSheet { display: none; }
.deadline-hint { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
@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; }
    html.print-paper body { background: #fff !important; }
    html.print-paper body > *:not(#printSheet) { display: none !important; }
    html.print-paper #printSheet { display: block; }
    .ps-copy { width: 100%; border-collapse: collapse; }
    .ps-copy + .ps-copy { break-before: page; page-break-before: always; }
    .ps-gap { height: 20mm; padding: 0; }
    .ps-body { padding: 0 20mm; vertical-align: top; }
    #printSheet .paper { margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 0; background: #fff; font-size: 11.5pt; line-height: 1.8; }
    #printSheet .p-title { font-size: 18pt; margin-bottom: 18pt; }
    #printSheet .p-parties, #printSheet .p-body li, #printSheet .p-closing, #printSheet .p-sign { break-inside: avoid; }
    #printSheet .p-date { break-after: avoid; }
}

/* ══ 소장 작성 AI 전용 ══ */
.step-foot { margin: 12px 0 0; font-size: 13px; color: var(--ink-light); line-height: 1.55; }
.def-hint { margin: 4px 0 10px; font-size: 13px; color: var(--ink-soft); background: #f6f9fc; border: 1px solid var(--line); border-radius: 11px; padding: 8px 12px; line-height: 1.55; }
.field.court { margin-top: 14px; }
.field.wide { grid-column: 1 / -1; }
.claim-wrap { margin-bottom: 14px; }
.cb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cb-head .linklike { font-size: 13px; }
.cb-empty { margin: 0; font-size: 14px; color: var(--ink-light); line-height: 1.55; background: #f6f9fc; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 14px; }
#claimBox .cb-case { margin: 0 0 6px; font-family: var(--serif); font-size: 14.5px; color: var(--ink-soft); }
#claimBox .cb-case b { color: var(--ink); }
.cb-lines { margin: 0; padding: 12px 14px 12px 34px; background: #fffefb; border: 1px solid #e3ddcf; border-radius: 12px; font-family: var(--serif); font-size: 14.5px; line-height: 1.8; color: #1b1b1b; }
.cb-lines li { margin: 2px 0; padding-left: 2px; }
.cb-tail { margin: 6px 0 0 34px; font-family: var(--serif); font-size: 14px; color: var(--ink-soft); }
.cost { margin: 0 0 14px; }
.cost:empty { display: none; }
.cost-title { margin: 0 0 8px; font-size: 15px; font-weight: 800; }
.cost-title .dim { font-size: 12.5px; font-weight: 600; }
.cost-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cost-col { background: #f6f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.cost-col:first-child { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.cc-h { margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--accent); }
.cc-row { margin: 3px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 13.5px; color: var(--ink-soft); }
.cc-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cc-row small { flex-basis: 100%; font-size: 11.5px; color: var(--ink-light); }
.cc-sum { margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed var(--line-strong); font-size: 14px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.cost-foot { margin: 8px 0 0; font-size: 12px; color: var(--ink-light); line-height: 1.55; }
.cost-empty { margin: 0; font-size: 13.5px; color: var(--ink-light); background: #f6f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
@media (max-width: 380px) { .cost-grid { grid-template-columns: 1fr; } }
.tlbox { margin-bottom: 14px; }
.tl-ghost-row { padding: 6px 0 6px 22px; font-size: 13px; color: var(--ink-light); }
#paperWrap { scroll-margin-top: 72px; border-top: 1px solid var(--line); padding-top: 14px; }
/* 소장 종이 */
.p-case { margin: 4px 0 14px; font-size: 15px; }
.p-case b { font-weight: 800; }
.p-sec { margin: 18px 0 8px; text-align: center; font-size: 16px; font-weight: 900; letter-spacing: .35em; }
.p-claim { margin: 0; padding-left: 1.5em; }
.p-claim li { margin: 0 0 4px; }
.p-tail { margin: 6px 0 0 1.5em; }
.p-cause .p-h { margin: 12px 0 4px; font-weight: 800; }
.p-cause .p-para { margin: 0 0 6px; text-indent: 1em; }
.p-list { margin: 0; padding-left: 1.5em; }
.p-list li { margin: 0 0 2px; }
.p-court { margin: 18px 0 0; font-size: 17px; font-weight: 900; letter-spacing: .08em; }
.p-annex { margin-top: 22px; padding-top: 14px; border-top: 1px dashed #d9d2c1; }
.p-annex-t { margin: 0 0 4px; text-align: center; font-weight: 700; }
.p-annex-b { margin: 0; }
@media print {
    #printSheet .p-sec { font-size: 13pt; margin: 14pt 0 6pt; }
    #printSheet .p-claim li, #printSheet .p-cause .p-para, #printSheet .p-list li, #printSheet .p-court { break-inside: avoid; }
    #printSheet .p-sec, #printSheet .p-cause .p-h { break-after: avoid; }
    #printSheet .p-annex { break-before: page; border-top: 0; padding-top: 0; margin-top: 0; }
    #printSheet .p-court { font-size: 14pt; }
}
.ref-list { margin: 12px 0 0; padding-left: 1.2em; font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.ref-list li { margin: 0 0 6px; }
.ref-list b { color: var(--ink); }

/* 라벨 글자와 «(선택)»을 한 줄로 · 나란한 입력칸은 아래선을 맞춘다(2026-09-19 조변 지적: «연락처 (선택)» 칸만 24px 내려가 삐뚤었다) */
.field .lab { display: block; }
.field .lab em { margin-left: 3px; }
.pair { align-items: end; }
