:root {
  --bg: #f3ecdf;
  --ink: #241c14;
  --muted: #6f6256;
  --card: rgba(255, 250, 243, 0.92);
  --line: #e4d5c0;
  --green: #0e6b52;
  --green-dark: #0a4d3b;
  --gold: #a97816;
  --danger: #8d3a30;
  --shadow: 0 16px 40px rgba(70, 46, 16, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Manrope, sans-serif;
  background:
    radial-gradient(900px 420px at -10% -10%, #f8e4bc 0%, transparent 60%),
    radial-gradient(700px 380px at 110% 0%, #d5ebe3 0%, transparent 55%),
    var(--bg);
}

button, input, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2 { font-family: Literata, serif; font-weight: 560; }

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

h2 { margin: 0; font-size: 1.45rem; }

.today { margin: 0; color: var(--muted); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.55);
}

.stat span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.stack { display: flex; flex-direction: column; gap: 18px; }

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.hint, .empty, .progress-label, .meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.hint { margin: 0 0 14px; }

.saved-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: relative;
}

.saved-value {
  margin: 0 0 8px;
  font-family: Literata, serif;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.saved-actions { display: flex; align-items: center; gap: 8px; }

.add7, .minus7, .solid, .ghost, .text-btn, .icon-btn {
  border: 0;
  background: transparent;
}

.add7, .minus7, .solid, .ghost {
  border-radius: 999px;
}

.add7 {
  min-width: 92px;
  padding: 16px 26px;
  background: var(--green);
  color: #f6fff9;
  font-size: 1.45rem;
  font-weight: 700;
}

.add7:hover { background: var(--green-dark); }

.minus7, .ghost {
  padding: 10px 14px;
  color: var(--muted);
  background: #f3eadc;
}

.minus7:disabled {
  opacity: 0.4;
  cursor: default;
}

.solid {
  padding: 12px 16px;
  background: var(--ink);
  color: #fffaf3;
  font-weight: 700;
}

.solid:hover { background: #3a2e22; }

.text-btn {
  padding: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 0.92rem;
}

.goal-block { margin-top: 22px; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 700;
}

input, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  outline: none;
}

textarea { resize: vertical; min-height: 96px; }

input:focus, textarea:focus {
  border-color: #8fbfae;
  box-shadow: 0 0 0 3px rgba(14, 107, 82, 0.12);
}

.goal-row { position: relative; }

.suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.goal-row input { padding-right: 36px; }

.progress { margin-top: 14px; }

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe4d2;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #1f9a72);
  transition: width 0.25s ease;
}

.progress-fill.done { background: linear-gradient(90deg, var(--gold), #e0b15a); }

.progress-label { margin: 8px 0 0; }

.inline-form, .budget-form, #note-form {
  display: grid;
  gap: 10px;
}

.inline-form {
  grid-template-columns: 1fr auto auto;
  align-items: end;
  margin-top: 14px;
}

.inline-form label { grid-column: 1 / -1; margin: 0; }

.budget-form { margin-bottom: 8px; }

.hidden { display: none; }

.list, .notes {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row, .note {
  display: grid;
  gap: 4px 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #f0e6d6;
}

.row {
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.row strong, .note p { margin: 0; }

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--green-dark);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--danger);
  font-size: 1.2rem;
  line-height: 1;
}

.icon-btn:hover { background: #f8ebe8; }

.note {
  position: relative;
  padding-right: 46px;
}

.note .icon-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}

.note p { white-space: pre-wrap; word-break: break-word; }

.total {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.float-plus {
  position: absolute;
  left: 8px;
  top: 0;
  color: var(--green);
  font-weight: 800;
  pointer-events: none;
  animation: rise 0.7s ease forwards;
}

@keyframes rise {
  to { transform: translateY(-28px); opacity: 0; }
}

@media (max-width: 860px) {
  .layout, .stats, .inline-form { grid-template-columns: 1fr; }
  .saved-row { align-items: flex-start; flex-direction: column; }
  .row { grid-template-columns: 1fr auto; }
  .row .amount { grid-column: 1; }
}
