:root {
  --ink: #14201d;
  --muted: #68736d;
  --paper: #f4f0e7;
  --paper-bright: #fbf9f4;
  --forest: #173c34;
  --forest-light: #286455;
  --acid: #c9f04a;
  --coral: #ef715f;
  --line: rgba(20, 32, 29, .14);
  --shadow: 0 22px 70px rgba(38, 45, 40, .10);
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: "Avenir Next", "Avenir", "Gill Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -5%, rgba(201, 240, 74, .16), transparent 31rem),
    radial-gradient(circle at 95% 18%, rgba(239, 113, 95, .10), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }
.paper-noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .26;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.login-shell {
  min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .8fr) 1.2fr;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  background: var(--forest); color: var(--paper-bright);
}
.login-context { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 6vw, 6rem); border-right: 1px solid rgba(255,255,255,.12); }
.login-context h1 { margin: 0 0 3rem; font: 400 clamp(2.8rem, 5vw, 5rem)/1 var(--serif); letter-spacing: -.045em; }
.login-context dl { width: 100%; max-width: 28rem; margin: 0; border-top: 1px solid rgba(255,255,255,.16); }
.login-context dl div { display: flex; justify-content: space-between; gap: 2rem; padding: .9rem 0; border-bottom: 1px solid rgba(255,255,255,.16); font-size: .72rem; }
.login-context dt { color: rgba(255,255,255,.48); }
.login-context dd { margin: 0; text-align: right; }
.login-card { align-self: center; width: min(620px, 100%); padding: 5rem clamp(2rem, 8vw, 8rem); animation: rise .45s ease both; }
.eyebrow { margin: 0 0 1rem; text-transform: uppercase; letter-spacing: .17em; font-size: .68rem; font-weight: 700; }
.login-card h2 { margin: 0; font: 400 clamp(2.6rem, 4vw, 4.6rem)/1 var(--serif); letter-spacing: -.045em; }
.login-copy { max-width: 31rem; margin: 1.5rem 0 2rem; color: rgba(255,255,255,.68); font-size: .95rem; line-height: 1.65; }
.primary-button {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 2rem; min-width: 15rem;
  border: 0; background: var(--acid); color: var(--ink); padding: 1rem 1.2rem; font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(201,240,74,.18); }
.primary-button span { font-size: 1.35rem; }
.primary-button.dark { background: var(--ink); color: white; width: 100%; margin-top: 1.5rem; }
.code-form { margin-top: 1.8rem; }
.code-form label { display: block; margin-bottom: .6rem; font-size: .75rem; color: rgba(255,255,255,.68); }
.code-row { display: flex; max-width: 22rem; }
.code-row input { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.25); border-right: 0; color: white; background: rgba(255,255,255,.06); padding: .9rem 1rem; font-size: 1.35rem; letter-spacing: .3em; outline: none; }
.code-row input:focus { border-color: var(--acid); }
.square-button { width: 3.6rem; border: 0; background: var(--acid); font-size: 1.5rem; }
.form-status { min-height: 1.3rem; font-size: .82rem; color: var(--acid); }
.security-line { margin-top: 2.2rem; color: rgba(255,255,255,.48); font-size: .72rem; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; margin-right: .5rem; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 0 rgba(201,240,74,.5); animation: pulse 2s infinite; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: calc(72px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top) clamp(1.2rem, 4vw, 4.5rem) 0; background: rgba(244,240,231,.88); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-glyph { position: relative; display: grid; place-items: center; width: 38px; height: 38px; background: var(--forest); color: var(--acid); font: italic 1.8rem var(--serif); }
.brand-glyph span { position: absolute; width: 8px; height: 8px; right: -3px; top: -3px; background: var(--coral); border-radius: 50%; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .8rem; letter-spacing: .12em; }
.brand small { color: var(--muted); font: italic .88rem var(--serif); }
.desktop-nav { display: flex; gap: 2rem; font-size: .76rem; font-weight: 600; }
.desktop-nav a { position: relative; padding: .5rem 0; }
.desktop-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--ink); transition: right .2s; }
.desktop-nav a:hover::after { right: 0; }
.top-actions { display: flex; align-items: center; gap: .6rem; }
.nav-chat { border: 1px solid var(--ink); background: var(--ink); color: white; padding: .55rem .8rem; font-size: .68rem; }
.freshness-badge { border: 1px solid var(--line); background: rgba(255,255,255,.48); padding: .55rem .75rem; font-size: .68rem; color: var(--muted); }
.freshness-badge i { display: inline-block; width: 6px; height: 6px; margin-right: .4rem; border-radius: 50%; background: #d09a38; }
.freshness-badge.is-fresh i { background: #48a779; }
.freshness-badge.is-stale i { background: var(--coral); }
.icon-button { min-height: 34px; border: 1px solid var(--line); background: transparent; padding: 0 .7rem; color: var(--muted); font-size: .64rem; }

main { max-width: 1500px; margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 4.5rem); }
.portfolio-header { min-height: 205px; padding: 3.8rem 0 2rem; display: flex; justify-content: space-between; align-items: flex-end; gap: 3rem; }
.portfolio-header h1 { margin: 0; font: 400 clamp(2.6rem, 4.6vw, 4.8rem)/1 var(--serif); letter-spacing: -.045em; }
.source-strip { display: grid; grid-template-columns: repeat(3, minmax(115px, 1fr)); min-width: min(620px, 55vw); margin: 0; border: 1px solid var(--line); background: rgba(251,249,244,.5); }
.source-strip div { padding: .8rem 1rem; border-left: 1px solid var(--line); }
.source-strip div:first-child { border-left: 0; }
.source-strip dt { color: var(--muted); font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; }
.source-strip dd { margin: .35rem 0 0; font-size: .7rem; font-weight: 600; }

.kpi-grid { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); border: 1px solid var(--line); background: rgba(251,249,244,.58); box-shadow: var(--shadow); }
.kpi { min-height: 184px; padding: 1.5rem; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.kpi:first-child { border-left: 0; }
.kpi-primary { background: var(--forest); color: white; }
.kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.kpi-primary .kpi-label { color: rgba(255,255,255,.58); }
.kpi-label span { float: right; font-size: .6rem; opacity: .7; }
.kpi-value { font: 400 clamp(2rem, 3.4vw, 3.6rem)/1 var(--serif); letter-spacing: -.04em; }
.kpi-foot { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .67rem; }
.kpi-primary .kpi-foot { color: rgba(255,255,255,.58); }
.positive { color: #378a66 !important; }
.negative { color: var(--coral) !important; }

.panel { background: rgba(251,249,244,.72); border: 1px solid var(--line); box-shadow: var(--shadow); }
.performance-panel { margin-top: 1.5rem; padding: clamp(1.4rem, 3vw, 2.7rem); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.panel-heading.compact { align-items: center; }
.panel-heading h2 { margin: 0; font: 400 clamp(2.1rem, 3.7vw, 3.8rem)/1 var(--serif); letter-spacing: -.045em; }
.segmented { display: flex; border: 1px solid var(--line); padding: 3px; background: rgba(255,255,255,.45); }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: .65rem .85rem; font-size: .67rem; }
.segmented button.is-active { background: var(--ink); color: white; }
.chart-summary { margin-top: 2.4rem; display: flex; align-items: baseline; gap: 1rem; }
.chart-summary strong { font: 2.7rem var(--serif); }
.chart-summary span { color: var(--muted); font-size: .72rem; }
.chart-wrap { position: relative; min-height: 270px; margin-top: .5rem; }
#performance-chart { display: block; width: 100%; height: 270px; overflow: visible; }
.chart-grid { stroke: rgba(20,32,29,.08); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--forest); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-line.is-negative { stroke: var(--coral); }
.chart-area { opacity: .75; }
.chart-dot { fill: var(--acid); stroke: var(--forest); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-dot.is-negative { fill: var(--paper-bright); stroke: var(--coral); }
.chart-bar-positive { fill: var(--forest-light); }
.chart-bar-negative { fill: var(--coral); }
.chart-zero { stroke: rgba(20,32,29,.35); stroke-dasharray: 4 5; }
.chart-y-label { fill: var(--muted); font: 18px var(--sans); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: italic 1.1rem var(--serif); }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .62rem; }
.chart-meta { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .62rem; }
.chart-meta span { padding: .7rem .8rem; border-left: 1px solid var(--line); }
.chart-meta span:first-child { border-left: 0; }
.method-note { margin-top: .8rem; color: var(--muted); font-size: .66rem; }
.method-note summary { display: flex; justify-content: space-between; align-items: center; padding: .65rem 0; cursor: pointer; list-style: none; font-weight: 600; }
.method-note summary::-webkit-details-marker { display: none; }
.method-note summary::after { content: "+"; font-size: 1rem; font-weight: 400; }
.method-note[open] summary::after { content: "−"; }
.method-note p { max-width: 78rem; margin: 0; padding: 0 0 .8rem; line-height: 1.6; }

.split-grid { display: grid; grid-template-columns: 1.5fr .8fr; gap: 1.5rem; margin-top: 1.5rem; }
.allocation-panel, .pm-panel { padding: clamp(1.4rem, 3vw, 2.7rem); min-height: 480px; }
.quality-pill { padding: .4rem .65rem; background: rgba(201,240,74,.25); border: 1px solid rgba(23,60,52,.15); color: var(--forest); font-size: .62rem; }
.allocation-content { display: grid; grid-template-columns: minmax(210px, .8fr) 1.2fr; align-items: center; gap: 2rem; margin-top: 2.7rem; }
.donut-wrap { display: grid; place-items: center; }
.donut { width: min(260px, 25vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--forest) 0 100%); }
.donut::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--paper-bright); box-shadow: inset 0 0 0 1px var(--line); }
.donut > div { position: relative; z-index: 1; text-align: center; }
.donut strong { display: block; font: 2.4rem var(--serif); }
.donut span { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; }
.sector-list { display: grid; gap: .8rem; }
.sector-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: .7rem; font-size: .72rem; }
.sector-row i { width: 9px; height: 9px; border-radius: 2px; }
.sector-row span { color: var(--muted); }
.sector-row strong { font-size: .72rem; }
.caption { margin: 2rem 0 0; color: var(--muted); font-size: .64rem; line-height: 1.6; }
.pm-panel { position: relative; overflow: hidden; color: white; background: var(--forest); }
.pm-panel::after { content: ""; position: absolute; width: 260px; height: 260px; right: -130px; bottom: -130px; border: 1px solid rgba(201,240,74,.3); border-radius: 50%; box-shadow: 0 0 0 48px rgba(201,240,74,.04); }
.pm-signal { position: absolute; right: 1.5rem; top: 1.5rem; color: rgba(255,255,255,.58); font-size: .65rem; }
.pm-signal span { display: inline-block; width: 6px; height: 6px; margin-right: .35rem; border-radius: 50%; background: var(--acid); }
.pm-panel .eyebrow { color: rgba(255,255,255,.58); margin-top: 2.8rem; }
.pm-panel h2 { margin: 0 0 1rem; color: var(--acid); font: 3rem var(--serif); }
.pm-copy { min-height: 6rem; color: rgba(255,255,255,.7); font: 1rem/1.55 var(--serif); }
.pm-meta { margin: 1.8rem 0; border-top: 1px solid rgba(255,255,255,.15); }
.pm-meta div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid rgba(255,255,255,.15); font-size: .67rem; }
.pm-meta dt { color: rgba(255,255,255,.48); }
.pm-meta dd { margin: 0; text-align: right; }
.pm-panel .primary-button { position: relative; z-index: 1; background: var(--acid); color: var(--ink); }

.positions-panel { margin: 1.5rem 0 3rem; padding: clamp(1.4rem, 3vw, 2.7rem); }
.table-tools { display: flex; gap: .35rem; }
.filter-button { border: 1px solid var(--line); background: transparent; padding: .5rem .75rem; font-size: .65rem; color: var(--muted); }
.filter-button.is-active { background: var(--ink); color: white; }
.table-scroll { overflow-x: auto; margin-top: 2rem; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { padding: .8rem .6rem; border-bottom: 1px solid var(--line); text-align: right; color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
th:first-child { text-align: left; }
td { padding: 1rem .6rem; border-bottom: 1px solid var(--line); text-align: right; font-size: .75rem; }
td:first-child { text-align: left; }
.asset-cell { display: flex; align-items: center; gap: .8rem; }
.asset-symbol { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; background: rgba(23,60,52,.08); color: var(--forest); font: 700 .62rem var(--sans); }
.asset-cell strong, .asset-cell small { display: block; }
.asset-cell small { max-width: 330px; margin-top: .15rem; overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.weight-bar { display: inline-block; width: 60px; height: 3px; margin-right: .6rem; background: rgba(20,32,29,.08); vertical-align: middle; }
.weight-bar i { display: block; height: 100%; background: var(--forest-light); }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .62rem; }

.offline-shell { min-height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: calc(2rem + env(safe-area-inset-top)) 1.5rem calc(2rem + env(safe-area-inset-bottom)); }
.offline-shell .brand-glyph { width: 56px; height: 56px; margin-bottom: 2rem; font-size: 2.7rem; }
.offline-shell h1 { margin: 0; font: 400 clamp(2.8rem, 10vw, 4.5rem)/1 var(--serif); letter-spacing: -.045em; }
.offline-shell p:not(.eyebrow) { max-width: 34rem; margin: 1.4rem 0 1.8rem; color: var(--muted); line-height: 1.65; }
.offline-shell .primary-button { width: auto; min-width: 11rem; }

.chat-fab { position: fixed; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom)); z-index: 42; width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--ink); color: var(--acid); box-shadow: 0 12px 35px rgba(20,32,29,.24); font-size: 1.25rem; }
.chat-fab i { position: absolute; right: 4px; top: 4px; width: 10px; height: 10px; border: 2px solid var(--paper); border-radius: 50%; background: #48a779; }
.chat-drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--paper-bright); transform: translateX(105%); transition: transform .35s cubic-bezier(.22,.9,.28,1); box-shadow: -30px 0 80px rgba(20,32,29,.18); }
.chat-drawer.is-open { transform: translateX(0); }
.chat-drawer > header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.chat-drawer > header > div { display: flex; align-items: center; gap: .75rem; }
.chat-drawer header strong, .chat-drawer header small { display: block; }
.chat-drawer header small { margin-top: .15rem; color: var(--muted); font-size: .62rem; }
.chat-drawer header small i { display: inline-block; width: 6px; height: 6px; margin-right: .3rem; background: #48a779; border-radius: 50%; }
.chat-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--forest); color: var(--acid); font: 700 .7rem var(--sans); }
.chat-drawer header button { border: 0; background: transparent; font-size: 1.6rem; color: var(--muted); }
.chat-context { padding: .75rem 1.2rem; background: rgba(201,240,74,.16); color: var(--forest); font-size: .64rem; line-height: 1.5; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.2rem; }
.message { display: flex; margin-bottom: 1rem; }
.message p { max-width: 85%; margin: 0; padding: .85rem 1rem; border-radius: 2px 14px 14px 14px; background: rgba(23,60,52,.08); font: .9rem/1.55 var(--serif); white-space: pre-wrap; }
.message.user { justify-content: flex-end; }
.message.user p { border-radius: 14px 2px 14px 14px; background: var(--forest); color: white; font-family: var(--sans); font-size: .78rem; }
.message.pending p::after { content: ""; display: inline-block; width: 18px; height: 6px; margin-left: .5rem; background: radial-gradient(circle, var(--forest) 2px, transparent 3px) 0 0 / 6px 6px; animation: drift .8s linear infinite; }
.chat-form { display: flex; align-items: flex-end; gap: .6rem; padding: 1rem; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; min-height: 48px; max-height: 150px; resize: vertical; border: 1px solid var(--line); background: white; padding: .8rem; outline: none; }
.chat-form textarea:focus { border-color: var(--forest); }
.chat-form button { width: 46px; height: 46px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--acid); color: var(--ink); font-size: 1.2rem; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 45; pointer-events: none; opacity: 0; background: rgba(20,32,29,.24); backdrop-filter: blur(2px); transition: opacity .25s; }
.drawer-backdrop.is-open { pointer-events: auto; opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 80; max-width: min(90vw, 480px); padding: .85rem 1rem; color: white; background: var(--ink); font-size: .72rem; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .25s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.reveal { animation: rise .65s ease both; }
.reveal:nth-of-type(2) { animation-delay: .08s; }
.reveal:nth-of-type(3) { animation-delay: .14s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(201,240,74,0); } 100% { box-shadow: 0 0 0 0 rgba(201,240,74,0); } }
@keyframes drift { to { background-position: 6px 0; } }

@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .portfolio-header { align-items: flex-start; flex-direction: column; gap: 1.5rem; }
  .source-strip { width: 100%; min-width: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .kpi:nth-child(4) { border-top: 1px solid var(--line); }
  .split-grid { grid-template-columns: 1fr; }
  .allocation-content { grid-template-columns: .8fr 1.2fr; }
  .donut { width: min(240px, 34vw); }
}

@media (max-width: 680px) {
  .login-shell { display: block; }
  .login-context { min-height: auto; padding: 2.5rem 1.3rem 2rem; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .login-context h1 { margin-bottom: 1.5rem; font-size: 2.6rem; }
  .login-context dl { display: none; }
  .login-card { padding: 2.5rem 1.3rem 3rem; }
  .login-card h2 { font-size: 3rem; }
  .login-copy { font-size: .92rem; }
  .topbar { height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) .75rem 0; }
  .brand strong { font-size: .7rem; }
  .brand small { display: none; }
  .nav-chat { display: block; padding: .5rem .6rem; }
  .freshness-badge { max-width: 92px; overflow: hidden; padding: .5rem .55rem; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 0 1rem; }
  .portfolio-header { padding: 2.5rem 0 1.5rem; }
  .portfolio-header h1 { font-size: 3rem; }
  .source-strip { grid-template-columns: 1fr; }
  .source-strip div { border-left: 0; border-top: 1px solid var(--line); }
  .source-strip div:first-child { border-top: 0; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { min-height: 150px; border-left: 0; border-top: 1px solid var(--line); }
  .kpi:first-child { border-top: 0; }
  .panel-heading { flex-direction: column; }
  .performance-panel { margin-top: 1rem; padding: 1rem; }
  .performance-panel .panel-heading { gap: 1rem; }
  .performance-panel .panel-heading h2 { font-size: 2.25rem; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented button { flex: 1; padding: .65rem .45rem; white-space: nowrap; }
  .chart-summary { display: block; margin-top: 1.35rem; }
  .chart-summary strong { display: block; font-size: 2.5rem; }
  .chart-summary span { display: block; margin-top: .35rem; }
  .chart-wrap, #performance-chart { min-height: 178px; height: 178px; }
  .chart-y-label { font-size: 20px; }
  .chart-axis { margin-top: .25rem; }
  .chart-meta { grid-template-columns: 1fr 1fr; }
  .chart-meta span { padding: .6rem; }
  .chart-meta span:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
  .method-note { margin-top: .4rem; }
  .allocation-content { grid-template-columns: 1fr; }
  .donut { width: 220px; }
  .table-tools { width: 100%; }
  .filter-button { flex: 1; }
  footer { flex-direction: column; }
  .chat-drawer { width: 100vw; }
  .chat-fab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Account identity stays beside the portfolio, including on narrow screens. */
.broker-picker { display: flex; align-items: center; gap: .65rem; margin-top: 1rem; font-size: .85rem; }
.broker-picker select { min-height: 44px; max-width: 100%; padding: .5rem .75rem; color: inherit; border: 1px solid #b8c2b9; background: #f7f5ef; font: inherit; }
.broker-sync-status { max-width: 48rem; color: #61746c; font-size: .85rem; line-height: 1.5; }
