:root {
  color-scheme: light;
  --ink: #1b2924;
  --muted: #5d6d65;
  --paper: #f3f5f2;
  --surface: #fff;
  --line: #e0e7e2;
  --forest: #174d3d;
  --forest-deep: #103c30;
  --leaf: #b9d9c9;
  --sun: #f2bd69;
  --danger: #a5342a;
  --bs-primary: #174d3d;
  --bs-primary-rgb: 23, 77, 61;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.96rem;
  line-height: 1.5;
}

.app-container {
  max-width: 1120px;
}

.site-header {
  padding: 1.45rem 0 2.35rem;
  background:
    radial-gradient(ellipse at 91% 14%, rgba(185, 217, 201, 0.21), transparent 28rem),
    var(--paper);
}

.brand-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(28, 57, 44, 0.12);
  padding-bottom: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  color: var(--ink);
  font-size: 1.07rem;
  font-weight: 760;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.brand:hover {
  color: var(--forest);
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px 9px 9px 3px;
  background: var(--forest);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: -0.1em;
  padding-right: 0.12em;
}

.private-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 550;
}

.private-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #52856c;
  box-shadow: 0 0 0 3px rgba(82, 133, 108, 0.12);
}

.intro-row {
  padding-top: 2.8rem;
}

.eyebrow {
  margin: 0;
  color: #527260;
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.105em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1 {
  margin: 0.6rem 0 0.8rem;
  color: var(--ink);
  font-size: clamp(2.55rem, 5.6vw, 4.65rem);
  font-weight: 680;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

h1 span {
  color: var(--forest);
}

.intro-copy {
  max-width: 31rem;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.summary-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(185, 217, 201, 0.15), transparent 55%),
    var(--forest);
  color: #fff;
  padding: 1.35rem 1.55rem 1.25rem;
  box-shadow: 0 14px 32px rgba(27, 61, 46, 0.1);
}

.summary-topline,
.summary-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-label {
  margin: 0;
  color: #d6e5dc;
  font-size: 0.82rem;
  font-weight: 600;
}

.summary-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: var(--sun);
  font-size: 0.85rem;
  font-weight: 700;
}

.summary-amount {
  margin: 0.45rem 0 0.9rem;
  color: #fff;
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 1.15;
}

.summary-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.19);
}

.summary-meta {
  padding-top: 0.8rem;
  color: #d6e5dc;
  font-size: 0.77rem;
}

.summary-meta strong {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 680;
}

.main-content {
  padding-bottom: 3.5rem;
}

.surface-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(34, 58, 44, 0.035);
}

.entry-card {
  padding: 1.45rem 1.45rem 1.5rem;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.section-index {
  display: grid;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  place-items: center;
  margin-top: 0.1rem;
  border: 1px solid #d7e5dc;
  border-radius: 8px;
  background: #f2f7f3;
  color: #47745a;
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.16rem;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.entry-card form {
  margin-top: 1.55rem;
}

.form-label {
  margin-bottom: 0.45rem;
  color: #31443a;
  font-size: 0.82rem;
  font-weight: 650;
}

.form-control,
.input-group-text {
  min-height: 45px;
  border-color: #d7e0da;
  color: var(--ink);
  font-size: 0.9rem;
}

.form-control {
  border-radius: 8px;
  background-color: #fff;
  font-variant-numeric: tabular-nums;
}

.input-group > .form-control {
  min-width: 0;
}

.input-group > .input-group-text {
  border-radius: 0 8px 8px 0;
  background: #f5f8f5;
  color: #50645a;
  font-size: 0.82rem;
  font-weight: 600;
}

.input-group > .currency-addon {
  border-radius: 8px 0 0 8px;
  color: #41614f;
}

.input-group > .form-control:not(:first-child) {
  border-radius: 0 8px 8px 0;
}

.form-control::placeholder {
  color: #829087;
  opacity: 1;
}

.form-control:focus {
  border-color: #55806a;
  box-shadow: 0 0 0 0.2rem rgba(40, 105, 72, 0.15);
}

.form-control.is-invalid {
  border-color: #b44a3e;
  background-image: none;
}

.form-control.is-invalid:focus {
  border-color: #a5342a;
  box-shadow: 0 0 0 0.2rem rgba(165, 52, 42, 0.13);
}

.form-text {
  margin-top: 0.35rem;
  color: #65746c;
  font-size: 0.73rem;
}

.field-group .invalid-feedback:not([hidden]) {
  display: block;
  margin-top: 0.35rem;
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 550;
}

.form-actions {
  display: grid;
  gap: 0.25rem;
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--forest);
  --bs-btn-border-color: var(--forest);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--forest-deep);
  --bs-btn-hover-border-color: var(--forest-deep);
  --bs-btn-active-bg: var(--forest-deep);
  --bs-btn-active-border-color: var(--forest-deep);
  --bs-btn-disabled-bg: #788c81;
  --bs-btn-disabled-border-color: #788c81;
  min-height: 45px;
  border-radius: 8px;
  font-size: 0.87rem;
  font-weight: 650;
  box-shadow: 0 5px 12px rgba(23, 77, 61, 0.13);
}

.button-plus {
  display: inline-block;
  margin-right: 0.25rem;
  color: var(--sun);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 0.8;
  vertical-align: -0.03em;
}

.cancel-button {
  min-height: 34px;
  color: #52675b;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.cancel-button:hover {
  color: var(--forest-deep);
  text-decoration: underline;
}

.rounding-note,
.storage-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  color: #607168;
  font-size: 0.75rem;
}

.rounding-note span {
  color: #518064;
  font-size: 0.95rem;
}

.ledger-card {
  min-height: 315px;
  overflow: hidden;
}

.ledger-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.45rem 1.55rem 1.25rem;
}

.ledger-count {
  align-self: center;
  color: #65756c;
  font-size: 0.75rem;
  font-weight: 550;
}

.ledger-table-wrap {
  border-top: 1px solid #edf1ee;
}

.ledger-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  min-width: 620px;
  font-size: 0.82rem;
}

.ledger-table thead th {
  padding: 0.78rem 0.9rem;
  border-bottom-color: #e5ebe7;
  color: #5d6d64;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ledger-table thead th:first-child,
.ledger-table tbody th:first-child {
  padding-left: 1.55rem;
}

.ledger-table thead th:last-child,
.ledger-table tbody td:last-child {
  padding-right: 1.45rem;
}

.ledger-table tbody th,
.ledger-table tbody td {
  padding: 0.92rem 0.9rem;
  border-bottom-color: #edf1ee;
  color: #34483c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ledger-table tbody th {
  font-weight: 620;
}

.ledger-table tbody td.text-end {
  color: #1e4434;
}

.ledger-table tbody tr:last-child > * {
  border-bottom: 0;
}

.ledger-table .btn {
  --bs-btn-color: #456151;
  --bs-btn-border-color: #cfdbd2;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #456151;
  --bs-btn-hover-border-color: #456151;
  --bs-btn-active-bg: #365242;
  --bs-btn-active-border-color: #365242;
  font-size: 0.72rem;
  font-weight: 600;
}

.ledger-table .btn-outline-danger {
  --bs-btn-color: #8c3931;
  --bs-btn-border-color: #e3c7c3;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #963d33;
  --bs-btn-hover-border-color: #963d33;
  --bs-btn-active-bg: #7c2f28;
  --bs-btn-active-border-color: #7c2f28;
}

.ledger-table .btn:focus-visible,
.btn:focus-visible,
.brand:focus-visible {
  outline: 3px solid #ba781f;
  outline-offset: 3px;
  box-shadow: none;
}

.empty-state {
  display: grid;
  min-height: 205px;
  align-content: center;
  justify-items: center;
  border-top: 1px solid #edf1ee;
  padding: 1.25rem;
  text-align: center;
}

.empty-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 0.75rem;
  border: 1px dashed #b8c9bd;
  border-radius: 12px;
  color: #4f795d;
  font-size: 1.4rem;
}

.empty-state h3 {
  margin: 0;
  color: #33473b;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.empty-state p {
  margin: 0.35rem 0 0;
  color: #65746b;
  font-size: 0.78rem;
}

.storage-note {
  margin-top: 0.85rem;
}

.storage-icon {
  color: #4c7b5e;
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid #dfe6e1;
  color: #637168;
  font-size: 0.72rem;
  padding: 1.15rem 0 1.45rem;
}

@media (max-width: 991.98px) {
  .site-header {
    padding-bottom: 2rem;
  }

  .intro-row {
    padding-top: 2.15rem;
  }

  .summary-panel {
    padding: 1.2rem 1.35rem;
  }

  .summary-amount {
    margin: 0.3rem 0 0.7rem;
  }
}

@media (max-width: 575.98px) {
  body {
    font-size: 0.93rem;
  }

  .site-header {
    padding-top: 1rem;
    padding-bottom: 1.6rem;
  }

  .private-note {
    font-size: 0.72rem;
  }

  .intro-row {
    padding-top: 1.8rem;
  }

  h1 {
    font-size: clamp(2.45rem, 12vw, 3.25rem);
  }

  .intro-copy {
    font-size: 0.92rem;
  }

  .summary-panel {
    border-radius: 12px;
    padding: 1rem 1.15rem;
  }

  .summary-amount {
    font-size: 2.3rem;
  }

  .main-content {
    padding-bottom: 2.4rem;
  }

  .entry-card {
    padding: 1.2rem 1.1rem 1.25rem;
  }

  .ledger-heading {
    align-items: flex-start;
    padding: 1.2rem 1.1rem 1rem;
  }

  .ledger-count {
    padding-top: 0.35rem;
  }

  .ledger-table thead th:first-child,
  .ledger-table tbody th:first-child {
    padding-left: 1.1rem;
  }

  .ledger-table thead th:last-child,
  .ledger-table tbody td:last-child {
    padding-right: 1.1rem;
  }

  .site-footer .container {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 0.25rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
