/* =====================================================================
   TrakFi — minimal theme ("ledger paper")
   ---------------------------------------------------------------------
   Presentation-only layer, loaded after every <style> block in
   index.html. It does not touch markup or logic; it flattens the UI:
     · warm paper background, ink text, hairline rules
     · one colour for money in (green), one for money out (brick red);
       everything else is ink or grey
     · no gradients, glows, 3D shadows, glossy pills or looping shimmer
     · one typeface (Hind, Indian Type Foundry) with tabular figures
   Emoji icons are swapped for line icons / stripped by
   theme-minimal.js. Everything is scoped to html.tf-min, so removing
   that class from <html> brings the original look back.
   ===================================================================== */

/* Looping shimmer/glow/twinkle animations become no-ops. Spinners, the mic
   pulse and entrance transitions are left alone because they carry meaning.
   These stay outside the layer below: an unlayered @keyframes defined later
   in the document is the one that wins. */
@keyframes aiHaloPulse{} @keyframes brandAiShimmer{} @keyframes fabSparkleShimmer{} @keyframes fabTwinkle{}
@keyframes fcGlow{} @keyframes fcShimmer{} @keyframes fcTwinkle{} @keyframes festBulb{} @keyframes festFlame{}
@keyframes festTwinkle{} @keyframes metallicGoldShimmer{} @keyframes planBadgeShimmer{} @keyframes qeFabPulse{}
@keyframes shimmerMove{} @keyframes sidenavEdgeShimmer{} @keyframes sidenavHeadSheen{} @keyframes smsFlashPulse{}
@keyframes spendsBackdropDrift{} @keyframes spendsBulgeGlint{} @keyframes spendsBulgeSheen{} @keyframes spendsBulgeShift{}
@keyframes spendsPetalChevron{} @keyframes spendsPetalFloat{} @keyframes spendsPetalGlowPulse{}
@keyframes spendsPetalGradientShift{} @keyframes spendsPetalSheen{} @keyframes spendsSparkleSpin{}

/* Everything else lives in one cascade layer and is written !important.
   For !important declarations a layer beats unlayered CSS regardless of
   specificity, so this file wins over the app's own !important rules
   (and over its inline styles) without a specificity arms race. */
@layer tf-min{

  html.tf-min{
    --m-bg:#F5F3EE;
    --m-surface:#FFFFFF;
    --m-sunken:#EFECE6;
    --m-ink:#1C1B19;
    --m-ink-2:#4A4740;
    --m-muted:#8A857D;
    --m-line:#E5E1D8;
    --m-line-2:#D3CEC4;
    --m-pos:#2F6A43;
    --m-neg:#A63A26;
    --m-warn:#94650F;
    --m-font:'Hind',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
    --m-display:var(--m-font);
    /* The one loud surface: top bar + dashboard headline sit on this solid band. */
    --m-band:#1C1B19;
    --m-band-ink:#F5F3EE;
    --m-band-accent:#E8775F;

    /* Re-point the app's own tokens so every rule that reads them follows along. !important because
       the app declares them unlayered on :root, which would otherwise beat this layer. */
    --bg:var(--m-bg)!important; --card:var(--m-surface)!important; --ink:var(--m-ink)!important; --muted:var(--m-muted)!important; --line:var(--m-line)!important;
    --good:var(--m-pos)!important; --risk:var(--m-neg)!important; --warn:var(--m-warn)!important;
    /* Category colours: kept distinguishable for charts/legends, but quiet and earthy. */
    --savings:#3F6E77!important; --savings-bg:#EEF2F2!important; --savings-text:#3F6E77!important;
    --investments:#3E5A8E!important; --investments-bg:#EEF0F5!important;
    --loans:#9A5A2B!important; --loans-bg:#F5EFE9!important;
    --insurance:#6E6A63!important; --insurance-bg:#F1EFEB!important;
    --creditcard:#5E4B7A!important; --creditcard-bg:#F1EEF4!important;
    --housing:#4E7553!important; --housing-bg:#EEF3ED!important; --housing-text:#4E7553!important;
    --lifestyle:#A0752A!important; --lifestyle-bg:#F6F1E6!important; --lifestyle-text:#7E5B1C!important;
    --dividend:#8A6A2E!important; --dividend-bg:#F5F1E8!important; --dividend-text:#7A5D27!important;
    --bonus:#8C4B5C!important; --bonus-bg:#F5EDEF!important; --bonus-text:#7C4050!important;
  }
  html.tf-min[data-theme="dark"]{
    --m-bg:#141412;
    --m-surface:#1C1C19;
    --m-sunken:#24241F;
    --m-ink:#ECE9E2;
    --m-ink-2:#C2BEB5;
    --m-muted:#8F8A80;
    --m-line:#2E2D29;
    --m-line-2:#3E3C37;
    --m-pos:#82BD93;
    --m-neg:#E2907B;
    --m-warn:#D9AE5B;
    --m-band:#26251F;
    --m-band-ink:#ECE9E2;
    --m-band-accent:#E2907B;
    --savings-bg:#1F2626!important; --investments-bg:#1F2230!important; --loans-bg:#2A221B!important; --insurance-bg:#24231F!important;
    --creditcard-bg:#25212C!important; --housing-bg:#1F271F!important; --lifestyle-bg:#2A251A!important; --dividend-bg:#29241A!important;
    --bonus-bg:#2A1F22!important; --savings-text:#8FB8BF!important; --housing-text:#9CC2A1!important; --lifestyle-text:#D8B36E!important;
    --dividend-text:#CDAE74!important; --bonus-text:#D49AAA!important;
  }

  /* ---------- Strip decoration everywhere ----------
     :where() keeps these at near-zero specificity so the component rules
     below (and the few functional gradients) can still win. */
  html.tf-min :where(*), html.tf-min :where(*)::before, html.tf-min :where(*)::after{
    text-shadow:none!important;
    box-shadow:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    -webkit-text-fill-color:currentColor!important;
  }
  html.tf-min :where(*:not(.upi-icon-img,.upi-icon-inline,.gauge-track,.ai-score-ring)),
  html.tf-min :where(*)::before, html.tf-min :where(*)::after{
    background-image:none!important;
  }


  /* Sparkle dots drawn with solid backgrounds (so the gradient kill above misses them),
     using keyframes that are defined after this file and so can't be emptied here. */
  html.tf-min #topbarAiBtn .account-avatar{animation:none!important}
  html.tf-min #topbarAiBtn .account-avatar::before, html.tf-min .sms-import-row-icon::after,
  html.tf-min .metallic-gold-spark::before{display:none!important}
  html.tf-min .tf-hide{display:none!important}

  /* ---------- Base ---------- */
  html.tf-min, html.tf-min body{background:var(--m-bg)!important;color:var(--m-ink)!important}
  html.tf-min body{font-family:var(--m-font)!important;-webkit-font-smoothing:antialiased!important;font-size:15px!important;line-height:1.45!important}
  html.tf-min :where(h1,h2,h3,h4,.num,button,input,select,textarea,.btn){font-family:var(--m-font)!important;letter-spacing:0!important}
  html.tf-min :where(.num,.val,.dts-v,[id$="Val"],td){font-variant-numeric:tabular-nums!important}
  html.tf-min .wrap{padding-left:16px!important;padding-right:16px!important}
  html.tf-min ::selection{background:var(--m-ink)!important;color:var(--m-surface)!important}
  /* Line icons injected by theme-minimal.js */
  html.tf-min .tf-ic{display:inline-block!important;width:20px!important;height:20px!important;vertical-align:middle!important;flex-shrink:0!important}
  html.tf-min .tf-ic svg{display:block!important;width:100%!important;height:100%!important}
  /* Any emoji the script leaves in place (icon-only buttons with no line icon) read as quiet, monochrome marks. */
  html.tf-min .tf-emo{filter:grayscale(1)!important;opacity:.65!important}

  /* ---------- Form controls ---------- */
  html.tf-min :where(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){
    background-color:var(--m-surface)!important;color:var(--m-ink)!important;
    border:1px solid var(--m-line-2)!important;border-radius:8px!important;font-size:15px!important}
  html.tf-min :where(input,select,textarea):focus{outline:none!important;border-color:var(--m-ink)!important}
  html.tf-min :where(input[type=checkbox],input[type=radio],input[type=range]){accent-color:var(--m-ink)!important}
  html.tf-min ::placeholder{color:var(--m-muted)!important;opacity:1!important}

  /* Buttons: outlined by default; solid ink only for the one primary action in a dialog. */
  html.tf-min .btn, html.tf-min .btn.ghost, html.tf-min .btn-secondary, html.tf-min .applock-action-btn{
    background-color:var(--m-surface)!important;color:var(--m-ink)!important;border:1px solid var(--m-line-2)!important;
    border-radius:10px!important;font-weight:500!important;letter-spacing:0!important;text-transform:none!important}
  html.tf-min .modal-card .btn:not(.btn-secondary):not(.ghost), html.tf-min button.btn-primary, html.tf-min .fest-cta,
  html.tf-min .applock-action-btn.primary, html.tf-min .ai-send-btn{
    background-color:var(--m-ink)!important;color:var(--m-surface)!important;border:1px solid var(--m-ink)!important;
    border-radius:10px!important;font-weight:600!important;letter-spacing:0!important;text-transform:none!important}
  html.tf-min .applock-action-btn.danger, html.tf-min .action-reset, html.tf-min .action-clearall{
    background-color:transparent!important;color:var(--m-neg)!important;border:1px solid var(--m-line-2)!important}
  /* Backup / Export / Import / Reset row: text labels only, inheriting the button colour. */
  html.tf-min .action-btn .icon-label-mini{color:inherit!important}
  html.tf-min .action-btn .tf-ic{display:none!important}
  html.tf-min .icon-btn{background:transparent!important;color:var(--m-muted)!important}
  html.tf-min .icon-btn:active{background:var(--m-sunken)!important;color:var(--m-ink)!important}

  /* ---------- Top bar ---------- */
  html.tf-min .topbar{background:var(--m-band)!important;color:var(--m-band-ink)!important;border:0!important;
    border-radius:0!important;padding:10px 16px 12px!important}
  html.tf-min .topbar::before, html.tf-min .topbar::after{display:none!important}
  html.tf-min .brand-icon, html.tf-min .brand-tagline-row, html.tf-min .brand-ai-badge{display:none!important}
  html.tf-min .brand-icon-hamburger span{background:var(--m-band-ink)!important}
  html.tf-min .topbar .brand-title{font-size:21px!important;font-weight:700!important;letter-spacing:-.01em!important;gap:0!important}
  html.tf-min #topbarAiBtn::before, html.tf-min #topbarAiBtn::after{display:none!important}
  html.tf-min .topbar .brand-monthly, html.tf-min .topbar .brand-wealth{color:var(--m-band-ink)!important;font-family:var(--m-display)!important;
    font-weight:700!important;background:none!important;animation:none!important;filter:none!important}
  html.tf-min .topbar .brand-wealth{color:var(--m-band-accent)!important}
  html.tf-min .topbar :is(.topbar-account-btn,#toolbarMenuBtn){border-color:color-mix(in srgb,var(--m-band-ink) 28%,transparent)!important}
  html.tf-min .topbar :is(.topbar-account-btn,#toolbarMenuBtn,.account-avatar){color:var(--m-band-ink)!important}
  html.tf-min .topbar .fest-chip{color:var(--m-band-ink)!important;border-color:color-mix(in srgb,var(--m-band-ink) 35%,transparent)!important}
  html.tf-min .fest-chip{background:transparent!important;color:var(--m-ink-2)!important;border:1px solid var(--m-line-2)!important;
    border-radius:999px!important;font-weight:500!important;font-size:11px!important;letter-spacing:0!important;margin-left:8px!important;padding:3px 9px!important}
  html.tf-min .fest-chip .fc-sp{display:none!important}
  html.tf-min .topbar-plan-badge, html.tf-min .sidenav-plan-badge{background:transparent!important;color:var(--m-ink-2)!important;
    border:1px solid var(--m-line-2)!important;font-weight:600!important;letter-spacing:.04em!important}
  html.tf-min .topbar-account-btn, html.tf-min #toolbarMenuBtn{background:transparent!important;border:1px solid var(--m-line)!important;
    color:var(--m-ink)!important;border-radius:50%!important;width:36px!important;height:36px!important;padding:0!important;display:inline-flex!important;
    align-items:center!important;justify-content:center!important;transform:none!important}
  html.tf-min #toolbarMenuBtn{font-size:18px!important;line-height:1!important}
  html.tf-min .account-avatar{background:transparent!important;color:var(--m-ink)!important;border:0!important;width:auto!important;height:auto!important}
  html.tf-min .topbar .controls-row{gap:8px!important}
  html.tf-min .topbar select, html.tf-min #year, html.tf-min #month{
    background-color:var(--m-surface)!important;color:var(--m-ink)!important;border:1px solid var(--m-line-2)!important;
    border-radius:8px!important;font-weight:500!important;font-size:15px!important;height:40px!important;padding:0 34px 0 12px!important;
    -webkit-appearance:none!important;appearance:none!important;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A857D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
    background-repeat:no-repeat!important;background-position:right 12px center!important}
  html.tf-min #stickyPeriodBar{background:var(--m-ink)!important;color:var(--m-surface)!important;border:0!important}

  /* ---------- Page groups (Dashboard / Income / Reports / Insights wrappers) ---------- */
  html.tf-min .group-wrap{background:transparent!important;border:0!important;border-radius:0!important;margin:0 0 20px!important;overflow:visible!important}
  html.tf-min .group-inner{background:transparent!important;padding:0!important}
  html.tf-min .group-label{background:transparent!important;color:var(--m-ink)!important;padding:18px 2px 12px!important;margin:0!important;
    border:0!important;border-radius:0!important;transform:none!important}
  html.tf-min .group-label::before, html.tf-min .group-label::after{display:none!important}
  html.tf-min .group-label .gi{display:none!important}
  html.tf-min .group-label .gt b{font-family:var(--m-font)!important;font-size:24px!important;font-weight:600!important;
    letter-spacing:-.01em!important;text-transform:none!important;color:var(--m-ink)!important}
  html.tf-min .group-label .gt span{font-size:14px!important;color:var(--m-muted)!important;opacity:1!important}
  html.tf-min .group-label .gchev{color:var(--m-muted)!important}

  /* ---------- Dashboard headline (.tf-hero, built by theme-minimal.js) ----------
     Continues the top bar's band: one big "left after spending" figure, money in / spent,
     and a bar for how much of the income is gone. Replaces the Dashboard page title. */
  html.tf-min #group_dashboard > .group-inner > .group-label{display:none!important}
  html.tf-min .tf-hero{display:block!important;background:var(--m-band)!important;color:var(--m-band-ink)!important;
    margin:-12px -16px 20px!important;padding:8px 20px 22px!important;border-radius:0 0 26px 26px!important;cursor:pointer!important}
  html.tf-min .tf-hero-k{font-size:13.5px!important;font-weight:500!important;opacity:.75!important}
  html.tf-min .tf-hero-v{font-family:var(--m-display)!important;font-size:46px!important;font-weight:700!important;line-height:1.05!important;
    letter-spacing:-.02em!important;margin:4px 0 16px!important;font-variant-numeric:tabular-nums!important}
  html.tf-min .tf-hero-bar{height:6px!important;border-radius:3px!important;overflow:hidden!important;
    background:color-mix(in srgb,var(--m-band-ink) 18%,transparent)!important}
  html.tf-min .tf-hero-bar i{display:block!important;height:100%!important;border-radius:3px!important;background:var(--m-band-accent)!important}
  html.tf-min .tf-hero-row{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;margin-top:12px!important}
  html.tf-min .tf-hero-row div{display:flex!important;flex-direction:column!important;gap:1px!important;min-width:0!important}
  html.tf-min .tf-hero-row span{font-size:clamp(9px,2.7vw,12px)!important;opacity:.7!important;white-space:nowrap!important}
  html.tf-min .tf-hero-row b{font-family:var(--m-display)!important;font-size:clamp(11px,3.4vw,16px)!important;font-weight:600!important;font-variant-numeric:tabular-nums!important;white-space:nowrap!important}

  /* ---------- Cards & section headers ---------- */
  html.tf-min .card:not([style*="background:transparent"]){
    background:var(--m-surface)!important;border:1px solid var(--m-line)!important;border-radius:12px!important;
    margin:0 0 12px!important;transform:none!important}
  html.tf-min .card::before, html.tf-min .card::after{display:none!important}
  html.tf-min .card h2, html.tf-min .card h2[style]{color:var(--m-ink)!important;font-size:16px!important;font-weight:600!important;
    text-transform:none!important;letter-spacing:0!important}
  html.tf-min .h2-sub{color:var(--m-muted)!important;font-weight:400!important;font-size:.82em!important}
  html.tf-min .section-head, html.tf-min .section-head.section-head-3d{
    background:transparent!important;border:0!important;border-radius:0!important;transform:none!important;padding:2px 0!important;margin:0!important}
  html.tf-min .section-head::before, html.tf-min .section-head::after{display:none!important}
  html.tf-min .chev, html.tf-min .si-chev{color:var(--m-muted)!important;opacity:1!important}
  html.tf-min .card .hint, html.tf-min .hint{color:var(--m-muted)!important}
  html.tf-min .subgroup-header{background:transparent!important;border:0!important;border-bottom:1px solid var(--m-line)!important;
    border-radius:0!important;padding:10px 0!important}
  html.tf-min .subgroup-header-icon{display:none!important}
  /* Report kickers ("OVERVIEW", "SPENDS") become a small grey line above the card title */
  html.tf-min .report-kicker{display:block!important;background:transparent!important;border:0!important;padding:0!important;
    margin:0 0 2px!important;color:var(--m-muted)!important;font-size:11px!important;font-weight:500!important;letter-spacing:.08em!important}
  html.tf-min .sx-card{background:transparent!important;border:0!important;padding:0!important}
  html.tf-min .custom-charts-empty{background:var(--m-sunken)!important;border:0!important;color:var(--m-muted)!important}
  /* Chart legends and hints under charts: plain text, not coloured pills */
  html.tf-min .dist-legend-chip{background:transparent!important;border:1px solid var(--m-line)!important}
  html.tf-min .dist-legend-neutral{border:0!important;color:var(--m-muted)!important;font-weight:400!important}
  /* Spends summary: hide the money-bag art, flatten the track, mute the bright cash/UPI yellow */
  html.tf-min .budget-hero-icon{display:none!important}
  html.tf-min .budget-hero-track{background:var(--m-sunken)!important}
  html.tf-min :is([style*="background:#F4B400" i],[style*="rgb(244, 180, 0)"]){background:var(--lifestyle)!important}
  /* Category tag pills ("LIABILITY", "INCOME") on report cards */
  html.tf-min :is([class$="-tag"],[class*="-tag "]):not(.src-tag), html.tf-min .type-chip{background:transparent!important;color:var(--m-muted)!important;
    border:1px solid var(--m-line)!important;font-weight:500!important}

  /* ---------- Dashboard summary ---------- */
  html.tf-min .dash-cat-label{background:transparent!important;color:var(--m-ink-2)!important;border:0!important;border-radius:0!important;
    padding:0 2px!important;margin:14px 0 6px!important;font-size:12px!important;font-weight:600!important;letter-spacing:.08em!important;
    text-transform:uppercase!important;display:flex!important;align-items:center!important;gap:7px!important;transform:none!important;min-height:0!important}
  html.tf-min .dash-cat-label::after{display:none!important}
  html.tf-min .dash-cat-label::before{content:""!important;display:inline-block!important;position:static!important;inset:auto!important;
    width:7px!important;height:7px!important;border-radius:50%!important;background:var(--m-line-2)!important;flex:0 0 auto!important}
  html.tf-min .dash-cat-income::before{background:var(--m-pos)!important}
  html.tf-min .dash-cat-spends::before{background:var(--m-neg)!important}
  html.tf-min .dash-cat-liability::before{background:var(--m-warn)!important}
  html.tf-min .dash-cat-balance::before, html.tf-min .dash-cat-outcome-label::before{background:var(--m-ink)!important}
  html.tf-min .metric{background:var(--m-surface)!important;border:1px solid var(--m-line)!important;border-radius:10px!important;
    padding:11px 12px!important;transform:none!important}
  html.tf-min .metric::before, html.tf-min .metric::after{display:none!important}
  html.tf-min .metric .lbl{color:var(--m-muted)!important;font-size:12.5px!important;font-weight:500!important;
    text-transform:none!important;letter-spacing:0!important}
  html.tf-min .metric .val{color:var(--m-ink)!important;font-size:20px!important;font-weight:600!important;margin-top:2px!important}
  html.tf-min .metric .sub, html.tf-min .metric small{color:var(--m-muted)!important}
  html.tf-min .dash-total-strip{background:transparent!important;border:0!important;border-top:1px solid var(--m-line)!important;
    border-radius:0!important;padding:8px 2px 0!important}
  html.tf-min .dash-total-strip .dts-l{color:var(--m-ink-2)!important;font-size:12px!important;font-weight:600!important}
  html.tf-min .dash-total-strip .dts-ic{background:transparent!important;width:14px!important;height:14px!important}
  html.tf-min .dash-total-strip .dts-ic svg{width:14px!important;height:14px!important}
  html.tf-min .dash-total-strip .dts-v{font-weight:600!important}
  html.tf-min .dash-row-half:first-child .dash-total-strip :is(.dts-ic,.dts-v){color:var(--m-pos)!important}
  html.tf-min .dash-row-half:last-child .dash-total-strip :is(.dts-ic,.dts-v){color:var(--m-neg)!important}
  html.tf-min .dash-numbers-divider{background:var(--m-line)!important;opacity:1!important}
  html.tf-min .mini-stat, html.tf-min .stat-tile, html.tf-min .sx-tile, html.tf-min .inflow-chip, html.tf-min .budget-hero-stat{
    background:var(--m-surface)!important;border:1px solid var(--m-line)!important;border-radius:10px!important}
  html.tf-min .stat-tile-icon, html.tf-min .lbl-icon-sm, html.tf-min .icon-badge, html.tf-min .inf-ic, html.tf-min .inf-split-ic,
  html.tf-min .insight-icon-wrap, html.tf-min .modal-icon, html.tf-min .fest-feats .fi, html.tf-min .si-ic,
  html.tf-min .cat-icon-chip, html.tf-min .emi-ic, html.tf-min .inf-ico, html.tf-min .metallic-icon{display:none!important}
  html.tf-min .stat-tile-top, html.tf-min .stat-tile-top *{color:var(--m-muted)!important;text-transform:none!important;
    letter-spacing:0!important;font-weight:500!important;font-size:12.5px!important}
  html.tf-min .stat-tile-value{color:var(--m-ink)!important;font-weight:600!important;font-size:20px!important}
  html.tf-min .stat-tile-foot, html.tf-min .stat-tile-caption{color:var(--m-muted)!important}
  /* "Oct, in numbers" block: no box of its own, header reads like the other dashboard labels */
  html.tf-min .dash-insight-box{background:transparent!important;border:0!important;border-radius:0!important;padding:0!important;margin-top:6px!important}
  html.tf-min .dash-insight-head{padding:0 2px!important;margin:14px 0 8px!important;background:transparent!important}
  html.tf-min .dash-insight-title{color:var(--m-ink-2)!important;font-size:12px!important;font-weight:600!important;
    letter-spacing:.08em!important;text-transform:uppercase!important;font-family:var(--m-font)!important}
  html.tf-min .dash-insight-chip{background:transparent!important;border:0!important;color:var(--m-muted)!important;
    font-weight:400!important;padding:0!important}

  /* Functional bars stay, as flat solid fills */
  html.tf-min .progress, html.tf-min .flow-bar{background:var(--m-sunken)!important;border-radius:4px!important;height:6px!important}
  html.tf-min .progress .bar{background-color:var(--m-ink)!important;border-radius:4px!important}
  html.tf-min .flow-bar span{background-color:var(--m-ink-2)!important}

  /* ---------- Income / list rows ---------- */
  html.tf-min .inf-card, html.tf-min .alloc-summary, html.tf-min .budget-alloc-row, html.tf-min .formula-box,
  html.tf-min .why-banner, html.tf-min .ob-sync, html.tf-min .budget-hero-card, html.tf-min .snap-card,
  html.tf-min .legend-card, html.tf-min .plan-detail, html.tf-min .today-strip,
  html.tf-min .expense-quickstats .eqs-today, html.tf-min .cat-tx-modal-head, html.tf-min .custom-chart-head{
    background:var(--m-surface)!important;border:1px solid var(--m-line)!important;border-radius:10px!important;color:var(--m-ink)!important}
  html.tf-min .legend-row{background:transparent!important;border-bottom:1px solid var(--m-line)!important;border-radius:0!important}
  html.tf-min .legend-row b{color:var(--m-ink)!important}
  html.tf-min .inf-add-plus, html.tf-min .emi-add{background:transparent!important;color:var(--m-ink)!important;border:1px solid var(--m-line-2)!important}
  html.tf-min .inf-body .inflow-subtotal{background:var(--m-sunken)!important;color:var(--m-ink)!important}
  html.tf-min .eff-date-btn, html.tf-min .cat-filter-btn, html.tf-min .pmt-filter-btn, html.tf-min .tag-filter-btn,
  html.tf-min .cat-nav-btn, html.tf-min .custom-chart-chip, html.tf-min .eff-quick-chip, html.tf-min .cc-src-chip,
  html.tf-min .budget-hero-chip{
    background:var(--m-surface)!important;color:var(--m-ink)!important;border:1px solid var(--m-line-2)!important;border-radius:999px!important}
  html.tf-min .eff-date-btn::before, html.tf-min .eff-date-btn::after, html.tf-min .cat-filter-btn::before, html.tf-min .cat-filter-btn::after,
  html.tf-min .pmt-filter-btn::before, html.tf-min .pmt-filter-btn::after, html.tf-min .budget-row::before, html.tf-min .budget-row::after,
  html.tf-min .inf-row::after{display:none!important}
  html.tf-min .eff-date-btn.eff-active, html.tf-min .cat-filter-btn.eff-active, html.tf-min .eff-quick-chip.active,
  html.tf-min .cat-filter-chip.checked, html.tf-min .cat-filter-done{background:var(--m-ink)!important;color:var(--m-surface)!important;border-color:var(--m-ink)!important}
  html.tf-min .cc-src-ic{display:none!important}
  /* Income tab cards */
  html.tf-min .inf-card::before{display:none!important}
  html.tf-min .inf-title{color:var(--m-ink)!important}
  html.tf-min .inflow-hero{background:var(--m-sunken)!important;border:0!important;border-radius:10px!important}
  html.tf-min .inflow-hero-label{color:var(--m-ink-2)!important}
  html.tf-min .inflow-hero-value{color:var(--m-ink)!important}
  html.tf-min .inf-split-tile{background:var(--m-sunken)!important}
  html.tf-min .small-btn{color:var(--m-ink)!important;text-decoration:none!important}

  /* Per-component accent variables (set per class or inline: --ic, --c, --m, --lg-accent) collapse to ink,
     so every card that tints its title, rule or button from them goes neutral in one place. */
  html.tf-min :where(*){--ic:var(--m-ink-2)!important;--c:var(--m-ink)!important;--m:var(--m-ink)!important;--lg-accent:var(--m-ink)!important}
  /* Hard-coded accent text colours written inline in markup/JS */
  html.tf-min :is([style*="color:#8B5CF6" i],[style*="color:#7C3AED" i],[style*="color:#6D28D9" i],[style*="color:#5B21B6" i],
    [style*="color:#4338CA" i],[style*="color:#3730A3" i],[style*="color:#2563EB" i],[style*="color:#1D4ED8" i],
    [style*="color:#0369A1" i],[style*="color:#0EA5E9" i],[style*="color:#0F766E" i],[style*="color:#C2410C" i],
    [style*="color:#B45309" i],[style*="color:#92400E" i],[style*="color:#8A6200" i],[style*="color:#BE185D" i],
    [style*="color:#DB2777" i],[style*="color:#D97706" i]){color:var(--m-ink-2)!important}
  /* Amount colours: income / spend only */
  html.tf-min [style*="color:#16A34A"], html.tf-min [style*="color:#059669"], html.tf-min [style*="color:var(--good)"]{color:var(--m-pos)!important}
  html.tf-min [style*="color:#DC2626"], html.tf-min [style*="color:var(--risk)"]{color:var(--m-neg)!important}

  /* ---------- Bottom navigation ---------- */
  html.tf-min #appBottomNav{background:var(--m-surface)!important;border-top:1px solid var(--m-line)!important;
    padding:6px 6px calc(6px + env(safe-area-inset-bottom))!important}
  html.tf-min .nav-item{background:transparent!important;border:0!important;border-radius:0!important;color:var(--m-muted)!important;
    font-size:11px!important;font-weight:500!important;letter-spacing:0!important;gap:3px!important;padding:6px 0 2px!important;margin:0!important}
  html.tf-min .nav-item.active{color:var(--m-ink)!important;font-weight:600!important}
  html.tf-min .nav-item .nav-ic{font-size:0!important;line-height:0!important}
  html.tf-min .nav-item .nav-ic .tf-ic{width:22px!important;height:22px!important}
  html.tf-min .nav-item-primary .nav-ic, html.tf-min .nav-item-spends-bulge .nav-ic,
  html.tf-min .nav-item-spends-bulge.active .nav-ic, html.tf-min .nav-item-primary.active .nav-ic{
    background:var(--m-ink)!important;color:var(--m-surface)!important;border:0!important;width:48px!important;height:48px!important;
    top:-14px!important;border-radius:50%!important;display:flex!important;align-items:center!important;justify-content:center!important;animation:none!important}
  html.tf-min .nav-item-primary .nav-ic .tf-ic{width:24px!important;height:24px!important}
  html.tf-min .nav-item-spends-bulge .nav-ic::before, html.tf-min .nav-item-spends-bulge .nav-ic::after{display:none!important}
  html.tf-min .nav-item-primary span:last-child{font-weight:500!important;margin-top:-10px!important}
  html.tf-min .nav-item-primary.active span:last-child{font-weight:600!important}
  html.tf-min #qeFab{background:var(--m-ink)!important;color:var(--m-surface)!important;border:0!important}
  html.tf-min #qeFab::before, html.tf-min #qeFab::after{display:none!important}

  /* "Where to log it" picker that opens from Spends */
  html.tf-min #spendsPetalBackdrop{background:color-mix(in srgb,var(--m-bg) 96%,transparent)!important;opacity:1!important}
  html.tf-min #spendsPetalBackdrop::before{display:none!important}
  html.tf-min .spends-petal-hero-icon, html.tf-min .spends-petal-icon-wrap{display:none!important}
  html.tf-min .spends-petal-hero-title{color:var(--m-ink)!important;font-family:var(--m-font)!important;font-weight:600!important}
  html.tf-min .spends-petal-hero-sub, html.tf-min .spends-petal-title-row{color:var(--m-muted)!important}
  html.tf-min .spends-petal, html.tf-min .spends-petal-bills, html.tf-min .spends-petal-expenses{
    background:var(--m-surface)!important;color:var(--m-ink)!important;border:1px solid var(--m-line)!important;border-radius:14px!important;animation:none!important}
  html.tf-min .spends-petal::before, html.tf-min .spends-petal::after{display:none!important}
  html.tf-min .spends-petal *{color:inherit!important}
  html.tf-min .spends-petal [class*="sub"], html.tf-min .spends-petal small{color:var(--m-muted)!important}

  /* ---------- Side drawer ---------- */
  html.tf-min .sidenav-backdrop{background:rgba(20,20,18,.45)!important}
  html.tf-min #sideNavDrawer{background:var(--m-surface)!important;border:0!important}
  html.tf-min .sidenav-head{background:var(--m-surface)!important;color:var(--m-ink)!important;border-bottom:1px solid var(--m-line)!important}
  html.tf-min .sidenav-head::before, html.tf-min .sidenav-head::after, html.tf-min .sidenav-metallic-edge, html.tf-min .sidenav-brand-mark{display:none!important}
  html.tf-min .sidenav-head *{color:var(--m-ink)!important}
  html.tf-min .sidenav-tagline{display:none!important}
  html.tf-min .sidenav-brand{font-family:var(--m-font)!important;font-weight:600!important}
  html.tf-min .sidenav-close{background:var(--m-sunken)!important;color:var(--m-ink)!important}
  html.tf-min .sidenav-profile, html.tf-min .sidenav-switch-btn{background:var(--m-sunken)!important;border:0!important}
  html.tf-min .sidenav-profile-avatar{background:var(--m-ink)!important;color:var(--m-surface)!important}
  html.tf-min .sidenav-item{color:var(--m-ink)!important;font-weight:500!important;border-radius:8px!important;padding-left:8px!important}
  html.tf-min .sidenav-item:active{background:var(--m-sunken)!important;transform:none!important}
  html.tf-min .sidenav-item-flat{border-bottom:1px solid var(--m-line)!important;border-radius:0!important}
  html.tf-min .sidenav-item-group-toggle, html.tf-min .sidenav-item-group-toggle.open{background:transparent!important}
  html.tf-min .sidenav-item-danger{color:var(--m-neg)!important}
  html.tf-min .sidenav-item-admin{color:var(--m-muted)!important}
  html.tf-min .sidenav-group-label{color:var(--m-muted)!important;font-weight:600!important}
  html.tf-min .sidenav-flash{display:none!important}
  html.tf-min .sms-import-row{background:var(--m-surface)!important;border:1px solid var(--m-line)!important}
  html.tf-min .sms-import-row-icon{display:none!important}
  html.tf-min .sms-import-row-text b, html.tf-min .sms-import-row-chev{color:var(--m-ink)!important}
  html.tf-min .sms-import-row-text span{color:var(--m-muted)!important}
  html.tf-min [style*="EFF6FF"]{background:var(--m-surface)!important}

  /* ---------- Sheets, modals, popups ---------- */
  html.tf-min .actions-sheet-backdrop{background:rgba(20,20,18,.45)!important}
  html.tf-min .actions-sheet-backdrop .actions-sheet{background:var(--m-surface)!important;border-top:1px solid var(--m-line)!important}
  html.tf-min .actions-sheet-handle{background:var(--m-line-2)!important}
  html.tf-min .modal-card, html.tf-min .applock-card, html.tf-min .fest-card{
    background:var(--m-surface)!important;color:var(--m-ink)!important;border:1px solid var(--m-line)!important;border-radius:16px!important}
  html.tf-min .modal-card h2, html.tf-min .modal-card h3{color:var(--m-ink)!important;font-weight:600!important}
  /* Add Expense dialog: Manual / From SMS switch, submit button, tags tile, "Prefer not to type?" card
     (all hard-coded navy / mint / light blue in the app) */
  html.tf-min .qe-mode{background:var(--m-sunken)!important;border:0!important}
  html.tf-min .qe-mode-btn{background:transparent!important;color:var(--m-ink-2)!important;border:0!important}
  html.tf-min .qe-mode-btn.on, html.tf-min .ob-submit{background:var(--m-ink)!important;color:var(--m-surface)!important;border-color:var(--m-ink)!important}
  html.tf-min .tf-tile-btn{background:var(--m-sunken)!important;color:var(--m-ink)!important;border:0!important}
  html.tf-min .qe-sms-card{background:var(--m-sunken)!important;border:0!important}
  html.tf-min .qe-sms-ic{background:var(--m-surface)!important;color:var(--m-ink)!important}
  html.tf-min .qe-sms-card *{color:var(--m-ink)!important}
  html.tf-min .fest-card::before, html.tf-min .fest-card::after{display:none!important}
  html.tf-min .fest-card *:not(.fest-cta){color:var(--m-ink)!important}
  html.tf-min .fest-card h2{font-family:var(--m-font)!important;font-weight:600!important;font-size:24px!important}
  html.tf-min .fest-card h2 em, html.tf-min .fest-eyebrow, html.tf-min .fest-h2sub{font-style:normal!important;color:var(--m-ink-2)!important;
    font-family:var(--m-font)!important;font-weight:400!important}
  html.tf-min #festTitle svg{display:none!important}
  html.tf-min #festTitle span{color:var(--m-ink)!important}
  html.tf-min .fest-top{background:transparent!important;border:0!important}
  html.tf-min .fest-launch, html.tf-min .fest-tag, html.tf-min .fest-valid, html.tf-min .fest-feats li{
    background:transparent!important;border:1px solid var(--m-line)!important;border-radius:10px!important}
  html.tf-min .fest-tag{border-color:var(--m-line-2)!important;font-weight:600!important}
  html.tf-min .fest-foot{background:transparent!important;color:var(--m-muted)!important}
  html.tf-min .fest-foot *, html.tf-min .fest-feats li span:last-child{color:var(--m-muted)!important}
  html.tf-min .fest-card .fest-cta{color:var(--m-surface)!important}
  html.tf-min .applock-key, html.tf-min .applock-bio{background:var(--m-sunken)!important;color:var(--m-ink)!important;border:0!important}
  html.tf-min .applock-lock-badge, html.tf-min .applock-settings-badge{background:var(--m-ink)!important;color:var(--m-surface)!important}
  html.tf-min .tf-lock-gold, html.tf-min .tf-lock-elite{background:var(--m-sunken)!important;color:var(--m-ink)!important}
  html.tf-min .tf-att-tile.locked .tf-att-tile-btn, html.tf-min .tf-tile.locked .tf-tile-btn{background:var(--m-ink)!important;color:var(--m-surface)!important}

  /* ---------- Insights / AI panels ---------- */
  html.tf-min .ai-finance-landmark-card, html.tf-min .advisor-notes-landmark-card, html.tf-min .ai-score-card,
  html.tf-min #aiPromptPanel, html.tf-min #aiFinanceLockBanner{
    background:var(--m-surface)!important;border:1px solid var(--m-line)!important;border-radius:12px!important;color:var(--m-ink)!important}
  html.tf-min .ai-finance-landmark-card::before, html.tf-min .ai-finance-landmark-card::after,
  html.tf-min .advisor-notes-landmark-card::after, html.tf-min #aiPromptPanel::before,
  html.tf-min .advisor-notes-landmark-card>.section-head::before, html.tf-min .ai-finance-landmark-card>.section-head::before{display:none!important}
  html.tf-min .advisor-notes-landmark-card>.section-head, html.tf-min .ai-finance-landmark-card>.section-head{background:transparent!important;border:0!important}
  html.tf-min .ai-finance-title, html.tf-min .advisor-notes-title{color:var(--m-ink)!important;background:none!important}
  html.tf-min .ai-panel-head{background:transparent!important;color:var(--m-ink)!important;border-bottom:1px solid var(--m-line)!important}
  html.tf-min .ai-refresh-btn, html.tf-min .footer-refresh{background:transparent!important;color:var(--m-ink)!important;border:1px solid var(--m-line-2)!important}
  html.tf-min .ai-sugg-card{background:var(--m-surface)!important;border:1px solid var(--m-line)!important;border-left:2px solid var(--m-line-2)!important}
  html.tf-min .ai-sugg-card.sugg-high{border-left-color:var(--m-neg)!important}
  html.tf-min .ai-sugg-card.sugg-opp, html.tf-min .ai-sugg-card.sugg-opt{border-left-color:var(--m-pos)!important}
  html.tf-min .ai-score-ring::before{background:var(--m-surface)!important}
  html.tf-min .gauge-marker{background:var(--m-ink)!important}

  /* ---------- Footer ---------- */
  html.tf-min .footer-row, html.tf-min .footer-row *{color:var(--m-muted)!important}
  html.tf-min .footer-row .footer-version{background:transparent!important;border:1px solid var(--m-line)!important}
  html.tf-min .footer-row img, html.tf-min .footer-tagline svg, html.tf-min .footer-version svg{display:none!important}
  html.tf-min .footer-brand{font-weight:600!important;color:var(--m-ink-2)!important}

  /* ---------- Leftover hard-coded tints ----------
     Inline light backgrounds written straight into markup/JS. */
  html.tf-min [style*="background:#F8FAFC"], html.tf-min [style*="background:#F1F4F9"], html.tf-min [style*="background:#F1F5F9"],
  html.tf-min [style*="background:#FBFAFF"], html.tf-min [style*="background:#EAF3FF"], html.tf-min [style*="background:#FFF8E1"]{
    background:var(--m-sunken)!important}
  html.tf-min [style*="background:#fff"], html.tf-min [style*="background:#FFFFFF"], html.tf-min [style*="background: #fff"],
  html.tf-min [style*="background:#ffffff"]{background:var(--m-surface)!important}
  html.tf-min [style*="--lg-accent"]{--lg-accent:var(--m-ink)!important}

  /* ---------- Full ledger: prev / next month arrows beside Year + Month ---------- */
  html.tf-min .topbar #periodControlsRow{display:grid!important;grid-template-columns:40px minmax(0,1.1fr) minmax(0,.9fr) 40px!important;
    grid-template-rows:auto!important;gap:8px!important;align-items:center!important}
  html.tf-min .topbar #periodControlsRow .tf-pstep{-webkit-appearance:none!important;appearance:none!important;box-sizing:border-box!important;
    width:40px!important;height:40px!important;min-width:0!important;min-height:0!important;padding:0!important;margin:0!important;
    display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer!important;
    background:var(--m-surface)!important;color:var(--m-ink)!important;border:1px solid var(--m-line-2)!important;border-radius:8px!important}
  html.tf-min .topbar #periodControlsRow .tf-pstep:disabled{opacity:.38!important;cursor:default!important}

} /* @layer tf-min */
