@font-face {
  font-family: 'Manrope';
  src: url('../assets/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f1e8;
  --bg-deep: #ebe6da;
  --surface: #fffdf8;
  --surface-soft: #f8f4ea;
  --surface-sink: #efe9dd;
  --ink: #172820;
  --ink-soft: #4f5f57;
  --muted: #59645b;
  --line: #e4ded1;
  --line-strong: #d6cebe;
  --green: #123f35;
  --green-deep: #0b2f27;
  --green-soft: #e5efe8;
  --mint: #a8e6c9;
  --mint-soft: #dcf3e7;
  --lime: #d7ee9b;
  --amber: #8e5b21;
  --amber-soft: #fbedda;
  --red: #b34f3f;
  --red-soft: #fbe6e1;
  --blue: #456f91;
  --shadow-card: 0 1px 1px rgba(32, 46, 38, .03), 0 10px 28px rgba(40, 46, 36, .05);
  --shadow-float: 0 18px 48px rgba(28, 48, 38, .18);
  --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --radius: 24px;
  --tap: 44px;
  --page-pad: 20px;
  --nav-space: calc(96px + env(safe-area-inset-bottom));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(1100px 680px at 50% -120px, rgba(168, 230, 201, .16), transparent 62%),
    #e7e0d2;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body.sheet-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1, h2, h3, h4, p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--mint);
  color: var(--green-deep);
}

:focus-visible {
  outline: 2.5px solid var(--green);
  outline-offset: 3px;
}

.app-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(520px 320px at 96% 2%, rgba(206, 233, 213, .48), transparent 70%),
    var(--bg);
  box-shadow: 0 0 0 1px rgba(64, 68, 56, .04), 0 28px 80px rgba(44, 47, 38, .12);
  overflow: clip;
}

.app {
  min-height: 100dvh;
  padding-bottom: var(--nav-space);
}

.splash {
  min-height: 92dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--green);
}

.splash__mark svg {
  width: 78px;
  height: 78px;
}

.splash__word {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -.045em;
}

.splash__word span {
  color: #8b6b43;
}

.splash__hint {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
}

.noscript {
  padding: 24px;
  font-family: var(--font-ui);
  text-align: center;
}

/* ------------------------------------------------------------------ *
 *  Shell / navigation
 * ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) calc(var(--page-pad) + env(safe-area-inset-right)) 9px calc(var(--page-pad) + env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(244, 241, 232, .98) 0%, rgba(244, 241, 232, .92) 74%, rgba(244, 241, 232, 0) 100%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--tap);
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand__mark {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: #fff9ec;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}

.brand__mark svg {
  width: 19px;
  height: 19px;
}

.brand__word {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.055em;
}

.brand__word b {
  color: #7a5a30;
  font-weight: 600;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.month-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: var(--tap);
  max-width: 172px;
  padding: 0 12px;
  border: 1px solid rgba(30, 62, 50, .12);
  border-radius: 999px;
  background: rgba(255, 253, 248, .8);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.month-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4c9a79;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(76, 154, 121, .12);
}

.month-pill__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-pill svg {
  flex: 0 0 auto;
  opacity: .62;
}

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  min-width: var(--tap);
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
}

.icon-btn--paper {
  border-color: rgba(30, 62, 50, .1);
  background: rgba(255, 253, 248, .8);
}

.icon-btn:active {
  transform: scale(.94);
}

.view {
  animation: view-in .34s cubic-bezier(.2, .75, .25, 1);
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  padding: 0 var(--page-pad);
  margin-top: 26px;
}

.section--flush {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 16.5px;
  font-weight: 750;
  letter-spacing: -.025em;
}

.section-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.section-link {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 2px 0 8px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.section-link svg {
  width: 16px;
  height: 16px;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .135em;
  line-height: 1.3;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ------------------------------------------------------------------ *
 *  Bottom bar / FAB
 * ------------------------------------------------------------------ */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr 1fr 82px 1fr 1fr;
  align-items: start;
  width: 100%;
  max-width: 480px;
  min-height: 66px;
  padding: 7px 7px calc(4px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(255, 253, 248, .9);
  border-top: 1px solid rgba(37, 58, 48, .08);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 32px rgba(33, 45, 37, .08);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  backdrop-filter: blur(24px) saturate(1.35);
}

.tabbar__tab {
  position: relative;
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px 6px;
  border-radius: 15px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: -.01em;
  -webkit-tap-highlight-color: transparent;
}

.tabbar__tab::before {
  content: '';
  position: absolute;
  top: 3px;
  width: 42px;
  height: 34px;
  border-radius: 13px;
  background: transparent;
  transition: background .2s ease;
}

.tabbar__tab.is-active::before {
  background: var(--green-soft);
}

.tabbar__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.tabbar__icon svg {
  width: 22px;
  height: 22px;
}

.tabbar__label {
  position: relative;
  z-index: 1;
}

.tabbar__tab.is-active {
  color: var(--green);
}

.tabbar__tab:active {
  transform: scale(.96);
}

.tabbar__fab-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: -25px;
}

.tabbar__fab-label {
  color: var(--green);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .02em;
}

.fab {
  width: 59px;
  height: 59px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: linear-gradient(145deg, #1b5143 0%, #0e332b 100%);
  color: #fffaf0;
  box-shadow: 0 10px 24px rgba(18, 63, 53, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .16s ease, box-shadow .16s ease;
}

.fab::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
}

.fab:active {
  transform: scale(.92);
  box-shadow: 0 6px 15px rgba(18, 63, 53, .26);
}

/* ------------------------------------------------------------------ *
 *  Buttons / controls
 * ------------------------------------------------------------------ */

.btn {
  min-height: 52px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -.015em;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}

.btn:active {
  transform: scale(.985);
}

.btn:disabled {
  opacity: .45;
  pointer-events: none;
}

.btn svg {
  width: 19px;
  height: 19px;
}

.btn--primary {
  background: linear-gradient(160deg, #17493c 0%, #10372e 100%);
  color: #fffaf0;
  box-shadow: 0 6px 18px rgba(18, 63, 53, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn--secondary {
  background: var(--green-soft);
  border-color: rgba(18, 63, 53, .08);
  color: var(--green);
}

.btn--outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost {
  min-height: var(--tap);
  background: transparent;
  color: var(--ink-soft);
}

.btn--danger {
  background: var(--red-soft);
  border-color: rgba(179, 79, 63, .14);
  color: #8e3b2e;
}

.btn--danger-solid {
  background: var(--red);
  color: white;
}

.btn--compact {
  width: auto;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 14px;
  font-size: 12.5px;
}

.btn--text {
  min-height: var(--tap);
  width: auto;
  padding: 0 10px;
  background: transparent;
  color: var(--green);
  font-size: 13px;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row > * {
  flex: 1;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 4px;
  min-height: 48px;
  border-radius: 15px;
  background: var(--surface-sink);
}

.segmented button {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -.01em;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(33, 46, 37, .08), 0 3px 9px rgba(33, 46, 37, .05);
}

.chip {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fffaf0;
}

.chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}

.chip-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar {
  display: none;
}

/* ------------------------------------------------------------------ *
 *  Dashboard
 * ------------------------------------------------------------------ */

.dashboard-hello {
  padding: 10px var(--page-pad) 17px;
}

.dashboard-hello .eyebrow {
  margin-bottom: 7px;
}

.dashboard-hello h1 {
  max-width: 330px;
  font-family: var(--font-display);
  font-size: clamp(31px, 8.2vw, 38px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.038em;
}

.dashboard-hello h1 em {
  color: #6c7d6d;
  font-style: normal;
}

.dashboard-hello__meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4d9b78;
  box-shadow: 0 0 0 3px rgba(77, 155, 120, .11);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 var(--page-pad);
  padding: 21px 21px 18px;
  border-radius: 28px;
  background:
    radial-gradient(330px 200px at 100% 0%, rgba(168, 230, 201, .16), transparent 65%),
    linear-gradient(145deg, #194b3e 0%, #10392f 56%, #0b2d25 100%);
  color: #fff9ed;
  box-shadow: 0 16px 34px rgba(17, 52, 43, .2), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 210px;
  height: 210px;
  right: -102px;
  top: -112px;
  border: 1px solid rgba(168, 230, 201, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(168, 230, 201, .035), 0 0 0 52px rgba(168, 230, 201, .02);
}

.hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 150px;
  height: 150px;
  left: -76px;
  bottom: -100px;
  border-radius: 50%;
  background: rgba(168, 230, 201, .07);
  filter: blur(1px);
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 249, 237, .78);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero__label svg {
  width: 15px;
  height: 15px;
  opacity: .8;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 249, 237, .14);
  border-radius: 999px;
  background: rgba(255, 249, 237, .07);
  color: var(--mint);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero__amount {
  margin-top: 12px;
  font-size: clamp(34px, 9.8vw, 43px);
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  line-height: 1.04;
  white-space: normal;
  overflow-wrap: anywhere;
}

.hero__sub {
  margin-top: 5px;
  color: rgba(255, 249, 237, .78);
  font-size: 11.5px;
  font-weight: 500;
}

.hero__sub strong {
  color: rgba(255, 249, 237, .88);
  font-weight: 700;
}

.hero__divider {
  height: 1px;
  margin: 17px 0 13px;
  background: rgba(255, 249, 237, .12);
}

.hero__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero__metric span {
  display: block;
  color: rgba(255, 249, 237, .72);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.hero__metric strong {
  display: block;
  margin-top: 4px;
  color: #fff9ed;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.hero__metric--right {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 249, 237, .12);
}

.hero__ratio {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 249, 237, .76);
  font-size: 10.5px;
}

.hero__pace {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--mint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero__ratio .progress {
  flex: 1;
  height: 5px;
  background: rgba(255, 249, 237, .14);
}

.hero__ratio .progress__fill {
  background: var(--mint);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  padding: 12px var(--page-pad) 0;
}

.stat-card {
  min-width: 0;
  padding: 14px 15px 13px;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.stat-card__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.stat-card__icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}

.stat-card__icon--warm {
  background: var(--amber-soft);
  color: var(--amber);
}

.stat-card__icon svg {
  width: 15px;
  height: 15px;
}

.stat-card__amount {
  font-size: 18px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.038em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card__hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-card {
  padding: 17px;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.plan-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-card__title {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.plan-card__hint {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.plan-card__pct {
  min-width: 46px;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.plan-card__pct.is-warning {
  background: var(--amber-soft);
  color: #7f4f1a;
}

.plan-card__pct.is-over {
  background: var(--red-soft);
  color: #983f31;
}

.plan-card__numbers {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
}

.plan-card__spent {
  font-size: 24px;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.plan-card__spent-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.plan-card__of {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.plan-card__of strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plan-card .progress {
  margin-top: 12px;
}

.plan-card__footer {
  margin-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.plan-card__alert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--amber);
  font-weight: 700;
}

.plan-card__alert.is-over {
  color: var(--red);
}

.plan-card__alert svg {
  width: 13px;
  height: 13px;
}

.progress {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eae4d8;
}

.progress--thin {
  height: 5px;
}

.progress__fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--progress-color, var(--green));
  transition: width .5s cubic-bezier(.22, .75, .24, 1), background .25s ease;
}

.progress__fill.is-warning {
  background: var(--amber);
}

.progress__fill.is-over {
  background: var(--red);
}

/* Pockets rail */
.pocket-rail {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--page-pad));
  padding: 2px var(--page-pad) 10px;
  scroll-padding-inline: var(--page-pad);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pocket-rail::-webkit-scrollbar {
  display: none;
}

.pocket-card {
  position: relative;
  flex: 0 0 186px;
  min-height: 152px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  border: 1px solid rgba(49, 68, 55, .075);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  overflow: hidden;
}

.pocket-card::after {
  content: '';
  position: absolute;
  right: -37px;
  top: -44px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--cat-soft, var(--green-soft));
  opacity: .62;
}

.pocket-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pocket-card__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--cat-soft, var(--green-soft));
  color: var(--cat-color, var(--green));
}

.pocket-card__icon svg {
  width: 19px;
  height: 19px;
}

.pocket-card__tag {
  max-width: 88px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pocket-card__body {
  position: relative;
  z-index: 1;
  margin-top: 13px;
}

.pocket-card__name {
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pocket-card__amount {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pocket-card__meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.pocket-card .progress {
  height: 4px;
  margin-top: 10px;
  background: var(--bg-deep);
}

.pocket-card--empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

/* Category ledger */
.ledger {
  overflow: hidden;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.ledger-row {
  width: 100%;
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.ledger-row:last-child {
  border-bottom: 0;
}

.ledger-row:active {
  background: var(--surface-soft);
}

.ledger-row__icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--cat-soft, var(--green-soft));
  color: var(--cat-color, var(--green));
}

.ledger-row__icon svg {
  width: 18px;
  height: 18px;
}

.ledger-row__main {
  min-width: 0;
}

.ledger-row__name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-row__name .tag {
  flex: 0 0 auto;
}

.ledger-row__meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-row__right {
  min-width: 0;
  text-align: right;
}

.ledger-row__amount {
  display: block;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ledger-row__sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ledger-row__progress {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -1px;
}

.ledger-row__progress .progress {
  flex: 1;
  height: 5px;
}

.ledger-row__pct {
  width: 34px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--amber-soft);
  color: #7f4f1a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.3;
}

.alert-badge--over {
  background: var(--red-soft);
  color: #983f31;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-sink);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.4;
  text-transform: uppercase;
  vertical-align: 1px;
}

.tag--mint {
  background: var(--mint-soft);
  color: #2f735a;
}

.tag--account {
  background: var(--green);
  color: #fff9ed;
}

/* Analysis card */
.analysis-card {
  padding: 17px;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.analysis-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.analysis-card__title {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.analysis-card__hint {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.chart-switch {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-sink);
}

.chart-switch button {
  min-height: var(--tap);
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
}

.chart-switch button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(33, 46, 37, .09);
}

.chart-panel {
  padding-top: 16px;
  animation: soft-in .25s ease;
}

@keyframes soft-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.donut-layout {
  display: flex;
  align-items: center;
  gap: 17px;
}

.donut {
  position: relative;
  flex: 0 0 124px;
  width: 124px;
  height: 124px;
}

.donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
}

.donut__center strong {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.donut__center span {
  max-width: 78px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.25;
}

.chart-legend {
  flex: 1;
  min-width: 0;
}

.legend-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 27px;
}

.legend-row + .legend-row {
  border-top: 1px solid rgba(228, 222, 209, .65);
}

.legend-row__dot {
  width: 7px;
  height: 7px;
  border-radius: 2.5px;
  background: var(--cat-color, var(--green));
}

.legend-row__name {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-row__value {
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-empty {
  flex: 1;
  min-width: 0;
}

.chart-empty strong {
  display: block;
  font-size: 12px;
  font-weight: 750;
}

.chart-empty p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.chart-empty button {
  margin-top: 8px;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}
.evolution {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  min-height: 150px;
  padding: 10px 0 1px;
}

.bar-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.bar-pair {
  height: 112px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
}

.bar {
  width: min(13px, 34%);
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: var(--green-soft);
  transition: height .5s ease;
}

.bar--spent {
  background: var(--green);
}

.bar--budget {
  background: #ddd8cb;
}

.bar-label {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.bar-label.is-active {
  color: var(--green);
}

.bar.is-current {
  background: #1b5a49;
}

.chart-key {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.chart-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.chart-key i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #ddd8cb;
}

.chart-key .is-spent {
  background: var(--green);
}

.evolution-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

/* Movement rows */
.movement-list {
  overflow: hidden;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.movement-row {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 63px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.movement-row:last-child {
  border-bottom: 0;
}

.movement-row:active {
  background: var(--surface-soft);
}

.movement-row__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--cat-soft, var(--green-soft));
  color: var(--cat-color, var(--green));
}

.movement-row__icon--income {
  background: var(--mint-soft);
  color: #2f765a;
}

.movement-row__icon svg {
  width: 18px;
  height: 18px;
}

.movement-row__main {
  min-width: 0;
}

.movement-row__name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movement-row__meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movement-row__amount {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  white-space: nowrap;
  text-align: right;
}
.movement-row__amount--expense {
  color: #7f4537;
}

.movement-row__amount--income {
  color: #2c7157;
}

.movement-row__type {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  text-align: right;
}

.empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .5);
  text-align: center;
}

.empty-card__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green);
}

.empty-card__icon svg {
  width: 21px;
  height: 21px;
}

.empty-card strong {
  font-size: 13px;
  font-weight: 750;
}

.empty-card p {
  max-width: 250px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.empty-card .btn {
  width: auto;
  margin-top: 8px;
}

.quick-help {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  padding: 11px 13px;
  border-radius: 15px;
  background: rgba(229, 239, 232, .65);
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.45;
}

.quick-help svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--green);
}

.quick-help strong {
  color: var(--green);
}

/* ------------------------------------------------------------------ *
 *  Inner pages
 * ------------------------------------------------------------------ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 9px var(--page-pad) 16px;
}

.page-head__copy {
  min-width: 0;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 8vw, 36px);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.04;
}

.page-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding-bottom: 1px;
}

.round-add {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(18, 63, 53, .15);
  border-radius: 50%;
  background: var(--surface);
  color: var(--green);
  box-shadow: var(--shadow-card);
}

.round-add:active {
  transform: scale(.94);
}

.round-add svg {
  width: 21px;
  height: 21px;
}

.cycle-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 var(--page-pad) 14px;
}

.cycle-context__hint {
  color: var(--muted);
  font-size: 9.5px;
  text-align: right;
  max-width: 145px;
  line-height: 1.35;
}

.pockets-overview {
  position: relative;
  overflow: hidden;
  margin: 0 var(--page-pad);
  padding: 19px;
  border: 1px solid rgba(40, 96, 74, .11);
  border-radius: 26px;
  background:
    radial-gradient(220px 150px at 100% 0%, rgba(168, 230, 201, .28), transparent 70%),
    linear-gradient(145deg, #edf4eb, #e4eee4);
}

.pockets-overview::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  right: -55px;
  bottom: -58px;
  border: 1px solid rgba(18, 63, 53, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 16px rgba(18, 63, 53, .025);
}

.pockets-overview__label {
  color: #557062;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.pockets-overview__amount {
  margin-top: 4px;
  font-size: clamp(28px, 8.3vw, 34px);
  font-weight: 750;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
}

.pockets-overview__meta {
  margin-top: 4px;
  color: #62766a;
  font-size: 10.5px;
}

.pockets-overview__split {
  display: flex;
  gap: 18px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(41, 83, 65, .11);
}

.pockets-overview__split div {
  min-width: 0;
}

.pockets-overview__split span {
  display: block;
  color: #6c8073;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pockets-overview__split strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.category-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px var(--page-pad) 0;
}

.category-card {
  overflow: hidden;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.category-card__head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 15px 14px 10px;
}

.category-card__icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--cat-soft, var(--green-soft));
  color: var(--cat-color, var(--green));
}

.category-card__icon svg {
  width: 20px;
  height: 20px;
}

.category-card__title-wrap {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.category-card__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.category-card__title {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.category-card__meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
}

.category-card__more {
  min-width: var(--tap);
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  margin: -8px -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.category-card__more:active {
  background: var(--surface-soft);
}

.category-card__balance {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 14px 11px;
}

.category-card__balance-label {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.category-card__balance-amount {
  margin-top: 1px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.category-card__stats {
  text-align: right;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  white-space: nowrap;
}

.category-card__stats strong {
  color: var(--ink-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.category-card__progress {
  padding: 0 14px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-card__progress .progress {
  flex: 1;
  height: 5px;
}

.category-card__pct {
  width: 31px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 750;
  text-align: right;
}

.sub-list {
  border-top: 1px solid var(--line);
}

.sub-row {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
}

.sub-row:last-child {
  border-bottom: 0;
}

.sub-row__main {
  min-width: 0;
}

.sub-row:active {
  background: var(--bg-deep);
}

.sub-row__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-row__type {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
}

.sub-row__amount {
  text-align: right;
}

.sub-row__amount strong {
  display: block;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.015em;
  white-space: nowrap;
}

.sub-row__amount span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.sub-row__chevron {
  color: #a7ada4;
}

.sub-row__chevron svg {
  width: 15px;
  height: 15px;
}

.sub-row--alert .sub-row__name {
  color: #93402f;
}

.add-sub-row {
  width: 100%;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 750;
}

.add-sub-row svg {
  width: 15px;
  height: 15px;
}

.add-category-row {
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 253, 248, .5);
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
}

.inactive-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  margin: 9px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.inactive-toggle svg {
  width: 14px;
  height: 14px;
}

.inactive-list {
  padding: 8px var(--page-pad) 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.inactive-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 9px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  color: var(--muted);
  background: rgba(255, 253, 248, .36);
  font-size: 11px;
}

.inactive-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-color, var(--muted));
  opacity: .5;
}

.inactive-item span:nth-child(2) {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inactive-item .btn--text {
  min-height: var(--tap);
  color: var(--green);
  font-size: 10px;
}

/* Templates */
.templates-intro {
  margin: 0 var(--page-pad) 16px;
  padding: 17px;
  border-radius: 24px;
  background:
    radial-gradient(180px 120px at 92% 0%, rgba(215, 238, 155, .2), transparent 70%),
    linear-gradient(145deg, #1b4b3e 0%, #123a30 100%);
  color: #fff9ed;
  box-shadow: 0 12px 28px rgba(17, 52, 43, .15);
}

.templates-intro .eyebrow {
  color: rgba(255, 249, 237, .76);
}

.templates-intro h2 {
  margin-top: 5px;
  max-width: 270px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.templates-intro p {
  margin-top: 6px;
  max-width: 290px;
  color: rgba(255, 249, 237, .8);
  font-size: 10px;
  line-height: 1.5;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 var(--page-pad);
}

.template-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.template-card--active {
  border-color: rgba(46, 116, 89, .26);
  background:
    linear-gradient(180deg, rgba(229, 239, 232, .52), transparent 45%),
    var(--surface);
}

.template-card__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.template-card__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}

.template-card__icon svg {
  width: 18px;
  height: 18px;
}

.template-card__title-wrap {
  flex: 1;
  min-width: 0;
}

.template-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  color: #37775e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.template-card__badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4a9a77;
}

.template-card__name {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.3;
}

.template-card__note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.template-card__menu {
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  margin: -10px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  flex: 0 0 auto;
}

.template-card__menu:active {
  background: var(--surface-soft);
}

.template-card__metrics {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  margin-top: 13px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.template-card__metric span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.template-card__metric strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.template-card__metric small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}

.template-card__actions .btn {
  min-height: 48px;
  font-size: 12px;
  border-radius: 14px;
}

.template-card__actions .btn--outline {
  flex: 0 0 42%;
}

.template-card__actions .btn--primary {
  flex: 1;
}

.template-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0 var(--page-pad);
  margin-top: 15px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.template-note svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: #7e8c7f;
}

/* Settings */
.settings-stack {
  padding: 0 var(--page-pad);
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.settings-card {
  overflow: hidden;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.settings-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 15px 10px;
}

.settings-card__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}

.settings-card__icon svg {
  width: 17px;
  height: 17px;
}

.settings-card__title {
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: -.015em;
}

.settings-card__hint {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.settings-card__body {
  padding: 3px 15px 15px;
}

.settings-card__body .btn + .btn {
  margin-top: 8px;
}

.settings-row {
  width: 100%;
  min-height: 53px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 15px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.settings-row:first-child {
  border-top: 0;
}

.settings-row:active {
  background: var(--surface-soft);
}

.settings-row__main {
  flex: 1;
  min-width: 0;
}

.settings-row__label {
  font-size: 12.5px;
  font-weight: 650;
}

.settings-row__value {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.settings-row__chevron {
  flex: 0 0 auto;
  color: #a5aca4;
}

.settings-row__chevron svg {
  width: 16px;
  height: 16px;
}

.data-figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--line);
  margin: 6px 0 12px;
}

.data-figure {
  padding: 9px 8px;
  background: var(--surface-soft);
  text-align: center;
}

.data-figure strong {
  display: block;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.data-figure span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.storage-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.storage-note svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--green);
}

.install-steps {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.install-steps div {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.install-steps b {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--green);
  color: #fff9ed;
  font-size: 9px;
  font-weight: 800;
}

.about-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.about-line:first-child {
  border-top: 0;
}

.about-line strong {
  color: var(--ink-soft);
  font-weight: 650;
  text-align: right;
}

.settings-card--danger .settings-card__icon {
  background: var(--red-soft);
  color: var(--red);
}

.settings-card--danger .settings-card__title {
  color: #8f3f31;
}

.settings-card--recovery {
  border-color: rgba(46, 116, 89, .2);
  background:
    linear-gradient(180deg, rgba(229, 239, 232, .5), transparent 44%),
    var(--surface);
}

.settings-card--recovery .settings-card__icon {
  background: var(--mint-soft);
  color: #2f735a;
}

.settings-card--recovery .settings-card__title {
  color: #1d5a46;
}

.recovery-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.footer-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 28px 20px 16px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.footer-mark strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: -.04em;
}

/* Inline form feedback and compact action groups */
.form-alert {
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--red-soft);
  color: #8e3b2e;
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.45;
}

.edit-danger {
  padding-top: 4px;
}

.edit-repeat {
  margin-top: 16px;
}

.edit-repeat .field__hint {
  margin-top: 6px;
  text-align: center;
}

.edit-repeat .field__hint.is-blocked {
  color: var(--amber);
  font-weight: 650;
}

.inline-confirm {
  margin-top: 6px;
  padding: 12px;
  border: 1px solid rgba(179, 79, 63, .16);
  border-radius: 14px;
  background: var(--red-soft);
}

.inline-confirm p {
  margin-bottom: 10px;
  color: #7f3b2f;
  font-size: 10.5px;
  line-height: 1.45;
}

.inline-confirm .btn {
  min-height: 46px;
  font-size: 12px;
}

.reorder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.reorder-row__label {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 650;
}

.reorder-row > div {
  display: flex;
  gap: 6px;
}

.detail-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 13px;
  border-radius: 15px;
  background: var(--line);
}

.detail-overview > div {
  min-width: 0;
  padding: 10px 9px;
  background: var(--surface-soft);
}

.detail-overview span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.detail-overview strong {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-alert {
  margin-bottom: 12px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--amber-soft);
  color: #7f4f1a;
  font-size: 9.5px;
  line-height: 1.45;
}

.detail-alert--over {
  background: var(--red-soft);
  color: #8e3b2e;
}

.detail-list {
  border-top: 1px solid var(--line);
}

.detail-sub {
  padding: 12px 0 11px;
  border-bottom: 1px solid var(--line);
}

.detail-sub:last-child {
  border-bottom: 0;
}

.detail-sub__head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.detail-sub__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.detail-sub__name {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-sub__available {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.detail-sub__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 0 7px 13px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.detail-sub__meta strong {
  color: var(--ink-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.detail-sub > .progress {
  height: 5px;
  margin-left: 13px;
}

/* ------------------------------------------------------------------ *
 *  Movements page
 * ------------------------------------------------------------------ */

.movements-toolbar {
  padding: 0 var(--page-pad);
}

.movements-filter-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 11px;
}

.filter-month {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

.filter-icon {
  position: relative;
  flex: 0 0 var(--tap);
}

.filter-icon.is-active {
  border-color: rgba(18, 63, 53, .3);
  background: var(--green-soft);
  color: var(--green);
}

.filter-icon__dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--surface);
}

.filter-month svg {
  width: 14px;
  height: 14px;
  opacity: .65;
}

.filter-month__close {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-sink);
}

.segmented--compact {
  flex: 1;
  min-height: 52px;
  padding: 3px;
  border-radius: 13px;
}

.segmented--compact button {
  min-height: var(--tap);
  padding: 0 6px;
  font-size: 11px;
}

.filter-active-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 12px;
}

.movements-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  margin-bottom: 11px;
  padding: 0 6px 0 13px;
  border: 1.5px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.movements-search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 63, 53, .09);
}

.movements-search__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
}

.movements-search__input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 550;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
}

.movements-search__input::placeholder {
  color: #8f988f;
  font-weight: 450;
}

.movements-search__input::-webkit-search-cancel-button {
  display: none;
}

.movements-search__clear {
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-sink);
  color: var(--muted);
}

.movements-search__status {
  min-height: 18px;
  margin: -4px 2px 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.filter-pill {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-sink);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 650;
}

.filter-pill svg {
  width: 12px;
  height: 12px;
}

.movements-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(50, 66, 54, .075);
  border-radius: 18px;
  background: var(--line);
  margin-bottom: 15px;
}

.movements-summary div {
  padding: 11px 13px;
  background: var(--surface);
}

.movements-summary span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.movements-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movements-list {
  padding: 0 var(--page-pad);
}

.day-group + .day-group {
  margin-top: 17px;
}

.day-group__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.day-group__label span:last-child {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.day-group .movement-list {
  border-radius: 19px;
}

.load-more {
  padding: 14px var(--page-pad) 0;
}

.filter-sheet-hint {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.filter-section + .filter-section {
  margin-top: 18px;
}

.filter-section__title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 750;
}

.filter-category-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-category {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
}

.filter-category.is-active {
  border-color: var(--green);
  background: var(--green-soft);
}

.filter-category__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cat-color, var(--green));
  flex: 0 0 auto;
}

.filter-category__sub {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ *
 *  Forms / sheets
 * ------------------------------------------------------------------ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: calc(env(safe-area-inset-top) + 10px);
  background: rgba(10, 29, 23, .44);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .24s ease;
}

.sheet-backdrop.is-open {
  opacity: 1;
}

.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  box-shadow: 0 -22px 60px rgba(12, 37, 28, .26);
  transform: translateY(24px);
  transition: transform .28s cubic-bezier(.2, .8, .25, 1);
}

.sheet-backdrop.is-open .sheet {
  transform: translateY(0);
}

.sheet__handle {
  width: 38px;
  height: 5px;
  flex: 0 0 auto;
  margin: 9px auto 0;
  border-radius: 999px;
  background: rgba(32, 54, 43, .16);
}

.sheet__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 20px 11px;
}

.sheet__heading {
  flex: 1;
  min-width: 0;
}

.sheet__kicker {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sheet__title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.13;
}

.sheet__subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.sheet__close {
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin: -4px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-sink);
  color: var(--ink-soft);
}

.sheet__close svg {
  width: 18px;
  height: 18px;
}

.sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 20px 20px;
  -webkit-overflow-scrolling: touch;
}

.sheet__footer {
  flex: 0 0 auto;
  padding: 11px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(50, 66, 54, .08);
  background: linear-gradient(180deg, rgba(244, 241, 232, .62), var(--bg) 28%);
}

.sheet__footer-note {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
  line-height: 1.4;
}

.sheet--actions .sheet__header {
  padding-bottom: 5px;
}

.sheet--actions .sheet__body {
  padding-bottom: 8px;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-item {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.action-item:last-child {
  border-bottom: 0;
}

.action-item__icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.action-item__icon svg {
  width: 17px;
  height: 17px;
}

.action-item__body {
  flex: 1;
  min-width: 0;
}

.action-item__hint {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

.action-item--danger {
  color: var(--red);
}

.action-item--danger .action-item__icon {
  background: var(--red-soft);
  color: var(--red);
}

.form {
  padding-top: 3px;
}

.field {
  margin-top: 15px;
}

.field:first-child {
  margin-top: 5px;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.field__optional {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
}

.field__hint {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.field__error {
  margin-top: 5px;
  color: var(--red);
  font-size: 10px;
  font-weight: 600;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 53px;
  padding: 13px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 550;
  -webkit-appearance: none;
  appearance: none;
  outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #9aa198;
  font-weight: 450;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 63, 53, .09);
}

.textarea {
  min-height: 74px;
  resize: vertical;
  line-height: 1.45;
}

.input--date {
  min-height: 52px;
  line-height: 1.2;
}

.input--error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(179, 79, 63, .08);
}

.amount-field {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 76px;
  padding: 11px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.amount-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 63, 53, .09);
}

.amount-field.is-error {
  border-color: var(--red);
}

.amount-field__currency {
  flex: 0 0 auto;
  padding-top: 5px;
  color: var(--muted);
  font-size: 21px;
  font-weight: 600;
}

.amount-field input {
  min-width: 0;
  flex: 1;
  width: 100%;
  min-height: 44px;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(28px, 8.5vw, 35px);
  font-weight: 720;
  letter-spacing: -.045em;
  line-height: 1.15;
  outline: 0;
  font-variant-numeric: tabular-nums;
}

.amount-field input::placeholder {
  color: #b3b7ae;
  font-weight: 500;
}

.quick-tabs {
  margin: 7px 0 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid .field {
  margin-top: 13px;
}

.picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.picker-chip {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 650;
  text-align: left;
}

.picker-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-chip__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cat-color, var(--green));
}

.picker-chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff9ed;
}

.picker-chip.is-active .picker-chip__dot {
  background: var(--mint);
}

.picker-chip--direct {
  border-style: dashed;
}

.picker-chip--archived {
  border-style: dashed;
}

.picker-chip--archived:not(.is-active) {
  color: var(--muted);
}

.selection-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9.5px;
}

.selection-note svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.date-destination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.date-destination svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.destination-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--green-soft);
  color: #375e4e;
  font-size: 10px;
  line-height: 1.4;
}

.destination-summary svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.form-divider {
  height: 1px;
  margin: 17px 0 0;
  background: var(--line);
}

/* Template editor */
.template-editor-hero {
  padding: 13px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.template-editor-hero .field {
  margin-top: 10px;
}

.template-editor-hero .field:first-child {
  margin-top: 0;
}

.alloc-group {
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.alloc-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.alloc-group__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-color, var(--green));
}

.alloc-group__name {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alloc-group__total {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.alloc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(228, 222, 209, .75);
}

.alloc-row:last-child {
  border-bottom: 0;
}

.alloc-row__name {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  color: var(--ink-soft);
  line-height: 1.3;
}

.alloc-row__name span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
}

.alloc-row__input {
  position: relative;
  flex: 0 0 112px;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 46px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.alloc-row__input b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.alloc-row__input input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: 0;
}

.template-total {
  margin-top: 15px;
  padding: 13px;
  border-radius: 15px;
  background: var(--green-soft);
}

.template-total__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10.5px;
  line-height: 1.5;
}

.template-total__row strong {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.template-total__row--main {
  font-size: 13px;
  font-weight: 700;
}

.template-total__row--warn {
  color: #9b6023;
}

.template-total__note {
  margin-top: 6px;
  color: #43604f;
  font-size: 9px;
  line-height: 1.4;
}

/* Month sheet */
.cycle-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cycle-row {
  display: flex;
  align-items: stretch;
  gap: 5px;
}

.cycle-row__main {
  flex: 1;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  text-align: left;
}

.cycle-row__main.is-active {
  border-color: rgba(18, 63, 53, .35);
  background: var(--green-soft);
}

.cycle-row__calendar {
  width: 34px;
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.cycle-row__month {
  width: 100%;
  padding: 1px 0;
  background: var(--green);
  color: #fff9ed;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .03em;
  text-align: center;
  text-transform: uppercase;
}

.cycle-row__year {
  padding: 2px 0;
  font-size: 9.5px;
  font-weight: 750;
  color: var(--ink);
}

.cycle-row__copy {
  flex: 1;
  min-width: 0;
}

.cycle-row__name {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.cycle-row__meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cycle-row__check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  color: white;
}

.cycle-row__check svg {
  width: 12px;
  height: 12px;
}

.cycle-row__edit {
  width: var(--tap);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
}

.cycle-row__edit svg {
  width: 17px;
  height: 17px;
}

.new-cycle-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 15px;
  background: var(--surface-soft);
}

.new-cycle-box p {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
  text-align: center;
}

.month-stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.month-stepper button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.month-stepper button:active {
  background: var(--green-soft);
}

.month-stepper button:disabled {
  opacity: .3;
}

.month-stepper div {
  text-align: center;
}

.month-stepper strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.month-stepper span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.apply-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.apply-summary__label {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.apply-summary__value {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}

.apply-summary__hint {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
  line-height: 1.45;
}

.cycle-exists-note {
  margin-top: 10px;
  display: flex;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--amber-soft);
  color: #8e5b21;
  font-size: 9.5px;
  line-height: 1.45;
}

.cycle-exists-note svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

/* Icon / color pickers */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.color-swatch {
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.color-swatch span {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.color-swatch.is-active span {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--swatch);
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.icon-choice {
  aspect-ratio: 1;
  min-height: var(--tap);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
}

.icon-choice svg {
  width: 20px;
  height: 20px;
}

.icon-choice.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff9ed;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 4px 0;
}

.switch-row__copy {
  flex: 1;
  min-width: 0;
}

.switch-row__copy strong {
  display: block;
  font-size: 11.5px;
  font-weight: 650;
}

.switch-row__copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.switch {
  position: relative;
  width: 50px;
  height: 32px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8d3c6;
  transition: background .2s ease;
  pointer-events: none;
}

.switch__slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .2s ease;
}

.switch input:checked + .switch__slider {
  background: var(--green);
}

.switch input:checked + .switch__slider::after {
  transform: translateX(18px);
}

/* Summary / import */
.summary-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 40px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.summary-line:last-child {
  border-bottom: 0;
}

.summary-line span {
  color: var(--muted);
}

.summary-line strong {
  max-width: 65%;
  font-weight: 700;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-list--compact .summary-line {
  min-height: 37px;
}

.import-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #855422;
  font-size: 9.5px;
  line-height: 1.5;
}

.import-error {
  padding: 12px;
  border-radius: 12px;
  background: var(--red-soft);
  color: #8e3b2e;
  font-size: 10.5px;
  line-height: 1.5;
  word-break: break-word;
}

.import-success-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 1px auto 9px;
  border-radius: 15px;
  background: var(--green-soft);
  color: var(--green);
}

.import-success-icon svg {
  width: 24px;
  height: 24px;
}

/* Toast */
.toast-region {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(87px + env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  padding: 0 16px;
}

.toast {
  width: 100%;
  max-width: 448px;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 15px;
  border-radius: 16px;
  background: rgba(18, 52, 43, .97);
  color: #fbf7ed;
  box-shadow: 0 14px 34px rgba(16, 39, 31, .26);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: toast-in .3s cubic-bezier(.2, .8, .25, 1);
}

.toast.is-leaving {
  animation: toast-out .22s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(.98); }
}

.toast__icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(168, 230, 201, .16);
  color: var(--mint);
}

.toast__icon svg {
  width: 15px;
  height: 15px;
}

.toast__message {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.toast__action {
  min-height: var(--tap);
  flex: 0 0 auto;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, .08);
  color: var(--mint);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .01em;
}

/* Misc */
.spacer-8 { height: 8px; }
.spacer-16 { height: 16px; }
.spacer-24 { height: 24px; }

.loading-line {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  background-size: 200% 100%;
  animation: loader 1.2s infinite;
}

@keyframes loader {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (max-width: 374px) {
  :root {
    --page-pad: 16px;
  }

  .month-pill {
    max-width: 136px;
    padding: 0 10px;
    gap: 5px;
    font-size: 11.5px;
  }

  .brand__word {
    font-size: 22px;
  }

  .brand__mark {
    width: 24px;
    height: 24px;
  }

  .topbar {
    gap: 5px;
  }

  .topbar__actions {
    gap: 4px;
  }

  .hero__amount {
    font-size: 33px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card__amount {
    font-size: 16px;
  }

  .pocket-card {
    flex-basis: 174px;
  }

  .donut-layout {
    gap: 12px;
  }

  .donut {
    flex-basis: 110px;
    width: 110px;
    height: 110px;
  }
}

@media (min-width: 520px) {
  body {
    padding: 22px 0;
  }

  .app-frame {
    min-height: calc(100dvh - 44px);
    border-radius: 34px;
    overflow: clip;
  }

  .tabbar {
    border-radius: 26px 26px 0 0;
  }

  .sheet-backdrop {
    align-items: center;
    padding-bottom: 18px;
  }

  .sheet {
    border-radius: 28px;
    max-height: 92dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
