:root {
  --ink: #173f3b;
  --muted: #6e817c;
  --cream: #f7f5ed;
  --paper: #fffefa;
  --line: #dedfd5;
  --green: #226e62;
  --lime: #cbd84d;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Arial, sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
header {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 42px;
  padding: 0 5vw;
  background: #fffefaf2;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
}
.brand b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--lime);
  font: italic 700 20px Georgia;
}
.nav {
  border: 0;
  background: none;
}
nav {
  display: flex;
  gap: 3px;
  flex: 1;
}
nav button {
  border: 0;
  background: none;
  padding: 12px 15px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 650;
}
nav .active {
  background: #e9eee5;
  color: var(--ink);
}
header > button:last-child,
.add,
form button {
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  padding: 12px 17px;
  font-weight: 750;
}
#view {
  max-width: 1220px;
  margin: auto;
  padding: 52px 32px 70px;
}
.welcome {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 30px;
}
.welcome h1 {
  font: 700 42px Georgia;
  margin: 0 0 8px;
}
.welcome span {
  color: var(--muted);
}
.welcome em {
  font-style: normal;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}
.overline {
  font-size: 10px !important;
  letter-spacing: 0.16em;
  font-weight: 850 !important;
  color: #71827b !important;
  margin: 0 0 7px !important;
}
.hero,
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.hero {
  grid-template-columns: 1.65fr 1fr;
}
.safe,
.income,
.panel,
.stats section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 28px #223f390b;
}
.safe {
  padding: 28px 30px;
  background: var(--ink);
  color: white;
}
.safe .overline {
  color: #bdd1cb !important;
}
.safe h2 {
  font: 700 48px Georgia;
  margin: 0 0 10px;
}
.safe > span {
  font-size: 12px;
  color: #c6d5d1;
}
.safe > i,
.budget > i,
.budget-edit > i {
  display: block;
  height: 7px;
  background: #ffffff20;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 18px;
}
.safe > i > b,
.budget > i > b,
.budget-edit > i > b {
  display: block;
  height: 100%;
  background: var(--lime);
  border-radius: inherit;
}
.income {
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.income label {
  font-size: 10px;
  letter-spacing: 0.13em;
  font-weight: 850;
  color: var(--muted);
}
.income div {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font: 700 28px Georgia;
}
.income input {
  width: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  font: 700 39px Georgia;
  padding: 8px;
  outline: 0;
}
.income small {
  color: var(--muted);
  margin-top: 8px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.stats section {
  padding: 21px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.stats section > div > b {
  font: 700 24px Georgia;
}
.icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-style: normal;
  flex: none;
}
.peach {
  background: #fbe6d9;
  color: #a8522c;
}
.green {
  background: #dcece2;
  color: #347358;
}
.gold {
  background: #f6edc9;
  color: #9b7c18;
}
.panel {
  padding: 26px 28px;
  min-height: 250px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.panel-head h3 {
  font: 700 23px Georgia;
  margin: 0;
}
.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}
.donut {
  width: 155px;
  height: 155px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
}
.donut:before {
  content: "";
  position: absolute;
  inset: 25px;
  background: var(--paper);
  border-radius: 50%;
}
.donut > div {
  z-index: 1;
  text-align: center;
}
.donut strong {
  display: block;
  font: 700 18px Georgia;
}
.donut small {
  color: var(--muted);
}
.legend {
  min-width: 150px;
}
.legend p {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}
.legend span {
  color: var(--muted);
}
.large .donut {
  width: 190px;
  height: 190px;
}
.bars {
  height: 175px;
  display: flex;
  align-items: end;
  gap: 16px;
}
.bars > div {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 6px;
}
.bars span {
  font-size: 9px;
  color: var(--muted);
  height: 12px;
}
.bars i {
  height: 120px;
  width: min(38px, 100%);
  background: #eef0e8;
  border-radius: 8px;
  display: flex;
  align-items: end;
  overflow: hidden;
}
.bars i b {
  width: 100%;
  background: linear-gradient(var(--lime), #9eb846);
  border-radius: 8px;
}
.bars small {
  font-size: 9px;
  color: var(--muted);
}
.budget {
  margin-bottom: 18px;
}
.budget > div {
  display: flex;
  justify-content: space-between;
}
.budget small,
.row small,
.budget-edit small {
  display: block;
  color: var(--muted);
}
.budget > i,
.budget-edit > i {
  background: #e8e9df;
  height: 6px;
  margin-top: 8px;
}
.budget > i > b,
.budget-edit > i > b {
  background: var(--green);
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid #e8e8df;
}
.row > div {
  flex: 1;
}
.row > strong {
  width: 44px;
  height: 47px;
  border-radius: 10px;
  background: #f0efe7;
  display: grid;
  place-items: center;
  font: 700 18px Georgia;
}
.row > strong small {
  font: 8px Arial;
}
.check {
  width: 23px;
  height: 23px;
  border: 1px solid #abb5ae;
  background: white;
  border-radius: 7px;
}
.paid {
  opacity: 0.55;
}
.paid .check {
  background: var(--green);
  color: white;
}
.add {
  float: right;
  margin-top: -58px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 35px;
}
.budget-edit {
  display: grid;
  grid-template-columns: 150px 1fr 125px;
  gap: 24px;
  align-items: center;
  padding: 17px 0;
  border-top: 1px solid #e8e8df;
}
.budget-edit label {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
}
.budget-edit input {
  width: 80px;
  border: 0;
  background: none;
}
#gate,
#modal {
  position: fixed;
  inset: 0;
  background: var(--ink);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}
.gate-card,
.dialog {
  width: min(470px, 100%);
  background: var(--paper);
  border-radius: 20px;
  padding: 34px;
  box-shadow: 0 30px 80px #0004;
}
.gate-card .brand {
  margin-bottom: 42px;
}
.gate-card h1,
.dialog h2 {
  font: 700 34px Georgia;
  margin: 0 0 10px;
}
.gate-card > p {
  color: var(--muted);
  line-height: 1.5;
}
.gate-card form,
.dialog form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}
.gate-card label,
.dialog label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
}
.gate-card input,
.dialog input,
.dialog select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: white;
}
.dialog textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}
.gate-card #error {
  color: #a43e2e;
  min-height: 16px;
  font-size: 12px;
}
#modal {
  background: #102a2780;
  backdrop-filter: blur(4px);
}
.dialog {
  position: relative;
}
.dialog > #close {
  position: absolute;
  right: 18px;
  top: 14px;
  border: 0;
  background: none;
  font-size: 29px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 800px) {
  header {
    height: auto;
    min-height: 68px;
    padding: 10px 17px;
    gap: 12px;
    flex-wrap: wrap;
  }
  header > .brand {
    flex: 1;
  }
  header > #quick {
    font-size: 0;
  }
  header > #quick:first-letter {
    font-size: 20px;
  }
  nav {
    order: 3;
    width: 100%;
    overflow: auto;
  }
  #view {
    padding: 34px 17px;
  }
  .welcome h1 {
    font-size: 34px;
  }
  .welcome em {
    display: none;
  }
  .hero,
  .grid,
  .stats {
    grid-template-columns: 1fr;
  }
  .donut-wrap {
    gap: 18px;
  }
  .budget-edit {
    grid-template-columns: 110px 1fr;
  }
  .budget-edit label {
    grid-column: 2;
  }
  .pair {
    grid-template-columns: 1fr;
  }
}
.account-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--line);
}
.account-summary span { color: var(--muted); }
.account-summary strong { font: 700 28px Georgia; }
.account-row {
  display: grid;
  grid-template-columns: 46px 1fr 155px;
  gap: 14px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid #e8e8df;
}
.account-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #dcece2;
  color: var(--green);
  font-weight: 800;
}
.account-row small { display: block; color: var(--muted); margin-top: 3px; }
.account-row label { border: 1px solid var(--line); border-radius: 9px; padding: 9px; color: var(--muted); }
.account-row input { width: 105px; border: 0; background: none; font-weight: 750; color: var(--ink); }
.form-warning { color: #a8522c; }
.safe h2.negative { color: #ffd0bd; }
.savings-note {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 16px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #ffffff22;
  font-size: 12px;
}
.savings-note b { color: var(--lime); }
.savings-note small { grid-column: 1 / -1; color: #bdd1cb; }
.business-toggle {
  display: flex !important;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 9px !important;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f3f3e9;
  color: var(--ink) !important;
}
.business-toggle input { width: 18px !important; height: 18px; }
.business-first { margin-bottom: 2px; }
.business-fields {
  padding: 13px;
  border-left: 3px solid var(--lime);
  border-radius: 6px;
  background: #f4f5e9;
}
.business-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 6px;
  border-radius: 99px;
  background: #f6edc9;
  color: #806817;
  font: 700 9px Arial;
}
.receipt-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 7px 9px;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}
.transaction-actions { display: flex; gap: 6px; }
.edit-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1e8;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}
.receipt-link {
  display: block;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
}
@media (max-width: 600px) {
  header {
    display: grid;
    grid-template-columns: 1fr 46px;
    gap: 9px 12px;
    padding: 10px 16px 12px;
  }
  header > #quick {
    width: 46px;
    height: 44px;
    padding: 0;
  }
  header nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
    overflow: visible;
  }
  header nav button {
    min-width: 0;
    padding: 8px 3px;
    font-size: 11px;
  }
  .account-row { grid-template-columns: 44px 1fr; }
  .account-row label { grid-column: 2; }
  .donut-wrap { flex-direction: column; }
  .add { float: none; margin: 0 0 16px; width: 100%; }
  .transaction-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }
  .transaction-item .transaction-actions { grid-column: 2 / -1; }
  .transaction-item .transaction-actions button { flex: 1; }
  .dialog { max-height: calc(100dvh - 28px); overflow-y: auto; padding: 26px 22px; }
  .safe h2 { font-size: 40px; }
  nav button { flex: 0 0 auto; }
}
