:root {
  --bg: #f4efe6;
  --card: #fffdf8;
  --ink: #1c241d;
  --muted: #5d6b60;
  --line: #e4d8c6;
  --green: #1b7a4e;
  --green-2: #e8f6ee;
  --orange: #d86a1f;
  --orange-2: #fff1e4;
  --red: #c23b2a;
  --shadow: 0 10px 28px rgba(40, 32, 18, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Nirmala UI", "Segoe UI", "Noto Sans Devanagari", sans-serif;
  background:
    radial-gradient(900px 400px at 10% -10%, #ffe7c8 0%, transparent 50%),
    radial-gradient(700px 360px at 100% 0%, #d8f3e4 0%, transparent 46%),
    var(--bg);
  color: var(--ink);
}

.app {
  width: min(520px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px 96px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.eyebrow {
  margin: 0;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}
.topbar h1 { margin: 4px 0 0; font-size: 28px; }
.top-actions { display: flex; gap: 8px; }
.ghost-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  min-width: 42px;
  height: 42px;
  font-weight: 700;
  cursor: pointer;
}

.view { display: none; }
.view.active { display: block; }

.hero-card, .limit-card, .stat, .list-card, .form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card, .limit-card, .form-card, .list-card { padding: 16px; margin-bottom: 14px; }
.hero-card.compact { margin-top: 14px; }
.muted, .hint, .fineprint { color: var(--muted); }
.hero-date { margin: 2px 0 14px; font-size: 20px; font-weight: 700; }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.hero-grid span, .stat p {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 4px;
}
.hero-grid strong, .stat strong { font-size: 18px; }
.warn { color: var(--orange); }

.limit-head, .list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.limit-card h2, .list-card h2 { margin: 0 0 8px; font-size: 16px; }
.hint { font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
.bar {
  height: 10px;
  background: #efe6d8;
  border-radius: 99px;
  overflow: hidden;
}
.bar.tall { height: 12px; margin-top: 12px; }
.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), #3aa36b);
  border-radius: inherit;
  transition: width 0.25s ease, background 0.25s ease;
}
.bar-fill.over { background: linear-gradient(90deg, #d86a1f, #c23b2a); }
.limit-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 14px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  background: var(--green-2);
  color: var(--green);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat { padding: 14px; }
.stat small { display: block; margin-top: 6px; color: var(--muted); }

.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary { background: var(--green); color: #fff; }
.btn.accent { background: var(--orange); color: #fff; }
.btn.ghost { background: transparent; border: 1px dashed var(--line); color: var(--muted); margin-top: 8px; }
.btn.full { width: 100%; margin-top: 8px; }

.seg {
  display: flex;
  background: #efe8db;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}
.seg.wide { margin-bottom: 14px; }
.seg-btn {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.seg.wide .seg-btn { flex: 1; }
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.tx-list li:last-child { border-bottom: 0; }
.tx-list .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tx-list .plus { color: var(--green); }
.tx-list .minus { color: var(--orange); }
.empty { color: var(--muted); padding: 10px 0; }

.form-card label { display: block; margin-bottom: 12px; }
.form-card span { display: block; margin-bottom: 6px; font-weight: 600; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
}
.guide {
  background: var(--orange-2);
  border: 1px solid #f0d2b0;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}
.guide.hidden, .hidden { display: none; }
.guide h3 { margin: 0 0 6px; font-size: 15px; }
.guide p { margin: 0 0 10px; font-size: 13px; color: #6a4a2a; }
.guide-stats { list-style: none; margin: 0; padding: 0; }
.guide-stats li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}
.form-warn { color: var(--red); font-weight: 700; font-size: 13px; }
.fineprint { font-size: 12px; text-align: center; }

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(488px, calc(100% - 24px));
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px;
  box-shadow: var(--shadow);
}
.tab {
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.tab span { display: block; margin-top: 2px; }
.tab.active { background: var(--green-2); color: var(--green); }

@media (min-width: 720px) {
  .app { padding-top: 28px; }
}
