:root {
  --ink: #123b52;
  --ink-soft: #3c5a6b;
  --muted: #5d7280;
  --line: #d8e0e6;
  --bg: #f6f8f9;
  --paper: #ffffff;
  --accent: #0f6a63;
  --accent-soft: #e6f2f0;
  --bad: #a3271f;
  --bad-soft: #fbebe9;
  --review: #8a5a00;
  --review-soft: #fdf3df;
  --ok: #0f5b4a;
  --ok-soft: #e7f4ef;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 59, 82, 0.08), 0 8px 24px rgba(18, 59, 82, 0.06);
}

* { box-sizing: border-box; }

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

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.chrome { background: var(--paper); border-bottom: 1px solid var(--line); }
.chrome .in {
  max-width: 960px; margin: 0 auto; padding: 12px 16px;
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: baseline;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.chrome a:not(.brand) { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.chrome a[aria-current="page"] { color: var(--accent); font-weight: 700; }

main { max-width: 960px; margin: 0 auto; padding: 20px 16px 56px; }

h1 { font-size: 24px; line-height: 1.3; margin: 6px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }
b { color: var(--ink); }

.lead { font-size: 16px; color: var(--ink-soft); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.privacy-note {
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius); padding: 10px 12px; font-size: 14px; margin-bottom: 14px;
}

.steps { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 16px; }
.step {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; display: grid; gap: 2px; font-size: 14px;
}
.step b { font-size: 14px; }
.step span { color: var(--muted); }

.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 16px; box-shadow: var(--shadow);
}

.row { display: flex; flex-wrap: wrap; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; font-size: 13px; color: var(--ink-soft); }
.field > span { font-weight: 600; }
input, select, button { font: inherit; }
input[type="text"], input[type="date"], input[inputmode], select {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; color: var(--ink);
  min-height: 42px; width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.row-actions { margin: 8px 0 12px; }

.btn {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: 8px; padding: 10px 14px; font-weight: 600; cursor: pointer;
  min-height: 42px; font-size: 14px;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-ghost { background: #fff; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; }
.file-btn input { display: none; }

details.more { margin: 10px 0 4px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 8px 12px; }
details.more summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.flags { border: 0; padding: 8px 0 0; margin: 0; display: grid; gap: 8px; }
.flags legend { font-size: 12px; color: var(--muted); font-weight: 700; padding-top: 6px; }
.flags label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-soft); }
.flags label input[type="checkbox"] { width: 18px; height: 18px; }
.flags label select, .flags label input[inputmode] { max-width: 220px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; }
.stats > div { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.cards { display: grid; gap: 10px; margin-bottom: 16px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--muted);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.card.is-non { border-left-color: var(--bad); }
.card.is-review { border-left-color: var(--review); }
.card.is-ok { border-left-color: var(--ok); }
.card-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.card-title { font-weight: 700; font-size: 15px; }
.card-meta { font-size: 12px; color: var(--muted); }
.card-amount { font-variant-numeric: tabular-nums; font-weight: 700; }
.badge {
  display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700;
  border: 1px solid transparent;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3d6; }
.badge-non { background: var(--bad-soft); color: var(--bad); border-color: #f2c9c4; }
.badge-review { background: var(--review-soft); color: var(--review); border-color: #f0dcb2; }
.card p { margin: 6px 0 0; font-size: 13.5px; }
.card .law { color: var(--ink-soft); font-size: 12.5px; }
.card .next { color: var(--muted); font-size: 13px; }
.card-actions { display: flex; gap: 6px; margin-top: 8px; }
.card-actions button {
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px;
  font-size: 12px; color: var(--ink-soft); cursor: pointer;
}
.card-actions button:hover { border-color: var(--accent); color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg); font-size: 13px; color: var(--ink-soft); }
td { font-variant-numeric: tabular-nums; }

.links { padding-left: 18px; margin: 0 0 10px; }
.note-list { padding-left: 18px; margin: 0 0 10px; }
.note-list li, .links li { margin-bottom: 6px; }

.callout { border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.callout.warn { background: var(--review-soft); color: #6b4a09; }

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

.ad-slot {
  margin: 16px 0; padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius);
  text-align: center; color: var(--muted); font-size: 12.5px; background: #fbfcfc;
}

footer.chrome { margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 0; }
footer.chrome .in { display: grid; gap: 14px; align-items: start; }
footer .disc { font-size: 12.5px; color: var(--muted); margin: 0; }
footer section h2 { font-size: 13px; margin: 0 0 6px; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
footer ul a { font-size: 13px; }
footer section:first-of-type { grid-column: 1 / -1; }

@media (min-width: 720px) {
  h1 { font-size: 30px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  footer.chrome .in { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  main { padding: 28px 20px 72px; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .chrome, .ad-slot, #entry-panel, #setup-panel, #export-panel, .card-actions { display: none !important; }
  main { max-width: none; padding: 0; }
  .panel, .card { box-shadow: none; border-color: #bbb; break-inside: avoid; page-break-inside: avoid; }
  .card { border-left-width: 3px; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  a[href^="/"]::after { content: ""; }
}
