/* 나비로 Navi Law — 공통 스타일 (law.hondi.net)
   원칙: 단순·간결·명료. 한 줄 단(최대 960px), 본문 18px, 누르는 곳 44px 이상.
   색은 klaw·plan·mail과 같은 계열(남색·파랑·초록). */
:root {
  --navy: #002060;
  --green: #1b6b3a;
  --green-bg: #e6f4ec;
  --blue: #0057a8;
  --blue-bg: #ebf3fc;
  --bg: #f4f6f9;
  --paper: #ffffff;
  --line: #d1d9e6;
  --ink: #1a202c;
  --sub: #475569;
  --warn-bg: #fff8e6;
  --warn-line: #ecd9a0;
  --warn-ink: #5c4300;
  --accent: var(--blue);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 18px; line-height: 1.7; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.4; }
p { margin: 0 0 10px; }
[hidden] { display: none !important; }

/* 머리말 */
.head { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.head-in { max-width: 960px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 20px; color: var(--navy); text-decoration: none; letter-spacing: -0.03em; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 16px 14px; font-size: 17px; font-weight: 500; text-decoration: none; border-bottom: 3px solid transparent; min-height: 44px; }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 700; }
.nav a:hover { background: var(--bg); }
.head-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.head-right a.ext { font-size: 15px; color: var(--sub); text-decoration: none; padding: 10px 4px; }
.head-right a.ext:hover { text-decoration: underline; }

/* 본문 */
.wrap { max-width: 960px; margin: 0 auto; padding: 40px 20px 56px; }
.wrap h1 { font-size: 30px; margin-bottom: 8px; }
.wrap .sub { color: var(--sub); margin-bottom: 22px; }
.wrap h2 { font-size: 22px; margin: 36px 0 6px; }
.small { font-size: 16px; color: var(--sub); }

/* 입력창 */
.ask { display: flex; gap: 10px; flex-wrap: wrap; }
.ask input[type=text], .ask textarea {
  flex: 1 1 320px; min-height: 56px; padding: 14px 16px; font: inherit; border: 2px solid var(--accent); border-radius: 6px; background: #fff; color: var(--ink);
}
.ask input::placeholder, .ask textarea::placeholder { color: #64748b; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 56px; padding: 12px 22px; border: 2px solid var(--accent); border-radius: 6px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { filter: brightness(1.1); }
.btn.line { background: #fff; color: var(--accent); }
.btn.sm { min-height: 44px; padding: 8px 16px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.navy { background: var(--navy); border-color: var(--navy); }
.btn.green { background: var(--green); border-color: var(--green); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { background: #fff; border: 1px solid #cbd5e1; border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 16px; color: #334155; cursor: pointer; min-height: 44px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.notice { margin-top: 22px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); font-size: 16px; color: #334155; border-radius: 0 6px 6px 0; }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: #c98a00; color: var(--warn-ink); }

/* 홈: 문 두 개 */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 30px; }
.door { background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--blue); border-radius: 6px; padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.door.law { border-top-color: var(--navy); }
.door.scr { border-top-color: var(--green); }
.door.pick { outline: 3px solid #f2b705; }
.door h2 { font-size: 24px; margin: 0; }
.door p { color: var(--sub); font-size: 17px; margin: 0; }
.door .count { font-weight: 700; margin-top: 6px; font-size: 17px; }
.door .btn { margin-top: 14px; align-self: flex-start; }
.hint { text-align: center; margin-top: 16px; color: var(--sub); font-size: 16.5px; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 40px; }
.steps3 div { padding-top: 12px; border-top: 2px solid #cbd5e1; font-size: 16.5px; color: var(--sub); }
.steps3 b { display: block; font-size: 18px; color: var(--ink); }

/* 맺음말 */
.foot { background: #e9edf3; border-top: 1px solid var(--line); padding: 22px 20px; font-size: 15.5px; color: var(--sub); }
.foot-in { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.foot-links { display: flex; gap: 8px 24px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* 서류 목록 */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-top: 18px; }
.tab { padding: 10px 16px; font: inherit; font-size: 16.5px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; color: var(--sub); cursor: pointer; min-height: 44px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); font-weight: 700; color: var(--ink); }
.list { background: #fff; border: 1px solid var(--line); border-top: none; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 14px 18px; border-top: 1px solid #e2e8f0; align-items: center; }
.item:first-child { border-top: none; }
.item b { font-size: 17.5px; }
.item small { grid-column: 1; color: var(--sub); font-size: 15.5px; line-height: 1.55; }
.item .btn { grid-column: 2; grid-row: 1 / span 2; }
.lead-box { background: var(--blue-bg); border: 1px solid #b8d4f0; border-top: none; padding: 12px 18px; font-size: 16px; color: #1e3a5f; }
.meta-line { color: var(--sub); font-size: 15.5px; margin: 10px 0 0; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.field { background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px 12px; font: inherit; font-size: 16.5px; min-height: 44px; text-align: left; cursor: pointer; color: var(--ink); text-decoration: none; display: flex; align-items: center; }
.field:hover, .field[aria-current="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.more { margin-top: 10px; background: none; border: 0; font: inherit; font-size: 16.5px; font-weight: 700; color: var(--accent); cursor: pointer; padding: 10px 0; min-height: 44px; }
.field-head { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 0 6px 6px 0; padding: 14px 18px; margin-top: 22px; }
.field-head h2 { margin: 0 0 4px; font-size: 22px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { padding: 10px 14px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
th { background: #f1f5f9; font-weight: 700; }
details.fold { margin-top: 22px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
details.fold > summary { padding: 14px 18px; cursor: pointer; font-weight: 700; min-height: 44px; }
details.fold > div { padding: 0 18px 16px; font-size: 16px; color: var(--sub); }

/* 작성 화면 */
.phases { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: #fff; border-radius: 6px; overflow: hidden; margin-top: 16px; }
.phase { padding: 12px 8px; text-align: center; font-size: 16px; color: var(--sub); border-right: 1px solid #e2e8f0; }
.phase:last-child { border-right: none; }
.phase.done { background: var(--green-bg); color: var(--ink); }
.phase.on { background: var(--accent); color: #fff; font-weight: 700; }
.start { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px; margin-top: 16px; display: grid; gap: 12px; }
.start label { font-weight: 700; font-size: 16.5px; display: grid; gap: 6px; }
.start input, .start textarea { font: inherit; font-weight: 400; padding: 12px 14px; border: 2px solid #cbd5e1; border-radius: 6px; min-height: 48px; color: var(--ink); background: #fff; width: 100%; }
.start input:focus, .start textarea:focus { border-color: var(--accent); }
.work { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; margin-top: 18px; align-items: start; }
@media (max-width: 800px) { .work { grid-template-columns: 1fr; } }
.pane { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.pane h2 { font-size: 20px; margin: 0 0 10px; }
.pane-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.draft { font-size: 16.5px; line-height: 1.75; overflow-wrap: anywhere; }
.draft h1 { font-size: 20px; } .draft h2 { font-size: 18px; margin: 18px 0 6px; } .draft h3 { font-size: 17px; }
.draft table { margin: 10px 0; }
.draft table.meta { font-size: 14.5px; color: var(--sub); }
.draft blockquote { margin: 10px 0; padding: 8px 14px; border-left: 4px solid #cbd5e1; background: #f8fafc; }
.draft code { background: #f1f5f9; padding: 1px 5px; border-radius: 3px; font-size: .92em; }
.empty { color: var(--sub); border: 2px dashed #cbd5e1; border-radius: 6px; padding: 22px; text-align: center; font-size: 16.5px; }
.blanks { margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--line); }
.blanks h3 { font-size: 18px; margin-bottom: 6px; }
.chat-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
@media (max-width: 800px) { .chat-frame { height: 560px; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 16px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 80; max-width: 90vw; }
.toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 640px) {
  .wrap { padding: 28px 16px 44px; }
  .wrap h1 { font-size: 26px; }
  .item { grid-template-columns: 1fr; }
  .item .btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
  .phase { font-size: 14px; padding: 10px 4px; }
}
@media print { .head, .foot, .ask, .pane-actions, .chat-frame { display: none !important; } }

/* 서류 자동 완성 */
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sug-wrap { position: relative; flex: 1 1 320px; }
.sug-wrap input[type=text] { width: 100%; }
.sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid #94a3b8; border-radius: 8px; box-shadow: 0 10px 28px rgba(15, 23, 42, .18); max-height: min(60vh, 460px); overflow-y: auto; }
.sug li { padding: 10px 16px; min-height: 48px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.sug li[aria-selected="true"], .sug li:hover { background: var(--blue-bg); }
.sug-t { font-size: 17.5px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.sug-t mark { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
.sug-m { font-size: 14.5px; color: var(--sub); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sug-free { border-top: 1px solid var(--line); }
.sug-free .sug-t { font-weight: 500; color: var(--accent); }
.badge { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 13.5px; font-weight: 700; line-height: 1.6; }
.badge.scr { background: var(--green-bg); color: var(--green); }
.badge.law { background: #e6ecf8; color: var(--navy); }

/* 나비로의 특징 배너 (홈·서류 목록) */
.promo-wrap { background: var(--navy); }
.promo { color: #fff; }
.promo-in { max-width: 960px; margin: 0 auto; padding: 22px 20px 18px; }
.promo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.promo h2 { font-size: 21px; margin: 0 0 10px; color: #fff; }
.promo-list { margin: 0; padding-left: 1.5em; display: grid; gap: 6px; font-size: 17.5px; line-height: 1.65; }
.promo-list li::marker { font-weight: 700; color: #bcd3f5; }
.promo-note { margin: 10px 0 0; font-size: 14.5px; color: #c9d7ee; }
.promo-close { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; font: inherit; font-size: 15.5px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.65); border-radius: 6px; cursor: pointer; }
.promo-close:hover { background: rgba(255,255,255,.14); }
.promo-close:focus-visible { outline-color: #ffd43b; }
@media (max-width: 640px) { .promo-in { padding: 18px 16px 14px; } .promo-list { font-size: 16.5px; } .promo-close { order: -1; margin-left: auto; } }
@media print { .promo-wrap { display: none !important; } }
