:root {
  --ink: #17211c;
  --ink-soft: #4f5f57;
  --line: #d8e2dc;
  --bg: #f5f8f6;
  --card: #ffffff;
  --brand: #1d5c4a;
  --brand-soft: #e6f1ec;
  --warn: #8a4b00;
  --warn-bg: #fff4e0;
  --danger: #a4262c;
  --ok: #1d6b3f;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

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

a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }

.chrome { background: var(--brand); color: #fff; }
.chrome a { color: #fff; text-decoration: none; }
.chrome .in { max-width: 940px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.chrome .brand { font-weight: 700; margin-right: auto; }
.chrome nav a { padding: 4px 0; border-bottom: 2px solid transparent; font-size: 15px; }
.chrome nav a[aria-current="page"] { border-bottom-color: #fff; }

main { max-width: 940px; margin: 0 auto; padding: 18px 16px 40px; }

h1 { font-size: clamp(1.35rem, 4vw, 1.9rem); line-height: 1.35; margin: 8px 0 6px; }
h2 { font-size: 1.15rem; margin: 26px 0 10px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
.updated { color: var(--ink-soft); font-size: 0.85rem; margin: 0 0 14px; }
.lead { font-size: 1.02rem; color: var(--ink-soft); }
.small { font-size: 0.82rem; }
.muted { color: var(--ink-soft); }

.grid.tiles { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 16px 0; }
@media (min-width: 640px) { .grid.tiles { grid-template-columns: 1fr 1fr 1fr; } }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.tile strong { display: block; color: var(--brand); }
.tile span { font-size: 0.85rem; color: var(--ink-soft); }

.tool-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 16px 0; }
.tool-card h2 { margin-top: 0; }

fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
fieldset legend { font-size: 0.9rem; font-weight: 700; color: var(--brand); padding: 0 4px; }
label { display: block; font-size: 0.9rem; margin: 8px 0 4px; }
label.choice { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; margin: 7px 0; padding: 6px 8px; border-radius: 8px; }
label.choice:hover { background: var(--brand-soft); }
label.choice input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--brand); }
fieldset.toggles label { display: flex; gap: 8px; align-items: flex-start; }

input, select, button, textarea { font: inherit; }
input[type="date"], input[type="text"], input[type="number"], select {
  width: 100%;
  min-width: 0;
  max-width: 340px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #7bbfa5; outline-offset: 2px; }

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
button, .cta {
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 0.95rem;
}
button.primary, .cta.primary { background: var(--brand); color: #fff; }
button.secondary, .cta.secondary { background: var(--brand-soft); border-color: var(--brand-soft); }
button.ghost { border-color: var(--line); color: var(--ink-soft); }

.tool-err { color: var(--danger); font-size: 0.88rem; margin: 6px 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.card p { margin: 6px 0; }
.verdict { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.badge { display: inline-block; font-weight: 700; border-radius: 999px; padding: 3px 11px; font-size: 0.9rem; border: 1px solid #c9dcef; background: var(--brand-soft); color: var(--brand); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: #f0d9b0; }
.verdict-line { font-size: 1.05rem; font-weight: 700; margin: 8px 0 4px; }
.notice { border-radius: 8px; padding: 9px 12px; font-size: 0.9rem; }
.notice.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0d9b0; }
.dday { font-weight: 700; color: var(--brand); }

ul.check { padding-left: 0; list-style: none; }
ul.check li { position: relative; padding-left: 20px; margin: 6px 0; font-size: 0.94rem; }
ul.check li::before { content: "✔"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

ol.steps { padding-left: 22px; }
ol.steps li { margin: 5px 0; font-size: 0.94rem; }

ul.links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-left: 0; list-style: none; }

.tw { overflow-x: auto; margin: 10px 0; }
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 0.9rem; }
th, td { border: 1px solid var(--line); padding: 8px 9px; text-align: left; vertical-align: top; }
thead th { background: var(--brand-soft); color: var(--brand); font-size: 0.85rem; }
tbody th { font-weight: 600; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
#facility-table th[scope="row"] { width: 58%; }
#facility-table td { width: 42%; }
.sheet table.check-table th[scope="row"] { width: 13%; white-space: nowrap; }
tr[data-status="na"] td { color: var(--ink-soft); }
.status-required { font-weight: 700; color: var(--brand); }
.status-optional { font-weight: 700; color: var(--ok); }
.status-na { color: var(--ink-soft); }

.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; font-size: 0.94rem; color: var(--ink-soft); }

.related, .sources { margin-top: 26px; font-size: 0.9rem; }
.related ul, .sources ul { padding-left: 18px; }

footer.chrome .in { display: block; font-size: 0.85rem; }
footer.chrome section { margin-top: 10px; }
footer.chrome h2 { font-size: 0.85rem; margin: 8px 0 4px; color: #d7ece3; }
footer.chrome ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
footer.chrome .disc { margin: 6px 0; color: #e7f2ed; }

.sheet { background: #fff; color: #111; border: 1px solid #bbb; padding: 18px; margin: 14px 0; }
.sheet h1 { font-size: 1.25rem; margin: 0 0 4px; }
.sheet .small { font-size: 0.78rem; color: #333; margin: 3px 0; }
table.check-table { font-size: 0.82rem; }
table.check-table th, table.check-table td { border: 1px solid #666; padding: 5px 6px; }
table.check-table td.box { width: 6%; text-align: center; }
table.check-table td.ref { width: 24%; font-size: 0.74rem; color: #444; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 10pt; }
  #site-nav, #site-footer, main > h1, main > .updated, main > .lead, .related, .sources, .no-print, #checklist-empty { display: none !important; }
  .chrome { display: none !important; }
  main { max-width: none; padding: 0; margin: 0; }
  #print-area { display: block !important; border: 0; padding: 0; margin: 0; }
  #print-area h1 { font-size: 15pt; }
  table.check-table { width: 100%; font-size: 8.2pt; border-collapse: collapse; }
  table.check-table th, table.check-table td { border: 0.5pt solid #666; padding: 3pt 4pt; }
  table.check-table tr { break-inside: avoid; }
  .sheet .small { font-size: 7.6pt; }
}
