/* Capsynthesis Finance — visual redesign */

:root {
  color-scheme: dark;
  --bg-0: #08090f;
  --bg-1: #0d111b;
  --surface: rgba(20, 26, 38, 0.72);
  --surface-2: rgba(28, 36, 52, 0.62);
  --surface-solid: #141a26;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --text-dim: #cbd5e1;
  --muted: #8b97ab;
  --mint: #5eead4;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --green: #4ade80;
  --red: #f87171;
  --amber: #fbbf24;
  --gradient-primary: linear-gradient(135deg, #5eead4 0%, #38bdf8 100%);
  --gradient-violet: linear-gradient(135deg, #a78bfa 0%, #f0abfc 100%);
  --gradient-warm: linear-gradient(135deg, #fbbf24 0%, #fb923c 100%);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.18);
  --shadow-elev: 0 24px 60px rgba(0, 0, 0, 0.5);
  --tabbar-h: 68px;
  --radius-card: 18px;
  --radius-row: 14px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg-0: #eef2f8;
  --bg-1: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: rgba(248, 250, 253, 0.95);
  --surface-solid: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-dim: #334155;
  --muted: #64748b;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-elev: 0 24px 60px rgba(15, 23, 42, 0.14);
}

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

html, body { margin: 0; min-height: 100vh; overflow-x: hidden; }

body {
  background: var(--bg-0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* Decorative mesh background */
.bg-mesh {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 500px at 0% 0%, rgba(94, 234, 212, 0.18), transparent 60%),
    radial-gradient(600px 600px at 100% 20%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(800px 500px at 50% 100%, rgba(56, 189, 248, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
}
[data-theme="light"] .bg-mesh {
  background:
    radial-gradient(700px 500px at 0% 0%, rgba(94, 234, 212, 0.18), transparent 65%),
    radial-gradient(600px 600px at 100% 20%, rgba(167, 139, 250, 0.14), transparent 65%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
}

/* Typography */
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tnum { font-variant-numeric: tabular-nums; }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.hidden, [hidden] { display: none !important; }

/* Bootstrap loader */
.bootstrap { display: grid; place-items: center; min-height: 100vh; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--mint);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */
.app-root { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px); }
.app-main {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 16px 16px 8px;
  animation: viewIn 0.32s var(--ease);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 8px 4px 18px;
}
.page-head h1 { font-size: 26px; }
.page-head .chip { margin-bottom: 4px; }

/* ---------- Tabbar (floating, glassy) ---------- */
.tabbar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: repeat(7, 1fr);
  height: var(--tabbar-h);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 26, 38, 0.88), rgba(14, 18, 28, 0.92));
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-elev);
  z-index: 20;
  padding: 6px 6px;
}
[data-theme="light"] .tabbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 248, 252, 0.95));
}
.tabbar button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: transparent;
  color: var(--muted);
  cursor: pointer; font: inherit;
  border-radius: 16px;
  transition: color 0.22s var(--ease), transform 0.18s var(--ease);
}
.tabbar button svg { width: 22px; height: 22px; stroke-width: 1.8; stroke: currentColor; fill: none; }
.tabbar button small { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; }
.tabbar button:active { transform: scale(0.94); }
.tabbar button.active { color: var(--text); }
.tabbar button.active::before {
  content: ""; position: absolute; inset: 4px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.18), rgba(56, 189, 248, 0.18));
  border: 1px solid rgba(94, 234, 212, 0.32);
  border-radius: 14px;
  z-index: -1;
}
.tabbar button.active svg { stroke: url(#tabGrad); }

/* ---------- Cards / panels ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; color: var(--text-dim); font-weight: 600; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-card); padding: 22px 22px 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 0% 0%, rgba(94, 234, 212, 0.28), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(167, 139, 250, 0.22), transparent 55%),
    linear-gradient(135deg, #182232 0%, #0e1626 100%);
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
  color: var(--text);
}
[data-theme="light"] .hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(94, 234, 212, 0.30), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(167, 139, 250, 0.20), transparent 55%),
    linear-gradient(135deg, #ffffff 0%, #eef4f3 100%);
  color: var(--text);
}
.hero .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.hero h2 {
  font-size: clamp(32px, 8.5vw, 52px); font-weight: 800; letter-spacing: -0.03em;
  margin: 8px 0 12px;
  background: linear-gradient(120deg, #f1f5f9 0%, #94e3d4 60%, #38bdf8 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="light"] .hero h2 {
  background: linear-gradient(120deg, #0f172a 0%, #0d9488 60%, #0284c7 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 4px; }
.hero-stats > div { min-width: 100px; }
.hero-stats span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.hero-stats strong { font-size: 16px; font-weight: 700; }

/* KPI bento */
.kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 14px;
}
.kpi-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
}
.kpi-card .icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 10px;
}
.kpi-card .icon svg { width: 16px; height: 16px; stroke-width: 2; fill: none; }
.kpi-card.income .icon { background: rgba(74, 222, 128, 0.14); color: var(--green); }
.kpi-card.expense .icon { background: rgba(248, 113, 113, 0.14); color: var(--red); }
.kpi-card.neutral .icon { background: rgba(94, 234, 212, 0.14); color: var(--mint); }
.kpi-card.violet .icon { background: rgba(167, 139, 250, 0.14); color: var(--violet); }
.kpi-card span.label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-card strong { display: block; font-size: 20px; margin-top: 4px; font-weight: 700; letter-spacing: -0.01em; }
.kpi-card.income strong { color: var(--green); }
.kpi-card.expense strong { color: var(--red); }

/* List items */
.list { display: grid; gap: 8px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-row);
  padding: 13px 14px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
  animation: rowIn 0.36s var(--ease) backwards;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.list-item:hover { border-color: var(--line-strong); }
.list-item:active { transform: scale(0.985); }
.list-item .l-icon {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.list-item .l-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.list-item .l-icon.income { background: rgba(74, 222, 128, 0.14); color: var(--green); border-color: rgba(74, 222, 128, 0.22); }
.list-item .l-icon.expense { background: rgba(248, 113, 113, 0.14); color: var(--red); border-color: rgba(248, 113, 113, 0.22); }
.list-item .l-icon.violet { background: rgba(167, 139, 250, 0.14); color: var(--violet); border-color: rgba(167, 139, 250, 0.22); }
.list-item .l-icon.mint { background: rgba(94, 234, 212, 0.14); color: var(--mint); border-color: rgba(94, 234, 212, 0.22); }
.list-item .l-main { flex: 1; min-width: 0; }
.list-item .l-title { font-weight: 600; font-size: 14.5px; }
.list-item .l-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.list-item .l-right { text-align: right; }
.list-item .l-amount { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.list-item .l-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.amount-pos { color: var(--green); }
.amount-neg { color: var(--red); }

.empty {
  padding: 28px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

/* Category breakdown rows */
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row .name { font-weight: 600; font-size: 14px; }
.cat-row .val { font-weight: 700; }
.cat-row .bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.cat-row .bar span { display: block; height: 100%; border-radius: inherit; background: var(--gradient-primary); }

/* Progress */
.progress {
  height: 8px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.progress span {
  display: block; height: 100%;
  background: var(--gradient-primary);
  border-radius: inherit;
  transition: width 0.5s var(--ease);
}
.progress.violet span { background: var(--gradient-violet); }

/* Goal item style */
.goal-card { padding: 14px; }
.goal-card .goal-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.goal-card .goal-name { font-weight: 700; font-size: 15px; }
.goal-card .goal-pct { font-weight: 800; background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.goal-card .goal-meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.form input, .form select, .form textarea {
  height: 46px; border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text); padding: 0 14px;
  font: inherit; font-size: 15px; letter-spacing: -0.005em;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}
[data-theme="light"] .form input, [data-theme="light"] .form select, [data-theme="light"] .form textarea {
  background: rgba(15, 23, 42, 0.04);
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--mint);
  background: rgba(94, 234, 212, 0.06);
}
.form textarea { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.form .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.segmented {
  display: inline-flex; padding: 4px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}
.segmented button {
  padding: 9px 16px; border: 0; background: transparent;
  color: var(--muted); border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 13px;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.segmented button.active {
  background: var(--gradient-primary);
  color: #052e2a;
  box-shadow: 0 4px 14px rgba(94, 234, 212, 0.35);
}

.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  height: 46px; border: 0; border-radius: 12px;
  cursor: pointer; font: inherit; font-weight: 700; font-size: 14px;
  padding: 0 18px;
  transition: transform 0.18s var(--ease), opacity 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.btn-primary {
  background: var(--gradient-primary); color: #052e2a;
  box-shadow: 0 6px 18px rgba(94, 234, 212, 0.32);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(94, 234, 212, 0.4); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-secondary:active { transform: scale(0.97); }
.btn-danger {
  background: rgba(248, 113, 113, 0.12); color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.32);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; padding: 0 8px; }

/* Floating action button */
.fab {
  position: fixed; right: 20px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 26px);
  width: 56px; height: 56px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--gradient-primary);
  color: #052e2a;
  box-shadow: 0 14px 36px rgba(94, 234, 212, 0.4), 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 15;
  display: grid; place-items: center;
  transition: transform 0.18s var(--ease), box-shadow 0.22s var(--ease);
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(94, 234, 212, 0.5), 0 4px 10px rgba(0, 0, 0, 0.2); }
.fab:active { transform: scale(0.93); }
.fab svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2.4; fill: none; }

/* Filters */
.filters {
  display: grid; gap: 8px; grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}
.filters .full { grid-column: 1 / -1; }
.filters select, .filters input {
  height: 40px; border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text); padding: 0 12px;
  font: inherit; font-size: 13px;
}
[data-theme="light"] .filters select, [data-theme="light"] .filters input {
  background: rgba(15, 23, 42, 0.04);
}

.pager {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 16px; color: var(--muted); font-size: 13px;
}
.pager button {
  height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  cursor: pointer; font: inherit; font-weight: 600;
  transition: opacity 0.22s var(--ease);
}
.pager button:disabled { opacity: 0.32; cursor: default; }

/* ---------- Onboarding ---------- */
.onboarding {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 18px;
  background: var(--bg-0);
  overflow: hidden;
}
.ob-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ob-orb {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.55;
  animation: obFloat 18s ease-in-out infinite;
}
.ob-orb-1 { width: 380px; height: 380px; left: -120px; top: -100px; background: radial-gradient(circle, #5eead4, transparent 70%); }
.ob-orb-2 { width: 420px; height: 420px; right: -140px; bottom: -120px; background: radial-gradient(circle, #a78bfa, transparent 70%); animation-delay: -6s; }
.ob-orb-3 { width: 320px; height: 320px; left: 40%; top: 30%; background: radial-gradient(circle, #38bdf8, transparent 70%); animation-delay: -12s; opacity: 0.35; }
@keyframes obFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

.onboarding-card {
  position: relative;
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  padding: 22px 22px 20px;
  display: grid; gap: 14px;
  box-shadow: var(--shadow-elev);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  animation: obCardIn 0.5s var(--ease);
}
@keyframes obCardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ob-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ob-brand { display: flex; align-items: center; gap: 10px; }
.ob-brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--gradient-primary);
  color: #06222a;
  box-shadow: 0 10px 24px rgba(94, 234, 212, 0.4);
}
.ob-brand-mark svg { width: 20px; height: 20px; }
.ob-brand-text { display: grid; line-height: 1.15; }
.ob-brand-text strong { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.ob-brand-text span { font-size: 11px; color: var(--muted); }
.ob-step-counter {
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  padding: 6px 10px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.ob-step-counter i { font-style: normal; color: var(--muted); margin: 0 2px; }

.onboarding-progress { display: flex; gap: 6px; }
.onboarding-progress i {
  flex: 1; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.4s var(--ease), transform 0.4s var(--ease);
  position: relative; overflow: hidden;
}
.onboarding-progress i.done { background: var(--mint); }
.onboarding-progress i.on { background: var(--gradient-primary); transform: scaleY(1.15); }
.onboarding-progress i.on::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: obShimmer 1.6s linear infinite;
}
@keyframes obShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.ob-hero {
  height: 110px; display: grid; place-items: center;
  color: var(--mint);
  background:
    radial-gradient(circle at 50% 50%, rgba(94, 234, 212, 0.18), transparent 65%);
  border-radius: 18px;
  position: relative;
  animation: obHeroIn 0.5s var(--ease);
}
.ob-hero[data-step="1"] { color: var(--cyan); background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.18), transparent 65%); }
.ob-hero[data-step="2"] { color: var(--violet); background: radial-gradient(circle at 50% 50%, rgba(167, 139, 250, 0.18), transparent 65%); }
.ob-hero svg { width: 88px; height: 88px; animation: obHeroFloat 4s ease-in-out infinite; }
@keyframes obHeroIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes obHeroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.onboarding-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.onboarding-card > .muted { font-size: 13.5px; line-height: 1.45; }

.ob-body { display: grid; gap: 12px; animation: obBodyIn 0.4s var(--ease); }
@keyframes obBodyIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.ob-chip {
  display: inline-flex; align-self: flex-start;
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: var(--mint);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
}

.ob-cur-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.ob-cur {
  appearance: none; cursor: pointer; font: inherit;
  padding: 14px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--line);
  color: var(--text);
  font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
  transition: all 0.22s var(--ease);
}
.ob-cur:hover { background: rgba(255, 255, 255, 0.07); }
.ob-cur.active {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.18), rgba(56, 189, 248, 0.12));
  border-color: var(--mint);
  color: var(--mint);
  box-shadow: 0 6px 18px rgba(94, 234, 212, 0.25);
  transform: translateY(-1px);
}

.ob-amount {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  transition: border-color 0.22s var(--ease);
}
.ob-amount:focus-within { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12); }
.ob-amount-cur {
  font-size: 13px; font-weight: 700; color: var(--muted);
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
}
.ob-amount input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text);
  font: inherit; font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.ob-amount input::placeholder { color: var(--muted); font-weight: 500; }

.ob-hint {
  margin: 0; padding: 10px 12px;
  background: rgba(94, 234, 212, 0.06);
  border: 1px dashed rgba(94, 234, 212, 0.22);
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 12.5px; line-height: 1.45;
}

.ob-quick-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--muted); letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 2px;
}

.ob-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-quick-btn {
  appearance: none; cursor: pointer; font: inherit;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: all 0.2s var(--ease);
}
.ob-quick-btn:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.ob-quick-btn.ghost { background: transparent; color: var(--muted); }

.ob-preset {
  appearance: none; cursor: pointer; font: inherit;
  flex: 1; min-width: 96px;
  display: grid; gap: 2px; padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px; font-weight: 600; text-align: left;
  transition: all 0.22s var(--ease);
}
.ob-preset small { font-size: 11px; color: var(--muted); font-weight: 500; }
.ob-preset:hover {
  background: rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.3);
  transform: translateY(-1px);
}

.ob-form label { gap: 6px; }

.onboarding-nav { display: flex; gap: 10px; margin-top: 6px; }
.onboarding-nav .btn-primary { flex: 1; padding-block: 14px; font-size: 15px; }
.onboarding-nav .btn-secondary { min-width: 104px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 32px);
  transform: translateX(-50%);
  background: rgba(15, 18, 28, 0.95);
  border: 1px solid var(--line-strong);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  z-index: 60; max-width: 90vw;
  box-shadow: var(--shadow-elev);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: toastIn 0.32s var(--ease);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Inline actions in form */
.actions { display: flex; gap: 10px; margin-top: 6px; }
.actions .btn-primary, .actions .btn-secondary, .actions .btn-danger { flex: 1; }

/* Confirm modal */
.modal {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(5, 8, 14, 0.65); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 16px;
  animation: modalIn 0.22s var(--ease);
}
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: min(380px, 100%);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
  display: grid; gap: 14px;
  box-shadow: var(--shadow-elev);
  animation: viewIn 0.28s var(--ease);
}

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: rgba(94, 234, 212, 0.12);
  color: var(--mint);
  font-size: 12px; font-weight: 600;
  border: 1px solid rgba(94, 234, 212, 0.22);
}

/* ---------- FX: currency switcher + live rates ---------- */
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cur-switch {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  padding: 4px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.cur-pill {
  appearance: none; cursor: pointer; font: inherit;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: transparent; border: none;
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em;
  transition: all 0.22s var(--ease);
}
.cur-pill:hover { color: var(--text-dim); }
.cur-pill.active {
  background: var(--gradient-primary);
  color: #06222a;
  box-shadow: 0 4px 14px rgba(94, 234, 212, 0.35);
}

.fx-strip { padding: 16px 16px 18px; margin-bottom: 14px; }
.fx-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.fx-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.fx-tile {
  display: grid; gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease);
}
.fx-tile:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.fx-code { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; }
.fx-rate { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.fx-rate small { font-size: 11px; color: var(--muted); margin-left: 4px; font-weight: 500; }
.fx-chg { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.fx-chg.up { color: var(--green); }
.fx-chg.down { color: var(--red); }
.fx-chg.flat { color: var(--muted); }

.fx-hint { display: block; margin-top: 4px; font-size: 11px; line-height: 1.4; }
.fx-hint b { color: var(--text); font-variant-numeric: tabular-nums; }
.fx-convert {
  padding: 10px 12px; border-radius: 12px;
  background: rgba(94, 234, 212, 0.06);
  border: 1px dashed rgba(94, 234, 212, 0.25);
  font-size: 12.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.fx-convert b { color: var(--mint); font-weight: 700; }
.fx-convert[hidden] { display: none; }

@media (min-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .filters { grid-template-columns: repeat(4, 1fr); }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); }
  .fx-grid { grid-template-columns: repeat(5, 1fr); }
}
