/* Nunito font declarations */
@font-face{font-family:Nunito;src:url("assets/fonts/nunito_regular.ttf");font-weight:400}
@font-face{font-family:Nunito;src:url("assets/fonts/nunito_medium.ttf");font-weight:500}
@font-face{font-family:Nunito;src:url("assets/fonts/nunito_bold.ttf");font-weight:700}
@font-face{font-family:Nunito;src:url("assets/fonts/nunito_extrabold.ttf");font-weight:800}
@font-face{font-family:Nunito;src:url("assets/fonts/nunito_light.ttf");font-weight:300}

:root {
  color-scheme: dark;
  --bg: #111112;
  --surface: #1c1c1e;
  --surface-2: #242426;
  --surface-3: #2c2c2f;
  --surface-4: #36363a;
  --bg-blur: rgba(17, 17, 18, 0.94);
  --text: #f7f6f5;
  --text-muted: #8e8e93;
  --text-faint: #55555c;
  --line: #2e2e31;
  --accent-text: #6BDEEE;
  /* Qurri: verde menta → turquesa → cian → azul celeste */
  --mint: #95FBDF;
  --mint-bright: #83FCD7;
  --turquoise-soft: #86F2E2;
  --turquoise: #76EEE1;
  --cyan: #6BDEEE;
  --sky: #62D2F8;
  --sky-deep: #5DCDFB;
  --accent: #6BDEEE;
  --accent-grad: linear-gradient(135deg, #95FBDF 0%, #83FCD7 16%, #86F2E2 34%, #76EEE1 50%, #6BDEEE 66%, #62D2F8 84%, #5DCDFB 100%);
  --accent-soft: rgba(107, 222, 238, 0.16);
  --accent-glow: rgba(98, 210, 248, 0.42);
  --on-accent: #052b33;
  --green: #3cc867;
  --red: #ff5858;
  --yellow: #ffc107;
  --radius-card: 22px;
  --radius-pill: 100px;
  font-family: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Tema claro: blanco con un leve tinte turquesa. data-theme lo pone render() según Apariencia. */
:root[data-theme="Claro"] {
  color-scheme: light;
  --bg: #eef5f7;
  --bg-blur: rgba(238, 245, 247, 0.94);
  --surface: #ffffff;
  --surface-2: #f2f7f9;
  --surface-3: #e7eff2;
  --surface-4: #dbe6ea;
  --text: #0c1a20;
  --text-muted: #5d6e76;
  --text-faint: #9aa9b0;
  --line: #dbe5e9;
  --accent-text: #0b8aa3;
  --accent-soft: rgba(11, 138, 163, 0.12);
}
:root[data-theme="Claro"] .sheet,
:root[data-theme="Claro"] .dock-pill,
:root[data-theme="Claro"] .instant-prompt-card,
:root[data-theme="Claro"] .instant-preview-card { box-shadow: 0 8px 30px rgba(12, 26, 32, 0.12); }
:root[data-theme="Claro"] .cat-focus-card { background: rgba(255, 255, 255, 0.82); border-color: rgba(12, 26, 32, 0.08); }
:root[data-theme="Claro"] .tile-budget-mark { border-color: rgba(12, 26, 32, 0.35); }

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  background: #09090a;
  color: var(--text);
  font-size: 15px;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* App Shell (Mobile First / Desktop framed) */
.app-shell {
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

@media (min-width: 500px) {
  body {
    padding: 24px 0;
    background: #050506;
  }
  .app-shell {
    min-height: calc(100dvh - 48px);
    border-radius: 38px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

/* Topbar Header */
.topbar {
  height: 64px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-blur);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.list-switch:active { opacity: 0.7; }
.list-switch svg { color: var(--text-muted); }

.category-filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.category-filter-chip i { font-style: normal; color: var(--text-muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.15s;
}
.icon-button:active { opacity: 0.7; }

.cal-button {
  border-radius: var(--radius-pill);
  padding: 0 10px;
  width: auto;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Period Dropdown Popup (Screenshot 48-13) */
.period-popup {
  position: absolute;
  top: 52px;
  right: 18px;
  width: 260px;
  background: var(--surface-2);
  border: 1px solid #353538;
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.popup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
}
.popup-item:active { background: rgba(255, 255, 255, 0.08); }
.popup-check { color: var(--text); font-weight: 700; }
.popup-divider {
  height: 1px;
  background: #38383c;
  margin: 4px 6px;
}

/* Main Content */
.main {
  padding: 4px 18px 24px;
  flex: 1;
}

/* Home Month Carousel (Screenshots 33, 51-6) */
.month-carousel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 10px 0 16px;
  text-align: center;
}
.month-item {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 8px;
}
.month-item.active {
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13px;
}
.month-item.active .month-sub {
  color: #ff5858;
  font-size: 11.5px;
}
.month-item:not(.active) .month-sub {
  color: var(--text-faint);
  font-size: 11px;
}

/* Balance Center Section */
.balance-section {
  text-align: center;
  margin: 10px 0 18px;
}
.over-budget-warning {
  color: #ff5858;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.balance-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.balance-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
}
.balance-dot.negative { background: var(--red); }
.balance-dot.positive { background: var(--green); }
.balance-amount {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--text);
}
.balance-currency {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
  align-self: flex-start;
  margin-top: 10px;
}

/* Split Totals Pill */
.split-totals-pill {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-2);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
}
.split-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.split-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  color: #fff;
  font-weight: 900;
}
.split-dot.red { background: var(--red); }
.split-dot.green { background: var(--green); }

/* Category Cards Row (Carousel) (Screenshot 51-6) */
.category-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 2px;
  margin: 4px 0 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-carousel::-webkit-scrollbar { display: none; }

.cat-tile {
  width: 84px;
  height: 94px;
  border-radius: 20px;
  background: var(--surface);
  border: 0;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.cat-tile:active { transform: scale(0.96); }
.cat-tile .tile-emoji { font-size: 28px; line-height: 1; }
.cat-tile .tile-amount { font-size: 14px; font-weight: 700; }
.cat-tile.has-budget {
  background: #2e8b46;
  border: 2px dashed #b1f0c2;
}
.cat-tile.active-filter {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Home Welcome Card */
.welcome-gradient-card {
  border-radius: 24px;
  padding: 20px 20px 22px;
  background: var(--accent-grad);
  color: var(--on-accent);
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}
.welcome-gradient-card h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}
.welcome-gradient-card p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: rgba(5, 43, 51, 0.75);
}
.welcome-reg-btn {
  position: absolute;
  bottom: 16px;
  right: 18px;
  border: 0;
  background: rgba(255, 255, 255, 0.45);
  color: var(--on-accent);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Home Setup Grid (if 0 txs) */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.setup-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 14px;
  font-size: 13px;
}
.setup-card b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.setup-actions {
  display: flex;
  gap: 8px;
}
.setup-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-3);
  color: var(--text);
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.setup-circle-btn.dashed {
  border: 1.5px dashed var(--text-faint);
  background: none;
}
.setup-circle-btn.coral {
  background: var(--accent-grad);
  color: var(--on-accent);
}

/* Income Setup Card */
.income-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 14px;
}
.income-card strong {
  font-size: 15px;
  color: var(--text);
  display: block;
  margin-bottom: 12px;
}
.income-actions {
  display: flex;
  gap: 10px;
}
.pill-btn-olive {
  border: 0;
  background: #505c3c;
  color: #d1e2b0;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.pill-btn-dark {
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

/* Automation Card */
.automation-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 18px;
}
.automation-card strong {
  font-size: 14.5px;
  display: block;
  margin-bottom: 4px;
}
.automation-card p {
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 0 0 12px;
}
.pill-btn-lime {
  border: 0;
  background: #cbf56b;
  color: #1a2408;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

/* Transactions Feed */
.tx-group {
  margin-bottom: 18px;
}
.tx-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 0 4px 8px;
}
.tx-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 2px;
  cursor: pointer;
}
.tx-row:active { opacity: 0.7; }
.tx-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2a2826;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}
.tx-details {
  flex: 1;
  min-width: 0;
}
.tx-cat-name {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
}
.tx-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
}
.tx-badge {
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: none;
}

/* Floating Navigation Dock (Screenshots 33, 51-6, 48-3) */
.floating-dock {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 404px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
  pointer-events: none;
}
.dock-pill {
  pointer-events: auto;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 9px 22px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.dock-btn {
  border: 0;
  background: none;
  color: var(--text);
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.dock-btn:active { transform: scale(0.9); opacity: 0.8; }
.dock-voice {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--bg), 0 10px 30px var(--accent-glow);
  transition: transform 0.1s;
}
.dock-voice:active { transform: scale(0.92); }

/* Floating Search Bar (Screenshot 51-1) */
.floating-search-bar {
  position: fixed;
  bottom: calc(95px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 404px;
  z-index: 45;
}
.search-input-pill {
  background: var(--surface-2);
  border: 1px solid #3d3d42;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
}
.search-input-pill input {
  flex: 1;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.search-input-pill input::placeholder { color: var(--text-muted); }
.search-action-btn {
  border: 0;
  background: none;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
}

/* Instant Save Prompt Banner (Screenshot 51-5) */
.instant-save-container {
  position: fixed;
  bottom: calc(95px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 404px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.instant-preview-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.instant-prompt-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.instant-prompt-text b { display: block; font-size: 14.5px; }
.instant-prompt-text small { color: var(--text-muted); font-size: 12px; }
.instant-prompt-actions { display: flex; gap: 10px; }
.instant-btn-check {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--green);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.instant-btn-cross {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* iOS Home Indicator */
.home-indicator {
  position: fixed;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 4.5px;
  background: var(--text);
  border-radius: 100px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 50;
}

/* Modals and Overlays */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 110; /* above the voice screen, so its language picker is visible */
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.overlay.hidden { display: none !important; }

.sheet {
  width: 100%;
  max-width: 440px;
  max-height: 94dvh;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  padding: 16px 20px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: #555558;
  border-radius: 100px;
  margin: 0 auto 16px;
}

.sheet-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.sheet-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}
.sheet-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Add / Edit Expense Fullscreen Screen (Screenshot 48-8, 51-2) */
.expense-composer {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.composer-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.composer-pills {
  display: flex;
  gap: 8px;
}
.composer-pill {
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.composer-purpose-input {
  border: 0;
  background: none;
  font: inherit;
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  outline: none;
  width: 100%;
  margin-bottom: 8px;
}
.composer-purpose-input::placeholder { color: var(--text-faint); }
.composer-top-actions {
  display: flex;
  gap: 8px;
}
.composer-purpose-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.composer-purpose-row .composer-purpose-input {
  flex: 1;
  min-width: 0;
}
.composer-mic-btn {
  flex: none;
  margin-bottom: 8px;
}
.composer-mic-btn.listening {
  background: var(--accent-grad);
  color: var(--on-accent);
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse { 50% { transform: scale(1.12); } }
.composer-receipt-note {
  color: var(--text-muted);
  font-size: 13px;
  margin: -2px 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.composer-chip-row .composer-cat-pill {
  margin-bottom: 0;
  max-width: 100%;
}
.receipt-loading {
  text-align: center;
  padding: 36px 8px 28px;
}
.receipt-spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid var(--surface-2);
  border-top-color: var(--text);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.composer-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.composer-amount-display {
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}
.cursor-blink {
  display: inline-block;
  width: 3px;
  height: 38px;
  background: var(--text);
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: middle;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.composer-cat-pill {
  align-self: flex-start;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.composer-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.composer-tag-btn {
  width: 50px;
  height: 48px;
  border-radius: 14px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.composer-save-btn {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.composer-del-btn {
  width: 50px;
  height: 48px;
  border-radius: 14px;
  border: 0;
  background: var(--surface-2);
  color: #ff6565;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Numeric Keypad (Screenshots 48-8, 48-22) */
.ios-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 6px;
}
.keypad-key {
  height: 52px;
  background: var(--surface-4);
  border: 0;
  border-radius: 12px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  transition: background 0.1s;
}
.keypad-key:active { background: #4a4a50; }
.keypad-num { font-size: 22px; font-weight: 600; line-height: 1; }
.keypad-sub { font-size: 9.5px; font-weight: 600; color: #a8a8af; letter-spacing: 1px; margin-top: 2px; }

/* Voice Screen Overlay (Screenshot 48-10) */
.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 30% 20%, #4fd6c4 0%, #2a9fc4 38%, #0d3346 72%, #071724 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 24px 40px;
}
.voice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.voice-status-dot {
  width: 10px;
  height: 10px;
  background: #ffc107;
  border-radius: 50%;
}
.flag-pill {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  font-size: 22px;
  display: grid;
  place-items: center;
}
.voice-center {
  text-align: center;
}
.voice-transcript {
  font-size: 34px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}
.voice-transcript[contenteditable="true"] {
  outline: none;
  min-height: 1.25em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 4px;
}
.voice-hint {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  margin-top: 14px;
}
.voice-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.voice-cancel-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.voice-confirm-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--accent-glow);
}

/* Frequency Dropdown Scrim (Screenshot 51-3) */
.dropdown-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.freq-dropdown-menu {
  width: 270px;
  background: var(--surface-2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8);
}
.freq-item {
  width: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid #323236;
  cursor: pointer;
}
.freq-item:last-child { border-bottom: none; }
.freq-item:active { background: rgba(255, 255, 255, 0.08); }

/* Date Picker Sheet (Screenshot 51-4) */
.cal-picker-wrap {
  display: flex;
  flex-direction: column;
}
.cal-picker-month-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
}
.cal-month-nav {
  display: flex;
  gap: 14px;
}
.cal-nav-btn {
  border: 0;
  background: none;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 12px;
  text-align: center;
  margin-bottom: 24px;
}
.cal-day-cell {
  height: 38px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  margin: 0 auto;
  width: 38px;
}
.cal-day-cell.selected {
  background: var(--surface-4);
}
.cal-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.cal-time-pill {
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  border: 0;
  cursor: pointer;
}

/* Category Editor Sheet (Screenshot 48-6, 48-20) */
.cat-edit-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cat-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  cursor: pointer;
}
.cat-edit-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.cat-edit-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-4);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.cat-suggestions-dock {
  background: var(--accent-grad);
  color: var(--on-accent);
  border-radius: 20px;
  padding: 14px;
  margin: 16px 0;
}
.cat-suggestions-dock small {
  display: block;
  font-size: 12px;
  color: rgba(5, 43, 51, 0.75);
  margin-bottom: 10px;
}
.cat-suggestions-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.suggestion-pill {
  border: 0;
  background: rgba(255, 255, 255, 0.5);
  color: var(--on-accent);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.cat-save-float-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: #cbf56b;
  color: #1a2408;
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  align-self: flex-end;
  margin-top: 10px;
}

/* Budget Editor (Screenshot 48-22) */
.budget-editor-wrap {
  text-align: center;
}
.budget-avatar-card {
  width: 82px;
  height: 82px;
  background: var(--surface-4);
  border-radius: 24px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 38px;
}
.budget-color-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 14px 0 20px;
  flex-wrap: wrap;
}
.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-dot.active {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Settings Items (Screenshots 48-16, 48-17, 48-18, 48-19) */
.settings-section-title {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  cursor: pointer;
}
.settings-icon-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex: none;
}
.settings-info {
  flex: 1;
  min-width: 0;
}
.settings-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.settings-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: none;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--surface-4);
  transition: 0.2s;
  border-radius: 34px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--green);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Onboarding Views (Screenshots 52-3, 52-5, 52-6, 52-7, 46, 52-8, 52-9) */
.onboard-container {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 20px 30px;
  text-align: center;
}
.onboard-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.onboard-back-btn {
  border: 0;
  background: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}
.onboard-progress-badge {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.onboard-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}
.onboard-choice-card {
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 18px 12px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.onboard-choice-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.primary-grad-btn {
  width: 100%;
  height: 54px;
  border-radius: 18px;
  border: 0;
  background: var(--accent-grad);
  color: var(--on-accent);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--accent-glow);
}

/* Paywall (Screenshots 55, 56) */
.paywall-header {
  text-align: center;
  margin: 20px 0;
}
.paywall-header h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0;
}
.paywall-header em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.segmented-pill {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin: 18px 0;
}
.segmented-btn {
  flex: 1;
  border: 0;
  background: none;
  color: var(--text-muted);
  padding: 9px;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.segmented-btn.active {
  background: var(--surface-4);
  color: var(--text);
}
:root[data-theme="Claro"] .segmented-btn.active { background: #ffffff; box-shadow: 0 2px 8px rgba(12, 26, 32, 0.1); }
.plan-card {
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  cursor: pointer;
}
.plan-card.active {
  border-color: var(--accent);
}
.plan-badge-tag {
  position: absolute;
  top: -11px;
  left: 20px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 100px;
}

/* Social Proof (Screenshot 56) */
.laurel-rating-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
}
.laurel-rating-wrap strong {
  font-size: 52px;
  font-weight: 800;
}
.stars-gold {
  color: var(--yellow);
  font-size: 20px;
  letter-spacing: 2px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(95px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--surface-4);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 120;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hidden { display: none !important; }

/* Category bars: height follows the spending; the dashed box marks the budget */
.category-carousel.bars {
  align-items: flex-end;
  min-height: 178px;
  padding-top: 18px;
}
.category-carousel.bars .cat-tile {
  position: relative;
  overflow: hidden;
  justify-content: flex-end;
  padding-bottom: 14px;
  transition: height 0.35s cubic-bezier(.2, .8, .2, 1), opacity 0.2s, transform 0.1s;
}
.category-carousel.bars .cat-tile.short {
  flex-direction: row;
  justify-content: center;
  padding-bottom: 0;
  gap: 4px;
  border-radius: 18px;
}
.category-carousel.bars .cat-tile.short .tile-emoji { font-size: 18px; }
.category-carousel.bars .cat-tile.has-budget {
  background: var(--surface);
  border: 0;
}
.tile-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  transition: height 0.35s cubic-bezier(.2, .8, .2, 1);
}
.tile-budget-mark {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  border-radius: 17px;
  pointer-events: none;
}
.category-carousel.bars .tile-emoji,
.category-carousel.bars .tile-amount {
  position: relative;
  z-index: 1;
}
.tile-amount small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
  text-align: center;
}
.category-carousel.bars.has-focus .cat-tile:not(.focused) { opacity: 0.3; }
.category-carousel.bars .cat-tile.focused { outline: 0; box-shadow: 0 0 28px rgba(255, 255, 255, 0.08); }

.cat-focus-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 16px;
  margin: 2px 0 -6px;
  border-radius: 20px;
  background: rgba(60, 60, 64, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 300px;
}
.focus-link {
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 2px 0;
  cursor: pointer;
}
.focus-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.focus-title span { font-size: 13px; color: var(--text-muted); }
.focus-status { font-size: 22px; font-weight: 800; color: var(--text); }
.focus-status.over { color: #ff7a70; }
.focus-status.ok { color: #8fdca6; }

/* Weekly summary and goal: quiet cards that close with one tap */
.weekly-card,
.mini-chart-card,
.goal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-bottom: 12px;
  position: relative;
}
.weekly-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.weekly-label { color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.weekly-text b { font-size: 17px; }
.weekly-text small { color: var(--text-muted); font-size: 12.5px; line-height: 1.35; }
.weekly-close {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  align-self: flex-start;
}

/* Mini chart: donut by category + last six months */
.mini-donut { width: 64px; height: 64px; flex: none; }
.mini-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
  font-size: 12.5px;
}
.mini-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
}
.mini-legend em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mini-legend i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mini-legend b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; padding-left: 6px; }
.mini-months {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 52px;
  flex: none;
  padding-right: 18px;
}
.mini-month { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 13px; }
.mini-month span { width: 7px; border-radius: 4px; background: var(--surface-3); }
.mini-month.current span { background: var(--accent-grad); }
.mini-month small { font-size: 8.5px; color: var(--text-muted); text-transform: lowercase; }
.mini-chart-close { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; font-size: 10px; }
@media (max-width: 360px) { .mini-months { display: none; } }

.goal-card { width: 100%; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.goal-emoji { font-size: 26px; }
.goal-info { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.goal-info b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-bar { display: block; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.goal-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3cc867, #8fdca6); transition: width 0.4s; }
.goal-amount { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.goal-amount small { color: var(--text-muted); font-weight: 600; font-size: 11.5px; }

/* Undo toast: the only toast that takes taps */
.toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding-right: 8px; }
.toast-action {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  border-radius: 100px;
  padding: 6px 12px;
  cursor: pointer;
}

/* Composer extras: split note and quick suggestions */
.composer-split-note { color: #8fdca6; font-size: 13px; font-weight: 600; margin: -10px 0 14px; }
.composer-suggestions { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; scrollbar-width: none; }
.composer-suggestions::-webkit-scrollbar { display: none; }
.suggestion-chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.split-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0 6px; }
.split-grid button {
  height: 48px;
  border-radius: 14px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}
.split-grid button.active { background: var(--accent-grad); color: var(--on-accent); }

/* Goals screen and simple forms in sheets */
.goal-row { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: 20px; padding: 16px; margin-bottom: 10px; }
.goal-row-head { display: flex; align-items: center; gap: 10px; }
.goal-row-head b { flex: 1; font-size: 16px; }
.goal-row-actions { display: flex; gap: 8px; }
.sheet-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.sheet-form label { display: flex; flex-direction: column; gap: 6px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.sheet-form .field {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
}
.sheet-form .field:focus { box-shadow: 0 0 0 2px var(--accent-glow); }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.preset-grid button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.preset-grid span { font-size: 20px; }

/* Legal texts */
.legal-doc { color: var(--text); font-size: 14.5px; line-height: 1.6; padding-bottom: 40px; }
.legal-doc h2 { font-size: 22px; margin: 8px 0 2px; text-wrap: balance; }
.legal-doc h3 { font-size: 16px; margin: 22px 0 6px; }
.legal-doc h4 { font-size: 14.5px; margin: 14px 0 4px; color: var(--text-muted); }
.legal-doc p { margin: 0 0 10px; }
.legal-doc ul { margin: 0 0 10px; padding-left: 20px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a { color: var(--accent-text); }
.legal-updated { color: var(--text-muted); font-size: 12.5px; }

/* Welcome: draggable carousel of perfect circles */
.welcome-carousel {
  position: relative;
  height: 220px;
  margin: 26px 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.welcome-orbit-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  flex: none;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 50px;
  line-height: 1;
  color: inherit;
  cursor: grab;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
  --x: 0px; --s: 1;
  transform: translate(-50%, -50%) translateX(var(--x)) scale(var(--s));
  transition: transform 0.6s cubic-bezier(.22, .9, .25, 1), opacity 0.5s, filter 0.5s;
}
.welcome-orbit-circle:active { cursor: grabbing; }
.welcome-orbit-circle[data-pos="0"] { --x: 0px; --s: 1; z-index: 3; }
.welcome-orbit-circle[data-pos="-1"] { --x: -92px; --s: 0.78; z-index: 2; filter: brightness(0.9); }
.welcome-orbit-circle[data-pos="1"] { --x: 92px; --s: 0.78; z-index: 2; filter: brightness(0.9); }
.welcome-orbit-circle[data-pos="-2"] { --x: -158px; --s: 0.58; z-index: 1; opacity: 0.85; filter: brightness(0.8); }
.welcome-orbit-circle[data-pos="2"] { --x: 158px; --s: 0.58; z-index: 1; opacity: 0.85; filter: brightness(0.8); }
.welcome-legal { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; max-width: 380px; margin: 16px auto 0; }
.welcome-legal a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* Questions: icon in the corner that turns like a page, progress ring */
.onboard-step { text-align: left; }
.onboard-step .onboard-cards-grid { text-align: center; }
.onboard-ring { position: relative; display: grid; place-items: center; width: 40px; height: 40px; }
.onboard-ring svg { position: absolute; inset: 0; width: 40px; height: 40px; }
.onboard-ring b { position: relative; font-size: 14px; font-weight: 800; color: var(--text); }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 3; }
.ring-arc { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.onboard-ring.complete .ring-arc { stroke: var(--green); }
.step-icon { position: relative; width: 58px; height: 58px; margin: 6px 0 22px; perspective: 500px; }
.step-icon-page,
.step-icon-face {
  position: absolute;
  inset: 0;
  border-radius: 17px;
  display: grid;
  place-items: center;
}
.step-icon-page {
  background: var(--accent-grad);
  opacity: 0.45;
  transform: rotate(-12deg) translate(-6px, 3px);
}
.step-icon-face {
  background: var(--accent-grad);
  color: var(--on-accent);
  box-shadow: 0 8px 22px var(--accent-glow);
  transform-origin: left center;
}
.turn-forward .step-icon-face { animation: pageTurn 0.9s cubic-bezier(.25, .8, .3, 1) both; }
.turn-back .step-icon-face { animation: pageTurnBack 0.9s cubic-bezier(.25, .8, .3, 1) both; }
.turn-forward .step-icon-page { animation: pageSettle 0.9s ease both; }
.onboard-step.turn-forward > div:nth-child(2) > *:not(.step-icon) { animation: stepIn 0.6s ease both; }
.onboard-step.turn-back > div:nth-child(2) > *:not(.step-icon) { animation: stepInBack 0.6s ease both; }
.onboard-step > div:nth-child(2) > h1 { animation-delay: 0.08s !important; }
.onboard-step > div:nth-child(2) > p { animation-delay: 0.14s !important; }
.onboard-step > div:nth-child(2) > .onboard-cards-grid { animation-delay: 0.2s !important; }
@keyframes pageTurn {
  0% { transform: rotateY(-70deg); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: rotateY(0); opacity: 1; }
}
@keyframes pageTurnBack {
  0% { transform: rotateY(55deg); opacity: 0; }
  100% { transform: rotateY(0); opacity: 1; }
}
@keyframes pageSettle {
  0% { transform: rotate(0) translate(0, 0); }
  100% { transform: rotate(-12deg) translate(-6px, 3px); }
}
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.onboard-next-btn { transition: opacity 0.25s, filter 0.25s; }
.onboard-next-btn.is-disabled { opacity: 0.45; filter: saturate(0.6); box-shadow: none; cursor: not-allowed; }
.onboard-choice-card { transition: border-color 0.2s, background 0.2s, transform 0.12s; }
.onboard-choice-card:active { transform: scale(0.97); }

/* "Creando tu plan": the arc travels and each node grows when reached */
.plan-screen { justify-content: space-between; }
.plan-title { font-size: 36px; font-weight: 800; line-height: 1.2; margin: 0; }
.plan-ring { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 10px auto; }
.plan-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plan-track { fill: none; stroke: var(--text-faint); stroke-width: 2; stroke-dasharray: 3 7; opacity: 0.7; }
.plan-progress { fill: none; stroke: url(#planGrad); stroke-width: 14; stroke-linecap: round; filter: drop-shadow(0 0 10px var(--accent-glow)); }
.plan-node {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  transform: translate(-50%, -50%) scale(1);
  box-shadow: 0 0 0 6px var(--bg);
  transition: transform 0.7s cubic-bezier(.2, .9, .25, 1.15), box-shadow 0.6s;
  z-index: 1;
}
.plan-node.active {
  transform: translate(-50%, -50%) scale(1.75);
  box-shadow: 0 0 0 4px var(--bg), 0 0 40px 6px var(--accent-glow);
  z-index: 2;
}
.plan-center {
  position: absolute;
  inset: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 19px;
  line-height: 1.3;
  color: var(--text);
}
.plan-center b { color: var(--accent-text); }
.plan-center.swap { animation: planText 0.5s ease; }
.plan-ready { font-size: 22px; color: var(--text) !important; }
.plan-ring.done .plan-node { transform: translate(-50%, -50%) scale(1); }
@keyframes planText { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Swipe a movement left to delete */
.tx-swipe { position: relative; overflow: hidden; border-radius: 18px; }
.tx-swipe .tx-row {
  position: relative;
  z-index: 1;
  background: var(--bg);
  touch-action: pan-y;
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1);
}
.tx-swipe .tx-row.dragging { transition: none; }
.tx-swipe-del {
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: 0;
  width: 84px;
  border: 0;
  border-radius: 16px;
  background: #ff4d4f;
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

/* Budget percentage on the bars */
.tile-amount small.of-income { font-weight: 600; opacity: 0.72; }
.tile-amount small.near { color: #ffd8a8; }
.tile-amount small.over { color: #ffd0d0; font-weight: 800; }
:root[data-theme="Claro"] .tile-amount small.near { color: #a8590f; }
:root[data-theme="Claro"] .tile-amount small.over { color: #b3261e; }

/* Rainbow dot: opens the system color picker */
.color-dot-custom {
  position: relative;
  overflow: hidden;
  background: conic-gradient(#ff6b6b, #ffd166, #63e6be, #4dabf7, #9775fa, #ff6b6b);
}
.color-dot-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  .welcome-orbit-circle, .plan-node, .tx-swipe .tx-row { transition: none; }
  .step-icon-face, .step-icon-page, .onboard-step * { animation: none !important; }
}

/* Qurri Pro paywall */
.pw-marquees { display: flex; flex-direction: column; gap: 10px; margin: 18px -20px 22px; }
.pw-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.pw-track { display: flex; gap: 10px; width: max-content; animation: pwMarquee 38s linear infinite; }
.pw-track.reverse { animation-direction: reverse; animation-duration: 44s; }
@keyframes pwMarquee { to { transform: translateX(-50%); } }
.pw-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  background: var(--surface-2);
  border-radius: 22px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
}
.pw-pill i {
  font-style: normal;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 900;
}
.pw-tabs { width: fit-content; margin: 0 auto 26px; }
.pw-tabs.disabled { opacity: 0.4; pointer-events: none; }
.pw-tabs .segmented-btn { display: inline-flex; align-items: center; gap: 8px; padding-left: 22px; padding-right: 22px; }
.pw-info {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--accent-text); color: var(--accent-text);
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 900; font-style: normal;
}
.paywall-header .plan-card { width: 100%; border: 2px solid transparent; color: var(--text); font: inherit; text-align: left; display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.paywall-header .plan-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), 0 10px 30px var(--accent-soft); }
.plan-emoji { font-size: 34px; flex: none; }
.plan-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-info b { font-size: 17px; }
.plan-info small { color: var(--text-muted); font-size: 14px; }
.plan-price { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pw-phrase { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 18px; text-align: center; }
.pw-active { color: #8fdca6; font-weight: 700; font-size: 14px; margin: 6px 0 0; }
.pw-student {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 14px;
  cursor: pointer;
  text-align: left;
}
.pw-student b { display: block; font-size: 16px; }
.pw-student small { color: var(--text-muted); font-size: 12.5px; }
.pw-foot { display: block; text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 10px; }
.pw-links { display: flex; justify-content: space-between; gap: 10px; margin: 16px 4px 0; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.pw-links a { color: var(--text); font-size: 13px; font-weight: 700; text-decoration: none; }
.pw-family-list { margin: 0; padding-left: 20px; line-height: 1.55; font-size: 15px; }
.pw-family-list li { margin-bottom: 10px; }
.checkout-card { background: var(--surface-2); border-radius: 18px; padding: 6px 16px; margin: 6px 0 12px; }
.checkout-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.checkout-row:last-child { border-bottom: 0; }
.checkout-row span { color: var(--text-muted); }
.checkout-row.total b { font-size: 18px; }
.checkout-note { color: var(--text-muted); font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
.checkout-methods { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.checkout-method { border: 1.5px solid var(--line); border-radius: 100px; padding: 8px 14px; font-size: 13.5px; font-weight: 700; }
.checkout-method.selected { border-color: var(--accent); background: var(--accent-soft); }
.checkout-test { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; margin: 12px 0; }
@media (prefers-reduced-motion: reduce) { .pw-track { animation: none; } }

/* A6 · several movements from one phrase */
.multi-list { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 16px; }
.multi-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.multi-row .tx-details { flex: 1; min-width: 0; }
.multi-remove {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: var(--surface-3); color: var(--text-muted); font-size: 12px; cursor: pointer;
}
/* A7 · budget left while adding an expense */
.composer-budget-note { color: var(--text-muted); font-size: 13px; margin: -14px 0 16px; }
.composer-budget-note.over { color: #ff8a80; }

/* A2 · projection, A3 · alert card, A5 · chat bubbles */
.projection-line { color: var(--text-muted); font-size: 12.5px; margin: 2px 0 8px; }
.focus-projection { display: block; color: var(--text-muted); font-size: 12px; font-weight: 600; margin-top: 2px; }
.alert-card .weekly-label { color: #ffb38a; }
.alert-link { align-self: flex-start; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: 13px; font-weight: 800; padding: 4px 0 0; cursor: pointer; }
.ai-feed { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ai-msg { border-radius: 16px; padding: 12px 14px; max-width: 85%; font-size: 14.5px; line-height: 1.45; white-space: pre-line; }
.ai-msg.user { align-self: flex-end; background: var(--surface-3); }
.ai-msg.ai { align-self: flex-start; background: var(--surface); }
.ai-msg.pending { color: var(--text-muted); animation: aiPulse 1.2s ease-in-out infinite; }
@keyframes aiPulse { 50% { opacity: .45; } }
.ai-suggestions { flex-wrap: wrap; overflow: visible; }

.vote-pill { flex: none; border: 1.5px solid var(--line); border-radius: 100px; padding: 6px 12px; font-size: 12.5px; font-weight: 800; color: var(--text-muted); white-space: nowrap; }
.vote-pill.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
