/* ============================================================
   AUM AI — Portfolio dashboard styles
   ============================================================ */

.port-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.port-title { font-size: clamp(32px, 4vw, 46px); letter-spacing: -0.03em; }
.port-sub { font-size: 16px; color: var(--ink-2); margin: 6px 0 0; }
.port-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); white-space: nowrap; }

.port-grid { display: grid; grid-template-columns: minmax(0,1fr) 372px; gap: 22px; align-items: start; }
.port-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.port-side { position: sticky; top: calc(var(--nav-h) + 18px); }

.card { padding: 24px; }
.card h3 { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.card h3 svg { color: var(--ink-3); }
.card-sub { font-size: 13.5px; color: var(--ink-3); margin: 6px 0 18px; }

/* Stat cards */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.stat-card { display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.stat-top { display: flex; gap: 12px; align-items: center; }
.stat-ic { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface-inset); color: var(--ink); }
.stat-label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.stat-sub { font-size: 12.5px; color: var(--ink-3); }
.stat-bottom { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.stat-spark { width: 100%; margin-top: auto; opacity: .85; }

/* Performance */
.perf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.perf-sub { font-size: 14px; margin-top: 6px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.perf-range-lbl { color: var(--ink-3); font-size: 12.5px; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.range-toggle, .filter-chips { display: inline-flex; gap: 3px; background: var(--surface-inset); border: 1px solid var(--border); border-radius: 11px; padding: 3px; }
.rt, .fchip { border: none; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); transition: all .2s var(--ease); white-space: nowrap; }
.rt.on, .fchip.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.port-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.alloc { display: flex; flex-direction: column; }
.alloc .donut-wrap { margin-top: auto; margin-bottom: auto; }

/* Accounts */
.accounts h3 { margin-bottom: 16px; }
.acc-list { display: flex; flex-direction: column; }
.acc-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.acc-row:first-child { border-top: none; }
.acc-logo { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-inset); font-family: var(--font-display); font-weight: 700; color: var(--ink-2); }
.acc-meta { display: flex; flex-direction: column; }
.acc-meta b { font-size: 15.5px; }
.acc-meta span { font-size: 12.5px; color: var(--ink-3); }
.acc-bal { margin-left: auto; font-size: 17px; font-weight: 600; }

/* Holdings table */
.holdings-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.holdings-head h3 { margin: 0; }
.table-scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.htable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.htable th { text-align: left; padding: 10px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap; }
.htable th.num { text-align: right; }
.th-in { display: inline-flex; align-items: center; gap: 5px; }
.htable th.num .th-in { flex-direction: row-reverse; }
.th-sort { color: var(--ink-faint); display: inline-flex; }
.htable th:hover .th-sort { color: var(--ink-2); }
.hrow { cursor: pointer; transition: background .15s; }
.hrow td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hrow:hover { background: var(--surface-2); }
.hrow.open { background: var(--surface-inset); }
.htable td.num { text-align: right; }
.htable td.strong { font-weight: 600; color: var(--ink); }
.hsym { display: flex; flex-direction: column; gap: 5px; }
.hsym b { font-size: 15px; font-weight: 700; }
.badge-row { display: flex; align-items: center; gap: 8px; }
.hsector { font-size: 12px; color: var(--ink-3); }
.hdetail-row td { padding: 0 14px; border-bottom: 1px solid var(--border); }
.hdetail { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 14px 4px 18px; animation: fadeIn .25s var(--ease); }
.hd { display: flex; flex-direction: column; gap: 3px; }
.hd-l { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.hd-v { font-size: 14px; font-weight: 600; }

/* ---------------- Action Hub chat ---------------- */
.hub { display: flex; flex-direction: column; padding: 0; height: min(78vh, 760px); overflow: hidden; }
.hub-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.hub-title { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.hub-title svg { color: var(--ink-3); }
.hub-head-actions { display: flex; gap: 2px; }
.hub-scroll { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.hub-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; }
.hub-empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-inset); color: var(--ink-3); margin-bottom: 4px; }
.hub-empty h4 { font-size: 18px; }
.hub-empty p { font-size: 13.5px; color: var(--ink-3); margin: 0 0 8px; max-width: 240px; line-height: 1.5; }
.hub-starters { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.hub-chip { padding: 10px 14px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); text-align: left; transition: all .2s var(--ease); }
.hub-chip:hover { border-color: var(--accent); color: var(--ink); background: color-mix(in oklch, var(--brand-blue) 5%, var(--surface)); transform: translateX(2px); }
.hub-chip.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }

.msg { display: flex; gap: 9px; align-items: flex-start; animation: fadeUp .35s var(--ease) both; }
.msg-user { flex-direction: row-reverse; }
.msg-av { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-inset); }
.msg-body { max-width: 86%; }
.msg-user .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.msg-text { font-size: 14px; line-height: 1.55; padding: 11px 14px; border-radius: 14px; }
.msg-ai .msg-text { background: var(--surface-inset); color: var(--ink); border-bottom-left-radius: 5px; }
.msg-user .msg-text { background: var(--solid-bg); color: var(--solid-ink); border-bottom-right-radius: 5px; }
.msg-bullets { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.msg-table-wrap { margin-top: 10px; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.msg-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.msg-table th { text-align: left; padding: 8px 11px; background: var(--surface-2); color: var(--ink-3); font-weight: 600; font-size: 11.5px; }
.msg-table th.num, .msg-table td.num { text-align: right; }
.msg-table td { padding: 8px 11px; border-top: 1px solid var(--border); color: var(--ink-2); }
.msg-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 0 35px; }

.typing { display: flex; gap: 4px; padding: 13px 14px; background: var(--surface-inset); border-radius: 14px; border-bottom-left-radius: 5px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: typing 1.2s var(--ease) infinite; }
.typing span:nth-child(2){ animation-delay: .2s; } .typing span:nth-child(3){ animation-delay: .4s; }
@keyframes typing { 0%,60%,100%{ transform: translateY(0); opacity:.4;} 30%{ transform: translateY(-4px); opacity:1;} }

.hub-input { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.hub-clip { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: none; background: none; color: var(--ink-3); border-radius: 9px; }
.hub-clip:hover { background: var(--surface-inset); color: var(--ink); }
.hub-input input { flex: 1; min-width: 0; border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 11px; padding: 11px 14px; font-family: inherit; font-size: 14px; color: var(--ink); outline: none; transition: border-color .2s; }
.hub-input input:focus { border-color: var(--accent); }
.hub-send { width: 38px; height: 38px; flex: none; border: none; border-radius: 11px; background: var(--solid-bg); color: var(--solid-ink); display: grid; place-items: center; transition: all .2s var(--ease); }
.hub-send:hover:not(:disabled) { transform: translateY(-1px); }
.hub-send:disabled { opacity: .4; }
.hub-fine { text-align: center; font-size: 11px; color: var(--ink-faint); margin: 0; padding: 0 0 12px; }

.hub-max { position: fixed; inset: auto 22px 22px auto; width: min(540px, calc(100vw - 44px)); height: min(82vh, 820px); z-index: 200; box-shadow: var(--shadow-lg); }

@media (max-width: 1080px){
  .port-grid { grid-template-columns: 1fr; }
  .port-side { position: static; }
  .hub { height: 600px; }
}
@media (max-width: 680px){
  .stat-row, .port-2col { grid-template-columns: 1fr; }
}
