/* Pennie demo — cozy palette from the final design (variation-final.jsx). */

:root {
  --bg: #FAF3EC;
  --surface: #FFFFFF;
  --ink: #2B221C;
  --ink-dim: #7A6E63;
  --ink-soft: #A89C90;
  --hair: rgba(43, 34, 28, 0.08);
  --accent: #E89876;
  --accent-deep: #C66B47;
  --accent-wash: rgba(232, 152, 118, 0.14);
  --green: #3F7A55;
  --hero-ink: #3A2418;
  --hero: linear-gradient(160deg, #FFD9C4 0%, #FFC2A1 60%, #F2A37C 100%);
  --page: #EEE7DF;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(60% 55% at 62% 45%, rgba(255, 210, 186, 0.55), rgba(255, 210, 186, 0) 70%),
    var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.embedded body { overflow: hidden; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:disabled { cursor: default; }

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

.num, .tnum { font-variant-numeric: tabular-nums; }

/* ── Page stage ─────────────────────────────────────────────── */

.stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 72px;
  padding: 14px 16px;
}

.caption { display: none; width: 320px; color: var(--ink); }

@media (min-width: 940px) and (min-height: 560px) {
  .caption { display: block; }
}
.embedded .caption { display: none !important; }

.caption .back {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-dim);
  text-decoration: none;
  margin-bottom: 36px;
}
.caption .back:hover { color: var(--accent-deep); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--accent);
  overflow: hidden;
}
.brand-mark i {
  position: absolute;
  border-radius: 50%;
  background: #FFEFE3;
}
.brand-mark i:nth-child(1) { width: 12px; height: 12px; left: 5px; top: 12px; }
.brand-mark i:nth-child(2) { width: 9px; height: 9px; left: 16px; top: 15px; opacity: 0.8; }
.brand-mark i:nth-child(3) { width: 6px; height: 6px; left: 14px; top: 6px; opacity: 0.6; }

.caption h1 {
  margin: 22px 0 12px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -1px;
  font-weight: 700;
}
.caption p {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-dim);
}
.try {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  font-size: 14px;
  color: var(--ink);
}
.try li {
  position: relative;
  padding: 7px 0 7px 22px;
  border-top: 1px solid rgba(43, 34, 28, 0.09);
}
.try li:last-child { border-bottom: 1px solid rgba(43, 34, 28, 0.09); }
.try li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
}
.try b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  line-height: 1;
}
.caption .stack { font-size: 13px; color: var(--ink-soft); margin: 0; }

.device-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.demo-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  height: 20px;
  line-height: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-dim);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Phone frame ────────────────────────────────────────────── */

.device-wrap {
  width: calc(378px * var(--scale, 1));
  height: calc((var(--screen-h, 740px) + 18px) * var(--scale, 1));
}

.device {
  position: relative;
  width: 378px;
  height: calc(var(--screen-h, 740px) + 18px);
  padding: 9px;
  border-radius: 52px;
  background: #1F1A16;
  box-shadow:
    0 36px 70px -18px rgba(58, 36, 24, 0.38),
    0 12px 24px -12px rgba(58, 36, 24, 0.25),
    inset 0 0 0 1.5px #3B332C;
  transform: scale(var(--scale, 1));
  transform-origin: 0 0;
}

.screen {
  --top: 60px;
  position: relative;
  width: 360px;
  height: var(--screen-h, 740px);
  border-radius: 43px;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}

/* soft fade under the status bar so scrolled content doesn't collide with it */
.screen::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 46px;
  background: linear-gradient(var(--bg) 60%, rgba(250, 243, 236, 0));
  z-index: 30;
  pointer-events: none;
}

.statusbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 50px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 30px 0 34px;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  pointer-events: none;
}
.sb-icons { display: flex; align-items: center; gap: 5px; }
.sb-icons svg { fill: currentColor; }

.island {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 104px;
  height: 30px;
  margin-left: -52px;
  border-radius: 20px;
  background: #000;
  z-index: 50;
}

.home-ind {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 120px;
  height: 4px;
  margin-left: -60px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.25);
  z-index: 90;
  pointer-events: none;
}

/* ── Full screen on phones and narrow embeds ────────────────── */

@media (max-width: 500px) {
  body { background: var(--bg); overflow: hidden; }
  .stage { display: block; padding: 0; height: 100vh; height: 100dvh; min-height: 0; }
  .caption, .demo-label, .statusbar, .island, .home-ind { display: none; }
  .device-col { display: block; height: 100%; }
  .device-wrap { width: 100%; height: 100%; }
  .device {
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: none;
  }
  .screen {
    --top: calc(env(safe-area-inset-top, 0px) + 48px);
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .screen::before { height: calc(env(safe-area-inset-top, 0px) + 10px); }
  .demo-chip { display: flex !important; }
  .tabbar { bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important; }
  .view { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px) !important; }
  .sheet-panel { top: calc(env(safe-area-inset-top, 0px) + 14px) !important; }
  .sheet-foot { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px) !important; }
  .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
}

.noscript {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}

/* ── App views ──────────────────────────────────────────────── */

.view {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 110px;
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }

.view.enter { animation: view-in 0.34s var(--ease); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
}

.demo-chip {
  display: none;
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--hair);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-dim);
  white-space: nowrap;
  z-index: 2;
}
.demo-chip .dot { width: 5px; height: 5px; }

.hd { padding: var(--top) 24px 8px; }
.hd-sub { font-size: 13px; color: var(--ink-dim); margin-bottom: 2px; }
.hd h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }

.hd-home {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
}
.greet { font-size: 22px; font-weight: 600; letter-spacing: -0.4px; }

.month-sw {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 2px -6px;
  font-size: 13px;
  color: var(--ink-dim);
}
.msb {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-dim);
}
.msb:disabled { opacity: 0.3; }
.month-sw-label { padding: 0 2px; }

.round-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(43, 34, 28, 0.06);
}
.round-btn .badge {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-deep);
  box-shadow: 0 0 0 2px var(--surface);
}
.bell.ring svg { animation: ring 0.7s ease; transform-origin: 50% 4px; }
@keyframes ring {
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-4deg); }
}

/* hero */
.hero {
  position: relative;
  overflow: hidden;
  margin: 4px 16px 18px;
  padding: 22px 22px 18px;
  border-radius: 28px;
  background: var(--hero);
  color: var(--hero-ink);
}
.hero-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}
.hero-val {
  margin-top: 6px;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.1;
}
.hero-of { margin-top: 2px; font-size: 12px; opacity: 0.7; }
.hero-track {
  margin-top: 16px;
  height: 8px;
  border-radius: 4px;
  background: rgba(58, 36, 24, 0.12);
}
.hero-track > i { background: var(--hero-ink); border-radius: 4px; }
.hero-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.6;
}
.pebbles {
  position: absolute;
  right: -10px;
  bottom: -12px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  opacity: 0.5;
}
.pebbles span {
  border-radius: 50%;
  background: #FFEFE3;
  animation: pop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  animation-delay: calc(0.25s + var(--i) * 80ms);
}
@keyframes pop {
  from { transform: scale(0.3) translateY(10px); opacity: 0; }
}

/* quick stats */
.stats { display: flex; gap: 10px; padding: 0 16px 18px; }
.stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
}
.stat-ic {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.stat-v { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; white-space: nowrap; }
.stat-l { font-size: 10px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.6px; }

/* section heads + cards */
.sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.sec-lg { font-size: 13px; }
button.sec { width: 100%; text-align: left; }
.sec .link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-deep);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.card {
  margin: 0 16px;
  padding: 6px;
  border-radius: 22px;
  background: var(--surface);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hair);
}
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-amt { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-amt.over, .row-left.over { color: var(--accent-deep); }
.row-left { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-sub { margin-top: 4px; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.chip {
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

/* animated bars (fill grows when the .anim block gets .in) */
.bar {
  height: 5px;
  margin-top: 5px;
  border-radius: 3px;
  background: var(--hair);
  overflow: hidden;
}
.bar.thick { height: 6px; margin-top: 6px; }
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.95s var(--ease) var(--d, 0s);
}
.anim.in .bar > i { width: var(--w); }
.hero-track.bar { height: 8px; margin-top: 16px; }

/* ── Activity ───────────────────────────────────────────────── */

.search { display: flex; gap: 8px; padding: 12px 16px 14px; }
.field {
  flex: 1;
  min-width: 0;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-soft);
}
.field:focus-within { box-shadow: 0 0 0 2px rgba(198, 107, 71, 0.35); }
.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
.field input::placeholder { color: var(--ink-soft); opacity: 1; }
.field input::-webkit-search-cancel-button { display: none; }
.sq-btn {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
}

.chips {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 0 16px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.fchip {
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 600;
  transition: background-color 0.2s, color 0.2s;
}
.fchip.on { background: var(--accent-deep); color: #fff; }

.group { margin-bottom: 12px; }
.group-hd {
  display: flex;
  justify-content: space-between;
  padding: 0 24px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
}
.card.tx { padding: 4px; }
.tx .row { padding: 11px 12px; animation: row-in 0.42s var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
}
.tx-meta { display: flex; align-items: center; gap: 6px; margin-top: 1px; font-size: 11px; color: var(--ink-soft); }
.tx-amt { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amt.pos { color: var(--green); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 24px;
  color: var(--ink-soft);
  font-size: 13px;
}

/* ── Trends ─────────────────────────────────────────────────── */

.seg {
  display: flex;
  gap: 6px;
  margin: 8px 16px 14px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
}
.seg button {
  flex: 1;
  height: 32px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background-color 0.2s, color 0.2s;
}
.seg button.on { background: var(--accent-wash); color: var(--accent-deep); }

.panel {
  margin: 0 16px 18px;
  padding: 20px 18px 18px;
  border-radius: 22px;
  background: var(--surface);
}
.panel-hd { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.k-lbl { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.6px; }
.k-val { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.delta { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--green); }
.delta.up { color: var(--accent-deep); }

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 130px;
  margin-top: 10px;
}
.bars.dense { gap: 5px; }
.tb {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.tb-bar {
  position: relative;
  width: 100%;
  max-width: 28px;
  height: 0;
  border-radius: 8px;
  background: #EFE0D2;
  transition: height 0.8s var(--ease) var(--d, 0s), background-color 0.25s;
}
.dense .tb-bar { border-radius: 6px; }
.anim.in .tb-bar { height: var(--h); }
.tb.sel .tb-bar { background: var(--accent); }
@media (hover: hover) {
  .tb:not(.sel):hover .tb-bar { background: #F4D2BE; }
}
.tb-val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-deep);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  animation: fade-up 0.35s var(--ease) both;
}
.anim:not(.in) .tb-val { opacity: 0; }
@keyframes fade-up {
  from { opacity: 0; transform: translate(-50%, 4px); }
}
.tb-lbl { font-size: 10px; color: var(--ink-soft); font-weight: 500; }
.tb.sel .tb-lbl { font-weight: 700; color: var(--accent-deep); }

.donut-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 16px 18px;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface);
}
.donut { position: relative; width: 100px; height: 100px; flex-shrink: 0; }
.donut svg { transform: rotate(-90deg); }
.donut .seg-arc {
  stroke-dasharray: 0px var(--c);
  transition: stroke-dasharray 0.9s var(--ease) var(--d, 0s);
}
.anim.in .donut .seg-arc { stroke-dasharray: var(--len) var(--c); }
.donut-c {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-c small { font-size: 9px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.6px; }
.donut-c b { font-size: 14px; font-weight: 700; letter-spacing: -0.3px; }
.legend { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; }
.legend i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend span { flex: 1; }
.legend em { font-style: normal; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.insight {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #F4E4C5;
}
.insight-ic {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: #8E6A2A;
}
.insight b { display: block; font-size: 13px; font-weight: 600; color: #5A4818; }
.insight p { margin: 2px 0 0; font-size: 11px; line-height: 1.4; color: #8A7242; }

/* ── Budgets ────────────────────────────────────────────────── */

.ring-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 12px 16px 18px;
  padding: 20px 18px;
  border-radius: 24px;
  background: var(--surface);
}
.ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring-prog {
  stroke-dasharray: var(--c);
  stroke-dashoffset: var(--c);
  transition: stroke-dashoffset 1.2s var(--ease);
}
.anim.in .ring-prog { stroke-dashoffset: var(--off); }
.ring-c {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.ring-c small { font-size: 12px; color: var(--ink-soft); }
.big-v { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.sub-v { margin-top: 2px; font-size: 12px; color: var(--ink-dim); }
.budgets .row { padding: 12px; }

/* ── Tab bar ────────────────────────────────────────────────── */

.tabbar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  height: 72px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(43, 34, 28, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.tab {
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.tab span { font-size: 10px; font-weight: 500; letter-spacing: 0.1px; }
.tab.on { color: var(--accent-deep); }
.tab.on span { font-weight: 600; }
.tab.on svg { stroke-width: 2.1; }
.tab-add {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(232, 152, 118, 0.4);
  transition: transform 0.15s, background-color 0.2s;
}
.tab-add:active { transform: scale(0.93); }
@media (hover: hover) {
  .tab:not(.on):hover { color: var(--ink-dim); }
  .tab-add:hover { background: #E38A65; }
  .msb:not(:disabled):hover, .sq-btn:hover, .round-btn:hover { background-color: rgba(43, 34, 28, 0.05); }
  .round-btn:hover, .sq-btn:hover { background-color: #FFF8F2; }
}

/* ── Toast ──────────────────────────────────────────────────── */

.toast {
  position: absolute;
  left: 50%;
  bottom: 104px;
  z-index: 80;
  max-width: calc(100% - 40px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(43, 34, 28, 0.25);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }
.toast-ic {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
}
.toast-dim { opacity: 0.7; font-weight: 500; }

/* ── Add-entry sheet ────────────────────────────────────────── */

.sheet { position: absolute; inset: 0; z-index: 70; }
.sheet[hidden] { display: none; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 34, 28, 0.32);
  opacity: 0;
  transition: opacity 0.35s;
}
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 54px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  box-shadow: 0 -10px 30px rgba(43, 34, 28, 0.12);
  transform: translateY(102%);
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.grabber {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 36px;
  height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: rgba(43, 34, 28, 0.14);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.sheet-body::-webkit-scrollbar { display: none; }

.sheet-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 12px;
}
.sheet-hd h2 { margin: 0; font-size: 15px; font-weight: 700; }
.ibtn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
}
.ibtn.soft { color: var(--ink-soft); }

.io { display: flex; gap: 8px; padding: 6px 16px 16px; }
.io button {
  flex: 1;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.22s, color 0.22s;
}
.io button.on { color: #fff; font-weight: 700; }
.io button.on[data-io="out"] { background: var(--accent); }
.io button.on[data-io="in"] { background: var(--green); }

.amount {
  margin: 0 16px 18px;
  padding: 24px 18px;
  border-radius: 26px;
  background: var(--hero);
  color: var(--hero-ink);
}
.amount-l { font-size: 11px; font-weight: 600; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.7px; }
.amount-v {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  font-size: 60px;
  font-weight: 700;
  letter-spacing: -1.8px;
  line-height: 1.1;
}
.amount-v .dim { opacity: 0.5; }
.amount-v .sym { font-size: 36px; opacity: 0.6; }
.caret {
  align-self: center;
  width: 3px;
  height: 46px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--hero-ink);
  opacity: 0.55;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.cat-l {
  padding: 0 24px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 0 16px 16px;
  padding: 16px;
  border-radius: 22px;
  background: var(--surface);
}
.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.cat-box {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--t0);
  color: var(--t1);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.cat-n { font-size: 9px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.cat.sel .cat-box {
  background: var(--t1);
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--t1) 20%, transparent);
  transform: scale(1.04);
}
.cat.sel .cat-n { font-weight: 700; color: var(--t1); }

.meta { display: flex; gap: 8px; margin: 0 16px 16px; }
.meta button {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}
.meta span { font-size: 11px; font-weight: 600; color: var(--ink-dim); white-space: nowrap; }
.meta button[aria-expanded="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }

.note {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0 16px;
  transition: grid-template-rows 0.3s var(--ease), margin 0.3s var(--ease);
}
.note.open { grid-template-rows: 1fr; margin-bottom: 16px; }
.note > div { overflow: hidden; }
.note input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: 0;
}
.note input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.note input::placeholder { color: var(--ink-soft); }

.sheet-foot {
  padding: 4px 16px 18px;
  background: linear-gradient(rgba(250, 243, 236, 0), var(--bg) 26%);
}
.save {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  background: var(--accent-deep);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(198, 107, 71, 0.32);
  transition: transform 0.15s, background-color 0.2s;
}
.save:active { transform: scale(0.98); }
@media (hover: hover) {
  .save:hover { background: #B95E3B; }
  .cat:not(.sel):hover .cat-box { transform: translateY(-1px); }
}

/* small press feedback on tappable surfaces */
.fchip:active, .seg button:active, .io button:active, .meta button:active,
.ibtn:active, .round-btn:active, .sq-btn:active, .cat:active .cat-box { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
