/* Focus & Flow reference refinement */

.info-dot{display:none!important}

/* Desktop proportions closer to the reference */
.main-content{max-width:1180px;padding-top:18px}
.hero-grid{grid-template-columns:minmax(0,1.45fr) minmax(300px,.92fr);gap:12px}
.balance-banner{min-height:212px;border-radius:11px;padding:22px 24px}
.mix-card{border-radius:11px}
.summary-card,.quick-card,.detail-card{border-radius:10px}
.balance-amount{font-size:clamp(2.4rem,4.3vw,3.55rem)}
.hero-status{margin-bottom:17px}
.mountain-chart{inset:16px 0 5px 2px;width:100%;height:88%}
.mountain-back{fill:rgba(1,27,39,.24)}
.mountain-front{fill:rgba(1,20,31,.48)}

.mix-layout{grid-template-columns:145px minmax(0,1fr);gap:12px}
.legend{max-height:132px}
.summary-grid{grid-template-columns:1fr 1fr minmax(225px,.78fr)}
.summary-card,.quick-card{min-height:126px}

/* The bottom import/export strip duplicates Quick access and is intentionally hidden. */
.import-strip{display:none!important}

/* Quick access: compact and centered like the visual reference */
.quick-card{overflow:hidden}
.quick-actions{width:min(100%,420px);margin:auto;align-items:center}
.quick-card button{border-radius:10px;transition:background .18s ease,transform .18s ease}
.quick-card button:hover{background:rgba(40,216,245,.05)}
.quick-card button:active{transform:scale(.97)}
.quick-card button span{border:1px solid rgba(40,216,245,.16);background:rgba(14,52,69,.78)}

/* At tablet/phone widths the two summary cards fill the whole row. */
@media(max-width:980px){
  .summary-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .quick-card{grid-column:1/-1}
}

/* Mobile Import / Export bottom sheet */
.mobile-io-backdrop{position:fixed;inset:0;z-index:500;display:flex;align-items:flex-end;justify-content:center;padding:16px 12px calc(12px + env(safe-area-inset-bottom));background:rgba(0,7,13,.62);backdrop-filter:blur(10px);opacity:0;transition:opacity .18s ease}
.mobile-io-backdrop[hidden]{display:none}
.mobile-io-backdrop.open{opacity:1}
.mobile-io-sheet{width:min(520px,100%);padding:8px 14px 16px;border:1px solid #20465d;border-radius:20px;background:linear-gradient(180deg,#0c2131,#081622);box-shadow:0 24px 70px rgba(0,0,0,.5);transform:translateY(24px);transition:transform .2s cubic-bezier(.22,.61,.36,1)}
.mobile-io-backdrop.open .mobile-io-sheet{transform:none}
.mobile-io-handle{width:38px;height:4px;margin:2px auto 12px;border-radius:999px;background:#315267}
.mobile-io-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.mobile-io-head>div{display:flex;flex-direction:column;gap:2px}
.mobile-io-head strong{font-size:.9rem}
.mobile-io-head span{color:#7791a4;font-size:.64rem}
.mobile-io-close{display:grid;place-items:center;width:32px;height:32px;border:1px solid #294c62;border-radius:50%;background:#0a1a28;color:#8fa7b8;font-size:1.15rem}
.mobile-io-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.mobile-io-action{display:flex;min-height:76px;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:8px;border:1px solid #183c52;border-radius:12px;background:#0a1b29;color:#b9ccd8;text-align:center;cursor:pointer}
.mobile-io-action span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#0d3445;color:#52e6fb;font-size:1rem}
.mobile-io-action b{font-size:.6rem;line-height:1.2}
.mobile-io-action.primary{border-color:#245d71;background:linear-gradient(180deg,rgba(23,91,110,.28),rgba(10,27,41,.9))}
.mobile-io-action:active{transform:scale(.97)}

@media(max-width:700px){
  body{padding-bottom:calc(61px + env(safe-area-inset-bottom))}
  .main-content{padding:calc(4px + env(safe-area-inset-top)) 11px 22px}

  /* Mobile header: month | compact action */
  .topbar{grid-template-columns:minmax(0,1fr) auto;gap:5px;min-height:50px;margin-bottom:7px;padding:0 2px}
  .month-control{justify-self:start;display:flex;align-items:center;gap:4px}
  .month-control>div{min-width:105px}
  .month-control strong{font-size:.8rem;font-weight:700}
  .month-control button{display:none}
  .top-controls{justify-self:end}
  .top-controls .ctrl-btn:not(#langBtn){display:none!important}
  #langBtn{display:inline-flex;height:32px;min-width:46px;padding:0 5px;border:0;background:transparent;color:#9db2c1;font-size:.62rem}

  .hero-grid{gap:7px}
  .balance-banner{grid-template-columns:minmax(0,1.2fr) minmax(105px,.72fr);min-height:152px;padding:13px 14px 12px;border-radius:10px}
  .eyebrow{font-size:.67rem;font-weight:700}
  .balance-amount{margin:9px 0 1px;font-size:1.78rem;letter-spacing:-.055em}
  .hero-status{margin:4px 0 11px;font-size:.63rem}
  .balance-bar{height:5px}
  .hero-meta{margin-top:7px;font-size:.5rem}
  .hero-meta strong{font-size:.59rem}
  .hero-visual{align-self:end;height:100%;min-height:86px}
  .mountain-chart{inset:auto -2px 4px 0;width:105%;height:79%}
  .mountain-back{fill:rgba(2,31,43,.27)}
  .mountain-front{fill:rgba(2,23,34,.52)}
  /* Denser expense card like the reference */
  .mix-card{padding:11px 12px 9px;border-radius:10px}
  .section-title{font-size:.69rem}
  .mix-layout{grid-template-columns:108px minmax(0,1fr);gap:8px;margin-top:6px}
  .donut-container,.donut{width:104px;height:104px}
  .dc-pct{font-size:.72rem}
  .dc-label{max-width:63px;font-size:.45rem}
  .legend{display:grid;grid-template-columns:1fr 1fr;gap:3px 8px;max-height:none;overflow:visible}
  .legend-item{gap:4px;font-size:.49rem}
  .legend-dot{width:5px;height:5px}
  .mix-total{margin-top:6px;padding-top:6px;font-size:.48rem}
  .mix-total strong{font-size:.55rem}

  .summary-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px;margin-top:7px}
  .summary-card{width:100%;min-width:0;min-height:92px;padding:10px;border-radius:9px}
  .summary-icon{width:21px;height:21px;border-radius:6px;font-size:.57rem}
  .card-label{font-size:.57rem}
  .spark{font-size:.8rem}
  .card-value{margin-top:9px;font-size:.98rem}
  .summary-caption{margin-top:2px;font-size:.47rem}

  .quick-card{grid-column:1/-1;width:100%;min-height:78px;padding:8px 10px 9px;border-radius:9px}
  .quick-title{margin-bottom:2px;font-size:.53rem}
  .quick-actions{width:min(100%,330px);gap:10px}
  .quick-card button{gap:4px;padding:3px}
  .quick-card button span{width:28px;height:28px;border-radius:50%;font-size:.85rem}
  .quick-card button b{font-size:.46rem}

  .detail-grid{gap:7px;margin-top:7px}
  .detail-card{padding:11px 12px;border-radius:9px}

  .bottom-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important;height:calc(57px + env(safe-area-inset-bottom));padding:4px 7px env(safe-area-inset-bottom);background:rgba(3,14,24,.97)}
  .bottom-nav button{gap:1px;font-size:.45rem}
  .bottom-nav button span{font-size:.82rem}
  .bottom-nav .fab{display:none!important}
}

@media(max-width:390px){
  .main-content{padding-left:8px;padding-right:8px}
  .balance-banner{grid-template-columns:minmax(0,1.25fr) 96px;padding:12px}
  .balance-amount{font-size:1.62rem}
  .mix-layout{grid-template-columns:98px minmax(0,1fr)}
  .donut-container,.donut{width:96px;height:96px}
  .legend{gap:3px 6px}
  .legend-item{font-size:.45rem}
  .mobile-io-grid{grid-template-columns:repeat(2,1fr)}
}

/* Real More menu */
.mobile-more-backdrop{position:fixed;inset:0;z-index:510;display:flex;align-items:flex-end;justify-content:center;padding:16px 12px calc(12px + env(safe-area-inset-bottom));background:rgba(0,7,13,.62);backdrop-filter:blur(10px);opacity:0;transition:opacity .18s ease}
.mobile-more-backdrop[hidden]{display:none}
.mobile-more-backdrop.open{opacity:1}
.mobile-more-sheet{width:min(520px,100%);padding:8px 14px 14px;border:1px solid #20465d;border-radius:20px;background:linear-gradient(180deg,#0c2131,#081622);box-shadow:0 24px 70px rgba(0,0,0,.5);transform:translateY(24px);transition:transform .2s cubic-bezier(.22,.61,.36,1)}
.mobile-more-backdrop.open .mobile-more-sheet{transform:none}
.mobile-more-handle{width:38px;height:4px;margin:2px auto 12px;border-radius:999px;background:#315267}
.mobile-more-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.mobile-more-head strong{font-size:.9rem}
.mobile-more-close{display:grid;place-items:center;width:32px;height:32px;border:1px solid #294c62;border-radius:50%;background:#0a1a28;color:#8fa7b8;font-size:1.15rem}
.mobile-more-list{display:grid;gap:7px}
.mobile-more-list button{display:grid;grid-template-columns:36px 1fr;grid-template-rows:auto auto;column-gap:10px;width:100%;padding:11px;border:1px solid #183c52;border-radius:12px;background:#0a1b29;color:#b9ccd8;text-align:left}
.mobile-more-list button>span{grid-row:1/3;display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#0d3445;color:#52e6fb;font-size:1rem}
.mobile-more-list button>b{align-self:end;font-size:.72rem}
.mobile-more-list button>small{align-self:start;margin-top:2px;color:#71899a;font-size:.55rem}
.mobile-more-list button:active{transform:scale(.985)}
.page-size-settings{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:0 2px;padding:9px;border:1px solid #183c52;border-radius:12px;background:rgba(6,22,34,.68)}
.page-size-settings[hidden]{display:none}
.page-size-settings label{display:flex;align-items:center;justify-content:space-between;gap:7px;min-width:0;color:#96adbc;font-size:.61rem;font-weight:700}
.page-size-settings select{min-width:58px;min-height:34px;padding:0 8px;border:1px solid #28516a;border-radius:8px;background:#0a1d2a;color:#d9edf6;font:600 .68rem 'DM Mono',monospace;outline:0}
.page-size-settings select:focus{border-color:#49def4;box-shadow:0 0 0 2px rgba(73,222,244,.16)}

/* High-contrast Light Mode */
html.light{--bg:#eaf2f6;--panel:#ffffff;--panel-2:#f4f8fb;--line:#a9c2d0;--line-strong:#7fa5b9;--text:#102432;--muted:#526d7d;--cyan:#078da8;--accent:#0c9b55;--orange:#c45c00;--red:#c23d48}
html.light body{background:#eaf2f6;color:#102432}
html.light .main-content{color:#102432}
html.light .hero-card,html.light .mix-card,html.light .summary-card,html.light .quick-card,html.light .detail-card,html.light .empty-state{border-color:#b4cbd6;background:#fff;box-shadow:0 5px 16px rgba(34,73,94,.10)}
html.light .balance-banner{border-color:#9fc8d1;background:radial-gradient(circle at 93% 15%,rgba(18,178,101,.15),transparent 34%),linear-gradient(135deg,#d4edf3 0%,#c2e8e3 48%,#d9efdf 100%)}
html.light .eyebrow,html.light .section-title,html.light .card-label,html.light .row-name,html.light .total-row,html.light .month-control strong{color:#173142}
html.light .balance-amount{color:#0b7f4a}
html.light .hero-status{color:#0a8c4d;font-weight:600}
html.light .hero-meta{color:#4f6978}
html.light .hero-meta strong{color:#173142}
html.light .balance-bar{background:#78919f}
html.light .balance-bar-fill{background:linear-gradient(90deg,#18c565,#0da06b)}
html.light .mountain-back{fill:rgba(39,82,98,.24)}
html.light .mountain-front{fill:rgba(31,66,82,.42)}
html.light .dc-pct{color:#163244}
html.light .dc-label,html.light .legend-item,html.light .mix-total,html.light .summary-caption,html.light .row-freq-sub,html.light .row-pct,html.light .footer{color:#557080}
html.light .mix-total{border-color:#aac3d0}
html.light .mix-total strong,html.light .row-amount,html.light .total-row span:last-child{color:#173142}
html.light .green{color:#0a8c4d!important}
html.light .orange{color:#b95700!important}
html.light .green-bg{background:#dff5e8;color:#087d43}
html.light .orange-bg{background:#fff0df;color:#b95700}
html.light .quick-title{color:#087f98}
html.light .quick-card button{color:#385869}
html.light .quick-card button span{border-color:#9fc7d2;background:#dff1f5;color:#087f98}
html.light .row{border-color:#c4d7e0}
html.light .row:hover{background:#f0f6f9}
html.light .row-icon{background:#e2f1eb}
html.light .icon-btn{color:#527284}
html.light .icon-btn:hover{background:#e7f0f5;color:#153244}
html.light .btn-add{border-color:#86afbf;background:#f6fbfd;color:#087b93}
html.light .btn-add:hover{border-color:#078da8;background:#eaf7fa}
html.light .pct-bar{background:#c7d8e0}
html.light .sidebar{background:linear-gradient(180deg,#f8fbfd,#e9f1f5);border-color:#b4cbd6;box-shadow:12px 0 28px rgba(26,58,74,.12)}
html.light .brand{color:#163244}
html.light .brand-mark{background:#103447}
html.light .nav-item{color:#587586}
html.light .nav-item span{color:#607d8d}
html.light .nav-item:hover,html.light .nav-item.active{background:linear-gradient(90deg,rgba(25,151,190,.17),rgba(25,151,190,.07));color:#173142}
html.light .nav-item.active span{color:#078da8}
html.light .io-toggle{border-color:#9fbecb;background:#f7fbfd;color:#173142}
html.light .io-toggle>span{color:#078da8}
html.light .io-toggle small,html.light .side-footer{color:#587586}
html.light .io-dropdown{border-color:#9fbecb;background:#fff;box-shadow:0 16px 40px rgba(31,67,85,.16)}
html.light .io-item{border-color:#d2e0e7;color:#264657}
html.light .io-item:hover{background:#eef7fa;color:#087f98}
html.light #langBtn{color:#466878}
html.light .bottom-nav{border-color:#b8ccd6;background:rgba(248,251,253,.97)}
html.light .bottom-nav button{color:#587586}
html.light .bottom-nav button.active{color:#087f98}
html.light .mobile-io-backdrop,html.light .mobile-more-backdrop{background:rgba(28,47,58,.34)}
html.light .mobile-io-sheet,html.light .mobile-more-sheet{border-color:#9fbecb;background:linear-gradient(180deg,#ffffff,#eef5f8);box-shadow:0 22px 60px rgba(30,65,82,.24)}
html.light .mobile-io-handle,html.light .mobile-more-handle{background:#91aebb}
html.light .mobile-io-head strong,html.light .mobile-more-head strong{color:#173142}
html.light .mobile-io-head span{color:#587586}
html.light .mobile-io-close,html.light .mobile-more-close{border-color:#aac4d0;background:#f6fafc;color:#36596a}
html.light .mobile-io-action,html.light .mobile-more-list button{border-color:#b4cbd6;background:#fff;color:#264657}
html.light .mobile-io-action span,html.light .mobile-more-list button>span{background:#dff1f5;color:#087f98}
html.light .mobile-io-action.primary{border-color:#88b7c5;background:#eef9fb}
html.light .mobile-more-list button>small{color:#587586}
html.light .page-size-settings{border-color:#b4cbd6;background:#f7fbfd}
html.light .page-size-settings label{color:#466475}
html.light .page-size-settings select{border-color:#9bb8c6;background:#fff;color:#17485b}
html.light .import-preview{border-color:#a8c3cf;background:#fff;color:#173142;box-shadow:0 22px 60px rgba(30,65,82,.22)}
html.light .import-preview-summary,html.light .import-preview-notice,html.light .import-preview-details{color:#526f80}
html.light .import-preview-cancel{border-color:#a8c3cf;color:#36596a}
html.light .import-preview-confirm{background:#087f98;color:#fff}
