/* UI7 Liquid Glass Night — dark, translucent, specular. iOS-style glass layers over
   a soft colour field. Presentation only: no data, schema or handler changes. */
body.ui7-theme {
  color-scheme: dark;
  --paper: #04060c;
  --ink: #ffffff;
  --secondary: #ebebf599;
  --muted: var(--secondary);
  --blue: #0a84ff;
  --blue-light: #64d2ff;
  --blue-press: #3b9cff;
  --blue-tint: #0a84ff33;
  --green: #30d158;
  --orange: #ff9f0a;
  --purple: #bf5af2;
  --pink: #ff375f;
  --teal: #64d2ff;
  --fill: #78788052;
  --glass: #ffffff14;
  --glass-strong: #ffffff1f;
  --glass-hi: #ffffff40;
  --glass-edge: #ffffff24;
  --accent: var(--blue);
  --accent-hover: var(--blue-press);
  --lavender: var(--blue-light);
  --income: #30d158;
  --expense: #ff6b60;
  --income-on-dark: #30d158;
  --expense-on-dark: #ff6b60;
  --income-soft: #30d15826;
  --expense-soft: #ff6b6026;
  --surface: #ffffff12;
  --surface-soft: #ffffff0d;
  --surface-hover: #ffffff1f;
  --field: #ffffff14;
  --line: #ffffff1f;
  --line-strong: #ffffff40;
  --glass-bg: #ffffff12;
  --glass-sheet: #1c1c24b8;
  --glass-nav: #1c1c24b8;
  --glass-border: #ffffff24;
  --glass-blur: blur(30px) saturate(180%);
  --glass-radius: 28px;
  --dark: #000;
  --red: var(--expense);
  --shadow: none;
  --pane: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-edge), 0 10px 30px -12px #000000aa;
  --float: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-edge), 0 18px 50px -10px #000000cc;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Jotwai Thai", system-ui, sans-serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 60% 50% at 88% 6%, #4b3fd47a, transparent 70%),
    radial-gradient(ellipse 55% 45% at 6% 92%, #0a8fb06b, transparent 70%),
    radial-gradient(ellipse 40% 35% at 14% 8%, #b43fb24a, transparent 70%),
    radial-gradient(ellipse 45% 40% at 92% 80%, #0a58d155, transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  accent-color: var(--blue);
  -webkit-tap-highlight-color: #0a84ff30;
  scrollbar-color: #ffffff40 transparent;
}
body.ui7-theme :is(button,input,select,textarea,summary) { font-family: inherit; }
body.ui7-theme ::selection { background: #0a84ff80; color: #fff; }
body.ui7-theme ::-webkit-scrollbar-thumb { background: #ffffff40; }
body.ui7-theme :is(input,select,textarea) { caret-color: var(--blue-light); color: var(--ink); }
body.ui7-theme :is(button,input,select,textarea,summary,a):focus-visible { outline: 3px solid #64d2ffcc; outline-offset: 2px; box-shadow: none; }
body.ui7-theme .skip-link { background: #0058d8; color: #fff; }
body.ui7-theme :is(h1,h2,h3) { color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
body.ui7-theme :is(.section-description,.form-foot,.report-footnote,.sample-banner,.history-explanation,.calendar-legend,.calendar-mobile-legend,.weekly-help,.history-filter-notice,.history-net-note,.day-edit-hint,.list-caption,.capture-format-hint,.page-header p) { color: var(--secondary); }

/* ---------- Sidebar: glass rail ---------- */
body.ui7-theme .sidebar { background: #ffffff0d; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-right: 1px solid var(--glass-edge); color: var(--ink); width: 232px; }
body.ui7-theme .brand { color: #fff; font-weight: 700; letter-spacing: -.03em; }
body.ui7-theme .brand small { color: var(--secondary); font-weight: 400; }
body.ui7-theme .brand-mark { background: linear-gradient(160deg, #64d2ff, #0a84ff 55%, #5e5ce6); border: 0; border-radius: 13px; box-shadow: inset 0 1px 0 #ffffff80, 0 6px 16px -4px #0a84ffaa; }
body.ui7-theme .brand-mark .icon { color: #fff; stroke: #fff; }
body.ui7-theme .sidebar .nav { color: #ffffffd9; font-weight: 500; border-radius: 14px; }
body.ui7-theme .sidebar .nav .icon { stroke: var(--blue-light); }
body.ui7-theme .sidebar .nav:hover { background: #ffffff14; }
body.ui7-theme .sidebar .nav.active { background: #ffffff24; color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-edge); }
body.ui7-theme .sidebar .nav.active .icon { stroke: #fff; }
body.ui7-theme .sidebar :is(.side-note,.side-foot,.sidebar-bottom) { color: var(--secondary); }
body.ui7-theme .sidebar .side-note-icon { background: var(--blue-tint); color: var(--blue-light); }
body.ui7-theme main { margin-left: 232px; }
body.ui7-theme .page-header h1 { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }

/* ---------- Home: balance floats on a glass pane ---------- */
body.ui7-theme #moneyOverview {
  background: linear-gradient(160deg, #ffffff26, #ffffff0d 55%, #ffffff14); color: var(--ink); border: 0; border-radius: 34px;
  padding: clamp(24px, 3.2vw, 36px); box-shadow: var(--float);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
body.ui7-theme #moneyOverviewTitle { color: var(--secondary); font-weight: 500; font-size: 15px; }
body.ui7-theme #moneyCurrent { color: #fff; font-weight: 700; --money-size: 58px; letter-spacing: -.04em; text-shadow: 0 2px 30px #0a84ff66; }
body.ui7-theme #moneyOverview #moneyChange { color: var(--income); font-weight: 600; }
body.ui7-theme #moneyOverview #moneyChange.negative { color: var(--expense); }
body.ui7-theme #moneyScope { color: var(--secondary); }
body.ui7-theme #moneyOverview :is(.trend-caption,.trend-help summary,.trend-help p,#trendNotice,.trend-sparse-hint) { color: var(--secondary); }
body.ui7-theme #moneyOverview .overview-quick { background: var(--glass-strong); color: #fff; border-radius: 999px; font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-hi); }

/* Wallet lenses: one system colour per wallet */
body.ui7-theme .wallet-fleet { margin: 4px 0 20px; }
body.ui7-theme .wallet-fleet-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #ffffff1a; gap: 3px; padding: 1px; }
body.ui7-theme .wallet-fleet-bar span { display: block; min-width: 7px; background: var(--w); border-radius: 999px; box-shadow: 0 0 14px -2px var(--w); }
body.ui7-theme .wallet-fleet-key { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; font-weight: 500; color: #ffffffd9; }
body.ui7-theme .wallet-fleet-key li { display: inline-flex; align-items: center; gap: 7px; background: #ffffff14; padding: 5px 12px 5px 8px; border-radius: 999px; box-shadow: inset 0 1px 0 #ffffff33, inset 0 0 0 1px #ffffff14; }
body.ui7-theme .wallet-fleet-key i { width: 9px; height: 9px; border-radius: 50%; background: var(--w); box-shadow: 0 0 8px var(--w); }

/* Chart: luminous line */
body.ui7-theme #trendPlot #trendAreaFill stop { stop-color: var(--blue-light); }
body.ui7-theme #trendPlot .trend-line { stroke: var(--blue-light); stroke-width: 2.6; filter: drop-shadow(0 0 8px #64d2ff99); }
body.ui7-theme #trendPlot #trendDot { fill: #fff; stroke: var(--blue-light); stroke-width: 2.5; }
body.ui7-theme #trendPlot #trendDotHalo { fill: var(--blue-light); fill-opacity: .22; }
body.ui7-theme #trendPlot #trendCrosshair { stroke: #fff; stroke-opacity: .35; }
body.ui7-theme #trendPlot .trend-grid { stroke: #fff; stroke-opacity: .12; }
body.ui7-theme #trendPlot text { fill: var(--secondary); font-weight: 500; }
body.ui7-theme .trend-tooltip { background: #2a2a34cc; color: #fff; border: 0; border-radius: 14px; box-shadow: var(--pane); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
body.ui7-theme .trend-tooltip strong { color: #fff; }
body.ui7-theme .trend-tooltip span { color: var(--secondary); }
body.ui7-theme #moneyOverview .trend-period b { color: #fff; font-weight: 600; }
body.ui7-theme #moneyOverview .trend-period .icon-button { color: var(--blue-light); }
body.ui7-theme #moneyOverview #trendCursor { accent-color: var(--blue-light); }
body.ui7-theme #moneyOverview .trend-sparse-hint { margin-bottom: 64px; }
body.ui7-theme #moneyOverview :is(#trendOpenDay,#trendSparseExplore) { background: var(--glass-strong); color: #fff; border-radius: 999px; padding: 10px 18px; font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-edge); }
body.ui7-theme #moneyOverview .trend-point-summary * { color: #fff; }

/* ---------- Surfaces: glass panes ---------- */
body.ui7-theme :is(.panel,.account-overview,.quick-card,.spending-card,.recent-card,.history-panel) {
  background: linear-gradient(160deg, #ffffff1f, #ffffff0a 60%, #ffffff0f); color: var(--ink); border: 0; border-radius: 28px; box-shadow: var(--pane);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
body.ui7-theme #home .recent-card, body.ui7-theme #home .spending-card { background: transparent; box-shadow: none; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.ui7-theme #home .quick-card input#quick { background: #00000040; color: #fff; border: 0; border-radius: 16px; font-weight: 500; box-shadow: inset 0 1px 3px #00000066, 0 1px 0 #ffffff1f; }
body.ui7-theme #home .quick-card input#quick::placeholder { color: #ebebf55c; }
body.ui7-theme :is(.outline,.text-button) { color: var(--blue-light); font-weight: 600; }
body.ui7-theme .outline { background: var(--glass-strong); color: #fff; border: 0; border-radius: 14px; box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-edge); }
body.ui7-theme .outline:hover { background: #ffffff33; }
body.ui7-theme :is(input,select,textarea) { background: #00000040; border: 0; border-radius: 14px; color: #fff; box-shadow: inset 0 1px 3px #00000066, 0 1px 0 #ffffff1f; }
body.ui7-theme select option { background: #1c1c24; color: #fff; }
body.ui7-theme :is(input,select,textarea):focus { box-shadow: 0 0 0 3px #64d2ff66; }
body.ui7-theme .capture-account-trigger { background: #ffffff14; color: #fff; border: 0; border-radius: 16px; font-weight: 600; box-shadow: inset 0 1px 0 #ffffff33, inset 0 0 0 1px #ffffff14; }
body.ui7-theme .category-details summary { color: inherit; }
body.ui7-theme .error { color: var(--expense); font-weight: 600; }

/* Entries: individual glass chips */
body.ui7-theme #home :is(.frequent-row,.home-entry),
body.ui7-theme .ledger-entry, body.ui7-theme #allEntries .entry {
  background: linear-gradient(160deg, #ffffff1c, #ffffff0b); border: 0; border-radius: 22px; color: var(--ink); box-shadow: var(--pane);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
}
body.ui7-theme #home :is(.frequent-row,.home-entry):hover, body.ui7-theme .ledger-entry:hover { background: linear-gradient(160deg, #ffffff30, #ffffff14); }
body.ui7-theme .entry-title, body.ui7-theme .entry-info b { color: #fff; font-weight: 600; }
body.ui7-theme :is(.entry-meta,.entry-meta-main,.entry-meta-account,.entry-amount small) { color: var(--secondary); }
body.ui7-theme .entry-amount { font-weight: 600; }
body.ui7-theme .entry-amount.income, body.ui7-theme .income { color: var(--income); }
body.ui7-theme .entry-amount.expense, body.ui7-theme .expense { color: #fff; }
body.ui7-theme .entry-amount.transfer-amount { color: var(--secondary); }
body.ui7-theme [data-wallet] { --w: #8e8e93; }
body.ui7-theme .entry-meta-main[data-wallet]::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--w); box-shadow: 0 0 8px var(--w); vertical-align: 0; }

/* Spending bars */
body.ui7-theme .bar-track { background: #ffffff1a; border-radius: 999px; height: 9px; }
body.ui7-theme .bar-fill { background: linear-gradient(90deg, #0a84ff, #64d2ff); border-radius: 999px; box-shadow: 0 0 12px #0a84ff88; }
body.ui7-theme .bar-row:nth-child(4n+2) .bar-fill { background: linear-gradient(90deg, #30d158, #8ef0a8); box-shadow: 0 0 12px #30d15888; }
body.ui7-theme .bar-row:nth-child(4n+3) .bar-fill { background: linear-gradient(90deg, #ff9f0a, #ffd166); box-shadow: 0 0 12px #ff9f0a88; }
body.ui7-theme .bar-row:nth-child(4n+4) .bar-fill { background: linear-gradient(90deg, #bf5af2, #e0a7ff); box-shadow: 0 0 12px #bf5af288; }

/* Accounts */
body.ui7-theme .settings-list-row { background: linear-gradient(160deg, #ffffff1c, #ffffff0b); border: 0; border-radius: 20px; color: #fff; margin-block: 6px; box-shadow: var(--pane); }
body.ui7-theme .settings-list-row:hover { background: linear-gradient(160deg, #ffffff30, #ffffff14); }
body.ui7-theme .settings-list-row[data-wallet] .settings-list-icon { background: var(--w); border: 0; color: #fff; border-radius: 11px; box-shadow: inset 0 1px 0 #ffffff80, 0 6px 14px -4px var(--w); }
body.ui7-theme .settings-list-row[data-wallet] .settings-list-icon .icon { stroke: #fff; }
body.ui7-theme .settings-list-row .icon { stroke: var(--blue-light); }
body.ui7-theme .account-group-heading { color: var(--secondary); font-weight: 600; }
body.ui7-theme .count-badge { background: #ffffff24; color: #fff; }

/* ---------- Floating glass dock + capture ---------- */
body.ui7-theme #floatingCapture, body.ui7-theme #floatingCapture.compact-calendar {
  background: linear-gradient(160deg, #0b6fe0, #0058d8 55%, #3a4fe0); color: #fff; border: 0; border-radius: 999px; font-weight: 600;
  box-shadow: inset 0 1px 0 #ffffffa0, inset 0 0 0 1px #ffffff40, 0 12px 30px -6px #0a84ffcc; -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.ui7-theme #floatingCapture:hover { background: linear-gradient(160deg, #0a66d0, #004fc4 55%, #2f44d0); }
body.ui7-theme #floatingCapture .icon { stroke: #fff; }
body.ui7-theme .ui6-dock { background: #1e1e2a8c; -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%); border: 0; border-radius: 36px; box-shadow: var(--float); }
body.ui7-theme .ui6-dock nav::before { background: #ffffff2e; border-radius: 26px; box-shadow: inset 0 1px 0 var(--glass-hi); }
body.ui7-theme .ui6-dock .nav { color: #ebebf5a6; font-weight: 500; }
body.ui7-theme .ui6-dock .nav .icon { stroke: #ebebf5a6; }
body.ui7-theme .ui6-dock .nav.active { color: #fff; font-weight: 600; }
body.ui7-theme .ui6-dock .nav.active .icon { stroke: var(--blue-light); }
body.ui7-theme #toast { background: #2a2a34d9; color: #fff; border: 0; border-radius: 18px; font-weight: 500; box-shadow: var(--pane); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }

/* ---------- Sheets ---------- */
body.ui7-theme dialog { background: #1c1c26b3; color: #fff; border: 0; border-radius: 34px; box-shadow: var(--float); -webkit-backdrop-filter: blur(44px) saturate(190%); backdrop-filter: blur(44px) saturate(190%); }
body.ui7-theme dialog::backdrop { background: #00000073; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.ui7-theme .close-button { background: #ffffff26; color: #fff; border: 0; border-radius: 50%; box-shadow: inset 0 1px 0 var(--glass-hi); }
body.ui7-theme .icon-button { color: var(--blue-light); }
body.ui7-theme footer { color: var(--secondary); }

@media (max-width: 900px) {
  body.ui7-theme main { margin-left: auto; }
  body.ui7-theme #moneyCurrent { --money-size: 46px; }
  body.ui7-theme .page-header h1 { font-size: 30px; }
  body.ui7-theme #moneyOverview { border-radius: 30px; }
}
@media (prefers-reduced-motion: reduce) { body.ui7-theme * { transition: none !important; } }
@media (prefers-reduced-transparency: reduce) {
  body.ui7-theme :is(#moneyOverview,.panel,.quick-card,dialog,.ui6-dock,.sidebar) { background: #1c1c26; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Specificity locks over legacy layers ---------- */
body.ui7-theme.ui6-theme :is(.save,.primary-small,.calendar-modal-add) { background: linear-gradient(160deg, #0b6fe0, #0058d8 55%, #3a4fe0); color: #fff; border: 0; border-radius: 18px; font-weight: 600; box-shadow: inset 0 1px 0 #ffffffa0, 0 10px 24px -8px #0a84ffcc; }
body.ui7-theme.ui6-theme :is(.save,.primary-small,.calendar-modal-add):hover:not(:disabled) { background: linear-gradient(160deg, #0a66d0, #004fc4 55%, #2f44d0); color: #fff; }
body.ui7-theme.ui6-theme :is(.segments,.analytics-tabs),
body.ui7-theme.ui6-theme #history.calendar-compact .history-switch { background: #00000040; border: 0; border-radius: 16px; padding: 3px; box-shadow: inset 0 1px 3px #00000066; }
body.ui7-theme.ui6-theme :is(.segments button,.analytics-tabs button) { color: #ffffffcc; font-weight: 500; border-radius: 13px; background: transparent; }
body.ui7-theme.ui6-theme :is(.segments button.selected,#types [data-type].selected,#history.calendar-compact .history-switch .selected,.analytics-tabs button[aria-pressed=true]) { background: #ffffff38; color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-hi), 0 4px 12px -4px #000000aa; }
body.ui7-theme.ui6-theme #moneyOverview .trend-ranges { background: #00000040; border: 0; border-radius: 16px; padding: 3px; box-shadow: inset 0 1px 3px #00000066; }
body.ui7-theme.ui6-theme.ui5-theme #moneyOverview .trend-ranges button { color: #ffffffcc; border: 0; }
body.ui7-theme.ui6-theme.ui5-theme #moneyOverview .trend-ranges button.selected { background: #ffffff38; color: #fff; box-shadow: inset 0 1px 0 var(--glass-hi), 0 4px 12px -4px #000000aa; }
body.ui7-theme.ui6-theme.ui5-theme #moneyOverview .trend-ranges button::after,
body.ui7-theme.ui6-theme :is(.segments button,.analytics-tabs button)::after { display: none; }
body.ui7-theme.ui6-theme #types [data-type=expense].selected { color: #ff8a80; }
body.ui7-theme.ui6-theme #types [data-type=income].selected { color: #6ee89a; }
body.ui7-theme.ui6-theme #types [data-type=transfer].selected { color: var(--blue-light); }
body.ui7-theme.ui6-theme .quick-dialog #quick { background: #00000040; color: #fff; border: 0; font-weight: 600; }
body.ui7-theme.ui6-theme .quick-dialog #quick::placeholder { color: #ebebf55c; }
body.ui7-theme.ui6-theme .quick-dialog .capture-heading h2 { color: #fff; font-weight: 700; }
body.ui7-theme.ui6-theme .quick-dialog .sheet-heading { background: transparent; border-bottom: 0; }
body.ui7-theme.ui6-theme .quick-dialog .sheet-heading > span { color: var(--secondary); }
body.ui7-theme.ui6-theme dialog > .section-heading:first-child,
body.ui7-theme.ui6-theme dialog > form > .section-heading:first-child { background: transparent; border-bottom: 1px solid var(--line); }
body.ui7-theme.ui6-theme dialog > .section-heading:first-child :is(h2,p),
body.ui7-theme.ui6-theme dialog > form > .section-heading:first-child :is(h2,p) { color: #fff; font-weight: 700; }
body.ui7-theme.ui6-theme dialog > .section-heading:first-child .close-button,
body.ui7-theme.ui6-theme dialog > form > .section-heading:first-child .close-button { background: #ffffff26; color: #fff; border: 0; }
body.ui7-theme.ui6-theme dialog :is(.panel,.account-overview,.settings-list-row) { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- Calendar & history ---------- */
body.ui7-theme.ui6-theme .calendar-day { background: linear-gradient(160deg, #ffffff1c, #ffffff0b); border: 0; border-radius: 16px; color: #fff; box-shadow: inset 0 1px 0 #ffffff30, inset 0 0 0 1px #ffffff12; }
body.ui7-theme.ui6-theme .calendar-day:not(.has-entries) { background: transparent; box-shadow: none; color: var(--secondary); }
body.ui7-theme.ui6-theme .calendar-day.has-entries:hover { background: linear-gradient(160deg, #ffffff30, #ffffff14); }
body.ui7-theme.ui6-theme .calendar-day.is-today { background: linear-gradient(160deg, #0a84ff66, #0a84ff33); box-shadow: inset 0 1px 0 #ffffff60, inset 0 0 0 1px #64d2ff88; }
body.ui7-theme.ui6-theme .calendar-day.is-selected { outline: 2px solid var(--blue-light); outline-offset: 1px; }
body.ui7-theme .calendar-weekdays span { color: var(--secondary); font-weight: 600; }
body.ui7-theme .calendar-day .calendar-income b, body.ui7-theme .history-income { color: var(--income); }
body.ui7-theme .calendar-day .calendar-expense b, body.ui7-theme .history-expense { color: var(--expense); }
body.ui7-theme.ui6-theme .history-totals { background: linear-gradient(160deg, #ffffff1f, #ffffff0a); border-radius: 22px; padding: 14px 20px; color: #fff; box-shadow: var(--pane); }
body.ui7-theme.ui6-theme .history-totals * { color: inherit; }
body.ui7-theme.ui6-theme .history-totals .history-income { color: var(--income); }
body.ui7-theme.ui6-theme .history-totals .history-expense { color: var(--expense); }
body.ui7-theme.ui6-theme .history-totals b { font-weight: 700; }
body.ui7-theme.ui6-theme #history .history-panel { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.ui7-theme.ui6-theme.ui5-theme #moneyOverview .trend-ranges button { border-radius: 13px; }

/* ---------- Proportion pass: one type scale, one radius scale, one spacing rhythm ----------
   Type: 14 secondary / 15 body / 17 row title / 20 section / 32 page / 56 balance.
   Radius: 28 hero + sheets / 24 panes / 18 rows / 14 controls / pill.
   Space: 4-8-12-16-24-32 rhythm. */
body.ui7-theme.ui6-theme {
  --r-hero: 28px; --r-pane: 24px; --r-row: 18px; --r-ctl: 14px;
  --pad-hero: 28px; --pad-pane: 24px; --pad-row: 14px 16px;
}
body.ui7-theme.ui6-theme { font-size: 15px; line-height: 1.6; }
body.ui7-theme.ui6-theme :is(.section-description,.form-foot,.report-footnote,.sample-banner,.history-explanation,.calendar-legend,.calendar-mobile-legend,.weekly-help,.history-filter-notice,.history-net-note,.day-edit-hint,.list-caption,.capture-format-hint,.page-header p,.home-recent-hint,.entry-meta,.entry-meta-main,.entry-meta-account,.entry-amount small,.wallet-fleet-key,.trend-caption,#moneyScope,#moneyChange,.trend-period b,.bar-row span,.bar-row b,.account-group-heading,.settings-list-copy small,.settings-list-value small,.trend-help summary,.trend-help p,.calendar-weekdays span) { font-size: 14px; line-height: 1.6; }
body.ui7-theme.ui6-theme :is(#moneyOverviewTitle,.entry-title,.entry-info b,.settings-list-copy b,.settings-list-value) { font-size: 16px; line-height: 1.5; }
body.ui7-theme.ui6-theme .home-entry .entry-title { font-size: 17px; }
body.ui7-theme.ui6-theme .home-entry .entry-amount { font-size: 17px; }
body.ui7-theme.ui6-theme :is(#home .quick-templates h3,#home .recent-card h2,#home .spending-card h2,.panel h2,.account-overview h2,dialog h2,#home #frequentSection h3) { font-size: 20px; line-height: 1.4; letter-spacing: -.015em; }
body.ui7-theme.ui6-theme .page-header h1 { font-size: 32px; line-height: 1.3; }
body.ui7-theme.ui6-theme #moneyCurrent { --money-size: 56px; line-height: 1.2; }
body.ui7-theme.ui6-theme .brand { font-size: 24px; }
body.ui7-theme.ui6-theme .sidebar .nav { font-size: 15px; min-height: 48px; border-radius: var(--r-ctl); padding: 12px 14px; }
body.ui7-theme.ui6-theme :is(.outline,.text-button,.primary-small,.save,#trendOpenDay,#trendSparseExplore,.trend-ranges button,#floatingCapture) { font-size: 15px; }
body.ui7-theme.ui6-theme :is(.outline,.primary-small,.save) { min-height: 48px; padding-inline: 20px; }
body.ui7-theme.ui6-theme :is(input,select,textarea,.capture-account-trigger) { min-height: 48px; border-radius: var(--r-ctl); font-size: 16px; padding-inline: 16px; }
body.ui7-theme.ui6-theme #moneyOverview { border-radius: var(--r-hero); padding: var(--pad-hero); }
body.ui7-theme.ui6-theme :is(.panel,.account-overview,.quick-card,.history-panel) { border-radius: var(--r-pane); padding: var(--pad-pane); }
body.ui7-theme.ui6-theme #home :is(.home-entry,.frequent-row),
body.ui7-theme.ui6-theme :is(.ledger-entry,#allEntries .entry,.settings-list-row,.history-totals) { border-radius: var(--r-row); padding: var(--pad-row); }
body.ui7-theme.ui6-theme .calendar-day { border-radius: 14px; }
body.ui7-theme.ui6-theme .ui6-dock { border-radius: 32px; }
body.ui7-theme.ui6-theme dialog { border-radius: var(--r-hero); }
body.ui7-theme.ui6-theme :is(.segments,.trend-ranges,.analytics-tabs) { border-radius: var(--r-ctl); }
body.ui7-theme.ui6-theme.ui5-theme #moneyOverview .trend-ranges button, body.ui7-theme.ui6-theme :is(.segments button,.analytics-tabs button) { border-radius: 11px; font-size: 15px; }
body.ui7-theme.ui6-theme :is(#home .home-activity,#home .capture-column) { gap: 16px; }
body.ui7-theme.ui6-theme #home :is(#recent,#frequentList) { gap: 12px; }
body.ui7-theme.ui6-theme #home { gap: 32px 40px; }
body.ui7-theme.ui6-theme .wallet-fleet-key li { padding: 6px 14px 6px 10px; }
@media (max-width: 900px) {
  body.ui7-theme.ui6-theme { --r-hero: 26px; --pad-hero: 22px; --pad-pane: 20px; }
  body.ui7-theme.ui6-theme #moneyCurrent { --money-size: 46px; }
  body.ui7-theme.ui6-theme .page-header h1 { font-size: 28px; }
}
body.ui7-theme.ui6-theme #home .home-entry .entry-meta-main { font-size: 14px; font-weight: 500; color: #ffffffcc; }
body.ui7-theme.ui6-theme #home .home-entry .entry-meta-account { font-size: 14px; color: var(--secondary); }
body.ui7-theme.ui6-theme #home .home-entry .entry-meta { gap: 2px; }
body.ui7-theme.ui6-theme :is(.ledger-entry,#allEntries .entry) :is(.entry-meta-main,.entry-meta-account) { font-size: 14px; font-weight: 500; color: var(--secondary); }
body.ui7-theme.ui6-theme :is(.ledger-entry,#allEntries .entry) .entry-meta-main { color: #ffffffcc; }

/* Category manager: edit + delete actions */
body.ui7-theme .category-manager-actions { display: inline-flex; gap: 8px; flex-shrink: 0; }
body.ui7-theme.ui6-theme .category-manager-row button { font-size: 14px; min-height: 40px; padding-inline: 14px; border-radius: 12px; background: var(--glass-strong); color: var(--blue-light); border: 0; }
body.ui7-theme.ui6-theme .category-manager-row button.danger { color: #ff6b60; background: #ff6b6026; }
body.ui7-theme.ui6-theme .category-manager-row { font-size: 15px; gap: 12px; align-items: center; }

/* Summary / calendar "all data" totals: one rounded glass pane, no legacy square frame or column rules */
body.ui7-theme.ui6-theme #history#history .calendar-summary .history-totals {
 background: linear-gradient(160deg, #ffffff1f, #ffffff0a); border: 0; border-radius: var(--r-pane); padding: 16px 18px; margin: 4px 0 14px;
 box-shadow: var(--pane); gap: 10px 14px;
}
body.ui7-theme.ui6-theme #history#history .calendar-summary .history-totals > span,
body.ui7-theme.ui6-theme #history#history .calendar-summary .history-totals > span + span { border: 0; padding: 0; font-size: 14px; color: var(--muted, #ebebf599); }
body.ui7-theme.ui6-theme #history#history .calendar-summary .history-totals b { font-size: 19px; line-height: 1.4; }
@media (max-width: 420px) {
 body.ui7-theme.ui6-theme #history#history .calendar-summary .history-totals { padding: 14px 16px; gap: 8px 10px; }
 body.ui7-theme.ui6-theme #history#history .calendar-summary .history-totals b { font-size: 17px; }
}

/* ---------- Urgent fixes: retire leaked Afterglow (UI6) navy / mint / lavender ---------- */
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day,
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day.has-entries { border-radius: 16px; border: 0; }
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day.has-entries { background: linear-gradient(160deg, #ffffff1c, #ffffff0b); box-shadow: inset 0 1px 0 #ffffff30, inset 0 0 0 1px #ffffff12; }
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day.has-entries:hover { background: linear-gradient(160deg, #ffffff30, #ffffff14); }
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day.is-today:not(.is-selected) { background: linear-gradient(160deg, #0a84ff66, #0a84ff33); box-shadow: inset 0 1px 0 #ffffff60, inset 0 0 0 1px #64d2ff88; }
/* selected = filled + inset ring; keyboard focus = separate 3px outside ring, so the two never look alike */
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day.is-selected { background: linear-gradient(160deg, #0a84ff99, #0a84ff55); border: 0; box-shadow: inset 0 1px 0 #ffffff60, inset 0 0 0 2px #64d2ff; outline: 0; }
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day.is-today .calendar-day-top b,
body.ui7-theme.ui6-theme #history.calendar-compact .calendar-day.is-selected.is-today .calendar-day-top b { outline-color: var(--blue-light); }

body.ui7-theme.ui6-theme .quick-dialog #quickCard .capture-date-control input { background: #ffffff14; border-radius: var(--r-ctl); }
body.ui7-theme.ui6-theme .quick-dialog #quickCard .capture-date-status { background: #30d15826; }
body.ui7-theme.ui6-theme .capture-account-trigger:hover { background: #ffffff1a; border-color: #64d2ff80; }
body.ui7-theme.ui6-theme #captureAccountList > button[aria-pressed=true] { background: #0a84ff2e; border-color: #64d2ff80; }
body.ui7-theme.ui6-theme #captureAccountList > button:hover { background: #ffffff12; }
body.ui7-theme.ui6-theme .delete { background: #ff6b6026; color: #ff8a80; border-radius: var(--r-ctl); }
body.ui7-theme.ui6-theme .delete:hover { background: #ff6b6040; }
body.ui7-theme.ui6-theme .import-table th { background: #ffffff14; }
body.ui7-theme.ui6-theme .analytics-dialog :is(.chart-selection,#analyticsCategories .chart-selection,.donut-total-pill,.chart-category.is-selected) { background: #0a84ff1f; }
body.ui7-theme.ui6-theme :is(.outline,.icon-button,.close-button,.analytics-trigger,.category-manager-row button,.borrower-trash):hover:not(:disabled) { background: #ffffff1c; border-color: #64d2ff80; }

/* ---------- Donut v2: glass dome, glowing gradient ring (palette now lives in chart-view.js) ---------- */
body.ui7-theme.ui6-theme .analytics-dialog .donut-stage { width: min(100%, 300px); }
body.ui7-theme.ui6-theme .analytics-dialog .donut-stage::before {
 inset: 15%; border-radius: 50%;
 background: radial-gradient(circle at 32% 16%, #ffffff3d, #ffffff0f 38%, #00000022 100%), #0b0e1a;
 box-shadow: inset 0 1.5px 0 #ffffff66, inset 0 0 0 1px #ffffff1c, inset 0 -22px 44px #00000099, 0 22px 50px -14px #000000d0;
}
body.ui7-theme.ui6-theme .analytics-dialog .donut-stage::after {
 content: ""; position: absolute; inset: -14%; z-index: -1; pointer-events: none;
 background: radial-gradient(circle, #bf5af233 0%, #0a84ff26 42%, transparent 70%); filter: blur(14px);
}
body.ui7-theme .donut-track { fill: none; stroke: #ffffff10; stroke-width: 22px; }
body.ui7-theme .donut-guide { fill: none; stroke: #ffffff44; stroke-width: 1.6; stroke-dasharray: .1 7; stroke-linecap: round; }
body.ui7-theme .donut-guide-inner { stroke: #ffffff12; }
body.ui7-theme.ui6-theme .analytics-dialog .donut-segment { stroke-width: 22px; opacity: .82; filter: drop-shadow(0 0 6px var(--cg, #0a84ff99)); }
body.ui7-theme.ui6-theme .analytics-dialog .donut-segment.is-selected,
body.ui7-theme.ui6-theme .analytics-dialog .donut-segment:focus-visible { stroke-width: 28px; opacity: 1; filter: drop-shadow(0 0 14px var(--cg, #0a84ff99)) brightness(1.08); outline: none; }
body.ui7-theme .donut-center-content { inset: 24% 21%; gap: 2px; }
body.ui7-theme #donutCenterName { font-size: 13px; color: #ebebf5b3; font-weight: 500; }
body.ui7-theme #donutCenterPercent { font-size: 42px; line-height: 1.15; font-weight: 800; letter-spacing: -1.5px; background: linear-gradient(180deg, #fff 30%, #aebcff); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.ui7-theme #donutCenterAmount { font-size: 15px; font-weight: 700; color: #fff; }
body.ui7-theme .donut-center-content small { font-size: 12px; color: #ebebf599; }
body.ui7-theme.ui6-theme .analytics-dialog .donut-category-nav button { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(160deg, #ffffff26, #ffffff0d); border: 0; box-shadow: inset 0 1px 0 #ffffff40, inset 0 0 0 1px #ffffff14; color: var(--blue-light); }
body.ui7-theme #donutPosition { font-size: 14px; color: var(--secondary); }
body.ui7-theme.ui6-theme .analytics-dialog .donut-total-pill { background: linear-gradient(160deg, #ffffff1f, #ffffff0a); border: 0; border-radius: var(--r-row); box-shadow: inset 0 1px 0 #ffffff40, inset 0 0 0 1px #ffffff12; padding: 12px 18px; }
body.ui7-theme .donut-total-pill span { font-size: 14px; color: var(--secondary); }
body.ui7-theme .donut-total-pill strong { font-size: 20px; color: #fff; }
body.ui7-theme.ui6-theme .analytics-dialog .chart-category { border: 0; border-radius: var(--r-row); background: linear-gradient(160deg, #ffffff17, #ffffff08); box-shadow: inset 0 1px 0 #ffffff2e, inset 0 0 0 1px #ffffff10; }
body.ui7-theme.ui6-theme .analytics-dialog .chart-category.is-selected { background: linear-gradient(160deg, #ffffff26, #ffffff10); box-shadow: inset 0 1px 0 #ffffff55, inset 0 0 0 1.5px var(--category-color), 0 0 24px -6px var(--category-color); }
body.ui7-theme .analytics-dialog .chart-swatch { width: 30px; min-width: 30px; height: 30px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; color: #04101c; font-weight: 800; font-size: 14px; box-shadow: 0 0 14px -2px var(--category-color), inset 0 1px 0 #ffffff80; }
body.ui7-theme .analytics-dialog .category-track { background: #ffffff14; height: 6px; border-radius: 999px; }
body.ui7-theme .analytics-dialog .category-track i { border-radius: 999px; box-shadow: 0 0 10px var(--category-color); }
@media (min-width: 601px) { body.ui7-theme.ui6-theme .analytics-dialog .donut-layout { grid-template-columns: 300px minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { body.ui7-theme .donut-segment { transition: none; } }
