:root {
  --ink: #16211c;
  --muted: #5b6b62;
  --line: #d8e3db;
  --bg: #f6f8f4;
  --card: #ffffff;
  --brand: #1f4d3d;
  --brand-soft: #e7f1ea;
  --accent: #b4562a;
  --danger: #a32b2b;
  --today: #8a4b00;
  --overdue: #8d1f1f;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: var(--brand); }
a:hover { text-decoration: none; }

nav.site {
  background: var(--brand);
  color: #fff;
}
nav.site .in {
  max-width: 1060px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}
nav.site a { color: #eaf3ee; text-decoration: none; font-size: 14px; }
nav.site a[aria-current="page"] { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
nav.site .brand { font-weight: 700; font-size: 16px; margin-right: auto; color: #fff; }

main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

h1 { font-size: 26px; line-height: 1.3; margin: 8px 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 19px; margin: 30px 0 10px; }
h3 { font-size: 16px; margin: 0 0 4px; }
p { margin: 8px 0; }
ul, ol { padding-left: 20px; }
li { margin: 4px 0; }
small { color: var(--muted); font-size: 12px; }
code { background: var(--brand-soft); padding: 1px 5px; border-radius: 5px; font-size: 14px; }

.updated { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.lead { font-size: 17px; }
.note { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 14px; }

.aeo {
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 14px 0;
}
.aeo .q { font-weight: 700; font-size: 13px; color: var(--brand); margin: 0 0 2px; }
.aeo p:last-child { margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.card.quick { border-color: #bcd6c6; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; align-items: end; }
.grid label, .grid-3 label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.grid input, .grid select, .grid-3 input, .grid-3 select, textarea, .card > label input {
  font: inherit;
  color: var(--ink);
  padding: 9px 10px;
  border: 1px solid #c3d2c8;
  border-radius: 9px;
  background: #fff;
  min-width: 0;
  width: 100%;
}
textarea { font: inherit; width: 100%; padding: 10px; border: 1px solid #c3d2c8; border-radius: 9px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #1f4d3d55; outline-offset: 1px; }
[aria-invalid="true"] { border-color: var(--danger) !important; background: #fff5f5; }
.field-err { color: var(--danger); font-size: 12px; min-height: 0; }
.field-err:empty { display: none; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
button {
  font: inherit;
  font-size: 15px;
  border: 0;
  border-radius: 9px;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}
button.secondary { background: var(--brand-soft); color: var(--brand); border: 1px solid #b7d2c1; }
button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
button.danger { color: var(--danger); border-color: #e3b7b7; }
button:hover { filter: brightness(0.97); }

label.file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  border: 1px dashed #b7d2c1;
  border-radius: 9px;
  padding: 9px 12px;
  cursor: pointer;
  background: #fff;
  color: var(--brand);
}
label.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.quick-out:empty { display: none; }
.quick-big {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--brand-soft);
  margin: 10px 0;
}
.quick-big strong { font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; }
.quick-big span { color: var(--muted); font-size: 14px; }
.quick-big.badge-overdue { background: #fbeaea; }
.quick-big.badge-today { background: #fdf1d8; }
.quick-big.badge-d1 { background: #fdf3e3; }

.kv { list-style: none; padding: 0; margin: 10px 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); font-size: 14px; }
.kv strong { font-weight: 600; text-align: right; }
.kv.errors li { color: var(--danger); }
.kv.errors small { display: block; color: var(--muted); }

.sum {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 8px 0 12px;
  font-size: 14px;
  color: var(--muted);
}
.sum span { background: #eef4ef; border-radius: 20px; padding: 4px 10px; }
.sum strong { color: var(--ink); }
.sum-money { background: #fbf8f2; border: 1px solid #eadfc9; border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; }
.sum-money p { margin: 2px 0; font-size: 14px; }

.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.board { display: grid; gap: 10px; margin-top: 14px; }
.item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 11px;
  padding: 10px 12px;
  background: #fdfefd;
}
.item.badge-overdue { border-left-color: var(--overdue); background: #fffafa; }
.item.badge-today { border-left-color: var(--today); background: #fffdf6; }
.item.badge-d1, .item.badge-d7 { border-left-color: #c47a12; }
.item-head { display: flex; align-items: baseline; gap: 10px; }
.item-head h3 { flex: 1 1 auto; min-width: 0; }
.badge {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand);
}
.item.badge-overdue .badge { background: #f8dede; color: var(--overdue); }
.item.badge-today .badge { background: #fbe9c9; color: var(--today); }
.meta { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.memo { font-size: 14px; margin: 4px 0; }
.item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.item-actions button { padding: 5px 10px; font-size: 13px; }
details.lease { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
details.lease summary { cursor: pointer; font-size: 14px; color: var(--brand); }

.free-sum { background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.free-sum p { margin: 0; font-size: 13px; color: var(--muted); }
.free-sum strong { font-size: 24px; margin-right: 10px; }
.free-sum span { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cards a.mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  text-decoration: none;
}
.cards a.mini strong { color: var(--brand); font-size: 15px; }
.cards a.mini span { color: var(--muted); font-size: 12px; }

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

.check { list-style: none; padding-left: 0; }
.check li::before { content: "· "; color: var(--brand); font-weight: 700; }

.faq details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.sources ul, .related ul { list-style: none; padding-left: 0; }
.sources li, .related li { font-size: 14px; }
.tool-err { color: var(--danger); font-size: 14px; min-height: 0; margin: 4px 0; }
.tool-err:empty { display: none; }

footer.site { background: #10241c; color: #c8d8ce; padding: 24px 0 40px; margin-top: 20px; }
footer.site .in { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
footer.site .disc { color: #9fb5a7; font-size: 12px; }
footer.site a { color: #d9e8df; }
footer.site h2 { font-size: 13px; color: #8fae9c; margin: 16px 0 4px; text-transform: uppercase; letter-spacing: 0.04em; }
footer.site ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
footer.site li { font-size: 13px; }

@media (max-width: 720px) {
  h1 { font-size: 22px; }
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .quick-big strong { font-size: 28px; }
  .kv li { flex-direction: column; gap: 2px; }
  .kv strong { text-align: left; }
  table { min-width: 360px; }
}
@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr; }
}
