/* Google Fonts loaded via <link> in HTML for non-render-blocking delivery */

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

:root {
  --font:    'Geist', -apple-system, 'SF Pro Display', 'Inter', 'Helvetica Neue', sans-serif;
  --spring:  cubic-bezier(.34,1.56,.64,1);
  --smooth:  cubic-bezier(.25,.46,.45,.94);
  --blue:    #007AFF;
  --green:   #34C759;
  --red:     #FF3B30;

  --t-bg:         #fff;
  --t-bg-alt:     #f5f5f7;
  --t-card:       #f0f0f2;
  --t-card-alt:   #e8e8ed;
  --t-border:     rgba(0,0,0,.08);
  --t-text:       #1c1c1e;
  --t-text-2:     #8E8E93;
  --t-text-3:     #aeaeb2;
  --t-input-bg:   #f0f0f2;
  --t-input-bdr:  rgba(0,0,0,.06);
  --t-hover:      rgba(0,0,0,.04);
  --t-msg-user:   #f0f0f2;
  --t-msg-user-t: #1c1c1e;
  --t-send-bg:    #1752f0;
  --t-send-color: #fff;
  --t-icon-color: #1c1c1e;
  --t-overlay:    rgba(0,0,0,.4);
  --label:   #000; --label-2: #8E8E93; --label-3: #C7C7CC; --sep: #F2F2F7;
}

html.dark {
  --t-bg:         #000;
  --t-bg-alt:     #0d0d0d;
  --t-card:       #0d0d0d;
  --t-card-alt:   #111;
  --t-border:     rgba(255,255,255,.08);
  --t-text:       #fff;
  --t-text-2:     #8E8E93;
  --t-text-3:     #636366;
  --t-input-bg:   #111;
  --t-input-bdr:  rgba(255,255,255,.08);
  --t-hover:      rgba(255,255,255,.04);
  --t-msg-user:   #111;
  --t-msg-user-t: #fff;
  --t-send-bg:    #fff;
  --t-send-color: #000;
  --t-icon-color: #fff;
  --t-overlay:    rgba(0,0,0,.75);
  --label: #fff; --label-2: #8E8E93; --label-3: #636366; --sep: #1a1a1a;
}

* {
  scrollbar-width: none;
}
*::-webkit-scrollbar {
  display: none;
}

body {
  font-family: var(--font);
  background: var(--t-bg);
  color: var(--t-text);
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  letter-spacing: -.01em;
}

/* ═══════════════════════════════════
   APP SHELL
═══════════════════════════════════ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100svh;
  overflow: hidden;
}

.app-area {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.app .top-bar {
  flex-shrink: 0;
}

.app {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  background: var(--t-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ── DESKTOP SIDEBAR ── */
/* ── BALANCE CARD (above history) ── */
.balance-card {
  margin: 16px 0 0;
  background: transparent;
  border-radius: 0;
  padding: 8px 24px 24px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 140ms;
}
.balance-card:active { opacity: .75; }
.balance-card-lbl {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--t-text);
  margin-bottom: 8px;
}
.balance-card-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.balance-card-amount {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--t-text);
  line-height: 1;
}
.balance-card-currency {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--t-text-3);
}

/* ── Dashboard tabs ── */
.dash-tabs {
  display: flex;
  position: relative;
  padding: 0 24px;
  border-bottom: 1px solid var(--t-border);
  margin-bottom: 4px;
}
.dash-tab {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--t-text-3);
  padding: 12px 16px;
  cursor: pointer;
  transition: color 200ms;
  position: relative;
}
.dash-tab.active { color: var(--t-text); font-weight: 600; }
.dash-tab:hover { color: var(--t-text-2); }
.dash-tab-line {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: var(--t-send-bg);
  border-radius: 1px;
  transition: left 300ms cubic-bezier(.4,0,.2,1), width 300ms cubic-bezier(.4,0,.2,1);
}

/* ── FAB mic button ── */
.fab-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--t-bg);
  padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 10px);
  border-top: 1px solid var(--t-border);
}
.fab-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 600px;
  margin: 0 auto;
  padding: 6px 6px 6px 14px;
  border-radius: 22px;
  background: var(--t-card-alt);
}
.fab-bar-input {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 15px;
  color: var(--t-text);
  outline: none;
  resize: none;
  line-height: 1.4;
  padding: 7px 0;
  scrollbar-width: none;
}
.fab-bar-input::-webkit-scrollbar { display: none; }
.fab-bar-input::placeholder { color: var(--t-text-3); }
.fab-bar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  align-self: flex-end;
}
.fab-bar-mic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--t-text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 150ms;
  -webkit-tap-highlight-color: transparent;
}
.fab-bar-mic:hover { color: var(--t-text); }
.fab-bar-mic:active { opacity: .7; }
.fab-bar-mic.listening { color: #FF3B30; }
.fab-bar-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #1752f0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 150ms, transform 150ms;
  -webkit-tap-highlight-color: transparent;
}
.fab-bar-send:hover { opacity: .85; }
.fab-bar-send:active { transform: scale(.92); }
.fab-bar-send:disabled { opacity: .35; pointer-events: none; }

.fab-credits {
  text-align: center;
  padding: 6px 0 0;
  font-size: 12px;
  color: var(--t-text-3);
  white-space: nowrap;
}
.fab-credits button {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--t-text-2);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.fab-credits button:hover { color: var(--t-text); }

.dash-sidebar { display: none; }

/* Scrollable content area */
.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 90px;
}

.app-content::-webkit-scrollbar { display: none; }

/* ── UNIFIED SECTION LAYOUT ── */
#view-history,
#view-charts {
  padding-top: 20px;
}

/* ── SIDE NAVIGATION ── */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  padding: calc(env(safe-area-inset-top,14px) + 16px) 12px 18px;
  background: var(--t-bg);
  border-right: 1px solid rgba(255,255,255,.06);
  color: var(--t-text);
  transform: translateX(-100%);
  transition: transform 280ms var(--smooth);
  z-index: 300;
  overflow-y: auto;
  will-change: transform;
}
.side-nav.open { transform: translateX(0); }

.side-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 16px;
  color: var(--t-text);
}
.side-nav-brand .brand-name { color: var(--t-text); flex: 1; }

.side-nav-collapse-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--t-text-2);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 150ms, color 150ms;
  -webkit-tap-highlight-color: transparent;
}
.side-nav-collapse-btn:hover { background: var(--t-hover); color: var(--t-text); }

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--t-text-2);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  -webkit-tap-highlight-color: transparent;
}
.side-nav-item i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.side-nav-icon { width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; }
.side-nav-item:hover { background: var(--t-hover); color: var(--t-text); }
.side-nav-item.on { background: rgba(255,255,255,.1); color: var(--t-text); }

.side-nav-sep {
  height: 1px;
  background: var(--t-hover);
  margin: 8px 10px;
}

/* ── Sidebar free plan card ─────────────────────────────── */
.snav-free-card {
  margin: 12px 10px 10px;
  padding: 14px 14px 12px;
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.snav-free-card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9A9AA0;
}
.snav-free-card-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--t-text);
}
.snav-free-bar-track {
  height: 4px;
  border-radius: 100px;
  background: var(--t-card-alt);
  overflow: hidden;
  margin: 2px 0;
}
.snav-free-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: #0A84FF;
  transition: width 400ms ease, background 400ms ease;
}
.snav-free-card-desc {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--t-text-3);
  margin: 0;
}
.snav-free-upgrade-btn {
  margin-top: 2px;
  height: 34px;
  border-radius: 100px;
  border: none;
  background: #fff;
  color: #000;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
  transition: opacity 150ms;
  width: 100%;
}
.snav-free-upgrade-btn:active { opacity: .8; }
.side-nav.collapsed .snav-free-card { display: none !important; }

.side-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.side-nav-backdrop.show { opacity: 1; pointer-events: all; }

/* ── HEADER ── */
.top-bar {
  width: 100%;
  flex-shrink: 0;
  background: #fff;
  z-index: 100;
}

.top-bar-inner {
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top,14px) + 10px) 28px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar-right-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-guest-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dashboard-mode header: back | brand center | profile */
.top-bar-dash {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.top-bar-dash .brand {
  justify-self: center;
}
.top-bar-dash .top-bar-icon-btn:last-child {
  justify-self: end;
}

.top-bar-dashboard-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--t-hover);
  color: var(--t-text);
  font-size: 15px;
  cursor: pointer;
  transition: background 150ms, transform 150ms;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.top-bar-dashboard-btn:hover  { background: rgba(255,255,255,.14); }
.top-bar-dashboard-btn.on     { background: rgba(255,255,255,.16); }
.top-bar-dashboard-btn:active { transform: scale(.92); }

.top-bar-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.05);
  color: #1C1C1E;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms, color 150ms, transform 150ms;
  -webkit-tap-highlight-color: transparent;
}
.top-bar-icon-btn:active { transform: scale(.92); }
.top-bar-icon-btn { background: var(--t-hover); color: var(--t-text); }

.guest-action-btn {
  border: 1px solid var(--t-border);
  background: transparent;
  color: var(--t-text);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: opacity 150ms;
}
.guest-action-btn:active { opacity: .7; }
.guest-action-btn.primary {
  background: var(--t-text);
  color: var(--t-bg);
  border-color: var(--t-text);
}

.menu-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--sep);
  color: var(--label-2);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle:active { background: var(--t-card); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px; height: 38px;
  max-width: 38px; max-height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-icon svg { color: var(--t-text); }

.brand-logo-img {
  display: block;
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  object-fit: cover;
  border-radius: 9px;
}

.logo-dark { display: none; }
html.dark .logo-light { display: none !important; }
html.dark .logo-dark  { display: block; }

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.5px;
}

/* ── BALANCE ── */
.balance-section {
  padding: 20px 24px 0;
}

.balance-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--t-text-2);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.balance-num {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -2.5px;
  line-height: 1.05;
  color: var(--label);
  transition: color 300ms;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.balance-num:active { opacity: .6; }

.balance-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── ACCOUNT SELECTOR ── */
.account-selector {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.side-nav .account-selector {
  display: block;
  margin: 0 0 14px;
  padding: 0 12px;
}
.side-nav .account-selector-btn {
  width: 100%;
  justify-content: space-between;
  background: var(--t-hover);
  color: var(--t-text);
}
.side-nav .account-selector-btn:active { background: rgba(255,255,255,.1); }
.side-nav .account-menu { left: 12px; right: 12px; min-width: 0; }

.account-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  border: none;
  background: var(--sep);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--label);
  cursor: pointer;
  transition: background 140ms;
  -webkit-tap-highlight-color: transparent;
}
.account-selector-btn:active { background: var(--label-3); }

.account-select-arrow {
  font-size: 10px;
  color: var(--label-2);
  transition: transform 200ms var(--smooth);
}
.account-selector.open .account-select-arrow { transform: rotate(180deg); }

.account-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--t-bg);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  pointer-events: none;
  transition: opacity 160ms var(--smooth), transform 160ms var(--smooth);
  z-index: 50;
}
.account-selector.open .account-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--t-text);
  text-align: left;
  cursor: pointer;
  transition: background 120ms;
}
.account-menu-item:active { background: var(--t-hover); }
.account-menu-item.on { color: var(--blue); }
.account-menu-item i { font-size: 14px; width: 16px; text-align: center; color: var(--t-text-2); }
.account-menu-item.on i { color: var(--blue); }

.account-menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--t-hover);
}

.account-selector-btn { background: var(--t-card-alt); color: var(--t-text); }
.account-selector-btn:active { background: var(--t-card); }

/* ── MANAGE ACCOUNTS ── */
.manage-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 18px 18px;
  max-height: 50vh;
  overflow-y: auto;
}
.manage-account-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.manage-account-input { flex: 1; }
.manage-account-del {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--t-border);
  background: var(--t-bg);
  color: var(--red);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.manage-account-del:active { background: rgba(255,59,48,.1); }

/* ── SECTION HEADER ── */
.section-lbl {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--t-text-2);
  text-transform: uppercase;
  padding: 0 24px 12px;
}

/* ── TRANSACTION LIST ── */
.tx-list { padding: 0 0 calc(env(safe-area-inset-bottom,20px) + 100px); }

.tx-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 24px;
  cursor: pointer;
  transition: background 100ms;
  -webkit-tap-highlight-color: transparent;
}

.tx-row:active { background: var(--t-hover); }

/* Circle gradient icon */
.tx-icon {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.tx-icon svg {
  width: 22px; height: 22px;
  color: var(--t-text);
  display: block;
}

.tx-icon i.fi {
  font-size: 22px;
  color: var(--t-text);
  line-height: 1;
  display: block;
}

.tx-icon-flat {
  background: none !important;
}
.tx-icon-flat i.fi {
  color: var(--t-icon-color) !important;
}

/* Brand logo variant — fills circle natively */
.tx-icon-brand {
  background: var(--t-card) !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .2s;
  display: block;
}

.tx-body { flex: 1; min-width: 0; }

.tx-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.tx-cat-lbl {
  font-size: 14px;
  color: var(--label-2);
  margin-top: 2px;
  font-weight: 400;
}

.tx-right { text-align: right; flex-shrink: 0; }

.tx-amt {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--label);
}

.tx-amt.income { color: var(--green); }

.tx-date {
  font-size: 13px;
  color: var(--label-2);
  margin-top: 2px;
}

/* slide-in animation */
@keyframes txSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tx-row.new { animation: txSlide 320ms var(--spring) both; }

/* ── EMPTY ── */
.empty-state {
  text-align: center;
  padding: 28px 24px;
}

.empty-icon {
  width: auto; height: auto;
  background: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.empty-icon svg { width: 26px; height: 26px; color: var(--label-3); }
.empty-icon i { font-size: 26px; color: var(--label-3); }
.empty-title { font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: var(--label-2); }
.empty-body  { font-size: 15px; color: var(--label-2); line-height: 1.55; margin-top: 6px; }

/* ── Empty hint (points to FAB) ── */
.empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 40px;
  gap: 12px;
}
.empty-hint-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--t-text-3);
}
.empty-hint-arrow {
  font-size: 28px;
  color: var(--t-text-3);
  animation: hintBounce 1.4s ease-in-out infinite;
}
@keyframes hintBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ── Skeleton loading ── */
.skel-list { padding: 8px 0; }
.skel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
}
.skel-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--t-card-alt);
  flex-shrink: 0;
  animation: skelPulse 1.4s ease-in-out infinite;
}
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skel-line {
  height: 10px;
  border-radius: 5px;
  background: var(--t-card-alt);
  animation: skelPulse 1.4s ease-in-out infinite;
}
.skel-line.w30 { width: 30%; }
.skel-line.w35 { width: 35%; }
.skel-line.w40 { width: 40%; }
.skel-line.w50 { width: 50%; }
.skel-line.w55 { width: 55%; }
.skel-line.w60 { width: 60%; }
.skel-line.w70 { width: 70%; }
.skel-amt {
  width: 60px; height: 14px;
  border-radius: 7px;
  background: var(--t-card-alt);
  flex-shrink: 0;
  animation: skelPulse 1.4s ease-in-out infinite;
}
@keyframes skelPulse {
  0%, 100% { opacity: .4; }
  50% { opacity: .15; }
}

/* ── PAYMENTS VIEW ── */
.pay-view { padding: 0 0 calc(env(safe-area-inset-bottom,20px) + 100px); }
.pay-view .tx-list { padding-bottom: 0; }

.pay-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px 14px;
}

.pay-summary-lbl {
  font-size: 14px;
  color: var(--label-2);
}

.pay-summary-amt {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--label);
}

.pay-summary-amt.owe  { color: var(--red); }
.pay-summary-amt.owed { color: var(--green); }

/* ── LOCKED VIEWS (free plan) ── */
.locked-view { position: relative; }

.chart-view.blurred {
  filter: blur(14px);
  pointer-events: none;
  user-select: none;
}

.locked-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}
.locked-overlay.show { display: flex; }

.locked-icon {
  font-size: 26px;
  color: var(--t-text);
}

.locked-text {
  font-size: 14px;
  color: var(--t-text-2);
}

.locked-link {
  color: var(--t-text);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
}

#charts-lock-overlay.show {
  position: fixed;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 48px);
  max-width: 360px;
  z-index: 150;
}

/* ── CHARTS VIEW ── */
.chart-view { padding: 0 0 calc(env(safe-area-inset-bottom,20px) + 100px); }

.charts-grid {
  display: flex;
  flex-direction: column;
}

.charts-col { min-width: 0; }

/* Month nav */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 14px 20px 10px;
}

.month-nav-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.2px;
  min-width: 130px;
  text-align: center;
}

.month-nav-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--sep);
  border: none;
  font-size: 18px;
  color: var(--label);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 150ms;
  line-height: 1;
}

.month-nav-btn:disabled { opacity: .3; pointer-events: none; }
.month-nav-btn:active { background: var(--t-card); }

/* ── Unified Chart ── */
.uchart-wrap {
  padding: 0 24px 32px;
}

/* ── Stacked charts ── */
.stacked-charts {
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 8px;
}
.stacked-chart {
  width: 100%;
}
.stacked-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.stacked-chart-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t-text-2);
  margin-bottom: 2px;
}
.stacked-chart-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.4px;
}
.stacked-chart-badge {
  padding-top: 4px;
}
.stacked-chart-graph {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}
.stacked-chart-graph svg {
  width: 100%;
  height: 80px;
  display: block;
}
.uchart-tabs {
  display: flex;
  gap: 0;
}
.uchart-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 12px;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: opacity 200ms;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font);
  border-bottom: 2px solid transparent;
}
.uchart-tab.active { border-bottom-color: var(--t-text); }
.uchart-tab:not(.active) { opacity: .35; }
.uchart-tab:not(.active):hover { opacity: .55; }
.uchart-tab-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--t-text-3);
  letter-spacing: .02em;
}
.uchart-tab-val {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.03em;
  line-height: 1.1;
}
.uchart-tab-change {
  display: flex;
  align-items: center;
}
.spark-badge {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
}
.uchart-graph {
  padding: 20px 0 4px;
}
.uchart-graph svg {
  width: 100%;
  height: 130px;
  display: block;
}
@media (max-width: 440px) {
  .uchart-tab { padding: 12px 8px; }
  .uchart-tab-val { font-size: 18px; }
  .uchart-graph svg { height: 100px; }
}

/* ── Health Gauge ── */
.health-section {
  padding: 0 24px 28px;
}
.health-gauge {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 16px 0 0;
}
.health-gauge svg { display: block; }
.health-arc {
  transition: stroke-dashoffset 1.4s cubic-bezier(.4,0,.2,1);
}
.health-center {
  position: absolute;
  bottom: 4px;
  text-align: center;
}
.health-score {
  font-size: 36px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -1px;
  line-height: 1;
}
.health-label {
  font-size: 12px;
  color: var(--t-text-3);
  margin-top: 2px;
}
.health-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}
.health-toggle span {
  font-size: 12px;
  color: var(--t-text-3);
}
.health-toggle-arrow {
  font-size: 10px;
  color: var(--t-text-3);
  transition: transform 200ms;
}
.health-toggle-arrow.open { transform: rotate(180deg); }
.health-details {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}
.health-details.open { display: flex; }
.health-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.health-detail-label {
  font-size: 13px;
  color: var(--t-text-2);
  width: 100px;
  flex-shrink: 0;
}
.health-detail-bar {
  flex: 1;
  height: 4px;
  background: var(--t-card-alt);
  border-radius: 2px;
  overflow: hidden;
}
.health-detail-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 800ms cubic-bezier(.4,0,.2,1);
}
.health-detail-score {
  font-size: 13px;
  font-weight: 600;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Category Bars ── */
.catbars-section {
  padding: 0 24px 28px;
  margin-bottom: 8px;
}
.se-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.3px;
  margin-bottom: 6px;
}
.catbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.catbar-row:last-child { margin-bottom: 0; }
.catbar-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 14px;
}
.catbar-icon-flat {
  background: none !important;
  color: var(--t-icon-color);
  font-size: 18px;
}
.catbar-info {
  flex: 1;
  min-width: 0;
}
.catbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.catbar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catbar-track {
  height: 4px;
  background: var(--t-card-alt);
  border-radius: 2px;
  overflow: hidden;
}
.catbar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 800ms cubic-bezier(.4,0,.2,1);
}
.catbar-amt {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-text-2);
}

/* ── Stats Extra ── */
.stats-extra-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 24px 28px;
  margin-bottom: 8px;
}
.stats-extra-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-text);
  letter-spacing: -.01em;
  margin-bottom: 12px;
}

/* ── Rich stats cards (se-*) ── */
.se-card {
  background: var(--t-card);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--t-border);
}
.se-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.se-card-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.se-card-title {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.3px;
}
.se-card-menu {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--t-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--t-text-2);
  font-size: 16px;
}
.se-card-menu:hover { background: var(--t-card-alt); }
.se-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.se-badge i { font-size: 11px; }
.se-stats-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.se-stat {}
.se-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.4px;
  line-height: 1.2;
}
.se-stat-lbl {
  font-size: 12px;
  color: var(--t-text-2);
  margin-top: 2px;
}
.se-spark-wrap {
  margin-left: auto;
  text-align: right;
}
.se-spark { width: 90px; }
.se-spark svg { width: 90px; height: 36px; }
.se-spark-diff { margin-top: 2px; white-space: nowrap; }

/* Section headers inside cards */
.se-section-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--t-border);
}
.se-section-hdr span {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-text);
}
.se-view-all {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: #007AFF;
  cursor: pointer;
  padding: 0;
}
.se-view-all:hover { opacity: .7; }

/* List items inside cards */
.se-list { margin-bottom: 12px; }
.se-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--t-border);
}
.se-list-item:last-child { border-bottom: none; }
.se-list-clean .se-list-item { border-bottom: none; }
.se-list-item .tx-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; }
.se-list-item .tx-icon i { font-size: 16px; }
.se-list-item .brand-logo { width: 36px; height: 36px; }
.se-debt-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.se-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.se-list-info { flex: 1; min-width: 0; }
.se-list-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.se-list-sub {
  font-size: 12px;
  color: var(--t-text-3);
  margin-top: 1px;
}
.se-list-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.se-list-amt {
  font-size: 14px;
  font-weight: 600;
  color: var(--t-text);
}
.se-days-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Debt summary */
.se-debt-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.se-debt-col {}
.se-debt-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t-text-2);
  margin-bottom: 6px;
}
.se-debt-total {
  font-size: 24px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.4px;
  line-height: 1.2;
}
.se-debt-bar {
  height: 6px;
  background: var(--t-card-alt);
  border-radius: 3px;
  overflow: hidden;
}
.se-debt-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 800ms cubic-bezier(.4,0,.2,1);
}

/* Insight card inside se-card */
.se-insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 4px;
}
.se-insight-icon { font-size: 16px; flex-shrink: 0; line-height: 1.3; }
.se-insight-text {
  font-size: 13px;
  color: var(--t-text-2);
  line-height: 1.5;
}

/* Flat card variant (no bg, no border, no padding) */
.se-card-flat {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--t-border);
  margin-bottom: 28px;
}
.se-card-flat:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.se-card-flat .se-section-title { margin-bottom: 6px; }
.se-text-stats {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.se-text-stat {
  font-size: 14px;
  color: var(--t-text-2);
}
.se-text-stat strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.2px;
}
.se-text-sep {
  color: var(--t-text-3);
  font-size: 14px;
}
.se-insight-flat {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--t-hover);
  border-radius: 10px;
  font-size: 13px;
  color: var(--t-text-2);
  line-height: 1.5;
}
.se-info-text {
  font-size: 13px;
  color: var(--t-text-2);
  line-height: 1.6;
  margin-bottom: 18px;
}
.se-info-text strong { color: var(--t-text); font-weight: 600; }

.catbar-insight {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--t-hover);
  border-radius: 10px;
  font-size: 13px;
  color: var(--t-text-2);
  line-height: 1.5;
}
.catbar-insight strong { color: var(--t-text); }

/* ── Minimal goal/limit row ── */
.sgoal-row {
  padding: 0 24px 20px;
  display: flex;
  gap: 20px;
}
@media (max-width: 400px) { .sgoal-row { flex-direction: column; gap: 16px; } }
.sgoal-item { flex: 1; min-width: 0; }
.sgoal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.sgoal-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t-text-2);
}
.sgoal-edit {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: #007AFF;
  cursor: pointer;
  padding: 0;
}
.sgoal-edit:hover { opacity: .7; }
.sgoal-pct {
  font-size: 12px;
  font-weight: 600;
}
.sgoal-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.3px;
  margin-bottom: 8px;
}
.sgoal-of {
  font-size: 13px;
  font-weight: 400;
  color: var(--t-text-3);
}
.sgoal-bar {
  height: 4px;
  background: var(--t-card-alt);
  border-radius: 2px;
  overflow: hidden;
}
.sgoal-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 800ms cubic-bezier(.4,0,.2,1);
}
.sgoal-empty {
  font-size: 13px;
  color: var(--t-text-3);
  margin-top: 2px;
}

.stats-goal-pct {
  font-size: 12px;
  font-weight: 600;
  color: #22C55E;
}

/* Monthly summary */
.month-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 24px 14px;
}

.month-summary-item {
  flex: 1;
  min-width: 90px;
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
}

.month-summary-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--t-text-2);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.month-summary-amt {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--t-text);
}


/* Section divider inside chart-view */
.chart-section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--t-text);
  padding: 0 24px 14px;
}

/* Line chart */
.line-chart-wrap {
  padding: 0 16px 4px;
  overflow: hidden;
}

.line-chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 6px 10px;
}

.line-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--label-2);
}

.line-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.line-legend-dash {
  width: 18px; height: 2px;
  flex-shrink: 0;
  background: repeating-linear-gradient(90deg, #8E8E93 0 4px, transparent 4px 8px);
}

@keyframes chartDotPulse {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.donut-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0 20px;
}

.donut {
  width: 200px; height: 200px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-svg { overflow: visible; transform: rotate(-90deg); }

.donut-seg {
  transition: stroke-dashoffset 1s var(--smooth), filter .2s ease-out;
  cursor: pointer;
}

.donut-bg-ring { stroke: var(--sep); }

.donut-hole {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  pointer-events: none;
  padding: 0 28px;
}

.donut-hole-amt  { font-size: 24px; font-weight: 800; letter-spacing: -.6px; transition: opacity .15s ease; }
.donut-hole-lbl  { font-size: 12px; font-weight: 500; color: var(--label-2); letter-spacing: .02em; text-transform: uppercase; margin-top: 2px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .15s ease; }
.donut-hole-pct  { font-size: 13px; font-weight: 600; color: var(--label-2); margin-top: 2px; }

.cat-legend {
  padding: 4px 20px 0;
  border-top: 1px solid var(--sep);
  margin: 4px 20px 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms;
}

.legend-row:hover,
.legend-row.active { background: var(--sep); }

.legend-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-row .tx-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
}
.legend-row .tx-icon i.fi { font-size: 16px; }
.legend-row .tx-icon svg  { width: 16px; height: 16px; }

.legend-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.legend-cycle { font-size: 12px; font-weight: 500; color: var(--label-2); }

/* ── Subscription cards ── */
/* ── Confirm dialog ── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--t-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 200ms;
}
.confirm-overlay.open { opacity: 1; }
.confirm-card {
  width: 100%;
  max-width: 340px;
  background: var(--t-bg-alt);
  border: 1px solid var(--t-border);
  border-radius: 18px;
  padding: 24px;
}
.confirm-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--t-text);
  margin-bottom: 8px;
}
.confirm-body {
  font-size: 14px;
  color: var(--t-text-2);
  line-height: 1.5;
  margin-bottom: 20px;
}
.confirm-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--t-border);
  background: var(--t-input-bg);
  font-family: var(--font);
  font-size: 16px;
  color: var(--t-text);
  margin-bottom: 16px;
  outline: none;
}
.confirm-input:focus { border-color: #007AFF; }
.confirm-input::placeholder { color: var(--t-text-3); }
.confirm-btns {
  display: flex;
  gap: 10px;
}
.confirm-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms;
}
.confirm-btn:active { opacity: .7; }
.confirm-btn.cancel {
  background: var(--t-card-alt);
  color: var(--t-text);
}
.confirm-btn.primary {
  background: #007AFF;
  color: #fff;
}
.confirm-btn.danger {
  background: #FF3B30;
  color: #fff;
}

/* ── Debt cards ── */
.legend-name { flex: 1; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }

.legend-amt { font-size: 15px; font-weight: 700; letter-spacing: -.3px; min-width: 64px; text-align: right; }

.goal-card {
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 16px;
}

.goal-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 10px;
  color: var(--t-text);
}

.goal-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t-text);
  margin-bottom: 8px;
}

.goal-empty {
  font-size: 14px;
  color: var(--t-text-2);
  line-height: 1.5;
  margin-bottom: 12px;
}

.goal-progress-wrap {
  width: 100%;
  height: 8px;
  background: var(--label-3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.goal-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
  transition: width 600ms var(--smooth);
}

.goal-progress-bar.over { background: var(--red); }

.goal-amounts {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--t-text-2);
}

.goal-amounts-cur { font-weight: 600; color: var(--t-text); }
.goal-amounts-cur.over { color: var(--t-text); }

.goal-warning {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
}

.goal-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.goal-form.hidden { display: none; }

.goal-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--t-border);
  background: var(--t-input-bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--t-text);
}

.goal-save-btn {
  align-self: flex-start;
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--blue);
  color: var(--t-text);
}

.goal-edit-btn {
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}

/* Empty chart */
.chart-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--label-2);
  font-size: 15px;
}

/* ── FILTER CHIPS (inside History) ── */
.chips-wrap {
  display: flex;
  gap: 8px;
  padding: 14px 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips-wrap::-webkit-scrollbar { display: none; }

.chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  letter-spacing: -.01em;
  border: 1.5px solid var(--sep);
  background: none;
  color: var(--label-2);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 140ms var(--smooth);
}

.chip.on {
  background: var(--label);
  border-color: var(--label);
  color: var(--t-text);
}

.chip:active { transform: scale(.94); }

/* ══════════════════════════════════
   AI CHAT (main view)
══════════════════════════════════ */
.view-chat {
  position: relative;
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: var(--t-bg);
}
.view-chat.active {
  display: flex;
}

.ai-chat-header {
  display: none;
}

@media (min-width: 860px) {
  .ai-chat-header {
    position: absolute;
    top: calc(env(safe-area-inset-top, 14px) + 10px);
    right: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
  }
  .ai-chat-messages {
    padding-top: calc(env(safe-area-inset-top, 14px) + 62px);
  }
}

.ai-chat-header-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--t-hover);
  color: var(--t-text-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 150ms, background 150ms, transform 150ms;
  -webkit-tap-highlight-color: transparent;
}
.ai-chat-header-btn:active { transform: scale(.9); }
.ai-chat-header-btn:hover { color: var(--t-text); background: var(--t-hover); }

.ai-chat-header-btn-lg {
  width: 40px; height: 40px;
  font-size: 17px;
  color: var(--t-text);
  background: rgba(255,255,255,.1);
}
.ai-chat-header-btn-lg + .ai-chat-header-btn-lg { margin-left: 4px; }

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  -webkit-overflow-scrolling: touch;
}
.ai-chat-messages.hidden { display: none; }

/* ── WELCOME SCREEN ── */
.ai-welcome {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  padding: 0;
  min-height: 0;
}
.ai-welcome.show { display: flex; }
.ai-welcome .ai-welcome-headline {
  text-align: center;
}
.ai-welcome #ai-inputbar-wrap {
  padding: 0 14px;
}
.ai-welcome .ai-chat-inputbar {
  margin-left: 0;
  margin-right: 0;
}

.ai-suggest-wrap {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px 0;
}
@media (min-width: 768px) {
  .ai-suggest-wrap.visible { display: flex; }
}

.ai-suggest-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  border-radius: 100px;
  border: 1px solid var(--t-border);
  background: var(--t-card-alt);
  color: rgba(255,255,255,.45);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms, color 140ms, transform 120ms;
  -webkit-tap-highlight-color: transparent;
}
.ai-suggest-chip i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--t-text-3);
  flex-shrink: 0;
}
.ai-suggest-chip:hover { background: var(--t-hover); color: rgba(255,255,255,.65); }
.ai-suggest-chip:hover i { color: rgba(255,255,255,.45); }
.ai-suggest-chip:active { transform: scale(.96); }

.ai-welcome-headline {
  text-align: center;
}

.ai-welcome-title {
  font-family: var(--font);
  font-size: clamp(24px, 6vw, 48px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin: 0;
  text-align: center;
  color: var(--t-text);
  white-space: nowrap;
}
.ai-welcome-title.ai-welcome-logged {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--t-text);
}

.ai-welcome-static {
  color: var(--t-text);
}

.ai-welcome-dynamic {
  display: inline-block;
  color: var(--t-text);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,.4);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
  transition: opacity 280ms cubic-bezier(.4,0,.2,1), filter 280ms cubic-bezier(.4,0,.2,1), transform 280ms cubic-bezier(.4,0,.2,1);
  will-change: opacity, filter, transform;
}
.ai-welcome-dynamic.dyn-out {
  opacity: 0;
  filter: blur(8px);
  transform: scale(.92) translateY(-4px);
}
.ai-welcome-dynamic.dyn-in {
  opacity: 1;
  filter: blur(0px);
  transform: scale(1) translateY(0);
}
@keyframes dynAppear {
  from { opacity: 0; filter: blur(8px); transform: scale(.92) translateY(6px); }
  to   { opacity: 1; filter: blur(0px); transform: scale(1)   translateY(0);   }
}

.ai-welcome-subtitle {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--t-text-2);
  text-align: center;
  margin: 14px auto 0;
  max-width: 520px;
  padding: 0 24px;
}

.ai-msg-user {
  align-self: flex-end;
  max-width: 82%;
  background: var(--t-msg-user);
  color: var(--t-msg-user-t);
  padding: 11px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -.01em;
  white-space: pre-wrap;
  word-break: break-word;
  animation: msgSlideUp 350ms cubic-bezier(.22,1,.36,1) both;
}
@keyframes msgSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-msg-bot {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: msgFadeIn 400ms cubic-bezier(.22,1,.36,1) both;
}
@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-msg-icon {
  width: 22px; height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.ai-msg-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--t-text);
}
.ai-msg-meta {
  font-size: 11px;
  font-weight: 400;
  color: var(--t-text-3);
  letter-spacing: .01em;
}
.ai-msg-meta-arrow {
  font-size: 10px;
  color: var(--t-text-3);
  transition: transform 200ms ease;
  margin-left: -2px;
}
.ai-msg-meta-arrow.open { transform: rotate(180deg); }

.ai-msg-actions-detail {
  overflow: hidden;
  max-height: 0;
  padding: 0;
  opacity: 0;
  transition: max-height 400ms cubic-bezier(.4,0,.2,1), opacity 300ms ease, padding 300ms ease;
}
.ai-msg-actions-detail.open {
  max-height: 200px;
  padding: 6px 0 2px;
  opacity: 1;
}

.ai-timeline {
  display: flex;
  flex-direction: column;
}
.ai-tl-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 0 0 0;
  position: relative;
  min-height: 28px;
  animation: actStepIn 300ms cubic-bezier(.22,1,.36,1) both;
}
.ai-tl-step:nth-child(1) { animation-delay: 0ms; }
.ai-tl-step:nth-child(2) { animation-delay: 60ms; }
.ai-tl-step:nth-child(3) { animation-delay: 120ms; }
.ai-tl-step:nth-child(4) { animation-delay: 180ms; }
.ai-tl-step:nth-child(5) { animation-delay: 240ms; }
@keyframes actStepIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-tl-node {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  z-index: 1;
}
.ai-tl-step:not(.last) .ai-tl-node::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 1px;
  height: 16px;
  background: var(--t-border);
}
.ai-tl-text {
  font-size: 12px;
  color: var(--t-text-3);
  letter-spacing: .01em;
  line-height: 1.3;
}

/* Live timeline states */
.ai-tl-pending {
  opacity: .25;
}
.ai-tl-pending .ai-tl-node {
  background: var(--t-text-3);
}
.ai-tl-active {
  animation: actStepIn 400ms cubic-bezier(.22,1,.36,1) both;
}
.ai-tl-active .ai-tl-node {
  animation: nodePulse 1.2s ease-in-out infinite;
}
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}
.ai-live-timer {
  font-variant-numeric: tabular-nums;
}

.ai-msg-bot .ai-msg-text {
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.01em;
  color: var(--t-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-msg-bot.typing .ai-msg-text {
  display: none;
  animation: ai-shimmer 1.6s linear infinite;
}
@keyframes ai-shimmer {
  0%   { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

.ai-msg-actions {
  display: flex;
  gap: 6px;
}
.ai-msg-action {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--t-text-2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 150ms, background 150ms, transform 150ms;
  -webkit-tap-highlight-color: transparent;
}
.ai-msg-action:active { transform: scale(.9); }
.ai-msg-action:hover { color: var(--t-text); background: transparent; }
.ai-msg-action.done { color: #34C759; }

/* ── RECORD CARDS (transactions/subs/debts registered via chat) ── */
.ai-msg-records:empty { display: none; }

.ai-records {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--t-bg-alt);
  border: none;
  border-radius: 16px;
  padding: 4px;
  animation: cardReveal 450ms cubic-bezier(.22,1,.36,1) both;
  animation-delay: 150ms;
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-record-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 10px;
  animation: rowSlide 350ms cubic-bezier(.22,1,.36,1) both;
}
.ai-record-row:nth-child(1) { animation-delay: 200ms; }
.ai-record-row:nth-child(2) { animation-delay: 280ms; }
.ai-record-row:nth-child(3) { animation-delay: 360ms; }
.ai-record-row:nth-child(4) { animation-delay: 440ms; }
.ai-record-row:nth-child(5) { animation-delay: 520ms; }
@keyframes rowSlide {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ai-record-row .tx-name { color: var(--t-text); }
.ai-record-row .tx-cat-lbl { color: var(--t-text-2); }
.ai-record-row .tx-amt { color: var(--t-text); }
.ai-record-row .tx-amt.income { color: var(--t-text); }
.ai-record-clickable:hover { background: var(--t-hover); border-radius: 10px; }

.ai-records-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t-text-2);
  cursor: pointer;
  user-select: none;
}
.ai-records-toggle i { font-size: 12px; transition: transform .25s var(--smooth); }
.ai-records.collapsed .ai-records-toggle i { transform: rotate(-90deg); }
.ai-records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-records.collapsed .ai-records-list { display: none; }

/* ── CHAT VISUAL WIDGETS (charts / progress bars sent by the AI) ── */
.ai-msg-widget:empty { display: none; }
.chat-widget {
  align-self: stretch;
  background: var(--t-bg-alt);
  border: none;
  border-radius: 16px;
  animation: cardReveal 500ms cubic-bezier(.22,1,.36,1) both;
  animation-delay: 200ms;
}
.chat-widget .donut-wrap { padding: 16px 0 6px; }
.chat-widget .donut, .chat-widget .donut-svg { width: 160px; height: 160px; }
.chat-widget .cat-legend { margin: 4px 12px 4px; padding: 4px 12px 0; }
.chat-widget .donut-hole-amt,
.chat-widget .legend-name,
.chat-widget .legend-amt { color: var(--t-text); }
.chat-widget .donut-hole-lbl,
.chat-widget .donut-hole-pct { color: var(--t-text-2); }
.chat-widget .donut-bg-ring { stroke: #333333; }
.chat-widget .cat-legend { border-color: var(--t-border); }
.chat-widget .legend-row:hover { background: var(--t-card-alt); }
.chat-widget.goal-card { padding: 16px; }

/* ── CHAT HISTORY POPUP ── */
.ai-history-overlay {
  position: fixed;
  inset: 0;
  z-index: 655;
  background: var(--t-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.ai-history-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.ai-history-panel {
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  border-radius: 24px 24px 0 0;
  margin: 0 10px;
  padding-bottom: env(safe-area-inset-bottom,0px);
  transform: translateY(16px);
  transition: transform 220ms ease;
}
.ai-history-overlay.open .ai-history-panel { transform: translateY(0); }

@media (max-width: 859px) {
  .ai-history-overlay { align-items: stretch; }
  .ai-history-panel {
    max-height: none;
    height: 100%;
    width: 100%;
    margin: 0;
    border-radius: 0;
    border: none;
  }
}

@media (min-width: 860px) {
  .ai-welcome-title { font-size: clamp(36px, 5vw, 56px); }
}

@media (min-width: 860px) {
  .ai-history-overlay {
    align-items: stretch;
    justify-content: flex-end;
    background: rgba(0,0,0,.3);
  }
  .ai-history-panel {
    width: 360px;
    max-width: 360px;
    max-height: none;
    height: 100%;
    margin: 0;
    border-radius: 0;
    border-width: 0 0 0 1px;
    transform: translateX(100%);
  }
  .ai-history-overlay.open .ai-history-panel { transform: translateX(0); }
}

.ai-history-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.ai-history-title {
  flex: 1;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--t-text);
}

.ai-history-close-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--t-hover);
  color: var(--t-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 150ms, background 150ms, transform 150ms;
  -webkit-tap-highlight-color: transparent;
}
.ai-history-close-btn:active { transform: scale(.9); }
.ai-history-close-btn:hover { color: var(--t-text); background: var(--t-hover); }

.ai-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.ai-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 12px;
  border-radius: 12px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.ai-history-item:hover { background: var(--t-hover); }
.ai-history-item.active { background: var(--t-hover); }

.ai-history-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-history-item-title {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--t-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-history-item.active .ai-history-item-title { font-weight: 600; }
.ai-history-item-date {
  font-size: 11px;
  color: var(--t-text-3);
  letter-spacing: .01em;
}

.ai-history-item-delete {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--t-text-2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: color 150ms, background 150ms, opacity 150ms;
  -webkit-tap-highlight-color: transparent;
}
.ai-history-item:hover .ai-history-item-delete,
.ai-history-item.active .ai-history-item-delete { opacity: 1; }
.ai-history-item-delete:hover { color: var(--red); background: rgba(255,59,48,.12); }
.ai-history-item-delete:active { transform: scale(.9); }

.ai-history-empty {
  text-align: center;
  color: var(--t-text-2);
  font-size: 14px;
  padding: 60px 20px;
}

.ai-chat-inputbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 14px calc(env(safe-area-inset-bottom,14px) + 14px);
  padding: 12px 14px;
  background: var(--t-input-bg);
  border: 1px solid var(--t-input-bdr);
  border-radius: 24px;
  flex-shrink: 0;
}

.ai-chat-input {
  width: 100%;
  max-height: 120px;
  border: none;
  outline: none;
  resize: none;
  background: none;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--t-text);
  padding: 6px 4px;
}
.ai-chat-input::placeholder { color: var(--t-text-3); }

.ai-chat-limit-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--t-text-2);
  margin: -6px 14px calc(env(safe-area-inset-bottom,14px) + 12px);
  flex-shrink: 0;
  display: none;
}
.ai-chat-limit-note.show { display: block; }
.ai-chat-limit-link {
  color: var(--t-text);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
}

.ai-chat-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 150ms, opacity 150ms;
}
.ai-icon-btn:active { transform: scale(.92); }

.ai-mic-btn {
  background: var(--t-hover);
  color: var(--t-text-2);
  font-size: 17px;
}
.ai-mic-btn:active { opacity: .7; }

@keyframes mic-pulse {
  0%,100% { box-shadow: 0 0 0 0   rgba(255,59,48,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(255,59,48,.0); }
}

.ai-mic-btn.listening {
  color: var(--red);
  background: rgba(255,59,48,.12);
  animation: mic-pulse 1.4s ease-out infinite;
}

.ai-send {
  background: var(--t-send-bg);
  color: var(--t-send-color);
  border-radius: 50%;
}
.ai-send:disabled {
  opacity: .35;
  pointer-events: none;
}


/* ── SOLID CTA ── */
.cta-liquid {
  background: var(--t-send-bg) !important;
  color: var(--t-send-color) !important;
  border: none !important;
  box-shadow: none !important;
  transition: transform 120ms ease, opacity 150ms ease !important;
}
.cta-liquid:hover {
  opacity: .85;
}
.cta-liquid:active { transform: scale(.97); }
.cta-liquid:disabled,
.cta-liquid.disabled {
  opacity: .35 !important;
  pointer-events: none;
}

.ai-status {
  min-height: 18px;
  padding: 4px 4px 0;
  font-size: 12px;
  letter-spacing: -.01em;
}

/* dots */
@keyframes blink {
  0%,80%,100% { opacity:.2; transform:scale(.75); }
  40%          { opacity:1;  transform:scale(1); }
}

.dots { display:inline-flex; gap:3px; align-items:center; }
.dot  { width:5px; height:5px; border-radius:50%; background:var(--label-3); animation:blink 1.2s ease-in-out infinite; }
.dot:nth-child(2) { animation-delay:.2s; }
.dot:nth-child(3) { animation-delay:.4s; }

/* ══════════════════════════════════
   TOAST
══════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom,20px) + 90px);
  left: 50%;
  transform: translateX(-50%) translateY(14px) scale(.92);
  background: rgba(20,20,22,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--t-text);
  padding: 11px 18px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.01em;
  opacity: 0;
  pointer-events: none;
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 40px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 260ms var(--spring);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ══════════════════════════════════
   ACTION SHEET
══════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--t-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms;
}
.overlay.open { opacity: 1; pointer-events: all; }

.asheet {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.94);
  width: 100%;
  max-width: 480px;
  padding: 0 10px;
  z-index: 210;
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms var(--spring), opacity 200ms;
}
.asheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: all; }

.asheet-card {
  background: var(--t-bg);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--t-border);
}

/* Detail section */
.asheet-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
  gap: 4px;
  border-bottom: 0.5px solid rgba(255,255,255,.07);
}

.ash-icon-wrap { margin-bottom: 14px; }

.ash-icon-wrap .tx-icon,
.ash-icon-wrap .tx-icon-brand {
  width: 64px;
  height: 64px;
  border: 1px solid var(--t-border);
}

.ash-icon-wrap .tx-icon svg { width: 24px; height: 24px; }
.ash-icon-wrap .tx-icon i.fi { font-size: 24px; }

.asheet-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.2px;
  text-align: center;
  color: var(--t-text);
}

.asheet-amt {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.4px;
  margin-top: 8px;
  color: var(--t-text);
}

.asheet-meta {
  font-size: 13px;
  color: var(--t-text-2);
  margin-top: 6px;
  text-align: center;
}

.asheet-meta-sep { opacity: .35; margin: 0 4px; }

.asheet-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: -.01em;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: var(--t-text);
  transition: background 120ms;
}
.asheet-btn + .asheet-btn { border-top: 0.5px solid rgba(255,255,255,.06); }
.asheet-btn:active { background: var(--t-hover); }
.asheet-btn i { font-size: 16px; width: 18px; text-align: center; color: var(--t-text-2); }
.asheet-btn.del    { color: var(--red); }
.asheet-btn.del i  { color: var(--red); }

.amount-input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: -.01em;
  color: var(--t-text);
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  border-radius: 14px;
  outline: none;
  text-align: center;
  transition: border-color 140ms;
}

.amount-input:focus { border-color: rgba(255,255,255,.3); }
.amount-input::placeholder { color: var(--t-text-3); }

/* Edit transaction form */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px 16px;
}

.edit-type-toggle {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 4px;
  background: var(--t-bg);
  border-radius: 14px;
}

.edit-type-btn {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: -.01em;
  color: var(--t-text-2);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 140ms, color 140ms;
}

.edit-type-btn.on { background: var(--t-card-alt); color: var(--t-text); }

.edit-input {
  width: 100%;
  padding: 15px 16px;
  font-size: 15.5px;
  font-weight: 500;
  font-family: var(--font);
  letter-spacing: -.01em;
  color: var(--t-text);
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  border-radius: 14px;
  outline: none;
  transition: border-color 140ms, background 140ms;
}

.edit-input:focus { border-color: rgba(255,255,255,.3); background: var(--t-card-alt); }
.edit-input::placeholder { color: var(--t-text-3); }

.edit-select {
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  cursor: pointer;
}
.edit-select option { background: var(--t-bg); color: var(--t-text); }

.asheet-cancel {
  display: block;
  width: 100%;
  padding: 17px;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  color: var(--t-text);
  border-radius: 24px;
  cursor: pointer;
  text-align: center;
  transition: background 120ms;
}
.asheet-cancel:active { background: var(--t-card-alt); }

/* ══════════════════════════════════
   AUTH PAGE
══════════════════════════════════ */
.auth-page {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 32px 24px calc(env(safe-area-inset-bottom,24px) + 24px);
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 40px;
}

.auth-app-icon {
  width: 72px; height: 72px;
  background: var(--label);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.auth-app-icon svg { color: var(--t-text); }

.auth-name   { font-size: 28px; font-weight: 800; letter-spacing: -.8px; }
.auth-tagline { font-size: 15px; color: var(--label-2); margin-top: 4px; }

/* Segment */
.seg {
  display: flex;
  background: var(--sep);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
  margin-bottom: 24px;
}

.seg-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: -.01em;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--label-2);
  transition: all 180ms var(--smooth);
}

.seg-btn.on {
  background: #fff;
  color: var(--label);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* Fields */
.field-group {
  background: var(--sep);
  border-radius: 13px;
  overflow: hidden;
  margin-bottom: 12px;
}

.field-row {
  display: flex;
  align-items: center;
  padding: 0 16px;
  min-height: 52px;
}

.field-row + .field-row { border-top: 0.5px solid rgba(60,60,67,.12); }

.field-lbl {
  font-size: 16px;
  color: var(--label);
  width: 96px;
  flex-shrink: 0;
}

.field-row input {
  flex: 1;
  border: none;
  background: none;
  font-size: 16px;
  font-family: var(--font);
  letter-spacing: -.01em;
  color: var(--label);
  outline: none;
  padding: 15px 0;
  min-width: 0;
}

.field-row input::placeholder { color: var(--label-3); }

.btn-fill {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: -.02em;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: var(--label);
  color: var(--t-text);
  transition: transform 100ms, opacity 120ms;
  margin-bottom: 10px;
}

.btn-fill:active  { transform: scale(.97); opacity: .88; }
.btn-fill:disabled { opacity: .45; pointer-events: none; }

.alert {
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  display: none;
}

.alert-err { background: rgba(255,59,48,.10); color: #CC1B10; }
.alert-ok  { background: rgba(52,199,89,.10); color: #1A8A36; }

/* ══════════════════════════════════
   SPINNER
══════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }

.spin {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2.5px solid transparent;
  border-top-color: var(--t-icon-color);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

/* ══════════════════════════════════
   PROFILE OVERLAY
══════════════════════════════════ */
.profile-view {
  padding: 8px 24px calc(env(safe-area-inset-bottom, 24px) + 20px);
}

.profile-avatar {
  width: 74px; height: 74px;
  border-radius: 50%;
  background: linear-gradient(145deg, #007AFF, #5856D6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 26px;
  font-weight: 800;
  color: var(--t-text);
  letter-spacing: -.5px;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.profile-name {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 4px;
}

.profile-email-lbl {
  text-align: center;
  font-size: 14px;
  color: var(--label-2);
  margin-bottom: 6px;
}

.profile-member {
  text-align: center;
  font-size: 13px;
  color: var(--label-3);
  margin-bottom: 24px;
}

/* ── Plan banner ── */
.plan-banner {
  background: linear-gradient(135deg, rgba(0,122,255,.1), rgba(88,86,214,.06));
  border: 1px solid rgba(0,122,255,.16);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 20px;
}

.plan-banner-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-banner-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  color: var(--t-text);
  font-size: 19px;
}

.plan-banner-info { flex: 1; min-width: 0; }

.plan-banner-label {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.plan-banner-sub {
  font-size: 12.5px;
  color: var(--label-2);
  margin-top: 2px;
}

.plan-banner-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--label);
  color: var(--t-text);
}

.plan-banner-cta {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: none;
  border-radius: 100px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  color: var(--t-text);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.1px;
  cursor: pointer;
  transition: transform 120ms, opacity 150ms;
}
.plan-banner-cta:active { transform: scale(.98); }

.plan-banner.is-paid {
  background: linear-gradient(135deg, rgba(52,199,89,.12), rgba(0,199,190,.06));
  border-color: rgba(52,199,89,.2);
}

.plan-banner.is-paid .plan-banner-icon {
  background: linear-gradient(135deg, #34C759, #00C7BE);
}

.plan-banner.is-paid .plan-banner-badge {
  background: linear-gradient(135deg, #34C759, #00C7BE);
  color: var(--t-text);
}

.plan-banner.is-paid .plan-banner-cta { display: none; }

/* ── Preference rows ── */
.pref-group {
  background: transparent;
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
}

.pref-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  background: transparent;
}

.pref-row-tap { cursor: pointer; }
.pref-row-tap:active { background: rgba(0,0,0,.05); }

.pref-icon {
  font-size: 18px;
  color: var(--t-text-2);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.pref-label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--t-text);
}

.pref-select {
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text-2);
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font);
  max-width: 160px;
  cursor: pointer;
  text-align: right;
  -webkit-appearance: none;
  appearance: none;
}

.pref-select option { background: var(--t-card-alt); color: var(--t-text); }

.pref-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text-2);
  margin-right: 4px;
  white-space: nowrap;
}

.pref-arrow {
  font-size: 14px;
  color: var(--t-text-2);
}

.pref-sep {
  height: 1px;
  background: var(--t-hover);
  margin-left: 49px;
}

/* Toggle switch */
.toggle-sw {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.toggle-sw input { display: none; }

.toggle-track {
  width: 50px; height: 30px;
  background: var(--label-3);
  border-radius: 15px;
  transition: background 240ms;
  position: relative;
  display: block;
}

.toggle-sw input:checked + .toggle-track { background: var(--green); }

.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform 240ms cubic-bezier(.34,1.56,.64,1);
}

.toggle-sw input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

/* Change password modal */
.chpw-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms;
  padding: 24px;
  will-change: opacity;
}

.chpw-overlay.open { opacity: 1; pointer-events: all; }

.chpw-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.chpw-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-bottom: 20px;
  text-align: center;
}

.chpw-input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  background: var(--t-bg-alt);
  font-size: 15px;
  font-family: var(--font);
  margin-bottom: 10px;
  outline: none;
}

.chpw-input:focus { background: var(--t-card); }

.chpw-err {
  font-size: 13px;
  color: var(--red);
  min-height: 18px;
  text-align: center;
  margin-bottom: 4px;
}

.chpw-btns {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.chpw-cancel, .chpw-submit {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 140ms;
}

.chpw-cancel { background: var(--t-bg-alt); color: var(--label); }
.chpw-submit { background: var(--blue); color: var(--t-text); }
.chpw-cancel:active, .chpw-submit:active { opacity: .75; }

.profile-signout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: -.02em;
  border: none;
  border-radius: 14px;
  background: rgba(255,59,48,.09);
  color: var(--red);
  cursor: pointer;
  transition: opacity 140ms;
}

.profile-signout:active { opacity: .7; }

/* ══════════════════════════════════
   DESKTOP
══════════════════════════════════ */
@media (min-width: 520px) {
  .app {
    border-left: 1px solid rgba(0,0,0,.04);
    border-right: 1px solid rgba(0,0,0,.04);
    box-shadow: 0 0 60px rgba(0,0,0,.04);
  }

  body { background: var(--t-bg); }
}

@media (min-width: 860px) {
  .bottom-nav { display: none !important; }
  .app-content.has-bottom-nav { padding-bottom: 0; }

  .dash-sidebar {
    display: none !important;
  }

  .app {
    max-width: 680px;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .app-content,
  .view-chat {
    padding-top: 8px;
  }

  #view-history,
  #view-charts,
  #view-payments {
    padding-top: 0;
  }

  /* Charts: two-column grid on desktop */
  .chart-view {
    max-width: 100%;
    padding-bottom: 40px;
  }
  .month-summary {
    padding: 0 20px 20px;
    gap: 12px;
  }
  .month-summary-item {
    background: transparent;
    border-radius: 14px;
    padding: 14px 18px;
  }
  .charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 0 8px;
  }
  .line-chart-wrap {
    padding: 0 12px 16px;
  }

  .balance-section,
  .app-content > div,
  .ai-chat-messages,
  .ai-welcome,
  .ai-chat-inputbar,
  .ai-chat-limit-note {
    max-width: 700px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* Charts view uses its own full-width two-column layout */
  #view-charts {
    max-width: 100%;
  }
}

/* ══════════════════════════════════
   ONBOARDING — action bar & components
══════════════════════════════════ */

/* ── Onboarding Modal ──────────────────────────── */
.ob-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--t-overlay);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  animation: obFadeIn 400ms ease;
}
.ob-modal-overlay.open { display: flex; }
@keyframes obFadeIn { from { opacity: 0; } to { opacity: 1; } }

.ob-modal {
  width: 92%;
  max-width: 420px;
  max-height: 88vh;
  background: var(--t-bg-alt);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  animation: obSlideUp 500ms cubic-bezier(.22,1,.36,1);
  display: flex;
  flex-direction: column;
}
@keyframes obSlideUp { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.ob-modal-progress {
  display: flex;
  gap: 6px;
  padding: 16px 24px 0;
}
.ob-modal-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.1);
  transition: background 400ms ease;
}
.ob-modal-dot.active { background: var(--t-text); }
.ob-modal-dot.done { background: var(--t-text-2); }

.ob-modal-body {
  padding: 28px 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.ob-m-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--t-text);
  margin: 0 auto 20px;
}

.ob-m-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--t-text);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.25;
}

.ob-m-sub {
  font-size: 14px;
  color: var(--t-text-2);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 24px;
}

.ob-m-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.ob-m-feat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--t-hover);
  border-radius: 14px;
  animation: obFeatIn 500ms cubic-bezier(.22,1,.36,1) both;
}
.ob-m-feat:nth-child(1) { animation-delay: 100ms; }
.ob-m-feat:nth-child(2) { animation-delay: 200ms; }
.ob-m-feat:nth-child(3) { animation-delay: 300ms; }
.ob-m-feat:nth-child(4) { animation-delay: 400ms; }
.ob-m-feat:nth-child(5) { animation-delay: 500ms; }
@keyframes obFeatIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }

.ob-m-feat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.ob-m-feat-text {
  font-size: 14px;
  color: var(--t-text);
  line-height: 1.4;
}
.ob-m-feat-text strong { color: var(--t-text); font-weight: 600; }

.ob-m-input-wrap {
  margin-bottom: 20px;
}
.ob-m-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--t-hover);
  font-family: var(--font);
  font-size: 16px;
  color: var(--t-text);
  outline: none;
  transition: border-color 200ms;
}
.ob-m-input:focus { border-color: rgba(255,255,255,.35); }
.ob-m-input::placeholder { color: var(--t-text-3); }

.ob-m-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--t-text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.ob-m-select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--t-hover);
  font-family: var(--font);
  font-size: 16px;
  color: var(--t-text);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.ob-m-select option { background: var(--t-bg-alt); color: var(--t-text); }

.ob-m-lang-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.ob-m-lang-btn {
  flex: 1;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--t-hover);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--t-text);
  cursor: pointer;
  transition: border-color 200ms, background 200ms, transform 150ms;
  text-align: center;
}
.ob-m-lang-btn:hover { background: var(--t-hover); border-color: rgba(255,255,255,.2); }
.ob-m-lang-btn:active { transform: scale(.97); }
.ob-m-lang-btn.selected { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.1); }

.ob-m-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: var(--t-text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  color: var(--t-bg);
  cursor: pointer;
  transition: background 200ms, transform 150ms;
}
.ob-m-btn:hover { background: var(--t-card); }
.ob-m-btn:active { transform: scale(.97); }
.ob-m-btn:disabled { opacity: .4; pointer-events: none; }

.ob-m-btn-skip {
  width: 100%;
  padding: 12px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--t-text-3);
  cursor: pointer;
  margin-top: 8px;
}

.ob-m-credits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--t-hover);
  border-radius: 14px;
  margin-bottom: 24px;
}
.ob-m-credits-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--t-text);
  line-height: 1;
}
.ob-m-credits-lbl {
  font-size: 13px;
  color: var(--t-text-2);
  line-height: 1.3;
}

.ob-m-demo {
  background: var(--t-hover);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ob-m-demo-cursor {
  width: 2px;
  height: 20px;
  background: #fff;
  border-radius: 1px;
  animation: obCursorBlink 1s steps(2) infinite;
  flex-shrink: 0;
}
@keyframes obCursorBlink { 0% { opacity: 1; } 100% { opacity: 0; } }
.ob-m-demo-text {
  font-size: 15px;
  color: var(--t-text);
  font-weight: 500;
}

/* Action bar sits above the input bar during onboarding */
#ob-actions-bar {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px 10px;
  flex-shrink: 0;
}

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

.ob-btn {
  flex: 1;
  min-width: 120px;
  padding: 13px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--t-card-alt);
  color: var(--t-text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  letter-spacing: -.01em;
  transition: background 140ms, transform 100ms;
  -webkit-tap-highlight-color: transparent;
}
.ob-btn:hover  { background: var(--t-card-alt); }
.ob-btn:active { transform: scale(.97); }
.ob-btn:disabled { opacity: .4; pointer-events: none; }

.ob-btn-primary {
  background: #007AFF;
  border-color: transparent;
}
.ob-btn-primary:hover { background: #0071e3; }

/* Currency picker inside action bar */
.ob-currency-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ob-currency-sel {
  width: 100%;
  padding: 12px 40px 12px 16px;
  background: var(--t-card-alt);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  color: var(--t-text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23636366' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.ob-currency-sel option { background: var(--t-bg-alt); color: var(--t-text); }

/* Rich content inside bot message bubbles */
.ob-examples {
  background: var(--t-bg-alt);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--t-border);
  margin: 6px 0 2px;
}

.ob-example-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ob-example-row:last-child { border-bottom: none; }

.ob-example-icon {
  font-size: 17px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.ob-example-text {
  font-size: 13.5px;
  color: var(--t-text-2);
  letter-spacing: -.01em;
  font-style: italic;
}

.ob-section-lbl {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--t-text-3);
  margin: 12px 0 5px;
}
.ob-section-lbl:first-child { margin-top: 2px; }

.ob-feature-list {
  background: var(--t-bg-alt);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--t-border);
  margin: 6px 0 2px;
}

.ob-feature-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ob-feature-row:last-child { border-bottom: none; }

.ob-feature-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.ob-feature-text { font-size: 14px; color: var(--t-text); letter-spacing: -.01em; }

.ob-img-placeholder {
  width: 100%; max-width: 280px;
  aspect-ratio: 16/9;
  background: var(--t-bg-alt);
  border: 1px solid var(--t-border);
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  color: var(--t-text-3); font-size: 13px;
  margin: 6px 0 2px;
}
.ob-img-placeholder i { font-size: 26px; }

.ob-img-wrap {
  max-width: 280px; margin: 6px 0 2px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--t-border);
}
.ob-img-wrap img { width: 100%; display: block; }

/* Inline actions inside bot message bubbles (onboarding) */
.ob-msg-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ob-inline-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ob-inline-chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--t-card-alt);
  color: #e5e5e7;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
  -webkit-tap-highlight-color: transparent;
}
.ob-inline-chip:hover { background: #333; border-color: rgba(255,255,255,.22); }
.ob-inline-chip:active { transform: scale(.97); }

.ob-inline-btn {
  align-self: flex-start;
  padding: 9px 22px;
  border-radius: 999px;
  border: none;
  background: #007AFF;
  color: var(--t-text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms, transform 100ms;
  -webkit-tap-highlight-color: transparent;
}
.ob-inline-btn:hover { background: #0071e3; }
.ob-inline-btn:active { transform: scale(.97); }

.ob-inline-currency-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
}

/* ── Financial Goals ─────────────────────────────────── */
#fin-goals-area,
#fin-goals-area-desktop {
  padding: 0 20px;
}
#fin-goals-area-desktop {
  padding: 20px 28px 32px;
  max-width: 560px;
}
.fin-goals-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--t-text);
  padding: 24px 0 18px;
}
.fin-goal-card {
  background: transparent;
  border: none;
  padding: 0 0 28px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 28px;
}
.fin-goal-card:last-child {
  border-bottom: none;
  padding-bottom: 8px;
  margin-bottom: 0;
}
.fin-goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.fin-goal-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--t-text);
}
.fin-goal-edit-btn {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  color: #007AFF;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
}
.fin-goal-amounts {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 8px;
}
.fin-goal-current {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: var(--t-text);
  line-height: 1;
}
.fin-goal-target {
  font-size: 13px;
  color: var(--t-text);
  text-align: right;
}
.fin-goal-bar-wrap {
  background: var(--t-hover);
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.fin-goal-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 700ms ease;
  min-width: 4px;
}
.fin-goal-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--t-text);
  line-height: 1.4;
}
.fin-goal-rec {
  font-size: 12px;
  color: var(--t-text-3);
  margin-top: 5px;
}
.fin-goal-no-target { padding: 2px 0; }
.fin-goal-no-target-lbl {
  font-size: 15px;
  color: var(--t-text-3);
}
.fin-goal-edit-wrap { margin-bottom: 14px; }
.fin-goal-edit-row { display: flex; flex-direction: column; gap: 10px; }
.fin-goal-input {
  -webkit-appearance: none;
  appearance: none;
  background: var(--t-bg-alt);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: var(--t-text);
  font-family: var(--font);
  font-size: 17px;
  padding: 11px 14px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
}
.fin-goal-input:focus { border-color: rgba(0,122,255,.6); }
.fin-goal-input::placeholder { color: var(--t-text-3); }
.fin-goal-edit-btns { display: flex; gap: 8px; }
.fin-goal-save-btn {
  -webkit-appearance: none;
  appearance: none;
  background: #007AFF;
  border: none;
  border-radius: 20px;
  color: var(--t-text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 22px;
  cursor: pointer;
  transition: background 120ms;
}
.fin-goal-save-btn:hover { background: #0071e3; }
.fin-goal-cancel-btn {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  color: var(--t-text-3);
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 4px;
  cursor: pointer;
}
@media (min-width: 860px) {
  #fin-goals-area { display: none; }
}

/* ── Onboarding: demo typing bubble ─────────────────── */
.ob-demo-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--t-card-alt);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0 6px;
  white-space: normal;
  min-height: 44px;
}
.ob-demo-text {
  flex: 1;
  font-size: 15px;
  font-family: var(--font);
  color: var(--t-text);
  letter-spacing: -.01em;
  line-height: 1.4;
  word-break: break-word;
  min-width: 0;
}
.ob-demo-cursor {
  display: inline-block;
  width: 2px;
  height: 17px;
  background: #007AFF;
  border-radius: 1px;
  flex-shrink: 0;
  align-self: center;
  animation: ob-blink 1s step-end infinite;
}
@keyframes ob-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.ob-demo-hint {
  font-size: 13px;
  color: var(--t-text-3);
  margin: 4px 0 8px;
  white-space: normal;
  line-height: 1.4;
}
/* ── Onboarding: goal selector ───────────────────────── */
.ob-sel-table {
  background: var(--t-bg-alt);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--t-border);
  margin: 4px 0 2px;
  white-space: normal;
}
.ob-sel-row {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: var(--t-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.2;
  white-space: normal;
  text-align: left;
  cursor: pointer;
  transition: background 120ms;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.ob-sel-row:last-child { border-bottom: none; }
.ob-sel-row:hover  { background: var(--t-hover); }
.ob-sel-row:active { background: rgba(255,255,255,.09); }
.ob-sel-icon  { font-size: 16px; color: var(--t-text-2); flex-shrink: 0; }
.ob-sel-title { flex: 1; }
.ob-sel-arrow { font-size: 11px; color: var(--t-text-3); flex-shrink: 0; }
/* ── Onboarding: text / number inputs ───────────────── */
.ob-inline-input-wrap,
.ob-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
}
.ob-inline-input {
  -webkit-appearance: none;
  appearance: none;
  background: var(--t-card-alt);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: var(--t-text);
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.ob-inline-input::placeholder { color: var(--t-text-3); }
.ob-inline-input:focus { border-color: rgba(0,122,255,.6); }
/* ── Onboarding: sub-text ────────────────────────────── */
.ob-sub-text {
  font-size: 13px;
  color: var(--t-text-2);
  margin: 4px 0 0;
  line-height: 1.4;
  white-space: normal;
}

/* ── Onboarding: credits progress bar ───────────────── */
.ob-credits-wrap {
  margin: 16px 0 4px;
  background: var(--t-hover);
  border-radius: 14px;
  padding: 14px 16px;
  max-width: 280px;
}
.ob-credits-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--t-text-2);
}
.ob-credits-count {
  font-size: 22px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -.5px;
  text-transform: none;
}
.ob-credits-track {
  background: rgba(255,255,255,.1);
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
}
.ob-credits-fill {
  height: 100%;
  background: #007AFF;
  border-radius: 4px;
  animation: ob-credits-in 700ms cubic-bezier(.22,1,.36,1) 300ms both;
}
@keyframes ob-credits-in {
  from { width: 0 !important; }
  to   { /* inherits inline width */ }
}
.ob-credits-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--t-text-3);
}

/* ══════════════════════════════════
   THEME-AWARE COMPONENTS
══════════════════════════════════ */
.top-bar              { background: var(--t-bg); }
.brand-name           { color: var(--t-text); }
.menu-toggle          { color: var(--t-text); background: var(--t-card-alt); }
.balance-section      { background: var(--t-bg); }
.balance-num          { color: var(--t-text); }
.app-content          { background: var(--t-bg); }
.tx-row               { background: transparent; }
.tx-row:active        { background: var(--t-hover); }
.tx-name              { color: var(--t-text); }
.tx-amt               { color: var(--t-text); }
.tx-cat-lbl           { color: var(--t-text-3); }
.tx-date              { color: var(--t-text-3); }
.tx-sep               { background: var(--t-border); }
.empty-icon           { background: none; color: var(--t-text-3); }
.empty-title          { color: var(--t-text-3); }
.empty-body           { color: var(--t-text-3); }
.donut-hole-amt       { color: var(--t-text); }
.donut-hole-lbl       { color: var(--t-text-3); }
.donut-hole-pct       { color: var(--t-text-3); }
.donut-bg-ring        { stroke: var(--t-card-alt); }
.cat-legend           { border-color: var(--t-border); }
.legend-row:hover,
.legend-row.active    { background: var(--t-hover); }
.legend-name          { color: var(--t-text); }
.legend-amt           { color: var(--t-text); }
.pay-summary-lbl      { color: var(--t-text-3); }
.pay-summary-amt      { color: var(--t-text); }
.chart-empty          { color: var(--t-text-3); }
.month-nav-btn        { background: var(--t-card-alt); color: var(--t-text); }
.goal-progress-wrap   { background: var(--t-card-alt); }
.month-nav-label      { color: var(--t-text); }
.line-legend-item     { color: var(--t-text-3); }

/* ── VOICE OVERLAY ── */
.vo-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--t-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top,18px) + 18px) 24px calc(env(safe-area-inset-bottom,24px) + 24px);
  will-change: opacity;
}
.vo-overlay.open { opacity: 1; pointer-events: all; }

.vo-top {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--t-text-3);
}

.vo-top-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34C759;
  box-shadow: 0 0 0 0 rgba(52,199,89,.5);
  animation: voDot 1.6s ease-out infinite;
}

@keyframes voDot {
  0%   { box-shadow: 0 0 0 0 rgba(52,199,89,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(52,199,89,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); }
}

.vo-mid {
  flex: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  min-height: 0;
  overflow: hidden;
}

.vo-orb-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
  transition: transform 300ms ease;
}

.vo-orb-wrap::before {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23,82,240,.08) 0%, transparent 70%);
  animation: voPulse1 2.2s ease-out infinite;
}

.vo-orb-wrap::after {
  content: '';
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23,82,240,.04) 0%, transparent 70%);
  animation: voPulse2 2.2s ease-out infinite .5s;
}

@keyframes voPulse1 {
  0%   { transform: scale(.85); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}
@keyframes voPulse2 {
  0%   { transform: scale(.8); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.vo-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  animation: orbBreathe 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(23,82,240,.15));
}
.vo-orb.vo-orb-active {
  animation: orbPulseActive .6s ease-in-out infinite alternate;
}
@keyframes orbBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes orbPulseActive {
  0% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(23,82,240,.15)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 30px rgba(23,82,240,.3)); }
}

.vo-transcript-wrap {
  width: 100%;
  flex: 1;
  min-height: 40px;
  max-height: 40vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vo-transcript-wrap::-webkit-scrollbar { display: none; }

.vo-transcript {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.5px;
  line-height: 1.4;
  color: var(--t-text);
  width: 100%;
  word-break: break-word;
}

.vo-transcript.placeholder { color: var(--t-text-3); font-weight: 500; }

.vo-transcript-input {
  width: 100%;
  min-height: 60px;
  max-height: 100%;
  resize: none;
  border: none;
  outline: none;
  background: none;
  font-family: var(--font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.5px;
  line-height: 1.4;
  color: var(--t-text);
  text-align: center;
  display: none;
  word-break: break-word;
  scrollbar-width: none;
}
.vo-transcript-input::-webkit-scrollbar { display: none; }

.vo-transcript-input.show { display: block; }
.vo-transcript-wrap.editing .vo-transcript { display: none; }
.vo-transcript-wrap.editing {
  align-items: flex-start;
}

.vo-bottom {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.vo-action {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 140ms;
}
.vo-action:active { opacity: .6; }

.vo-action-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background 140ms, transform 140ms;
}
.vo-action-icon:active { transform: scale(.92); }

.vo-edit .vo-action-icon {
  background: #1752f015;
  color: #1752f0;
  border: none;
}
.vo-cancel .vo-action-icon {
  background: #FF3B3015;
  color: #FF3B30;
  border: none;
}
.vo-action.send .vo-action-icon {
  width: 68px; height: 68px;
  background: #1752f0;
  color: #fff;
  font-size: 26px;
  border: none;
  box-shadow: 0 4px 20px rgba(23,82,240,.3);
}

.vo-action.send:disabled,
.vo-action.send.disabled {
  pointer-events: none;
  opacity: .35;
}

.profile-name         { color: var(--t-text); }
.profile-email-lbl    { color: var(--t-text-2); }
.profile-member       { color: var(--t-text-3); }
.plan-banner-label    { color: var(--t-text); }
.plan-banner-sub      { color: var(--t-text-2); }
.pref-row-tap:active  { background: var(--t-hover); }
.chpw-card            { background: var(--t-card-alt); }
.chpw-title           { color: var(--t-text); }
.chpw-input           { background: var(--t-card); color: var(--t-text); }
.chpw-input:focus     { background: var(--t-card-alt); }
.chpw-cancel          { background: var(--t-card); color: var(--t-text); }
.toast                { background: var(--t-card-alt); color: var(--t-text); }

/* ── AUTH MODAL ──────────────────────────────────────────── */
.auth-overlay { position: fixed; inset: 0; z-index: 900; background: var(--t-overlay); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 220ms; padding: 24px; will-change: opacity; }
.auth-overlay.open { opacity: 1; pointer-events: all; }
.auth-modal { position: relative; width: 100%; max-width: 380px; max-height: calc(100svh - 48px); overflow-y: auto; background: var(--t-bg-alt); border: 1px solid var(--t-border); border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.auth-modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--t-card-alt); color: var(--t-text); font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1; }
.auth-modal-close:active { transform: scale(.92); }
.auth-modal-body { padding: 36px 28px 28px; display: flex; flex-direction: column; align-items: center; }
.am-logo { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 16px; }
.am-title { font-size: 22px; font-weight: 400; letter-spacing: -.5px; color: var(--t-text); margin: 0 0 6px; text-align: center; }
.am-sub { font-size: 14px; color: var(--t-text-2); margin: 0 0 22px; text-align: center; }
.am-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.am-field-wrap { position: relative; width: 100%; }
.am-field-wrap i.am-field-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--t-text-3); font-size: 16px; pointer-events: none; }
.am-field { width: 100%; height: 48px; padding: 0 16px 0 42px; border-radius: 100px; border: 1.5px solid var(--t-border); background: var(--t-input-bg); font-family: var(--font); font-size: 14.5px; color: var(--t-text); transition: border-color 150ms, box-shadow 150ms; }
.am-field.am-has-toggle { padding-right: 42px; }
.am-field::placeholder { color: var(--t-text-3); }
.am-field:focus { outline: none; border-color: var(--t-text); box-shadow: 0 0 0 4px var(--t-hover); }
.am-pw-toggle { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--t-text-3); font-size: 16px; cursor: pointer; padding: 4px; display: flex; align-items: center; }
.am-pw-toggle:hover { color: var(--t-text); }
.am-pw-strength { display: none; align-items: center; gap: 8px; margin-top: -2px; padding: 0 4px; }
.am-pw-strength.show { display: flex; }
.am-pw-strength-bars { display: flex; gap: 4px; flex: 1; }
.am-pw-strength-bars span { height: 4px; flex: 1; border-radius: 2px; background: var(--t-card-alt); transition: background 150ms; }
.am-pw-strength-label { font-size: 12px; color: var(--t-text-3); white-space: nowrap; }
.am-pw-strength.weak .am-pw-strength-bars span:nth-child(1) { background: #FF453A; }
.am-pw-strength.weak .am-pw-strength-label { color: #FF453A; }
.am-pw-strength.medium .am-pw-strength-bars span:nth-child(1), .am-pw-strength.medium .am-pw-strength-bars span:nth-child(2) { background: #FF9F0A; }
.am-pw-strength.medium .am-pw-strength-label { color: #FF9F0A; }
.am-pw-strength.strong .am-pw-strength-bars span { background: #34C759; }
.am-pw-strength.strong .am-pw-strength-label { color: #34C759; }
.am-submit { width: 100%; height: 48px; margin-top: 2px; border: none; border-radius: 100px; background: var(--t-text); color: var(--t-bg); font-family: var(--font); font-size: 15px; font-weight: 400; cursor: pointer; transition: transform 120ms, opacity 150ms; }
.am-submit:active { transform: scale(.98); }
.am-submit:disabled { opacity: .6; pointer-events: none; }
.am-divider { display: flex; align-items: center; gap: 12px; width: 100%; margin: 20px 0; color: var(--t-text-3); font-size: 12.5px; font-weight: 400; text-transform: uppercase; letter-spacing: .5px; }
.am-divider::before, .am-divider::after { content: ''; flex: 1; height: 1px; background: var(--t-border); }
.am-google-btn { width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 14px; border: 1.5px solid var(--t-border); background: var(--t-card-alt); font-family: var(--font); font-size: 14.5px; font-weight: 400; color: var(--t-text); cursor: pointer; transition: transform 120ms, border-color 150ms; }
.am-google-btn:hover { border-color: var(--t-border); }
.am-google-btn:active { transform: scale(.98); }
.am-google-btn:disabled { opacity: .6; pointer-events: none; }
.am-switch { margin-top: 20px; font-size: 14px; color: #9A9AA0; text-align: center; }
.am-switch button { border: none; background: none; color: var(--t-text); font-family: var(--font); font-size: 14px; font-weight: 400; cursor: pointer; padding: 0; text-decoration: underline; }
.am-alert { width: 100%; margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: rgba(255,59,48,.08); color: #FF453A; font-size: 13px; font-weight: 400; display: none; }
.am-success { width: 100%; margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: rgba(52,199,89,.10); color: #34C759; font-size: 13px; font-weight: 400; display: none; }

/* ── PLANS MODAL ─────────────────────────────────────────── */
.plans-overlay { position: fixed; inset: 0; z-index: 900; background: var(--t-overlay); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 220ms; padding: 20px; will-change: opacity; }
.plans-overlay.open { opacity: 1; pointer-events: all; }
.plans-modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--t-card-alt); color: var(--t-text); font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; flex-shrink: 0; }
.plans-modal-close:active { transform: scale(.92); }
.plans-modal { position: relative; width: 100%; max-width: 880px; background: var(--t-bg-alt); border: 1.5px solid var(--t-border); border-radius: 26px; padding: 32px 28px 28px; max-height: 90vh; overflow-y: auto; }

.plans-modal-head { text-align: center; margin: 0 auto 28px; }
.plans-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.plans-brand img { width: 36px; height: 36px; border-radius: 10px; }
.plans-brand span { font-size: 18px; font-weight: 400; letter-spacing: -.4px; color: var(--t-text); }
.plans-pro-badge { font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 4px 10px; border-radius: 100px; color: #000 !important; background: #fff; }
.plans-title { font-size: 30px; font-weight: 400; letter-spacing: -1px; color: var(--t-text); margin: 0 0 8px; }
.plans-sub { font-size: 15px; line-height: 1.6; color: #9A9AA0; margin: 0 auto; max-width: 440px; }
.plans-overlay .current-plan-badge { display: inline-flex; align-items: center; gap: 8px; margin: 14px auto 0; padding: 8px 18px; border-radius: 100px; border: 1px solid var(--t-border); background: var(--t-bg-alt); font-size: 13.5px; color: var(--t-text); }
.plans-toast { max-width: 560px; margin: 0 auto 24px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--t-border); background: var(--t-bg-alt); font-size: 14px; color: var(--t-text); text-align: center; display: none; }
.plans-toast.show { display: block; }

/* Plan selector */
.plan-select-group { display: flex; flex-direction: column; gap: 12px; max-width: 440px; margin: 0 auto 44px; }
.plan-select { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1.5px solid var(--t-border); background: var(--t-bg-alt); cursor: pointer; transition: border-color 150ms, background 150ms; }
.plan-select.selected { border-color: #fff; background: var(--t-card-alt); }
.plan-select-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #5C5C60; flex-shrink: 0; position: relative; }
.plan-select.selected .plan-select-radio { border-color: #fff; }
.plan-select.selected .plan-select-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #fff; }
.plan-select-label { font-size: 15px; color: var(--t-text); }

/* Section titles & feature blocks */
.plans-section-title { font-size: 22px; font-weight: 400; letter-spacing: -.4px; color: var(--t-text); text-align: center; margin: 56px auto 20px; max-width: 520px; }
.plans-feat-list { list-style: none; display: flex; flex-direction: column; gap: 14px; max-width: 440px; margin: 0 auto; padding: 0; }
.plans-feat-list li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--t-text); }
.plans-feat-list li::before { content: '\e430'; font-family: 'uicons-regular-rounded'; font-weight: 400; flex-shrink: 0; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; color: var(--t-text); font-size: 14px; }

.plans-feature-block { max-width: 480px; margin: 0 auto; text-align: center; }
.plans-img-placeholder { width: 100%; aspect-ratio: 1; max-width: 280px; margin: 20px auto; border-radius: 20px; background: var(--t-bg-alt); border: 1px solid var(--t-border); display: flex; align-items: center; justify-content: center; }
.plans-img-placeholder i { font-size: 48px; color: #3A3A3C; }
.plans-img-placeholder.small { max-width: 140px; margin: 0 auto 16px; }
.plans-body { font-size: 15px; line-height: 1.65; color: #9A9AA0; margin: 10px 0; }
.plans-quote { display: inline-block; margin: 14px auto; padding: 10px 18px; border-radius: 14px; background: var(--t-bg-alt); border: 1px solid var(--t-border); color: var(--t-text); font-size: 14px; }

/* Comparison */
.plans-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 480px; margin: 0 auto; }
.plans-compare-card { background: var(--t-bg-alt); border: 1.5px solid var(--t-border); border-radius: 20px; padding: 22px 18px; text-align: center; }
.plans-compare-card.highlight { border-color: #fff; }
.plans-compare-head { font-size: 15px; font-weight: 400; color: var(--t-text); margin-bottom: 4px; }
.plans-compare-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.plans-compare-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #9A9AA0; line-height: 1.4; }
.plans-compare-list.check li::before { content: '✓'; color: #34C759; flex-shrink: 0; font-weight: 700; }
.plans-compare-list.cross li::before { content: '✗'; color: #FF453A; flex-shrink: 0; font-weight: 700; }

/* Testimonials */
.plans-testimonials { display: flex; flex-direction: column; gap: 14px; max-width: 460px; margin: 0 auto; }
.plans-testimonial { background: var(--t-bg-alt); border: 1px solid var(--t-border); border-radius: 18px; padding: 20px; text-align: center; }
.plans-stars { color: #FFD60A; font-size: 16px; margin-bottom: 10px; letter-spacing: 2px; }
.plans-testimonial p { font-size: 14.5px; color: var(--t-text); font-style: italic; margin: 0; }

/* FAQ */
.plans-faq { display: flex; flex-direction: column; gap: 18px; max-width: 520px; margin: 0 auto; }
.plans-faq-item { padding-bottom: 16px; border-bottom: 1px solid #1F1F1F; }
.plans-faq-q { font-size: 15px; color: var(--t-text); margin-bottom: 6px; }
.plans-faq-a { font-size: 14px; color: #9A9AA0; line-height: 1.55; }

/* Start section */
.plans-start { text-align: center; max-width: 440px; margin: 56px auto 0; }
.plans-start p { font-size: 15px; color: #9A9AA0; margin: 4px 0; }

/* Plan cards grid */
.plan-cards-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin: 0 auto; padding-bottom: 4px; }
.plan-card { background: var(--t-bg); border: 1.5px solid var(--t-border); border-radius: 22px; padding: 24px 18px; display: flex; flex-direction: column; gap: 16px; }
#plan-card-free { background: var(--t-bg); }
.plan-card-featured { border-color: var(--t-text); }
.plan-card-name { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9A9AA0; }
.plan-card-price { font-size: 44px; font-weight: 700; letter-spacing: -2px; color: var(--t-text); line-height: 1; }
.plan-card-period { font-size: 15px; font-weight: 400; color: #9A9AA0; letter-spacing: 0; }
.plan-card-btn { height: 46px; }
.plan-card-btn-current { height: 46px; background: transparent !important; border: 1.5px solid var(--t-border) !important; color: var(--t-text-2) !important; cursor: default; pointer-events: none; border-radius: 100px; font-family: var(--font); font-size: 15px; font-weight: 400; display: flex; align-items: center; justify-content: center; width: 100%; }
.plan-card-features { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 10px; }
.plan-card-features li { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--t-text); line-height: 1.4; }
.plan-card-features li i { color: var(--t-text); font-size: 12px; flex-shrink: 0; margin-top: 1px; }
@media (max-width: 660px) { .plan-cards-grid { grid-template-columns: 1fr; } }
.plans-legal { font-size: 11.5px; color: #5C5C60; line-height: 1.6; text-align: center; margin: 20px 0 0; padding: 0 4px; }
.plans-legal-link { color: #9A9AA0; text-decoration: underline; text-underline-offset: 2px; }
.plans-legal-link:hover { color: var(--t-text); }

.price-cta { border-radius: 100px; border: none; font-family: var(--font); font-size: 15px; font-weight: 400; cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; width: 100%; transition: transform 120ms, opacity 150ms; background: #fff; color: #000; }
.price-cta:active { transform: scale(.97); }
.price-cta:hover { opacity: .88; }
.price-cta:disabled { opacity: .6; pointer-events: none; }

@media (max-width: 480px) {
  .plans-compare-grid { gap: 10px; }
  .plans-section-title { font-size: 19px; }
}

/* ── PRO WELCOME / MANAGE SUBSCRIPTION MODALS ── */
.pro-welcome-overlay, .manage-sub-overlay { z-index: 950; background: var(--t-overlay); }
.pro-welcome-card, .manage-sub-card {
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  max-width: 400px;
  padding: 32px 26px;
  text-align: center;
  position: relative;
  border-radius: 26px;
}
.pro-welcome-logo {
  width: 72px; height: 72px; margin: 0 auto 20px;
}
.pro-welcome-logo img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.manage-sub-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--t-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--t-text); margin: 0 auto 18px;
}
.pro-welcome-title, .manage-sub-title {
  font-size: 21px; font-weight: 400; letter-spacing: -.4px; color: var(--t-text);
  margin-bottom: 8px;
}
.pro-welcome-sub {
  font-size: 14.5px; color: #9A9AA0; margin-bottom: 22px; line-height: 1.5;
}
.pro-welcome-feat-list { text-align: left; margin-bottom: 24px; gap: 12px; }
.pro-welcome-feat-list li { font-size: 14px; }
.pro-welcome-card .price-cta, .manage-sub-card .price-cta { height: 50px; }

.manage-sub-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 400; padding: 5px 12px; border-radius: 100px;
  background: var(--t-hover); color: var(--t-text); margin-bottom: 14px;
}
.manage-sub-status.cancelled { background: rgba(255,159,10,.15); color: #FF9F0A; }
.manage-sub-status.active { background: rgba(48,209,88,.15); color: #30D158; }

.manage-sub-renew {
  font-size: 14.5px; color: #9A9AA0; margin-bottom: 22px;
}
.manage-sub-card .price-cta { margin-bottom: 12px; }
.modal-text-btn {
  width: 100%; height: 44px; border-radius: 100px; border: none;
  background: transparent; color: #9A9AA0; font-family: var(--font);
  font-size: 14.5px; cursor: pointer; transition: opacity 140ms;
}
.modal-text-btn:hover { opacity: .8; }
.manage-sub-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; font-size: 16px;
}

/* ── SUBSCRIPTION EXPIRED FULL-SCREEN LOCK ── */
.sub-expired-overlay {
  position: fixed; inset: 0; z-index: 980;
  background: var(--t-bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 220ms;
  padding: 24px;
}
.sub-expired-overlay.open { opacity: 1; pointer-events: all; }
.sub-expired-content {
  max-width: 380px; text-align: center;
}
.sub-expired-content .price-cta { height: 50px; margin-bottom: 12px; }

/* brand always visible in top-bar */

/* ─── Data Controls / Account Management modals ─────────── */
.dc-card {
  width: min(400px, calc(100vw - 40px));
  padding: 0;
  overflow: hidden;
}
.dc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
}
.dc-card-title {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -.3px;
  color: var(--t-text);
}
.dc-card-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--t-text);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms;
  flex-shrink: 0;
}
.dc-card-close:hover { background: rgba(255,255,255,.18); }
.dc-action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 120ms;
  border-top: 1px solid rgba(255,255,255,.07);
}
.dc-action-row:hover { background: var(--t-hover); }
.dc-action-row:active { background: var(--t-hover); }
.dc-action-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.dc-action-icon.red    { background: rgba(255,59,48,.15);  color: #FF453A; }
.dc-action-icon.blue   { background: rgba(10,132,255,.15); color: #0A84FF; }
.dc-action-icon.green  { background: rgba(52,199,89,.15);  color: #34C759; }
.dc-action-icon.orange { background: rgba(255,149,0,.15);  color: #FF9500; }
.dc-action-body { flex: 1; min-width: 0; }
.dc-action-label {
  font-size: 15px;
  font-weight: 400;
  color: var(--t-text);
}
.dc-action-label.danger { color: #FF453A; }
.dc-action-sub {
  font-size: 12.5px;
  color: #9A9AA0;
  margin-top: 2px;
}
.dc-action-arrow { color: #48484A; font-size: 13px; flex-shrink: 0; }

/* ── PROFILE DROPDOWN ── */
.prof-dd {
  position: fixed;
  z-index: 600;
  width: 268px;
  background: var(--t-bg-alt);
  border: 1px solid var(--t-border);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
  padding: 6px;
}
@keyframes profDdIn {
  from { opacity: 0; transform: scale(.94) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.prof-dd.open { animation: profDdIn 180ms cubic-bezier(.22,1,.36,1) both; }
#prof-dd-backdrop {
  position: fixed; inset: 0; z-index: 599;
}
.prof-dd-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 8px;
}
.prof-dd-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--t-card-alt); color: var(--t-text); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.prof-dd-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.prof-dd-info { min-width: 0; }
.prof-dd-name { font-size: 14px; font-weight: 600; color: var(--t-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prof-dd-email { font-size: 11.5px; color: var(--t-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.prof-dd-sep { height: 1px; background: var(--t-border); margin: 4px 4px; }
.prof-dd-credits { padding: 8px 10px 6px; }
.prof-dd-credits-lbl { font-size: 12px; color: var(--t-text); margin-bottom: 6px; }
.prof-dd-credits-bar { height: 3px; background: var(--t-card-alt); border-radius: 2px; overflow: hidden; }
.prof-dd-credits-fill { height: 100%; background: var(--t-text); border-radius: 2px; transition: width 400ms; }
.prof-dd-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; border: none;
  background: none; color: var(--t-text); font-family: var(--font); font-size: 13.5px; font-weight: 400;
  text-align: left; cursor: pointer; transition: background 120ms;
}
.prof-dd-item:hover { background: var(--t-hover); }
.prof-dd-item i { font-size: 14px; color: var(--t-text-2); flex-shrink: 0; width: 16px; text-align: center; }
.prof-dd-item-danger { color: #FF453A; }
.prof-dd-item-danger i { color: #FF453A; }

.prof-dd-theme {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; gap: 8px;
}
.prof-dd-theme-label {
  font-size: 13.5px; color: var(--t-text); display: flex; align-items: center; gap: 8px;
}
.prof-dd-theme-label i { font-size: 14px; color: var(--t-text-2); width: 16px; text-align: center; }
.prof-dd-theme-pills {
  display: flex; gap: 2px; background: var(--t-card-alt); border-radius: 8px; padding: 2px;
}
.prof-dd-theme-pill {
  width: 32px; height: 28px; border-radius: 6px; border: none;
  background: none; color: var(--t-text-3); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 150ms, color 150ms;
}
.prof-dd-theme-pill:hover { color: var(--t-text); }
.prof-dd-theme-pill.active {
  background: var(--t-bg); color: var(--t-text);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.prof-dd-lang-pill {
  width: 36px; height: 28px; border-radius: 6px; border: none;
  background: none; color: var(--t-text-3);
  font-family: var(--font); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 150ms, color 150ms;
}
.prof-dd-lang-pill:hover { color: var(--t-text); }
.prof-dd-lang-pill.active {
  background: var(--t-bg); color: var(--t-text);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.prof-dd-currency-select {
  height: 28px; padding: 0 6px; border-radius: 6px;
  border: 1px solid var(--t-border); background: var(--t-card-alt);
  font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--t-text); cursor: pointer; outline: none;
}

/* ── CUENTA MODAL ── */
.cuenta-card {
  width: calc(100% - 48px);
  max-width: 400px;
  max-height: calc(100svh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.cuenta-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cuenta-header .chpw-title { margin: 0; }
/* ── REPORT MODAL TEXTAREA ── */
.report-ta {
  width: 100%;
  min-height: 110px;
  background: #333;
  border: 1.5px solid var(--t-border);
  border-radius: 14px;
  color: var(--t-text);
  font-family: var(--font);
  font-size: 14px;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 150ms;
}
.report-ta::placeholder { color: var(--t-text-3); }
.report-ta:focus { outline: none; border-color: #555; }

/* ══════════════════════════════════
   CHAT — RESPONSIVE IMPROVEMENTS
══════════════════════════════════ */

/* Mobile-first: comfortable spacing */
@media (max-width: 540px) {
  .ai-chat-messages {
    padding: 12px 12px 8px;
    gap: 16px;
  }

  .ai-msg-user {
    max-width: 88%;
    font-size: 15px;
    padding: 10px 14px;
  }

  .ai-msg-bot .ai-msg-text {
    font-size: 15px;
    line-height: 1.55;
  }

  /* Input bar: tighter margin on small screens */
  .ai-chat-inputbar {
    margin: 0 10px calc(env(safe-area-inset-bottom, 10px) + 10px);
    padding: 10px 12px;
    border-radius: 22px;
  }

  .ai-chat-input {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 4px 2px;
  }

  .ai-chat-limit-note {
    margin: -4px 10px calc(env(safe-area-inset-bottom, 10px) + 8px);
  }

  .ai-welcome {
    padding: 16px 16px;
  }

  /* Record cards */
  .ai-records {
    border-radius: 14px;
  }

  .ai-record-row {
    padding: 8px 8px;
    gap: 10px;
  }

  /* Widget */
  .chat-widget {
    border-radius: 16px;
  }

  /* Onboarding actions bar */
  #ob-actions-bar {
    margin: 0 10px;
  }
}

/* Tablet / small desktop: comfortable max-width */
@media (min-width: 541px) and (max-width: 859px) {
  .ai-chat-messages {
    padding: 16px 16px;
    gap: 20px;
  }

  .ai-chat-inputbar {
    margin: 0 16px calc(env(safe-area-inset-bottom, 12px) + 12px);
  }
}

/* Desktop: constrain width and center, comfortable reading */
@media (min-width: 860px) {
  .ai-chat-messages {
    padding: 24px 0;
    gap: 24px;
  }

  .ai-chat-inputbar {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: calc(env(safe-area-inset-bottom, 16px) + 16px);
  }

  .ai-msg-user {
    max-width: 72%;
  }

  .ai-chat-input {
    font-size: 15px;
  }
}

/* ══════════════════════════════════
   RICH AI CONTENT COMPONENTS
══════════════════════════════════ */
.aic { display: flex; flex-direction: column; gap: 10px; animation: cardReveal 450ms cubic-bezier(.22,1,.36,1) both; animation-delay: 250ms; }
.aic:empty { display: none; }
.aic-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.aic-suggestions:empty { display: none; }

/* Inline text */
.aic-text { font-size: 15px; line-height: 1.6; color: var(--t-text); word-break: break-word; }
.aic-text strong { font-weight: 600; }
.aic-text em { font-style: italic; color: #e5e5ea; }
.aic-text del { opacity: .5; }
.aic-ic { font-family: ui-monospace,monospace; font-size: 13px; background: rgba(255,255,255,.1); border-radius: 4px; padding: 1px 5px; color: #e5e5ea; }
.aic-bq { display: block; border-left: 2.5px solid #007AFF; padding: 2px 0 2px 12px; color: #a8a8b0; font-style: italic; margin: 2px 0; }

/* Divider */
.aic-divider { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 2px 0; }

/* List */
.aic-list { display: flex; flex-direction: column; gap: 7px; }
.aic-li { display: flex; align-items: flex-start; gap: 9px; font-size: 15px; line-height: 1.5; color: var(--t-text); }
.aic-li-dot { flex-shrink:0; width:6px; height:6px; border-radius:50%; background:#007AFF; margin-top:8px; }
.aic-li-num { flex-shrink:0; font-size:13px; font-weight:600; color:#007AFF; min-width:20px; line-height:1.5; padding-top:2px; }
.aic-li-chk { flex-shrink:0; width:17px; height:17px; border-radius:5px; border:1.5px solid rgba(255,255,255,.25); margin-top:1px; display:flex; align-items:center; justify-content:center; font-size:10px; }
.aic-li-chk.done { background:#34C759; border-color:#34C759; color: var(--t-text); }
.aic-li-text { flex:1; }
.aic-li-text.done { text-decoration:line-through; opacity:.45; }

/* Table */
.aic-tbl-wrap { overflow-x:auto; border-radius:12px; background: var(--t-hover); border: 1px solid var(--t-border); }
.aic-tbl { width:100%; border-collapse:collapse; font-size:13.5px; }
.aic-tbl th { padding:9px 14px; text-align:left; font-size:11px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color: var(--t-text-3); border-bottom:1px solid rgba(255,255,255,.08); white-space:nowrap; }
.aic-tbl td { padding:9px 14px; color: var(--t-text); border-bottom:1px solid rgba(255,255,255,.05); line-height:1.4; }
.aic-tbl tr:last-child td { border-bottom:none; }
.aic-tbl tr:nth-child(even) td { background:rgba(255,255,255,.02); }

/* Alert */
.aic-alert { padding:10px 14px; border-radius:12px; font-size:13.5px; line-height:1.45; display:flex; gap:10px; align-items:flex-start; }
.aic-alert.success { background:rgba(52,199,89,.12); border:1px solid rgba(52,199,89,.2); color:#34C759; }
.aic-alert.warning { background:rgba(255,159,10,.12); border:1px solid rgba(255,159,10,.2); color:#FF9F0A; }
.aic-alert.error   { background:rgba(255,59,48,.12);  border:1px solid rgba(255,59,48,.2);  color:#FF453A; }
.aic-alert.info    { background:rgba(0,122,255,.12);  border:1px solid rgba(0,122,255,.2);  color:#007AFF; }
.aic-alert-icon { flex-shrink:0; font-size:15px; margin-top:1px; }

/* Buttons */
.aic-btns { display:flex; flex-wrap:wrap; gap:8px; }
.aic-btn { padding:8px 16px; border-radius:100px; border:1.5px solid rgba(255,255,255,.18); background: var(--t-hover); color: var(--t-text); font-size:13.5px; font-weight:500; font-family:var(--font); cursor:pointer; -webkit-tap-highlight-color:transparent; transition:background 140ms, border-color 140ms, transform 100ms; }
.aic-btn:active { transform:scale(.95); }
.aic-btn:hover { background:rgba(255,255,255,.13); border-color:rgba(255,255,255,.28); }
.aic-btn.primary { background:#007AFF; border-color:#007AFF; }
.aic-btn.primary:hover { background:#0071e3; border-color:#0071e3; }

/* Card */
.aic-card { background: var(--t-hover); border: 1px solid var(--t-border); border-radius:14px; overflow:hidden; }
.aic-card-title { font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color: var(--t-text-3); padding:12px 14px 8px; }
.aic-card-row { display:flex; justify-content:space-between; align-items:baseline; padding:7px 14px; gap:8px; border-top:1px solid rgba(255,255,255,.05); }
.aic-card-lbl { font-size:14px; color:#a0a0a8; flex:1; }
.aic-card-val { font-size:14px; font-weight:600; color: var(--t-text); text-align:right; }
.aic-card-footer { font-size:12px; color: var(--t-text-3); padding:8px 14px 12px; border-top:1px solid rgba(255,255,255,.05); }

/* Collapse */
.aic-collapse { border: 1px solid var(--t-border); border-radius:12px; overflow:hidden; }
.aic-collapse-hdr { display:flex; justify-content:space-between; align-items:center; padding:11px 14px; cursor:pointer; -webkit-tap-highlight-color:transparent; user-select:none; }
.aic-collapse-ttl { font-size:13.5px; font-weight:500; color:#a0a0a8; }
.aic-collapse-ico { font-size:12px; color: var(--t-text-3); transition:transform .2s; flex-shrink:0; }
.aic-collapse.open .aic-collapse-ico { transform:rotate(180deg); }
.aic-collapse-body { display:none; flex-direction:column; gap:10px; padding:0 14px 14px; border-top:1px solid rgba(255,255,255,.06); }
.aic-collapse.open .aic-collapse-body { display:flex; padding-top:12px; }

/* Progress */
.aic-prog { display:flex; flex-direction:column; gap:6px; }
.aic-prog-hdr { display:flex; justify-content:space-between; align-items:baseline; }
.aic-prog-lbl { font-size:13px; color:#a0a0a8; }
.aic-prog-val { font-size:13px; font-weight:600; color: var(--t-text); }
.aic-prog-track { height:4px; background:rgba(255,255,255,.1); border-radius:4px; overflow:hidden; }
.aic-prog-fill { height:100%; border-radius:4px; }
.aic-prog-sub { font-size:12px; color: var(--t-text-3); }

/* Suggestion chips */
.aic-sug { padding:7px 14px; background: var(--t-hover); border:1px solid rgba(255,255,255,.12); border-radius:100px; font-size:13px; font-family:var(--font); color:#c7c7cc; cursor:pointer; -webkit-tap-highlight-color:transparent; transition:background 140ms; }
.aic-sug:hover { background:rgba(255,255,255,.12); }
.aic-sug:active { transform:scale(.96); }

/* AI insight panel */
.aip:empty { display:none; }
.aip { margin-top:6px; animation: msgFadeIn 400ms cubic-bezier(.22,1,.36,1) both; animation-delay: 300ms; }
.aip-trigger { display:inline-flex; align-items:center; gap:6px; cursor:pointer; padding:2px 0; user-select:none; -webkit-tap-highlight-color:transparent; }
.aip-lbl { font-size:12px; color:var(--t-text-3); letter-spacing:.01em; }
.aip-arrow { font-size:10px; color:var(--t-text-3); transition:transform 200ms ease; }
.aip-open .aip-arrow { transform:rotate(180deg); }
.aip-body { display:none; margin-top:6px; }
.aip-open .aip-body { display:block; }
.aip-item { font-size:12px; color:var(--t-text-2); line-height:1.5; display:flex; align-items:flex-start; gap:10px; min-height:26px; position:relative; }
.aip-item::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--t-text-3); flex-shrink:0; margin-top:4px; position:relative; z-index:1; }
.aip-item:not(:last-child)::after { content:''; position:absolute; left:2px; top:10px; width:1px; height:calc(100% + 2px); background:var(--t-border); }
.aip-item:last-child { margin-bottom:0; }
.aip-acts { display:flex; flex-wrap:wrap; gap:8px; }
.aip-act-btn { background:none; border:none; padding:0; font-family:var(--font); font-size:13px; color: var(--t-text-3); cursor:pointer; -webkit-tap-highlight-color:transparent; text-decoration:underline; text-underline-offset:3px; text-decoration-color:#444; }
.aip-act-btn:hover { color:#777; }
.aip-act-btn:active { opacity:.7; }

/* ── MANAGE SUBSCRIPTION MODAL — REDESIGN ── */
.manage-sub-card {
  text-align: left; max-width: 420px;
  background: var(--t-bg);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 26px;
  padding: 28px 26px 22px;
}
.manage-sub-card .manage-sub-title {
  font-size: 17px; font-weight: 500; margin-bottom: 0; letter-spacing: -.2px; color: var(--t-text);
}

/* Header row: finqopro logo + plan info — status badge on its own row below */
.msub-header { display: flex; align-items: center; gap: 14px; margin-bottom: 0; padding-right: 40px; }
.msub-crown { width: 44px; height: 44px; flex-shrink: 0; }
.msub-crown img { width: 100%; height: 100%; object-fit: contain; display: block; }
.msub-header-info { flex: 1; min-width: 0; }
.msub-price-label { font-size: 12.5px; color: #6A6A70; margin-top: 3px; }
.manage-sub-card .manage-sub-status { margin: 10px 0 0; display: inline-flex; font-size: 12px; padding: 4px 10px; }

.msub-divider { border: none; border-top: 1px solid rgba(255,255,255,.06); margin: 18px 0; }

.msub-date-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--t-text); }
.msub-date-row i { font-size: 12px; opacity: .5; }

.msub-billing-title {
  font-size: 13px; font-weight: 500; letter-spacing: 0;
  text-transform: none; color: var(--t-text); margin: 18px 0 8px;
}

.msub-event {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.msub-event:last-child { border-bottom: none; }
.msub-event-dot { width: 7px; height: 7px; border-radius: 50%; background: #30D158; flex-shrink: 0; }
.msub-event-dot.ev-neg { background: #FF9F0A; }
.msub-event-text { flex: 1; font-size: 13px; color: #C5C5C9; }
.msub-event-amount { font-size: 13px; color: var(--t-text); font-variant-numeric: tabular-nums; font-weight: 500; }
.msub-event-date { font-size: 11.5px; color: #4A4A50; white-space: nowrap; }
.msub-empty-events { font-size: 13px; color: var(--t-text-3); padding: 10px 0; }
.msub-loading-events { font-size: 13px; color: var(--t-text-3); padding: 10px 0; }

.msub-portal-error { font-size: 13px; color: #FF9F0A; margin-top: 8px; display: none; }
.msub-portal-error.show { display: block; }
