/* ============================================================
   Property Portal — "Ledger on fine paper" light theme.
   Calm warm-white surfaces, ink-blue text, one cobalt accent.
   Green/red appear ONLY as data semantics (money up / money down).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,640&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f2f4f8;          /* also used as input-field fill on cards */
  --paper: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --border: #e3e8ef;
  --text: #1f2b38;
  --muted: #64748b;
  --brand: #3056d3;
  --brand-2: #2445b3;
  --brand-tint: #eef2fd;
  --green: #17835a;
  --green-tint: #e5f4ec;
  --red: #c2453c;
  --red-tint: #faeceb;
  --amber: #a9731c;
  --amber-tint: #faf3e4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 43, 56, 0.05), 0 8px 24px rgba(31, 43, 56, 0.05);
  --shadow-lift: 0 2px 6px rgba(31, 43, 56, 0.08), 0 16px 40px rgba(31, 43, 56, 0.1);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* numeric fields: plain typing, no spinner arrows */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type='number'] { -moz-appearance: textfield; appearance: textfield; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--brand-tint); }

/* ---- top nav ---- */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 22px;
  height: 60px;
  /* Full-width header gradient; recolored by portfolio state on the dashboard. */
  background: linear-gradient(100deg, #dfe8fb 0%, #ffffff 34%, #f4f2fe 66%, #e2f5ec 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}
/* Gradient accent strip under the nav — brand by default, recolored by
   portfolio state on the dashboard (green = positive cash flow, red = negative). */
.nav::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, #7b6cf0 55%, #1baf7a 100%);
}
body[data-state='good'] .nav { background: linear-gradient(100deg, #cfeedd 0%, #ffffff 36%, #e9f9f1 66%, #c8ecd9 100%); }
body[data-state='good'] .nav::after { background: linear-gradient(90deg, var(--green) 0%, #1baf7a 55%, #7ee0b4 100%); }
body[data-state='bad'] .nav { background: linear-gradient(100deg, #f9ddda 0%, #ffffff 36%, #fdf1e0 66%, #f7e3cd 100%); }
body[data-state='bad'] .nav::after { background: linear-gradient(90deg, var(--red) 0%, #e07a3f 55%, var(--amber) 100%); }
.nav .brand {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 18px;
  letter-spacing: 0.01em;
  margin-right: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav .brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); display: inline-block; }

/* the red dot of the “i” in Virasat — rendered over a dotless ı, sitting
   just above the letter like a bindi */
.brand-i { position: relative; display: inline-block; line-height: 1; }
.brand-i::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0.13em;
  width: 0.14em;
  height: 0.14em;
  border-radius: 50%;
  background: #d64541;
}
.nav a.link {
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
}
.nav a.link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.link.active { color: var(--brand); background: var(--brand-tint); font-weight: 600; }
.nav .spacer { flex: 1; }
.nav .who { color: var(--muted); font-size: 13px; margin-right: 10px; }

.container { max-width: 1480px; margin: 0 auto; padding: 30px 24px 70px; }

/* column-picker dropdown */
.col-picker { position: relative; display: inline-block; }
.col-picker .col-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lift); padding: 10px 14px; min-width: 180px; display: none;
}
.col-picker.open .col-menu { display: block; }
.col-menu label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; color: var(--text); }
.col-menu input { accent-color: var(--brand); }

/* ---- headings: serif statement heads with a double ledger rule ---- */
h1 {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 26px;
  letter-spacing: 0.005em;
  margin: 4px 0 4px;
}
h1::after {
  content: '';
  display: block;
  width: 54px;
  margin-top: 10px;
  border-bottom: 3px double var(--brand);
  opacity: 0.6;
}
h2 { font-family: var(--font-display); font-weight: 600; font-size: 17px; margin: 26px 0 12px; }
.subtitle { color: var(--muted); margin: 10px 0 26px; font-size: 14px; }

/* ---- KPI cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}
.kpi {
  background: linear-gradient(168deg, var(--surface) 55%, var(--brand-tint) 160%);
  border: 1px solid var(--border);
  border-top: 2px solid var(--brand);
  border-radius: 10px;
  padding: 15px 17px;
  box-shadow: var(--shadow);
}
.kpi .label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 7px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
/* KPI cards tinted by their own sign (net worth, monthly cash flow) */
.kpi.pos { border-top-color: var(--green); background: linear-gradient(168deg, var(--surface) 45%, var(--green-tint) 135%); }
.kpi.neg { border-top-color: var(--red); background: linear-gradient(168deg, var(--surface) 45%, var(--red-tint) 135%); }
.warn { color: var(--amber); }

/* ---- panels / tables ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.panel .panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(var(--surface), var(--paper));
}
.panel .panel-head h2 { margin: 0; font-size: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
table[data-nosort] th { cursor: default; }
th:hover { color: var(--text); }
th[data-sort='asc']::after { content: ' ▲'; font-size: 9px; color: var(--brand); }
th[data-sort='desc']::after { content: ' ▼'; font-size: 9px; color: var(--brand); }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--brand-tint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
tfoot td { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: none; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---- badges ---- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge.re { background: var(--brand-tint); color: var(--brand); }
.badge.india { background: var(--amber-tint); color: var(--amber); }
.badge.fin { background: var(--green-tint); color: var(--green); }
.badge.liab { background: var(--red-tint); color: var(--red); }
.badge.paid { background: var(--green-tint); color: var(--green); }
.badge.unpaid { background: var(--red-tint); color: var(--red); }
.badge.na { background: var(--surface-2); color: var(--muted); }
.badge.expired { background: var(--red-tint); color: var(--red); }
.badge.soon { background: var(--amber-tint); color: var(--amber); }
.badge.ok { background: var(--green-tint); color: var(--green); }

/* ---- buttons ---- */
.btn {
  background: var(--brand); color: #fff; border: none; padding: 9px 16px;
  border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  font-family: var(--font-ui);
  box-shadow: 0 1px 2px rgba(48, 86, 211, 0.25);
  transition: background 0.12s;
}
.btn:hover { background: var(--brand-2); }
.btn.ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--surface); border: 1px solid #e5b6b2; color: var(--red); box-shadow: none; }
.btn.danger:hover { background: var(--red-tint); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }

/* ---- forms / modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(31, 43, 56, 0.4);
  display: none; align-items: flex-start; justify-content: center; z-index: 50; padding: 48px 16px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  width: 100%; max-width: 520px; box-shadow: var(--shadow-lift);
}
.modal .modal-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 600; font-size: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal .modal-head .modal-x {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 16px; line-height: 1; padding: 4px 7px; border-radius: 6px; font-family: var(--font-ui);
}
.modal .modal-head .modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal .modal-body { padding: 18px 20px; }
.modal .modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--paper); border-radius: 0 0 14px 14px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 9px 11px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px; font-family: var(--font-ui);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.field.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- misc ---- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 500;
  transition: all 0.12s; display: inline-block; margin-bottom: 4px;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 40px 20px; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }

select {
  font-family: var(--font-ui);
}

/* inputs rendered on cards use --bg as their fill (planning inputs etc.) */
.plan-input:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-tint); }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--paper); }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 36px 32px; width: 100%; max-width: 390px; box-shadow: var(--shadow-lift);
}
.login-card h1 { text-align: center; margin: 0 0 4px; }
.login-card h1::after { margin-left: auto; margin-right: auto; }
.login-card .subtitle { text-align: center; }
.login-error { color: var(--red); font-size: 13.5px; min-height: 18px; margin-top: 4px; }

/* ---- AI chat widget (bottom-right) ---- */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  font-size: 21px; box-shadow: 0 6px 20px rgba(48, 86, 211, 0.4);
  transition: transform 0.15s, background 0.12s;
}
.chat-fab:hover { background: var(--brand-2); transform: translateY(-2px); }
.chat-panel {
  position: fixed; right: 24px; bottom: 88px; z-index: 60;
  width: 384px; max-width: calc(100vw - 32px); height: 530px; max-height: calc(100vh - 130px);
  display: none; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lift); overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-head {
  display: flex; align-items: center; gap: 6px;
  padding: 13px 15px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
  background: var(--brand); color: #fff;
}
.chat-head .spacer { flex: 1; }
.chat-icon-btn {
  background: transparent; border: none; color: rgba(255, 255, 255, 0.8); cursor: pointer;
  font-size: 15px; padding: 2px 6px; border-radius: 6px;
}
.chat-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.15); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.chat-msg {
  max-width: 88%; padding: 9px 12px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.chat-typing { color: var(--muted); font-style: italic; }
.chat-empty { color: var(--muted); font-size: 13px; line-height: 1.8; padding: 10px 6px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); align-items: flex-end; background: var(--surface); }
.chat-deep {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted); cursor: pointer; user-select: none;
  padding: 8px 4px; white-space: nowrap;
}
.chat-deep input { accent-color: var(--brand); cursor: pointer; }
.chat-input textarea {
  flex: 1; resize: none; padding: 9px 11px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  font-size: 13.5px; font-family: var(--font-ui);
  min-height: 38px; max-height: 110px; overflow-y: hidden; line-height: 1.4;
}
.chat-msg.assistant.error { background: var(--red-tint); border-color: #e5b6b2; color: var(--red); }
.chat-input textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }

/* ---- scrollbars (webkit) ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   iPhone / mobile: native-app feel
   ============================================================ */
html { -webkit-text-size-adjust: 100%; }
body { touch-action: manipulation; } /* snappier taps, no double-tap zoom (dblclick-to-edit still works) */
.table-wrap { -webkit-overflow-scrolling: touch; }

@media (max-width: 700px) {
  /* layout + safe areas (notch / home indicator) */
  .container { padding: 16px 12px calc(84px + env(safe-area-inset-bottom)); }
  h1 { font-size: 21px; }
  .subtitle { margin-bottom: 16px; }

  /* top nav: app-bar that scrolls horizontally, respects the notch */
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    height: calc(54px + env(safe-area-inset-top));
    gap: 0;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav .brand { font-size: 16px; margin-right: 10px; }
  .nav .brand span[style] { display: none; } /* hide the Devanagari suffix on small screens */
  .nav .who { display: none; }
  .nav a.link { padding: 8px 10px; font-size: 13.5px; white-space: nowrap; }

  /* KPIs: two-up cards like a native summary screen */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 13px; border-radius: 12px; }
  .kpi .value { font-size: 19px; }
  .kpi .sub { font-size: 11.5px; }

  /* touch targets */
  .btn { padding: 11px 16px; font-size: 14px; }
  .btn.sm { padding: 8px 12px; font-size: 13px; }
  .chip { padding: 8px 14px; font-size: 13px; }
  th, td { padding: 10px 10px; }

  /* 16px inputs stop iOS Safari from zooming in on focus */
  .field input, .field select, .plan-input, .chat-input textarea,
  select, input[type='number'], input[type='text'], input[type='password'], input[type='date'] {
    font-size: 16px !important;
  }

  /* modals become bottom sheets */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    border-left: none; border-right: none; border-bottom: none;
    max-height: 92vh;
    display: flex; flex-direction: column;
  }
  .modal .modal-body { overflow-y: auto; }
  .modal .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); border-radius: 0; }

  /* chat: full-screen sheet, fab clears the home indicator */
  .chat-fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .chat-panel {
    right: 0; bottom: 0; left: 0;
    width: 100%; max-width: 100%;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0; border: none;
  }
  .chat-head { padding-top: calc(13px + env(safe-area-inset-top)); }
  .chat-input { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

  /* column-picker menu stays on screen */
  .col-picker .col-menu { right: -8px; }

  /* login card breathes on small screens */
  .login-card { padding: 28px 22px; }
}

/* ---- asset-class badges (vehicles, gold, personal) ---- */
.badge.veh { background: #e8f2f8; color: #1f6d96; }
.badge.gold { background: var(--amber-tint); color: var(--amber); }
.badge.pers { background: var(--surface-2); color: var(--muted); }

/* ---- guided setup wizard ---- */
.ob-modal { width: min(620px, calc(100vw - 32px)); }
.ob-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ob-head .ob-networth { margin-left: auto; text-align: right; }
.ob-head .ob-networth .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ob-head .ob-networth .value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background .15s; }
.ob-dots span.on { background: var(--brand); }
.ob-dots span.done { background: var(--green); }
.ob-body { padding: 20px; max-height: min(62vh, 560px); overflow-y: auto; }
.ob-cat { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.ob-cat .icon { font-size: 26px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: var(--brand-tint); border-radius: 12px; }
.ob-cat h2 { margin: 0; font-size: 18px; }
.ob-cat .blurb { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ob-items { margin: 12px 0 4px; }
.ob-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; background: var(--surface); }
.ob-item .nm { font-weight: 600; }
.ob-item .sub { color: var(--muted); font-size: 12px; }
.ob-item .val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.ob-item button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.ob-item button:hover { color: var(--red); }
.ob-form { border: 1px dashed var(--border); border-radius: 10px; padding: 14px; margin-top: 10px; background: var(--paper, var(--bg)); }
.ob-form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ob-form .grid .wide { grid-column: 1 / -1; }
.ob-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.ob-foot .spacer { flex: 1; }
.ob-welcome { text-align: center; padding: 18px 8px 8px; }
.ob-welcome .big { font-size: 40px; }
.ob-welcome h2 { margin: 10px 0 6px; }
.ob-welcome p { color: var(--muted); font-size: 14px; max-width: 420px; margin: 0 auto 14px; }
.ob-classlist { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 10px; }
.ob-classlist span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
@media (max-width: 560px) { .ob-form .grid { grid-template-columns: 1fr; } }

/* ---- wealth-mix donut interactions ---- */
#wealthPie path {
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1.2), opacity 0.18s ease, filter 0.28s ease;
  cursor: pointer;
}
#wealthPie path.active { filter: drop-shadow(0 3px 9px rgba(20, 30, 60, 0.32)); }
#wealthPie path.dim { opacity: 0.28; }
#wealthPie text { transition: opacity 0.15s ease; pointer-events: none; }
#wealthLegend [data-slice] { transition: background 0.15s ease, transform 0.15s ease; cursor: pointer; }
#wealthLegend [data-slice].active { background: var(--brand-tint); transform: translateX(2px); }

/* ---- quick-add asset-type picker ---- */
.ob-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ob-pick button {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  cursor: pointer; font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ob-pick button:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.ob-pick .icon { font-size: 21px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--brand-tint); border-radius: 10px; flex: none; }
.ob-pick .nm { display: block; font-weight: 600; }
.ob-pick .sub { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
@media (max-width: 560px) { .ob-pick { grid-template-columns: 1fr; } }

/* ---- wealth-mix panel (mock layout) ---- */
.wm-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wm-head .wm-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-tint); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.wm-head h2 { margin: 0; font-size: 17px; }
.wm-stats { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.wm-chip { border: 1px solid var(--border); border-radius: 10px; padding: 7px 14px; background: var(--paper); min-width: 150px; }
.wm-chip .label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.wm-chip .value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wm-chip .row { display: flex; gap: 16px; justify-content: space-between; font-size: 12.5px; padding: 1px 0; }
.wm-chip .row .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.wm-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; padding: 16px 20px; }
.wm-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.wm-donutcard { display: flex; flex-direction: column; align-items: center; gap: 14px; justify-content: center; }
.wm-note { background: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); display: flex; gap: 9px; align-items: flex-start; line-height: 1.4; }
.wm-bd-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.wm-bd-head .t { font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.wm-toggle { margin-left: auto; display: flex; background: var(--paper); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.wm-toggle button { border: 0; background: transparent; font: inherit; font-size: 12.5px; padding: 4px 11px; border-radius: 7px; color: var(--muted); cursor: pointer; }
.wm-toggle button.active { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 30, 60, 0.12); }
.wm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); column-gap: 30px; }
.wm-row { display: flex; align-items: center; gap: 9px; padding: 9px 6px; border-bottom: 1px solid var(--border); font-size: 13.5px; transition: background 0.15s; border-radius: 6px; cursor: pointer; }
.wm-row.active { background: var(--brand-tint); }
.wm-row .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.wm-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-row .strong { font-weight: 700; margin-left: auto; font-variant-numeric: tabular-nums; }
.wm-row .soft { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.wm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); }
.wm-tile { display: flex; gap: 12px; align-items: center; padding: 15px 20px; border-right: 1px solid var(--border); }
.wm-tile:last-child { border-right: 0; }
.wm-tile .ico { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--brand-tint); flex: none; }
.wm-tile .label { font-size: 12px; color: var(--muted); }
.wm-tile .big { font-size: 16px; font-weight: 700; line-height: 1.3; }
.wm-tile .sub { font-size: 12px; color: var(--muted); }
@media (max-width: 980px) {
  .wm-grid { grid-template-columns: 1fr; }
  .wm-tiles { grid-template-columns: 1fr 1fr; }
  .wm-tile { border-right: 0; border-bottom: 1px solid var(--border); }
}
