:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    sans-serif;
  color: #292e2b;
  background: #fafaf8;
  font-size: 13px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 28px 18px;
}
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid #6c736e;
  padding-bottom: 13px;
}
h1 {
  font-size: 19px;
  margin: 0;
  letter-spacing: -0.7px;
}
header > span,
.hint,
.status-line,
footer {
  color: #717670;
  font-size: 12px;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  background: #fff;
  border: 1px solid #c5cac5;
  border-radius: 2px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover {
  background: #edf0ec;
  border-color: #929e95;
}
button:active {
  background: #e0e6df;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
.table-wrap:focus-visible {
  outline: 2px solid #597969;
  outline-offset: 1px;
}
input,
select {
  border: 1px solid #cdd1cb;
  background: #fff;
  border-radius: 1px;
  padding: 6px;
  min-width: 0;
}
input[type="checkbox"] {
  accent-color: #4f6b5c;
}
input[type="month"] {
  max-width: 145px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0 10px;
  flex-wrap: wrap;
}
.month-nav,
.actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.month-nav > button:first-child,
.month-nav > button:nth-of-type(2) {
  font-size: 18px;
  line-height: 18px;
  padding: 5px 10px;
}
#month {
  font-weight: 600;
  background: transparent;
  border-color: transparent;
  font-size: 15px;
}
.status-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  gap: 15px;
  min-height: 20px;
}
#notice {
  margin: 8px 0;
  padding: 9px 12px;
  border: 1px solid #c0cbbf;
  background: #eef2ec;
  color: #344d3c;
}
#notice.error {
  background: #fff1ec;
  border-color: #d6b5a6;
  color: #87452f;
}
.overview {
  margin: 22px 0 32px;
  border-top: 1px solid #c5cac5;
  border-bottom: 1px solid #c5cac5;
  display: flex;
  align-items: stretch;
}
.month-caption {
  min-width: 160px;
  padding: 20px 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.month-caption strong {
  font-size: 15px;
}
.month-caption span {
  font-size: 11px;
  color: #7b807b;
}
dl {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr 1.3fr;
  flex: 1;
  margin: 0;
}
dl > div {
  padding: 19px 18px;
  border-left: 1px solid #e0e3dd;
}
dt {
  font-size: 12px;
  color: #676f67;
}
dt small {
  font-size: 10px;
  margin-left: 4px;
  white-space: nowrap;
}
dd {
  font-variant-numeric: tabular-nums;
  font-size: 23px;
  font-weight: 600;
  margin: 10px 0 0;
  letter-spacing: -0.7px;
  white-space: nowrap;
}
dd span {
  font-size: 12px;
  font-weight: 400;
  margin-left: 4px;
  letter-spacing: 0;
}
.total {
  background: #eef1eb;
}
.total dd {
  color: #354d3e;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid #777e76;
  padding-bottom: 9px;
}
h2 {
  font-size: 13px;
  margin: 0;
  font-weight: 650;
}
h2 > span {
  color: #7d837c;
  font-size: 11px;
  font-weight: 400;
  margin-left: 5px;
}
.check {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 12px;
  color: #5f665f;
}
.hint {
  line-height: 1.7;
  margin: 8px 0;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#expenses {
  table-layout: fixed;
  min-width: 1180px;
}
.name-col {
  width: auto;
  min-width: 150px;
}
th,
td {
  border: 1px solid #d4d8d1;
  padding: 9px 10px;
  text-align: left;
}
thead th {
  background: #eeefec;
  font-weight: 500;
  color: #535b52;
  white-space: nowrap;
}
td input,
td select {
  width: 100%;
  border-color: transparent;
  background: transparent;
  padding: 7px 5px;
  font-size: 12px;
}
td input:hover,
td select:hover {
  border-color: #cbd0c8;
  background: #fff;
}
td:has(input),
td:has(select) {
  padding: 3px;
}
td input.amount {
  text-align: right;
}
tbody tr:hover {
  background: #f0f2ee;
}
td.num,
th.num {
  text-align: right;
}
.num {
  white-space: nowrap;
}
td .delete {
  border: 0;
  background: transparent;
  color: #7d817a;
  font-size: 11px;
  padding: 5px;
}
td .delete:hover {
  color: #9b4431;
  background: #f5e9e3;
}
tfoot td,
tfoot th {
  background: #f0f1ed;
}
tfoot #add {
  border: 0;
  background: transparent;
  padding: 1px 0;
  color: #405448;
}
#tableNote {
  font-size: 11px;
  color: #72796f;
  text-align: right;
}
.empty td {
  padding: 32px 14px;
  text-align: center;
  color: #6c746a;
}
.empty strong {
  display: block;
  font-weight: 500;
  color: #4d584b;
  margin-bottom: 7px;
}
.remaining {
  color: #626c5e;
  font-size: 11px;
}
.ended {
  color: #93988e;
}
.forecast {
  margin-top: 36px;
}
.forecast .table-wrap {
  margin-top: 9px;
}
.forecast table {
  min-width: 650px;
}
.forecast td,
.forecast th {
  padding: 10px 12px;
}
.forecast tbody tr:first-child {
  background: #eef1eb;
}
.forecast th:first-child {
  width: 140px;
}
.forecast td:last-child {
  color: #727a6c;
  max-width: 300px;
}
.decrease {
  color: #45624a;
}
.increase {
  color: #8c5a3b;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  border-top: 1px solid #d4d8d1;
  padding-top: 12px;
  font-size: 11px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
dialog {
  max-width: 430px;
  width: calc(100% - 40px);
  padding: 24px;
  border: 1px solid #a6afa2;
  border-radius: 3px;
  background: #fafaf8;
}
dialog::backdrop {
  background: #1c231d55;
}
dialog h2 {
  font-size: 16px;
}
dialog p {
  line-height: 1.8;
  color: #60695c;
  white-space: pre-line;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 22px;
}
#confirmAction {
  background: #405748;
  color: white;
  border-color: #405748;
}
@media (min-width: 1400px) {
  .name-col {
    width: 200px;
  }
}
@media (max-width: 900px) {
  main {
    padding: 20px 16px;
  }
  .overview {
    display: block;
  }
  .month-caption {
    padding: 12px 0;
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }
  dl > div:first-child {
    border-left: 0;
  }
  dl > div {
    padding: 15px 12px;
  }
  dd {
    font-size: 20px;
  }
  dt small {
    display: block;
    margin: 4px 0 0;
  }
  .status-line {
    font-size: 10px;
  }
  .section-title .hint {
    font-size: 11px;
  }
}
@media (max-width: 560px) {
  main {
    padding: 17px 12px;
  }
  header > span {
    font-size: 11px;
  }
  .unit {
    display: none;
  }
  .toolbar {
    gap: 12px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .actions button {
    font-size: 12px;
    padding: 6px 8px;
  }
  .status-line {
    flex-direction: column;
    gap: 3px;
  }
  .overview {
    margin: 18px 0 25px;
  }
  dl {
    grid-template-columns: 1fr 1fr;
  }
  dl > div {
    border-top: 1px solid #e0e3dd;
    padding: 12px;
  }
  dl > div:nth-child(3) {
    border-left: 0;
  }
  dt small {
    display: inline;
    font-size: 9px;
    margin-left: 3px;
  }
  dd {
    font-size: 21px;
    margin-top: 7px;
  }
  .section-title {
    align-items: baseline;
  }
  .check {
    font-size: 11px;
  }
  .forecast .section-title {
    display: block;
  }
  .forecast .hint {
    margin: 6px 0 0;
    display: block;
  }
  footer {
    flex-direction: column;
    gap: 5px;
  }
}
@media print {
  .toolbar,
  .status-line,
  .check,
  footer,
  button,
  .hint {
    display: none !important;
  }
  main {
    padding: 0;
  }
  .overview {
    margin: 15px 0;
  }
  table {
    font-size: 9px !important;
  }
  #expenses {
    min-width: 0;
  }
  td input,
  td select {
    font-size: 9px;
    padding: 0;
  }
  th,
  td {
    padding: 4px !important;
  }
  .table-wrap {
    overflow: visible;
  }
  .forecast {
    break-before: auto;
  }
  body {
    background: white;
  }
  td:last-child,
  th:last-child {
    display: none;
  }
}
#entryDialog {
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}
#entryForm {
  margin: 0;
}
.entry-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #c5cac5;
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.entry-heading button {
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 0 5px;
}
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.entry-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
}
.entry-grid .wide {
  grid-column: 1/-1;
}
.entry-grid input,
.entry-grid select {
  width: 100%;
  padding: 9px;
  max-width: none;
}
.entry-grid small {
  font-size: 10px;
  color: #7b807b;
}
.entry-grid [hidden] {
  display: none;
}
.entry-preview {
  background: #eef1eb;
  padding: 10px 12px;
  font-size: 12px;
  min-height: 42px;
}
#entryError {
  color: #914d32;
  font-size: 12px;
}
.primary {
  background: #405748;
  color: #fff;
  border-color: #405748;
}
.row-actions {
  white-space: nowrap;
}
.row-actions button {
  border: 0;
  background: transparent;
  padding: 4px;
  font-size: 11px;
}
.row-actions button:hover {
  background: #e4e9e1;
}
#addTop {
  margin-left: auto;
  background: #eef1eb;
}
#expenses tbody td {
  padding: 12px 10px;
}
#expenses tbody td strong {
  font-weight: 500;
}
@media (max-width: 450px) {
  .entry-grid {
    gap: 12px;
  }
  #entryDialog {
    padding: 18px;
  }
}
#entryDialog {
  max-width: 680px;
}
.kind-choice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.kind-choice button {
  padding: 11px;
  text-align: left;
  font-weight: 600;
}
.kind-choice button span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #71796d;
  font-weight: 400;
}
.kind-choice button[aria-pressed="true"] {
  background: #e9eee6;
  border-color: #59715b;
  box-shadow: inset 0 0 0 1px #59715b;
}
.entry-intro {
  font-size: 12px;
  color: #677060;
  margin: 12px 0 20px;
  line-height: 1.7;
}
.field-note {
  color: #737c6c;
  font-size: 11px;
  line-height: 1.7;
}
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.presets button {
  font-size: 10px;
  padding: 3px 6px;
  background: #f3f4f0;
  color: #6a7562;
}
.entry-grid label small {
  display: inline;
}
.entry-grid input:disabled {
  background: #eceee9;
}
.entry-preview h3 {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 12px;
}
.entry-preview {
  padding: 16px;
  margin-top: 22px;
}
.entry-preview p {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.7;
}
.preview-values {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.preview-values > div {
  padding: 0 8px;
  border-left: 1px solid #d8dfd2;
}
.preview-values > div:first-child {
  padding-left: 0;
  border: 0;
}
.preview-values dt {
  font-size: 11px;
}
.preview-values dd {
  font-size: 19px;
  margin-top: 6px;
}
.maturity {
  color: #885039;
  font-weight: 500;
}
.schedule-wrap {
  max-height: 220px;
  overflow: auto;
  margin-top: 10px;
}
.schedule-wrap table {
  min-width: 430px;
}
.schedule-wrap thead {
  position: sticky;
  top: 0;
}
#scheduleDetails {
  font-size: 12px;
  padding: 8px 0;
}
#scheduleDetails summary {
  cursor: pointer;
  color: #4e6245;
}
.overview > dl {
  grid-template-columns: repeat(3, 1fr) 1.1fr 1.25fr;
}
#loanBalance {
  margin-top: -20px;
  margin-bottom: 25px;
}
.entry-grid [hidden],
.entry-grid .loan-only[hidden] {
  display: none;
}
@media (max-width: 1100px) {
  .overview {
    display: block;
  }
  .overview > dl {
    grid-template-columns: repeat(5, 1fr);
  }
  .overview dd {
    font-size: 19px;
  }
}
@media (max-width: 700px) {
  .overview > dl {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview dl > div {
    border-top: 1px solid #dce1d8;
  }
  .overview dl > div:nth-child(odd) {
    border-left: 0;
  }
  .overview dl > div:last-child {
    grid-column: 1/-1;
  }
  .preview-values dd {
    font-size: 16px;
  }
  .kind-choice button {
    padding: 8px;
  }
  .kind-choice button span {
    font-size: 10px;
  }
  .entry-preview {
    padding: 12px;
  }
  .preview-values {
    gap: 3px;
  }
}
@media (max-width: 380px) {
  .entry-grid {
    grid-template-columns: 1fr;
  }
  .entry-grid .wide {
    grid-column: auto;
  }
  .preview-values {
    grid-template-columns: 1fr;
  }
  .preview-values > div {
    border: 0;
    padding: 6px 0;
  }
  .kind-choice button span {
    display: none;
  }
}
.row-meta {
  display: block;
  font-size: 10px;
  color: #727c6b;
  line-height: 1.5;
  margin-top: 4px;
}
@media(max-width:560px){.preview-values{grid-template-columns:1fr 1fr;gap:12px}.preview-values>div:last-child{grid-column:1/-1;border-left:0;padding-left:0;border-top:1px solid #d8dfd2;padding-top:10px}}
