/* ── Milionário+ · Design System ─────────────────────────────── */
:root {
  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --accent-soft: rgba(29, 78, 216, 0.08);
  --accent-border: rgba(29, 78, 216, 0.16);
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text2: #64748B;
  --text3: #94A3B8;
  --sep: var(--border);
  --fill: #F1F5F9;
  --fill2: #E2E8F0;
  --card: var(--surface);
  --blur-bg: var(--surface);
  --card-blur: var(--surface);
  --blue: var(--accent);
  --royal-blue: var(--accent);
  --royal-green: #059669;
  --tiffany: #059669;
  --deep-green: #064E3B;
  --good: #059669;
  --bad: #DC2626;
  --warn: #D97706;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --r: 10px;
  --r-s: 8px;
  --r-lg: 14px;
}

html[data-theme="dark"] {
  --bg: #0F172A;
  --surface: #1E293B;
  --surface-2: #172033;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #F1F5F9;
  --text2: #94A3B8;
  --text3: #64748B;
  --fill: rgba(148, 163, 184, 0.10);
  --fill2: rgba(148, 163, 184, 0.16);
  --card: var(--surface);
  --blur-bg: var(--surface);
  --card-blur: var(--surface);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.20);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.24), 0 6px 16px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #E8ECF1;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  overflow: hidden;
  font-feature-settings: "tnum" 1;
}

/* ── Shell ── */
#device { height: 100%; display: flex; align-items: center; justify-content: center; background: #E8ECF1; }
#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 430px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#view, #pages, #tabbar, #overlays, #splash { position: relative; z-index: 1; }

@media (min-width: 520px) {
  html[data-theme="dark"] body { background: #0B1120; }
  body { background: #E8ECF1; }
  #device { padding: 20px 0; }
  #app {
    height: min(860px, 100%);
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow), 0 24px 48px -12px rgba(15, 23, 42, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-progress > div span,
  .project-progress.hot > div span,
  .progress-flame { animation: none !important; }
}

/* ── Splash ── */
#splash {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  pointer-events: none;
  animation: splash-out .45s ease .9s forwards;
}
.splash-mark { width: 72px; height: 72px; flex: none; }
.splash-word { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.splash-tag { color: var(--text2); font-size: 13px; font-weight: 500; }
.grad-plus { color: var(--accent); }
@keyframes splash-out {
  to { opacity: 0; visibility: hidden; }
}

/* ── Content area ── */
.view {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 108px;
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }

/* ── Tab bar ── */
#tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 4px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  color: var(--text3);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s;
  position: relative;
  padding-top: 6px;
}
.tab:active { opacity: .7; }
.tab .ic { width: 22px; height: 22px; }
.tab.active { color: var(--accent); }
.tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.ic { width: 22px; height: 22px; flex: none; }

/* ── Headers ── */
.big-head { display: flex; align-items: flex-start; justify-content: space-between; margin: 2px 0 18px; }
.big-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; color: var(--text); }
.big-sub { color: var(--text2); font-size: 13px; margin-top: 4px; font-weight: 500; }
.sec-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 20px 2px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sec-title .link { text-transform: none; letter-spacing: 0; }
.link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.link .ic { width: 14px; height: 14px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.card.tight { padding: 8px 16px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .ic { width: 17px; height: 17px; color: var(--accent); }

/* Balance hero */
.hero {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  position: relative;
  overflow: hidden;
}
.hero::after,
.hero::before { display: none; }
.hero .lb { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.hero .val { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.hero-grid { display: flex; gap: 8px; position: relative; z-index: 1; }
.hero-pill {
  flex: 1;
  background: var(--fill);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: 10px;
}
.hero-pill .k { font-size: 10px; font-weight: 600; color: var(--text2); display: flex; align-items: center; gap: 4px; text-transform: uppercase; letter-spacing: .03em; }
.hero-pill .k .ic { width: 12px; height: 12px; }
.hero-pill .v { font-size: 14px; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

.quick-expense {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quick-expense:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.quick-expense:active { transform: scale(.99); }
.quick-plus {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  flex: none;
}
.quick-plus .ic { width: 22px; height: 22px; }
.quick-expense b { display: block; font-size: 15px; font-weight: 600; }
.quick-expense small { display: block; margin-top: 2px; color: var(--text2); font-size: 12px; font-weight: 500; line-height: 1.3; }

/* Stats grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat .k { font-size: 11px; color: var(--text2); font-weight: 600; display: flex; gap: 5px; align-items: center; text-transform: uppercase; letter-spacing: .03em; }
.stat .k .ic { width: 14px; height: 14px; }
.stat .v { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 11px; font-weight: 600; margin-top: 3px; }
.up { color: var(--good); }
.down { color: var(--bad); }
.muted { color: var(--text2); }

/* ── Lists ── */
.list {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 10px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  min-height: 52px;
  position: relative;
  cursor: pointer;
  transition: background .12s;
  border: 0;
  width: 100%;
  text-align: left;
  background: none;
  font-family: inherit;
  color: var(--text);
}
.row:active { background: var(--fill); }
.row + .row::before { content: ''; position: absolute; left: 58px; right: 0; top: 0; height: 1px; background: var(--border); }
.row.no-icon + .row.no-icon::before { left: 14px; }
.row-ic { width: 32px; height: 32px; border-radius: var(--r-s); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.row-ic .ic { width: 17px; height: 17px; }
.row-main { flex: 1; min-width: 0; }
.row-t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-s { font-size: 12px; color: var(--text2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; flex: none; display: flex; align-items: center; gap: 8px; }
.row-v { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.row-vs { font-size: 11px; color: var(--text2); margin-top: 1px; }
.chev { color: var(--text3); width: 15px !important; height: 15px !important; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--r);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  width: 100%;
}
.btn:active { transform: scale(.98); }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-hover); }
.btn-ghost { background: var(--fill); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(220, 38, 38, 0.08); color: var(--bad); border: 1px solid rgba(220, 38, 38, 0.16); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: var(--r-s); width: auto; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.fab {
  position: absolute;
  right: 16px;
  bottom: 96px;
  z-index: 25;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s, background .15s;
}
.fab:active { transform: scale(.94); background: var(--accent-hover); }
.fab .ic { width: 24px; height: 24px; }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: border-color .15s, color .15s;
}
.icon-btn:active { background: var(--fill); }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); border: 1.5px solid var(--surface); }

/* ── Segmented control ── */
.seg { display: flex; background: var(--fill); border-radius: var(--r-s); padding: 3px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--border); }
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
  flex: 1;
  border: 0;
  background: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ── Chips ── */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none; margin-bottom: 10px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.chip:active { transform: scale(.97); }
.chip.on,
.chip[data-active="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .02em; }
.badge .ic { width: 11px; height: 11px; }

/* ── Insights ── */
.insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.insight .ins-ic { width: 32px; height: 32px; border-radius: var(--r-s); flex: none; display: flex; align-items: center; justify-content: center; }
.insight .ins-ic .ic { width: 16px; height: 16px; }
.insight p { font-size: 13px; font-weight: 500; line-height: 1.45; padding-top: 5px; color: var(--text); }
.tone-good .ins-ic { background: rgba(5, 150, 105, 0.10); color: var(--good); }
.tone-bad .ins-ic { background: rgba(220, 38, 38, 0.08); color: var(--bad); }
.tone-warn .ins-ic { background: rgba(217, 119, 6, 0.10); color: var(--warn); }
.tone-info .ins-ic { background: var(--accent-soft); color: var(--accent); }

/* ── Stacked pages ── */
#pages { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.page { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.32, .72, .28, 1); pointer-events: auto; }
.page.in { transform: translateX(0); }
.page-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 10px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 2;
}
.page-head h2 { flex: 1; text-align: center; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-btn { display: flex; align-items: center; border: 0; background: none; color: var(--accent); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; width: 86px; }
.back-btn .ic { width: 18px; height: 18px; }
.page-right { width: 86px; display: flex; justify-content: flex-end; }
.page-body { padding-bottom: 40px; }

/* ── Sheets ── */
.sheet-wrap { position: absolute; inset: 0; z-index: 60; display: flex; align-items: flex-end; }
.sheet-dim { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.40); opacity: 0; transition: opacity .25s; }
.sheet {
  position: relative;
  width: 100%;
  max-height: 88%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 8px 18px 28px;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32, .72, .28, 1);
  display: flex;
  flex-direction: column;
}
.sheet-wrap.in .sheet { transform: translateY(0); }
.sheet-wrap.in .sheet-dim { opacity: 1; }
.sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 6px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-x { border: 0; background: var(--fill); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--text2); cursor: pointer; }
.sheet-x .ic { width: 14px; height: 14px; }
.sheet-body { overflow-y: auto; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }
.confirm-msg { font-size: 14px; color: var(--text2); line-height: 1.5; }

/* ── Forms ── */
.field { display: block; margin-bottom: 12px; }
.field-lb { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.inp {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.inp { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea.inp { resize: none; min-height: 72px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* Switch */
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { display: none; }
.switch .knob { position: absolute; inset: 0; background: var(--fill2); border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(20px); }

/* ── Charts ── */
.ch-lb { font-size: 10px; font-weight: 600; fill: var(--text3); font-family: inherit; }
.chart-empty { color: var(--text3); font-size: 13px; text-align: center; padding: 24px 0; }
.chart-legend { display: flex; justify-content: center; gap: 16px; margin-top: 4px; color: var(--text2); font-size: 11px; font-weight: 600; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.donut-title { font-size: 16px; font-weight: 700; fill: var(--text); font-family: inherit; letter-spacing: -0.02em; }
.donut-sub { font-size: 10px; font-weight: 600; fill: var(--text2); font-family: inherit; }
.ring-lb { font-size: 11px; font-weight: 700; fill: var(--text); font-family: inherit; }
.legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.leg-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.leg-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.leg-item .lv { margin-left: auto; color: var(--text2); font-weight: 600; font-size: 12px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.hbar-val { color: var(--text2); font-variant-numeric: tabular-nums; }
.hbar-track { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 3px; transition: width .4s cubic-bezier(.32, .72, .28, 1); }

/* Progress bar */
.prog { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.prog > div { height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s; }

/* ── Kanban ── */
.kanban { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 18px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.kanban::-webkit-scrollbar { display: none; }
.kb-col { flex: none; width: 258px; scroll-snap-align: start; }
.kb-head { display: flex; align-items: center; gap: 6px; padding: 4px 4px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); }
.kb-head .cnt { margin-left: auto; color: var(--text3); font-weight: 600; }
.kb-dot { width: 7px; height: 7px; border-radius: 50%; }
.kb-cards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.task-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .12s;
}
.task-card:active { border-color: var(--accent-border); }
.task-card .tt { font-size: 13px; font-weight: 600; line-height: 1.35; }
.task-card.done-task { opacity: .65; }
.task-card.done-task .tt { text-decoration: line-through; color: var(--text2); }
.task-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.task-meta .badge { background: var(--fill); color: var(--text2); }
.prj-tag { font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
.prj-tag .pd { width: 6px; height: 6px; border-radius: 50%; }

.project-filter { margin-bottom: 8px; }
.project-row {
  width: 100%;
  display: block;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .12s;
}
.project-row:active { border-color: var(--accent-border); }
.project-row-top { display: flex; align-items: center; gap: 12px; }
.project-row-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.project-progress { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; margin-top: 12px; }
.project-progress > div { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; position: relative; }
.project-progress > div span {
  display: block;
  width: var(--pct);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left center;
  animation: progressGrow .6s cubic-bezier(.22, .8, .22, 1) both;
}
.project-progress.hot > div span { background: var(--good); animation: progressGrow .6s cubic-bezier(.22, .8, .22, 1) both; }
.project-progress b { color: var(--text2); font-size: 11px; font-weight: 700; }
.progress-flame {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-s);
  background: rgba(217, 119, 6, 0.10);
  border: 1px solid rgba(217, 119, 6, 0.20);
}
.progress-flame .ic { width: 16px; height: 16px; color: var(--warn); filter: none; animation: none; }
.project-progress.detail { margin: 12px 0 4px; }
.project-next {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: var(--r-s);
  background: var(--fill);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
}
.project-next span { color: var(--text2); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.project-next b { margin-left: auto; color: var(--text2); font-size: 11px; }
.project-next.done { color: var(--good); background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.16); }

@keyframes progressGrow {
  from { transform: scaleX(.05); }
  to { transform: scaleX(1); }
}

/* ── Calendar ── */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 10px; font-weight: 700; color: var(--text3); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--r-s);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  background: none;
  font-family: inherit;
  color: var(--text);
  position: relative;
}
.cal-day.other { color: var(--text3); opacity: .45; }
.cal-day.today { background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.sel:not(.today) { background: var(--accent-soft); color: var(--accent); }
.cal-dots { display: flex; gap: 2px; height: 4px; }
.cal-dots i { width: 4px; height: 4px; border-radius: 50%; display: block; }

.calendar-card { padding: 14px; }
.agenda-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 10px 0 4px; }
.agenda-actions .btn { width: 100%; padding-inline: 8px; }
.icon-btn.mini { width: 30px; height: 30px; box-shadow: none; }
.icon-btn.mini .ic { width: 15px; height: 15px; }
.push-card .row-ic { width: 36px; height: 36px; border-radius: var(--r-s); }
.push-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 10px; }
.push-times .inp { text-align: center; padding-inline: 6px; }
.done-reminder .row-t { text-decoration: line-through; color: var(--text3); }

/* ── Financial analysis chat ── */
.ai-wrap { display: flex; flex-direction: column; height: 100%; }
.ai-scroll { flex: 1; overflow-y: auto; padding: 12px 16px 8px; scrollbar-width: none; }
.ai-scroll::-webkit-scrollbar { display: none; }
.msg { max-width: 88%; margin-bottom: 10px; animation: msg-in .25s ease; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg.user { margin-left: auto; }
.msg .bub { padding: 11px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user .bub { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai .bub { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); border-bottom-left-radius: 4px; }
.msg .who { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--text2); margin: 0 4px 4px; text-transform: uppercase; letter-spacing: .03em; }
.ai-avatar { width: 22px; height: 22px; border-radius: var(--r-s); background: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; color: var(--accent); flex: none; }
.ai-avatar .ic { width: 12px; height: 12px; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text3); animation: ty 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ty { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.ai-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px calc(92px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.ai-input-bar input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.ai-input-bar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-send {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  border: 0;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: background .15s;
}
.ai-send:active { background: var(--accent-hover); }
.ai-send .ic { width: 18px; height: 18px; }

/* ── Credit cards ── */
.ccard { border-radius: var(--r-lg); padding: 16px; color: #fff; position: relative; overflow: hidden; margin-bottom: 10px; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, 0.12); }
.ccard::after { content: ''; position: absolute; right: -40px; top: -50px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.ccard .bank { font-size: 12px; font-weight: 600; opacity: .85; }
.ccard .cname { font-size: 15px; font-weight: 700; margin-top: 1px; }
.ccard .brand { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; letter-spacing: .04em; opacity: .9; z-index: 1; }
.ccard-row { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11px; font-weight: 600; opacity: .9; position: relative; z-index: 1; }
.ccard-row b { display: block; font-size: 14px; font-weight: 700; margin-top: 1px; font-variant-numeric: tabular-nums; }
.ccard .limitbar { margin-top: 10px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.20); overflow: hidden; position: relative; z-index: 1; }
.ccard .limitbar > div { height: 100%; background: #fff; border-radius: 2px; }

/* ── Toast ── */
.toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translate(-50%, -80px);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: transform .3s cubic-bezier(.32, .72, .28, 1);
  white-space: nowrap;
  max-width: 92%;
}
.toast.in { transform: translate(-50%, 0); }
.toast .ic { width: 16px; height: 16px; color: var(--good); }

/* ── Goals ── */
.goal-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.goal-scroll::-webkit-scrollbar { display: none; }
.goal-card {
  flex: none;
  width: 164px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .12s;
}
.goal-card:active { border-color: var(--accent-border); }
.goal-ic { width: 32px; height: 32px; border-radius: var(--r-s); display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 8px; }
.goal-ic .ic { width: 17px; height: 17px; }
.goal-card .gt { font-size: 13px; font-weight: 600; line-height: 1.3; min-height: 32px; }
.goal-card .gv { font-size: 11px; color: var(--text2); font-weight: 500; margin: 6px 0 6px; font-variant-numeric: tabular-nums; }

/* ── Gantt ── */
.gantt-row { margin-bottom: 12px; }
.gantt-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.gantt-top span:last-child { color: var(--text2); font-size: 11px; }
.gantt-track { height: 24px; background: var(--fill); border-radius: var(--r-s); position: relative; overflow: hidden; border: 1px solid var(--border); }
.gantt-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; min-width: 10px; display: flex; align-items: center; padding: 0 7px; color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 2; }

/* ── Checklist ── */
.checkline { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border: 0; background: none; width: 100%; font-family: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.checkline .cbox { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); flex: none; display: flex; align-items: center; justify-content: center; color: #fff; transition: all .15s; }
.checkline .cbox .ic { width: 12px; height: 12px; }
.checkline.done .cbox { background: var(--accent); border-color: var(--accent); }
.checkline.done span { text-decoration: line-through; color: var(--text3); }

/* ── Misc ── */
.empty { text-align: center; color: var(--text3); padding: 24px 14px; font-size: 13px; font-weight: 500; }
.empty .ic { width: 28px; height: 28px; margin-bottom: 6px; color: var(--text3); opacity: .6; }
.avatar { width: 40px; height: 40px; border-radius: var(--r); background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex: none; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; position: relative; background: var(--accent); border-radius: var(--r); color: #fff; font-weight: 700; }
.brandline { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 4px; color: var(--text2); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.profile-logo { width: 40px; height: 40px; margin: 0 auto 8px; }
.profile-logo svg,
.brandline svg { display: block; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .12s;
  font-family: inherit;
  text-align: left;
  color: var(--text);
}
.tile:active { border-color: var(--accent-border); }
.tile .t-ic { width: 34px; height: 34px; border-radius: var(--r-s); display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 8px; }
.tile .t-ic .ic { width: 18px; height: 18px; }
.tile .t-t { font-size: 13px; font-weight: 600; }
.tile .t-s { font-size: 11px; color: var(--text2); font-weight: 500; margin-top: 2px; }
.day-group { font-size: 11px; font-weight: 700; color: var(--text2); margin: 14px 2px 6px; text-transform: uppercase; letter-spacing: .04em; }
.flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
b, strong { font-weight: 600; }

/* Smart Home inspired visual refresh */
:root {
  --accent: #7CFFB2;
  --accent-hover: #46E98D;
  --accent-soft: rgba(124, 255, 178, 0.14);
  --accent-border: rgba(124, 255, 178, 0.32);
  --bg: #091013;
  --surface: rgba(18, 28, 32, 0.76);
  --surface-2: rgba(26, 41, 46, 0.86);
  --border: rgba(218, 244, 240, 0.10);
  --border-strong: rgba(218, 244, 240, 0.18);
  --text: #F3FBF9;
  --text2: #A9BAB7;
  --text3: #687A78;
  --sep: rgba(218, 244, 240, 0.10);
  --fill: rgba(255, 255, 255, 0.07);
  --fill2: rgba(255, 255, 255, 0.12);
  --card: rgba(18, 28, 32, 0.78);
  --blur-bg: rgba(18, 28, 32, 0.86);
  --card-blur: rgba(18, 28, 32, 0.72);
  --blue: #6CB7FF;
  --royal-blue: #6CB7FF;
  --royal-green: #7CFFB2;
  --tiffany: #5EE7D1;
  --deep-green: #173C35;
  --good: #7CFFB2;
  --bad: #FF6F7D;
  --warn: #FFD166;
  --shadow-sm: 0 12px 34px rgba(0, 0, 0, 0.22);
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.34);
  --r: 8px;
  --r-s: 6px;
  --r-lg: 8px;
}

html[data-theme="light"] {
  --accent: #0B8F57;
  --accent-hover: #087A4A;
  --accent-soft: rgba(11, 143, 87, 0.10);
  --accent-border: rgba(11, 143, 87, 0.22);
  --bg: #EAF0EC;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: rgba(246, 250, 247, 0.92);
  --border: rgba(32, 57, 53, 0.11);
  --border-strong: rgba(32, 57, 53, 0.18);
  --text: #17211F;
  --text2: #65736F;
  --text3: #8A9894;
  --sep: rgba(32, 57, 53, 0.10);
  --fill: rgba(23, 33, 31, 0.06);
  --fill2: rgba(23, 33, 31, 0.10);
  --card: rgba(255, 255, 255, 0.86);
  --blur-bg: rgba(255, 255, 255, 0.88);
  --card-blur: rgba(255, 255, 255, 0.80);
  --blue: #2776D7;
  --royal-blue: #2776D7;
  --royal-green: #0B8F57;
  --tiffany: #0C9D90;
  --deep-green: #0B4B3F;
  --good: #0B8F57;
  --bad: #D84654;
  --warn: #C47B0E;
  --shadow-sm: 0 12px 32px rgba(49, 65, 60, 0.10);
  --shadow: 0 20px 52px rgba(49, 65, 60, 0.16);
}

html[data-theme="dark"] {
  --bg: #091013;
  --surface: rgba(18, 28, 32, 0.76);
  --surface-2: rgba(26, 41, 46, 0.86);
  --border: rgba(218, 244, 240, 0.10);
  --border-strong: rgba(218, 244, 240, 0.18);
  --text: #F3FBF9;
  --text2: #A9BAB7;
  --text3: #687A78;
  --fill: rgba(255, 255, 255, 0.07);
  --fill2: rgba(255, 255, 255, 0.12);
  --card: rgba(18, 28, 32, 0.78);
  --blur-bg: rgba(18, 28, 32, 0.86);
  --card-blur: rgba(18, 28, 32, 0.72);
}

body,
#device {
  background:
    linear-gradient(115deg, rgba(124, 255, 178, 0.16), transparent 28%),
    linear-gradient(245deg, rgba(108, 183, 255, 0.18), transparent 34%),
    #05090B;
}

html[data-theme="light"] body,
html[data-theme="light"] #device {
  background:
    linear-gradient(115deg, rgba(11, 143, 87, 0.12), transparent 30%),
    linear-gradient(245deg, rgba(39, 118, 215, 0.12), transparent 36%),
    #DDE5E0;
}

#app {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(145deg, rgba(124, 255, 178, 0.10), transparent 42%),
    linear-gradient(315deg, rgba(255, 111, 125, 0.09), transparent 48%),
    var(--bg);
}

#app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 86px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 62%);
  z-index: 0;
}

@media (min-width: 520px) {
  #app {
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  }
}

#splash {
  background:
    linear-gradient(145deg, rgba(124, 255, 178, 0.14), transparent 46%),
    linear-gradient(315deg, rgba(108, 183, 255, 0.14), transparent 52%),
    var(--bg);
}

.splash-mark {
  filter: drop-shadow(0 18px 32px rgba(124, 255, 178, 0.24));
}

.splash-word,
.splash-tag {
  color: var(--text);
}

.view {
  padding: 18px 16px 116px;
}

#tabbar {
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.tab {
  min-height: 56px;
  border-radius: 18px;
  justify-content: center;
  color: var(--text3);
  font-size: 9px;
}

.tab.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(124, 255, 178, 0.22), rgba(124, 255, 178, 0.08));
  box-shadow: inset 0 0 0 1px rgba(124, 255, 178, 0.20);
}

.tab.active::before {
  display: none;
}

.big-head {
  align-items: center;
  margin: 4px 0 18px;
}

.big-title {
  font-size: 27px;
  line-height: 1.05;
}

.big-sub {
  color: var(--text2);
}

.brandline {
  color: var(--accent);
}

.card,
.list,
.stat,
.project-row,
.task-card,
.tile,
.goal-card,
.quick-expense,
.insight {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px) saturate(132%);
}

.card,
.project-row,
.task-card,
.tile,
.goal-card {
  position: relative;
  overflow: hidden;
}

.card::before,
.project-row::before,
.task-card::before,
.tile::before,
.goal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255,255,255,0.10), transparent 42%);
}

.hero {
  padding: 18px;
  color: #F7FFFC;
  background:
    linear-gradient(145deg, rgba(124, 255, 178, 0.24), rgba(94, 231, 209, 0.06) 48%, rgba(255, 111, 125, 0.14)),
    rgba(15, 26, 29, 0.90);
  border: 1px solid rgba(124, 255, 178, 0.24);
  border-left: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255,255,255,0.12);
}

.hero::after {
  display: block;
  content: "";
  position: absolute;
  right: 18px;
  top: 18px;
  width: 54px;
  height: 20px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent), #5EE7D1);
  box-shadow: 0 0 26px rgba(124, 255, 178, 0.42);
}

.hero .lb {
  color: rgba(247, 255, 252, 0.74);
}

.hero .val {
  color: #FFFFFF;
  font-size: 30px;
  margin-bottom: 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.hero-pill .k {
  color: rgba(247, 255, 252, 0.68);
}

.hero-pill .v {
  color: #FFFFFF;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-expense {
  min-height: 72px;
  padding: 14px;
}

.quick-plus,
.row-ic,
.goal-ic,
.tile .t-ic,
.insight .ins-ic,
.avatar,
.logo-mark {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 10px 22px rgba(0,0,0,0.18);
}

.quick-plus,
.btn-primary,
.fab,
.ai-send,
.switch input:checked + .knob,
.cal-day.today,
.checkline.done .cbox {
  background: linear-gradient(135deg, var(--accent), #5EE7D1);
  color: #06100D;
}

.stat {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat .k,
.sec-title {
  color: var(--text2);
}

.stat .v {
  font-size: 20px;
}

.list {
  overflow: hidden;
}

.row {
  min-height: 58px;
}

.row:active,
.icon-btn:active {
  background: var(--fill);
}

.row + .row::before {
  background: rgba(255, 255, 255, 0.07);
}

.icon-btn,
.sheet-x {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(16px);
}

.btn {
  min-height: 44px;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-danger {
  background: rgba(255, 111, 125, 0.12);
  color: var(--bad);
  border-color: rgba(255, 111, 125, 0.24);
}

.seg {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border);
  padding: 4px;
}

.seg-btn {
  color: var(--text2);
}

.seg-btn.on {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.chip {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border);
  color: var(--text2);
}

.chip.on,
.chip[data-active="true"] {
  color: #06100D;
  background: linear-gradient(135deg, var(--accent), #5EE7D1);
  border-color: transparent;
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text2);
}

.page {
  background:
    linear-gradient(145deg, rgba(124, 255, 178, 0.10), transparent 44%),
    var(--bg);
}

.page-head,
.ai-input-bar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-color: var(--border);
  backdrop-filter: blur(22px) saturate(130%);
}

.back-btn {
  color: var(--accent);
}

.sheet {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent 28%),
    color-mix(in srgb, var(--surface-2) 94%, #000);
  border-color: var(--border-strong);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.36);
}

.sheet-dim {
  background: rgba(3, 8, 10, 0.64);
  backdrop-filter: blur(5px);
}

.inp {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border);
  color: var(--text);
}

.inp::placeholder {
  color: var(--text3);
}

.inp:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.switch .knob {
  background: rgba(255, 255, 255, 0.13);
}

.switch .knob::after {
  background: #F7FFFC;
}

.prog,
.hbar-track,
.gantt-track,
.ccard .limitbar {
  background: rgba(255, 255, 255, 0.10);
}

.prog > div,
.project-progress > div span,
.hbar-fill {
  background: linear-gradient(90deg, var(--accent), #5EE7D1);
}

.project-progress.hot > div span {
  background: linear-gradient(90deg, var(--warn), var(--accent));
}

.cal-day {
  border-radius: 8px;
}

.cal-day.sel:not(.today) {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.msg.ai .bub,
.msg.user .bub,
.toast {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(18px);
}

.msg.user .bub {
  background: linear-gradient(135deg, var(--accent), #5EE7D1);
  color: #06100D;
}

.ccard {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.ccard::after {
  display: none;
}

/* Stronger glass pass */
:root {
  --glass-bg: rgba(14, 27, 30, 0.44);
  --glass-bg-2: rgba(22, 39, 43, 0.34);
  --glass-line: rgba(255, 255, 255, 0.22);
  --glass-line-soft: rgba(255, 255, 255, 0.10);
  --glass-shine: rgba(255, 255, 255, 0.18);
  --glass-blur: 34px;
}

html[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.46);
  --glass-bg-2: rgba(255, 255, 255, 0.30);
  --glass-line: rgba(255, 255, 255, 0.62);
  --glass-line-soft: rgba(32, 57, 53, 0.12);
  --glass-shine: rgba(255, 255, 255, 0.62);
}

#app {
  background:
    linear-gradient(160deg, rgba(124, 255, 178, 0.20), transparent 29%),
    linear-gradient(20deg, rgba(108, 183, 255, 0.16), transparent 44%),
    linear-gradient(205deg, rgba(255, 111, 125, 0.12), transparent 54%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 42px),
    var(--bg);
}

#app::before {
  background:
    linear-gradient(115deg, rgba(255,255,255,0.10), transparent 22%, rgba(124,255,178,0.08) 44%, transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 86px);
}

.card,
.list,
.stat,
.project-row,
.task-card,
.tile,
.goal-card,
.quick-expense,
.insight,
.ccard {
  background:
    linear-gradient(145deg, var(--glass-shine), transparent 38%),
    linear-gradient(315deg, rgba(124, 255, 178, 0.08), transparent 42%),
    linear-gradient(180deg, var(--glass-bg), var(--glass-bg-2));
  border-color: var(--glass-line-soft);
  box-shadow:
    inset 0 1px 0 var(--glass-line),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 22px 52px rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}

.card::before,
.project-row::before,
.task-card::before,
.tile::before,
.goal-card::before {
  background:
    linear-gradient(125deg, rgba(255,255,255,0.28), transparent 20%, transparent 62%, rgba(255,255,255,0.08)),
    linear-gradient(180deg, rgba(255,255,255,0.10), transparent 34%);
  opacity: 0.9;
}

.hero {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.22), transparent 32%),
    linear-gradient(320deg, rgba(124, 255, 178, 0.24), transparent 48%),
    linear-gradient(180deg, rgba(13, 31, 31, 0.52), rgba(11, 20, 23, 0.30));
  border-color: rgba(124, 255, 178, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    0 28px 70px rgba(0,0,0,0.36),
    0 0 0 1px rgba(124,255,178,0.08);
  backdrop-filter: blur(40px) saturate(185%);
  -webkit-backdrop-filter: blur(40px) saturate(185%);
}

.hero-pill,
.icon-btn,
.sheet-x,
.btn-ghost,
.seg,
.chip,
.badge,
.inp,
.ai-input-bar input {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.055));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 10px 24px rgba(0,0,0,0.14);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

#tabbar,
.page-head,
.ai-input-bar,
.sheet,
.toast,
.msg.ai .bub {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.055)),
    rgba(12, 23, 26, 0.48);
  border-color: rgba(255,255,255,0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 20px 52px rgba(0,0,0,0.32);
  backdrop-filter: blur(38px) saturate(180%);
  -webkit-backdrop-filter: blur(38px) saturate(180%);
}

.sheet {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent 28%),
    linear-gradient(145deg, rgba(124,255,178,0.08), transparent 42%),
    rgba(12, 23, 26, 0.58);
}

.row + .row::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

.tab.active {
  background:
    linear-gradient(145deg, rgba(124, 255, 178, 0.34), rgba(255,255,255,0.09));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 0 0 1px rgba(124, 255, 178, 0.26),
    0 12px 30px rgba(124, 255, 178, 0.12);
}

/* Royal blue colorway */
:root {
  --accent: #2F63FF;
  --accent-hover: #1E49E8;
  --accent-soft: rgba(47, 99, 255, 0.16);
  --accent-border: rgba(47, 99, 255, 0.38);
  --bg: #070B16;
  --surface: rgba(16, 23, 42, 0.72);
  --surface-2: rgba(21, 31, 55, 0.82);
  --border: rgba(203, 216, 255, 0.12);
  --border-strong: rgba(203, 216, 255, 0.22);
  --text: #F5F8FF;
  --text2: #A9B8D6;
  --text3: #64708D;
  --sep: rgba(203, 216, 255, 0.12);
  --fill: rgba(255, 255, 255, 0.075);
  --fill2: rgba(255, 255, 255, 0.13);
  --card: rgba(16, 23, 42, 0.70);
  --blur-bg: rgba(16, 23, 42, 0.78);
  --card-blur: rgba(16, 23, 42, 0.64);
  --blue: #2F63FF;
  --royal-blue: #2F63FF;
  --royal-green: #7CFFB2;
  --tiffany: #5AD7FF;
  --deep-green: #103357;
  --good: #7CFFB2;
  --bad: #FF6F8C;
  --warn: #FFD166;
  --glass-bg: rgba(13, 22, 46, 0.46);
  --glass-bg-2: rgba(26, 39, 74, 0.34);
  --glass-line: rgba(221, 230, 255, 0.24);
  --glass-line-soft: rgba(221, 230, 255, 0.12);
  --glass-shine: rgba(229, 235, 255, 0.18);
}

html[data-theme="dark"] {
  --bg: #070B16;
  --surface: rgba(16, 23, 42, 0.72);
  --surface-2: rgba(21, 31, 55, 0.82);
  --border: rgba(203, 216, 255, 0.12);
  --border-strong: rgba(203, 216, 255, 0.22);
  --text: #F5F8FF;
  --text2: #A9B8D6;
  --text3: #64708D;
  --fill: rgba(255, 255, 255, 0.075);
  --fill2: rgba(255, 255, 255, 0.13);
  --card: rgba(16, 23, 42, 0.70);
  --blur-bg: rgba(16, 23, 42, 0.78);
  --card-blur: rgba(16, 23, 42, 0.64);
}

html[data-theme="light"] {
  --accent: #244EEB;
  --accent-hover: #183DCA;
  --accent-soft: rgba(36, 78, 235, 0.12);
  --accent-border: rgba(36, 78, 235, 0.26);
  --bg: #E9EEFF;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-2: rgba(247, 249, 255, 0.88);
  --border: rgba(32, 48, 92, 0.12);
  --border-strong: rgba(32, 48, 92, 0.20);
  --text: #11182E;
  --text2: #5E6D91;
  --text3: #8794B2;
  --blue: #244EEB;
  --royal-blue: #244EEB;
  --glass-bg: rgba(255, 255, 255, 0.48);
  --glass-bg-2: rgba(255, 255, 255, 0.32);
  --glass-line: rgba(255, 255, 255, 0.66);
  --glass-line-soft: rgba(32, 48, 92, 0.13);
}

body,
#device {
  background:
    radial-gradient(circle at 18% 18%, rgba(47, 99, 255, 0.42), transparent 28%),
    radial-gradient(circle at 82% 30%, rgba(90, 215, 255, 0.22), transparent 32%),
    linear-gradient(245deg, rgba(47, 99, 255, 0.24), transparent 38%),
    #030611;
}

html[data-theme="light"] body,
html[data-theme="light"] #device {
  background:
    radial-gradient(circle at 18% 18%, rgba(36, 78, 235, 0.18), transparent 30%),
    radial-gradient(circle at 82% 30%, rgba(90, 215, 255, 0.16), transparent 34%),
    #DDE5FF;
}

#app {
  background:
    linear-gradient(160deg, rgba(47, 99, 255, 0.28), transparent 30%),
    linear-gradient(20deg, rgba(90, 215, 255, 0.16), transparent 44%),
    linear-gradient(205deg, rgba(124, 255, 178, 0.10), transparent 56%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 42px),
    var(--bg);
}

#app::before {
  background:
    linear-gradient(115deg, rgba(255,255,255,0.10), transparent 22%, rgba(47,99,255,0.13) 45%, transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 86px);
}

#splash {
  background:
    linear-gradient(145deg, rgba(47, 99, 255, 0.24), transparent 46%),
    linear-gradient(315deg, rgba(90, 215, 255, 0.16), transparent 52%),
    var(--bg);
}

.splash-mark {
  filter: drop-shadow(0 18px 32px rgba(47, 99, 255, 0.34));
}

.card,
.list,
.stat,
.project-row,
.task-card,
.tile,
.goal-card,
.quick-expense,
.insight,
.ccard {
  background:
    linear-gradient(145deg, var(--glass-shine), transparent 38%),
    linear-gradient(315deg, rgba(47, 99, 255, 0.12), transparent 43%),
    linear-gradient(180deg, var(--glass-bg), var(--glass-bg-2));
}

.hero {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.22), transparent 32%),
    linear-gradient(320deg, rgba(47, 99, 255, 0.36), transparent 50%),
    linear-gradient(180deg, rgba(13, 24, 54, 0.54), rgba(8, 14, 30, 0.32));
  border-color: rgba(47, 99, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    0 28px 70px rgba(0,0,0,0.36),
    0 0 0 1px rgba(47,99,255,0.16),
    0 0 42px rgba(47,99,255,0.10);
}

.hero::after {
  background: linear-gradient(90deg, var(--accent), #5AD7FF);
  box-shadow: 0 0 28px rgba(47, 99, 255, 0.54);
}

.quick-plus,
.btn-primary,
.fab,
.ai-send,
.switch input:checked + .knob,
.cal-day.today,
.checkline.done .cbox {
  background: linear-gradient(135deg, var(--accent), #5AD7FF);
  color: #F8FBFF;
}

.chip.on,
.chip[data-active="true"] {
  color: #F8FBFF;
  background: linear-gradient(135deg, var(--accent), #5AD7FF);
}

.prog > div,
.project-progress > div span,
.hbar-fill {
  background: linear-gradient(90deg, var(--accent), #5AD7FF);
}

.project-progress.hot > div span {
  background: linear-gradient(90deg, var(--accent), var(--good));
}

.msg.user .bub {
  background: linear-gradient(135deg, var(--accent), #5AD7FF);
  color: #F8FBFF;
}

.sheet {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent 28%),
    linear-gradient(145deg, rgba(47,99,255,0.14), transparent 42%),
    rgba(11, 18, 39, 0.62);
}

.tab.active {
  background:
    linear-gradient(145deg, rgba(47, 99, 255, 0.40), rgba(255,255,255,0.10));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 0 0 1px rgba(47, 99, 255, 0.32),
    0 12px 30px rgba(47, 99, 255, 0.18);
}

/* App identity and standardized vector icons */
.brandline-logo {
  margin-bottom: 8px;
  letter-spacing: 0;
}

.brandline-logo img {
  display: block;
  width: 142px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(47, 99, 255, 0.30));
}

.row-ic,
.goal-ic,
.tile .t-ic,
.insight .ins-ic,
.ai-avatar {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.20), rgba(47,99,255,0.28)),
    rgba(17, 27, 58, 0.62) !important;
  border: 1px solid rgba(221, 230, 255, 0.16);
  color: #F5F8FF !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.24),
    0 10px 24px rgba(0,0,0,0.20),
    0 0 18px rgba(47,99,255,0.12);
}

.row-ic .ic,
.goal-ic .ic,
.tile .t-ic .ic,
.insight .ins-ic .ic {
  color: #DCE7FF;
  stroke-width: 1.9;
}

.brand-badge {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #F5F8FF;
}

.brand-badge svg {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(90, 215, 255, 0.18));
}

.brand-disney,
.brand-icloud {
  color: #BFD9FF;
}

.brand-nubank,
.brand-itau,
.brand-netflix,
.brand-spotify,
.brand-vivo {
  color: #F5F8FF;
}

.ccard-head {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.ccard-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.20), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
}

.ccard-logo .brand-badge,
.ccard-logo .brand-badge svg {
  width: 30px;
  height: 30px;
}

.ai-view {
  flex: 1;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden !important;
}

.ai-view .ai-wrap {
  height: 100%;
  min-height: 0;
}

.ai-view .ai-scroll {
  min-height: 0;
  padding-bottom: 12px;
}

.ai-view .ai-input-bar {
  flex: none;
  margin-top: auto;
  padding: 10px 14px calc(110px + env(safe-area-inset-bottom));
}

/* Light theme tabbar readability */
html[data-theme="light"] #tabbar {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.78), rgba(235,241,255,0.54)),
    rgba(244, 247, 255, 0.78);
  border-color: rgba(33, 56, 120, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.92),
    0 18px 42px rgba(36, 78, 235, 0.18),
    0 8px 24px rgba(17, 24, 46, 0.10);
}

html[data-theme="light"] .tab {
  color: #435173;
  text-shadow: none;
}

html[data-theme="light"] .tab .ic {
  color: #34415F;
  stroke-width: 2;
}

html[data-theme="light"] .tab span {
  color: #34415F;
  font-weight: 800;
}

html[data-theme="light"] .tab.active {
  color: #FFFFFF;
  background:
    linear-gradient(145deg, #244EEB, #5A8DFF);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 0 0 1px rgba(36, 78, 235, 0.35),
    0 12px 26px rgba(36, 78, 235, 0.30);
}

html[data-theme="light"] .tab.active .ic,
html[data-theme="light"] .tab.active span {
  color: #FFFFFF;
}

/* Modal readability fix */
#overlays {
  position: absolute;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

#overlays > * {
  pointer-events: auto;
}

.sheet-wrap {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.sheet-dim {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.68);
  opacity: 0;
  transition: opacity .22s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 430px;
  max-height: min(82dvh, 720px);
  display: flex;
  flex-direction: column;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), transparent 32%),
    rgba(9, 15, 32, 0.94);
  border: 1px solid rgba(203, 216, 255, 0.20);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 -18px 70px rgba(0, 0, 0, 0.56);
  transform: translateY(105%);
  transition: transform .26s cubic-bezier(.32, .72, .28, 1);
  overflow: hidden;
  backdrop-filter: blur(34px) saturate(160%);
  -webkit-backdrop-filter: blur(34px) saturate(160%);
}

.sheet-wrap.in .sheet {
  transform: translateY(0);
}

.sheet-wrap.in .sheet-dim {
  opacity: 1;
}

.sheet-grab {
  flex: none;
  width: 38px;
  height: 4px;
  margin: 4px auto 12px;
  border-radius: 999px;
  background: rgba(203, 216, 255, 0.40);
}

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

.sheet-head h3 {
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  white-space: normal;
}

.sheet-x {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(203, 216, 255, 0.18);
  box-shadow: none;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 1px 4px;
  scrollbar-width: none;
}

.sheet-body::-webkit-scrollbar {
  display: none;
}

.sheet-body .row-s,
.sheet-body .confirm-msg {
  color: #C7D2EA;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.45;
}

.sheet-body .field {
  margin-bottom: 12px;
}

.sheet-body .field-lb {
  color: #C7D2EA;
}

.sheet-body .inp {
  min-height: 46px;
  color: #F8FBFF;
  background: rgba(255,255,255,0.10);
  border-color: rgba(203, 216, 255, 0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.sheet-body .inp::placeholder {
  color: #7E8BA8;
}

.sheet-body .btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sheet-body .btn {
  min-width: 0;
  min-height: 46px;
  white-space: normal;
  line-height: 1.2;
}

.sheet-body .btn-ghost {
  color: #F8FBFF;
  background: rgba(255,255,255,0.10);
  border-color: rgba(203, 216, 255, 0.18);
  box-shadow: none;
}

.sheet-body .btn-primary {
  color: #FFFFFF;
}

html[data-theme="light"] .sheet {
  color: #0F172A;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), transparent 36%),
    rgba(245, 248, 255, 0.96);
  border-color: rgba(47, 99, 255, 0.20);
}

html[data-theme="light"] .sheet-head h3,
html[data-theme="light"] .sheet-x,
html[data-theme="light"] .sheet-body .inp,
html[data-theme="light"] .sheet-body .btn-ghost {
  color: #0F172A;
}

html[data-theme="light"] .sheet-body .row-s,
html[data-theme="light"] .sheet-body .confirm-msg,
html[data-theme="light"] .sheet-body .field-lb {
  color: #475569;
}

html[data-theme="light"] .sheet-body .inp,
html[data-theme="light"] .sheet-body .btn-ghost,
html[data-theme="light"] .sheet-x {
  background: rgba(255,255,255,0.72);
  border-color: rgba(15, 23, 42, 0.10);
}

@media (min-width: 520px) {
  .sheet-wrap {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    max-width: 390px;
    max-height: min(78dvh, 680px);
    border-radius: 22px;
    border-bottom: 1px solid rgba(203, 216, 255, 0.20);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.20),
      0 26px 90px rgba(0, 0, 0, 0.46);
  }
}

@media (max-width: 360px) {
  .sheet {
    padding-inline: 14px;
  }

  .sheet-body .btn-row {
    grid-template-columns: 1fr;
  }
}
