:root {
  --bg: #0b0d12;
  --ink: #f4f1ea;
  --muted: #9a958c;
  --line: rgba(244, 241, 234, 0.09);
  --panel: rgba(20, 23, 31, 0.78);
  --accent: #f0b429;
  --accent-2: #ff8a4c;
  --out: #ff6b7a;
  --in: #5ec8ff;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  --radius: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 76px;
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
.hidden { display: none !important; }

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(160deg, #171b26 0%, #0b0d12 48%, #121018 100%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.5;
  animation: float 14s ease-in-out infinite alternate;
}
.b1 {
  width: 340px; height: 340px; top: -100px; left: -80px;
  background: radial-gradient(circle, rgba(240,180,41,0.32), transparent 68%);
}
.b2 {
  width: 300px; height: 300px; top: 20%; right: -100px;
  background: radial-gradient(circle, rgba(255,138,76,0.22), transparent 70%);
  animation-delay: -4s;
}
.noise {
  position: absolute; inset: 0; opacity: 0.04; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes float {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(16px, 22px, 0) scale(1.06); }
}

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}
.boot-orb {
  width: 58px; height: 58px; margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent-2));
  box-shadow: 0 0 48px rgba(240,180,41,0.35);
  animation: pulse 1.15s ease-in-out infinite;
}
.brand-mini {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--accent);
}
.boot-bars {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}
.boot-bars span {
  width: 28px;
  height: 4px;
  border-radius: 99px;
  background: rgba(240,180,41,0.25);
  animation: bootBar 1s ease-in-out infinite;
}
.boot-bars span:nth-child(2) { animation-delay: 0.15s; }
.boot-bars span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bootBar {
  0%, 100% { background: rgba(240,180,41,0.2); transform: scaleX(0.85); }
  50% { background: var(--accent); transform: scaleX(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1); opacity: 1; }
}

.shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 14px calc(var(--tab-h) + var(--safe-b) + 16px);
}
.page { display: none; }
.page.active { display: block; animation: pageIn 0.38s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.page-head h1, .balance {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-head h1 { font-size: 32px; }
.muted, .panel-sub, .balance-label, .delta {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 13px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 18px 16px 16px;
  border: 1px solid rgba(240,180,41,0.18);
  background:
    linear-gradient(145deg, rgba(240,180,41,0.1), transparent 45%),
    rgba(18, 21, 30, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-glow {
  position: absolute;
  width: 200px; height: 200px;
  right: -50px; top: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,180,41,0.2), transparent 68%);
  pointer-events: none;
}
.hero-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.balance-label {
  margin-top: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.balance {
  font-size: clamp(36px, 10vw, 46px);
  line-height: 1;
  margin-top: 4px;
}
.delta { font-weight: 600; }
.free-line {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.day-limit {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
}
.day-limit .track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.trip-chip {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(240,180,41,0.28);
  background: rgba(240,180,41,0.1);
  font-size: 13px;
  font-weight: 700;
}

.period-switch, .seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.hero-card .period-switch {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  margin-top: 14px;
  flex-shrink: 0;
}
.period-switch button, .seg button {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s ease;
}
.hero-card .period-switch button {
  width: 100%;
  padding: 9px 8px;
  text-align: center;
}
.period-switch button.on, .seg button.on {
  background: var(--accent);
  color: #1a1408;
  box-shadow: 0 6px 16px rgba(240,180,41,0.28);
}
.seg.big { width: 100%; }
.seg.big button { flex: 1; padding: 12px; font-size: 14px; }

.hero-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.metric {
  padding: 12px 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
  font-weight: 600;
}
.metric strong {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
.metric.out strong { color: var(--out); }
.metric.in strong { color: var(--in); }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.qa {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.qa:active { transform: scale(0.97); border-color: rgba(240,180,41,0.35); }
.qa-ico {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}
.qa-ico.out { color: var(--out); background: rgba(255,107,122,0.12); }
.qa-ico.in { color: var(--in); background: rgba(94,200,255,0.12); }

.insight {
  margin-top: 12px;
  padding: 14px 15px;
  border-radius: 20px;
  border: 1px solid rgba(240,180,41,0.18);
  background:
    linear-gradient(120deg, rgba(240,180,41,0.1), transparent 55%),
    rgba(20, 23, 31, 0.75);
  box-shadow: var(--shadow);
}
.insight-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}
.insight p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}
.insight strong { color: var(--accent); font-weight: 800; }

.plan-strip {
  margin-top: 10px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}
.plan-chip {
  text-align: left;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(240,180,41,0.12), rgba(255,255,255,0.03));
  border: 1px solid rgba(240,180,41,0.18);
  display: grid;
  gap: 4px;
}
.plan-chip .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.plan-chip strong {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
}

.budget-strip {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.budget-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
}
.budget-chip .track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.budget-chip.warn {
  border-color: rgba(255,107,122,0.35);
  background: linear-gradient(120deg, rgba(255,107,122,0.08), var(--panel));
}

.panel {
  margin-top: 12px;
  padding: 15px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.reveal { animation: rise 0.5s cubic-bezier(.2,.8,.2,1) both; }
.reveal:nth-child(3) { animation-delay: 0.04s; }
.reveal:nth-child(4) { animation-delay: 0.08s; }
.reveal:nth-child(5) { animation-delay: 0.12s; }
.reveal:nth-child(6) { animation-delay: 0.16s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.panel h2, .budget-form h2 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.chip {
  font-size: 11px;
  color: #1a1408;
  background: linear-gradient(135deg, var(--accent), #ffc85a);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}
.text-btn {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.chart-wrap { margin-top: 4px; }
.chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 128px;
}
.bar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.bar {
  width: 100%;
  border-radius: 9px 9px 5px 5px;
  background: linear-gradient(180deg, #ffd76a 0%, rgba(240,180,41,0.55) 65%, rgba(255,138,76,0.2) 100%);
  transform-origin: bottom;
  animation: grow 0.55s cubic-bezier(.2,.8,.2,1) both;
  min-height: 6px;
}
.bar.empty {
  background: rgba(255,255,255,0.05);
}
.bar.active {
  background: linear-gradient(180deg, #ffe29a, var(--accent));
}
@keyframes grow {
  from { transform: scaleY(0.12); opacity: 0.25; }
  to { transform: scaleY(1); opacity: 1; }
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.structure {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 14px;
  align-items: center;
}
.donut {
  width: 118px;
  height: 118px;
  position: relative;
}
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}
.donut-center strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}
.donut-center span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.cat-list, .tx-list, .budget-list { display: grid; gap: 10px; }
.cat-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px 10px;
  align-items: center;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.cat-row .track {
  grid-column: 2 / -1;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.55s ease;
}
.fill.warn { background: linear-gradient(90deg, #ffb454, var(--out)); }

.label { font-size: 14px; font-weight: 700; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.amt {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.amt.out { color: var(--out); }
.amt.in { color: var(--in); }

.wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wallet {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(240,180,41,0.08), transparent 55%),
    rgba(255,255,255,0.025);
}
.wallet::after {
  content: "";
  position: absolute;
  width: 80px; height: 80px;
  right: -20px; bottom: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,76,0.14), transparent 70%);
}
.wallet .sub, .wallet strong { position: relative; z-index: 1; }
.wallet strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 17px;
}

.tx-list.cards { gap: 8px; }
.tx-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.tx-list.cards .tx-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
}
.tx-row:last-child { border-bottom: 0; }
.tx-list.cards .tx-row:last-child { border-bottom: 1px solid var(--line); }
.avatar {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
}
.avatar.out { background: rgba(255,107,122,0.14); color: var(--out); }
.avatar.in { background: rgba(94,200,255,0.14); color: var(--in); }
.tx-main { min-width: 0; }
.tx-main .label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-actions { display: grid; justify-items: end; gap: 4px; }
.tx-row button.del {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.add-form, .budget-form { display: grid; gap: 14px; }
.amount-stage {
  border-radius: 22px;
  padding: 8px;
  border: 1px solid rgba(240,180,41,0.2);
  background:
    radial-gradient(80% 80% at 20% 0%, rgba(240,180,41,0.12), transparent 55%),
    rgba(255,255,255,0.02);
}
.field { display: grid; gap: 8px; }
.field > span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
}
.field input, .field select, .budget-form select, .budget-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .budget-form input:focus, .budget-form select:focus {
  border-color: rgba(240,180,41,0.5);
  box-shadow: 0 0 0 4px rgba(240,180,41,0.1);
}
.amount-row { display: grid; grid-template-columns: 1fr 84px; gap: 8px; }
.amount-field input {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  padding: 8px 12px;
}
.amount-hint {
  margin: 4px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.amount-hint.hot { color: var(--accent); }

.templates {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.templates::-webkit-scrollbar { display: none; }
.tpl {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  text-align: left;
  min-width: 108px;
}
.tpl .label { font-size: 13px; }
.tpl .sub { margin-top: 4px; color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.tpl:active { border-color: rgba(240,180,41,0.45); background: rgba(240,180,41,0.1); }

.export-btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(240,180,41,0.35);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.ghost {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}
.tx-row { cursor: pointer; }
.tx-row button.del { cursor: pointer; }

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 4px 8px;
}
.numpad button {
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  transition: transform 0.12s ease, background 0.12s ease;
}
.numpad button:active {
  transform: scale(0.96);
  background: rgba(240,180,41,0.16);
}
.numpad .span2 { grid-column: span 2; }
.numpad .num-del { color: var(--out); }
.numpad .num-k {
  font-size: 15px;
  color: var(--accent);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
}
.sheet.hidden { display: none !important; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  animation: fadeIn 0.2s ease both;
}
.sheet-card {
  position: relative;
  max-height: min(78vh, 640px);
  overflow: auto;
  border-radius: 28px 28px 0 0;
  padding: 10px 14px calc(18px + var(--safe-b));
  background: #12151d;
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: 0 -20px 50px rgba(0,0,0,0.45);
  animation: sheetUp 0.32s cubic-bezier(.2,.8,.2,1) both;
}
.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,0.18);
  margin: 4px auto 12px;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.sheet-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}
.sheet-x {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.sheet-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sheet-metrics .metric { background: rgba(255,255,255,0.03); }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 2px 8px;
  cursor: pointer;
}
.day-head:first-child { margin-top: 2px; }
.day-head .label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.day-head .amt { font-size: 12px; color: var(--muted); }
.bar-col { cursor: pointer; }

.balance.pulse {
  animation: balPulse 0.45s ease;
}
@keyframes balPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  transition: 0.18s ease;
}
.pick.on {
  background: rgba(240,180,41,0.14);
  border-color: rgba(240,180,41,0.55);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(240,180,41,0.08);
}

.primary {
  width: 100%;
  border-radius: 18px;
  padding: 16px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffd76a, var(--accent) 45%, var(--accent-2));
  color: #1a1408;
  box-shadow: 0 14px 34px rgba(240,180,41,0.22);
  transition: transform 0.15s ease;
}
.primary:active { transform: scale(0.98); }
.row-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }

.budget-row.panel { margin: 0; }
.budget-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
}
.budget-row .track {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.budget-row.dim, .task-row.dim { opacity: 0.55; }
.row-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.back-btn {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.hub-card {
  text-align: left;
  padding: 16px 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  gap: 4px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.hub-card:active { transform: scale(0.98); }
.hub-card .hub-ico {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  background: rgba(240,180,41,0.12);
  color: var(--accent);
  font-weight: 800;
}
.hub-card strong {
  font-family: var(--font-display);
  font-size: 17px;
}
.debt-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 12px;
}
.debt-stats .metric {
  padding: 12px 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.debt-stats .metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.debt-stats .metric strong {
  font-family: var(--font-mono);
  font-size: 16px;
}
.task-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0;
}
.task-check {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1.5px solid rgba(240,180,41,0.45);
  background: transparent;
}
.task-check.on {
  background: linear-gradient(135deg, #ffd76a, var(--accent));
  border-color: transparent;
  box-shadow: inset 0 0 0 4px rgba(11,13,18,0.85);
}
.strike { text-decoration: line-through; opacity: 0.75; }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: rgba(11, 13, 18, 0.88);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.15);
  z-index: 20;
}
.tabbar button {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 4px;
  transition: color 0.2s ease;
}
.tabbar button i {
  width: 22px; height: 22px;
  border-radius: 8px;
  background: currentColor;
  opacity: 0.35;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  transition: 0.2s ease;
}
.tabbar button[data-go="home"] i {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 11.5 12 4l8 7.5V20a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 11.5 12 4l8 7.5V20a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
}
.tabbar button[data-go="history"] i {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 4h14v2H5zm0 5h14v2H5zm0 5h10v2H5zm0 5h8v2H5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 4h14v2H5zm0 5h14v2H5zm0 5h10v2H5zm0 5h8v2H5z'/%3E%3C/svg%3E");
}
.tabbar button[data-go="add"] i {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E");
}
.tabbar button[data-go="more"] i,
.tabbar button[data-go="budgets"] i {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm7 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm7 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm7 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm7 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/%3E%3C/svg%3E");
}
.tabbar button.on { color: var(--accent); }
.tabbar button.on i { opacity: 1; background: var(--accent); }
.tabbar button.fab i {
  width: 36px; height: 36px;
  border-radius: 13px;
  opacity: 1;
  background: linear-gradient(135deg, #ffd76a, var(--accent-2));
  box-shadow: 0 8px 20px rgba(240,180,41,0.28);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  transform: translateX(-50%);
  background: #1c1820;
  border: 1px solid rgba(240,180,41,0.4);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  z-index: 40;
  animation: pageIn 0.25s ease both;
  box-shadow: var(--shadow);
}
.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 10px 0;
  line-height: 1.45;
}

@media (max-width: 380px) {
  .structure { grid-template-columns: 1fr; }
  .donut { margin: 0 auto; }
  .metric strong { font-size: 12px; }
}
