:root {
  --ink:#263d36;
  --muted:#63726b;
  --paper:#f4f3ed;
  --line:#dedfd6;
  --green:#27664f;
  --sand:#ba895c;
  --white:#fffefa;
  --warn:#785925}
* {
  box-sizing:border-box}
html {
  scroll-behavior:smooth;
  scroll-padding-top:24px}
body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR",sans-serif;
  font-size:15px}
header {
  border-bottom:1px solid var(--line);
  padding:22px 5%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:var(--white)}
.brand {
  display:flex;
  gap:12px;
  align-items:center}
.brand-mark {
  font:26px Georgia;
  background:var(--green);
  color:white;
  border-radius:50%;
  width:42px;
  height:42px;
  display:grid;
  place-items:center}
.brand strong {
  font-size:18px}
.brand small {
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-top:3px}
.local {
  font-size:12px;
  color:var(--green);
  background:#e7ede4;
  border-radius:20px;
  padding:7px 13px}
main {
  max-width:1320px;
  margin:auto;
  padding:42px 28px}
.intro {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:30px}
.eyebrow {
  font-size:11px;
  letter-spacing:2px;
  color:var(--green);
  font-weight:700}
h1 {
  font-size:38px;
  letter-spacing:-1.8px;
  line-height:1.3;
  margin:14px 0 18px;
  font-weight:650}
p {
  line-height:1.7}
.intro p:last-child {
  color:var(--muted);
  font-size:14px}
.intro-actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:end;
  max-width:420px}
.intro-actions label {
  width:100%}
button,.subtle {
  border:0;
  border-radius:8px;
  background:var(--green);
  color:white;
  padding:12px 18px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap}
.subtle {
  background:var(--white);
  border:1px solid var(--line);
  color:var(--ink);
  text-decoration:none}
button:disabled {
  opacity:.4;
  cursor:default}
button:hover {
  filter:brightness(.94)}
.ghost {
  background:transparent;
  color:var(--muted);
  padding:8px 10px}
.notice {
  border-left:3px solid var(--sand);
  background:#f0eadd;
  padding:14px 18px;
  color:#65563c;
  font-size:13px;
  margin:25px 0;
  line-height:1.8}
.notice.error {
  border-color:#af433d;
  color:#8d3430;
  background:#f8e7e4}
nav {
  display:flex;
  gap:28px;
  margin:26px 0 25px;
  border-bottom:1px solid var(--line);
  padding-bottom:14px}
nav a {
  color:var(--ink);
  text-decoration:none;
  font-size:14px}
.cards {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin-bottom:20px}
.card {
  background:var(--white);
  border:1px solid var(--line);
  padding:22px;
  border-radius:12px;
  min-height:142px}
.card.primary {
  background:var(--green);
  color:white;
  border-color:var(--green)}
.card span {
  font-size:13px;
  opacity:.8}
.card strong {
  display:block;
  font-size:27px;
  font-variant-numeric:tabular-nums;
  margin:15px 0 9px;
  letter-spacing:-.6px}
.card small {
  font-size:12px;
  opacity:.75;
  line-height:1.6;
  display:block}
.two {
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:20px}
.panel {
  background:var(--white);
  border:1px solid var(--line);
  padding:25px;
  border-radius:12px;
  margin-bottom:20px;
  min-width:0}
.section-title {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:15px}
.section-title h2 {
  font-size:19px;
  letter-spacing:-.4px;
  margin:0}
.section-title span {
  color:var(--muted);
  font-size:12px;
  line-height:1.5}
.half {
  padding:15px 0;
  border-top:1px solid var(--line)}
.half-title {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px}
.badge {
  font-size:11px;
  color:var(--warn);
  background:#f2ead8;
  border-radius:4px;
  padding:4px 7px}
.badge.complete {
  color:var(--green);
  background:#e8eee5}
.half dl {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:0}
.half dt {
  font-size:12px;
  color:var(--muted)}
.half dd {
  margin:5px 0 0;
  font-size:18px;
  font-variant-numeric:tabular-nums}
.footnote {
  font-size:12px;
  color:var(--muted);
  line-height:1.8;
  margin:17px 0 0}
.composition-row {
  display:flex;
  justify-content:space-between;
  border-bottom:1px solid #eeeee6;
  padding:12px 0;
  gap:16px;
  font-size:13px}
.composition-row b {
  font-variant-numeric:tabular-nums;
  white-space:nowrap}
.table-scroll {
  overflow:auto}
table {
  width:100%;
  border-collapse:collapse;
  font-size:13px}
th {
  text-align:right;
  color:var(--muted);
  background:#f7f7f1;
  font-weight:500;
  padding:13px 12px;
  white-space:nowrap}
td {
  text-align:right;
  padding:13px 12px;
  border-bottom:1px solid #eceee5;
  font-variant-numeric:tabular-nums;
  white-space:nowrap}
th:first-child,td:first-child {
  text-align:left}
td.muted {
  color:var(--muted)}
.negative {
  color:#a44935}
.chart {
  height:170px;
  display:flex;
  gap:16px;
  align-items:end;
  padding:10px 8px 26px;
  margin:10px 0 20px;
  border-bottom:1px solid var(--line)}
.month-col {
  height:100%;
  flex:1;
  display:flex;
  align-items:end;
  justify-content:center;
  gap:4px;
  position:relative;
  min-width:24px}
.bar {
  width:16px;
  border-radius:4px 4px 0 0;
  background:var(--green);
  min-height:1px}
.bar.out {
  background:var(--sand)}
.month-label {
  position:absolute;
  bottom:-22px;
  font-size:11px;
  color:var(--muted)}
.dot {
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:50%;
  margin-left:8px}
.income {
  background:var(--green)}
.expense {
  background:var(--sand)}
label {
  font-size:12px;
  color:var(--muted);
  display:flex;
  flex-direction:column;
  gap:7px}
input,select {
  font:inherit;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#fff;
  color:var(--ink);
  min-width:0}
input:focus,select:focus,button:focus-visible,a:focus-visible {
  outline:2px solid #83aa91;
  outline-offset:2px}
.settings-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px}
.form-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:22px 0}
.checkbox {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:8px;
  line-height:1.6}
.checkbox input {
  accent-color:var(--green)}
.explain {
  font-size:13px;
  color:var(--muted);
  margin:0 0 22px}
.formula {
  font-size:12px;
  background:#f2f4ed;
  border-radius:8px;
  padding:13px 16px;
  color:#546a5e;
  line-height:1.8}
.giving-summary {
  display:flex;
  gap:20px;
  flex-wrap:wrap;
  background:#edf1e8;
  border-radius:8px;
  padding:18px}
.giving-summary div {
  flex:1;
  min-width:150px}
.giving-summary small {
  display:block;
  font-size:12px;
  color:var(--muted)}
.giving-summary strong {
  display:block;
  font-size:22px;
  margin-top:8px}
.selected td {
  background:#edf3e9}
.filters {
  display:flex;
  gap:18px;
  align-items:end;
  margin-bottom:20px}
.search {
  flex:1}
.ledger-table td {
  text-align:left;
  vertical-align:top}
.ledger-table td:nth-child(3) {
  text-align:right}
.ledger-table td:nth-child(2) {
  white-space:normal;
  min-width:210px;
  max-width:280px}
.ledger-table small {
  display:block;
  color:var(--muted);
  margin-top:5px;
  line-height:1.6}
.ledger-table select {
  width:190px;
  font-size:12px}
.ledger-table input[type=text] {
  width:170px;
  font-size:12px}
.ledger-table button {
  padding:8px 10px;
  font-size:12px}
.ledger-table .checkbox {
  white-space:nowrap;
  margin-bottom:8px}
footer {
  font-size:12px;
  color:var(--muted);
  line-height:1.8;
  margin:30px 0 10px}
footer a {
  color:var(--green)}
dialog {
  border:1px solid var(--line);
  border-radius:14px;
  padding:28px;
  max-width:580px;
  width:calc(100% - 32px);
  color:var(--ink);
  background:var(--white)}
dialog::backdrop {
  background:#172e2466}
dialog p {
  font-size:13px;
  color:var(--muted)}
.upload-result {
  margin:20px 0;
  line-height:1.8;
  font-size:14px}
.upload-result.error {
  color:#a44935}
@media(max-width:900px) {
  .cards {
  grid-template-columns:repeat(2,1fr)}
.two {
  grid-template-columns:1fr}
.settings-grid {
  grid-template-columns:repeat(2,1fr)}
.intro {
  align-items:start}
.intro-actions {
  max-width:300px}
.chart {
  gap:8px}
.bar {
  width:12px}
}
@media(max-width:600px) {
  header {
  padding:16px 20px}
main {
  padding:24px 16px}
.intro {
  display:block}
h1 {
  font-size:30px}
.intro-actions {
  max-width:none}
.intro-actions label {
  width:100%}
.card {
  padding:16px}
.card strong {
  font-size:22px}
.panel {
  padding:18px}
.section-title {
  align-items:start}
.settings-grid {
  gap:12px}
.form-footer {
  align-items:start;
  flex-direction:column}
.filters {
  flex-wrap:wrap}
.filters .search {
  flex-basis:100%}
.chart {
  gap:5px}
.bar {
  width:8px}
nav {
  gap:23px}
}


/* 모바일 카드형 뷰 및 반응형 고도화 */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  .local {
    align-self: flex-start;
  }
  main {
    padding: 16px 12px;
  }
  .intro-actions {
    width: 100%;
    max-width: none;
    margin-top: 15px;
  }
  .intro-actions button, .intro-actions a {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
    padding: 10px 12px;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .card {
    min-height: auto;
    padding: 16px;
  }
  .card strong {
    font-size: 24px;
    margin: 10px 0 6px;
  }
  .two {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .giving-summary {
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }
  .giving-summary div {
    min-width: 100%;
  }
  nav {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    gap: 18px;
    -webkit-overflow-scrolling: touch;
  }
  nav a {
    display: inline-block;
    padding: 6px 0;
  }
  .ledger-table thead {
    display: none;
  }
  .ledger-table, .ledger-table tbody, .ledger-table tr, .ledger-table td {
    display: block;
    width: 100%;
  }
  .ledger-table tr {
    background: #fafaf7;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 14px;
    padding: 14px;
  }
  .ledger-table td {
    border: none;
    padding: 6px 0;
    text-align: left !important;
    white-space: normal !important;
    min-width: auto !important;
    max-width: none !important;
  }
  .ledger-table td:nth-child(1) {
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px dashed var(--line);
    padding-bottom: 8px;
    margin-bottom: 6px;
  }
  .ledger-table td:nth-child(2) {
    font-size: 15px;
    font-weight: 600;
  }
  .ledger-table td:nth-child(3) {
    font-size: 18px;
    font-weight: 700;
    margin: 4px 0;
  }
  .ledger-table td:nth-child(4) select,
  .ledger-table td:nth-child(5) input[type="text"] {
    width: 100% !important;
    margin-top: 4px;
  }
  .ledger-table td:nth-child(6) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--line);
    padding-top: 10px;
    margin-top: 6px;
  }
  .ledger-table td:nth-child(6) button {
    padding: 8px 16px;
  }
}

/* Chart wrapper styling */
.chart-wrapper {
  position: relative;
  min-height: 240px;
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-sizing: border-box;
}

