:root {
  --bg1: #1d78e8;
  --bg2: #309cff;
  --card: rgba(255,255,255,0.92);
  --text: #10233b;
  --muted: #6e7d90;
  --line: #dde7f2;
  --blue: #2f98f6;
  --blue-soft: #7dc5ff;
  --shadow: 0 10px 25px rgba(10, 60, 120, 0.16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  color: var(--text);
}
.app-shell {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #f6f9fe;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}
.topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 18px 18px 10px;
}
.topbar h1 {
  text-align: center;
  margin: 0;
  font-size: 1.8rem;
}
.icon-btn {
  border: 0;
  background: transparent;
  font-size: 2rem;
  color: var(--text);
}
.content { padding: 8px 18px 28px; }
.progress-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 18px;
}
.ring-wrap { position: relative; width: 260px; height: 260px; }
.ring {
  position: absolute; inset: 0;
  transform: rotate(-90deg);
}
.ring-bg, .ring-progress {
  fill: none;
  stroke-width: 8;
}
.ring-bg { stroke: #e8eef8; }
.ring-progress {
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset .35s ease;
}
.wave-circle {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  overflow: hidden;
  background: #eef5fd;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,0.7);
}
.percent {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: bold;
  font-size: 3rem;
  z-index: 3;
}
.wave {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 120px;
  border-radius: 45%;
  bottom: 0;
  transform-origin: center;
}
.wave1 {
  background: var(--blue);
  opacity: 0.95;
  animation: drift 7s linear infinite;
}
.wave2 {
  background: var(--blue-soft);
  opacity: 0.75;
  animation: drift 10s linear infinite reverse;
}
@keyframes drift {
  from { transform: translateX(0) rotate(0deg); }
  to { transform: translateX(4%) rotate(360deg); }
}
.totals {
  margin-top: 12px;
  font-size: 2rem;
  font-weight: 600;
}
.quick-add {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.quick-add button {
  border: 0;
  background: transparent;
  padding: 18px 8px;
  font-size: 1.15rem;
  color: #214b78;
}
.quick-add button + button { border-left: 1px solid var(--line); }
.card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 18px;
}
.custom-add, .target-row {
  display: flex;
  gap: 10px;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 12px;
  font-size: 1rem;
}
#addCustomBtn, #saveTargetBtn {
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: white;
  padding: 0 16px;
  font-weight: bold;
}
.section-title, label {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: block;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  background: #f1f6fc;
  border-radius: 18px;
  padding: 16px;
}
.time { color: var(--muted); font-size: 1.05rem; }
.amount { font-size: 1.6rem; font-weight: 700; }
.delete-btn {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  color: #7b8ba0;
}
@media (max-width: 420px) {
  .topbar h1 { font-size: 1.5rem; }
  .ring-wrap { width: 220px; height: 220px; }
  .totals { font-size: 1.6rem; }
}
