:root {
  --ink: #16202b;
  --muted: #5a6672;
  --line: #d8dee6;
  --brand: #12355b;
  --brand-soft: #eef3f9;
  --warn-bg: #fff4e5;
  --warn-line: #e0a35a;
  --danger: #a4232b;
  --ok: #1c6b4a;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  background: #f7f8fa;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.65;
  font-size: 16px;
}

.chrome { background: #fff; border-bottom: 1px solid var(--line); }
.chrome .in { max-width: 960px; margin: 0 auto; padding: 10px 16px; }

nav.chrome .in { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
nav.chrome .brand { font-weight: 700; color: var(--brand); text-decoration: none; margin-right: 4px; }
nav.chrome a { color: var(--ink); text-decoration: none; font-size: 14px; padding: 4px 2px; }
nav.chrome a[aria-current="page"] { color: var(--brand); font-weight: 700; border-bottom: 2px solid var(--brand); }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }

h1 { font-size: 1.55rem; line-height: 1.35; margin: 0 0 6px; color: var(--brand); letter-spacing: -0.01em; }
h2 { font-size: 1.12rem; margin: 28px 0 8px; }
h3 { font-size: 1rem; margin: 20px 0 6px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin: 0 0 6px; }
a { color: #14508c; }
a:hover { text-decoration: underline; }

.updated { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.lead { font-size: 1.02rem; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.req { color: var(--danger); font-size: 12px; }
.error { color: var(--danger); font-weight: 600; min-height: 0; margin: 8px 0; font-size: 14px; }
.notice-n1 { border-left: 3px solid var(--line); padding-left: 12px; color: var(--muted); font-size: 13px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; font-size: 15px; color: var(--brand); }

.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field.checkbox { display: flex; gap: 8px; align-items: flex-start; }
.field.checkbox label { font-weight: 400; margin: 0; }
input[type="text"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #b9c2cc;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #7aa7d6; outline-offset: 1px; }
textarea { resize: vertical; min-height: 72px; }
input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; }

.cta {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  margin: 4px 6px 4px 0;
}
.cta:hover { background: #0d2745; text-decoration: none; }
.cta.secondary { background: #fff; color: var(--brand); }
.cta.secondary:hover { background: var(--brand-soft); }
.cta[disabled] { opacity: 0.5; cursor: not-allowed; }

.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
.result-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .result-grid { grid-template-columns: repeat(3, 1fr); } }
.result-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfcfd;
}
.result-grid span.result-label { display: block; font-size: 12px; color: var(--muted); }
.result-date { display: block; font-size: 1.25rem; letter-spacing: -0.01em; }
.result-grid .off { color: var(--muted); font-size: 15px; }
.result-grid .primary { border-color: var(--brand); background: var(--brand-soft); }

.badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}
.badge.soft { background: #e6ecf4; color: var(--brand); }
.badge.alert { background: var(--danger); }

.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 14px;
}

.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--brand-soft); font-weight: 700; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #eef1f4; }
.checklist li:last-child { border-bottom: 0; }
.progress { font-weight: 700; color: var(--brand); }

.faq details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: #33404d; }

.src-list { font-size: 13px; }
.related ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related li { margin: 0; }
.related a { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fff; text-decoration: none; font-size: 14px; }

footer.chrome { margin-top: 32px; border-top: 1px solid var(--line); border-bottom: 0; }
footer .disc { color: var(--muted); font-size: 12px; }
footer section { margin-top: 14px; }
footer section h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 4px; }
footer section ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }

.sheet-wrap { margin: 20px 0; }
.sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 20px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.sheet h2 { text-align: center; font-size: 1.35rem; letter-spacing: 0.28em; margin: 0 0 18px; }
.sheet ol { padding-left: 20px; }
.sheet .sign { margin-top: 26px; text-align: right; }
.sheet .foot { margin-top: 22px; font-size: 12px; color: #444; border-top: 1px solid var(--line); padding-top: 8px; }
.sheet .attachments { font-size: 13px; }

.local-cases { list-style: none; padding: 0; }
.local-cases li { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; margin: 0 0 8px; }

@page {
  size: A4;
  margin: 18mm 16mm;
}

@media print {
  body { background: #fff; font-size: 11.5pt; }
  nav.chrome, footer.chrome, .no-print, .updated, .notice-n1, .related, .sources, .faq { display: none !important; }
  main { max-width: none; padding: 0; }
  h1, .lead, form, #deadline-result { display: none !important; }
  .sheet-wrap[hidden] { display: none !important; }
  .sheet { border: 0; border-radius: 0; padding: 0; }
  .sheet h2 { margin-bottom: 12mm; }
  a { color: inherit; text-decoration: none; }
}

@media (max-width: 400px) {
  body { font-size: 15px; }
  h1 { font-size: 1.35rem; }
  main { padding: 16px 12px 32px; }
  .card { padding: 12px; }
  th, td { padding: 6px 8px; }
}
