/* nf-build:289 */
:root {
  --nf-green: #46ae37;
  --nf-green-dark: #3d9a30;
  --nf-ink: #14231a;
  --nf-muted: #6b7c72;
  --nf-card: #ffffff;
  --nf-bg: #f4f6f5;
  /* Expense/income list surface (white in light; = --nf-bg in dark) */
  --nf-list: #ffffff;
  color-scheme: light;
  --nf-border: #e3e8e5;
  --nf-danger: #c0392b;
  --nf-font: 'Manrope', system-ui, sans-serif;
  --nf-sidebar: 300px;
  --nf-top: 60px;
}

html {
  /* Kill double-tap zoom; pinch blocked via viewport + gesture listeners */
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  /* Skeleton tokens — shared by list rows + cold overall bar */
  --skel-bone: #e2e8e3;
  --skel-shine: #f2f5f2;
  --skel-page: var(--nf-bg, #f4f6f5);
}

* {
  box-sizing: border-box;
}

.money-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--nf-font);
  color: var(--nf-ink);
  background: var(--nf-bg);
}

.money-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--nf-card);
  border-bottom: 1px solid var(--nf-border);
  position: relative;
  z-index: 20;
  min-height: var(--nf-top);
  flex-shrink: 0;
}

/* Mobile-only brand row (logo + ⋮ spaces) */
.money-brand-bar {
  display: none;
}

.money-brand-logo-wrap {
  display: flex;
  align-items: center;
  line-height: 0;
}

.money-brand-logo {
  display: block;
  height: 22px;
  width: auto;
}

.money-brand-actions {
  display: none;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}

/*
 * PC left rail: square Expenses / Incomes tabs.
 * Mobile: hidden (dock). Sidebar (z50) covers this rail (z12).
 */
.money-home-mode-rail {
  display: none;
}

.money-home-mode-tab {
  border: none;
  background: transparent;
  color: var(--nf-ink-muted, #667);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 90px;
  margin: 0;
  padding: 10px 6px;
  border-radius: 0;
  box-sizing: border-box;
}

.money-home-mode-tab-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.money-home-mode-tab-label {
  font-size: 11px;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-home-mode-tab.is-active {
  background: var(--nf-card); /* same as .money-pane-cats */
  color: #2f8f28;
}

.money-home-mode-tab:active {
  background: color-mix(in srgb, var(--nf-card) 70%, transparent);
}

/* Split overall progress: expense | income, 75/25 ↔ 25/75 by homeMode */
.money-overall-split {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.money-overall-seg {
  min-width: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/*
 * Flex 75↔25: CSS transition for desktop / non-pager mode taps (nf-overall-anim).
 * During ViewPager drag, nf-overall-live disables transition — JS drives flex each frame.
 */
html.nf-overall-anim .money-overall-seg {
  transition:
    flex-grow var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1),
    flex-shrink var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1),
    flex-basis var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1);
}

html.nf-overall-live .money-overall-seg {
  transition: none !important;
}

/* Solo plan → that bar takes the full row */
.money-overall-split[data-plans='expense'] .money-overall-seg.is-expense,
.money-overall-split[data-plans='income'] .money-overall-seg.is-income {
  flex: 1 1 100%;
}

.money-overall-split[data-plans='expense'] .money-overall-seg.is-income,
.money-overall-split[data-plans='income'] .money-overall-seg.is-expense,
.money-overall-split[data-plans='none'] .money-overall-seg {
  display: none !important;
}

/* Both plans: expense left, income right — 75/25 by homeMode (never swap) */
.money-overall-split[data-plans='both'][data-mode='expense'] .money-overall-seg.is-expense {
  flex: 3 1 0%;
}

.money-overall-split[data-plans='both'][data-mode='expense'] .money-overall-seg.is-income {
  flex: 1 1 0%;
}

.money-overall-split[data-plans='both'][data-mode='income'] .money-overall-seg.is-expense {
  flex: 1 1 0%;
}

.money-overall-split[data-plans='both'][data-mode='income'] .money-overall-seg.is-income {
  flex: 3 1 0%;
}

.money-overall-seg .money-range-progress {
  width: 100%;
}

/* Inside split: empty = hollow track, never unmount (keeps 75/25 layout) */
.money-overall-split .money-range-progress.is-empty,
.money-overall-split .money-range-progress[hidden] {
  display: flex !important;
}

.money-overall-split .money-range-progress.is-empty .money-range-progress-track {
  opacity: 0.55;
}

.money-range-progress-peer .money-range-progress-track {
  margin-top: 0;
}

.money-overall-seg.is-income .money-range-progress-fill {
  background: #2aa8a0;
  background-color: #2aa8a0;
}

/*
 * Narrow (1/4): current % (top) + current sum (bot) + time mark on track.
 * Wide (3/4): full 0 / current / plan / time via normal paint.
 */
.money-overall-seg.is-narrow [data-role='pct-start'],
.money-overall-seg.is-narrow [data-role='pct-end'],
.money-overall-seg.is-narrow [data-role='pct-plan'],
.money-overall-seg.is-narrow [data-role='amt-start'],
.money-overall-seg.is-narrow [data-role='amt-end'],
.money-overall-seg.is-narrow [data-role='amt-plan'],
.money-overall-seg.is-narrow [data-role='plan-tick'],
.money-overall-seg.is-narrow [data-role='time-start'],
.money-overall-seg.is-narrow [data-role='time-end'],
.money-overall-seg.is-narrow [data-role='time-cur'],
.money-overall-seg.is-narrow [data-role='time-wrap'] {
  display: none !important;
}

.money-overall-seg.is-narrow .money-range-progress-cur[data-role='pct-cur'],
.money-overall-seg.is-narrow .money-range-progress-cur[data-role='amt-cur'] {
  /* width:0 + flex center already centers on left% — no translateX (avoids jump) */
  left: 50% !important;
  transform: none;
  max-width: 100%;
  justify-content: center !important;
  text-align: center !important;
}

/* No fill tween before app ready — avoids tip/label flash on income reload */
html:not(.nf-ready) .money-overall-seg .money-range-progress-fill {
  transition: none !important;
}

/* Live swipe: JS setProperty(left, …, important) rides toward center */
html.nf-overall-live .money-overall-seg .money-range-progress-cur[data-role='pct-cur'],
html.nf-overall-live .money-overall-seg .money-range-progress-cur[data-role='amt-cur'] {
  transform: none !important;
}

/* Soften fill width tween if a re-paint lands mid-swipe */
html.nf-overall-live .money-overall-seg .money-range-progress-fill {
  transition: none !important;
}

.money-cats-search-toggle,
.money-cats-manage {
  color: var(--nf-ink);
  width: 40px;
  height: 40px;
}

html:not(.nf-can-structure) .money-cats-manage,
html:not(.nf-can-structure) .money-split-edit-slot {
  display: none !important;
}

.money-top.is-select-open .money-cats-manage,
.money-top.is-search-open .money-cats-manage {
  display: none !important;
}

.money-cats-search-close {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin: 0 -4px 0 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  color: #555555;
  background: transparent;
  box-shadow: none;
}

.money-cats-search-toggle.is-active {
  color: #3391ce;
}

.money-spaces-more-wrap {
  position: relative;
  flex: 0 0 auto;
}

.money-spaces-more {
  color: var(--nf-ink);
  width: 40px;
  height: 40px;
  margin: 0 -6px 0 0;
}

.money-ico-vert-more {
  display: block;
}

/* Header chrome: burger + search only (status kept for JS, not shown) */
.money-top > .money-status {
  display: none !important;
}

/* Quick workspace switcher — dropdown under ⋮ (not a fixed overlay) */
.money-spaces-quick {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 260px;
  max-width: min(260px, 85vw);
}

.money-spaces-quick-panel {
  display: flex;
  flex-direction: column;
  max-height: min(60vh, 360px);
  overflow: hidden;
  /* Same solid surface + frame as the active-space header chip */
  background: var(--nf-card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid var(--nf-border);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(20, 35, 26, 0.14);
  padding: 8px 6px 6px;
}

.money-spaces-quick-title {
  flex: 0 0 auto;
  margin: 0 8px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--nf-muted);
  text-transform: uppercase;
}

.money-spaces-quick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.money-spaces-quick-add {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 8px 9px;
  border: none;
  border-top: 1px solid var(--nf-border);
  border-radius: 0 0 10px 10px;
  background: transparent;
  color: var(--nf-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.money-spaces-quick-add:hover,
.money-spaces-quick-add:active {
  background: color-mix(in srgb, var(--nf-ink) 6%, var(--nf-card));
}

.money-spaces-quick-add svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--nf-muted);
}

.money-spaces-quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 9px;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.money-spaces-quick-item:hover,
.money-spaces-quick-item:active {
  background: color-mix(in srgb, var(--nf-ink) 6%, var(--nf-card));
}

.money-spaces-quick-item.is-active {
  background: #eef6fb;
}

.money-spaces-quick-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-spaces-quick-meta {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--nf-muted);
}

.money-spaces-quick-item.is-active .money-spaces-quick-meta {
  color: #3391ce;
}

.money-cats-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  max-width: none;
  height: 42px;
  padding: 0 12px 0 11px;
  border-radius: 6px;
  background: #f7f7f7;
  color: #9a9a9a;
  cursor: text;
}

/* Multi-select bar — mobile only (shown via .is-select-open) */
.money-cats-select {
  display: none;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}

.money-cats-select-cancel {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  color: var(--nf-ink);
}

.money-cats-select-count {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--nf-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-cats-select-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  margin-left: auto;
}

.money-cats-select-archive,
.money-cats-select-edit {
  width: 40px;
  height: 40px;
  color: var(--nf-ink);
}

.money-cats-select-archive:disabled,
.money-cats-select-edit:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/*
 * Checkbox: bottom-right of the progress ring (shown in select/manage mode).
 * Drag grip: right of the row (hidden until select/manage mode).
 */
.money-budget-check {
  display: none;
  position: absolute;
  /*
   * Bottom-right of the ring, slightly overlapping the circle.
   * Ring box: left 8 / top 3 / 69×69.
   */
  left: 52px;
  top: 45px;
  z-index: 3;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  color: #ffffff;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.money-budget-check svg {
  display: block;
  width: 26px;
  height: 26px;
}

.money-budget-check-ring {
  fill: #d8ddd9;
  stroke: #ffffff;
  stroke-width: 1.8;
}

.money-budget-check-tick {
  opacity: 0;
}

/* Unchecked boxes hidden — only selected rows show a check */
html.nf-cat-select .money-budget-check {
  display: none;
}

html.nf-cat-select .money-budget-row.is-selected .money-budget-check {
  display: inline-flex;
}

html.nf-cat-select .money-budget-drag {
  display: inline-flex !important;
}

.money-budget-row.is-selected .money-budget-check {
  color: #ffffff;
}

.money-budget-row.is-selected .money-budget-check-ring {
  fill: #46ae37;
  stroke: #ffffff;
}

.money-budget-row.is-selected .money-budget-check-tick {
  opacity: 1;
  stroke: #fff;
}

/* Cats bulk still uses tabs */
.money-bulk-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
  padding: 3px;
  border-radius: 12px;
  background: #f0f2f0;
}

.money-bulk-tab {
  flex: 1 1 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--nf-muted);
  cursor: pointer;
}

.money-bulk-tab.is-active {
  background: #fff;
  color: var(--nf-ink);
  box-shadow: 0 1px 3px rgba(20, 35, 26, 0.08);
}

.money-bulk-tabs .money-bulk-tab {
  padding: 9px 4px;
  font-size: 13px;
}

/* Tx bulk — same language as add-picker: gray page, white cards.
 * Must beat later .money-modal { background: var(--nf-card) }. */
.money-modal.money-bulk-modal {
  background: #f3f3f3;
  max-height: none;
  height: min(100%, 100dvh);
  border: none;
  box-shadow: none;
}

/*
 * Root must stay transparent — opaque #f3f3f3 hid the previous screen
 * during swipe-dismiss (gray flash). Gray lives on .money-bulk-modal only.
 */
.money-bulk-root {
  background: transparent;
}

.money-bulk-chrome {
  flex-shrink: 0;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 0 4px;
  background: #f3f3f3;
}

.money-bulk-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px 4px 8px;
}

/* Transparent back/close — like .money-add-picker-back */
.money-bulk-back.money-detail-back,
.money-bulk-close.money-detail-back {
  width: 42px;
  height: 42px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  flex: 0 0 auto;
  pointer-events: auto;
}

.money-bulk-back .money-ico-back {
  font-size: 22px;
  font-weight: 700;
}

.money-bulk-close.money-detail-back .money-ico-close {
  display: block;
}

.money-bulk-close.money-detail-back .money-ico-back {
  display: none;
}

.money-bulk-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--nf-ink);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.money-bulk-hub {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 14px 20px;
  -webkit-overflow-scrolling: touch;
}

/* One white group — like .money-add-picker-actions */
.money-bulk-nav {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 2px;
  border-radius: 14px;
  background: #fff;
  gap: 0;
}

.money-bulk-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 10px 12px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--nf-ink);
  -webkit-tap-highlight-color: transparent;
}

.money-bulk-link:active {
  background: rgba(70, 174, 55, 0.1);
}

.money-bulk-link-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.money-bulk-link-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.money-bulk-link-sub {
  font-size: 12px;
  font-weight: 500;
  color: #9a9a9a;
  line-height: 1.35;
}

.money-bulk-link-chevron {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 400;
  color: #9a9a9a;
  line-height: 1;
}

.money-bulk-sheet {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f3f3f3;
}

.money-bulk-sheet[hidden] {
  display: none !important;
}

.money-bulk-hub[hidden] {
  display: none !important;
}

.money-bulk-sheet-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.money-bulk-sheet-foot {
  flex-shrink: 0;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #f3f3f3;
}

.money-bulk-sheet-foot .money-btn {
  width: 100%;
}

.money-bulk-panel[hidden] {
  display: none !important;
}

.money-bulk-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 4px 0 6px;
  border-radius: 14px;
  background: #fff;
}

.money-bulk-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 12px 12px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.money-bulk-row + .money-bulk-row {
  border-top: 1px solid #f0f0f0;
}

.money-bulk-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-bulk-row-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(5.5rem, 0.7fr);
  gap: 8px;
}

.money-bulk-row-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dde2dd;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--nf-ink);
}

.money-bulk-row-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.money-bulk-row-input:focus {
  outline: none;
  border-color: #3391ce;
  box-shadow: 0 0 0 3px rgba(51, 145, 206, 0.18);
}

.money-bulk-panel-category,
.money-bulk-panel-date,
#txs-bulk-panel-category,
#txs-bulk-panel-date {
  margin: 0;
  padding: 14px 12px;
  border-radius: 14px;
  background: #fff;
}

.money-bulk-category-field {
  margin: 0;
}

.money-bulk-category-field select,
.money-bulk-category-field input[type='date'] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--nf-ink);
}

.money-bulk-sheet-scroll > .money-hint {
  margin: 0 2px 2px;
  color: #9a9a9a;
}

.money-cats-search-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: #9a9a9a;
}

.money-cats-search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  /* ≥16px — iOS Safari won't auto-zoom on focus */
  font-size: 16px;
  font-weight: 500;
  color: var(--nf-ink);
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
}

.money-cats-search-input::placeholder {
  color: #a3a3a3;
  font-weight: 500;
  opacity: 1;
}

.money-cats-search-input::-webkit-search-decoration,
.money-cats-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.money-cats-search:focus-within {
  background: #f2f2f2;
  color: #7a7a7a;
}

.money-budgets-empty-search {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--nf-muted);
}

/* Overall plan vs spent — scale labels above/below the track */
.money-range-progress {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: auto;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  pointer-events: none;
  min-width: 0;
}

.money-range-progress-top,
#overall-split-top {
  grid-column: 1 / -1;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  margin: 2px 0 0;
  padding: 0;
}

#overall-split-top .money-range-progress-top {
  margin: 0;
  grid-column: auto;
}

.money-range-progress-scale {
  position: relative;
  height: 11px;
  min-height: 11px;
  width: 100%;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  color: #9aa89f;
  user-select: none;
}

.money-range-progress-edge,
.money-range-progress-cur,
.money-range-progress-mark {
  position: absolute;
  top: 0;
  white-space: nowrap;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-range-progress-edge.is-start {
  left: 0;
  transform: none;
}

.money-range-progress-edge.is-end {
  right: 0;
  left: auto;
  transform: none;
  text-align: right;
}

/*
 * Zero-width anchors — center via flex, NOT transform.
 * Parent scale() during sheet swipe + child translateX(-50%) made
 * cur/%/triangle intermittently drift on WebKit compositing.
 * display:flex beats UA [hidden] — hide explicitly (same as other flex controls).
 */
.money-range-progress-cur,
.money-range-progress-mark {
  left: 0;
  width: 0;
  max-width: none;
  overflow: visible;
  display: flex;
  justify-content: center;
  transform: none;
  text-align: center;
}

.money-range-progress-cur[hidden],
.money-range-progress-mark[hidden] {
  display: none !important;
}

.money-range-progress-cur {
  font-weight: 600;
  z-index: 2;
}

.money-range-progress-mark.is-plan {
  font-weight: 500;
  color: #9aa89f;
  z-index: 1;
}

.money-range-progress.is-near-start .money-range-progress-cur {
  justify-content: flex-start;
  text-align: left;
}

.money-range-progress.is-near-end .money-range-progress-cur,
.money-range-progress-cur.is-end-anchored {
  justify-content: flex-end;
  text-align: right;
}

.money-range-progress-track {
  position: relative;
  height: 3.5px;
  width: 100%;
  background: #e4ebe6;
  border-radius: 999px;
  overflow: visible;
}

.money-range-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  min-height: 3.5px;
  border-radius: 999px;
  background: #46ae37;
  background-color: #46ae37;
  transition:
    width 0.28s ease,
    background-color 0.28s ease;
}

/* Freeze fill width tween while home layers zoom on sheet swipe */
html.nf-sheet-zoom .money-range-progress-fill {
  transition: none !important;
}

.money-range-progress-plan-tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1.5px;
  margin-left: -0.75px;
  border-radius: 1px;
  background: #8a9a90;
  opacity: 0.85;
  z-index: 2;
  pointer-events: none;
}

.money-range-progress.is-empty .money-range-progress-fill {
  width: 0 !important;
}

.money-range-progress.is-empty .money-range-progress-cur,
.money-range-progress.is-empty .money-range-progress-mark,
.money-range-progress.is-empty .money-range-progress-plan-tick,
.money-range-progress.is-empty .money-range-progress-time,
.money-range-progress.is-empty .money-range-progress-time-mark {
  display: none !important;
}

/* No overall plan → hide shared strips (stats modal keeps is-empty chrome) */
.money-range-progress-top.is-empty,
.money-range-progress-dock.is-empty {
  display: none !important;
}

/* Collapse reserved mobile space only when BOTH expense+income have no plan */
html.nf-overall-empty .money-pane-cats-main,
html.nf-overall-empty .money-top-veil,
html.nf-overall-empty .money-top,
html.nf-overall-empty #overall-split-dock,
html.nf-overall-empty .money-range-progress-dock {
  --money-mobile-progress-gap: 0px;
  --money-mobile-progress-h: 0px;
}

html.nf-overall-empty #overall-split-dock,
html.nf-overall-empty #overall-split-top {
  display: none !important;
}

/*
 * Day-pace marker — floating triangle on the track (no overlay / tails).
 * Spend fill stays a plain opaque bar underneath.
 */
.money-range-progress-time-mark {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 3;
  width: 0;
  height: 0;
  /* Center without transform (border box is 8×5.5; -35% of 5.5 ≈ -1.9) */
  margin: -1.9px 0 0 -4px;
  border-style: solid;
  border-width: 5.5px 4px 0 4px;
  border-color: #2c3631 transparent transparent transparent;
  transform: none;
  pointer-events: none;
  /* Avoid filter layer — same WebKit scale drift as translate on children */
  box-shadow: 0 0 0.6px rgba(255, 255, 255, 0.55);
}

.money-range-progress-time-mark[hidden] {
  display: none !important;
}

.money-range-progress:not(.is-detailed)
  .money-range-progress-track
  > .money-range-progress-fill {
  position: relative;
  z-index: 1;
  opacity: 1;
  border-radius: 999px;
}

/* Detailed dual bars — Statistics page only */
.money-range-progress-time {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 5px;
  min-width: 0;
}

.money-range-progress.is-detailed .money-range-progress-time {
  display: flex;
}

.money-range-progress-time[hidden] {
  display: none !important;
}

.money-range-progress-track.is-time {
  height: 2.3px;
  background: #e4ebe6;
}

.money-range-progress-fill.is-time {
  position: relative;
  z-index: 1;
  min-height: 2.3px;
  opacity: 1;
  background: #c2cbc5;
  background-color: #c2cbc5;
}

.money-range-progress-scale.is-time {
  height: 10px;
  min-height: 10px;
  color: #9aa89f;
}

.money-range-progress-cur.is-time {
  font-weight: 600;
  color: #7a8780;
}

.money-range-progress.is-near-start .money-range-progress-cur.is-time {
  justify-content: flex-start;
  text-align: left;
}

.money-range-progress.is-near-end-time .money-range-progress-cur.is-time,
.money-range-progress-cur.is-time.is-end-anchored {
  justify-content: flex-end;
  text-align: right;
}

.money-modal-stats {
  max-width: 440px;
}

.money-stats-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.money-stats-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--nf-muted);
}

.money-stats-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: #f6f8f6;
  border: 1px solid rgba(20, 35, 26, 0.06);
}

.money-stats-block-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--nf-muted);
}

.money-range-progress-stats {
  width: 100%;
}

.money-top-title {
  min-width: 0;
}

.money-word {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

.money-period,
.money-period-trigger {
  margin: 0;
  font-size: 12px;
  color: var(--nf-muted);
  font-weight: 600;
}

.money-period-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-muted);
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}

.money-period-trigger::after {
  content: '▾';
  font-size: 10px;
  opacity: 0.7;
}

.money-period-trigger:hover {
  color: var(--nf-ink);
}

.money-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--nf-muted);
  line-height: 1.35;
}

.money-modal-period {
  max-width: 420px;
  width: min(420px, 100%);
  max-height: min(92dvh, 720px);
  display: flex;
  flex-direction: column;
}

.money-period-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.money-period-presets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: none;
  overflow: visible;
}

.money-period-preset {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--nf-ink);
  cursor: pointer;
}

.money-period-preset:hover {
  background: #f3f7f3;
}

.money-period-preset.is-active {
  background: #e8f4e4;
  color: var(--nf-green-dark);
  font-weight: 600;
}

.money-period-preset:disabled,
.money-period-preset.is-disabled {
  color: #a8b3ac;
  background: transparent;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.72;
}

.money-period-preset:disabled:hover,
.money-period-preset.is-disabled:hover {
  background: transparent;
}

.money-period-summary {
  margin: 0;
  font-size: 13px;
  color: var(--nf-muted);
  line-height: 1.4;
}

.money-period-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.money-period-apply {
  width: 100%;
  justify-content: center;
}

.money-status {
  margin: 0;
  font-size: 12px;
  color: var(--nf-muted);
  text-align: right;
  max-width: 120px;
}

.money-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--nf-ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.money-burger {
  width: 18px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
  display: block;
}

.money-burger::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  border-top: 2px solid currentColor;
}

.money-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 26, 0.35);
  z-index: 40;
}

.money-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(var(--nf-sidebar), 88vw);
  background: var(--nf-card);
  border-right: 1px solid var(--nf-border);
  z-index: 50;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
  overflow-y: auto;
}

.money-body.menu-open .money-sidebar {
  transform: translateX(0);
}

.money-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.money-sidebar-head h2 {
  margin: 0;
  font-size: 18px;
}

.money-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.money-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #7cbc6e;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.money-profile-meta {
  min-width: 0;
}

.money-profile-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-profile-email {
  font-size: 12px;
  color: var(--nf-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-muted);
  flex: 1;
  min-width: 0;
}

.money-field input,
.money-field select,
.money-form input,
.money-form select,
.money-inline-form input {
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  color: var(--nf-ink);
  border: 1px solid var(--nf-border);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  width: 100%;
}

#cat-edit-name::-webkit-search-decoration,
#cat-edit-name::-webkit-search-cancel-button,
#cat-edit-name::-webkit-search-results-button,
#cat-edit-name::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

#cat-edit-name::-webkit-contacts-auto-fill-button,
#cat-edit-name::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
}

.money-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.money-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.money-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--nf-border);
  border-radius: 14px;
  background: #f7faf7;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.money-nav-item:hover {
  border-color: var(--nf-green);
  background: #f1f8ef;
}

.money-nav-ico {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.money-nav-ico--workspace {
  background: #3b82f6;
}
.money-nav-ico--period {
  background: #14b8a6;
}
.money-nav-ico--stats {
  background: #8b5cf6;
}
.money-nav-ico--archive {
  background: #f59e0b;
}
.money-nav-ico--danger {
  background: #ef4444;
}

.money-nav-item--danger .money-nav-item-title {
  color: #c0392b;
}
.money-nav-ico--theme {
  background: #64748b;
}
.money-nav-ico--images {
  background: #ec4899;
}
.money-nav-ico--lang {
  background: #0ea5e9;
}
.money-nav-ico--logout {
  background: #ef4444;
}

.money-nav-item--logout {
  width: 100%;
  text-align: left;
}

.money-nav-item--logout .money-nav-item-title {
  color: #c0392b;
}

.money-nav-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.money-nav-item-title {
  font-weight: 700;
  font-size: 14px;
}

.money-nav-item-sub {
  font-size: 12px;
  color: var(--nf-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-nav-item-chevron {
  font-size: 22px;
  color: var(--nf-muted);
  line-height: 1;
  margin-left: auto;
  flex: 0 0 auto;
}

.money-sidebar-section {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--nf-border);
  border-radius: 14px;
  background: #f7faf7;
}

.money-sidebar-section-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nf-muted);
  margin: 0 2px 2px;
}

.money-theme-pref {
  flex-wrap: nowrap;
  align-items: center;
  cursor: default;
}

.money-theme-seg {
  display: flex;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 3px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--nf-ink) 7%, transparent);
  box-sizing: border-box;
}

.money-theme-seg-opt {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.money-theme-seg-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.money-theme-seg-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 10px;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--nf-muted);
  text-align: left;
  white-space: nowrap;
}

.money-theme-seg-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-theme-seg-opt input:checked + .money-theme-seg-btn {
  background: var(--nf-card);
  color: var(--nf-ink);
  box-shadow: 0 1px 3px rgba(20, 35, 26, 0.12);
}

.money-theme-seg-opt input:focus-visible + .money-theme-seg-btn {
  outline: 2px solid var(--nf-green);
  outline-offset: 1px;
}

.money-theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--nf-border);
  box-sizing: border-box;
}

.money-theme-swatch.is-light {
  background: #f4f6f5;
}

.money-theme-swatch.is-dark {
  background: #1b242f;
}

.money-theme-swatch.is-gray {
  background: #343739;
}

.money-pref-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.money-nav-item--toggle {
  margin: 0;
}

.money-nav-item--toggle .money-pref-switch {
  margin-left: auto;
}

.money-pref-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.money-pref-toggle-title {
  font-weight: 700;
  font-size: 14px;
}

.money-pref-toggle-sub {
  font-size: 12px;
  color: var(--nf-muted);
  line-height: 1.35;
}

.money-pref-toggle input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.money-pref-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #c9d2c9;
  transition: background 0.18s ease;
}

.money-pref-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}

.money-pref-toggle input:checked + .money-pref-switch {
  background: var(--nf-green);
}

.money-pref-toggle input:checked + .money-pref-switch::after {
  transform: translateX(18px);
}

.money-pref-toggle input:disabled + .money-pref-switch {
  opacity: 0.45;
}

.money-pref-toggle input:focus-visible + .money-pref-switch {
  outline: 2px solid var(--nf-green);
  outline-offset: 2px;
}

.money-sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--nf-border);
}

.money-top-period {
  display: none;
  align-items: center;
  gap: 6px;
  max-width: min(46vw, 220px);
  padding: 7px 10px;
  border: 1px solid var(--nf-border);
  border-radius: 999px;
  background: var(--nf-card);
  color: var(--nf-ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.money-top-period-ico {
  display: inline-flex;
  color: var(--nf-muted);
  flex: 0 0 auto;
}

.money-top-period-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-modal-root {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.money-modal-root[hidden] {
  display: none !important;
}

.money-logout-root {
  z-index: 80;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  /* Transparent root so swipe-dismiss reveals the previous screen */
  background: transparent;
}

.money-logout-root .money-modal-backdrop {
  /* Dim like other sheets — not solid white (that caused a blank flash) */
  background: rgba(20, 35, 26, 0.45);
}

.money-logout-modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 28px 20px max(28px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

.money-logout-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--nf-ink);
}

.money-logout-account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--nf-border);
  border-radius: 16px;
  background: #fff;
}

.money-logout-meta {
  min-width: 0;
}

.money-logout-name {
  font-weight: 700;
  font-size: 15px;
}

.money-logout-email {
  font-size: 13px;
  color: var(--nf-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-logout-hint {
  margin: 0 0 16px;
  text-align: center;
  font-size: 14px;
  color: var(--nf-muted);
  line-height: 1.4;
}

.money-btn-ink {
  width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 14px 16px;
  background: #111 !important;
  color: #fff !important;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  min-height: 48px;
  cursor: pointer;
}

.money-btn-ink .money-btn-ico {
  flex: 0 0 auto;
  display: block;
  width: 18px;
  height: 18px;
}

.money-btn-ink:hover,
.money-btn-ink:hover:not(:disabled) {
  background: #000 !important;
}

.money-btn-ink:disabled {
  opacity: 0.6;
  cursor: wait;
}

.money-logout-cancel.money-chip {
  width: 100%;
  margin-top: 10px;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  border-radius: 999px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 48px;
}

@media (min-width: 860px) {
  .money-logout-root {
    padding: 16px;
    align-items: center;
    justify-content: center;
    background: transparent;
  }

  .money-logout-root .money-modal-backdrop {
    background: rgba(20, 35, 26, 0.45);
  }

  .money-logout-modal {
    width: min(400px, 100%);
    height: auto;
    max-height: min(88vh, 560px);
    border-radius: 18px;
    border: 1px solid var(--nf-border);
    box-shadow: 0 18px 48px rgba(20, 35, 26, 0.18);
    padding: 28px 24px;
  }
}

.money-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 35, 26, 0.45);
}

.money-modal {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--nf-card);
  border-radius: 18px;
  border: 1px solid var(--nf-border);
  box-shadow: 0 18px 48px rgba(20, 35, 26, 0.18);
  overflow: hidden;
}

.money-modal-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--nf-border);
  flex-shrink: 0;
}

.money-modal-head h2 {
  margin: 0;
  font-size: 16px;
  text-align: center;
  font-weight: 700;
}

/* Period modal: title + close only — must beat .money-modal-head (same specificity, later wins) */
.money-modal-head.money-modal-head-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  grid-template-columns: unset;
}

.money-modal-head.money-modal-head-period h2 {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-modal-head.money-modal-head-period .money-icon-btn {
  flex: 0 0 40px;
}

.money-modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.money-modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.money-modal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.money-modal-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nf-muted);
}

.money-space-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.money-space-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--nf-border);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.money-space-row:hover {
  border-color: #c5d6c8;
  background: #f7faf7;
}

.money-space-row.is-active {
  border-color: var(--nf-green);
  background: #f1f8ef;
}

.money-space-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.money-space-row-name {
  font-weight: 700;
  font-size: 14px;
}

.money-space-row-meta {
  font-size: 12px;
  color: var(--nf-muted);
}

.money-space-row-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--nf-green-dark);
  background: #e5f3e1;
  border-radius: 999px;
  padding: 4px 8px;
}

.money-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.money-inline-form .money-chip {
  flex-shrink: 0;
  height: 44px;
}

.money-link {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--nf-ink);
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 0;
}

.money-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--nf-border);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--nf-ink);
  cursor: pointer;
}

/* :hover on touch sticky-eats the first tap after swipe-back */
@media (hover: hover) and (pointer: fine) {
  .money-chip:hover {
    border-color: var(--nf-green);
    color: var(--nf-green-dark);
  }
}

.money-chip-ok {
  background: var(--nf-green);
  border-color: var(--nf-green);
  color: #fff;
}

.money-chip-danger {
  color: var(--nf-danger);
  border-color: rgba(192, 57, 43, 0.35);
}

.money-chip-danger:hover {
  color: var(--nf-danger);
  border-color: var(--nf-danger);
  background: rgba(192, 57, 43, 0.06);
}

.money-tx-row.is-editable {
  cursor: pointer;
}

.money-readonly {
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-muted);
}

/* Invites sit above category list — same density as a budget row */
.money-invites {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

.money-invites[hidden] {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 0 !important;
  border: none !important;
}

.money-invite-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px 8px 10px;
  margin: 0;
  background: #f4f6f4;
  border: none;
  border-radius: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}

.money-invite-card + .money-invite-card {
  border-top: 1px solid rgba(20, 35, 26, 0.06);
}

.money-invite-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.money-invite-text strong {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--nf-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-invite-text span {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--nf-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-invite-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
}

.money-invite-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: #e8ebe8;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--nf-muted);
  cursor: pointer;
}

.money-invite-btn .money-btn-ico {
  flex: 0 0 auto;
  display: block;
  width: 14px;
  height: 14px;
}

.money-invite-btn:hover {
  background: #dde1dd;
  color: var(--nf-ink);
}

.money-invite-btn.is-accept {
  background: #e2e8e2;
  color: var(--nf-ink);
}

.money-invite-btn.is-accept:hover {
  background: #d5ddd5;
}

.money-shell {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.money-pane {
  background: var(--nf-card);
  border: none;
  border-radius: 0;
  padding: 16px;
  min-height: 0;
  overflow: hidden;
}

.money-splitter {
  display: none;
  flex: 0 0 2px;
  width: 2px;
  margin: 0;
  padding: 0;
  border: none;
  background: var(--nf-border);
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 2;
}

.money-splitter::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  right: -2px;
}

.money-splitter:hover,
.money-body.is-resizing .money-splitter {
  background: var(--nf-green);
}

.money-body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.money-body.is-resizing iframe {
  pointer-events: none;
}

.money-pane-title {
  margin: 0 0 14px;
  font-size: 18px;
  flex-shrink: 0;
}

/* Thin, quiet scrollbars */
.money-budgets,
.money-detail-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 35, 26, 0.22) transparent;
}

.money-budgets::-webkit-scrollbar,
.money-detail-scroll::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.money-budgets::-webkit-scrollbar-track,
.money-detail-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.money-budgets::-webkit-scrollbar-thumb,
.money-detail-scroll::-webkit-scrollbar-thumb {
  background: rgba(20, 35, 26, 0.22);
  border-radius: 999px;
}

.money-budgets::-webkit-scrollbar-thumb:hover,
.money-detail-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 35, 26, 0.38);
}

.money-budgets {
  list-style: none;
  margin: 0;
  padding: 4px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Cold first load — mirrors budget rows (65px ring + name/meta) */
.money-skel-list {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 4px 0 12px;
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
}

html.nf-cold:not(.nf-ready) .money-skel-list {
  display: flex;
}

html.nf-cold:not(.nf-ready) #budget-list,
html.nf-cold:not(.nf-ready) #budget-list-income,
html.nf-cold:not(.nf-ready) #cats-foot,
html.nf-has-session .money-skel-list,
html.nf-ready .money-skel-list {
  display: none !important;
}

html.nf-cold:not(.nf-ready) .money-top > .money-status {
  opacity: 0;
}

/*
 * Shared overall bars: always show one wide expense-shaped skel during cold.
 * Avoids the “sometimes two bars / sometimes none” flash before plans load.
 * Beat nf-overall-empty (same !important) so cold never hides the strip.
 */
html.nf-cold:not(.nf-ready) #overall-split-dock,
html.nf-cold:not(.nf-ready).nf-overall-empty #overall-split-dock {
  display: flex !important;
}

html.nf-cold:not(.nf-ready) #overall-split-dock .money-overall-seg.is-income {
  display: none !important;
}

html.nf-cold:not(.nf-ready) #overall-split-dock .money-overall-seg.is-expense {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: none !important;
}

html.nf-cold:not(.nf-ready) #overall-split-dock .money-split-edit-slot,
html.nf-cold:not(.nf-ready) #overall-split-dock .money-range-progress-scale,
html.nf-cold:not(.nf-ready) #overall-split-dock [data-role='time-mark'],
html.nf-cold:not(.nf-ready) #overall-split-dock [data-role='plan-tick'] {
  visibility: hidden !important;
}

html.nf-cold:not(.nf-ready) #overall-split-dock .money-range-progress-track {
  background: var(--skel-bone) !important;
  background-color: var(--skel-bone) !important;
  overflow: hidden;
}

html.nf-cold:not(.nf-ready) #overall-split-dock .money-range-progress-fill {
  width: 42% !important;
  max-width: 42% !important;
  transform: none !important;
  background: linear-gradient(
    90deg,
    var(--skel-bone) 0%,
    var(--skel-shine) 45%,
    var(--skel-bone) 90%
  ) !important;
  background-color: transparent !important;
  background-size: 220% 100%;
  animation: money-skel-shine 1.5s ease-in-out infinite;
  opacity: 1 !important;
  transition: none !important;
}

.money-skel-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-height: 71px;
  padding: 3px 8px;
  margin: 0;
  background: transparent;
}

.money-skel-ring,
.money-skel-line {
  background: linear-gradient(
    90deg,
    var(--skel-bone) 0%,
    var(--skel-shine) 42%,
    var(--skel-bone) 84%
  );
  background-size: 220% 100%;
  animation: money-skel-shine 1.5s ease-in-out infinite;
}

/* Matches .money-budget-ring (65×65) with hollow core like the SVG ring */
.money-skel-ring {
  position: relative;
  flex: 0 0 65px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
}

.money-skel-ring-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72%;
  height: 72%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--skel-page, #f4f6f5);
  box-shadow: inset 0 0 0 1px rgba(20, 35, 26, 0.04);
}

.money-skel-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding-right: 6px;
}

.money-skel-line {
  display: block;
  border-radius: 7px;
}

.money-skel-line-title {
  width: 44%;
  height: 14px;
}

.money-skel-line-meta {
  width: 62%;
  height: 11px;
  opacity: 0.9;
}

/* Varied lengths so the list reads like real category names */
.money-skel-row:nth-child(2) .money-skel-line-title { width: 38%; }
.money-skel-row:nth-child(2) .money-skel-line-meta { width: 54%; }
.money-skel-row:nth-child(3) .money-skel-line-title { width: 52%; }
.money-skel-row:nth-child(3) .money-skel-line-meta { width: 41%; }
.money-skel-row:nth-child(4) .money-skel-line-title { width: 33%; }
.money-skel-row:nth-child(4) .money-skel-line-meta { width: 68%; }
.money-skel-row:nth-child(5) .money-skel-line-title { width: 47%; }
.money-skel-row:nth-child(5) .money-skel-line-meta { width: 49%; }
.money-skel-row:nth-child(6) .money-skel-line-title { width: 40%; }
.money-skel-row:nth-child(6) .money-skel-line-meta { width: 57%; }
.money-skel-row:nth-child(7) .money-skel-line-title { width: 55%; }
.money-skel-row:nth-child(7) .money-skel-line-meta { width: 36%; }
.money-skel-row:nth-child(8) .money-skel-line-title { width: 36%; }
.money-skel-row:nth-child(8) .money-skel-line-meta { width: 60%; }
.money-skel-row:nth-child(9) .money-skel-line-title { width: 49%; }
.money-skel-row:nth-child(9) .money-skel-line-meta { width: 45%; }
.money-skel-row:nth-child(10) .money-skel-line-title { width: 31%; }
.money-skel-row:nth-child(10) .money-skel-line-meta { width: 64%; }
.money-skel-row:nth-child(11) .money-skel-line-title { width: 43%; }
.money-skel-row:nth-child(11) .money-skel-line-meta { width: 52%; }
.money-skel-row:nth-child(12) .money-skel-line-title { width: 57%; }
.money-skel-row:nth-child(12) .money-skel-line-meta { width: 39%; }
.money-skel-row:nth-child(13) .money-skel-line-title { width: 35%; }
.money-skel-row:nth-child(13) .money-skel-line-meta { width: 58%; }
.money-skel-row:nth-child(14) .money-skel-line-title { width: 46%; }
.money-skel-row:nth-child(14) .money-skel-line-meta { width: 50%; }

.money-skel-row:nth-child(odd) .money-skel-ring,
.money-skel-row:nth-child(odd) .money-skel-line {
  animation-delay: 0.1s;
}

.money-skel-row:nth-child(3n) .money-skel-ring,
.money-skel-row:nth-child(3n) .money-skel-line {
  animation-delay: 0.2s;
}

.money-skel-row:nth-child(4n) .money-skel-ring,
.money-skel-row:nth-child(4n) .money-skel-line {
  animation-delay: 0.3s;
}

@keyframes money-skel-shine {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .money-skel-ring,
  .money-skel-line,
  html.nf-cold:not(.nf-ready) #overall-split-dock .money-range-progress-fill {
    animation: none;
  }
}

.money-budget-row {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  border-bottom: none;
  cursor: pointer;
  text-align: left;
  background: transparent;
  font: inherit;
  color: inherit;
  width: 100%;
  overflow: visible;
}

/* Grip overlays the right edge — does not shrink the category row */
.money-budget-drag {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  flex: none;
  width: 28px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #9aa49d;
  cursor: grab;
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}

.money-budget-drag:active {
  cursor: grabbing;
  color: #6b7c72;
}

.money-ico-drag {
  display: block;
  fill: currentColor;
  pointer-events: none;
  opacity: 0.9;
}

/* Full-bleed category rows — no card frame / no inter-row gaps */
.money-budget-card {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 3px 8px;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow: visible;
}

/* Keep name clear of the overlay grip while selecting */
html.nf-cat-select .money-budget-card {
  padding-right: 30px;
}

.money-budget-row:not(:has(.money-budget-drag)) .money-budget-card {
  margin-left: 0;
}

.money-budget-placeholder {
  flex: 0 0 auto;
  box-sizing: border-box;
  margin-left: 0;
  width: 100%;
  background: rgba(70, 174, 55, 0.1);
  border-radius: 0;
  pointer-events: none;
}

.money-budgets.is-reordering {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.money-budget-row.is-dragging {
  /* Must live under body (cats-dnd) — ViewPager transform breaks viewport-fixed */
  position: fixed;
  z-index: 55;
  margin: 0;
  box-sizing: border-box;
  pointer-events: none;
  background: transparent;
  opacity: 0.98;
}

.money-budget-row.is-dragging .money-budget-card {
  box-shadow:
    0 10px 28px rgba(20, 35, 26, 0.16),
    0 0 0 1px rgba(20, 35, 26, 0.06);
}

/* Hover only on real pointer devices — :hover on touch eats the first tap */
@media (hover: hover) and (pointer: fine) {
  .money-budget-row:hover {
    background: rgba(20, 35, 26, 0.035);
  }

  .money-budget-row:hover .money-budget-card {
    background: transparent;
  }
}

.money-budget-row.is-active {
  background: rgba(70, 174, 55, 0.1);
  box-shadow: none;
}

.money-budget-row.is-active .money-budget-card {
  background: transparent;
  border: none;
  box-shadow: none;
}

.money-budget-row.is-selected {
  background: rgba(70, 174, 55, 0.14);
}

.money-budget-row.is-archived {
  opacity: 0.72;
}

.money-budget-row.is-archived .nm::after {
  content: ' · archive';
  font-size: 11px;
  font-weight: 500;
  color: var(--nf-muted);
}

html[lang='uk'] .money-budget-row.is-archived .nm::after,
html[lang='ua'] .money-budget-row.is-archived .nm::after {
  content: ' · архів';
}

.money-budget-ring {
  position: relative;
  /* 69px − 6% */
  flex: 0 0 65px;
  width: 65px;
  height: 65px;
}

/* Unread count — right side of the name row (left of drag grip) */
.money-budget-unread {
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #e67e22;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  letter-spacing: -0.02em;
  pointer-events: none;
}

.money-budget-unread[hidden] {
  display: none !important;
}

/* Keep badge clear of the overlay drag grip while reordering */
html.nf-cat-select .money-budget-unread {
  margin-right: 2px;
}

.money-budget-ring .money-ring-img,
.money-detail-ring .money-ring-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86%;
  height: 86%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background: #eef2ef;
  object-fit: cover;
  /* Light theme: lift crush + tame harsh saturated fills (dark theme resets) */
  filter: brightness(1.12) saturate(0.82) contrast(0.96);
}

/*
 * Image disks (light): soft rim only — heavy bottom inset made icons muddy.
 * Letter avatars keep the stronger convex shadow below. Dark theme restores
 * the deep inset on images via money-dark.css.
 */
.money-budget-ring.has-image::after,
.money-detail-ring.has-image::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86%;
  height: 86%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.money-budget-ring .money-ring-letter,
.money-detail-ring .money-ring-letter {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86%;
  height: 86%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  box-sizing: border-box;
  overflow: hidden;
  /* hidden by default — [hidden] alone lost to display:flex in some paints */
  display: none;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans',
    'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: #fff;
  /* Soft near shadow like generated icon glyphs */
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.22);
  /* Light theme: match soft image-disk rim (dark restores deep inset) */
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  /* Same lift as .money-ring-img — custom cats are often letter disks */
  filter: brightness(1.12) saturate(0.82) contrast(0.96);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  user-select: none;
}

.money-budget-ring .money-ring-letter.is-on,
.money-detail-ring .money-ring-letter.is-on,
.money-budget-ring.has-letter .money-ring-letter,
.money-detail-ring.has-letter .money-ring-letter {
  display: flex;
}

.money-detail-ring .money-ring-letter {
  font-size: 11px;
}

.money-budget-ring.has-image .money-ring-pct,
.money-budget-ring.has-letter .money-ring-pct,
.money-detail-ring.has-image .money-ring-pct,
.money-detail-ring.has-letter .money-ring-pct {
  display: none;
}

.money-budget-pct,
.money-detail-title-pct {
  flex: 0 0 auto;
  /* After name — a bit larger than the old 11px for readability */
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.money-budget-ring-svg,
.money-budget-ring-time-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

/* Rings: opaque spend; time = floating triangle on the circumference. */
.money-budget-ring-svg {
  position: relative;
  z-index: 1;
}

.money-budget-ring-time-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.money-budget-ring-track,
.money-budget-ring-fill {
  fill: none;
  /* 65px ring / viewBox 36 → stroke scales with CSS size */
  stroke-width: 1.286;
}

.money-budget-ring-track {
  stroke: #e4ebe6;
}

.money-budget-ring-time-mark {
  fill: #2c3631;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 0.35;
  paint-order: stroke fill;
}

html:not(.nf-ring-time) .money-budget-ring-time-mark,
.money-budget-ring.is-no-plan .money-budget-ring-time-mark,
.money-detail-ring.is-no-plan .money-budget-ring-time-mark,
.money-budget-ring-time-mark[hidden] {
  display: none;
}

.money-budget-ring-fill {
  stroke: #46ae37;
  /* butt — round caps looked darker at both ends over the track/time */
  stroke-linecap: butt;
  transition:
    stroke-dasharray 0.28s ease,
    stroke 0.28s ease;
}

.money-budget-ring .money-ring-pct {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #46ae37;
  pointer-events: none;
  white-space: nowrap;
}

.money-budget-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.money-budget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.money-budget-name {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 600;
  font-size: 15.5px;
  min-width: 0;
}

.money-budget-name .nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-cat-rollover {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 12px;
}
.money-cat-rollover-label {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  color: var(--nf-muted);
}
.money-cat-rollover-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--nf-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--nf-ink) 3%, var(--nf-card));
}
.money-cat-rollover-current {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.money-cat-rollover-current-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--nf-ink);
}
.money-cat-rollover-current-lead {
  font-size: 12px;
  font-weight: 500;
  color: var(--nf-muted);
  line-height: 1.35;
}
.money-cat-rollover-change {
  flex: 0 0 auto;
  margin: 0;
}
.money-cat-rollover-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.money-radio-opt {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--nf-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--nf-ink) 3%, var(--nf-card));
  color: var(--nf-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.money-radio-opt.is-active {
  border-color: color-mix(in srgb, var(--nf-green, #4caf50) 55%, var(--nf-border));
  background: color-mix(in srgb, var(--nf-green, #4caf50) 12%, var(--nf-card));
}
.money-radio-opt:active {
  transform: scale(0.99);
}
.money-radio-dot {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid color-mix(in srgb, var(--nf-ink) 35%, var(--nf-border));
  border-radius: 50%;
  box-sizing: border-box;
  background: transparent;
  position: relative;
}
.money-radio-opt.is-active .money-radio-dot {
  border-color: var(--nf-green, #4caf50);
}
.money-radio-opt.is-active .money-radio-dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--nf-green, #4caf50);
}
.money-radio-opt-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.money-radio-opt-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.money-radio-opt-lead {
  font-size: 12px;
  font-weight: 500;
  color: var(--nf-muted);
  line-height: 1.35;
}
.money-bulk-row-rollover {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.money-bulk-row-rollover .money-bulk-row-label {
  margin: 0;
}
.money-bulk-rollover {
  margin: 0;
}

.money-cat-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 2px;
}

.money-cat-images-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--nf-muted, #6b7280);
}

.money-cat-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}

.money-cat-image-opt {
  position: relative;
  appearance: none;
  border: 2px solid transparent;
  background: #f3f6f4;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  padding: 0;
  overflow: visible;
  cursor: pointer;
}

.money-cat-image-opt.is-selected {
  border-color: #46ae37;
}

.money-cat-image-opt img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: brightness(1.12) saturate(0.82) contrast(0.96);
}

.money-cat-image-opt::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.money-cat-image-del {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #2a342e;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.money-cat-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.money-cat-image-upload {
  display: inline-flex;
  align-self: flex-start;
  cursor: pointer;
}

.money-cat-image-upload[hidden],
.money-cat-image-clear[hidden] {
  display: none !important;
}

.money-cat-image-upload-btn {
  pointer-events: none;
}

.money-cat-image-clear {
  appearance: none;
}

.money-cat-image-share {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--nf-ink, #1a221c);
  cursor: pointer;
  user-select: none;
}

/* display:flex above beats the [hidden] UA rule — hide explicitly */
.money-cat-image-share[hidden] {
  display: none !important;
}

.money-cat-image-share input {
  margin-top: 2px;
  flex: 0 0 auto;
}

.money-bulk-row-image {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(20, 35, 26, 0.08);
}

.money-bulk-row-image:last-child {
  border-bottom: 0;
}

.money-bulk-image-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.money-bulk-image-preview {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2ef;
  background-image: none;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans',
    'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: #fff;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.money-bulk-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(1.12) saturate(0.82) contrast(0.96);
}

.money-bulk-image-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.money-bulk-image-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.money-bulk-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
}

.money-bulk-image-opt {
  appearance: none;
  border: 2px solid transparent;
  background: #f3f6f4;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.money-bulk-image-opt.is-selected {
  border-color: #46ae37;
}

.money-bulk-image-opt img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.money-bulk-image-upload {
  display: inline-flex;
  align-self: flex-start;
  cursor: pointer;
}

.money-bulk-image-upload-btn {
  pointer-events: none;
}

.money-budget-meta {
  font-size: 13px;
  color: var(--nf-muted);
  line-height: 1.35;
  /* Stable one-line slot — prevents F5 jump when soft patch tweaks amounts */
  min-height: 1.35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-budget-edit {
  display: none;
}

/* ⋯ edit — reliable on Mac where category RMB is flaky */
.money-budget-more {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: 0;
  margin-right: -4px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--nf-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

html.nf-can-structure .money-budget-more {
  display: inline-flex;
}

.money-budget-more svg {
  display: block;
  fill: currentColor;
}

.money-budget-more:hover,
.money-budget-more:focus-visible {
  color: var(--nf-ink);
  background: rgba(20, 35, 26, 0.06);
}

.money-budget-row.is-active .money-budget-more {
  color: inherit;
  opacity: 0.85;
}

.money-budget-row.is-active .money-budget-more:hover {
  background: rgba(255, 255, 255, 0.18);
  opacity: 1;
}


.money-pane-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.money-back {
  display: none;
}

.money-detail-chrome {
  display: none;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  --detail-accent: var(--nf-green);
  pointer-events: none;
}

.money-detail-top {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.money-detail-back,
.money-detail-edit,
.money-detail-archive {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--nf-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(20, 35, 26, 0.05);
  pointer-events: auto;
}

.money-detail-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  pointer-events: none;
}

.money-detail-actions .money-detail-edit,
.money-detail-actions .money-detail-archive {
  pointer-events: auto;
}

.money-ico-back {
  display: inline-block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-90deg);
}

.money-detail-back .money-ico-close {
  display: none;
}

.money-ico-more {
  display: block;
  flex-shrink: 0;
}

.money-detail-back:active,
.money-detail-edit:active,
.money-detail-archive:active {
  transform: scale(0.96);
}

.money-detail-edit[hidden],
.money-detail-archive[hidden] {
  display: none !important;
}

.money-detail-archive:disabled,
.money-detail-edit:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.money-detail-select-count {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 4px 0 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--nf-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*
 * Expense multi-select checkmarks — absolute in the right gutter
 * (beside 90%-wide bubbles). Larger hit target; clicks enabled in select mode.
 */
.money-tx-check {
  display: none;
  position: absolute;
  left: auto;
  right: -34px;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.money-tx-check svg {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.money-tx-check-ring {
  fill: none;
  stroke: #ffffff;
}

.money-tx-check-tick {
  opacity: 0;
}

html.nf-tx-select .money-tx-check {
  display: flex;
  pointer-events: auto;
}

/* Keep bubble width identical in select mode — checks sit in the existing ~10% gutter */
html.nf-tx-select .money-detail-scroll .money-tx-row {
  width: 90%;
  max-width: 90%;
}

.money-tx-row.is-selected .money-tx-check {
  color: #46ae37;
}

.money-tx-row.is-selected .money-tx-check-ring {
  fill: #46ae37;
  stroke: #46ae37;
}

.money-tx-row.is-selected .money-tx-check-tick {
  opacity: 1;
  stroke: #fff;
}

/* Smooth leave — delete/archive without wiping the whole list */
.money-tx-row.is-leaving,
.money-budget-row.is-leaving,
.money-tx-day.is-leaving {
  transition:
    height 0.18s ease,
    opacity 0.15s ease,
    margin 0.18s ease,
    padding 0.18s ease;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* Detail chrome in expense select mode */
.money-detail-chrome.is-tx-select .money-ico-back {
  display: none;
}

.money-detail-chrome.is-tx-select .money-detail-back .money-ico-close {
  display: block;
}

.money-detail-chrome.is-tx-select .money-detail-ring,
.money-detail-chrome.is-tx-select .money-detail-heading-text {
  display: none !important;
}

.money-detail-chrome.is-tx-select .money-detail-select-count {
  display: block;
}

.money-detail-chrome.is-tx-select .money-detail-archive:not([hidden]) {
  display: inline-flex !important;
}

html.nf-tx-select .money-form-line {
  opacity: 0.35;
  pointer-events: none;
}

/* PC RMB context menu for expenses */
.money-ctx-menu {
  position: fixed;
  z-index: 80;
  min-width: 180px;
  padding: 6px;
  margin: 0;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 10px 28px rgba(20, 35, 26, 0.16),
    0 0 0 1px rgba(20, 35, 26, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.money-ctx-menu[hidden] {
  display: none !important;
}

.money-ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  color: var(--nf-ink);
  cursor: pointer;
}

.money-ctx-menu-item .money-btn-ico {
  flex: 0 0 auto;
  opacity: 0.9;
}

.money-ctx-menu-item:hover,
.money-ctx-menu-item:focus-visible {
  background: #f3f5f3;
  outline: none;
}

.money-ctx-menu-item[data-tx-ctx='delete'],
.money-ctx-menu-item[data-cat-ctx='delete'] {
  color: #c0392b;
}

.money-detail-heading {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 10px 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(20, 35, 26, 0.05);
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}

.money-detail-ring {
  position: relative;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
}

.money-detail-ring::before {
  /* Fill to inner edge of progress stroke; match heading pill gray */
  content: '';
  position: absolute;
  inset: 1.46px;
  border-radius: 50%;
  background: #f3f5f3;
  z-index: 0;
  pointer-events: none;
}

.money-detail-ring .money-budget-ring-svg,
.money-detail-ring .money-budget-ring-time-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.money-detail-ring .money-budget-ring-svg {
  position: relative;
  z-index: 1;
}

.money-detail-ring .money-budget-ring-time-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.money-detail-ring .money-budget-ring-track,
.money-detail-ring .money-budget-ring-fill {
  fill: none;
  stroke-width: 1.85;
}

.money-detail-ring .money-budget-ring-track {
  stroke: #e4ebe6;
}

.money-detail-ring .money-budget-ring-time-mark {
  fill: #2c3631;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 0.35;
  paint-order: stroke fill;
}

.money-detail-ring .money-ring-pct {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #46ae37;
  pointer-events: none;
  white-space: nowrap;
}

.money-detail-heading-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  /* nudge block slightly up so title sits higher than center */
  padding-bottom: 1px;
}

.money-detail-title-row {
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0;
  font-size: inherit;
  font-weight: inherit;
}

.money-detail-title {
  margin: 0;
  min-width: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  /* Match .money-budget-name on home */
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  color: var(--nf-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.money-detail-figures {
  margin: 0;
  min-width: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--nf-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-detail-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 4px 8px 2px;
}

.money-stat-circle {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(20, 35, 26, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.money-stat-value {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--nf-ink);
}

.money-stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--nf-muted);
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-stat-donut {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.money-donut-svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.money-donut-track,
.money-donut-value {
  fill: none;
  stroke-width: 3.2;
}

.money-donut-track {
  stroke: rgba(255, 255, 255, 0.55);
}

.money-donut-value {
  stroke: var(--detail-accent, var(--nf-green));
  stroke-linecap: round;
  stroke-dasharray: 0 87.96;
  transition: stroke-dasharray 0.35s ease, stroke 0.2s ease;
}

.money-donut-value.is-over {
  stroke: var(--nf-danger);
}

.money-donut-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--nf-ink);
  pointer-events: none;
}

.money-donut-pct.is-over {
  color: var(--nf-danger);
}

.money-detail-head {
  flex-shrink: 0;
}

.money-detail-head h2 {
  margin: 0;
  font-size: 20px;
}

.money-detail-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--nf-muted);
}

.money-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  justify-content: flex-start;
  align-items: stretch;
}

.money-detail-body[hidden] {
  display: none !important;
}

.money-detail-body#detail-empty:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.money-detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.money-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
  width: 100%;
  align-self: stretch;
}

.money-list li,
.money-tx-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--nf-border);
  border-radius: 6px;
  background: #fff;
  /* soft shadow without -1px spread (avoids 1px bottom strip) */
  box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}

/* Others' expenses not yet "read" in this open — soft sky tint */
.money-tx-row.is-unread {
  background: #e8f3ff;
  border-color: rgba(66, 133, 244, 0.28);
}

/* Telegram-style day separator */
.money-list > .money-tx-day {
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 4px 0 2px;
  padding: 6px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.money-list > .money-tx-day:first-child {
  margin-top: 0;
  padding-top: 0;
}

.money-tx-day-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(20, 40, 28, 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-shadow: none;
}

/* Extra space when author changes within a multi-author day */
.money-tx-row.is-author-gap {
  margin-top: 12px;
}

/*
 * Gap after a >10min cluster break (adds to list gap: 6px → ~12px).
 * JS skips this class when author-gap / day pill / cluster-cont apply;
 * CSS guards below keep margins from summing if classes ever overlap.
 */
.money-tx-row.is-tx-cluster-break {
  margin-top: 6px;
}
.money-tx-row.is-author-gap.is-tx-cluster-break {
  margin-top: 12px;
}
.money-tx-row.is-tx-cluster-cont.is-tx-cluster-break {
  margin-top: -2px;
}

.money-tx-main {
  min-width: 0;
}

.money-tx-title {
  font-weight: 500;
  font-size: 14px;
}

.money-tx-meta {
  font-size: 12px;
  color: var(--nf-muted);
}

.money-tx-amount {
  font-weight: 500;
  white-space: nowrap;
}

.money-tx-del {
  border: none;
  background: none;
  color: var(--nf-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
}

.money-empty {
  margin: 0;
  color: var(--nf-muted);
  font-size: 14px;
}

.money-empty-pick {
  font-size: 14px;
  color: #8a9a90;
  text-align: center;
}

.money-empty-tx {
  margin: auto;
  font-size: 13px;
  color: #ffffff;
  text-align: center;
  max-width: 280px;
  line-height: 1.4;
  align-self: center;
}

.money-detail-scroll:has(#tx-empty:not([hidden])) {
  justify-content: center;
  align-items: center;
}

.money-cats-foot {
  flex-shrink: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--nf-border);
  background: var(--nf-card);
}

.money-cats-foot .money-chip {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.money-cats-create-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1;
}

.money-cats-create-ico {
  display: block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

/* Legacy pencil / tx × — edit via ⋯ / contextmenu / hold */
.money-budget-edit-btn,
.money-tx-del {
  display: none !important;
}

/* Hold-to-edit feedback (Mac trackpad / touch) */
.money-budget-row.is-hold-armed .money-budget-card,
.money-tx-row.is-hold-armed {
  transform: scale(0.985);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 0 0 2px rgba(70, 174, 55, 0.35);
}

/* Context popover: anchored beside the row (not centered sheet) */
.money-modal-root.is-ctx {
  padding: 0;
  align-items: flex-start;
  justify-content: flex-start;
  background: transparent;
  pointer-events: none;
}

.money-modal-root.is-ctx .money-modal-backdrop {
  pointer-events: auto;
  background: rgba(20, 35, 26, 0.12);
}

.money-modal-root.is-ctx .money-modal {
  pointer-events: auto;
  position: fixed;
  margin: 0;
  width: min(320px, calc(100vw - 16px));
  max-width: min(320px, calc(100vw - 16px));
  max-height: min(72vh, 520px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--nf-border);
  box-shadow: 0 14px 40px rgba(20, 35, 26, 0.2);
  z-index: 1;
}

.money-modal-root.is-ctx .money-modal-head {
  padding: 10px 12px 8px;
  gap: 8px;
  /* Back is hidden → 2 columns so × stays on the right (not beside the title) */
  grid-template-columns: minmax(0, 1fr) 40px;
}

.money-modal-root.is-ctx .money-modal-head h2 {
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  min-width: 0;
}

/* Hide back chevron in ctx — × is enough */
.money-modal-root.is-ctx .money-modal-head > .money-icon-btn:first-child {
  display: none;
}

.money-modal-root.is-ctx .money-modal-head > .money-icon-btn:last-child {
  grid-column: 2;
  justify-self: end;
}

.money-modal-root.is-ctx .money-modal-body {
  padding: 8px 12px 12px;
  gap: 8px;
}

/* Structure chrome only for owner/admin */
html:not(.nf-can-structure) .money-budget-drag,
html:not(.nf-can-structure) #cats-foot,
html:not(.nf-can-structure) #btn-detail-edit {
  display: none !important;
}

/* Tx select: pencil + trash visible for any writer (even without structure) */
html.nf-tx-select #btn-detail-edit:not([hidden]),
html.nf-tx-select #btn-detail-archive:not([hidden]) {
  display: inline-flex !important;
}

.money-budget-row,
.money-tx-row.is-editable {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.money-modal-sm {
  width: min(420px, 100%);
}

.money-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.money-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--nf-border);
  background: var(--nf-card);
}

.money-form-line {
  position: relative;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
}

/*
 * Round calendar icon — same row as #exp-line (left).
 * Shown after long-press ↑ send; opens native date via #exp-date.
 * Themes: light (white), dark blue, gray (dark + nf-ios).
 */
.money-exp-cal {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--nf-ink) 7%, #fff);
  color: var(--nf-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(20, 35, 26, 0.1);
}

.money-exp-cal[hidden] {
  display: none !important;
}

.money-exp-cal:active {
  background: color-mix(in srgb, var(--nf-ink) 12%, #fff);
}

.money-exp-cal.is-not-today {
  color: var(--nf-ink);
  box-shadow: inset 0 0 0 1.5px rgba(70, 174, 55, 0.45);
}

.money-exp-cal-ico {
  display: inline-flex;
  line-height: 0;
}

/* Native date field — value only; picker opened from .money-exp-cal */
.money-form-line .money-exp-date {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.money-btn-send.is-hold-armed {
  transform: scale(0.94);
}

.money-exp-field {
  flex: 1 1 140px;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.money-exp-ph {
  display: none;
  pointer-events: none;
}

.money-form-line #exp-line {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.35;
  color: var(--nf-ink);
  border: 1px solid var(--nf-border);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  resize: none;
  overflow-y: auto;
  max-height: calc(16px * 1.35 * 5 + 22px);
  min-height: 44px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.money-form-line #exp-line::-webkit-search-decoration,
.money-form-line #exp-line::-webkit-search-cancel-button,
.money-form-line #exp-line::-webkit-search-results-button,
.money-form-line #exp-line::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

.money-form-line #exp-line::-webkit-contacts-auto-fill-button,
.money-form-line #exp-line::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  position: absolute;
  right: 0;
}

.money-btn-send {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.money-form-line .money-msg {
  flex: 1 1 100%;
}

.money-detail-body#detail-active:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.money-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nf-muted);
}

.money-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: var(--nf-green);
  cursor: pointer;
}

.money-btn .money-btn-ico,
.money-chip .money-btn-ico {
  flex: 0 0 auto;
  display: block;
  width: 18px;
  height: 18px;
}

.money-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.money-btn:hover:not(:disabled) {
  background: var(--nf-green-dark);
}

.money-btn--danger {
  background: #c0392b;
  width: 100%;
}

.money-btn--danger:hover:not(:disabled) {
  background: #a93226;
}

.money-msg {
  margin: 0;
  font-size: 14px;
}

.money-msg.ok {
  color: var(--nf-green-dark);
}

.money-msg.err {
  color: var(--nf-danger);
}

.money-members {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.money-member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.money-member-meta .nm {
  font-weight: 600;
  font-size: 13px;
}

.money-member-meta .em {
  font-size: 11px;
  color: var(--nf-muted);
}

.money-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.money-member-actions select {
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--nf-border);
  border-radius: 8px;
  padding: 5px 6px;
  background: #fff;
}

.money-archive-hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--nf-muted);
}

.money-delete-data-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 12px;
}

.money-delete-data-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--nf-muted);
}

.money-delete-data-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--nf-ink) 3.5%, transparent);
}

.money-delete-data-section--danger {
  background: color-mix(in srgb, #c0392b 8%, transparent);
}

.money-delete-data-section.is-disabled {
  opacity: 0.55;
}

.money-delete-data-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.money-delete-data-section-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--nf-ink);
}

.money-delete-data-link {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  color: var(--nf-green-dark, #1f6b4a);
  cursor: pointer;
}

.money-delete-data-spaces,
.money-delete-data-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.money-delete-data-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--nf-card, #fff);
  cursor: pointer;
  user-select: none;
}

.money-delete-data-check input {
  margin-top: 2px;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: #c0392b;
}

.money-delete-data-check span {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--nf-ink);
  line-height: 1.35;
}

.money-delete-data-check--block {
  align-items: flex-start;
}

.money-delete-data-space-text,
.money-delete-data-check--block > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.money-delete-data-check-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--nf-ink);
}

.money-delete-data-check-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--nf-muted);
  line-height: 1.4;
}

.money-delete-data-empty {
  margin: 0;
  font-size: 13px;
  color: var(--nf-muted);
}

.money-delete-data-confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nf-ink);
}

.money-delete-data-confirm input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--nf-border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
  background: var(--nf-card, #fff);
  color: var(--nf-ink);
}

.money-delete-data-confirm input:focus {
  outline: none;
  border-color: color-mix(in srgb, #c0392b 55%, var(--nf-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, #c0392b 16%, transparent);
}

.money-delete-data-msg {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.money-delete-data-msg.is-ok {
  color: var(--nf-green-dark, #1f6b4a);
}

.money-delete-data-msg.is-err {
  color: #c0392b;
}

.money-delete-data-submit {
  margin-top: 2px;
}

.money-archive-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.money-archive-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--nf-border);
  border-radius: 12px;
  background: var(--nf-surface, #fff);
}

.money-archive-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 140px;
}

.money-archive-av {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--nf-border);
}

.money-archive-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(1.12) saturate(0.82) contrast(0.96);
}

.money-archive-av.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.45),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.money-archive-letter {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: brightness(1.12) saturate(0.82) contrast(0.96);
}

.money-archive-meta .nm {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.money-archive-empty {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--nf-muted);
  text-align: center;
}

/* Mobile overall progress — hidden on desktop (header bar used there) */
.money-range-progress-dock,
#overall-split-dock {
  display: none;
}

/* Mobile bottom dock — hidden on desktop / detail */
.money-dock {
  display: none;
}

/* Mobile: list scrolls the document (pull-to-refresh); body stays overflow:visible so fixed dock works */
@media (max-width: 859px) {
  html {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .money-body {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    /* Do NOT set overflow here — it breaks position:fixed for the dock */
    overflow: visible;
  }

  /*
   * Mobile: never use :hover on category rows.
   * Any matching :hover rule makes WebKit eat the first tap after swipe-back
   * (sticky hover — scroll-then-tap “fixes” it). Selected/press: no gray paint.
   */
  .money-budget-row {
    -webkit-tap-highlight-color: transparent;
  }

  .money-budget-row:active,
  .money-budget-row:focus,
  .money-budget-row:focus-visible,
  .money-budget-row.is-active,
  .money-budget-row.is-active:active {
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    outline: none !important;
  }

  /*
   * Select highlight must win over :active/:focus transparent !important,
   * otherwise the green wash only appears after the next tap (focus leaves).
   */
  .money-budget-row.is-selected,
  .money-budget-row.is-selected:active,
  .money-budget-row.is-selected:focus,
  .money-budget-row.is-selected:focus-visible,
  .money-budget-row.is-selected.is-active,
  .money-budget-row.is-selected.is-active:active {
    background: rgba(70, 174, 55, 0.14) !important;
  }

  /* Category rows (mobile): flat full-bleed — no card chrome */
  .money-budget-card {
    border: none;
    box-shadow: none !important;
    background: transparent !important;
  }

  .money-budget-card::after {
    content: none;
    display: none;
  }

  .money-budget-row:active .money-budget-card,
  .money-budget-row:focus .money-budget-card,
  .money-budget-row.is-active .money-budget-card,
  .money-budget-row.is-active:active .money-budget-card {
    background: transparent !important;
    border: none;
    box-shadow: none !important;
  }

  .money-budget-row.is-active .money-budget-name,
  .money-budget-row.is-active .nm {
    color: inherit !important;
  }

  .money-budget-row.is-active .money-budget-meta {
    color: var(--nf-muted) !important;
  }

  .money-budget-row.is-active.is-archived .nm::after {
    color: var(--nf-muted) !important;
  }

  .money-budget-row.is-active .money-budget-ring::before {
    content: none !important;
    display: none !important;
  }

  .money-budget-row.is-active .money-budget-ring-fill {
    stroke: revert-layer;
  }

  .money-budget-row.is-active .money-budget-edit-btn {
    color: var(--nf-muted) !important;
    background: transparent !important;
  }

  /*
   * Mobile top: fixed to the viewport (sticky fails — .money-shell has
   * overflow:hidden to clip the off-screen detail pane).
   * Soft shadow only when scrollY > 0 (.is-scrolled).
   */
  .money-top {
    --money-mobile-top-row: 40px;
    --money-mobile-top-h: calc(var(--money-mobile-top-row) + 16px + env(safe-area-inset-top, 0px));
    --money-mobile-progress-gap: 6px;
    --money-mobile-progress-h: 32px;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    height: auto !important;
    min-height: var(--money-mobile-top-h) !important;
    margin: 0 !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px !important;
    border-bottom: none;
    box-shadow: none;
    overflow: visible !important;
    /* Solid theme pane — veil sits underneath (body::before z 34) */
    background: #ffffff;
    flex: 0 0 auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    /* Under expenses sheet (40); body-fixed like progress — covered, not unmounted */
    z-index: 38;
    box-sizing: border-box;
  }

  .money-top.is-scrolled {
    box-shadow: 0 1px 2px rgba(20, 35, 26, 0.11);
  }

  /*
   * Top reserve lives on each ViewPager page — NOT on cats-main.
   * Shrinking shared cats-main padding mid-swipe made Incomes + Analytics
   * both jump upward while the budget chrome slid.
   */
  .money-pane-cats-main {
    --money-mobile-top-row: 40px;
    --money-mobile-top-h: calc(var(--money-mobile-top-row) + 16px + env(safe-area-inset-top, 0px));
    --money-mobile-progress-gap: 6px;
    --money-mobile-progress-h: 32px;
    --nf-pad-budget: calc(
      var(--money-mobile-top-h) + var(--money-mobile-progress-gap) + var(--money-mobile-progress-h) + 6px
    );
    --nf-pad-bare: calc(10px + env(safe-area-inset-top, 0px));
    padding-top: 0;
  }

  /*
   * Top fade — body-level element (not pane ::before) so scroll-lock /
   * expenses open does not yank it; covered by sheet (z40), zoomed via getBehind.
   */
  .money-top-veil {
    --money-mobile-top-row: 40px;
    --money-mobile-top-h: calc(var(--money-mobile-top-row) + 16px + env(safe-area-inset-top, 0px));
    --money-mobile-progress-gap: 6px;
    --money-mobile-progress-h: 32px;
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--money-mobile-top-h);
    width: 100%;
    height: calc(
      var(--money-mobile-progress-gap) + var(--money-mobile-progress-h) + 10px
    );
    z-index: 34;
    pointer-events: none;
    /* was: rgba(255, 255, 255, 0.96) — a bit softer so list peeks through */
    background: rgba(255, 255, 255, 0.82);
    /* was: #000 0/28%, 0.88@48%, 0.52@72%, 0.18@90% */
    -webkit-mask-image: linear-gradient(
      180deg,
      #000 0%,
      #000 22%,
      rgba(0, 0, 0, 0.78) 44%,
      rgba(0, 0, 0, 0.42) 68%,
      rgba(0, 0, 0, 0.14) 88%,
      transparent 100%
    );
    mask-image: linear-gradient(
      180deg,
      #000 0%,
      #000 22%,
      rgba(0, 0, 0, 0.78) 44%,
      rgba(0, 0, 0, 0.42) 68%,
      rgba(0, 0, 0, 0.14) 88%,
      transparent 100%
    );
  }

  .money-top.is-select-open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: none;
  }

  .money-top.is-select-open.is-scrolled {
    box-shadow: none;
  }

  .money-brand-bar {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    height: var(--money-mobile-top-row);
    min-height: var(--money-mobile-top-row);
  }

  .money-brand-logo-wrap {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
  }

  .money-brand-logo {
    height: 20px;
  }

  .money-brand-actions {
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Icon-only search, parked on the right — not a chip. */
  .money-brand-bar .money-cats-search-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    margin-left: 0;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 12px;
    flex: 0 0 auto;
    order: 3;
    color: var(--nf-ink);
  }

  .money-brand-bar .money-cats-search-toggle svg {
    width: 22px;
    height: 22px;
  }

  .money-brand-bar .money-cats-manage {
    display: none !important;
  }

  .money-top-period {
    display: inline-flex;
    margin-right: 0;
    margin-left: auto;
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 32vw;
    height: 32px;
    padding: 0 10px;
    align-self: center;
  }

  .money-top-period:active {
    background: color-mix(in srgb, var(--nf-card) 70%, var(--nf-ink) 8%);
  }

  .money-top-chip {
    width: auto;
    height: 32px;
    padding: 0 10px;
    gap: 5px;
    border: 1px solid var(--nf-border);
    border-radius: 999px;
    background: var(--nf-card);
    color: var(--nf-ink);
    font-size: 12.5px;
    font-weight: 650;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .money-top-chip:active {
    background: color-mix(in srgb, var(--nf-card) 70%, var(--nf-ink) 8%);
  }

  .money-top-chip svg {
    flex: 0 0 auto;
    color: var(--nf-muted);
  }

  .money-top-chip-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .money-spaces-more {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    width: auto;
    height: 32px;
    margin: 0;
    gap: 5px;
    font-weight: 650;
  }

  .money-spaces-more .money-top-chip-label {
    font-weight: 650;
  }

  .money-spaces-more-ico {
    flex: 0 0 auto;
    color: var(--nf-muted);
  }

  .money-spaces-more .money-spaces-more-ico.is-close {
    display: none;
  }

  .money-spaces-more[aria-expanded='true'] .money-spaces-more-ico.is-home {
    display: none;
  }

  .money-spaces-more[aria-expanded='true'] .money-spaces-more-ico.is-close {
    display: block;
  }

  .money-cats-manage {
    width: auto;
    height: 32px;
  }

  .money-spaces-more-wrap {
    display: inline-flex;
    flex: 0 0 auto;
    order: 2;
    align-self: center;
  }

  .money-top > .money-icon-btn#btn-menu-open,
  .money-top > .money-status,
  .money-top > .money-range-progress-top,
  .money-top > #overall-split-top {
    display: none !important;
  }

  /* Search field collapsed by default on mobile */
  .money-top > .money-cats-search {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    align-self: stretch;
    width: 100%;
    max-width: none;
    height: var(--money-mobile-top-row);
    min-height: var(--money-mobile-top-row);
    padding: 0 8px 0 11px;
    border-radius: 999px;
    background: #ececec;
  }

  .money-top > .money-cats-select {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    align-self: stretch;
    width: 100%;
    max-width: none;
    height: var(--money-mobile-top-row);
    min-height: var(--money-mobile-top-row);
    padding: 0 2px 0 0;
  }

  .money-top.is-search-open > .money-brand-bar {
    display: none !important;
  }

  /* Keep brand row space in flow; select bar covers viewport top instead */
  .money-top.is-select-open > .money-brand-bar {
    visibility: hidden;
    pointer-events: none;
  }

  .money-top.is-search-open > .money-cats-search {
    display: flex;
  }

  /*
   * Search + keyboard: hide dock/FAB under the keyboard
   * (interactive-widget=resizes-visual — KB overlays layout; expense detail pins to VV).
   */
  html:has(.money-top.is-search-open) .money-dock,
  html:has(.money-top.is-search-open) .money-pane-cats .money-cats-foot,
  html.nf-cash-kb .money-dock,
  html.nf-cash-kb .money-pane-cats .money-cats-foot {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  html:has(.money-top.is-search-open) .money-dock-veil,
  html.nf-cash-kb .money-dock-veil {
    display: none !important;
  }

  .money-top.is-select-open > .money-cats-search {
    display: none !important;
  }

  .money-top.is-select-open > .money-cats-select {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 45;
    width: auto;
    max-width: none;
    height: var(--money-mobile-top-h);
    min-height: var(--money-mobile-top-h);
    margin: 0;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    box-sizing: border-box;
    background: var(--nf-card);
    box-shadow: 0 1px 0 rgba(20, 35, 26, 0.06);
    border-radius: 0;
  }

  .money-top.is-search-open .money-cats-search-close:not([hidden]) {
    display: inline-flex !important;
  }

  .money-cats-search-close[hidden] {
    display: none !important;
  }

  .money-top > .money-cats-search:focus-within {
    background: #e6e6e6;
  }

  .money-cats-search-input {
    font-size: 16px;
  }

  /*
   * Multi-select: gray + light fade on content only — frosted backgrounds stay.
   * Taps still dismiss selection via JS capture handlers.
   */
  html.nf-cat-select .money-dock-avatar,
  html.nf-cat-select .money-dock-icon,
  html.nf-cat-select .money-dock-label,
  html.nf-cat-select .money-cats-create,
  html.nf-cat-select .money-cats-create-plus,
  html.nf-cat-select .money-range-progress-dock .money-range-progress-scale,
  html.nf-cat-select .money-range-progress-dock .money-range-progress-track,
  html.nf-cat-select .money-range-progress-dock .money-range-progress-fill,
  html.nf-cat-select .money-range-progress-dock .money-range-progress-cur,
  html.nf-cat-select .money-range-progress-dock .money-range-progress-edge,
  html.nf-cat-select .money-range-progress-dock .money-range-progress-mark,
  html.nf-cat-select .money-range-progress-dock .money-range-progress-plan-tick,
  html.nf-cat-select .money-range-progress-dock .money-range-progress-time {
    filter: grayscale(0.35);
    opacity: 0.72;
  }

  /*
   * List view: shell grows with content (document scrolls for PTR),
   * but overflow:hidden clips the off-screen detail pane (translateX 100%)
   * — otherwise it creates horizontal scroll and breaks position:fixed dock.
   */
  .money-shell {
    position: relative;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .money-splitter {
    display: none !important;
  }

  .money-pane-cats {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0;
    width: 100%;
    max-width: 100%;
    /* --nf-list follows theme boot (white light / dark bg) — no cold white flash */
    background: var(--nf-list);
  }

  .money-pane-cats-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background: var(--nf-list);
  }

  .money-pane-cats .money-skel-list {
    flex: 0 0 auto;
    overflow: visible;
    /* Match expense/income page top reserve (cats-main padding is 0) */
    padding: var(--nf-pad-budget, 56px) 0 calc(78px + env(safe-area-inset-bottom, 0px));
    background: transparent;
  }

  .money-pane-cats .money-skel-ring {
    flex-basis: 65px;
    width: 65px;
    height: 65px;
  }

  /*
   * Clearance for menu only (~56 + 10 inset) — FAB floats over list.
   */
  .money-pane-cats .money-budgets {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    padding: 4px 0 calc(78px + env(safe-area-inset-bottom, 0px));
    gap: 0;
    background: transparent;
  }

  /* FAB above the centered menu (~30px gap); +5px down, +7px right inset. */
  .money-pane-cats .money-cats-foot {
    position: fixed;
    right: 19px;
    bottom: calc(81px + env(safe-area-inset-bottom, 0px));
    left: auto;
    z-index: 36;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    min-height: 0;
    width: auto;
    pointer-events: none;
  }

  .money-pane-cats .money-cats-foot .money-cats-create {
    pointer-events: auto;
    /* ~10% smaller than former 56px menu-matched FAB */
    width: 50px;
    height: 50px;
    min-height: 50px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgb(70, 174, 55);
    color: #fff;
    font-size: 0;
    font-weight: 700;
    line-height: 1;
    gap: 0;
    box-shadow:
      0 3px 1px -2px rgb(0 0 0 / 10%),
      0 2px 2px 0 rgb(0 0 0 / 7%),
      0 1px 5px 0 rgb(0 0 0 / 6%) !important;
    justify-content: center;
    align-items: center;
  }

  .money-pane-cats .money-cats-foot .money-cats-create:active {
    background: rgb(61, 154, 48);
    color: #fff;
    border: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .money-pane-cats .money-cats-foot .money-cats-create:hover {
      background: rgb(61, 154, 48);
      color: #fff;
      border: none;
    }
  }

  .money-pane-cats .money-cats-foot .money-cats-create-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
    color: #fff;
    transform: none;
  }

  .money-pane-cats .money-cats-foot .money-cats-create-ico {
    display: block;
    width: 28px;
    height: 28px;
  }

  /*
   * Cover FAB with expenses — keep mounted underneath for swipe-back reveal
   * (same idea as .money-dock). Do not display:none — that jumps on dismiss.
   */
  .money-body.detail-open .money-cats-foot {
    pointer-events: none !important;
  }

  .money-body.detail-open .money-cats-foot .money-cats-create {
    pointer-events: none !important;
  }

  /*
   * Bottom menu only (progress lives under the fixed header).
   * Small lift above the home indicator / safe-area.
   */
  .money-dock {
    display: block !important;
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box;
    margin: 0 !important;
    /* Stay viewport-fixed during swipe-back (not in homeBehindEls zoom set) */
    transform: translateZ(0);
    z-index: 35;
    pointer-events: none;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  /* Legacy pseudo — replaced by viewport-fixed .money-dock-veil */
  .money-dock::before {
    content: none !important;
    display: none !important;
  }

  /*
   * Soft fade under menu — fixed to the viewport (not a child of .money-dock),
   * so swipe-back zoom never shrinks it / leaves a transparent strip.
   * Always mounted under sheets (no display:none on add-picker) to avoid pop-in.
   */
  .money-dock-veil {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    /* was: 110px — slightly shorter fade */
    height: calc(92px + env(safe-area-inset-bottom, 0px));
    z-index: 34;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.96);
    /* was: 0.88@26%, 0.52@56%, 0.18@82% */
    -webkit-mask-image: linear-gradient(
      0deg,
      #000 0%,
      rgba(0, 0, 0, 0.88) 30%,
      rgba(0, 0, 0, 0.48) 62%,
      rgba(0, 0, 0, 0.14) 86%,
      transparent 100%
    );
    mask-image: linear-gradient(
      0deg,
      #000 0%,
      rgba(0, 0, 0, 0.88) 30%,
      rgba(0, 0, 0, 0.48) 62%,
      rgba(0, 0, 0, 0.14) 86%,
      transparent 100%
    );
  }

  /* Analytics: bottom veil = page bg, a touch lighter than top veil */
  html[data-home-tab='analytics'] .money-dock-veil {
    background: rgba(238, 241, 239, 0.96);
  }

  .money-dock-stack {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    pointer-events: none;
  }

  /* Expenses cover the dock; keep mounted underneath for slide-back reveal */
  .money-body.detail-open .money-dock {
    visibility: visible;
    pointer-events: none !important;
  }

  .money-body.detail-open .money-dock-inner {
    pointer-events: none !important;
  }

  .money-dock-inner {
    pointer-events: auto;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    gap: 2px;
    /* Centered; ~15px narrower than prior FAB-side width */
    width: calc(100% - 77px);
    max-width: calc(100% - 77px);
    align-self: center;
    height: 56px;
    min-height: 56px;
    padding: 4px 6px;
    border-radius: 999px;
    overflow: visible;
    /* Solid pill — no glass blur */
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow:
      0 3px 1px -2px rgb(0 0 0 / 10%),
      0 2px 2px 0 rgb(0 0 0 / 7%),
      0 1px 5px 0 rgb(0 0 0 / 6%) !important;
    box-sizing: border-box;
  }

  /* No create FAB — menu uses full width */
  html:not(.nf-can-structure) .money-dock-inner {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
  }

  /*
   * Floating progress under the header: two sibling cards (expense | income)
   * with the same radius/fill/shadow and a small gap — not one shared pill.
   */
  #overall-split-dock {
    --money-mobile-top-row: 40px;
    --money-mobile-top-h: calc(var(--money-mobile-top-row) + 16px + env(safe-area-inset-top, 0px));
    --money-mobile-progress-gap: 6px;
    --money-mobile-progress-h: 32px;
    display: flex !important;
    align-items: stretch;
    position: fixed;
    top: calc(var(--money-mobile-top-h) + var(--money-mobile-progress-gap));
    left: 12px;
    right: 12px;
    /* Under expenses sheet (40); body-fixed with dock — covered, not unmounted */
    z-index: 36;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 0;
    height: var(--money-mobile-progress-h);
    min-height: var(--money-mobile-progress-h);
    max-height: var(--money-mobile-progress-h);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    box-sizing: border-box;
    pointer-events: none;
    /*
     * Do NOT set transform here — sheet-swipe applies translateZ+scale inline
     * (top-left origin) on swipe-back.
     */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  #overall-split-dock .money-overall-seg.is-income {
    margin-left: 6px;
  }

  /* Round edit: left on expenses, right on incomes. Slot width + icon scale. */
  .money-split-edit-slot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    overflow: hidden;
    pointer-events: none;
  }

  .money-split-edit-slot.is-expense {
    width: 32px;
    margin-right: 6px;
  }

  .money-split-edit-slot.is-income {
    width: 0;
    margin: 0;
  }

  html[data-home-tab='income'] .money-split-edit-slot.is-expense,
  html[data-home-tab='analytics'] .money-split-edit-slot,
  html[data-home-tab='profile'] .money-split-edit-slot {
    width: 0;
    margin: 0;
  }

  html[data-home-tab='income'] .money-split-edit-slot.is-income {
    width: 32px;
    margin-left: 6px;
  }

  .money-split-edit {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: none;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Same surface as #overall-split-dock .money-overall-seg */
    background: #ffffff;
    color: var(--nf-ink);
    box-shadow:
      0 0 1px rgba(40, 48, 58, 0.07),
      0 0 4px rgba(40, 48, 58, 0.08),
      0 0 7px rgba(40, 48, 58, 0.05);
    pointer-events: auto;
    transform-origin: center center;
    -webkit-tap-highlight-color: transparent;
  }

  .money-split-edit-slot.is-income .money-split-edit,
  html[data-home-tab='income'] .money-split-edit-slot.is-expense .money-split-edit,
  html[data-home-tab='analytics'] .money-split-edit,
  html[data-home-tab='profile'] .money-split-edit {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
  }

  html[data-home-tab='income'] .money-split-edit-slot.is-income .money-split-edit {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  /* Select: glass stays with the bars; only the pencil fades like bar content. */
  html.nf-cat-select .money-split-edit svg {
    filter: grayscale(0.35);
    opacity: 0.72;
  }

  #overall-split-dock .money-overall-seg {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 100%;
    padding: 3px 10px 4px;
    border-radius: 14px;
    background: #ffffff;
    border: none;
    box-shadow:
      0 0 1px rgba(40, 48, 58, 0.07),
      0 0 4px rgba(40, 48, 58, 0.08),
      0 0 7px rgba(40, 48, 58, 0.05);
    box-sizing: border-box;
    overflow: visible;
    /* Parent is pointer-events:none; segments receive taps → homeMode */
    pointer-events: auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  #overall-split-dock .money-range-progress-dock {
    display: flex !important;
    flex-direction: column;
    position: static;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    gap: 2px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    justify-content: center;
    pointer-events: none;
  }

  .money-body.detail-open #overall-split-dock,
  .money-body.detail-open .money-range-progress-dock {
    pointer-events: none !important;
  }

  #overall-split-dock .money-range-progress-dock .money-range-progress-scale {
    height: 10px;
    min-height: 10px;
    font-size: 8px;
    line-height: 10px;
  }

  #overall-split-dock .money-range-progress-dock .money-range-progress-track {
    height: 3px;
    border-radius: 999px;
    flex: 0 0 3px;
  }

  #overall-split-dock .money-range-progress-dock .money-range-progress-fill {
    height: 3px;
    min-height: 3px;
    border-radius: 999px;
  }


  .money-dock-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--nf-ink);
    font: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 2px 1px 5px;
    border-radius: 999px;
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease, transform 180ms ease;
  }

  /* Active bg morphs with pager progress (shrink+fade out / grow+fade in) */
  .money-dock-bg {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(70, 174, 55, 0.14);
    transform: scale(0);
    opacity: 0;
    transform-origin: center center;
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
  }

  .money-dock-bg.is-animated {
    transition:
      transform var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1),
      opacity var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* Fallback before JS sets inline; swipe overrides via style */
  .money-dock-item.is-active .money-dock-bg {
    transform: scale(1);
    opacity: 1;
  }

  .money-dock-item > :not(.money-dock-bg) {
    position: relative;
    z-index: 1;
  }

  .money-dock-item .money-dock-icon,
  .money-dock-item .money-dock-label {
    transition: color 160ms ease;
  }

  .money-dock-item:active {
    background: transparent;
  }

  .money-dock-item.is-active {
    color: #2f8f28;
    background: transparent;
    border-radius: 999px;
  }

  .money-dock-item.is-active .money-dock-icon,
  .money-dock-item.is-active .money-dock-label {
    color: #2f8f28;
  }

  /* Prefer vertical pan; horizontal claimed by ViewPager after axis lock */
  #pane-cats-main,
  .money-home-pager {
    touch-action: pan-y;
  }

  /*
   * During horizontal pager drag/snap: kill viewport rubber-band + vertical steal
   * (iOS Safari otherwise pans visual viewport → feels like zoom).
   * touch-action mid-gesture is ignored on iOS — JS also preventDefault on touchmove.
   */
  html.nf-pager-dragging,
  html.nf-pager-dragging body {
    overscroll-behavior: none;
    overscroll-behavior-y: none;
  }
  html.nf-pager-dragging .money-home-pager,
  html.nf-pager-dragging #pane-cats-main,
  html.nf-pager-dragging .money-home-pager-track,
  html.nf-pager-dragging .money-home-page {
    touch-action: none;
  }

  /* ViewPager: Expenses | Incomes | Analytics | Profile */
  .money-home-pager {
    position: relative;
    width: 100%;
    overflow: hidden;
  }

  .money-home-pager-track {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 400%;
    transform: translate3d(0, 0, 0);
    will-change: transform;
  }

  .money-home-pager-track.is-animated {
    transition: transform var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1);
  }

  .money-home-pager-track.is-dragging {
    transition: none !important;
  }

  /*
   * First paint: park pager on the session tab (html.nf-tab-boot from <head>).
   * Percent of the 400% track = one page. Inline JS transform takes over after boot.
   */
  html.nf-tab-boot[data-home-tab='income'] #home-pager-track {
    transform: translate3d(-25%, 0, 0);
  }
  html.nf-tab-boot[data-home-tab='analytics'] #home-pager-track {
    transform: translate3d(-50%, 0, 0);
  }
  html.nf-tab-boot[data-home-tab='profile'] #home-pager-track {
    transform: translate3d(-75%, 0, 0);
  }
  html.nf-tab-boot[data-home-tab='analytics'] #money-budget-chrome,
  html.nf-tab-boot[data-home-tab='profile'] #money-budget-chrome {
    transform: translate3d(-100%, 0, 0);
  }
  html.nf-tab-boot[data-home-tab='income'] #dock-expenses.is-active,
  html.nf-tab-boot[data-home-tab='analytics'] #dock-expenses.is-active,
  html.nf-tab-boot[data-home-tab='profile'] #dock-expenses.is-active,
  html.nf-tab-boot[data-home-tab='income'] #dock-expenses.is-active .money-dock-icon,
  html.nf-tab-boot[data-home-tab='analytics'] #dock-expenses.is-active .money-dock-icon,
  html.nf-tab-boot[data-home-tab='profile'] #dock-expenses.is-active .money-dock-icon,
  html.nf-tab-boot[data-home-tab='income'] #dock-expenses.is-active .money-dock-label,
  html.nf-tab-boot[data-home-tab='analytics'] #dock-expenses.is-active .money-dock-label,
  html.nf-tab-boot[data-home-tab='profile'] #dock-expenses.is-active .money-dock-label {
    color: var(--nf-muted);
  }
  html.nf-tab-boot[data-home-tab='income'] #dock-expenses .money-dock-bg,
  html.nf-tab-boot[data-home-tab='analytics'] #dock-expenses .money-dock-bg,
  html.nf-tab-boot[data-home-tab='profile'] #dock-expenses .money-dock-bg {
    transform: scale(0);
    opacity: 0;
  }
  html.nf-tab-boot[data-home-tab='income'] #dock-incomes,
  html.nf-tab-boot[data-home-tab='income'] #dock-incomes .money-dock-icon,
  html.nf-tab-boot[data-home-tab='income'] #dock-incomes .money-dock-label,
  html.nf-tab-boot[data-home-tab='analytics'] #dock-analytics,
  html.nf-tab-boot[data-home-tab='analytics'] #dock-analytics .money-dock-icon,
  html.nf-tab-boot[data-home-tab='analytics'] #dock-analytics .money-dock-label,
  html.nf-tab-boot[data-home-tab='profile'] #dock-profile,
  html.nf-tab-boot[data-home-tab='profile'] #dock-profile .money-dock-label {
    color: #2f8f28;
  }
  html.nf-tab-boot[data-home-tab='income'] #dock-incomes .money-dock-bg,
  html.nf-tab-boot[data-home-tab='analytics'] #dock-analytics .money-dock-bg,
  html.nf-tab-boot[data-home-tab='profile'] #dock-profile .money-dock-bg {
    transform: scale(1);
    opacity: 1;
  }

  .money-home-page {
    flex: 0 0 25%;
    width: 25%;
    max-width: 25%;
    box-sizing: border-box;
    min-width: 0;
    /* Keep swipe surface usable on short tabs; JS also enforces viewport min */
    min-height: calc(100dvh - var(--money-mobile-top-h, 56px) - 12px);
  }

  /* Expense/Income: room for fixed budget chrome (header + progress) */
  .money-home-page[data-home-page='expense'],
  .money-home-page[data-home-page='income'] {
    padding-top: var(--nf-pad-budget);
  }

  /* Analytics: chrome owns safe-area + header/progress rhythm */
  .money-home-page[data-home-page='analytics'] {
    padding-top: 0;
    /* Slightly deeper than app --nf-bg (#f4f6f5) so analytics reads as its own surface */
    background: #e6ebe8;
  }

  /* Profile: only safe-area — budget chrome is off-screen */
  .money-home-page[data-home-page='profile'] {
    padding-top: var(--nf-pad-bare);
  }

  .money-home-page .money-budgets {
    width: 100%;
  }

  /*
   * Budget chrome wrapper — children stay position:fixed; transform on this
   * node slides header+progress with Expenses/Incomes during ViewPager drag.
   * MUST be full viewport width: any transform makes this the containing
   * block for fixed kids — width:0 would squash header/progress mid-swipe.
   */
  .money-budget-chrome {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    width: 100%;
    height: 0;
    overflow: visible;
    z-index: 38;
    pointer-events: none;
  }

  .money-budget-chrome > .money-top,
  .money-budget-chrome > #overall-split-dock {
    pointer-events: auto;
  }

  .money-budget-chrome.is-animated {
    transition: transform var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1);
  }

  .money-settings-page {
    /* Same horizontal inset as expense/income .money-top (12px) */
    padding: 0 12px calc(72px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    max-width: 520px;
    margin: 0 auto;
  }

  /*
   * Analytics page is full-bleed horizontally; chrome + panes own the 12px inset.
   * Inset/gap stay fixed during swipe (collapsing them reflowed every pane).
   * Top padding = fixed head height (content flush under chrome).
   */
  .money-analytics-page {
    --money-mobile-top-row: 40px;
    --money-mobile-top-h: calc(var(--money-mobile-top-row) + 16px + env(safe-area-inset-top, 0px));
    --nf-an-chip-h: 34px;
    --nf-an-chrome-h: var(--money-mobile-top-h);
    padding: var(--nf-an-chrome-h) 0 calc(78px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    max-width: none;
    margin: 0;
    color: var(--nf-ink);
    background: #e6ebe8;
  }

  /*
   * Analytics chrome shell — ported to body on mobile.
   * Single head row: kind menu + period chip.
   * NOTE: .nf-an-top is reserved for the top-categories <ul>.
   */
  .nf-an-chrome {
    --money-mobile-top-row: 40px;
    --money-mobile-top-h: calc(var(--money-mobile-top-row) + 16px + env(safe-area-inset-top, 0px));
    --nf-an-chip-h: 34px;
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background: transparent;
    pointer-events: none;
  }

  /*
   * Ported fixed chrome — full viewport width so transform does not squash kids.
   * Horizontal ride with home ViewPager is driven by syncAnalyticsChrome(trackX)
   * (same pattern as .money-budget-chrome).
   */
  .nf-an-chrome.is-ported {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 37;
    will-change: transform;
    /* Absolute .nf-an-veil anchors to this box */
    overflow: visible;
  }

  .nf-an-chrome.is-animated {
    transition: transform var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* Full-width top bar — kind menu + calendar on the right */
  .nf-an-head {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    min-height: var(--money-mobile-top-h);
    height: var(--money-mobile-top-h);
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
    box-sizing: border-box;
    /* Frosted like .money-top — tinted to analytics bg (#e6ebe8) */
    background: rgba(230, 235, 232, 0.58);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    pointer-events: auto;
    box-shadow: none;
  }

  /* .nf-an-head.is-scrolled {
    box-shadow: 0 1px 2px rgba(20, 35, 26, 0.11);
  } */

  /* Soft fade under header — commented (looked like a top shadow) */
  /*
  .nf-an-veil {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--money-mobile-top-h);
    width: 100%;
    height: 24px;
    z-index: 0;
    pointer-events: none;
    background: rgba(230, 235, 232, 0.92);
    -webkit-mask-image: linear-gradient(
      180deg,
      #000 0%,
      #000 22%,
      rgba(0, 0, 0, 0.78) 44%,
      rgba(0, 0, 0, 0.42) 68%,
      rgba(0, 0, 0, 0.14) 88%,
      transparent 100%
    );
    mask-image: linear-gradient(
      180deg,
      #000 0%,
      #000 22%,
      rgba(0, 0, 0, 0.78) 44%,
      rgba(0, 0, 0, 0.42) 68%,
      rgba(0, 0, 0, 0.14) 88%,
      transparent 100%
    );
  }
  */
  .nf-an-veil {
    display: none !important;
  }

  /* Nested ViewPager: expense | income | balance (chrome stays fixed) */
  .nf-an-pager {
    position: relative;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
  }

  /*
   * Same geometry as home pager: track = N×100% of pager, page = 1/N of track.
   */
  .nf-an-pager-track {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 400%;
    max-width: none;
    transform: translate3d(0, 0, 0);
    will-change: transform;
  }

  .nf-an-pager-track.is-animated {
    transition: transform var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1);
  }

  .nf-an-pager-track.is-dragging {
    transition: none !important;
  }

  /* Boot park — % of the 400% track (same as runtime settledX). */
  html.nf-tab-boot[data-analytics-kind='income'] #analytics-pager-track {
    transform: translate3d(-25%, 0, 0);
  }
  html.nf-tab-boot[data-analytics-kind='balance'] #analytics-pager-track {
    transform: translate3d(-50%, 0, 0);
  }
  html.nf-tab-boot[data-analytics-kind='savings'] #analytics-pager-track {
    transform: translate3d(-75%, 0, 0);
  }
  /* Pill left/width set by JS (content-sized tabs) — no boot % transforms. */

  .nf-an-page {
    flex: 0 0 25%;
    width: 25%;
    max-width: 25%;
    box-sizing: border-box;
    min-width: 0;
    /* inset only — no inter-pane margin (home has no gap either) */
    /* Same horizontal inset as expense/income .money-top (12px) */
    padding-left: var(--nf-an-inset, 12px);
    padding-right: var(--nf-an-inset, 12px);
    /* JS sets min-height = viewport − chrome − dock pad (no extra scrollbar) */
    min-height: 0;
  }

  .nf-an-page + .nf-an-page {
    margin-left: 0;
  }

  /* Period chip — right side of head, same height as kind menu (icon + label) */
  .nf-an-period {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    height: var(--nf-an-chip-h, 34px);
    max-width: min(38vw, 168px);
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--nf-border);
    border-radius: 999px;
    background: var(--nf-card);
    color: var(--nf-ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 650;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
  }

  .nf-an-period:active {
    background: color-mix(in srgb, var(--nf-card) 70%, var(--nf-ink) 8%);
  }

  .nf-an-period-ico {
    display: inline-flex;
    color: var(--nf-muted);
    flex: 0 0 auto;
  }

  .nf-an-period-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Kind menu — content-based tabs (even gaps), pill width set in JS */
  .nf-an-seg {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: var(--nf-an-chip-h, 34px);
    min-height: var(--nf-an-chip-h, 34px);
    padding: 2px;
    box-sizing: border-box;
    border: 1px solid var(--nf-border);
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--nf-card) 88%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    box-shadow: none;
  }

  /* Sliding active background — left/width driven by analytics-swipe */
  .nf-an-seg-pill {
    position: absolute;
    top: 2px;
    left: 0;
    bottom: 2px;
    width: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--nf-green) 12%, #ffffff);
    pointer-events: none;
    z-index: 0;
    transform: translate3d(0, 0, 0);
    will-change: transform, width;
  }

  .nf-an-seg-pill.is-animated {
    transition:
      transform var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1),
      width var(--nf-snap-ms, 320ms) cubic-bezier(0.22, 1, 0.36, 1);
  }

  .nf-an-seg-btn {
    position: relative;
    z-index: 1;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--nf-muted);
    font: inherit;
    font-size: 12.5px;
    font-weight: 650;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
  }

  /* Kind-tab icons commented out in markup — keep hidden if cached DOM still has them */
  .nf-an-seg-ico {
    display: none !important;
  }

  .nf-an-seg-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
  }

  .nf-an-seg-btn.is-active {
    background: transparent;
    color: var(--nf-green-dark, #3d9a30);
  }

  .nf-an-seg-btn:active {
    background: transparent;
  }

  .nf-an-hero {
    padding: 14px 14px 12px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: var(--nf-card);
    border: 1px solid var(--nf-border);
  }

  .nf-an-hero-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nf-muted);
  }

  .nf-an-hero-value {
    margin: 0;
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--nf-ink);
  }

  .nf-an-hero-sub {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--nf-muted);
    line-height: 1.35;
  }

  .nf-an-hero-badge {
    display: inline-flex;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    max-width: 100%;
    background: color-mix(in srgb, var(--nf-card) 70%, var(--nf-ink) 10%);
    color: var(--nf-ink);
  }

  /* display:inline-flex beats UA [hidden] — empty pill was visible on Balance */
  .nf-an-hero-badge[hidden] {
    display: none !important;
  }

  .nf-an-hero-badge.is-good {
    background: color-mix(in srgb, var(--nf-green) 18%, transparent);
    color: var(--nf-green-dark, #2f8f28);
  }

  .nf-an-hero-badge.is-warn {
    background: color-mix(in srgb, #e0a020 18%, transparent);
    color: #c47a12;
  }

  /* ——— Каса (cash + reserve) ——— */
  .nf-cash-hero .nf-an-hero-value.is-pos {
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-hero .nf-an-hero-value.is-neg {
    color: #b85c5c;
  }
  .nf-cash-hero--reserve {
    margin-top: 4px;
  }
  .nf-cash-total {
    margin: 8px 0 14px;
    padding: 14px 4px 4px;
    border-top: 1px solid var(--nf-border);
  }
  .nf-cash-total[hidden] {
    display: none !important;
  }
  .nf-cash-total-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 650;
    color: var(--nf-muted);
    letter-spacing: 0.01em;
  }
  .nf-cash-total-value {
    margin: 0;
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--nf-ink);
  }
  .nf-cash-total-value.is-pos {
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-total-value.is-neg {
    color: #b85c5c;
  }
  .nf-cash-total-sub {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--nf-muted);
  }
  .nf-cash-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
  }
  .nf-cash-hero-top .nf-an-hero-kicker {
    margin: 0;
  }
  .nf-cash-tools {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
  }
  .nf-cash-ico {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--nf-ink) 6%, transparent);
    color: var(--nf-ink);
    cursor: pointer;
    flex: 0 0 auto;
  }
  .nf-cash-ico:active {
    transform: scale(0.96);
  }
  .nf-cash-ico.is-active,
  .nf-cash-ico.is-primary {
    background: color-mix(in srgb, var(--nf-green, #4caf50) 22%, transparent);
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-ico.is-in {
    background: color-mix(in srgb, var(--nf-green, #4caf50) 18%, transparent);
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-ico.is-out {
    background: color-mix(in srgb, #b85c5c 16%, transparent);
    color: #a04545;
  }
  .nf-cash-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, #b85c5c 12%, var(--nf-card));
    color: #8f3d3d;
    font-size: 13px;
  }
  .nf-cash-card {
    margin-bottom: 12px;
  }
  .nf-cash-recorded {
    padding: 12px 14px;
  }
  .nf-cash-recorded-title {
    margin: 0 0 4px;
  }
  .nf-cash-recorded-value {
    margin: 0;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--nf-ink);
  }
  .nf-cash-recorded-value.is-pos {
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-recorded-value.is-neg {
    color: var(--nf-red, #c62828);
  }
  .nf-cash-recorded-sub {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--nf-muted);
    line-height: 1.35;
  }
  .nf-cash-month-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 0 10px;
  }
  @media (min-width: 380px) {
    .nf-cash-month-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .nf-cash-month-grid--two {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  .nf-cash-month-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid var(--nf-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--nf-ink) 3%, var(--nf-card));
    min-width: 0;
  }
  .nf-cash-month-cell--accent {
    border-color: color-mix(in srgb, var(--nf-green, #4caf50) 45%, var(--nf-border));
    background: color-mix(in srgb, var(--nf-green, #4caf50) 10%, var(--nf-card));
  }
  .nf-cash-month-label {
    font-size: 11px;
    font-weight: 650;
    color: var(--nf-muted);
    line-height: 1.3;
  }
  .nf-cash-month-value {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--nf-ink);
    line-height: 1.2;
  }
  .nf-cash-month-value.is-pos {
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-month-value.is-neg {
    color: var(--nf-red, #c62828);
  }
  .nf-cash-month-plan {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--nf-muted);
    line-height: 1.35;
  }
  .nf-cash-month-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .nf-cash-month-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: baseline;
    padding: 8px 10px;
    border: 1px solid var(--nf-border);
    border-radius: 10px;
    background: var(--nf-card);
    font-size: 12.5px;
  }
  .nf-cash-month-item.is-empty {
    display: block;
    color: var(--nf-muted);
    font-weight: 500;
  }
  .nf-cash-month-item-name {
    font-weight: 650;
    color: var(--nf-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nf-cash-month-item-meta {
    color: var(--nf-muted);
    font-size: 11px;
    font-weight: 600;
  }
  .nf-cash-month-item-val {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .nf-cash-month-item.is-pos .nf-cash-month-item-val {
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-month-item.is-neg .nf-cash-month-item-val {
    color: var(--nf-red, #c62828);
  }
  .nf-cash-lead {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--nf-muted);
    line-height: 1.4;
  }
  .nf-cash-lead--tight {
    margin-bottom: 10px;
  }
  .nf-cash-forced-mixed {
    color: color-mix(in srgb, var(--nf-green, #4caf50) 70%, var(--nf-ink));
    font-weight: 600;
  }
  .nf-cash-policy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
  }
  .nf-cash-policy-label {
    margin: 0;
    font-size: 11px;
    font-weight: 650;
    color: var(--nf-muted);
  }
  .nf-cash-policy-opt {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid var(--nf-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--nf-ink) 3%, var(--nf-card));
    color: var(--nf-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .nf-cash-policy-opt.is-active {
    border-color: color-mix(in srgb, var(--nf-green, #4caf50) 55%, var(--nf-border));
    background: color-mix(in srgb, var(--nf-green, #4caf50) 12%, var(--nf-card));
  }
  .nf-cash-policy-opt:active {
    transform: scale(0.99);
  }
  .nf-cash-policy-opt-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
  }
  .nf-cash-policy-opt-lead {
    font-size: 12px;
    font-weight: 500;
    color: var(--nf-muted);
    line-height: 1.35;
  }
  .nf-cash-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
  }
  .nf-cash-label {
    font-size: 11px;
    font-weight: 650;
    color: var(--nf-muted);
  }
  .nf-cash-hint {
    font-size: 12px;
    color: var(--nf-muted);
    line-height: 1.35;
  }
  .nf-cash-setup .nf-cash-field {
    margin-bottom: 14px;
  }
  .nf-cash-setup .nf-cash-field input {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    padding: 14px 14px;
  }
  .nf-cash-field input,
  .nf-cash-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--nf-border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    background: var(--nf-card);
    color: var(--nf-ink);
  }
  .nf-cash-btn {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }
  .nf-cash-editor {
    margin: 0 0 12px;
    padding: 12px;
    border-radius: 16px;
    background: var(--nf-card);
    border: 1px solid var(--nf-border);
  }
  .nf-cash-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }
  .nf-cash-editor-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--nf-ink);
  }
  .nf-cash-editor-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .nf-cash-editor-row input[type='text'] {
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid var(--nf-border);
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: color-mix(in srgb, var(--nf-ink) 3%, var(--nf-card));
    color: var(--nf-ink);
  }
  .nf-cash-note-flat {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
    border: 0;
    border-radius: 10px;
    padding: 9px 10px;
    font: inherit;
    font-size: 13px;
    background: color-mix(in srgb, var(--nf-ink) 4%, transparent);
    color: var(--nf-ink);
  }
  .nf-cash-note-flat::placeholder {
    color: var(--nf-muted);
  }
  .nf-cash-pot-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  .nf-cash-pot-main {
    flex: 1 1 auto;
    min-width: 0;
  }
  .nf-cash-pot-title {
    margin-bottom: 4px;
  }
  .nf-cash-pot-value {
    margin: 0;
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--nf-ink);
  }
  .nf-cash-pot-value.is-neg {
    color: #b85c5c;
  }
  .nf-cash-pot-value.is-pos {
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-pot-sub {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--nf-muted);
  }
  .nf-cash-pot-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
  }
  .nf-cash-pot-tools[hidden] {
    display: none !important;
  }
  .nf-cash-transfer-dir {
    display: flex;
    width: 100%;
    margin-bottom: 10px;
  }
  .nf-cash-transfer-dir .nf-cash-hist-tab {
    flex: 1 1 0;
    text-align: center;
  }
  .nf-cash-history {
    padding-top: 4px;
  }
  .nf-cash-hist-title {
    margin-bottom: 10px;
  }
  .nf-cash-hist-title[hidden] {
    display: none !important;
  }
  .nf-cash-hist-seg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0 0 10px;
    padding: 3px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--nf-ink) 6%, transparent);
  }
  .nf-cash-hist-seg[hidden] {
    display: none !important;
  }
  .nf-cash-hist-tab {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    margin: 0;
    padding: 7px 14px;
    border-radius: 10px;
    background: transparent;
    color: var(--nf-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
  }
  .nf-cash-hist-tab.is-active {
    background: var(--nf-card);
    color: var(--nf-ink);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--nf-ink) 10%, transparent);
  }
  .nf-cash-hist-tab:active {
    transform: scale(0.98);
  }
  .nf-cash-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }
  .nf-cash-event {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
  }
  .nf-cash-event.is-reversed {
    opacity: 0.55;
  }
  .nf-cash-event.is-reversed .nf-cash-event-title {
    text-decoration: line-through;
  }
  .nf-cash-event-main {
    flex: 1 1 auto;
    min-width: 0;
  }
  .nf-cash-event-title {
    font-size: 13px;
    font-weight: 650;
    color: var(--nf-ink);
  }
  .nf-cash-event-meta {
    margin-top: 2px;
    font-size: 11px;
    color: var(--nf-muted);
    line-height: 1.35;
  }
  .nf-cash-event-amt {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
  }
  .nf-cash-event-amt.is-pos {
    color: var(--nf-green-dark, #3d9a30);
  }
  .nf-cash-event-amt.is-neg {
    color: #b85c5c;
  }
  .nf-cash-events-empty {
    margin: 0;
    font-size: 13px;
    color: var(--nf-muted);
  }
  .nf-cash-more {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    margin: 4px 0 0;
    padding: 10px 0;
    border: 0;
    background: transparent;
    color: var(--nf-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-align: center;
    cursor: pointer;
  }
  .nf-cash-more[hidden] {
    display: none !important;
  }
  .nf-cash-more:active {
    color: var(--nf-ink);
  }

  .nf-an-hero-badge.is-ok {
    background: color-mix(in srgb, var(--nf-card) 70%, var(--nf-ink) 10%);
    color: var(--nf-muted);
  }

  .nf-an-card {
    padding: 12px 0 4px;
    margin-bottom: 8px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .nf-an-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }

  .nf-an-card-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nf-muted);
  }

  .nf-an-card-head .nf-an-card-title {
    margin: 0;
  }

  .nf-an-card-meta {
    font-size: 12px;
    font-weight: 650;
    color: var(--nf-muted);
    white-space: nowrap;
  }

  /* Legacy pace meters — hide if cached HTML remains */
  .nf-an-meters,
  .nf-an-meter,
  .nf-an-meter-track {
    display: none !important;
  }

  .nf-an-chart-card,
  .nf-an-donut-card,
  .nf-an-panel-card {
    padding: 12px 14px 10px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: var(--nf-card);
    border: 1px solid var(--nf-border);
  }

  .nf-an-chart-wrap {
    width: 100%;
    margin-top: 4px;
    border-radius: 0;
    overflow: visible;
    /* Same surface as the card / plot — no nested “tray”. */
    background: transparent;
  }

  .nf-an-chart-frame {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    box-sizing: border-box;
  }

  .nf-an-chart-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 2px;
    min-width: 0;
    height: 214px;
    max-height: 214px;
  }

  .nf-an-chart-plot {
    flex: 1 1 auto;
    min-width: 0;
  }

  .nf-an-chart {
    display: block;
    width: 100%;
    height: 214px;
  }

  .nf-an-chart-grid {
    stroke: color-mix(in srgb, var(--nf-border) 70%, transparent);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
  }

  .nf-an-chart-grid.is-x {
    stroke: color-mix(in srgb, var(--nf-border) 45%, transparent);
  }

  .nf-an-chart-zero {
    stroke: rgba(20, 35, 26, 0.28);
    stroke-width: 1;
    stroke-dasharray: 4 4;
    vector-effect: non-scaling-stroke;
  }

  /* Right amount rail = labels + zoom scrubber as one scale. */
  .nf-an-chart-yscale {
    position: relative;
    flex: 0 0 3.6em;
    width: 3.6em;
    min-width: 3.6em;
    height: 214px;
    max-height: 214px;
  }

  .nf-an-chart-y {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    font-size: 10px;
    font-weight: 650;
    line-height: 1;
    color: var(--nf-muted);
    font-variant-numeric: tabular-nums;
  }

  .nf-an-chart-y > span {
    position: absolute;
    left: 0;
    right: 0;
    padding-left: 4px;
    transform: translateY(-50%);
    white-space: nowrap;
    text-align: left;
  }

  /* Bottom day rail = dates + zoom scrubber as one scale. */
  .nf-an-chart-xscale {
    position: relative;
    margin-top: 0;
    margin-right: 3.6em;
    height: 22px;
    min-width: 0;
  }

  .nf-an-chart-x {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    font-size: 10px;
    font-weight: 650;
    line-height: 1;
    color: var(--nf-muted);
    font-variant-numeric: tabular-nums;
  }

  .nf-an-chart-x > span {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    white-space: nowrap;
  }

  .nf-an-chart-x.is-cozy {
    font-size: 9px;
  }

  .nf-an-chart-x.is-dense {
    font-size: 8px;
    letter-spacing: -0.02em;
  }

  .nf-an-chart-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-top: 4px;
    margin-right: 3.6em;
    font-size: 11px;
    font-weight: 650;
    color: var(--nf-muted);
    font-variant-numeric: tabular-nums;
  }

  .nf-an-chart-legend {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .nf-an-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 650;
    color: var(--nf-muted);
  }

  .nf-an-chart-legend-item > i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
  }

  .nf-an-chart-range {
    margin-left: auto;
  }

  .nf-an-chart-wrap.is-zoomed .nf-an-chart-range {
    margin-left: 0;
  }

  .nf-an-chart-reset {
    margin-left: auto;
    border: 0;
    border-radius: 999px;
    padding: 4px 10px;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--nf-ink);
    background: color-mix(in srgb, var(--nf-ink) 8%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .nf-an-chart-reset:active {
    opacity: 0.75;
  }

  .nf-an-chart-zoom-x,
  .nf-an-chart-zoom-y {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: ew-resize;
    touch-action: none;
    --nf-zoom: 0%;
    --nf-zoom-fill: color-mix(in srgb, var(--nf-ink) 12%, transparent);
    --nf-zoom-track: color-mix(in srgb, var(--nf-border) 50%, transparent);
    background: transparent;
  }

  .nf-an-chart-zoom-x {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
  }

  .nf-an-chart-zoom-y {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 214px;
    /* After -90deg this becomes the full visual width of the sum rail. */
    height: 3.6em;
    z-index: 2;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center center;
    cursor: ns-resize;
  }

  .nf-an-chart-zoom-x::-webkit-slider-runnable-track,
  .nf-an-chart-zoom-y::-webkit-slider-runnable-track {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(
      to right,
      var(--nf-zoom-fill) 0%,
      var(--nf-zoom-fill) var(--nf-zoom),
      var(--nf-zoom-track) var(--nf-zoom),
      var(--nf-zoom-track) 100%
    );
  }

  .nf-an-chart-zoom-x::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 22px;
    margin-top: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nf-ink) 26%, transparent);
  }

  /* Thumb spans full sum-rail width (input height before rotate). */
  .nf-an-chart-zoom-y::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 3.6em;
    margin-top: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nf-ink) 26%, transparent);
  }

  .nf-an-chart-zoom-x::-moz-range-track,
  .nf-an-chart-zoom-y::-moz-range-track {
    height: 100%;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(
      to right,
      var(--nf-zoom-fill) 0%,
      var(--nf-zoom-fill) var(--nf-zoom),
      var(--nf-zoom-track) var(--nf-zoom),
      var(--nf-zoom-track) 100%
    );
  }

  .nf-an-chart-zoom-x::-moz-range-thumb {
    width: 18px;
    height: 22px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nf-ink) 26%, transparent);
  }

  .nf-an-chart-zoom-y::-moz-range-thumb {
    width: 16px;
    height: 3.6em;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nf-ink) 26%, transparent);
  }

  .nf-an-donut-wrap {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .nf-an-donut-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Balance: two separate surface blocks, not one shared tray. */
  .nf-an-donut-card:has(.nf-an-donut-pair) {
    padding: 0;
    background: transparent;
    border: 0;
  }

  .nf-an-donut-pair > .nf-an-donut {
    padding: 12px 10px 10px;
    border-radius: 16px;
    background: var(--nf-card);
    border: 1px solid var(--nf-border);
    box-sizing: border-box;
  }

  .nf-an-donut-title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nf-muted);
    text-align: center;
  }

  .nf-an-donut-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .nf-an-donut.is-split .nf-an-donut-body {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .nf-an-donut-pair .nf-an-donut-body {
    gap: 8px;
  }

  .nf-an-donut-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
  }

  .nf-an-donut-ring {
    position: relative;
    width: 100px;
    height: 100px;
    flex: 0 0 auto;
  }

  .nf-an-donut.is-split .nf-an-donut-ring {
    width: 112px;
    height: 112px;
  }

  .nf-an-donut.is-split .nf-an-donut-ring svg {
    width: 112px;
    height: 112px;
  }

  .nf-an-donut-pair .nf-an-donut-ring {
    width: 88px;
    height: 88px;
  }

  .nf-an-donut-pair .nf-an-donut-ring svg {
    width: 88px;
    height: 88px;
  }

  .nf-an-donut-total {
    margin: 0;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: -0.01em;
    color: var(--nf-ink);
    font-variant-numeric: tabular-nums;
    text-align: center;
    line-height: 1.2;
  }

  .nf-an-donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .nf-an-donut.is-split .nf-an-donut-legend {
    flex: 1 1 auto;
    min-width: 0;
  }

  .nf-an-donut-legend > li {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px 7px;
    font-size: 11px;
    font-weight: 650;
    color: var(--nf-muted);
    font-variant-numeric: tabular-nums;
  }

  .nf-an-donut-legend > li > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
  }

  .nf-an-donut-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--nf-ink);
  }

  .nf-an-donut-amt {
    color: var(--nf-ink);
    font-weight: 700;
    white-space: nowrap;
  }

  .nf-an-donut-pct {
    color: var(--nf-muted);
    min-width: 2.4em;
    text-align: right;
  }

  @media (max-width: 360px) {
    .nf-an-donut-pair {
      grid-template-columns: 1fr;
    }

    .nf-an-donut.is-split .nf-an-donut-body {
      flex-direction: column-reverse;
    }
  }

  .nf-an-health {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .nf-an-health-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 8px;
    border-radius: 14px;
    border: 1px solid var(--nf-border);
    background: var(--nf-card);
    text-align: center;
  }

  .nf-an-health-chip strong {
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--nf-ink);
  }

  .nf-an-health-chip span {
    font-size: 11px;
    font-weight: 650;
    color: var(--nf-muted);
    line-height: 1.2;
  }

  .nf-an-health-chip.is-over strong {
    color: var(--nf-danger);
  }

  .nf-an-health-chip.is-ok strong {
    color: #2f8f28;
  }

  .nf-an-health-chip.is-under strong {
    color: var(--nf-muted);
  }

  .nf-an-top {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .nf-an-top-meta,
  .nf-an-top-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
  }

  .nf-an-top-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--nf-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nf-an-top-amt {
    font-size: 13px;
    font-weight: 750;
    color: var(--nf-ink);
    flex: 0 0 auto;
  }

  /* Same 3px thickness as home shared progress (#overall-split-dock) */
  .nf-an-top-track {
    margin: 6px 0 4px;
    height: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--nf-border) 70%, var(--nf-card));
    overflow: hidden;
  }

  .nf-an-top-fill {
    height: 3px;
    min-height: 3px;
    border-radius: inherit;
    background: var(--nf-green);
    transition: width 220ms ease;
  }

  .nf-an-top-foot {
    font-size: 11.5px;
    font-weight: 650;
    color: var(--nf-muted);
  }

  .nf-an-balance-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .nf-an-balance-cell {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--nf-border);
    background: var(--nf-card);
  }

  .nf-an-balance-cell span {
    font-size: 13px;
    font-weight: 650;
    color: var(--nf-muted);
  }

  .nf-an-balance-cell strong {
    font-size: 15px;
    font-weight: 750;
    color: var(--nf-ink);
  }

  .nf-an-balance-cell.is-income strong {
    color: #2aa8a0;
  }

  .nf-an-balance-cell.is-good strong {
    color: #2f8f28;
  }

  .nf-an-balance-cell.is-bad strong {
    color: var(--nf-danger);
  }

  .nf-an-empty {
    margin: 28px 8px;
    text-align: center;
    color: var(--nf-muted);
    font-size: 14px;
    font-weight: 650;
  }

  /* Stats item lives in profile; Analytics dock covers it on mobile */
  #btn-open-stats {
    display: none !important;
  }

  .money-settings-page .money-sidebar-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 4px 8px 14px;
  }

  .money-settings-page .money-avatar {
    width: 84px;
    height: 84px;
    font-size: 28px;
  }

  .money-settings-page .money-profile-meta {
    width: 100%;
  }

  .money-settings-page .money-profile-name {
    font-size: 20px;
    font-weight: 750;
    white-space: normal;
  }

  .money-settings-page .money-profile-email {
    font-size: 13px;
    margin-top: 4px;
    white-space: normal;
  }

  .money-settings-page .money-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 0;
  }

  .money-settings-page .money-sidebar-group {
    gap: 8px;
  }

  .money-settings-page .money-nav-item {
    padding: 14px 14px;
    border-radius: 16px;
  }

  .money-settings-page .money-sidebar-foot {
    margin-top: 14px;
    padding: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    justify-content: flex-start;
    border-top: 1px solid var(--nf-border);
  }

  .money-settings-page .money-nav-item--logout {
    margin-top: 4px;
  }

  /* Profile / Analytics: hide budget foot/skel (header+progress slide via chrome transform) */
  html[data-home-tab='profile'] #overall-split-top,
  html[data-home-tab='profile'] .money-cats-foot,
  html[data-home-tab='profile'] .money-skel-list,
  html[data-home-tab='analytics'] #overall-split-top,
  html[data-home-tab='analytics'] .money-cats-foot,
  html[data-home-tab='analytics'] .money-skel-list,
  html[data-home-tab='settings'] #overall-split-top,
  html[data-home-tab='settings'] .money-cats-foot,
  html[data-home-tab='settings'] .money-skel-list {
    display: none !important;
  }

  /* Drawer unused on mobile — content lives in pager */
  .money-sidebar,
  .money-backdrop#menu-backdrop {
    display: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .money-dock-item,
    .money-dock-item .money-dock-icon,
    .money-dock-item .money-dock-label,
    .money-dock-bg.is-animated,
    .money-home-pager-track.is-animated,
    .nf-an-pager-track.is-animated,
    .nf-an-seg-pill.is-animated,
    .nf-an-chrome.is-animated,
    .money-budget-chrome.is-animated {
      transition: none !important;
    }
  }

  .money-dock-profile {
    cursor: pointer;
    pointer-events: auto;
  }

  .money-dock-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #7cbc6e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .money-dock-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--nf-ink);
  }

  .money-dock-label {
    font-size: 11px;
    font-weight: 650;
    line-height: 1.1;
    color: #111111;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
  }

  /* Workspace popup full-screen on mobile */
  .money-modal-root {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .money-modal-root .money-modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  /* Category edit/create = full sheet on mobile (same chrome as bulk) */
  #category-modal .money-bulk-sheet-scroll {
    gap: 12px;
    padding-top: 8px;
  }

  /* .money-field { flex:1 } was stretching fields → huge empty gaps */
  #category-modal .money-field {
    flex: 0 0 auto;
    width: 100%;
  }

  #category-modal .money-field input {
    border: 1px solid #dde2dd;
    border-radius: 10px;
    padding: 11px 12px;
  }

  #category-modal .money-field input:focus {
    outline: none;
    border-color: #3391ce;
    box-shadow: 0 0 0 3px rgba(51, 145, 206, 0.18);
  }

  #category-modal .money-cat-edit-foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #category-modal .money-cat-edit-foot .money-chip {
    width: 100%;
    justify-content: center;
  }

  #category-modal.is-ctx,
  #tx-edit-modal.is-ctx {
    padding: 0;
    align-items: flex-start;
    justify-content: flex-start;
  }

  #category-modal.is-ctx .money-modal,
  #tx-edit-modal.is-ctx .money-modal {
    width: min(320px, calc(100vw - 16px));
    height: auto;
    max-height: min(72vh, 520px);
    border-radius: 12px;
  }

  .money-pane-detail {
    position: absolute;
    inset: 0;
    z-index: 40; /* above home dock so expenses cover it */
    height: 100% !important;
    min-height: 100% !important;
    max-height: none;
    width: 100%;
    max-width: 100%;
    background-color: #8ab692;
    isolation: isolate;
    overflow: hidden; /* clip gradient — else blur/scale creates horizontal scroll */
    touch-action: pan-y;
    /* Off-screen solid — no fade (fade mid-slide looks cheap / “from the middle”) */
    transform: translate3d(100%, 0, 0);
    opacity: 1;
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      visibility 0s linear 0.4s;
  }

  .money-pane-detail::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #8ab692;
    background-image:
      radial-gradient(at 15% 15%, #e1ea9e 0px, transparent 55%),
      radial-gradient(at 25% 80%, #51937a 0px, transparent 60%),
      radial-gradient(at 85% 85%, #dbe4c6 0px, transparent 50%),
      radial-gradient(at 85% 15%, #7ea886 0px, transparent 50%);
    filter: blur(20px);
    transform: scale(1.15);
    transform-origin: center center;
  }

  .money-pane-detail > * {
    position: relative;
    z-index: 1;
  }

  /*
   * Settled detail must use transform:none — any transform (even 0,0,0) makes
   * position:fixed descendants stick to the pane and scroll with expenses.
   */
  .money-shell[data-view='detail'] .money-pane-detail {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      visibility 0s;
  }

  /* Enter: opaque push from the right, fast→slow (ease-out) */
  .money-shell.is-entering-detail[data-view='detail'] .money-pane-detail {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: -12px 0 32px rgba(20, 35, 26, 0.18);
    transition:
      transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      visibility 0s;
  }

  .money-shell[data-view='detail'] .money-pane-cats {
    pointer-events: none;
  }

  /*
   * Leave: slide only — do NOT fade opacity. Fading made home dock/progress
   * flash through the sheet mid-dismiss (esp. when list was scrolled).
   */
  .money-shell.is-leaving-detail .money-pane-detail {
    transform: translate3d(100%, 0, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    box-shadow: none;
    transition:
      transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.22s;
  }

  .money-shell.no-pane-anim .money-pane-detail {
    transition: none !important;
  }

  /* Dim categories behind the expenses sheet while swiping it away */
  .money-detail-swipe-scrim {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 39; /* under .money-pane-detail (40) */
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(20, 35, 26, 0.42);
    pointer-events: none;
    opacity: 0;
  }

  .money-shell.is-swipe-chrome .money-detail-swipe-scrim {
    display: block;
  }

  /* Tiny home zoom while swiping the expenses sheet away (content only, not FAB) */
  .money-shell.is-swipe-chrome .money-pane-cats-main {
    transform-origin: 50% 45%;
    will-change: transform;
    pointer-events: none;
  }

  /* Rounded left edge only while the sheet is being dragged / finishing swipe */
  .money-shell.is-swipe-chrome .money-pane-detail {
    border-radius: 18px 0 0 18px;
    overflow: hidden;
    box-shadow: -12px 0 32px rgba(20, 35, 26, 0.18);
  }

  /* Interactive slide-to-dismiss: follow the finger */
  .money-shell.is-swiping-detail .money-pane-detail {
    transition: none !important;
    will-change: transform;
  }

  @media (prefers-reduced-motion: reduce) {
    .money-pane-detail,
    .money-shell[data-view='detail'] .money-pane-detail,
    .money-shell.is-entering-detail[data-view='detail'] .money-pane-detail,
    .money-shell.is-leaving-detail .money-pane-detail {
      transition: none !important;
    }
  }

  .money-detail-chrome:not([hidden]) {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 37;
    padding: 10px 12px 8px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    /* was: overflow:hidden — clipped the veil’s transparent tip */
    overflow: visible;
    background: transparent;
    pointer-events: none;
  }

  /* Top veil — controls stay fully opaque */
  .money-detail-chrome:not([hidden])::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    /* Extend past chrome so gradient can reach alpha 0 below the header */
    height: calc(100% + 52px);
    z-index: 0;
    pointer-events: none;
    /*
     * Semi at top → fully clear at bottom (must not be clipped by parent).
     * was: 0.9 → 0.5@34% → 0.16@68% → clear@100%
     */
    background-image: linear-gradient(
      180deg,
      rgba(200, 219, 154, 0.9) 0%,
      rgba(160, 196, 150, 0.45) 40%,
      rgba(138, 182, 146, 0.12) 72%,
      transparent 100%
    );
    -webkit-mask-image: none;
    mask-image: none;
  }

  .money-detail-chrome:not([hidden]) .money-detail-top {
    position: relative;
    z-index: 1;
  }

  .money-detail-chrome:not([hidden]) .money-detail-back,
  .money-detail-chrome:not([hidden]) .money-detail-edit,
  .money-detail-chrome:not([hidden]) .money-detail-archive {
    pointer-events: auto;
    background: #f3f5f3;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 1px 3px rgba(20, 35, 26, 0.08);
    opacity: 1;
    width: 42px;
    height: 42px;
  }

  .money-detail-chrome:not([hidden]) .money-detail-actions {
    pointer-events: none;
  }

  .money-detail-chrome:not([hidden]) .money-detail-actions .money-detail-edit,
  .money-detail-chrome:not([hidden]) .money-detail-actions .money-detail-archive {
    pointer-events: auto;
  }

  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-actions {
    background: #f3f5f3;
    box-shadow: 0 1px 3px rgba(20, 35, 26, 0.08);
    border-radius: 999px;
    padding: 0 2px;
    gap: 0;
    height: 42px;
  }

  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-actions .money-detail-edit,
  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-actions .money-detail-archive {
    background: transparent;
    box-shadow: none;
    width: 40px;
    height: 40px;
  }

  .money-detail-chrome:not([hidden]) .money-ico-back {
    font-size: 22px;
    font-weight: 700;
  }

  .money-detail-chrome:not([hidden]) .money-ico-more {
    width: 22px;
    height: 22px;
  }

  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-select-count {
    font-size: 15.5px;
    font-weight: 600;
  }

  .money-detail-chrome:not([hidden]) .money-detail-heading {
    background: #f3f5f3;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 1px 3px rgba(20, 35, 26, 0.08);
    opacity: 1;
    height: 42px;
    padding: 0 12px 0 0;
    gap: 5px;
  }

  /* Same inset L/T/B: 41px ring (−6%) in 42px pill */
  .money-detail-chrome:not([hidden]) .money-detail-ring {
    flex-basis: 41px;
    width: 41px;
    height: 41px;
    margin-left: -1px;
  }

  .money-detail-chrome:not([hidden]) .money-detail-ring .money-ring-pct {
    font-size: 9px;
  }

  .money-detail-chrome:not([hidden]) .money-detail-heading-text {
    gap: 2px;
    padding-bottom: 2px;
  }

  .money-detail-chrome:not([hidden]) .money-detail-title {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.12;
    text-align: left;
  }

  .money-detail-chrome:not([hidden]) .money-detail-figures {
    font-size: 11.5px;
    font-weight: 500;
  }

  .money-detail-scroll .money-tx-row {
    position: relative;
    overflow: visible;
    align-self: flex-start;
    margin-left: 3px;
    margin-right: auto;
    width: 90%;
    max-width: 90%;
    box-sizing: border-box;
    background: #f1ffe0;
    border-radius: 16px;
    border-color: transparent;
    /*
     * Soft shadow — strong drop-shadow + subpixel Y on mobile makes the
     * tail/bubble join look ±1px off on different rows.
     */
    box-shadow: none;
    filter: drop-shadow(0 1px 1px rgb(0 0 0 / 8%));
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .money-detail-scroll .money-tx-row.is-tx-cluster-cont {
    margin-top: -2px;
  }

  .money-detail-scroll .money-tx-row.is-tx-cluster-break {
    margin-top: 6px;
  }

  .money-detail-scroll .money-tx-row.is-author-gap.is-tx-cluster-break {
    margin-top: 12px;
  }

  .money-detail-scroll .money-tx-row.is-tx-cluster-cont.is-tx-cluster-break {
    margin-top: -2px;
  }

  /*
   * Cluster corners (mobile): first keeps large TL + soft BL (6px).
   * Middles: both left corners = that soft BL. Last+tail: soft TL, sharp BL.
   */
  .money-detail-scroll .money-tx-row.is-tx-cluster-mid {
    border-radius: 16px 16px 16px 6px;
  }

  .money-detail-scroll .money-tx-row.is-tx-cluster-mid.is-tx-cluster-cont {
    border-radius: 6px 16px 16px 6px;
  }

  .money-detail-scroll .money-tx-row.has-tx-tail {
    border-radius: 16px 16px 16px 0;
  }

  .money-detail-scroll .money-tx-row.has-tx-tail.is-tx-cluster-cont {
    border-radius: 6px 16px 16px 0;
  }

  /*
   * Sharp tail with 1px overlap into the bubble (left: -9) so subpixel
   * rounding can't open a seam or a step on some rows.
   */
  .money-detail-scroll .money-tx-row.has-tx-tail::before {
    content: '';
    position: absolute;
    left: -9px;
    bottom: -1px;
    width: 10px;
    height: 14px;
    background: #f1ffe0;
    clip-path: path('M 10 0 C 10 7 7 14 0 14 L 10 14 Z');
    pointer-events: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .money-detail-scroll .money-tx-row.is-unread {
    background: #dff0ff;
  }

  .money-detail-scroll .money-tx-row.is-unread.has-tx-tail::before {
    background: #dff0ff;
  }

  /*
   * ≤1200 chat layout (mobile): own expenses right / others left.
   * Mirror radii, tail, select check gutter; light mine = white.
   */
  .money-detail-scroll .money-tx-row.is-tx-mine {
    align-self: flex-end;
    margin-left: auto;
    margin-right: 3px;
    background: #ffffff;
  }

  .money-detail-scroll .money-tx-row.is-tx-mine.is-tx-cluster-mid {
    border-radius: 16px 16px 6px 16px;
  }

  .money-detail-scroll .money-tx-row.is-tx-mine.is-tx-cluster-mid.is-tx-cluster-cont {
    border-radius: 16px 6px 6px 16px;
  }

  .money-detail-scroll .money-tx-row.is-tx-mine.has-tx-tail {
    border-radius: 16px 16px 0 16px;
  }

  .money-detail-scroll .money-tx-row.is-tx-mine.has-tx-tail.is-tx-cluster-cont {
    border-radius: 16px 6px 0 16px;
  }

  .money-detail-scroll .money-tx-row.is-tx-mine.has-tx-tail::before {
    left: auto;
    right: -9px;
    background: #ffffff;
    clip-path: path('M 0 0 C 0 7 3 14 10 14 L 0 14 Z');
  }

  .money-detail-scroll .money-tx-row.is-tx-mine.is-selected {
    background: #f3f7f0;
  }

  .money-detail-scroll .money-tx-row.is-tx-mine.is-selected.has-tx-tail::before {
    background: #f3f7f0;
  }

  html.nf-tx-select .money-detail-scroll .money-tx-row.is-tx-mine .money-tx-check {
    left: -34px;
    right: auto;
  }

  .money-detail-scroll .money-tx-day {
    background: transparent;
    box-shadow: none;
  }

  .money-detail-body#detail-active:not([hidden]) {
    background: transparent;
  }

  /*
   * Detail: single scroll container (.money-detail-scroll).
   * Nested body+pane scroll caused sticky/janky vertical scrolling.
   */
  html.money-vv-lock,
  html.money-vv-lock body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  /*
   * Detail: freeze document scroll, but do NOT collapse body/shell to 100dvh.
   * Collapsing clipped the home list to the top of the page (visible during
   * enter/leave). Expenses sheet is position:fixed to the viewport anyway.
   */
  .money-body.detail-open {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
  }

  html:has(.money-body.detail-open) {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .money-body.detail-open .money-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    max-height: none;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  /*
   * Fixed sheet covers dock (z35) + FAB (z36) without raising .money-shell —
   * raising shell caused the dock to jump on swipe-back dismiss.
   */
  .money-body.detail-open .money-pane-detail {
    position: fixed;
    inset: 0;
    z-index: 40;
    flex: 1 1 auto;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 0;
    gap: 0;
  }

  /* Slide expenses over the add-picker (z55), then picker closes underneath */
  html.nf-add-picker .money-body.detail-open .money-pane-detail {
    z-index: 60;
  }

  html.nf-add-picker .money-body.detail-open .money-detail-swipe-scrim {
    z-index: 59;
  }

  .money-body.detail-open .money-detail-swipe-scrim {
    position: fixed;
    z-index: 39;
  }

  .money-body.detail-open .money-detail-body#detail-active:not([hidden]) {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
  }

  .money-body.detail-open .money-detail-scroll {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    /* Room under floating input pill — txs scroll underneath */
    padding: 64px 12px calc(96px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    box-sizing: border-box;
  }

  /* Hide list until pinned to bottom — avoids flash of top + scroll jump */
  .money-body.detail-open .money-detail-scroll.is-tx-pending {
    visibility: hidden;
  }

  /* Keep chrome above list even if > * { position: relative } wins elsewhere */
  .money-body.detail-open .money-detail-chrome:not([hidden]) {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 37;
    flex-shrink: 0;
  }

  .money-body.detail-open .money-detail-scroll .money-list {
    width: 100%;
    max-width: none;
    align-self: stretch;
    margin-top: 0;
  }

  .money-body.detail-open .money-detail-scroll:has(#tx-empty:not([hidden])) {
    justify-content: center;
    min-height: 30vh;
  }

  /* Floating pill over the list (txs scroll underneath) */
  .money-body.detail-open .money-form-line {
    position: fixed;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100% - 24px);
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 36;
    flex-shrink: 0;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0;
    /* was: 2px 2px 2px 14px */
    padding: 2px 3px 2px 14px;
    border: none;
    border-radius: 999px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    box-sizing: border-box;
    overflow: visible;
  }

  /* Full-bleed fade under the pill (tall enough for multi-line composer) */
  .money-body.detail-open .money-form-line::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(-10px - env(safe-area-inset-bottom, 0px));
    width: 100vw;
    /* was: 140px — a bit shorter so it doesn’t climb the list */
    height: calc(118px + env(safe-area-inset-bottom, 0px));
    margin-left: -50vw;
    z-index: 0;
    pointer-events: none;
    background-image: linear-gradient(
      90deg,
      rgba(126, 168, 134, 0.88) 0%,
      rgba(138, 182, 146, 0.88) 28%,
      rgba(81, 147, 122, 0.82) 72%,
      rgba(100, 160, 130, 0.86) 100%
    );
    -webkit-mask-image: linear-gradient(
      0deg,
      #000 0%,
      #000 40%,
      rgba(0, 0, 0, 0.5) 70%,
      transparent 100%
    );
    mask-image: linear-gradient(
      0deg,
      #000 0%,
      #000 40%,
      rgba(0, 0, 0, 0.5) 70%,
      transparent 100%
    );
  }

  /* White pill surface above the veil */
  .money-body.detail-open .money-form-line::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 999px;
    background: #fff;
    /* Pixel frame 1px: top a bit darker than bottom */
    box-shadow:
      0 -1px 0 0 rgba(20, 35, 26, 0.18),
      0 1px 0 0 rgba(20, 35, 26, 0.12);
    pointer-events: none;
  }

  .money-body.detail-open .money-form-line .money-exp-field,
  .money-body.detail-open .money-form-line #exp-line,
  .money-body.detail-open .money-form-line .money-exp-cal,
  .money-body.detail-open .money-btn-send {
    position: relative;
    z-index: 2;
  }

  /* Calendar visible: shrink left pad to match top/bottom (was 14px for text-only). */
  .money-body.detail-open .money-form-line.is-advanced-open {
    padding-left: 2px;
  }

  /* Match send button height (40px) so top/bottom gaps match the left inset. */
  .money-body.detail-open .money-form-line .money-exp-cal {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin: 0;
  }

  .money-body.detail-open .money-form-line .money-exp-field {
    flex: 1 1 auto;
    min-width: 0;
    align-self: stretch;
  }

  /* Overlay placeholder — native textarea placeholder sits low / leaves a band */
  .money-body.detail-open .money-form-line .money-exp-ph {
    display: flex;
    align-items: center;
    position: absolute;
    left: 0;
    right: 6px;
    top: 0;
    bottom: 0;
    z-index: 1;
    margin: 0;
    padding: 0;
    font: inherit;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.25;
    color: var(--nf-muted, #7a8a7e);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
  }

  .money-body.detail-open .money-form-line.has-exp-value .money-exp-ph,
  .money-body.detail-open .money-form-line:focus-within .money-exp-ph {
    display: none;
  }

  .money-body.detail-open .money-form-line #exp-line::placeholder {
    color: transparent;
    opacity: 0;
  }

  .money-body.detail-open .money-form-line #exp-line {
    border: none;
    border-radius: 0;
    outline: none;
    background: transparent;
    /* Single-line: line-height = height (no vert padding) so placeholder isn't low */
    padding: 0 6px 0 0;
    font-size: 16px;
    line-height: 40px;
    min-height: 40px;
    height: 40px;
    max-height: calc(20px * 5 + 20px);
    overflow-x: hidden;
    overflow-y: hidden;
    box-shadow: none;
    -webkit-box-shadow: none;
  }

  .money-body.detail-open .money-form-line #exp-line.is-multiline {
    padding: 10px 6px 10px 0;
    line-height: 20px;
    overflow-y: auto;
    height: auto;
  }

  .money-body.detail-open .money-form-line #exp-line::placeholder {
    line-height: 40px;
    opacity: 1;
  }

  .money-body.detail-open .money-form-line #exp-line.is-multiline::placeholder {
    line-height: 20px;
  }

  .money-body.detail-open .money-form-line #exp-line:focus {
    outline: none;
    background: transparent;
    box-shadow: none;
  }

  .money-body.detail-open .money-btn-send {
    border-radius: 999px;
    width: 40px;
    height: 40px;
    font-size: 19px;
    flex-shrink: 0;
  }

  .money-body.detail-open .money-form-line .money-msg {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: calc(100% + 8px);
    z-index: 2;
    flex: none;
    margin: 0;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(20, 35, 26, 0.1);
  }

  .money-body.detail-open.kb-open .money-form-line::before {
    bottom: calc(-8px - env(safe-area-inset-bottom, 0px));
    height: calc(48px + env(safe-area-inset-bottom, 0px));
  }

  /* Keyboard: pin shell to visualViewport; floating pill stays above list */
  .money-body.detail-open.kb-open {
    position: fixed;
    top: var(--vvtop, 0px);
    left: 0;
    right: 0;
    height: var(--vvh, 100dvh);
    max-height: var(--vvh, 100dvh);
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .money-body.detail-open.kb-open .money-shell {
    height: 100% !important;
    max-height: 100%;
    overflow: hidden;
  }

  /*
   * While keyboard is open body is position:fixed to the visual viewport.
   * Keep chrome as absolute inside that shell — viewport-fixed top:0 would
   * sit above the visible area (looks like the header vanished).
   */
  .money-body.detail-open.kb-open .money-detail-chrome:not([hidden]) {
    display: flex !important;
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 37;
  }

  .money-body.detail-open.kb-open .money-shell,
  .money-body.detail-open.kb-open .money-pane-detail,
  .money-body.detail-open.kb-open .money-detail-body#detail-active:not([hidden]) {
    min-height: 0 !important;
    overflow: hidden;
    height: auto !important;
  }

  .money-body.detail-open.kb-open .money-detail-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-top: 64px;
    /* Same bottom pad as closed KB — txs keep scrolling under the floating pill */
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  /*
   * Keep pill floating over the list while KB is open.
   * absolute (not relative) inside the fixed VV shell — sits above keyboard
   * but does not clip/dock the scroll content.
   */
  .money-body.detail-open.kb-open .money-form-line {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    width: auto;
    max-width: none;
    margin: 0;
  }

  .money-body.detail-open.kb-open .money-form-line::before {
    bottom: -10px;
  }
}

/* Desktop: two columns + resizable cats */
@media (min-width: 860px) {
  .money-body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  /* Left square tabs: Expenses / Incomes — under sidebar */
  .money-home-mode-rail {
    --money-mode-rail: 90px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--money-mode-rail);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    z-index: 12;
    background: #dfe6e2; /* darker than page --nf-bg */
    pointer-events: none;
  }

  .money-home-mode-rail .money-home-mode-tab {
    pointer-events: auto;
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  /* Header + cats column sit 90px to the right of the rail */
  .money-shell {
    height: 100%;
    overflow: hidden;
    flex-direction: row;
    align-items: stretch;
    margin-left: 90px;
    width: calc(100% - 90px);
    box-sizing: border-box;
  }

  .money-pane-cats {
    flex: 0 0 var(--cats-width, 36%);
    width: var(--cats-width, 36%);
    max-width: 70%;
    min-width: 22%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }

  /* PC: no horizontal pager — toggle pages via display */
  .money-home-pager {
    overflow: visible;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .money-home-pager-track {
    display: block;
    width: 100%;
    transform: none !important;
    transition: none !important;
    flex: 1 1 auto;
    min-height: 0;
  }

  .money-home-page {
    width: 100%;
    max-width: none;
    flex: none;
    height: 100%;
    min-height: 0;
  }

  .money-home-page[data-home-page='income'],
  .money-home-page[data-home-page='analytics'],
  .money-home-page[data-home-page='profile'],
  .money-home-page[data-home-page='settings'] {
    display: none;
  }

  html[data-home-mode='income'] .money-home-page[data-home-page='expense'] {
    display: none;
  }

  html[data-home-mode='income'] .money-home-page[data-home-page='income'] {
    display: block;
  }

  /* PC keeps the real sidebar drawer (undo mobile hide) */
  .money-sidebar {
    display: flex !important;
  }

  .money-backdrop#menu-backdrop {
    display: block;
  }

  .money-backdrop#menu-backdrop[hidden] {
    display: none !important;
  }

  /*
   * Header + shared progress sit in the left column (mounted via
   * syncLayoutMode / early inline script). Mobile keeps body-level fixed.
   */
  .money-pane-cats > .money-top {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
    z-index: 5;
    border-bottom: 1px solid var(--nf-border);
  }

  .money-pane-cats > .money-top #overall-split-top,
  .money-pane-cats > .money-top .money-range-progress-top {
    display: flex;
    width: 100%;
    margin: 4px 0 2px;
    padding: 0 2px;
  }

  .money-pane-cats > .money-top #overall-split-top .money-range-progress-top {
    margin: 0;
    padding: 0;
  }

  .money-pane-cats-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .money-pane-cats .money-skel-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 4px 0 16px;
  }

  .money-pane-cats .money-skel-ring {
    flex-basis: 65px;
    width: 65px;
    height: 65px;
  }

  .money-pane-cats .money-skel-line-title {
    height: 14px;
  }

  .money-splitter {
    display: block;
  }

  .money-pane-detail {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    padding: 0;
    background-color: #8ab692;
    isolation: isolate;
  }

  .money-pane-detail::before {
    content: '';
    position: absolute;
    inset: -12%;
    z-index: 0;
    pointer-events: none;
    background-color: #8ab692;
    background-image:
      radial-gradient(at 15% 15%, #e1ea9e 0px, transparent 55%),
      radial-gradient(at 25% 80%, #51937a 0px, transparent 60%),
      radial-gradient(at 85% 85%, #dbe4c6 0px, transparent 50%),
      radial-gradient(at 85% 15%, #7ea886 0px, transparent 50%);
    filter: blur(20px);
    transform: scale(1.2);
  }

  .money-pane-detail > * {
    position: relative;
    z-index: 1;
  }

  .money-detail-body#detail-active:not([hidden]) {
    background: transparent;
  }

  /* PC category multi-select header (same chrome as mobile select bar) */
  .money-top.is-select-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .money-top.is-select-open > #btn-menu-open,
  .money-top.is-select-open > .money-cats-search,
  .money-top.is-select-open > .money-range-progress-top,
  .money-top.is-select-open > #overall-split-top,
  .money-top.is-select-open > .money-brand-bar {
    display: none !important;
  }

  .money-top.is-select-open > .money-cats-select {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 2px;
    background: #f3f5f3;
    border-radius: 10px;
  }

  .money-top.is-select-open .money-cats-select-cancel,
  .money-top.is-select-open .money-cats-select-archive,
  .money-top.is-select-open .money-cats-select-edit {
    width: 36px;
    height: 36px;
  }

  .money-top.is-select-open .money-cats-select-count {
    font-size: 14px;
  }

  /*
   * PC: show only the manage (edit) control from the brand bar —
   * between burger and search. Logo / ⋮ / search-toggle stay mobile-only.
   */
  .money-top {
    grid-template-columns: 44px auto minmax(0, 1fr);
  }

  .money-brand-bar {
    display: flex !important;
    align-items: center;
    height: auto;
    min-height: 0;
    gap: 0;
  }

  .money-brand-logo-wrap,
  .money-brand-bar .money-cats-search-toggle,
  .money-brand-bar .money-spaces-more-wrap {
    display: none !important;
  }

  .money-brand-actions {
    display: flex !important;
    align-items: center;
    gap: 6px;
  }

  .money-top-period {
    display: inline-flex;
    max-width: 200px;
  }

  .money-cats-manage {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 10px;
  }

  .money-top-chip-label {
    display: none;
  }

  .money-top.is-select-open > .money-brand-bar {
    display: none !important;
  }

  /* Select mode: progress receives taps (block/dismiss) instead of passing through */
  html.nf-cat-select .money-range-progress-dock {
    pointer-events: auto !important;
  }

  .money-detail-scroll,
  .money-detail-body#detail-empty {
    /* top = bottom: 14px scroll + 8px list */
    padding: 14px 18px !important;
  }

  .money-detail-scroll {
    align-items: flex-start;
  }

  .money-detail-scroll .money-list {
    width: min(440px, 100%);
    max-width: 440px;
    align-self: flex-start;
    margin-top: 0;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .money-detail-scroll .money-tx-row {
    position: relative;
    overflow: visible;
    margin-left: 3px;
    width: calc(100% - 3px);
    box-sizing: border-box;
    background: #f1ffe0;
    backdrop-filter: none;
    border-radius: 6px;
    border-color: transparent;
    /* drop-shadow follows bubble + tail silhouette (no bottom strip) */
    box-shadow: none !important;
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / 14%));
  }

  .money-detail-scroll .money-tx-row.is-tx-cluster-cont {
    margin-top: -2px;
  }

  .money-detail-scroll .money-tx-row.is-tx-cluster-break {
    margin-top: 6px;
  }

  .money-detail-scroll .money-tx-row.is-author-gap.is-tx-cluster-break {
    margin-top: 12px;
  }

  .money-detail-scroll .money-tx-row.is-tx-cluster-cont.is-tx-cluster-break {
    margin-top: -2px;
  }

  /* Cluster corners (desktop) — same logic as mobile, scaled to 6/2 */
  .money-detail-scroll .money-tx-row.is-tx-cluster-mid {
    border-radius: 6px 6px 6px 2px;
  }

  .money-detail-scroll .money-tx-row.is-tx-cluster-mid.is-tx-cluster-cont {
    border-radius: 2px 6px 6px 2px;
  }

  .money-detail-scroll .money-tx-row.has-tx-tail {
    border-radius: 6px 6px 6px 0;
  }

  .money-detail-scroll .money-tx-row.has-tx-tail.is-tx-cluster-cont {
    border-radius: 2px 6px 6px 0;
  }

  /* Sharp bubble tail */
  .money-detail-scroll .money-tx-row.has-tx-tail::before {
    content: '';
    position: absolute;
    left: -9px;
    bottom: -1px;
    width: 8px;
    height: 11px;
    background: #f1ffe0;
    clip-path: path('M 8 0 C 8 5.5 5.5 11 0 11 L 8 11 Z');
    pointer-events: none;
  }

  /*
   * 860–1200: same chat split as mobile (own right / others left).
   * >1200 keeps the default left-only desktop look above.
   */
  @media (max-width: 1200px) {
    .money-detail-scroll .money-tx-row.is-tx-mine {
      align-self: flex-end;
      margin-left: auto;
      margin-right: 3px;
      width: 90%;
      max-width: 90%;
      background: #ffffff;
    }

    .money-detail-scroll .money-tx-row.is-tx-mine.is-tx-cluster-mid {
      border-radius: 6px 6px 2px 6px;
    }

    .money-detail-scroll .money-tx-row.is-tx-mine.is-tx-cluster-mid.is-tx-cluster-cont {
      border-radius: 6px 2px 2px 6px;
    }

    .money-detail-scroll .money-tx-row.is-tx-mine.has-tx-tail {
      border-radius: 6px 6px 0 6px;
    }

    .money-detail-scroll .money-tx-row.is-tx-mine.has-tx-tail.is-tx-cluster-cont {
      border-radius: 6px 2px 0 6px;
    }

    .money-detail-scroll .money-tx-row.is-tx-mine.has-tx-tail::before {
      left: auto;
      right: -9px;
      background: #ffffff;
      clip-path: path('M 0 0 C 0 5.5 2.5 11 8 11 L 0 11 Z');
    }

    .money-detail-scroll .money-tx-row.is-tx-mine.is-selected {
      background: #f3f7f0;
    }

    .money-detail-scroll .money-tx-row.is-tx-mine.is-selected.has-tx-tail::before {
      background: #f3f7f0;
    }

    :is(html.nf-layout-pc, .money-body.layout-pc).nf-tx-select
      .money-detail-scroll
      .money-tx-row.is-tx-mine {
      width: 90%;
      max-width: 90%;
    }

    :is(html.nf-layout-pc, .money-body.layout-pc)
      .money-tx-row.is-tx-mine
      .money-tx-check {
      left: auto;
      right: -26px;
    }
  }

  .money-detail-scroll .money-tx-day {
    background: transparent;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .money-detail-scroll .money-tx-day-pill {
    background: rgba(20, 40, 28, 0.22);
  }

  .money-detail-scroll .money-empty-tx {
    margin: auto;
    align-self: center;
    text-align: center;
    color: #ffffff;
  }

  .money-detail-scroll:has(#tx-empty:not([hidden])) {
    justify-content: center;
    align-items: center;
  }

  /* Bottom bars: equal height — create category | expense line */
  .money-cats-foot {
    display: flex;
    align-items: stretch;
    min-height: 62px;
    padding: 0;
    box-sizing: border-box;
    border-top: 2px solid var(--nf-border);
  }

  .money-cats-foot .money-cats-create {
    width: 100%;
    min-height: 60px;
    margin: 0;
    padding: 0 14px;
    border: none;
    border-radius: 0;
    background: #fff;
    color: var(--nf-ink);
    font-size: 14px;
    font-weight: 600;
    box-shadow: none;
  }

  .money-cats-foot .money-cats-create:hover {
    border: none;
    background: #f5f5f5;
    color: var(--nf-ink);
  }

  .money-pane-detail .money-form-line {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 2px solid var(--nf-border);
    border-radius: 0;
    min-height: 62px;
    padding: 0 12px;
    box-sizing: border-box;
    align-items: center;
  }

  .money-pane-detail .money-form-line .money-exp-cal {
    width: 40px;
    height: 40px;
  }

  .money-pane-detail .money-form-line #exp-line {
    border: none;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    padding: 12px 8px;
  }

  .money-pane-detail .money-form-line #exp-line:hover,
  .money-pane-detail .money-form-line #exp-line:focus,
  .money-pane-detail .money-form-line #exp-line:focus-visible,
  .money-pane-detail .money-form-line #exp-line:active {
    border: none;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
  }

  .money-pane-detail .money-btn-send {
    background: #3391ce;
    border-radius: 50%;
  }

  .money-pane-detail .money-btn-send:hover:not(:disabled) {
    background: #2d82b8;
  }

  .money-back {
    display: none !important;
  }

  /* Desktop detail chrome: solid white bar (no glass / no veil) */
  .money-detail-chrome {
    display: none;
  }

  .money-detail-chrome:not([hidden]) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 4;
    margin: 0;
    padding: 9px 14px;
    width: 100%;
    min-height: var(--nf-top);
    box-sizing: border-box;
    background: #ffffff;
    border-bottom: 2px solid var(--nf-border);
    pointer-events: auto;
  }

  .money-detail-chrome:not([hidden]) .money-detail-top {
    pointer-events: auto;
    min-height: 42px;
  }

  /* PC: both panes visible — back not needed (except select cancel) */
  .money-detail-chrome:not([hidden]) .money-detail-back {
    display: none !important;
  }

  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-back {
    display: inline-flex !important;
    background: #f3f5f3;
    box-shadow: none;
    border-radius: 10px;
  }

  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f3f5f3;
    border-radius: 10px;
    padding: 0 2px;
    height: 36px;
  }

  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-edit,
  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-archive {
    background: transparent;
    box-shadow: none;
    border-radius: 8px;
  }

  .money-detail-chrome:not([hidden]).is-tx-select .money-detail-heading {
    background: #f3f5f3;
    border-radius: 10px;
    padding: 0 12px;
    min-height: 36px;
  }

  .money-detail-chrome:not([hidden]) .money-detail-edit {
    background: #f3f5f3;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border-radius: 10px;
  }

  /*
   * PC select: shift list by circle width only (margin, not padding —
   * padding shrank bubbles and left a big empty gap on the right).
   */
  :is(html.nf-layout-pc, .money-body.layout-pc) .money-detail-scroll .money-list {
    transition: margin-left 0.15s ease;
    margin-left: 0;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc).nf-tx-select .money-detail-scroll .money-list {
    margin-left: 26px;
  }

  /* Don't shrink PC bubbles to 90% (that rule is for mobile right-gutter checks) */
  :is(html.nf-layout-pc, .money-body.layout-pc).nf-tx-select .money-detail-scroll .money-tx-row {
    width: calc(100% - 3px);
    max-width: none;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-tx-check {
    display: flex;
    left: -26px;
    right: auto;
    width: 26px;
    height: 26px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) scale(0.84);
    transition:
      opacity 0.15s ease,
      transform 0.15s ease,
      visibility 0.15s;
    pointer-events: none;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc).nf-tx-select .money-tx-check {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-tx-check svg {
    width: 20px;
    height: 20px;
  }

  .money-detail-chrome:not([hidden]) .money-detail-heading {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border-radius: 0;
    height: auto;
    min-height: 42px;
    padding: 0;
    gap: 10px;
  }

  .money-detail-chrome:not([hidden]) .money-detail-ring {
    display: none;
  }

  .money-detail-chrome:not([hidden]) .money-detail-title {
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1.15;
    text-align: left;
  }

  .money-detail-chrome:not([hidden]) .money-detail-figures {
    font-size: 12.5px;
  }

  /* Active category — blue row wash (PC), flat (no card). */
  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active {
    background: #3391ce;
    box-shadow: none;
    color: #fff;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-card {
    background: transparent;
    color: #fff;
    border: none;
    box-shadow: none;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active:hover .money-budget-card {
    background: transparent;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-drag {
    color: rgba(255, 255, 255, 0.75);
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-name,
  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .nm {
    color: #fff;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-meta {
    color: #e6eef4;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active.is-archived .nm::after {
    color: #d5e0e8;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-ring::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #fff;
    z-index: 0;
    pointer-events: none;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-ring-svg {
    position: relative;
    z-index: 1;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-ring .money-ring-pct {
    z-index: 3;
  }

  /* White disc behind ring → track/fill need contrast on white, not on blue */
  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-ring-track {
    stroke: rgba(20, 35, 26, 0.14);
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-ring-fill {
    /* keep progress color from inline style / paintBudgetRing */
    stroke: revert-layer;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-edit-btn {
    color: #e6eef4;
  }

  :is(html.nf-layout-pc, .money-body.layout-pc) .money-budget-row.is-active .money-budget-edit-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
  }
}

/* —— Mobile add-picker (FAB → full-screen) —— */
.money-add-picker,
.money-add-picker-swipe-scrim {
  display: none;
}

@media (max-width: 859px) {
  /* Dim home behind the add-picker sheet while swipe back */
  .money-add-picker-swipe-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 54; /* under .money-add-picker (55) */
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(20, 35, 26, 0.42);
    pointer-events: none;
    opacity: 0;
  }

  html.nf-add-picker-swipe .money-add-picker-swipe-scrim {
    display: block;
  }

  /* Tiny home zoom while swiping the add-picker away (content only, not FAB/dock) */
  html.nf-add-picker-swipe .money-pane-cats-main {
    transform-origin: 50% 45%;
    will-change: transform;
    pointer-events: none;
  }

  .money-add-picker {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: #f3f3f3;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 0
      calc(8px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Vertical scroll only — horizontal → JS swipe back (same as expenses) */
    touch-action: pan-y;
  }

  .money-add-picker[hidden] {
    display: none !important;
  }

  .money-add-picker-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 14px 4px 8px;
  }

  /* Same ↑ glyph as expense detail, but no pill background */
  .money-add-picker-back.money-detail-back {
    width: 42px;
    height: 42px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    flex: 0 0 auto;
  }

  .money-add-picker-back .money-ico-back {
    font-size: 22px;
    font-weight: 700;
  }

  .money-add-picker-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--nf-ink);
    line-height: 1.15;
  }

  .money-add-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin: 6px 14px 10px;
    height: 40px;
    padding: 0 12px 0 11px;
    border-radius: 999px;
    background: #fff;
    color: #9a9a9a;
  }

  .money-add-picker-search:focus-within {
    background: #fff;
  }

  .money-add-picker-actions {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    margin: 0 14px 10px;
    padding: 2px;
    border-radius: 14px;
    background: #fff;
    gap: 0;
  }

  .money-add-picker.is-searching .money-add-picker-actions {
    display: none;
  }

  .money-add-picker-action {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--nf-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .money-add-picker-action:active {
    background: rgba(70, 174, 55, 0.1);
  }

  .money-add-picker-action-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f3f3f3;
    color: var(--nf-green);
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    box-shadow: none;
    flex: 0 0 auto;
  }

  .money-add-picker-action-ico-space {
    color: var(--nf-ink);
  }

  .money-add-picker-action-label {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Categories grow with content — page scroll is on .money-add-picker */
  .money-add-picker-scroll {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    margin: 0 14px 8px;
    padding: 4px 0 6px;
    border-radius: 14px;
    background: #fff;
  }

  /* Kill dock spacer from .money-budgets mobile rule — dense list */
  .money-add-picker-list.money-budgets {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    margin: 0;
    padding: 0 4px;
    gap: 0;
    background: transparent;
  }

  .money-add-picker-list .money-budget-row {
    margin-left: 0;
  }

  .money-add-picker-list .money-budget-row:not(:has(.money-budget-drag)) .money-budget-card,
  .money-add-picker-list .money-budget-card {
    margin-left: 0;
    padding: 3px 8px 0 6px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-top: none;
  }

  /* No press / hover chrome on add-picker categories (shadow or inset frame) */
  .money-add-picker-list .money-budget-row:hover,
  .money-add-picker-list .money-budget-row:active,
  .money-add-picker-list .money-budget-row:focus,
  .money-add-picker-list .money-budget-row:focus-visible,
  .money-add-picker-list .money-budget-row.is-active,
  .money-add-picker-list .money-budget-row.is-active:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }

  .money-add-picker-list .money-budget-row:hover .money-budget-card,
  .money-add-picker-list .money-budget-row:active .money-budget-card,
  .money-add-picker-list .money-budget-row:focus .money-budget-card,
  .money-add-picker-list .money-budget-row.is-active .money-budget-card,
  .money-add-picker-list .money-budget-row.is-active:active .money-budget-card {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }

  .money-add-picker.is-swiping {
    transition: none !important;
    will-change: transform;
    border-radius: 18px 0 0 18px;
    box-shadow: -12px 0 32px rgba(20, 35, 26, 0.18);
    overflow: hidden;
  }

  .money-add-picker.is-leaving {
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .money-add-picker.is-swiping,
    .money-add-picker.is-leaving {
      transition: none !important;
      box-shadow: none;
      border-radius: 0;
    }
  }

  /* White disc inside progress rings */
  .money-add-picker-list .money-budget-ring::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #fff;
    z-index: 0;
    pointer-events: none;
  }

  .money-add-picker-list .money-budget-ring-svg {
    position: relative;
    z-index: 1;
  }

  .money-add-picker-list .money-budget-ring .money-ring-pct {
    z-index: 3;
  }

  .money-add-picker #add-picker-empty {
    margin: 18px 16px;
    text-align: center;
    color: var(--nf-muted);
    font-size: 14px;
  }

  /*
   * Cover FAB / dock with add-picker — keep mounted for swipe-back reveal.
   * Hiding them caused a jump vs expenses (dock stayed, FAB vanished).
   */
  html.nf-add-picker .money-cats-foot,
  html.nf-add-picker .money-dock,
  .money-body.add-picker-open .money-cats-foot,
  .money-body.add-picker-open .money-dock {
    pointer-events: none !important;
  }

  /*
   * Keep .money-dock-veil mounted under the + sheet (opaque cover hides it).
   * Hiding it used to pop the fade back in mid swipe-dismiss.
   */

  html.nf-add-picker .money-cats-foot .money-cats-create,
  html.nf-add-picker .money-dock-inner,
  html.nf-add-picker .money-range-progress-dock,
  .money-body.add-picker-open .money-cats-foot .money-cats-create,
  .money-body.add-picker-open .money-dock-inner,
  .money-body.add-picker-open .money-range-progress-dock {
    pointer-events: none !important;
  }

  /* —— Shared modal sheet swipe (same feel as expenses / add-picker) —— */
  /* Never paint an opaque veil on the root — sheet + backdrop only */
  .money-modal-root.is-swipe-chrome,
  .money-modal-root.is-leaving,
  .money-modal-root.is-swiping {
    background: transparent !important;
  }

  /* Horizontal pans → JS swipe; vertical stays native scroll (anywhere, not just edge) */
  .money-modal-root .money-modal,
  .money-modal-root .money-modal-body,
  .money-modal-root .money-bulk-sheet-scroll,
  .money-modal-root .money-bulk-hub,
  .money-modal-root .money-period-body,
  .money-modal-root .money-stats-body {
    touch-action: pan-y;
  }

  .money-add-picker-list,
  .money-add-picker-scroll,
  .money-body.detail-open .money-list {
    touch-action: pan-y;
  }

  .money-modal-root.is-swipe-chrome .money-modal {
    border-radius: 18px 0 0 18px;
    box-shadow: -12px 0 32px rgba(20, 35, 26, 0.18);
    overflow: hidden;
  }

  .money-modal.is-swiping-sheet {
    transition: none !important;
    will-change: transform;
  }

  .money-modal.is-leaving-sheet,
  .money-modal-root.is-leaving .money-modal {
    pointer-events: none;
  }

  html.nf-modal-swipe .money-pane-cats-main,
  html.nf-modal-swipe .money-pane-detail {
    transform-origin: 50% 45%;
    will-change: transform;
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .money-modal.is-swiping-sheet,
    .money-modal.is-leaving-sheet,
    .money-modal-root.is-swipe-chrome .money-modal {
      transition: none !important;
      box-shadow: none;
      border-radius: 0;
    }
  }
}
