:root, [data-theme="dark"] {
  --bg: #0f1512; --panel: #18211c; --panel-2: #1f2a24;
  --text: #eef4f0; --muted: #93a49c; --accent: #4bbf8f; --accent-soft: #79d6ae;
  --green: #4bbf8f; --red: #f87171; --amber: #fbbf24; --purple: #a78bfa; --cyan: #22d3ee;
  --border: #29372f; --ring: rgba(75, 191, 143, 0.35);
  --grid: rgba(255,255,255,.06); --on-accent: #0f1512; --glow: rgba(75, 191, 143, 0.10); --glow-2: rgba(75, 191, 143, 0.07);
}
[data-theme="light"] {
  --bg: #f4f8f5; --panel: #ffffff; --panel-2: #eef3ef;
  --text: #14201a; --muted: #5c6b64; --accent: #12a86f; --accent-soft: #34c98c;
  --green: #12a86f; --red: #dc2626; --amber: #b45309; --purple: #7c3aed; --cyan: #0e7490;
  --border: #dde6e0; --ring: rgba(18, 168, 111, 0.30);
  --grid: rgba(0,0,0,.08); --on-accent: #ffffff; --glow: rgba(18, 168, 111, 0.08); --glow-2: rgba(18, 168, 111, 0.05);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background:
  radial-gradient(1100px 600px at 50% -10%, var(--glow), transparent 60%),
  radial-gradient(900px 500px at 85% 110%, var(--glow-2), transparent 55%),
  var(--bg); background-attachment: fixed; color: var(--text); line-height: 1.5; }
/* App shell: a collapsible sidebar (nav + account) beside the main content. */
.app-shell { display: flex; min-height: 100vh; align-items: flex-start; }
.sidebar { width: 226px; flex: none; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; transition: width .2s ease; z-index: 15; }
/* Deliberately no overflow-y:auto here — setting only one axis to a
   scrolling value forces the other axis to compute to 'auto' too (CSS
   overflow spec), which would clip the collapsed-state hover tooltips that
   pop out past the sidebar's right edge. Seven nav items plus the footer
   comfortably fit any real viewport height without needing to scroll. */
.sidebar .brand { display: flex; align-items: center; gap: 9px; padding: 0 6px; margin-bottom: 22px; }
.sidebar .logo { height: 26px; width: auto; display: block; flex: none; }
[data-theme="light"] .sidebar .logo { background: #0f1512; padding: 4px 7px; border-radius: 7px; }
.logo-mark { display: none; height: 30px; width: 30px; flex: none; border-radius: 7px; }
.brand-label { font-weight: 700; font-size: 15px; white-space: nowrap; }
.main-col { flex: 1; min-width: 0; }
.main-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 0; }
.main-topbar h1 { font-size: 20px; margin: 0; }
.main-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.main-topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 40px; }
#saveStatus { color: var(--muted); font-size: 13px; }
.topbar-settings { width: 38px; height: 38px; padding: 9px; display: grid; place-items: center; }
.topbar-settings svg { width: 100%; height: 100%; display: block; }
.mobile-nav-toggle, .drawer-close { display: none; }
.sidebar-backdrop { display: none; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.theme-toggle svg { width: 15px; height: 15px; flex: none; display: block; }
.icon-btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); padding: 8px 10px; border-radius: 9px; font-size: 13px; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.money-profile-switcher { display: flex; align-items: stretch; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.money-profile-switcher select { width: auto; min-width: 168px; padding: 5px 30px 5px 9px; border: 0; background: transparent; font-weight: 700; }
.money-profile-switcher select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Account pill + avatar */
.avatar { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.account-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--panel-2); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.account-pill .pill-text { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.account-pill .chev { color: var(--muted); font-size: 10px; }
.account-menu { position: relative; flex: 1; min-width: 0; }
.account-dropdown { position: absolute; bottom: calc(100% + 8px); top: auto; left: 0; width: 230px; background: var(--panel); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 18px 40px -20px rgba(20,32,26,.35); padding: 6px; z-index: 20; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: transparent; color: var(--text); font-family: inherit; font-size: 13px; padding: 9px 10px; border-radius: 8px; }
.menu-item:hover { background: var(--panel-2); filter: none; }
.menu-item .ic { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.menu-item .ic svg { width: 100%; height: 100%; display: block; }
.menu-item.danger { color: var(--red); }
.product-tour { --tour-arrow-offset: 28px; position: fixed; z-index: 10001; width: min(360px, calc(100vw - 32px)); padding: 18px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border)); border-radius: 13px; box-shadow: 0 20px 55px rgba(3,18,11,.32); }
body.product-tour-open:not(.product-tour-nora-step) #nora-launcher, body.product-tour-open .nora-panel { display: none !important; }
.product-tour:focus { outline: none; }
.product-tour-spotlight { position: fixed; z-index: 10000; pointer-events: none; border: 2px solid var(--accent-soft); border-radius: 10px; box-shadow: 0 0 0 5px var(--ring), 0 0 0 9999px rgba(5,12,8,.68); transition: top .18s ease, left .18s ease, width .18s ease, height .18s ease; }
.product-tour-arrow { position: absolute; z-index: -1; width: 13px; height: 13px; background: var(--panel); border: solid color-mix(in srgb, var(--accent) 34%, var(--border)); transform: rotate(45deg); }
.product-tour[data-placement="right"] .product-tour-arrow { left: -7px; top: var(--tour-arrow-offset); border-width: 0 0 1px 1px; }
.product-tour[data-placement="left"] .product-tour-arrow { right: -7px; top: var(--tour-arrow-offset); border-width: 1px 1px 0 0; }
.product-tour[data-placement="bottom"] .product-tour-arrow { top: -7px; left: var(--tour-arrow-offset); border-width: 1px 0 0 1px; }
.product-tour[data-placement="top"] .product-tour-arrow { bottom: -7px; left: var(--tour-arrow-offset); border-width: 0 1px 1px 0; }
.product-tour-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.product-tour-head > div { display: flex; align-items: center; gap: 8px; }
.product-tour-kicker { color: var(--accent); font-size: 12px; font-weight: 700; }
.product-tour-head strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.product-tour-close { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; flex: none; border: 1px solid var(--border); border-radius: 50%; background: var(--panel-2); color: var(--muted); font-size: 20px; line-height: 1; }
.product-tour-progress { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 16px 0 0; }
.product-tour-progress button { min-width: 0; height: 3px; padding: 0; border: 0; border-radius: 999px; background: var(--border); }
.product-tour-progress button.current { background: var(--accent); }
.product-tour h2 { margin: 14px 0 7px; font-size: 19px; line-height: 1.3; }
.product-tour > p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.product-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.product-tour-actions > div { display: flex; gap: 7px; }
.product-tour-actions button { padding: 8px 12px; }
.product-tour-skip { justify-self: start; padding-left: 0 !important; border: 0; background: transparent; color: var(--muted); }
.product-tour-skip:hover { color: var(--text); background: transparent; filter: none; }
.tour-focus { scroll-margin: 80px; }
/* Category icons — inline next to text in tags, table cells, breakdown rows,
   modal titles. Coloured entirely by the surrounding text colour. */
.cat-ic, .ic-eye { display: inline-flex; width: 14px; height: 14px; vertical-align: -2px; }
.cat-ic svg, .ic-eye svg { width: 100%; height: 100%; display: block; }
.ic-eye { width: 15px; height: 15px; vertical-align: -3px; opacity: .7; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 2px; }
.avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.avatar-row input[type="file"] { display: none; }

/* Customize popover — e.g. hiding a category from the Dashboard chart
   without leaving the panel it affects. Same overlay pattern as the
   account dropdown (anchored, closes on outside click / Escape). */
.customize-wrap { position: relative; }
.customize-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.customize-btn svg { width: 13px; height: 13px; flex: none; }
.customize-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 220px; max-height: 280px; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 36px -18px rgba(0,0,0,.35); padding: 6px; z-index: 20; }
.customize-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.customize-item:hover { background: var(--panel-2); }
.customize-item input { width: auto; margin: 0; accent-color: var(--accent); flex: none; }
.customize-item .cat-ic { flex: none; }
.customize-item.is-hidden .name-text { color: var(--muted); }

/* Account view */
.acct-back { background: none; border: none; color: var(--muted); font-size: 13px; padding: 0 0 16px; cursor: pointer; }
.acct-back:hover { color: var(--text); filter: none; }
.acct-layout { display: grid; grid-template-columns: 190px 1fr; gap: 22px; align-items: start; }
.acct-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 76px; }
.acct-nav button { text-align: left; border: none; background: transparent; color: var(--muted); font-size: 13.5px; padding: 9px 12px; border-radius: 8px; }
.acct-nav button.on { background: var(--panel-2); color: var(--accent); font-weight: 700; }
@media (max-width: 720px) {
  .acct-layout { grid-template-columns: 1fr; }
  .acct-nav { flex-direction: row; overflow-x: auto; position: static; }
}
button { font-family: inherit; font-size: 14px; cursor: pointer; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: 8px; transition: filter .15s, background .15s; }
button:hover { filter: brightness(1.15); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.danger { color: var(--red); border-color: var(--red); }
button.small { padding: 4px 10px; font-size: 12px; }
.btn-ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Sidebar nav — mono-coloured line icons (colour inherited from .side-item's
   own state: muted normally, on-accent when active), collapsible to a
   ~64px icon-only rail via #collapseSidebarBtn. */
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; font-family: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer; position: relative; text-align: left; white-space: nowrap; }
.side-item:hover { filter: none; background: var(--panel-2); color: var(--text); }
.side-item .ic { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.side-item .ic svg { width: 100%; height: 100%; display: block; }
.side-item.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.side-explore { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); border-radius: 0; }
.side-explore:hover { border-top-color: var(--border); border-radius: 9px; }
.side-tooltip { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 7px; white-space: nowrap; box-shadow: 0 8px 20px -8px rgba(0,0,0,.4); z-index: 5; display: none; }
.side-tooltip::before { content: ''; position: absolute; left: -4px; top: 50%; transform: translateY(-50%); border: 5px solid transparent; border-right-color: var(--text); }

.side-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.side-foot-row { display: flex; align-items: center; gap: 8px; }
.collapse-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px dashed var(--border); background: transparent; color: var(--muted); font-size: 12px; padding: 7px 10px; border-radius: 8px; width: 100%; }
.collapse-toggle:hover { filter: none; border-color: var(--accent); color: var(--accent); }
.collapse-chevron { width: 14px; height: 14px; flex: none; transition: transform .2s ease; }

/* Collapsed state — same sidebar element, narrower */
.sidebar.collapsed { width: 66px; }
.sidebar.collapsed .brand { justify-content: center; padding: 0; }
.sidebar.collapsed .brand-label { display: none; }
.sidebar.collapsed .logo { display: none; }
.sidebar.collapsed .logo-mark { display: block; }
.sidebar.collapsed .side-nav { align-items: center; }
.sidebar.collapsed .side-item { width: 40px; justify-content: center; padding: 9px 0; }
.sidebar.collapsed .side-item .lbl { display: none; }
.sidebar.collapsed .side-item:hover .side-tooltip { display: block; }
.sidebar.collapsed .money-profile-switcher { display: none; }
.sidebar.collapsed .side-foot-row { flex-direction: column; }
.sidebar.collapsed .account-pill { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }
.sidebar.collapsed .account-pill .pill-text { display: none; }
.sidebar.collapsed #themeToggle { width: 36px; padding: 8px 0; justify-content: center; }
.sidebar.collapsed #themeToggle .lbl { display: none; }
.sidebar.collapsed .collapse-label { display: none; }
.sidebar.collapsed .collapse-chevron { transform: rotate(180deg); }

@media (max-width: 860px) {
  body.nav-open { overflow: hidden; }
  .app-shell { display: block; }
  .sidebar, .sidebar.collapsed {
    width: min(86vw, 320px); height: 100dvh; position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column; align-items: stretch; overflow-y: auto; overflow-x: visible;
    padding: 20px 16px; transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 20px 0 50px rgba(0,0,0,.22); z-index: 50;
  }
  .sidebar.mobile-open, .sidebar.collapsed.mobile-open { transform: translateX(0); }
  .sidebar .brand, .sidebar.collapsed .brand { justify-content: flex-start; margin: 0 44px 26px 0; padding: 0 6px; }
  .sidebar.collapsed .logo { display: block; }
  .sidebar.collapsed .logo-mark { display: none; }
  .sidebar.collapsed .brand-label, .sidebar.collapsed .side-item .lbl, .sidebar.collapsed #themeToggle .lbl { display: inline; }
  .side-nav, .sidebar.collapsed .side-nav { width: 100%; align-items: stretch; flex-direction: column; }
  .sidebar.collapsed .side-item { width: 100%; justify-content: flex-start; padding: 11px 12px; }
  .side-item { min-height: 44px; padding: 11px 12px; }
  .side-foot, .sidebar.collapsed .side-foot { flex-direction: column; border-top: 1px solid var(--border); border-left: 0; padding: 14px 0 0; margin: 16px 0 0; }
  .side-foot-row, .sidebar.collapsed .side-foot-row { flex-direction: row; }
  .sidebar.collapsed .money-profile-switcher { display: flex; }
  .sidebar.collapsed .account-pill { width: auto; height: auto; padding: 4px 12px 4px 4px; justify-content: flex-start; border-radius: 999px; }
  .sidebar.collapsed .account-pill .pill-text { display: flex; }
  .sidebar.collapsed #themeToggle { width: auto; padding: 8px 10px; }
  .collapse-toggle, .side-tooltip { display: none !important; }
  .drawer-close { display: grid; place-items: center; position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; }
  .mobile-nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; font-size: 18px; }
  .sidebar-backdrop { position: fixed; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgba(4, 12, 8, .56); z-index: 40; }
  .sidebar-backdrop:not([hidden]) { display: block; }
  .main-topbar { min-height: 64px; padding: 12px 16px 0; }
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.card .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.card .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); } .purple { color: var(--purple); } .cyan { color: var(--cyan); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 14px; font-size: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
form.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; align-items: end; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, select { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-family: inherit; font-size: 14px; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
input[readonly] { color: var(--muted); border-style: dashed; cursor: default; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.amt { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: rgba(255,255,255,.02); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.pill.stopped { color: var(--muted); }
.del-btn { background: transparent; border: none; color: var(--muted); padding: 4px 8px; cursor: pointer; }
.del-btn:hover { color: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 26px; font-size: 14px; }
.progress-wrap { background: var(--panel-2); border-radius: 999px; height: 22px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); display: grid; place-items: center; color: var(--on-accent); font-size: 12px; font-weight: 600; transition: width .4s; }
.hidden { display: none; }
.chart-box { position: relative; height: 300px; }
.chart-box.small { height: 260px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
input[type="file"] { display: none; }
.breakdown-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.breakdown-row .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.breakdown-row .bar > span { display: block; height: 100%; border-radius: 999px; }
.breakdown-row .name { width: 130px; font-size: 13px; }
.breakdown-row .pct { width: 130px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; }
.tag button { border: none; background: transparent; color: var(--muted); padding: 0 2px; }
.tag button:hover { color: var(--red); }
.tag small { color: var(--muted); font-size: 10px; }
.method-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.debt-disclaimer { max-width: 850px; line-height: 1.55; }
.debt-list { display: grid; border-top: 1px solid var(--border); margin: 16px 0; }
.debt-row { display: grid; grid-template-columns: minmax(150px,1.3fr) repeat(3,minmax(120px,1fr)) auto; gap: 12px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--border); }
.debt-identity { align-self: center; min-width: 0; }
.debt-identity strong, .debt-identity span { display: block; }
.debt-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debt-identity span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.debt-actions { display: flex; gap: 7px; }
.debt-form { display: grid; grid-template-columns: minmax(150px,1.3fr) repeat(4,minmax(115px,1fr)) auto; gap: 10px; align-items: end; }
.cat-block { margin-bottom: 12px; }
.subcat-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0 20px; align-items: center; }
.tag.sub { background: transparent; border-style: dashed; font-size: 12px; }
.sub-input { width: 140px; padding: 4px 8px; font-size: 12px; }
.archived-list { flex-basis: 100%; width: 100%; margin-top: 8px; }
.archived-list summary { cursor: pointer; font-size: 12px; }
.cat-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
#taxonomyModalBody > label { display: block; margin-top: 14px; }
#taxonomyModalBody .tx-actions { margin-top: 8px; }
#taxonomyModalBody .tx-help { font-size: 12px; margin: 6px 0 8px; }
#taxonomyModalBody .tx-split { margin: 6px 0 4px; }
#taxonomyModalBody .tx-split summary { cursor: pointer; font-size: 13px; color: var(--muted); }
#taxonomyModalBody .tx-option { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 10px; }
#taxonomyModalBody .tx-move { flex-wrap: wrap; gap: 8px; }
.modal-box { max-height: calc(100vh - 48px); overflow-y: auto; }
.tx-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.tx-picker .tx-icon { width: 34px; height: 34px; padding: 7px; display: inline-flex; align-items: center; justify-content: center; }
.tx-picker .tx-icon svg { width: 18px; height: 18px; }
.tx-picker .tx-colour { width: 26px; height: 26px; border-radius: 50%; padding: 0; border: 2px solid transparent; }
.tx-picker .selected { border-color: var(--text); outline: 2px solid var(--green); outline-offset: 1px; }
.mode-btn { display: inline-flex; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-overlay.hidden { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; width: 100%; max-width: 520px; }
.modal-box .chart-box { height: 320px; margin-top: 10px; }
.money-profiles-panel > .flex-between { align-items: flex-start; }
.money-profiles-panel h2, .money-profile-modal h2 { margin-bottom: 4px; }
.money-profiles-panel .muted, .money-profile-modal .muted { margin: 0; }
.money-profile-list { margin-top: 18px; border-top: 1px solid var(--border); }
.money-profile-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 18px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--border); }
.money-profile-identity { min-width: 0; }
.money-profile-identity strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.money-profile-identity span { color: var(--muted); font-size: 12px; }
.money-profile-currency { min-width: 72px; font-size: 18px; font-weight: 800; letter-spacing: .04em; text-align: right; }
.money-profile-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; font-weight: 700; }
.money-profile-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.money-profile-modal { max-width: 780px; max-height: calc(100vh - 48px); overflow-y: auto; }
.money-profile-form { display: grid; gap: 16px; margin-top: 22px; }
.profile-market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-connections { display:grid; gap:12px; padding:16px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.profile-connections h3 { margin:0 0 3px; color:var(--text); font-size:15px; }
.profile-debts { display: grid; gap: 10px; padding: 2px 0; }
.profile-debts h3 { margin: 0 0 3px; font-size: 15px; }
.profile-debt-list { display: grid; border-top: 1px solid var(--border); }
.profile-debt-row { display: grid; grid-template-columns: minmax(140px,1.2fr) repeat(4,minmax(105px,1fr)) auto; gap: 8px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--border); }
.profile-debt-row input[readonly] { border-style: solid; }
.profile-connection-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.profile-connection-lane { display:grid; align-content:start; gap:9px; padding:13px; border:1px solid var(--border); border-radius:11px; background:var(--panel-2); }
.optional-label { color:var(--muted); font-size:11px; font-weight:500; }
.profile-picker { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; }
.profile-connection-tags { display:flex; flex-wrap:wrap; gap:6px; min-height:28px; }
.profile-connection-tag { display:inline-flex; align-items:center; gap:6px; padding:5px 7px 5px 9px; border:1px solid var(--border); border-radius:999px; background:var(--panel); font-size:12px; }
.profile-connection-tag button { border:0; padding:0; background:transparent; color:var(--muted); line-height:1; }
.profile-other-methods { display:flex; flex-wrap:wrap; gap:18px; }
.profile-other-methods label { display:flex; gap:7px; align-items:center; color:var(--text); margin:0; }
.profile-other-methods input, .profile-investments input { width:auto; accent-color:var(--accent); }
.profile-investments { padding:14px; border-radius:11px; background:color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.profile-investments > label { display:flex; gap:9px; align-items:flex-start; color:var(--text); cursor:pointer; }
.profile-investments > label span { display:grid; gap:3px; }
.profile-investments small { color:var(--muted); }
#new-profile-investment-setup { margin-top:12px; display:grid; gap:8px; }
#new-profile-investment-setup.hidden { display:none; }
.security-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:10px; align-items:end; }
.inline-status { min-height:20px; margin:9px 0 0; font-size:13px; }
.danger-divider { height:1px; background:var(--border); margin:20px 0; }
.delete-account-modal { max-width:480px; }
.delete-account-modal > p { color:var(--muted); line-height:1.55; }
.delete-account-modal form { display:grid; gap:13px; margin-top:18px; }
.profile-lock-callout { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 15px; border-left: 4px solid var(--accent); background: var(--panel-2); }
.profile-lock-callout > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.profile-lock-callout strong { display: block; margin-bottom: 3px; }
.profile-lock-callout p { margin: 0; color: var(--muted); font-size: 13px; }
.profile-confirm-line { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: 13px; cursor: pointer; }
.profile-confirm-line input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--accent); }
.money-profile-error { min-height: 20px; margin: 0; color: var(--red); font-size: 13px; }
.money-profile-actions { display: flex; justify-content: flex-end; gap: 10px; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .55; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  header { align-items: flex-start; }
  header > div { width: 100%; }
  .money-profile-switcher { order: -1; flex: 1 1 100%; }
  .money-profile-switcher select { flex: 1; min-width: 0; }
  .money-profile-row { grid-template-columns: minmax(0,1fr) auto; }
  .money-profile-row > button { grid-column: 1 / -1; width: 100%; }
  .profile-market-grid, .profile-connection-grid, .security-form, .debt-row, .debt-form, .profile-debt-row { grid-template-columns: 1fr; }
  .debt-actions { justify-content: stretch; }
  .debt-actions button { flex: 1; }
  .product-tour { width: min(340px, calc(100vw - 24px)); padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-focus, .product-tour, .product-tour-spotlight { scroll-behavior: auto; transition: none; }
}
