/* ==========================================
   Zaboe — styles
   1. Tokens & themes   2. Base   3. Buttons & forms
   4. Landing & auth    5. App shell   6. Cards & KPIs
   7. Dashboard         8. Tables & lists   9. Sheets
   10. Learn            11. Tools   12. Misc   13. Responsive
   ========================================== */

/* 1. TOKENS ------------------------------------------------ */
:root {
  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2.25rem;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --ease: cubic-bezier(.2,.8,.2,1);

  --sidebar-w: 248px;
}

[data-theme="light"] {
  --bg: #F2F4F7;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --surface-3: #ECEFF3;
  --border: #E2E6EC;
  --text: #0E1A2B;
  --muted: #5A6878;
  --faint: #8A96A5;
  --brand: #0F2A4F;
  --primary: #1D64D8;
  --primary-ink: #FFFFFF;
  --primary-soft: #E6EEFB;
  --gain: #0B8F5F;
  --gain-soft: #E3F4EC;
  --loss: #D4383E;
  --loss-soft: #FBE9EA;
  --warn: #B86A10;
  --warn-soft: #FBF0DF;
  --streak: #F27A00;
  --streak-soft: #FFF0DE;
  --xp: #7A4DE0;
  --shadow: 0 1px 2px rgba(14,26,43,.05), 0 2px 10px rgba(14,26,43,.04);
  --shadow-lg: 0 20px 60px rgba(14,26,43,.18);
}

[data-theme="dark"] {
  --bg: #0A111D;
  --surface: #111A29;
  --surface-2: #162133;
  --surface-3: #1D2A3F;
  --border: #233149;
  --text: #E7EDF6;
  --muted: #9AA8BB;
  --faint: #6F7E93;
  --brand: #E7EDF6;
  --primary: #4F8EF7;
  --primary-ink: #06101F;
  --primary-soft: #18294A;
  --gain: #2FD39A;
  --gain-soft: #10302A;
  --loss: #FF6B70;
  --loss-soft: #3A1A20;
  --warn: #F2B04A;
  --warn-soft: #36290F;
  --streak: #FF9B2F;
  --streak-soft: #3A2610;
  --xp: #A88BFF;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.55);
}

/* 2. BASE -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h2 { font-size: var(--text-xl); font-family: var(--font-display); letter-spacing: -0.01em; }
h3 { font-size: var(--text-base); }
svg { width: 20px; height: 20px; flex-shrink: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.muted { color: var(--muted); }
.sm { font-size: var(--text-sm); }
.center { text-align: center; }
.num, .amt, td.money, .kpi-value, .hero-value { font-variant-numeric: tabular-nums lining-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--brand);
}
.wordmark span { color: var(--primary); }
.wordmark.center { text-align: center; margin-bottom: 1rem; }

/* Privacy mode */
.privacy .amt { filter: blur(7px); user-select: none; transition: filter .2s; }

/* 3. BUTTONS & FORMS -------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.05rem;
  border-radius: var(--r-sm);
  font-weight: 700; font-size: var(--text-sm);
  transition: background .15s, transform .1s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--loss); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--loss); border-color: var(--loss-soft); }
.btn.danger-ghost:hover { background: var(--loss-soft); }
.btn.success { background: var(--gain); color: #fff; }
.btn.block { width: 100%; }
.btn.lg { padding: .85rem 1.4rem; font-size: var(--text-base); border-radius: var(--r); }
.btn.sm { padding: .45rem .75rem; font-size: var(--text-xs); }
.btn[disabled] { opacity: .6; pointer-events: none; }

.link { color: var(--primary); font-weight: 700; font-size: var(--text-sm); }
.link:hover { text-decoration: underline; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

label { display: block; font-size: var(--text-sm); font-weight: 500; color: var(--muted); margin: .7rem 0 .3rem; }
input, select, textarea {
  width: 100%;
  font: inherit; font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .62rem .75rem;
  transition: border-color .15s, box-shadow .15s;
}
input[type="number"] { font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[aria-invalid="true"] { border-color: var(--loss); }
textarea { resize: vertical; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .85rem; }
.form-row .full { grid-column: 1 / -1; }
.form-error { color: var(--loss); font-size: var(--text-sm); min-height: 1.2em; margin-top: .5rem; }
.row-gap { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.row-gap.end { justify-content: flex-end; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.mini-select { width: auto; padding: .2rem 1.6rem .2rem .5rem; font-size: var(--text-sm); font-weight: 700; border: 0; background-color: transparent; color: var(--muted); margin-left: -.5rem; }

/* 4. LANDING & AUTH --------------------------------------- */
.landing { min-height: 100dvh; display: flex; flex-direction: column; }
.landing-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem clamp(1rem, 5vw, 4rem); }
.landing-brand { display: flex; flex-direction: column; gap: .1rem; }
.landing-brand span { color: var(--muted); font-size: .72rem; font-weight: 600; }
.landing-hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 5vw, 4rem);
  max-width: 1240px; margin: 0 auto; width: 100%;
}
.eyebrow { font-size: var(--text-sm); font-weight: 700; color: var(--primary); letter-spacing: .02em; margin-bottom: 1rem; }
.landing-copy h1 { font-family: var(--font-display); font-size: clamp(1.1rem, 3vw, 2.65rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; }
.lede { font-size: var(--text-lg); color: var(--muted); margin: 1.25rem 0 1.75rem; max-width: 46ch; }
.landing-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.landing .hint { margin-top: .9rem; font-size: var(--text-sm); color: var(--faint); }

.landing-visual { display: flex; justify-content: center; }
.lv-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 1.5rem; box-shadow: var(--shadow-lg); color: var(--gain);
  transform: rotate(-1.5deg);
}
.lv-top { display: flex; justify-content: space-between; align-items: center; }
.lv-label { color: var(--muted); font-size: var(--text-sm); font-weight: 500; }
.lv-value { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.lv-spark { width: 100%; height: 90px; margin: .75rem 0; }
.lv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.lv-row span { display: block; font-size: var(--text-xs); color: var(--muted); }
.lv-row strong { color: var(--text); font-size: var(--text-lg); font-variant-numeric: tabular-nums; }

.landing-features {
  max-width: 1240px; width: 100%; margin: 0 auto; padding: 1rem clamp(1rem, 5vw, 4rem) 3rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.4rem; }
.feature-card svg { width: 28px; height: 28px; color: var(--primary); margin-bottom: .9rem; }
.feature-card:first-child svg { color: var(--streak); }
.feature-card h3 { margin-bottom: .35rem; }
.feature-card p { color: var(--muted); font-size: var(--text-sm); }
.landing-footer { margin-top: auto; text-align: center; padding: 1.5rem; color: var(--faint); font-size: var(--text-sm); }

.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.75rem; box-shadow: var(--shadow); }
.auth-card h2 { font-size: var(--text-xl); margin-bottom: .25rem; text-align: center; }
.auth-card .btn.block { margin-top: 1.25rem; }
.auth-card .btn.ghost.block { margin-top: .5rem; }
.auth-card .back { display: inline-block; margin-bottom: .5rem; }
.switch { text-align: center; margin-top: 1rem; font-size: var(--text-sm); color: var(--muted); }
#auth-message, #setup-message { text-align: center; color: var(--loss); font-size: var(--text-sm); min-height: 1.2em; margin-top: 1rem; }
#auth-message.ok, #setup-message.ok { color: var(--muted); }
.pw-meter { height: 4px; background: var(--surface-3); border-radius: 4px; margin-top: .5rem; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--loss); transition: width .25s, background .25s; }
.auth-card .hint { font-size: var(--text-xs); color: var(--faint); margin-top: .35rem; }

/* 5. APP SHELL -------------------------------------------- */
#app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 1rem;
}
.sidebar .wordmark { padding: 0 .5rem; }
.biz-switch { display: flex; align-items: center; gap: .65rem; padding: .6rem; border-radius: var(--r); background: var(--surface-2); text-align: left; width: 100%; }
.biz-switch:hover { background: var(--surface-3); }
.biz-avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); flex-shrink: 0; }
.biz-meta { display: flex; flex-direction: column; min-width: 0; }
.biz-meta strong { font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-meta small { font-size: var(--text-xs); color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button {
  display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 10px;
  font-weight: 500; font-size: var(--text-sm); color: var(--muted); text-align: left;
}
.side-nav button:hover { background: var(--surface-2); color: var(--text); }
.side-nav button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-sep { height: 1px; background: var(--border); margin: .5rem .25rem; }
.side-foot { margin-top: auto; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .85rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar h1 { font-size: var(--text-lg); font-family: var(--font-body); }
.topbar-actions { display: flex; align-items: center; gap: .35rem; }
.mobile-only { display: none; }
.demo-pill { font-size: var(--text-xs); font-weight: 700; background: var(--warn-soft); color: var(--warn); padding: .25rem .6rem; border-radius: 99px; margin-right: .25rem; }

.streak-chip, .xp-chip {
  display: inline-flex; align-items: center; gap: .3rem; font-weight: 800; font-size: var(--text-sm);
  padding: .3rem .6rem; border-radius: 99px; font-variant-numeric: tabular-nums;
}
.streak-chip { color: var(--streak); background: var(--streak-soft); }
.streak-chip svg { width: 16px; height: 16px; }
.streak-chip.big { padding: .4rem .7rem; }
.streak-chip.cold { color: var(--faint); background: var(--surface-3); }
.xp-chip { color: var(--xp); background: color-mix(in srgb, var(--xp) 14%, transparent); }
.xp-chip svg { width: 15px; height: 15px; }

main { padding: .5rem clamp(1rem, 3vw, 2rem) 3rem; max-width: 1280px; width: 100%; }
.view { display: none; }
.view.active { display: block; animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tabbar, .floating-add { display: none; }

/* 6. CARDS & KPIs ----------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.25rem; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card h3 { margin-bottom: .75rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .85rem; }
.card-head h3 { margin: 0; }
.card-head.pad { padding: 1.1rem 1.25rem .25rem; }
.label { font-size: var(--text-sm); color: var(--muted); font-weight: 500; }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 1rem 0 1.25rem; }
.section-head p { font-size: var(--text-sm); margin-top: .2rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .85rem; margin: 1rem 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: var(--text-xs); color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; gap: .5rem; }
.kpi-value { font-size: 1.4rem; font-weight: 700; margin-top: .3rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: var(--text-xs); color: var(--faint); margin-top: .15rem; }
.kpi-value.pos { color: var(--gain); }
.kpi-value.neg { color: var(--loss); }
.info { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--muted); cursor: help; flex-shrink: 0; }

.delta { display: inline-flex; align-items: center; gap: .25rem; font-size: var(--text-sm); font-weight: 700; padding: .15rem .5rem; border-radius: 99px; }
.delta svg { width: 14px; height: 14px; }
.delta.up { color: var(--gain); background: var(--gain-soft); }
.delta.down { color: var(--loss); background: var(--loss-soft); }
.delta.flat { color: var(--muted); background: var(--surface-3); }

.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .65rem; margin-bottom: 1rem; }
.strip-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: .7rem .9rem; }
.strip-item .lbl { font-size: var(--text-xs); color: var(--muted); }
.strip-item .val { font-weight: 700; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.strip-item.green .val { color: var(--gain); }
.strip-item.red .val { color: var(--loss); }
.strip-item.amber .val { color: var(--warn); }

.recurring-dashboard-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-color: var(--warn);
  background: var(--warn-soft);
}
.recurring-dashboard-alert p { margin-top: .25rem; }
.recurring-reminder { border-left: 4px solid var(--warn); }
.recurring-reminder ul { margin: .55rem 0 0 1.15rem; color: var(--muted); }
.recurring-table { min-width: 820px; }
.recurring-table td:first-child small,
.recurring-table td.money small,
.recurring-table td:nth-child(3) small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
}
.recurring-status {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: capitalize;
}
.recurring-status.overdue { background: var(--warn-soft); color: var(--warn); }
.recurring-status.paused,
.recurring-status.ended { background: var(--surface-3); color: var(--muted); }
.recurring-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; min-width: 250px; }
.recurring-integrations { display: grid; justify-items: start; gap: .6rem; }
.recurring-integrations h3,
.recurring-integrations p { margin: 0; }
.recurring-integrations .btn { max-width: 100%; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; width: 100%; }
.integration-card { display: grid; align-content: start; justify-items: start; gap: .6rem; min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.integration-card h4 { font-size: var(--text-base); }
.integration-card p { margin: 0; }
.integration-card .tt-check { align-items: flex-start; font-size: var(--text-sm); }
.integration-card .row-gap { flex-wrap: wrap; }
.bank-data-summary { display: grid; gap: .65rem; width: 100%; }
.bank-summary-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.bank-summary-strip > div { display: grid; gap: .15rem; padding: .65rem; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.bank-summary-strip small,
.bank-account-row span { color: var(--muted); font-size: var(--text-xs); }
.bank-summary-strip strong { overflow-wrap: anywhere; }
.bank-accounts { display: grid; gap: .35rem; width: 100%; }
.bank-account-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.bank-account-row span { text-align: right; }
.bank-transactions { min-width: 600px; }
.bank-transactions td small { display: block; color: var(--muted); font-size: var(--text-xs); }

/* 7. DASHBOARD -------------------------------------------- */
.greet { display: flex; justify-content: space-between; align-items: flex-end; margin: .75rem 0 1rem; }
.greet p { font-size: var(--text-sm); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.stack-grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.dash-grid > *, .stack-grid > * { min-width: 0; }
.more-row { display: flex; justify-content: center; padding: 1rem; border-top: 1px solid var(--border); }
.dash-grid.three { grid-template-columns: repeat(3, 1fr); }
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.hero-head .label { display: none; }
.hero-value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; margin: .25rem 0 .35rem; }
.hero-chart { height: 220px; margin-top: .75rem; position: relative; }
.chart-box { height: 260px; position: relative; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { padding: .3rem .6rem; border-radius: 8px; font-size: var(--text-xs); font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg.wide { display: flex; margin-top: .85rem; }
.seg.wide button { flex: 1; padding: .5rem; }

.checkin-card { display: flex; flex-direction: column; gap: .9rem; }
.checkin-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.checkin-head h3 { margin: .15rem 0 0; font-size: var(--text-lg); }
.ring {
  --p: 0; width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--streak) calc(var(--p) * 1%), var(--surface-3) 0);
  display: grid; place-items: center; transition: --p .6s;
}
.ring span { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.wd { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: var(--text-xs); color: var(--faint); font-weight: 500; }
.wd i { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: #fff; }
.wd i svg { width: 15px; height: 15px; }
.wd.done i { background: var(--streak); }
.wd.today { color: var(--text); font-weight: 700; }
.wd.today i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--streak); }
.tasks { list-style: none; display: grid; gap: .45rem; }
.tasks li { display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 10px; background: var(--surface-2); font-size: var(--text-sm); }
.tasks li .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.tasks li.done .tick { background: var(--gain); border-color: var(--gain); }
.tasks li.done .tick svg { width: 13px; height: 13px; }
.tasks li.done .t-text { color: var(--muted); text-decoration: line-through; }
.tasks li .t-text { flex: 1; }
.tasks li .t-xp { font-size: var(--text-xs); font-weight: 700; color: var(--xp); }
.tasks li button.t-go { font-size: var(--text-xs); font-weight: 700; color: var(--primary); }

.score-pill { font-weight: 800; font-size: var(--text-sm); padding: .25rem .65rem; border-radius: 99px; font-variant-numeric: tabular-nums; }
.score-pill.good { background: var(--gain-soft); color: var(--gain); }
.score-pill.warn { background: var(--warn-soft); color: var(--warn); }
.score-pill.bad { background: var(--loss-soft); color: var(--loss); }
.health { list-style: none; display: grid; gap: .5rem; }
.health li { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--text-sm); padding: .55rem .7rem; border-radius: 10px; background: var(--surface-2); }
.health li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: .45rem; flex-shrink: 0; }
.health li.good::before { background: var(--gain); }
.health li.warn::before { background: var(--warn); }
.health li.bad::before { background: var(--loss); }

.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .6s var(--ease); }
.bar.warn span { background: var(--warn); }
.bar.bad span { background: var(--loss); }
.bar.good span { background: var(--gain); }
.meter-row { margin-bottom: 1rem; }
.meter-row:last-child { margin-bottom: 0; }
.meter-top { display: flex; justify-content: space-between; font-size: var(--text-sm); margin-bottom: .4rem; gap: .5rem; }
.meter-top strong { font-variant-numeric: tabular-nums; }
.meter-row .muted { font-size: var(--text-xs); margin-top: .35rem; }

.cat-row { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; margin-bottom: .8rem; font-size: var(--text-sm); }
.cat-row .bar { grid-column: 1 / -1; height: 6px; }
.cat-row strong { font-variant-numeric: tabular-nums; }

/* 8. TABLES & LISTS --------------------------------------- */
.toolbar { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type="search"] { flex: 1; min-width: 180px; max-width: 360px; }
.toolbar select { width: auto; min-width: 180px; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chips button { padding: .4rem .8rem; border-radius: 99px; font-size: var(--text-sm); font-weight: 500; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.chips button.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.date-pair { display: flex; align-items: center; gap: .5rem; }
.date-pair input { width: auto; }

.table-wrap { overflow-x: auto; }
.table-scroll-top { display: none; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th { text-align: left; font-weight: 500; font-size: var(--text-xs); color: var(--muted); padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
th.money, td.money { text-align: right; white-space: nowrap; }
td.money.pos { color: var(--gain); font-weight: 700; }
td.money.neg { color: var(--loss); font-weight: 700; }
td .desc { font-weight: 500; }
td .sub { display: block; font-size: var(--text-xs); color: var(--faint); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions button { font-size: var(--text-xs); font-weight: 700; padding: .35rem .55rem; border-radius: 6px; color: var(--muted); }
.row-actions button:hover { background: var(--surface-3); color: var(--text); }
.row-actions button.pay { color: var(--gain); }
.row-actions button.del:hover { color: var(--loss); background: var(--loss-soft); }
.table-foot { padding: .75rem 1rem; text-align: right; font-size: var(--text-sm); color: var(--muted); border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
tr.total-row td { font-weight: 700; background: var(--surface-2); }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: var(--text-xs); font-weight: 700; white-space: nowrap; }
.badge.quoted { background: var(--surface-3); color: var(--muted); }
.badge.inprogress { background: var(--warn-soft); color: var(--warn); }
.badge.completed { background: var(--primary-soft); color: var(--primary); }
.badge.paid { background: var(--gain-soft); color: var(--gain); }
.badge.overdue { background: var(--loss-soft); color: var(--loss); }
.badge.auto { background: color-mix(in srgb, var(--xp) 14%, transparent); color: var(--xp); margin-left: .35rem; }

.list { display: grid; }
.list > * { min-width: 0; }
.list-item { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.li-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.li-icon svg { width: 17px; height: 17px; }
.li-icon.in { background: var(--gain-soft); color: var(--gain); }
.li-icon.out { background: var(--loss-soft); color: var(--loss); }
.li-icon.wait { background: var(--warn-soft); color: var(--warn); }
.li-main { flex: 1; min-width: 0; }
.li-main strong { display: block; font-size: var(--text-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main small { font-size: var(--text-xs); color: var(--faint); }
.li-amt { font-weight: 700; font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.li-amt.pos { color: var(--gain); }
.li-amt.neg { color: var(--text); }
.li-item-btn { font-size: var(--text-xs); font-weight: 700; color: var(--gain); padding: .3rem .5rem; border-radius: 6px; background: var(--gain-soft); }

.empty { text-align: center; padding: 2rem 1rem; color: var(--faint); font-size: var(--text-sm); }
.empty strong { display: block; color: var(--text); font-size: var(--text-base); margin-bottom: .25rem; }
.empty .btn { margin-top: .9rem; }

.biz-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: var(--r); margin-bottom: .5rem; }
.biz-row.active { border-color: var(--primary); background: var(--primary-soft); }
.biz-row .meta { font-size: var(--text-xs); color: var(--muted); }
.big-text { font-size: var(--text-lg); font-weight: 700; word-break: break-all; }

.pl { width: 100%; font-size: var(--text-sm); }
.pl td { padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.pl td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.pl tr.sub td { color: var(--muted); padding-left: .9rem; }
.pl tr.sum td { font-weight: 700; border-bottom: 1px solid var(--border); }
.pl tr.grand td { font-weight: 800; font-size: var(--text-base); border-bottom: 0; padding-top: .75rem; }
.pl tbody tr:hover td { background: none; }

.sec-list { list-style: none; display: grid; gap: .25rem; }
.sec-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.sec-list li:last-child { border-bottom: 0; }
.sec-list strong { display: block; font-size: var(--text-sm); }
.sec-list small { color: var(--muted); font-size: var(--text-xs); }
.switch-ui { position: relative; width: 44px; height: 26px; margin: 0; flex-shrink: 0; }
.switch-ui input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-ui span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch-ui span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch-ui input:checked + span { background: var(--gain); }
.switch-ui input:checked + span::after { transform: translateX(18px); }
.switch-ui input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.guest-notice { background: var(--warn-soft); color: var(--text); border-radius: var(--r); padding: .9rem 1rem; margin-top: 1rem; font-size: var(--text-sm); }
.guest-notice .btn { margin-top: .6rem; }
.demo-limit-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: .75rem 1.5rem 0; padding: .75rem 1rem;
  border: 1px solid var(--warn); border-radius: var(--r);
  background: var(--warn-soft); color: var(--text); font-size: var(--text-sm);
}
.demo-limit-banner p { max-width: 76ch; }
.demo-limit-banner .btn { flex: 0 0 auto; }

/* 9. SHEETS ----------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(5,10,20,.5); z-index: 50; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-lg); padding: 1.25rem 1.4rem 1.4rem; box-shadow: var(--shadow-lg);
  animation: pop .25s var(--ease) both;
}
.sheet.wide { width: min(620px, calc(100vw - 2rem)); }
.sheet.small { width: min(380px, calc(100vw - 2rem)); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.sheet-head h2 { font-size: var(--text-xl); }
.mock-checkout-callout { padding: .85rem 1rem; margin: .75rem 0; border-radius: var(--r); background: var(--primary-soft); font-size: var(--text-sm); }
.mock-checkout-callout p { margin-top: .25rem; }
.mock-check-confirm { align-items: flex-start; margin: .9rem 0; }
.mock-check-confirm input { flex: 0 0 auto; margin-top: .2rem; }
.mock-checkout-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.mock-checkout-footer .row-gap { margin-top: 0; }
.confirm-text { font-weight: 500; margin-bottom: .5rem; }
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .5rem; }
.qa { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; padding: 1.1rem; border-radius: var(--r); border: 1px solid var(--border); text-align: left; }
.qa:hover { border-color: var(--primary); }
.qa svg { width: 30px; height: 30px; padding: 6px; border-radius: 10px; margin-bottom: .3rem; }
.qa.in svg { background: var(--gain-soft); color: var(--gain); }
.qa.out svg { background: var(--loss-soft); color: var(--loss); }
.qa small { color: var(--muted); font-size: var(--text-xs); }
.more-list { display: grid; gap: .25rem; }
.more-list button { display: flex; align-items: center; gap: .85rem; padding: .85rem .5rem; border-radius: 10px; font-weight: 500; }
.more-list button:hover { background: var(--surface-2); }
.job-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1rem 0 .25rem; padding: .8rem; background: var(--surface-2); border-radius: var(--r); }
.job-preview div { font-size: var(--text-xs); color: var(--muted); }
.job-preview strong { display: block; color: var(--text); font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.job-preview .pos { color: var(--gain); }
.job-preview .neg { color: var(--loss); }

/* 10. COACH ----------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.coach-workspace { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: .9rem; height: min(78vh, 900px); min-height: 580px; position: relative; }
.coach-workspace.is-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.coach-history { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: .8rem; overflow: hidden; padding: 1rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); transition: opacity .2s ease, padding .2s ease; }
.coach-workspace.is-collapsed .coach-history { padding-inline: 0; border-color: transparent; opacity: 0; pointer-events: none; }
.coach-history-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--text); }
.coach-mobile-close { display: none; }
.coach-new-chat { display: flex; width: 100%; justify-content: center; gap: .55rem; }
.coach-new-chat svg, .coach-insights-toggle svg { width: 17px; height: 17px; }
.coach-history-search { min-height: 42px; padding: .55rem .75rem; border-radius: var(--r); }
.coach-history-list { display: grid; align-content: start; gap: .35rem; flex: 1; min-height: 60px; overflow: auto; overscroll-behavior: contain; }
.coach-history-empty { padding: .8rem .35rem; color: var(--muted); font-size: var(--text-sm); }
.coach-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem; min-width: 0; padding: .45rem; border: 1px solid transparent; border-radius: var(--r); }
.coach-history-item:hover, .coach-history-item.active { background: var(--surface-2); border-color: var(--border); }
.coach-history-select { display: grid; gap: .15rem; min-width: 0; padding: .25rem; text-align: left; }
.coach-history-select strong { overflow: hidden; color: var(--text); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.coach-history-select small { color: var(--muted); font-size: var(--text-xs); }
.coach-history-actions { display: flex; gap: .1rem; }
.coach-history-actions .icon-btn { width: 30px; height: 30px; }
.coach-rename-form { display: grid; grid-column: 1 / -1; gap: .45rem; }
.coach-rename-form input { min-width: 0; min-height: 38px; padding: .4rem .55rem; }
.coach-rename-actions { display: flex; gap: .35rem; }
.coach-history-settings { display: grid; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.coach-history-settings > p { margin: 0; }
.coach-history-toggle { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.coach-history-toggle span { display: grid; gap: .15rem; }
.coach-history-toggle strong { font-size: var(--text-sm); }
.coach-history-toggle small { color: var(--muted); font-size: var(--text-xs); line-height: 1.4; }
.coach-history-toggle input { width: 42px; height: 23px; flex: 0 0 42px; accent-color: var(--primary); }
.coach-main-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.coach-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 66px; padding: .65rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.coach-toolbar-start { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.coach-brand-lockup { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.coach-brand-lockup > span:last-child { display: grid; gap: .05rem; min-width: 0; }
.coach-brand-lockup strong { color: var(--text); font-family: var(--font-display); font-size: var(--text-base); }
.coach-brand-lockup small { color: var(--muted); font-size: var(--text-xs); }
.coach-brand-mark { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 11px; color: var(--primary-ink); background: var(--brand); }
.coach-brand-mark svg { width: 18px; height: 18px; }
.coach-insights-toggle { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.coach-thread { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(.9rem, 3vw, 2rem); }
.coach-answer[hidden], .coach-insights-panel[hidden], .coach-history-backdrop[hidden] { display: none; }
.coach-welcome { width: min(100%, 780px); margin: auto; padding: 1rem 0; text-align: center; }
.coach-welcome h2 { margin: .55rem 0; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.coach-welcome > p { max-width: 560px; margin: 0 auto; }
.coach-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: 1.8rem; text-align: left; }
.coach-suggestion { display: grid; gap: .2rem; min-width: 0; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); text-align: left; transition: border-color .2s ease, transform .2s ease; }
.coach-suggestion:hover { border-color: var(--primary); transform: translateY(-1px); }
.coach-suggestion strong { color: var(--text); font-size: var(--text-sm); }
.coach-suggestion span { color: var(--muted); font-size: var(--text-xs); }
.coach-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-top: 1rem; }
.coach-metric { min-width: 0; padding: .85rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.coach-metric span { display: block; color: var(--muted); font-size: var(--text-xs); }
.coach-metric strong { display: block; margin-top: .2rem; font-size: var(--text-lg); overflow-wrap: anywhere; }
.coach-priorities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.coach-priority { padding: .9rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.coach-priority strong { display: block; margin-bottom: .25rem; }
.coach-priority p { color: var(--muted); font-size: var(--text-sm); }
.coach-answer { display: flex; flex-direction: column; gap: 1.1rem; width: min(100%, 820px); margin: auto; padding: .5rem 0 1rem; }
.coach-message { display: flex; align-items: flex-start; gap: .7rem; max-width: 100%; }
.coach-message.user { justify-content: flex-end; }
.coach-message-bubble { max-width: min(88%, 760px); min-width: 0; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); }
.coach-message.user .coach-message-bubble { border-color: var(--primary-soft); background: var(--primary-soft); }
.coach-message-label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.coach-message-content { color: var(--text); font-size: var(--text-base); line-height: 1.65; overflow-wrap: anywhere; }
.coach-message-content p { margin: 0 0 .65rem; white-space: pre-wrap; }
.coach-message-content p:last-child { margin-bottom: 0; }
.coach-message-content ul, .coach-message-content ol { margin: .4rem 0 .75rem; padding-left: 1.25rem; }
.coach-message-content li + li { margin-top: .25rem; }
.coach-message-content h3 { margin: .7rem 0 .35rem; font-size: var(--text-base); }
.coach-message-content code { padding: .1rem .3rem; border-radius: 5px; background: var(--surface-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.coach-message-content .table-wrap { max-width: 100%; margin: .6rem 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.coach-message-content table { min-width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.coach-message-content th, .coach-message-content td { padding: .5rem .65rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.coach-message-content th { background: var(--surface-3); font-weight: 700; }
.coach-message-content tr:last-child td { border-bottom: 0; }
.coach-message.error .coach-message-bubble { border-color: var(--loss); }
.coach-loading { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); }
.coach-loading::before { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); content: ""; animation: coach-pulse 1s ease-in-out infinite alternate; }
@keyframes coach-pulse { to { opacity: .25; transform: scale(.65); } }
.coach-form { display: grid; gap: .45rem; width: min(100%, 860px); margin: 0 auto; padding: .75rem clamp(.9rem, 3vw, 2rem) .9rem; background: var(--surface); }
.coach-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; align-items: end; padding: .45rem .5rem .45rem .8rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.coach-form textarea { min-height: 44px; max-height: 180px; resize: none; padding: .55rem 0; line-height: 1.5; border: 0; background: transparent; box-shadow: none; }
.coach-form textarea:focus { outline: none; box-shadow: none; }
.coach-send { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 86px; min-height: 42px; }
.coach-send svg { width: 16px; height: 16px; }
.coach-form-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; color: var(--muted); font-size: var(--text-xs); }
.coach-live-details { max-width: 100%; }
.coach-live-details > summary { cursor: pointer; font-weight: 700; }
.coach-local-note { text-align: right; }
.coach-insights-panel { position: absolute; z-index: 20; top: 74px; right: .85rem; bottom: 96px; width: min(440px, calc(100% - 1.7rem)); overflow-y: auto; padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.coach-insights-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.coach-insights-heading h2 { margin: .2rem 0 0; font-size: var(--text-xl); }
.coach-insights-panel .coach-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.coach-insights-panel .coach-priorities, .coach-insights-panel .coach-links { grid-template-columns: 1fr; }
.coach-insights-panel .coach-priority { min-width: 0; }
.coach-history-backdrop { display: none; }
.coach-consent-box { padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.coach-consent-box .tt-check { display: flex; align-items: flex-start; gap: .55rem; color: var(--text); font-weight: 600; }
.coach-consent-box input[type="checkbox"] { width: 18px; flex: 0 0 18px; margin: .2rem 0 0; accent-color: var(--primary); }
.coach-privacy-details { margin-top: .45rem; }
.coach-privacy-details summary { color: var(--muted); font-size: var(--text-sm); cursor: pointer; }
.coach-privacy-details p { margin-top: .4rem; }
.coach-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.coach-link { display: grid; gap: .25rem; text-align: left; padding: 1rem; }
.coach-link strong { color: var(--text); }
.coach-link span { color: var(--muted); font-size: var(--text-sm); }
.setup-progress { margin: 1rem 0 1.25rem; }
.setup-progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.setup-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .25s ease; }
.setup-progress-caption { display: flex; justify-content: space-between; gap: .75rem; margin-top: .4rem; color: var(--muted); font-size: var(--text-xs); }
.setup-step h3 { margin: .5rem 0 .8rem; }
.setup-options { display: grid; gap: .45rem; margin: 1rem 0; padding: .85rem; border: 1px solid var(--border); border-radius: var(--r); }
.setup-options legend { padding: 0 .35rem; font-weight: 700; font-size: var(--text-sm); }
.setup-options .tt-check { display: flex; gap: .5rem; align-items: center; }
.setup-actions { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.setup-actions #setup-submit { margin-left: auto; }
.tour-backdrop { position: fixed; z-index: 2200; inset: auto 1rem 1rem; display: flex; justify-content: center; pointer-events: none; }
.tour-card { width: min(520px, 100%); padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 18px 60px #0007; pointer-events: auto; }
.tour-card h2 { margin: .45rem 0; }
.tour-card p { color: var(--muted); }
.tour-highlight { position: relative; z-index: 2100; outline: 3px solid var(--primary); outline-offset: 4px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary) 20%, transparent); }

/* 11. TOOLS ----------------------------------------------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.tool h3 { margin-bottom: .15rem; }
.tool-out { margin-top: 1rem; padding: .9rem 1rem; background: var(--surface-2); border-radius: var(--r); display: grid; gap: .4rem; }
.tool-out .row { display: flex; justify-content: space-between; gap: .5rem; font-size: var(--text-sm); color: var(--muted); }
.tool-out .row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.tool-out .row.main { font-size: var(--text-base); color: var(--text); font-weight: 700; padding-top: .4rem; border-top: 1px solid var(--border); }
.tool-out .row.main strong { font-size: var(--text-lg); color: var(--primary); }
.tool-out .note { font-size: var(--text-xs); color: var(--faint); }

/* 12. MISC ------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px); z-index: 90;
  background: var(--text); color: var(--bg); padding: .75rem 1.1rem; border-radius: var(--r);
  font-weight: 700; font-size: var(--text-sm); box-shadow: var(--shadow-lg);
  opacity: 0; transition: .25s var(--ease); pointer-events: none; max-width: calc(100vw - 2rem);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--loss); color: #fff; }

.celebrate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(5,10,20,.55); padding: 1rem; animation: fade .2s both; }
.celebrate-card { background: var(--surface); border-radius: 24px; padding: 2rem 1.75rem 1.5rem; width: min(360px, 100%); text-align: center; box-shadow: var(--shadow-lg); animation: pop2 .45s var(--ease) both; }
@keyframes pop2 { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.celebrate-flame svg { width: 88px; height: 88px; color: var(--streak); animation: flicker 1.2s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.celebrate-num { font-family: var(--font-display); font-size: 3.6rem; font-weight: 800; color: var(--streak); line-height: 1; font-variant-numeric: tabular-nums; }
.celebrate-label { font-weight: 800; font-size: var(--text-lg); margin-bottom: .5rem; }
.celebrate .btn { margin-top: 1.25rem; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

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

/* 13. RESPONSIVE ------------------------------------------ */
@media (max-width: 1100px) {
  .dash-grid.three { grid-template-columns: 1fr 1fr; }
  .dash-grid.three > :last-child { grid-column: 1 / -1; }
  .landing-features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  #app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-only { display: block; }
  .desktop-only { display: none; }
  .topbar .wordmark { font-size: 1.2rem; }
  .topbar { padding-top: calc(.85rem + env(safe-area-inset-top)); }
  main { padding-bottom: calc(116px + env(safe-area-inset-bottom)); }
  .dash-grid, .dash-grid.three { grid-template-columns: 1fr; }
  .dash-grid.three > :last-child { grid-column: auto; }
  .coach-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coach-priorities, .coach-links { grid-template-columns: 1fr; }
  .coach-workspace, .coach-workspace.is-collapsed { grid-template-columns: minmax(0, 1fr); height: min(74dvh, 780px); min-height: 480px; }
  .coach-history { position: fixed; z-index: 61; inset: 0 auto 0 0; width: min(340px, 88vw); height: 100dvh; padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom)); border-radius: 0 var(--r-lg) var(--r-lg) 0; box-shadow: var(--shadow-lg); transform: translateX(-105%); transition: transform .24s ease; opacity: 1; pointer-events: auto; }
  .coach-workspace.is-collapsed .coach-history { padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom)); border-color: var(--border); opacity: 1; pointer-events: auto; }
  .coach-workspace.history-open .coach-history { transform: translateX(0); }
  .coach-mobile-close { display: inline-flex; }
  .coach-history-backdrop { position: fixed; inset: 0; z-index: 60; display: none; border: 0; background: rgba(5, 15, 30, .58); }
  .coach-workspace.history-open .coach-history-backdrop { display: block; }
  .coach-main-panel { min-height: 0; }
  .coach-insights-panel { position: absolute; z-index: 20; top: 62px; right: .6rem; bottom: calc(96px + env(safe-area-inset-bottom)); width: calc(100% - 1.2rem); max-height: none; }
  .coach-form { padding-inline: .8rem; }
  .coach-form-footer { flex-wrap: wrap; }
  .coach-local-note { text-align: left; }
  .landing-hero { grid-template-columns: 1fr; }
  .landing-visual { order: -1; }
  .lv-card { transform: none; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
    box-sizing: border-box; position: fixed; left: auto; right: .75rem;
    bottom: calc(.65rem + env(safe-area-inset-bottom)); z-index: 40;
    width: min(520px, calc(100vw - 5.25rem));
    transform: none;
    border: 1px solid var(--border); border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    padding: .4rem;
    opacity: 1;
    transition: transform .65s cubic-bezier(.4,0,.2,1), opacity .65s cubic-bezier(.4,0,.2,1);
  }
  .tabbar.is-scrolling {
    transform: translateY(4px) scale(.985);
    opacity: .92;
  }
  .tabbar.is-idle {
    transform: translateY(calc(100% + 1rem));
    opacity: 0;
    pointer-events: none;
  }
  .tabbar button { display: flex; min-width: 0; min-height: 48px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; font-size: 10px; font-weight: 600; color: var(--faint); padding: .3rem 0; }
  .tabbar button svg { width: 21px; height: 21px; flex: 0 0 auto; }
  .tabbar button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
  .tabbar button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
  .floating-add {
    display: grid; place-items: center; position: fixed;
    right: .75rem; bottom: calc(5.25rem + env(safe-area-inset-bottom)); z-index: 42;
    width: 48px; height: 48px; border-radius: 15px;
    background: var(--primary); color: var(--primary-ink);
    box-shadow: 0 5px 16px color-mix(in srgb, var(--primary) 38%, transparent);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  }
  .floating-add:hover { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 42%, transparent); }
  .floating-add svg { width: 24px; height: 24px; }

  .sheet { box-sizing: border-box; left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100% !important; max-height: 92dvh; border-radius: 22px 22px 0 0; padding-bottom: calc(1.4rem + env(safe-area-inset-bottom)); animation: slideup .3s var(--ease) both; }
  #sheet-job { display: flex; flex-direction: column; overflow: hidden; }
  #sheet-job .sheet-head { flex: 0 0 auto; padding-bottom: .65rem; }
  #job-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 .1rem .25rem; }
  #job-form .row-gap.end { position: sticky; bottom: 0; z-index: 2; margin: .5rem 0 0; padding: .75rem 0 .4rem; border-top: 1px solid var(--border); background: var(--surface); }
  .table-scroll-top { display: block; height: 16px; overflow-x: auto; overflow-y: hidden; margin: 0 0 .25rem; scrollbar-width: thin; scrollbar-color: var(--muted) var(--surface-2); touch-action: pan-x; }
  .table-scroll-top[hidden] { display: none; }
  .table-scroll-top > div { height: 1px; }
  .table-wrap { scrollbar-width: none; }
  .table-wrap::-webkit-scrollbar { display: none; }
  @keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}

@media (max-width: 640px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-header { padding: 1rem; }
  .landing-hero { padding-top: .5rem; }
  .lv-value { font-size: 2.1rem; }
  .hero-value { font-size: 1.9rem; }
  .hero-chart { height: 180px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .kpi { padding: .8rem .85rem; }
  .kpi-value { font-size: 1.15rem; }
  .xp-chip { display: none; }
  .topbar-actions .icon-btn { width: 34px; height: 34px; }
  .toolbar input[type="search"] { max-width: none; flex-basis: 100%; }
  .toolbar select { flex: 1; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { flex-shrink: 0; }
  .date-pair { width: 100%; }
  .date-pair input { flex: 1; min-width: 0; }
  .job-preview { grid-template-columns: 1fr 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
  th, td { padding: .65rem .7rem; }
  .row-actions button { padding: .35rem .4rem; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .section-head .btn { padding: .55rem .85rem; }
  .coach-toolbar { min-height: 58px; padding-inline: .6rem; }
  .coach-toolbar-start { gap: .35rem; }
  .coach-brand-lockup small { display: none; }
  .coach-insights-toggle { padding-inline: .5rem; }
  .coach-insights-toggle span { font-size: var(--text-xs); }
  .coach-thread { padding: .75rem; }
  .coach-workspace, .coach-workspace.is-collapsed { height: min(70dvh, 720px); min-height: 440px; }
  .coach-suggestions { grid-template-columns: 1fr; gap: .45rem; margin-top: 1rem; }
  .coach-suggestion { padding: .65rem .8rem; }
  .coach-message-bubble { max-width: 94%; padding: .75rem .85rem; }
  .coach-form { padding: .55rem .65rem .7rem; }
  .coach-send { min-width: 44px; padding-inline: .65rem; }
  .coach-send span { display: none; }
  .coach-history-settings { padding-bottom: .25rem; }
  .coach-insights-panel { padding: .9rem; }
  .coach-insights-panel .coach-metrics { grid-template-columns: 1fr 1fr; }
  .demo-limit-banner { align-items: stretch; flex-direction: column; margin: .6rem .75rem 0; }
  .demo-limit-banner .btn { width: 100%; }
  .mock-checkout-footer { align-items: stretch; flex-direction: column; }
  .mock-checkout-footer .row-gap { justify-content: stretch; }
  .mock-checkout-footer .row-gap .btn { flex: 1; }
}
@media (max-width: 420px) {
  #mock-checkout-form .form-row.two { grid-template-columns: 1fr; }
}
/* Display profit amounts in green */
.profit {
    color: #22c55e;
}
/* Green profit figures */
.profit-green,
.profit-green .amt {
    color: #22c55e !important;
} /* Put Price, Discount and Paid so far side by side */
#job-form .form-row.two {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 12px;
}

/* Date and Status: half width each */
#job-date,
#job-status {
    min-width: 0;
}

#job-form .form-row.two > div {
    grid-column: span 3;
}

/* Description: full width */
#job-form .form-row.two > .full {
    grid-column: 1 / -1;
}

/* Price, Discount and Paid so far: one-third each */
#job-form .form-row.two > div:has(#job-price),
#job-form .form-row.two > div:has(#job-discount),
#job-form .form-row.two > div:has(#job-paid) {
    grid-column: span 2;
    min-width: 0;
}

/* Line separating payments from expenses */
#job-expenses-section {
    border-top: 1px solid var(--border);
    margin-top: 24px;
    padding-top: 20px;
}

/* Keep expense heading and button on one line */
.job-expenses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* On small screens, use two columns */
@media (max-width: 640px) {
    #job-form .form-row.two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #job-form .form-row.two > div:has(#job-price),
    #job-form .form-row.two > div:has(#job-discount),
    #job-form .form-row.two > div:has(#job-paid) {
        grid-column: span 1;
    }
}/* Individual job expense */
.job-expense-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.job-expense-row span {
    flex: 1;
}

.job-expense-amount {
    width: 140px;
}

.job-expense-remove {
    color: var(--loss);
    font-size: 24px;
    padding: 4px 8px;
}

/* Dropdown positioned below Add expense */
.job-expenses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 12px;
}

#job-expense-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 190px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

#job-expense-menu[hidden] {
    display: none !important;
}

#job-expense-menu button {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: left;
    border: none;
    border-radius: 6px;
    background: transparent;
}

#job-expense-menu button:hover {
    background: var(--surface-2);
}

/* Targeted fixes: job form and floating New Job button */
#job-form .form-row.two { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#job-form .form-row.two > div { grid-column: span 3; min-width: 0; }
#job-form .form-row.two > .full { grid-column: 1 / -1; }
#job-form .form-row.two > div:has(#job-price),
#job-form .form-row.two > div:has(#job-discount),
#job-form .form-row.two > div:has(#job-paid) { grid-column: span 2; }
.job-expense-dropdown { position: relative; }
#job-expense-menu { top: calc(100% + 6px); right: 0; margin: 0; }
.floating-new-job { position: fixed; right: 24px; bottom: 24px; z-index: 35; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--primary-ink); background: var(--primary); box-shadow: var(--shadow-lg); }
.floating-new-job svg { width: 26px; height: 26px; }
.floating-new-job:hover { filter: brightness(1.08); }
@media (max-width: 900px) { .floating-new-job { display: none; } }
@media (max-width: 640px) {
  #job-form .form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #job-form .form-row.two > div:has(#job-price),
  #job-form .form-row.two > div:has(#job-discount),
  #job-form .form-row.two > div:has(#job-paid) { grid-column: span 1; }
  .job-expenses-header { align-items: flex-start; }
}
/* Make each added job expense full width */
#job-expenses-list .job-expense-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    width: 100%;
    margin: 12px 0;
}

/* Expense category label */
#job-expenses-list .job-expense-row span {
    grid-column: 1;
    font-weight: 500;
    color: var(--muted);
}

/* Expense amount box */
#job-expenses-list .job-expense-amount {
    grid-column: 1;
    width: 100%;
    min-width: 0;
}

/* Remove expense button */
#job-expenses-list .job-expense-remove {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
}#job-form input::placeholder {
    color: #8491a3;
    opacity: 0.7;
}
#job-expenses-list {
    width: 100%;
}

#job-expenses-list .job-expense-row {
    width: 100%;
    max-width: 100%;
}.job-custom-row { display: flex; gap: .5rem; align-items: center; margin-top: .9rem; }
.job-custom-row[hidden] { display: none !important; }
.job-custom-row input { flex: 1; min-width: 0; }

.job-expense-group {
  border: 1px solid var(--border, #ddd);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}

.job-expense-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  font-weight: 600;
}

.job-expense-date {
  padding: 0 14px 12px;
  font-size: 12px;
  opacity: 0.65;
}

.job-expense-items {
  border-top: 1px solid var(--border, #ddd);
  padding: 12px 14px;
}

.job-expense-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  gap: 12px;
}

/* EXPENSE FILTER BUTTONS */

#expense-date-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

#expense-date-filters button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 16px;
  min-height: 38px;

  background: #111c2e;
  color: #e5e7eb;

  border: 1px solid #334155;
  border-radius: 9px;

  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

#expense-date-filters button:hover {
  background: #1e293b;
}

#expense-date-filters button.active {
  background: #4f8df7;
  border-color: #4f8df7;
  color: #07111f;
  font-weight: 600;
}

/* CUSTOM DATE INPUTS */

#expense-custom-dates[hidden] {
  display: none !important;
}

#expense-custom-dates:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
/* Make the Zaboe logo clickable without changing its design */
button.wordmark {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
/* ==================================================
   Account security: 2FA, reset, verification
   ================================================== */
.forgot-row { text-align: right; margin-top: .4rem; }
.auth-icon { width: 52px; height: 52px; margin: 0 auto .75rem; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.auth-icon svg { width: 26px; height: 26px; }
.auth-card .center, .hint.center { text-align: center; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.35rem; letter-spacing: .35em; text-align: center; }
.code-input.recovery { letter-spacing: .04em; font-size: 1rem; }
.qr-box { display: grid; place-items: center; background: #fff; border-radius: var(--r-md, 12px); padding: 12px; width: 204px; height: 204px; margin: .75rem auto; }
.qr-box img, .qr-box svg { width: 180px; height: 180px; image-rendering: pixelated; }
.secret-key { display: block; padding: .6rem .75rem; border-radius: 10px; background: var(--surface-2, var(--surface-3)); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-sm); word-break: break-all; text-align: center; margin-bottom: 1rem; user-select: all; }
.code-list { display: grid; grid-template-columns: 1fr; gap: .35rem; margin: 1rem 0; padding: .9rem 1rem .9rem 2.6rem; border-radius: 12px; background: var(--surface-2, var(--surface-3)); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-xs); }
.code-list li { word-break: break-all; }
@media (max-width: 480px) { .code-list { grid-template-columns: 1fr; } }
.sec-status { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--text-xs); font-weight: 700; padding: .15rem .55rem; border-radius: 99px; }
.sec-status.on { color: var(--gain); background: color-mix(in srgb, var(--gain) 14%, transparent); }
.sec-status.off { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.sec-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.job-expense-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.job-expense-heading .btn { margin-left: auto; }

/* ==================================================
   Fixes: job form grid, expense filters follow theme
   ================================================== */
.job-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; }
.job-grid > div { min-width: 0; }
.job-grid .span-2 { grid-column: span 2; }
.job-grid .span-3 { grid-column: span 3; }
.job-grid .span-6 { grid-column: span 6; }
.job-grid:has(#job-price) > div:has(#job-price),
.job-grid > div:has(#job-discount),
.job-grid > div:has(#job-paid) { grid-column: span 2; }
@media (max-width: 640px) {
  .job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-grid > div, .job-grid .span-3, .job-grid .span-2 { grid-column: span 1; }
  .job-grid .span-6 { grid-column: span 2; }
}
.job-expenses-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--border); }

#expense-date-filters button {
  background: var(--surface-2, var(--surface));
  color: var(--text);
  border: 1px solid var(--border);
}
#expense-date-filters button:hover { background: var(--surface-3, var(--surface-2, var(--surface))); }
#expense-date-filters button.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink, #fff); }
#view-expenses .toolbar { flex-wrap: wrap; align-items: center; }
#view-expenses .toolbar #expense-date-filters { flex-basis: 100%; margin: 0 0 4px; }
#view-expenses .toolbar #expense-custom-dates { flex-basis: 100%; margin: 0; }
#view-expenses .toolbar label[for="expense-sort"] { margin: 0; font-size: 13px; color: var(--muted); }
#view-expenses .toolbar #expense-sort { width: auto; }


/* ==================================================
   Zaboe — subtle motion enhancement
   CSS-only: no changes to login, registration or data.
   ================================================== */
@keyframes tt-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tt-soft-pop {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tt-glow-breathe {
  0%, 100% { opacity: .45; }
  50% { opacity: .78; }
}

/* Landing: clear entrance, slight stagger. */
.landing-copy p { animation: tt-fade-up .65s .12s cubic-bezier(.2,.8,.2,1) both; }
.landing-cta { animation: tt-fade-up .65s .22s cubic-bezier(.2,.8,.2,1) both; }
.landing-visual { animation: tt-soft-pop .8s .16s cubic-bezier(.2,.8,.2,1) both; }
.landing-features > * { animation: tt-fade-up .6s both; }
.landing-features > :nth-child(2) { animation-delay: .1s; }
.landing-features > :nth-child(3) { animation-delay: .2s; }
.landing-features > :nth-child(4) { animation-delay: .3s; }

/* Dashboard cards: gentle hover and entrance. */
.kpi, .card { transition: box-shadow .24s ease, border-color .24s ease, transform .24s ease; }
@media (hover: hover) and (pointer: fine) {
  .kpi:hover, .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
  }
  .btn:not(:disabled):hover { transform: translateY(-2px); }
  .btn:not(:disabled):active { transform: translateY(0) scale(.985); }
}
.btn { transition: transform .18s ease, box-shadow .2s ease, background-color .2s ease, filter .2s ease; }

/* Animate newly displayed app views and their contents. */
.view.active > .kpi-grid .kpi,
.view.active > .card,
.view.active > .dashboard-grid > .card {
  animation: tt-fade-up .42s cubic-bezier(.2,.8,.2,1) both;
}
.view.active .kpi-grid > :nth-child(2) { animation-delay: .055s; }
.view.active .kpi-grid > :nth-child(3) { animation-delay: .11s; }
.view.active .kpi-grid > :nth-child(4) { animation-delay: .165s; }
.view.active .kpi-grid > :nth-child(5) { animation-delay: .22s; }
.view.active .kpi-grid > :nth-child(6) { animation-delay: .275s; }

/* Form panels and dialogs. */
.sheet:not([hidden]) { animation: tt-soft-pop .25s cubic-bezier(.2,.8,.2,1) both; }
.auth-card { animation: tt-soft-pop .42s cubic-bezier(.2,.8,.2,1) both; }
input, select, textarea { transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
input:focus-visible, select:focus-visible, textarea:focus-visible { transition-duration: .16s; }

/* Accessibility: respect OS Reduce Motion setting. */
@media (prefers-reduced-motion: reduce) {
  .landing-copy h1, .landing-copy p, .landing-cta, .landing-visual,
  .landing-features > *, .view.active > .kpi-grid .kpi,
  .view.active > .card, .view.active > .dashboard-grid > .card,
  .sheet:not([hidden]), .auth-card {
    animation: none !important;
  }
  .kpi, .card, .btn, input, select, textarea { transition: none !important; }
  .kpi:hover, .card:hover, .btn:hover, .btn:active { transform: none !important; }
}

/* Keep the mobile fixed tab bar attached to the viewport during scroll. */
html { scroll-behavior: smooth; }
#app-shell { animation: tt-app-enter .4s ease both; }
#auth-screen, #business-setup-screen, #landing-screen { animation: tt-screen-enter .55s cubic-bezier(.22,1,.36,1) both; }
@keyframes tt-app-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes tt-screen-enter { from {opacity:0;transform:translate3d(0,16px,0)} to {opacity:1;transform:translate3d(0,0,0)} }
.view.active { animation: none; }
.view.active .card, .view.active .kpi { animation: none; }
.card, .kpi, .btn, .side-nav button, .tabbar button { transition-duration: .32s; transition-timing-function: cubic-bezier(.22,1,.36,1); }
.sheet:not([hidden]) { animation: pop .42s cubic-bezier(.22,1,.36,1) both; }
@media (max-width: 900px) { .sheet:not([hidden]) { animation: slideup .3s var(--ease) both; } }
@media (prefers-reduced-motion: reduce) { html {scroll-behavior:auto} #app-shell, #auth-screen, #business-setup-screen, #landing-screen, .sheet:not([hidden]) {animation:none!important} }

/* ==========================================================
   Zaboe adaptive layout — phone through ultrawide
   Keeps the existing visual language and app functionality.
   ========================================================== */
html, body { width: 100%; max-width: 100%; }
#app-shell { min-width: 0; }
.main-col { min-width: 0; width: 100%; }
/* Keep the topbar and working area aligned on large displays. */
.topbar { padding-inline: max(clamp(1rem, 2.5vw, 2rem), calc((100% - 1440px) / 2)); }
main {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 2.5vw, 2rem);
}
/* Larger canvases get a comfortable width without stretched-out charts. */
@media (min-width: 1900px) {
  :root { --sidebar-w: 264px; }
  main { max-width: 1500px; padding-inline: 2rem; }
  .topbar { padding-inline: max(2rem, calc((100% - 1500px) / 2)); }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
  .dash-grid { gap: 1.25rem; }
}
@media (min-width: 2700px) {
  main { max-width: 1600px; }
  .topbar { padding-inline: max(2rem, calc((100% - 1600px) / 2)); }
}
/* Centre public pages as well, rather than stretching the header to the edges. */
.landing-header { width: 100%; max-width: 1440px; margin-inline: auto; }
.landing-pricing { width: min(100%, 1240px); }
/* Responsive grids should shrink rather than overflow. */
.dash-grid, .dash-grid.three, .stack-grid, .kpi-grid, .pricing-grid,
.job-grid, .form-row.two { min-width: 0; }
.dash-grid > *, .dash-grid.three > *, .stack-grid > *, .pricing-grid > * { min-width: 0; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Tablets and smaller laptops: give charts room without tiny columns. */
@media (min-width: 901px) and (max-width: 1250px) {
  main { padding-inline: clamp(1rem, 2vw, 1.5rem); }
  .topbar { padding-inline: clamp(1rem, 2vw, 1.5rem); }
  .dash-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .dash-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  main { max-width: 760px; margin-inline: auto; }
  .topbar { padding-inline: max(1rem, calc((100% - 760px) / 2 + 1rem)); }
  .landing-header { padding-inline: clamp(1rem, 4vw, 2rem); }
  .landing-hero, .landing-features { max-width: 760px; }
  .pricing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { padding-inline: clamp(.75rem, 3.5vw, 1rem); }
  .topbar { padding-inline: clamp(.75rem, 3.5vw, 1rem); }
  .topbar, .topbar-actions, .section-head, .card-head { min-width: 0; }
  .section-head { align-items: flex-start; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { white-space: normal; overflow-wrap: anywhere; }
  .landing-cta > .btn { max-width: 100%; }
  .form-row.two { grid-template-columns: 1fr; }
  .auth-card { padding: clamp(1rem, 4vw, 1.75rem); }
  .sheet { max-width: 100vw; overflow-x: hidden; }
  .pricing-card { min-width: 0; }
  .recurring-dashboard-alert { align-items: flex-start; flex-direction: column; }
  .recurring-dashboard-alert .btn { align-self: flex-start; }
  .recurring-actions { justify-content: flex-start; }
  .integration-grid { grid-template-columns: 1fr; }
  .bank-account-row { align-items: flex-start; flex-direction: column; gap: .15rem; }
  .bank-account-row span { text-align: left; }
}
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .landing-cta { flex-direction: column; }
  .landing-cta .btn { width: 100%; }
}

/* Clearer customer workspace navigation and progressive disclosure. */
.side-nav .nav-label {
  margin: .55rem .75rem .15rem;
  color: var(--faint);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.topbar-title h1 { font-size: var(--text-lg); font-family: var(--font-body); }
.dashboard-more {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.dashboard-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
}
.dashboard-more > summary::-webkit-details-marker { display: none; }
.dashboard-more > summary span:first-child { display: grid; gap: .15rem; }
.dashboard-more > summary small { color: var(--muted); font-size: var(--text-sm); }
.summary-chevron { color: var(--muted); font-size: 1.2rem; transition: transform .18s ease; }
.dashboard-more[open] .summary-chevron { transform: rotate(180deg); }
.dashboard-more > .dash-grid { padding: 0 1rem 1rem; }

.more-label {
  padding: .65rem .5rem .25rem;
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.more-list button.active { background: var(--primary-soft); color: var(--primary); }

.subscription-card { margin-bottom: 1.5rem; }
.subscription-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.subscription-head h3 { margin-top: .25rem; font-size: var(--text-xl); }
.subscription-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .3rem .7rem;
  background: var(--surface-3);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  white-space: nowrap;
}
.subscription-badge.positive { background: var(--gain-soft); color: var(--gain); }
.subscription-badge.warning { background: var(--warn-soft); color: var(--warn); }
.subscription-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.subscription-details > div { display: grid; gap: .2rem; min-width: 0; }
.subscription-details span { color: var(--muted); font-size: var(--text-xs); }
.subscription-details strong { overflow-wrap: anywhere; font-size: var(--text-sm); }
.subscription-note { color: var(--muted); font-size: var(--text-sm); }
.plans-heading { margin-top: 1.5rem; }
.pricing-intro { max-width: 740px; margin: 0 auto 1.5rem; text-align: center; }
.pricing-intro p { color: var(--muted); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; margin: 1rem 0; }
.pricing-card { position: relative; display: flex; flex-direction: column; gap: .8rem; padding: 1.4rem; }
.pricing-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary-soft), var(--shadow); }
.pricing-tag { display: inline-block; align-self: flex-start; border: 1px solid var(--primary); color: var(--primary); border-radius: 20px; padding: .25rem .6rem; font-size: var(--text-xs); font-weight: 700; }
.pricing-card h3 { margin: 0; }
.pricing-price { font-size: 1.8rem; font-weight: 800; }
.pricing-price small { color: var(--muted); font-size: var(--text-sm); font-weight: 500; }
.pricing-benefits { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .55rem; flex: 1; }
.pricing-benefits li { display: flex; align-items: flex-start; gap: .55rem; font-size: var(--text-sm); }
.pricing-benefits li::before { content: "✓"; color: var(--gain); font-weight: 800; }
.pricing-card .btn { margin-top: auto; }
.pricing-note { margin-top: .75rem; color: var(--muted); font-size: var(--text-sm); }
.landing-pricing { width: min(100%, 1240px); margin: 3rem auto; padding: 0 clamp(1rem, 5vw, 4rem); }
.landing-pricing .pricing-card { border-radius: var(--r-lg); }

@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .subscription-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dashboard-more > .dash-grid { padding-inline: .75rem; }
  .subscription-card { padding: 1rem; }
  .subscription-details { gap: .75rem .5rem; }
  .pricing-card { padding: 1.1rem; }
  .landing-pricing { margin: 2rem auto; }
  .tabbar { width: min(520px, calc(100vw - 5.25rem)); }
}
@media (max-width: 360px) {
  .tabbar button { font-size: 8px; }
  .tabbar button svg { width: 19px; height: 19px; }
  .floating-add { right: .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tabbar, .floating-add { transition: none; }
}

/* Keep the primary add action inside the visible desktop viewport. */
.floating-new-job {
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  right: max(24px, env(safe-area-inset-right, 0px));
}
#view-connections .recurring-integrations { width: 100%; }
#sheet-quick .qa-grid { align-items: stretch; }

/* Legal links (landing footer and registration form) */
.landing-footer a, .legal-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-consent { font-size: var(--text-sm); margin: .25rem 0 .75rem; }
