    /* ── Bottom Nav — Floating Pill ── */
    .bottom-nav {
      position: static;
      transform: none;
      background: rgba(30,30,30,0.4);
      backdrop-filter: blur(50px) saturate(200%) brightness(1.15);
      -webkit-backdrop-filter: blur(50px) saturate(200%) brightness(1.15);
      border: 1px solid rgba(255,255,255,0.15);
      display: flex;
      align-items: center;
      padding: 4px;
      padding-bottom: max(4px, env(safe-area-inset-bottom));
      gap: 0;
      z-index: 100;
      border-radius: 24px;
      box-shadow: var(--shadow-lg);
      transition: all var(--duration-enter) ease;
    }
    [data-theme="light"] .bottom-nav {
      background: rgba(255,255,255,0.45);
      border-color: rgba(255,255,255,0.6);
    }
    .bottom-nav::before { display: none; }

    .nav-items-wrapper {
      position: relative;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2px;
      z-index: 3;
    }
    .nav-items-wrapper .nav-item {
      justify-content: center;
    }

    .nav-active-pill {
      position: absolute;
      top: 0; left: 0;
      height: 100%;
      border-radius: 20px;
      will-change: transform;
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      transition: transform var(--duration-enter) var(--ease-spring),
                  width var(--duration-enter) var(--ease-spring),
                  background var(--duration-enter) ease, box-shadow var(--duration-enter) ease;
      z-index: 1;
    }
    [data-theme="dark"] .nav-active-pill {
      background: rgba(255,255,255,0.08);
      box-shadow: none;
    }
    [data-theme="light"] .nav-active-pill {
      background: rgba(0,0,0,0.06);
      box-shadow: none;
    }
    @keyframes navGoop {
      0%   { scale: 1 1; }
      25%  { scale: 1.06 0.92; }
      50%  { scale: 0.98 1.03; }
      80%  { scale: 1.01 0.995; }
      100% { scale: 1 1; }
    }
    .nav-active-pill.gooping {
      animation: navGoop 0.6s var(--ease-out);
    }

    .nav-item {
      position: relative;
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 400;
      font-family: var(--font-sans);
      cursor: pointer;
      padding: 8px 16px;
      border-radius: 20px;
      background: transparent;
      border: none;
      -webkit-tap-highlight-color: transparent;
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      z-index: 2;
      transition: color var(--duration-slow) ease;
    }
    [data-theme="dark"] .nav-item { color: rgba(255,255,255,0.5); }
    [data-theme="light"] .nav-item { color: rgba(0,0,0,0.5); }
    [data-theme="dark"] .nav-item.active { color: #ffffff; }
    [data-theme="light"] .nav-item.active { color: rgba(0,0,0,0.9); }

    .nav-item:active > .nav-item-content { transform: scale(0.92); }
    .nav-item-content {
      display: flex;
      align-items: center;
      gap: 6px;
      pointer-events: none;
      transition: transform var(--duration-normal) var(--ease-out);
    }

    .nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
    .nav-item .nav-label { display: inline; }
    .nav-item.active .nav-label { display: inline; }

    /* ── Transactions dropdowns ── */
    .txn-filters {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      width: 100%;
    }
    @media (max-width: 767px) {
      .txn-filters {
        width: 100% !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0;
      }
      .txn-select-wrap {
        flex: 1 1 0% !important;
      }
    }

    /* ── Date Navigator ── */
    .date-nav {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      width: 100%;
    }
    .date-nav-arrow {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border: none;
      background: transparent;
      color: var(--text-3);
      cursor: pointer;
      border-radius: 50%;
      transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
    }
    .date-nav-arrow:active {
      color: var(--text-1);
      background: var(--hover-bg);
    }
    .date-nav-arrow svg {
      width: 18px;
      height: 18px;
    }
    .date-nav-label {
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      background: transparent;
      color: var(--text-1);
      font-size: 16px;
      font-weight: 400;
      font-family: var(--font-sans);
      letter-spacing: var(--ls-tight);
      cursor: pointer;
      padding: 6px 16px;
      border-radius: 8px;
      min-width: 120px;
      transition: color var(--duration-fast) ease;
    }
    .date-nav-label:active {
      color: var(--text-2);
    }

    /* ── Date Picker Popup ── */
    .date-picker-popup {
      position: absolute;
      top: calc(100% + 8px);
      left: var(--content-px);
      right: var(--content-px);
      z-index: 110;
      background: var(--card-bg-solid);
      border: 1px solid var(--divider);
      border-radius: 16px;
      padding: 16px;
      box-shadow: var(--shadow-xl);
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .date-picker-popup.hidden {
      display: none;
    }
    .date-picker-presets {
      display: flex;
      gap: 6px;
    }
    .date-picker-preset {
      flex: 1;
      padding: 8px 4px;
      border: 1px solid var(--divider);
      border-radius: 8px;
      background: transparent;
      color: var(--text-2);
      font-size: 12px;
      font-weight: 400;
      font-family: var(--font-sans);
      cursor: pointer;
      transition: all var(--duration-fast) ease;
    }
    .date-picker-preset:active,
    .date-picker-preset.active {
      background: var(--blue);
      color: #fff;
      border-color: var(--blue);
    }
    .date-picker-year-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .date-picker-year-btn {
      padding: 6px 14px;
      border: 1px solid var(--divider);
      border-radius: 8px;
      background: transparent;
      color: var(--text-2);
      font-size: 13px;
      font-weight: 400;
      font-family: var(--font-sans);
      cursor: pointer;
      transition: all var(--duration-fast) ease;
    }
    .date-picker-year-btn.active {
      background: var(--blue);
      color: #fff;
      border-color: var(--blue);
    }
    .date-picker-months {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
    }
    .date-picker-month-btn {
      padding: 8px 4px;
      border: 1px solid var(--divider);
      border-radius: 8px;
      background: transparent;
      color: var(--text-2);
      font-size: 12px;
      font-weight: 400;
      font-family: var(--font-sans);
      cursor: pointer;
      transition: all var(--duration-fast) ease;
    }
    .date-picker-month-btn:active,
    .date-picker-month-btn.active {
      background: var(--blue);
      color: #fff;
      border-color: var(--blue);
    }
    /* ── Date Picker Mode Toggle ── */
    .date-picker-mode {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 2px;
      background: rgba(255,255,255,0.06);
      border-radius: 8px;
      padding: 3px;
    }
    .date-picker-mode-btn {
      flex: 1;
      padding: 6px 0;
      border: none;
      border-radius: 6px;
      background: transparent;
      color: var(--text-3);
      font-size: 12px;
      font-weight: 400;
      font-family: var(--font-sans);
      cursor: pointer;
      transition: all var(--duration-fast) ease;
    }
    .date-picker-mode-btn.active {
      background: var(--blue);
      color: #fff;
    }
    /* ── Date Picker Calendar (day/week mode) ── */
    .date-picker-calendar {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .date-picker-calendar.hidden { display: none; }
    .dp-cal-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .dp-cal-nav-btn {
      width: 32px;
      height: 32px;
      border: none;
      background: transparent;
      color: var(--text-3);
      font-size: 18px;
      cursor: pointer;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .dp-cal-nav-btn:active { color: var(--text-1); }
    .dp-cal-title {
      font-size: 14px;
      font-weight: 400;
      color: var(--text-1);
    }
    .dp-cal-weekdays {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      text-align: center;
    }
    .dp-cal-weekday {
      font-size: 10px;
      font-weight: 400;
      color: var(--text-3);
      padding: 4px 0;
    }
    .dp-cal-days {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 2px;
    }
    .dp-cal-day {
      aspect-ratio: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      color: var(--text-2);
      border-radius: 50%;
      cursor: pointer;
      transition: all var(--duration-fast) ease;
      position: relative;
    }
    .dp-cal-day:active { background: var(--hover-bg); }
    .dp-cal-day.empty { cursor: default; }
    .dp-cal-day.today { color: var(--blue); font-weight: 600; }
    .dp-cal-day.selected {
      background: var(--blue);
      color: #fff;
      font-weight: 400;
    }
    .dp-cal-day.in-range {
      background: rgba(74,124,255,0.15);
      border-radius: 4px;
    }
    .dp-cal-day.range-start { border-radius: 50% 4px 4px 50%; }
    .dp-cal-day.range-end { border-radius: 4px 50% 50% 4px; }
    .dp-cal-day.has-txn::after {
      content: '';
      position: absolute;
      bottom: 2px;
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: var(--emerald);
    }
    .dp-cal-clear {
      border: none;
      background: transparent;
      color: var(--text-3);
      font-size: 12px;
      font-family: var(--font-sans);
      cursor: pointer;
      padding: 6px;
      text-align: center;
    }
    .dp-cal-clear:active { color: var(--text-1); }

    /* ── Type Navigator ── */
    .type-nav {
      display: flex !important;
      flex-direction: row !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 4px;
      padding: 4px 0;
      width: 100%;
    }
    .type-nav.filter-hidden {
      display: none !important;
    }
    .type-nav-arrow {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border: none;
      background: transparent;
      color: var(--text-3);
      cursor: pointer;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .type-nav-arrow:active { color: var(--text-1); }
    .type-nav-arrow svg { width: 18px; height: 18px; }
    .type-nav-label-wrap {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .type-nav-native-select {
      position: absolute;
      inset: 0;
      opacity: 0;
      width: 100%;
      height: 100%;
      cursor: pointer;
      font-size: 16px;
    }
    .type-nav-label {
      border: none;
      background: transparent;
      color: var(--text-1);
      font-size: 16px;
      font-weight: 400;
      font-family: var(--font-sans);
      letter-spacing: var(--ls-tight);
      pointer-events: none;
      padding: 6px 16px;
      min-width: 100px;
      text-align: center;
    }
    .type-nav-label:active { color: var(--text-2); }
    .type-dropdown {
      position: absolute;
      top: calc(100% + 8px);
      left: var(--content-px);
      right: var(--content-px);
      z-index: 110;
      background: var(--card-bg-solid);
      border: 1px solid var(--divider);
      border-radius: 16px;
      padding: 8px;
      box-shadow: var(--shadow-xl);
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .type-dropdown.hidden { display: none; }
    .type-dropdown-item {
      padding: 10px 16px;
      border: none;
      border-radius: 10px;
      background: transparent;
      color: var(--text-2);
      font-size: 14px;
      font-weight: 400;
      font-family: var(--font-sans);
      cursor: pointer;
      text-align: left;
      transition: all var(--duration-fast) ease;
    }
    .type-dropdown-item:active {
      background: var(--hover-bg);
    }
    .type-dropdown-item.active {
      color: var(--text-1);
      font-weight: 400;
      background: rgba(74,124,255,0.1);
    }

    .txn-filters {
      position: relative;
    }

    .txn-filter-item {
      overflow: hidden;
    }
    .txn-filter-item.txn-filter-extra,
    .txn-filter-item#filterBdType {
      transition: flex var(--duration-enter) var(--ease-out),
                  opacity var(--duration-slow) ease,
                  max-width var(--duration-enter) var(--ease-out),
                  padding var(--duration-enter) var(--ease-out),
                  margin var(--duration-enter) var(--ease-out);
    }
    .txn-filter-extra.filter-hidden,
    .txn-filter-item.filter-hidden {
      flex: 0 0 0px !important;
      max-width: 0px;
      opacity: 0;
      padding: 0;
      margin: 0;
      pointer-events: none;
    }
    @media (max-width: 767px) {
      .txn-filter-extra.filter-hidden,
      .txn-filter-item.filter-hidden {
        display: none !important;
      }
    }

    .txn-select-wrap {
      position: relative;
      flex: 1 1 0%;
      min-width: 0;
      max-width: 100%;
    }

    .txn-select {
      width: 100%;
      appearance: none;
      -webkit-appearance: none;
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      border-radius: 12px;
      padding: 8px 24px 8px 10px;
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 400;
      color: var(--text-1);
      cursor: pointer;
      backdrop-filter: blur(20px) saturate(180%);
      -webkit-backdrop-filter: blur(20px) saturate(180%);
      transition: all var(--duration-normal) ease;
      outline: none;
    }

    .txn-select:focus {
      border-color: rgba(74,222,128,0.4);
      box-shadow: 0 0 0 2px rgba(74,222,128,0.1);
    }

    .txn-select option {
      background: var(--bg);
      color: var(--text-1);
    }

    .txn-select-wrap::after {
      content: '▾';
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 10px;
      color: var(--text-3);
      pointer-events: none;
    }

    @media (min-width: 640px) {
      .txn-filters {
        width: auto;
        order: unset;
        flex-wrap: nowrap;
        padding-top: 0;
      }
      .txn-select-wrap {
        flex: 0 0 auto;
      }
    }

    /* ── Insights Page ── */
    .insights-metrics-row {
      display: flex;
      gap: 16px;
      padding: 16px var(--content-px);
    }
    .insight-metric-card {
      flex: 1;
      min-width: 0;
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      border-radius: 20px;
      padding: 16px;
      position: relative;
      overflow: hidden;
      backdrop-filter: blur(20px) saturate(180%);
      -webkit-backdrop-filter: blur(20px) saturate(180%);
      box-shadow: var(--shadow-card), inset 0 1px 0 var(--glass-shine);
      opacity: 0;
      transform: translateY(16px);
      animation: insightCardIn 0.7s var(--ease-out) forwards;
    }
    .insight-metric-card::before { display: none; }
    .insight-metric-card:nth-child(2) { animation-delay: 0.1s; }
    .insight-metric-card:nth-child(3) { animation-delay: 0.2s; }
    .insight-metric-label {
      font-size: 10px;
      font-weight: 400;
      letter-spacing: var(--ls-wide);
      text-transform: uppercase;
      color: rgba(255,255,255,0.15);
      text-shadow: 0 -1px 0 rgba(0,0,0,0.8), 0 1px 1px rgba(255,255,255,0.04);
      margin-bottom: 8px;
    }
    [data-theme="light"] .insight-metric-label {
      color: rgba(0,0,0,0.2);
      text-shadow: 0 1px 0 rgba(255,255,255,0.8), 0 -1px 1px rgba(0,0,0,0.04);
    }
    .insight-metric-value {
      font-family: var(--font-mono);
      font-size: 28px;
      font-weight: 400;
      letter-spacing: var(--ls-tight);
      color: var(--text-1);
      line-height: var(--lh-none);
      margin-bottom: 4px;
    }
    .insight-metric-sub {
      font-size: 12px;
      color: var(--text-3);
      margin-bottom: 12px;
    }
    .insight-metric-sparkline {
      height: 32px;
      position: relative;
    }
    .insight-metric-sparkline svg {
      width: 100%;
      height: 100%;
    }
    .insight-metric-bar {
      height: 6px;
      border-radius: 4px;
      background: rgba(255,255,255,0.06);
      overflow: hidden;
      position: relative;
    }
    [data-theme="light"] .insight-metric-bar {
      background: rgba(0,0,0,0.06);
    }
    .insight-metric-bar-fill {
      height: 100%;
      border-radius: 4px;
      transition: width 1.2s var(--ease-out);
    }

    .insights-bottom-row {
      display: flex;
      gap: 16px;
      padding: 0 var(--content-px) 16px;
    }
    .insights-trends-card {
      flex: 3;
      min-width: 0;
    }
    .insights-movers-card {
      flex: 2;
      min-width: 0;
    }
    .insights-donuts-row {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
      padding: 0 var(--content-px) 16px;
    }
    /* Remove extra margin on chart-cards inside Insights containers */
    #txnSummaryTab .chart-card {
      margin-bottom: 0;
    }
    #txnSummaryTab .charts-section {
      padding: 0 12px 16px;
    }
    @media (max-width: 900px) {
      .insights-metrics-row { flex-direction: column; }
      .insights-bottom-row { flex-direction: column; }
      .insights-donuts-row { grid-template-columns: 1fr; }
    }

    .mover-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 0;
      border-bottom: 1px solid var(--glass-border);
    }
    .mover-row:last-child { border-bottom: none; }
    .mover-name {
      font-size: 12px;
      font-weight: 400;
      color: var(--text-1);
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .mover-amount {
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 400;
      margin-left: 12px;
      flex-shrink: 0;
    }
    .mover-pct {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 400;
      margin-left: 8px;
      padding: 2px 6px;
      border-radius: 6px;
      flex-shrink: 0;
    }
    .mover-up { color: var(--red); }
    .mover-up .mover-pct { background: rgba(255,69,58,0.1); color: var(--red); }
    .mover-down { color: var(--emerald); }
    .mover-down .mover-pct { background: rgba(48,209,88,0.1); color: var(--emerald); }
    .mover-new { color: var(--text-3); }
    .mover-new .mover-pct { background: rgba(255,255,255,0.06); color: var(--text-3); }

    /* ── Spending Heatmap ── */
    .heatmap-wrap {
      overflow-x: auto;
      padding-bottom: 4px;
    }
    .heatmap-grid {
      display: flex;
      gap: 2px;
      flex: 1;
      min-width: 700px;
    }
    .heatmap-col {
      display: flex;
      flex-direction: column;
      gap: 2px;
      flex: 1;
    }
    .heatmap-cell {
      width: 100%;
      aspect-ratio: 1;
      border-radius: 4px;
      position: relative;
      transition: transform var(--duration-fast) ease;
      cursor: pointer;
    }
    .heatmap-cell:hover,
    .heatmap-cell.heatmap-active {
      transform: scale(1.6);
      z-index: 5;
    }
    @media (hover: none) {
      .heatmap-cell.heatmap-active {
        transform: scale(3.5);
        border-radius: 4px;
      }
    }
    .heatmap-cell.heatmap-today {
      outline: 2px solid var(--text-1);
      outline-offset: 1px;
    }
    .heatmap-tooltip {
      position: fixed;
      background: #2c2c2e;
      color: rgba(255,255,255,0.8);
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 400;
      padding: 4px 8px;
      border-radius: 6px;
      white-space: nowrap;
      pointer-events: none;
      z-index: 9999;
      border: 1px solid rgba(255,255,255,0.08);
      box-shadow: var(--shadow-sm);
      opacity: 0;
      transition: opacity var(--duration-fast) ease;
    }
    .heatmap-tooltip.visible { opacity: 1; }
    @media (hover: none) {
      .heatmap-tooltip { font-size: 12px; padding: 6px 12px; border-radius: 10px; }
    }

    /* ── Shared external chart tooltip ── */
    .chart-ext-tip {
      position: fixed;
      background: #2c2c2e;
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 12px;
      padding: 8px 12px;
      pointer-events: none;
      z-index: 9999;
      opacity: 0;
      transition: opacity var(--duration-fast) ease;
      white-space: nowrap;
      box-shadow: var(--shadow-lg);
    }
    .chart-ext-tip.visible { opacity: 1; }
    .chart-tip-title {
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 400;
      color: rgba(255,255,255,0.9);
      margin-bottom: 2px;
    }
    .chart-tip-line {
      font-family: var(--font-mono);
      font-size: 12px;
      color: rgba(255,255,255,0.7);
    }
    [data-theme="light"] .chart-ext-tip {
      background: #fff;
      border-color: rgba(0,0,0,0.1);
    }
    [data-theme="light"] .chart-tip-title { color: rgba(0,0,0,0.85); }
    [data-theme="light"] .chart-tip-line { color: rgba(0,0,0,0.6); }
    @media (hover: none) {
      .chart-ext-tip { padding: 10px 16px; border-radius: 14px; }
      .chart-tip-title { font-size: 14px; }
      .chart-tip-line { font-size: 14px; }
    }
    .heatmap-labels {
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-right: 6px;
      flex-shrink: 0;
      width: 14px;
    }
    .heatmap-label {
      flex: 1;
      font-size: 9px;
      color: var(--text-3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-mono);
    }
    .heatmap-months {
      display: flex;
      margin-left: 20px;
      margin-bottom: 4px;
    }
    .heatmap-month-label {
      font-size: 9px;
      color: var(--text-3);
      font-family: var(--font-mono);
    }

    /* ── Scrollable txn tabs ── */
    .txn-tabs {
      overflow: hidden;
      flex-wrap: nowrap;
      justify-content: center;
    }
    .txn-tabs .tab { white-space: nowrap; flex-shrink: 0; }

    /* ── Breakdown type filter ── */
    /* ── Breakdown: Segmented Control ── */
    .breakdown-type-filter {
      display: flex;
      padding: 12px clamp(12px, 4vw, 20px) 8px;
      position: relative;
    }
    .bd-seg-track {
      display: flex;
      flex: 1;
      background: var(--card-bg-solid);
      border: 1px solid var(--glass-border);
      border-radius: 12px;
      padding: 4px;
      position: relative;
    }
    .bd-seg-pill {
      position: absolute;
      top: 3px;
      bottom: 3px;
      left: 3px;
      background: var(--seg-pill-bg);
      border: 1px solid var(--glass-border);
      border-radius: 10px;
      transition: left var(--duration-normal) var(--ease-spring), width var(--duration-normal) var(--ease-spring);
      pointer-events: none;
      z-index: 1;
    }
    .bd-seg-btn {
      flex: 1;
      padding: 8px 0;
      border: none;
      background: none;
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 400;
      color: var(--text-3);
      cursor: pointer;
      position: relative;
      z-index: 2;
      transition: color var(--duration-normal) ease, font-weight var(--duration-normal) ease;
      text-align: center;
    }
    .bd-seg-btn.active {
      color: #ffffff;
      font-weight: 400;
    }

    /* ── Breakdown: Section Card ── */
    .breakdown-section {
      margin: 0 var(--content-px) 16px;
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      border-radius: 20px;
      overflow: visible;
      backdrop-filter: blur(40px) saturate(180%);
      -webkit-backdrop-filter: blur(40px) saturate(180%);
      box-shadow: var(--shadow-elevated), inset 0 1px 0 var(--glass-shine), inset 0 0 80px var(--glass-glow);
    }

    /* ── Section Header (clickable, collapsible) ── */
    .bd-header {
      padding: 16px 16px 0;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
    }
    .bd-header-top {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 4px;
    }
    .bd-type-label {
      font-size: 12px;
      font-weight: 400;
      text-transform: uppercase;
      letter-spacing: var(--ls-wide);
      font-family: var(--font-sans);
    }
    .bd-status-badge {
      font-size: 10px;
      font-weight: 400;
      padding: 2px 8px;
      border-radius: 10px;
      line-height: var(--lh-normal);
    }
    .bd-item-count {
      font-size: 12px;
      color: var(--text-3);
      margin-left: auto;
    }
    .bd-chevron {
      width: 16px;
      height: 16px;
      color: var(--text-3);
      transition: transform var(--duration-slow) var(--ease-out);
      flex-shrink: 0;
    }
    .bd-chevron.collapsed { transform: rotate(-90deg); }

    .bd-headline {
      font-size: 32px;
      font-weight: 800;
      letter-spacing: var(--ls-tight);
      line-height: var(--lh-tight);
      font-family: var(--font-sans);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    @media (max-width: 767px) {
      .bd-headline {
        font-size: 28px;
      }
    }
    .bd-subtext {
      font-size: 12px;
      color: var(--text-3);
      margin-top: 2px;
    }

    /* Summary bar (always visible) */
    .bd-summary-bar {
      position: relative;
      height: 8px;
      background: rgba(255,255,255,0.06);
      margin: 28px 16px 28px;
      border-radius: 6px;
      overflow: visible;
      display: flex;
      gap: 2px;
    }
    [data-theme="light"] .bd-summary-bar {
      background: rgba(15,23,42,0.06);
    }
    [data-theme="light"] .bd-seg-tooltip {
      background: #ffffff;
      border-color: rgba(15,23,42,0.08);
      box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }
    .bd-seg-fill {
      height: 100%;
      border-radius: 4px;
      width: 0;
      transition: width 0.8s var(--ease-out), opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
      min-width: 0;
      cursor: pointer;
      position: relative;
    }
    .bd-seg-fill::before {
      content: '';
      position: absolute;
      top: -20px;
      bottom: -20px;
      left: 0;
      right: 0;
    }
    .bd-seg-fill.bd-seg-active {
      opacity: 1;
      transform: scaleY(1.4);
      border-radius: 3px;
      z-index: 1;
    }
    .bd-summary-bar:has(.bd-seg-active) .bd-seg-fill:not(.bd-seg-active) {
      opacity: 0.35;
    }
    .bd-seg-tooltip {
      position: absolute;
      bottom: calc(100% + 24px);
      left: 0;
      background: var(--card-bg-solid);
      border: 1px solid var(--divider);
      border-radius: 10px;
      padding: 8px 12px;
      box-shadow: var(--shadow-lg);
      display: flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
      z-index: 10;
      pointer-events: none;
    }
    .bd-seg-tooltip.hidden { display: none; }
    .bd-seg-tip-cat {
      font-size: 12px;
      font-weight: 400;
      color: var(--text-1);
    }
    .bd-seg-tip-amt {
      font-size: 12px;
      font-weight: 400;
      color: var(--text-2);
      font-family: var(--font-mono);
    }
    .bd-seg-tip-pct {
      font-size: 11px;
      font-weight: 400;
      color: var(--text-3);
    }

    /* ── Collapsible content ── */
    .bd-items-wrap .bd-items-inner {
      transition: opacity var(--duration-normal) ease;
    }
    .bd-items-wrap.collapsed .bd-items-inner {
      display: none;
    }
    .bd-items-inner {
      padding: 0 16px 8px;
    }

    /* ── Line Items ── */
    .bd-item {
      padding: 16px 0;
      border-bottom: 1px solid var(--divider);
    }
    .bd-item:last-child { border-bottom: none; }

    .bd-item-row1 {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      margin-bottom: 6px;
    }
    .bd-item-name {
      font-family: var(--font-sans);
      font-weight: 400;
      font-size: 14px;
      color: var(--text-1);
    }
    .bd-item-gap {
      font-family: var(--font-mono);
      font-size: 14px;
      font-weight: 400;
    }

    /* Progress bar */
    .bd-item-bar-wrap {
      position: relative;
      height: 3px;
      background: var(--glass-bg);
      border-radius: 4px;
      margin-bottom: 10px;
      overflow: hidden;
    }
    .bd-item-bar-fill {
      height: 100%;
      border-radius: 4px;
      width: 0;
      transition: width 0.9s var(--ease-out);
    }

    /* Meta row */
    .bd-item-row3 {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }
    .bd-item-meta {
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--text-3);
      font-variant-numeric: tabular-nums;
    }
    .bd-item-chip {
      font-family: var(--font-sans);
      font-size: 9px;
      font-weight: 400;
      padding: 4px 8px;
      border-radius: 6px;
      line-height: var(--lh-none);
      letter-spacing: var(--ls-slight);
    }
    .bd-chip-green { background: rgba(48,209,88,0.1); color: #30d158; border: 1px solid rgba(48,209,88,0.15); }
    .bd-chip-amber { background: rgba(255,159,10,0.1); color: var(--amber); border: 1px solid rgba(255,159,10,0.15); }
    .bd-chip-red { background: rgba(255,69,58,0.1); color: #ff453a; border: 1px solid rgba(255,69,58,0.15); }
    .bd-chip-muted { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.3); border: 1px solid rgba(255,255,255,0.06); }
    .bd-chip-blue { background: rgba(10,132,255,0.1); color: var(--blue); border: 1px solid rgba(10,132,255,0.15); }
    [data-theme="light"] .bd-chip-muted { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.3); border: 1px solid rgba(0,0,0,0.06); }

    .chart-toggle {
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      font-size: 10px;
      font-weight: 400;
      color: var(--text-2);
      padding: 4px 8px;
      border-radius: 10px;
      transition: opacity var(--duration-normal), background var(--duration-fast);
      user-select: none;
      font-family: var(--font-sans);
    }
    .chart-toggle:hover {
      background: rgba(255,255,255,0.04);
    }
    [data-theme="light"] .chart-toggle:hover {
      background: rgba(0,0,0,0.04);
    }
    .chart-toggle.off {
      opacity: 0.3;
    }
    .chart-toggle .toggle-dot {
      width: 8px;
      height: 8px;
      border-radius: 4px;
      flex-shrink: 0;
    }

    .pct-bar-wrap {
      position: relative;
      width: 100%;
      min-width: 32px;
      height: 18px;
      background: var(--divider);
      border-radius: 10px;
      overflow: hidden;
      margin-left: auto;
    }

    .pct-bar-fill {
      height: 100%;
      border-radius: 10px;
      transition: width var(--duration-slow) ease;
      min-width: 2px;
    }

    .pct-bar-label {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 9px;
      font-weight: 400;
      color: var(--text-1);
      pointer-events: none;
      line-height: var(--lh-none);
    }

    /* Gradient colors are set dynamically via inline style */

    .breakdown-excess { color: var(--red); }
    .breakdown-remaining { color: var(--emerald); }

    /* ── Full Tab Layout ── */
    /* ── Inline Mini Donut (Breakdown sections) ── */
    .bd-donut-wrap {
      flex-shrink: 0;
    }
    .bd-mini-donut {
      display: block;
    }
    .bd-donut-slice:hover {
      stroke-width: 15 !important;
      filter: brightness(1.15);
    }
    .bd-donut-tip {
      position: absolute;
      bottom: calc(100% + 6px);
      left: 50%;
      transform: translateX(-50%) translateY(4px);
      background: #2c2c2e;
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 10px;
      padding: 6px 10px;
      pointer-events: none;
      opacity: 0;
      transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out);
      white-space: nowrap;
      z-index: 50;
      box-shadow: var(--shadow-sm);
    }
    .bd-donut-tip.visible {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
    .bd-donut-tip-label {
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 400;
      color: rgba(255,255,255,0.9);
    }
    .bd-donut-tip-row {
      display: flex;
      gap: 8px;
      align-items: baseline;
      margin-top: 2px;
    }
    .bd-donut-tip-amount {
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 400;
      color: #fff;
    }
    .bd-donut-tip-pct {
      font-family: var(--font-mono);
      font-size: 10px;
      color: rgba(255,255,255,0.5);
    }
    [data-theme="light"] .bd-donut-tip {
      background: #fff;
      border-color: rgba(0,0,0,0.1);
      box-shadow: var(--shadow-sm);
    }
    [data-theme="light"] .bd-donut-tip-label { color: rgba(0,0,0,0.8); }
    [data-theme="light"] .bd-donut-tip-amount { color: #1a1a1a; }
    [data-theme="light"] .bd-donut-tip-pct { color: rgba(0,0,0,0.4); }
    @media (hover: none) {
      .bd-donut-tip {
        bottom: calc(100% + 20px);
        padding: 8px 16px;
      }
      .bd-donut-tip-label { font-size: 14px; }
      .bd-donut-tip-amount { font-size: 14px; }
      .bd-donut-tip-pct { font-size: 12px; }
    }

    /* ── Tab slide transitions ── */
    .slide-left {
      animation: slideFromRight 0.3s var(--ease-out) forwards;
    }
    .slide-right {
      animation: slideFromLeft 0.3s var(--ease-out) forwards;
    }
    @keyframes slideFromRight {
      from { opacity: 0; transform: translateX(40px); }
      to { opacity: 1; transform: translateX(0); }
    }
    @keyframes slideFromLeft {
      from { opacity: 0; transform: translateX(-40px); }
      to { opacity: 1; transform: translateX(0); }
    }

    /* ── Utility ── */
    .hidden { display: none !important; }

    /* ── Transaction Detail Modal ── */
    .txn-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.5);
      z-index: 999;
      opacity: 0;
      pointer-events: none;
      transition: opacity var(--duration-normal) ease;
    }
    .txn-modal-overlay.open {
      opacity: 1;
      pointer-events: auto;
    }
    .txn-modal {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      background: var(--glass-bg);
      backdrop-filter: blur(40px) saturate(180%);
      -webkit-backdrop-filter: blur(40px) saturate(180%);
      border: 1px solid var(--glass-border);
      border-bottom: none;
      border-radius: 20px 20px 0 0;
      padding: 20px 24px 32px;
      transform: translateY(100%);
      transition: transform var(--duration-slow) var(--ease-spring);
      max-height: 70vh;
      overflow-y: auto;
    }
    .txn-modal-overlay.open .txn-modal {
      transform: translateY(0);
    }
    .txn-modal-handle {
      width: 36px;
      height: 4px;
      background: var(--text-3);
      border-radius: 4px;
      margin: 0 auto 16px;
    }
    .txn-modal-row {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding: 10px 0;
      border-bottom: 1px solid var(--divider);
    }
    .txn-modal-row:last-child { border-bottom: none; }
    .txn-modal-label {
      font-size: 10px;
      font-weight: 400;
      text-transform: uppercase;
      letter-spacing: var(--ls-spread);
      color: var(--text-3);
      font-family: var(--font-mono);
    }
    .txn-modal-value {
      font-size: 14px;
      font-weight: 400;
      color: var(--text-1);
      font-family: var(--font-sans);
      text-align: right;
      max-width: 65%;
      word-break: break-word;
    }
    .txn-refund-label {
      font-size: 13px;
      color: var(--text-2);
      font-family: var(--font-sans);
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
    }
    .txn-refund-label input[type="checkbox"] {
      accent-color: var(--emerald);
      width: 16px;
      height: 16px;
    }
    .txn-edit-input {
      background: rgba(255,255,255,0.06);
      border: 1px solid var(--divider);
      border-radius: 12px;
      padding: 8px 12px;
      font-size: 14px;
      font-weight: 400;
      color: var(--text-1);
      font-family: var(--font-sans);
      text-align: right;
      width: 100%;
      max-width: 65%;
      outline: none;
      transition: border-color var(--duration-normal) ease, background var(--duration-normal) ease;
    }
    .txn-edit-input:focus {
      border-color: var(--emerald);
      background: rgba(255,255,255,0.1);
    }
    .txn-edit-select {
      background: rgba(255,255,255,0.06);
      border: 1px solid var(--divider);
      border-radius: 12px;
      padding: 8px 12px;
      font-size: 14px;
      font-weight: 400;
      color: var(--text-1);
      font-family: var(--font-sans);
      text-align: right;
      width: 100%;
      max-width: 65%;
      outline: none;
      -webkit-appearance: none;
      appearance: none;
      cursor: pointer;
    }
    .txn-modal-actions {
      display: flex;
      gap: 10px;
      margin-top: 16px;
      padding-top: 12px;
    }
    .txn-modal-btn {
      flex: 1;
      padding: 12px 0;
      border-radius: 12px;
      border: 1px solid var(--divider);
      font-family: var(--font-sans);
      font-size: 14px;
      font-weight: 400;
      cursor: pointer;
      transition: all var(--duration-normal) ease;
      backdrop-filter: blur(12px);
    }
    .txn-modal-btn.save {
      background: rgba(74,222,128,0.15);
      border-color: rgba(74,222,128,0.3);
      color: var(--emerald);
    }
    .txn-modal-btn.save:active { transform: scale(0.96); }
    .txn-modal-btn.save:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
    .txn-modal-btn.cancel {
      background: rgba(255,255,255,0.04);
      color: var(--text-2);
    }
    .txn-modal-btn.cancel:active { transform: scale(0.96); }
    .txn-modal-btn.delete {
      background: rgba(248,113,113,0.1);
      border-color: rgba(248,113,113,0.25);
      color: var(--red);
      flex: 0.5;
    }
    .txn-modal-btn.delete:active { transform: scale(0.96); }
    .txn-edit-status {
      text-align: center;
      font-size: 12px;
      font-family: var(--font-mono);
      padding: 8px 0 0;
      min-height: 24px;
    }

    .error-msg {
      background: linear-gradient(135deg, rgba(248,113,113,0.08), var(--glass-bg));
      border: 1px solid rgba(248,113,113,0.2);
      border-radius: 12px;
      padding: 12px 16px;
      margin: 16px 20px;
      font-size: 14px;
      font-weight: 400;
      color: var(--red);
      backdrop-filter: blur(12px);
      transition: all var(--duration-enter) ease;
    }

    .info-msg {
      background: linear-gradient(135deg, rgba(74,222,128,0.08), var(--glass-bg));
      border: 1px solid rgba(74,222,128,0.2);
      border-radius: 12px;
      padding: 12px 16px;
      margin: 8px 20px;
      font-size: 14px;
      color: var(--emerald);
      backdrop-filter: blur(12px);
      transition: all var(--duration-enter) ease;
    }

    .price-loading {
      font-size: 12px;
      font-family: var(--font-mono);
      color: var(--text-3);
      padding: 8px 20px;
      text-align: center;
    }

    /* ── Responsive ── */
    @media (min-width: 600px) {
      .charts-section {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .chart-card { margin-bottom: 0; width: 100%; }

      .chart-wrapper-pnl {
        height: clamp(240px, 32vw, 360px);
      }

      .chart-wrapper-hist {
        height: clamp(220px, 28vw, 320px);
      }
    }

    @media (orientation: landscape) and (max-height: 500px) {
      .charts-section {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px 16px;
      }

      .chart-card {
        margin-bottom: 0;
        padding: 10px;
        width: 100%;
      }

      .pie-donut-wrap {
        min-width: 140px;
        max-width: 200px;
      }

      .chart-wrapper-pnl,
      .chart-wrapper-hist {
        height: 200px;
      }
    }

    @media (min-width: 768px) {
      .charts-section { gap: 12px; }
    }

