:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --line: #dce2e7;
  --line-strong: #c4cdd5;
  --text: #17212b;
  --muted: #66727d;
  --green: #13795b;
  --green-soft: #e7f5ef;
  --red: #b4232f;
  --red-soft: #fcebed;
  --amber: #9a6400;
  --amber-soft: #fff4d6;
  --blue: #2463a7;
  --blue-soft: #eaf2fb;
  --focus: #2f73bd;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 14px; letter-spacing: 0; }
button, select { font: inherit; letter-spacing: 0; }
button:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.login-page { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(20px, 6vw, 32px); width: min(100%, 400px); }
.login-card h1 { font-size: 24px; margin: 24px 0 20px; }
.login-card label { display: block; font-weight: 650; margin: 0 0 6px; }
.login-card input { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px; color: var(--text); font: inherit; font-size: 16px; min-height: 44px; padding: 8px 10px; width: 100%; }
.login-card input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.login-card input + label { margin-top: 16px; }
.login-card button { background: #192d3d; border: 1px solid transparent; border-radius: 5px; color: white; cursor: pointer; font-weight: 700; margin-top: 20px; min-height: 44px; width: 100%; }
.login-card button:hover { background: #25445b; }
#login-error { color: var(--red); margin: 12px 0 0; }

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand-block { align-items: center; display: flex; gap: 10px; }
.brand-mark { align-items: center; background: #192d3d; color: white; display: flex; font-size: 11px; font-weight: 800; height: 32px; justify-content: center; width: 32px; }
.brand-block strong { display: block; font-size: 15px; }
.brand-block span { color: var(--muted); display: block; font-size: 11px; margin-top: 2px; }
.topbar-status { align-items: center; color: var(--muted); display: flex; gap: 14px; }
.topbar-status time { font-variant-numeric: tabular-nums; font-size: 12px; }
.status-dot { align-items: center; display: inline-flex; font-size: 12px; font-weight: 700; gap: 7px; }
.status-dot::before { background: currentColor; border-radius: 50%; content: ""; height: 7px; width: 7px; }
.status-dot.good { color: var(--green); }
.status-dot.bad { color: var(--red); }
.status-dot.neutral { color: var(--muted); }
.icon-button { align-items: center; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); cursor: pointer; display: inline-flex; font-size: 19px; height: 34px; justify-content: center; padding: 0; width: 34px; }
.icon-button:hover { background: var(--surface-muted); }

.app-shell { display: grid; grid-template-columns: 168px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { background: #edf1f4; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; padding: 18px 12px; }
.nav-button { background: transparent; border: 0; color: #4f5d68; cursor: pointer; font-size: 13px; font-weight: 650; min-height: 38px; padding: 0 12px; text-align: left; }
.nav-button:hover { background: #e1e7eb; color: var(--text); }
.nav-button.active { background: var(--surface); border-left: 3px solid var(--blue); color: var(--text); padding-left: 9px; }

.main-content { min-width: 0; padding: 24px 28px 48px; }
.view { display: none; }
.view.active { display: block; }
.view-heading { align-items: flex-end; display: flex; justify-content: space-between; margin-bottom: 20px; min-height: 46px; }
.view-heading h1 { font-size: 24px; line-height: 1.2; margin: 2px 0 0; }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; margin: 0; text-transform: uppercase; }
.view-meta { color: var(--muted); font-size: 10px; margin-top: 6px; overflow-wrap: anywhere; }
.summary-counters { align-items: center; color: var(--muted); display: flex; gap: 18px; }
.summary-counters strong { color: var(--text); font-size: 18px; margin-left: 5px; }
.metric-strip { display: grid; gap: 1px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.metric-item { background: var(--surface); border: 1px solid var(--line); min-height: 72px; padding: 12px 14px; }
.metric-label { color: var(--muted); font-size: 10px; font-weight: 750; }
.metric-value { font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 750; margin-top: 8px; overflow-wrap: anywhere; }
.performance-controls { align-items: center; display: flex; gap: 10px; }
.performance-controls select { min-width: 260px; }
.segmented-control { background: #e7ecef; border: 1px solid var(--line); display: inline-flex; padding: 2px; }
.segmented-control button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; height: 29px; min-width: 42px; padding: 0 8px; }
.segmented-control button:hover { color: var(--text); }
.segmented-control button.active { background: var(--surface); box-shadow: 0 1px 2px rgba(22, 34, 44, .1); color: var(--text); }
.trade-status-strip { background: #e9eef1; border: 1px solid var(--line); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 14px; }
.trade-status-strip > span { border-right: 1px solid var(--line-strong); min-height: 48px; padding: 8px 12px; }
.trade-status-strip > span:last-child { border-right: 0; }
.trade-status-strip small { color: var(--muted); display: block; font-size: 9px; font-weight: 750; }
.trade-status-strip strong { display: block; font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 5px; overflow-wrap: anywhere; }

.account-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.account-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; min-height: 150px; padding: 16px; }
.account-card header { align-items: center; display: flex; justify-content: space-between; }
.account-name { font-size: 13px; font-weight: 800; }
.account-id { color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.gate-badge, .state-badge { border-radius: 3px; display: inline-flex; font-size: 10px; font-weight: 800; padding: 4px 6px; white-space: nowrap; }
.gate-badge.active, .state-badge.good { background: var(--green-soft); color: var(--green); }
.gate-badge.frozen, .state-badge.bad { background: var(--red-soft); color: var(--red); }
.gate-badge.uninitialized, .state-badge.neutral { background: #edf1f4; color: var(--muted); }
.state-badge.warning { background: var(--amber-soft); color: var(--amber); }
.side-badge { border-left: 3px solid; display: inline-flex; font-size: 10px; font-weight: 800; padding: 3px 6px; white-space: nowrap; }
.side-badge.buy { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.side-badge.sell { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.account-equity { font-size: 24px; font-variant-numeric: tabular-nums; font-weight: 760; margin-top: 20px; white-space: nowrap; }
.account-change { align-items: center; display: flex; font-size: 12px; justify-content: space-between; margin-top: 8px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.muted { color: var(--muted); }

.overview-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.panel-heading, .section-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 12px; }
.panel-heading h2, .section-heading h2 { font-size: 14px; margin: 0; }
.panel-heading select, .view-heading select, .filters select { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); height: 34px; max-width: 380px; padding: 0 28px 0 9px; }
.chart-panel { min-height: 334px; position: relative; }
.chart-panel.large { min-height: 410px; }
.performance-chart-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); margin-bottom: 14px; }
.chart-heading { min-height: 28px; }
.chart-legend { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: 10px; gap: 12px; justify-content: flex-end; }
.chart-legend span { align-items: center; display: inline-flex; gap: 5px; white-space: nowrap; }
.chart-legend i { display: inline-block; height: 3px; width: 14px; }
.swatch-blue { background: #2463a7; }
.swatch-red { background: #b5473c; }
.swatch-green { background: #13795b; }
.chart-stage { height: 260px; min-width: 0; overflow: hidden; position: relative; }
.large-stage { height: 320px; }
.activity-stage { height: 220px; }
.chart-stage canvas { height: 100%; width: 100%; }
.chart-tooltip { background: #17212b; color: #fff; font-size: 10px; line-height: 1.45; max-width: calc(100% - 16px); min-width: 142px; padding: 8px 10px; pointer-events: none; position: absolute; z-index: 5; }
.chart-tooltip strong { display: block; font-size: 11px; margin-bottom: 5px; }
.chart-tooltip span { align-items: center; display: flex; gap: 10px; justify-content: space-between; white-space: nowrap; }
.chart-tooltip em { font-style: normal; font-variant-numeric: tabular-nums; font-weight: 700; }
.chart-tooltip i { display: inline-block; flex: 0 0 auto; height: 3px; width: 10px; }
.activity-panel { min-height: 410px; }
.turnover-summary { border-top: 1px solid var(--line); display: flex; flex-direction: column; font-size: 10px; gap: 5px; margin-top: 8px; min-height: 34px; padding-top: 8px; }
.turnover-summary strong { color: var(--text); }
.holdings-plans-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); margin-bottom: 14px; }
.data-panel { min-height: 190px; min-width: 0; padding: 0; }
.data-panel .panel-heading { margin: 0; min-height: 48px; padding: 0 16px; }
.count-label { background: #edf1f4; color: var(--muted); font-size: 10px; font-weight: 800; min-width: 24px; padding: 3px 6px; text-align: center; }
.embedded-table { overflow-x: auto; }
.embedded-table table { min-width: 620px; }
.embedded-table td { height: 44px; }
.data-panel .status-list { padding: 0 16px 8px; }
.data-panel > .muted { padding: 16px; }
#contributions-section { margin-top: 14px; }
canvas { display: block; height: 260px; max-width: 100%; width: 100%; }
.empty-state { align-items: center; color: var(--muted); display: flex; inset: 56px 16px 16px; justify-content: center; position: absolute; }
.hidden { display: none !important; }
.text-button { background: transparent; border: 0; color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; padding: 4px; }

.compact-list { display: flex; flex-direction: column; gap: 1px; }
.compact-list.horizontal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-row { align-items: center; border-bottom: 1px solid #edf0f2; cursor: pointer; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; min-height: 48px; padding: 7px 2px; }
.compact-row:last-child { border-bottom: 0; }
.compact-row:hover { background: var(--surface-muted); }
.compact-primary { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-secondary { color: var(--muted); font-size: 10px; margin-top: 3px; }
.incidents-band { margin-top: 14px; }

.table-section { background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.table-section + .table-section { margin-top: 14px; }
.table-section > .section-heading { left: 0; margin: 0; min-height: 48px; min-width: 760px; padding: 12px 14px 0; position: sticky; }
table { border-collapse: collapse; min-width: 760px; width: 100%; }
th { background: var(--surface-muted); color: var(--muted); font-size: 10px; font-weight: 800; height: 38px; padding: 0 12px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { border-top: 1px solid #edf0f2; font-size: 12px; height: 48px; padding: 8px 12px; white-space: nowrap; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f5f8fa; }
td.numeric { font-variant-numeric: tabular-nums; text-align: right; }
.filters { display: flex; gap: 8px; }
.table-secondary { color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.strategy-summary-section { margin-bottom: 14px; }
.obligation-summary-section { margin-bottom: 14px; }
.obligation-detail-section { margin-bottom: 14px; }
.obligation-table { min-width: 1480px; }
.metric-value.compact { font-size: 15px; }
.strategy-summary-table { min-width: 1480px; }
.strategy-detail-section { margin-bottom: 14px; }
.strategy-detail-table { min-width: 2300px; }
.strategy-holdings-table { min-width: 1250px; }
.strategy-id { color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.holdings-cell { min-width: 180px; white-space: normal; }
.holding-token { display: inline-flex; gap: 4px; margin: 2px 10px 2px 0; white-space: nowrap; }
.decision-statuses { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.decision-status { align-items: center; display: inline-flex; gap: 3px; }
.decision-status > span:last-child { color: var(--muted); font-size: 10px; }

.incident-list { display: flex; flex-direction: column; gap: 8px; }
.incident-item { align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 6px; cursor: pointer; display: grid; gap: 14px; grid-template-columns: 100px minmax(0, 1fr) 150px; min-height: 72px; padding: 12px 14px; }
.incident-badges { display: grid; justify-items: start; gap: 4px; }
.incident-item.critical { border-left-color: var(--red); }
.incident-item.warning { border-left-color: var(--amber); }
.incident-item:hover { border-color: var(--line-strong); }
.incident-title { font-weight: 760; }
.incident-detail { color: var(--muted); font-size: 11px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.operations-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.status-list { display: flex; flex-direction: column; }
.status-row { align-items: center; border-top: 1px solid #edf0f2; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; min-height: 48px; }
.status-row:first-child { border-top: 0; }
.status-title { font-size: 12px; font-weight: 720; }
.status-detail { color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }

.detail-backdrop { background: rgba(25, 36, 45, .25); inset: 0; position: fixed; z-index: 39; }
.detail-panel { background: var(--surface); border-left: 1px solid var(--line-strong); bottom: 0; box-shadow: -12px 0 30px rgba(22, 34, 44, .12); max-width: 92vw; overflow-y: auto; position: fixed; right: 0; top: 0; transform: translateX(102%); transition: transform 160ms ease; width: 620px; z-index: 40; }
.detail-panel.open { transform: translateX(0); }
.detail-header { align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; height: 64px; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 1; }
.detail-header h2 { font-size: 17px; margin: 0; }
.detail-body { padding: 20px; }
.detail-grid { display: grid; gap: 1px; grid-template-columns: 150px minmax(0, 1fr); }
.detail-grid dt, .detail-grid dd { border-bottom: 1px solid #edf0f2; margin: 0; min-height: 38px; padding: 10px 8px; }
.detail-grid dt { color: var(--muted); font-size: 11px; }
.detail-grid dd { font-size: 12px; overflow-wrap: anywhere; }
.timeline { border-left: 2px solid var(--line); margin: 18px 0 0 7px; padding-left: 18px; }
.timeline-item { margin-bottom: 16px; position: relative; }
.timeline-item::before { background: var(--surface); border: 2px solid var(--blue); border-radius: 50%; content: ""; height: 8px; left: -24px; position: absolute; top: 3px; width: 8px; }
.timeline-title { font-size: 12px; font-weight: 760; }
.timeline-meta, .timeline-detail { color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.detail-section-title { font-size: 13px; margin: 24px 0 10px; }
.detail-grid.compact { margin-top: 12px; }
.detail-grid.compact dt, .detail-grid.compact dd { min-height: 34px; padding: 8px; }
.multiline { white-space: pre-wrap; }
.json-block { background: #f3f6f8; border: 1px solid var(--line); color: #273642; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.55; margin: 0; max-height: 320px; overflow: auto; padding: 12px; white-space: pre-wrap; word-break: break-word; }
.plan-list { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.plan-item { padding: 16px 0; }
.plan-item + .plan-item { border-top: 1px solid var(--line); }
.plan-header { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; }
.plan-header > div:last-child { align-items: center; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.payload-details { margin-top: 24px; }
.payload-details summary { color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.toast { background: #182833; bottom: 22px; color: white; left: 50%; max-width: 420px; padding: 10px 14px; position: fixed; transform: translateX(-50%); z-index: 60; }

@media (max-width: 1050px) {
  .account-grid { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .compact-list.horizontal { grid-template-columns: 1fr; }
  .performance-chart-grid, .holdings-plans-grid { grid-template-columns: 1fr; }
  .trade-status-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trade-status-strip > span:nth-child(3) { border-right: 0; }
  .trade-status-strip > span:nth-child(-n+3) { border-bottom: 1px solid var(--line-strong); }
}

@media (max-width: 720px) {
  .topbar { height: 56px; padding: 0 12px; }
  .brand-block span, .topbar-status time { display: none; }
  .app-shell { display: block; min-height: calc(100vh - 56px); }
  .sidebar { border-bottom: 1px solid var(--line); border-right: 0; flex-direction: row; gap: 2px; overflow-x: auto; padding: 8px; position: sticky; top: 56px; z-index: 15; }
  .nav-button { flex: 1 0 46px; min-height: 34px; min-width: 46px; padding: 0 4px; text-align: center; }
  .nav-button.active { border-bottom: 3px solid var(--blue); border-left: 0; padding: 0 4px 3px; }
  .main-content { padding: 18px 12px 36px; }
  .view-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .performance-controls { align-items: stretch; flex-direction: column; width: 100%; }
  .performance-controls select { min-width: 0; width: 100%; }
  .segmented-control { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .segmented-control button { min-width: 0; padding: 0 3px; }
  .panel-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .panel-heading select, .view-heading select { max-width: 100%; width: 100%; }
  .view-heading h1 { font-size: 21px; }
  .summary-counters { width: 100%; }
  .account-equity { font-size: 20px; }
  .operations-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trade-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trade-status-strip > span { border-bottom: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }
  .trade-status-strip > span:nth-child(2n) { border-right: 0; }
  .trade-status-strip > span:nth-last-child(-n+2) { border-bottom: 0; }
  .large-stage { height: 280px; }
  .chart-legend { justify-content: flex-start; width: 100%; }
  .chart-panel.large, .activity-panel { min-height: auto; }
  .incident-item { grid-template-columns: 72px minmax(0, 1fr); }
  .incident-item > :nth-child(n+3) { display: none; }
  .detail-panel { max-width: 100vw; width: 100%; }
  .detail-grid { grid-template-columns: 110px minmax(0, 1fr); }
}
:root { --configuration-warning: #8d5618; }
.configuration-warning { border-left: 3px solid var(--configuration-warning); padding: 12px 16px; line-height: 1.7; }
.configuration-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.configuration-percent { max-width: 130px; padding: 8px; }
.configuration-enabled { width: 20px; height: 20px; }
.configuration-blockers { padding: 16px 20px; line-height: 1.8; }
.configuration-blockers h3 { margin: 0; font-size: 15px; }
.configuration-blockers ul { margin: 8px 0 0; padding-left: 20px; }

/* Investor workspace: shared palette, readable hierarchy and responsive data density. */
body { font-size: 14px; line-height: 1.55; }
.app-shell { grid-template-columns: 192px minmax(0, 1fr); }
.main-content { padding: 30px 32px 64px; max-width: 1680px; width: 100%; margin: 0 auto; }
.sidebar { background: var(--surface); padding: 22px 14px; }
.nav-label { color: var(--muted); font-size: 11px; font-weight: 700; padding: 0 12px; margin: 8px 0; }
.nav-label:not(:first-child) { margin-top: 30px; }
.nav-button { min-height: 44px; border-radius: 6px; }
.nav-button.active { background: var(--blue-soft); color: var(--blue); }
.sidebar-note { margin: auto 10px 0; padding-top: 40px; font-size: 11px; color: var(--muted); line-height: 1.8; }
.view-heading { margin-bottom: 24px; gap: 16px; }
.view-heading h1 { font-size: 28px; letter-spacing: -.7px; line-height: 1.35; }
.eyebrow { letter-spacing: 1.3px; font-size: 10px; }
.view-meta, .data-basis, .table-secondary { font-size: 12px; line-height: 1.65; }
.data-basis { color: var(--muted); margin: 12px 0 20px; overflow-wrap: anywhere; }
.summary-counters { font-size: 12px; flex-wrap: wrap; gap: 14px; }
.summary-counters strong { font-size: 16px; }
.investor-summary { display: grid; grid-template-columns: 1.3fr 1fr 1fr .85fr; gap: 12px; }
.investor-metric { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 22px; min-height: 142px; }
.investor-metric p { color: var(--muted); font-size: 12px; font-weight: 650; margin: 0 0 12px; }
.investor-metric strong { display: block; font-size: clamp(22px, 2vw, 30px); line-height: 1.25; letter-spacing: -.7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.investor-metric .total-return { font-size: 19px; margin-top: 10px; }
.investor-metric span { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); }
.investor-metric.hero { background: #192d3d; border-color: #192d3d; color: #fff; }
.investor-metric.hero p, .investor-metric.hero span { color: #c3d1dc; }
.panel, .table-section, .account-card { border-radius: 8px; }
.overview-grid { gap: 16px; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); margin-bottom: 28px; }
.panel-heading h2, .section-heading h2 { font-size: 16px; margin: 0; }
.chart-caption { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.chart-panel { min-height: 340px; }
.allocation-panel { padding: 20px; }
.allocation-summary { margin-top: 24px; }
.allocation-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin: 14px 0; }
.allocation-row strong { font-variant-numeric: tabular-nums; }
meter { display: block; width: 100%; height: 14px; accent-color: var(--blue); }
.health-summary { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; font-size: 12px; }
.health-summary p { margin: 7px 0; }
.health-summary .data-basis { font-size: 11px; margin-top: 14px; }
.strategy-overview { margin: 24px 0; }
.strategy-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.strategy-card { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 22px; min-width: 0; }
.strategy-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 54px; }
.strategy-card h3 { font-size: 16px; margin: 6px 0; line-height: 1.45; }
.strategy-value { font-size: 25px; font-weight: 750; letter-spacing: -.5px; margin: 18px 0 4px; font-variant-numeric: tabular-nums; }
.strategy-metrics { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin: 20px 0; }
.strategy-metrics dt { font-size: 11px; color: var(--muted); }
.strategy-metrics dd { margin: 5px 0 0; font-weight: 650; font-size: 14px; overflow-wrap: anywhere; }
.strategy-periods { border-top: 1px solid var(--line); margin-bottom: 18px; padding-top: 10px; }
.strategy-period-row { display: grid; grid-template-columns: minmax(60px, 1fr) minmax(0, 1.45fr) minmax(0, .85fr); align-items: start; gap: 8px; padding: 9px 0; font-size: 13px; }
.strategy-period-row > :nth-child(n+2) { text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.strategy-period-row .strategy-period-note { grid-column: 1 / -1; text-align: left; display: block; margin-top: -4px; font-size: 10px; color: var(--muted); line-height: 1.45; }
.strategy-period-header { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); }
.strategy-period-basis { font-size: 11px; color: var(--muted); line-height: 1.6; margin-top: 6px; }
.strategy-period-basis summary { cursor: pointer; }
.strategy-period-basis ul { padding-left: 16px; }
.strategy-execution { border-top: 1px solid var(--line); padding-top: 15px; }
.strategy-holdings { min-height: 30px; padding-top: 12px; font-size: 12px; }
.strategy-card .data-basis { font-size: 11px; margin: 10px 0; }
.strategy-actions { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }
.advanced-section, .methodology { margin: 16px 0; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 14px 18px; }
.advanced-section > summary, .methodology > summary { cursor: pointer; font-size: 13px; font-weight: 650; }
.advanced-section[open] > summary, .methodology[open] > summary { margin-bottom: 18px; }
.advanced-section > .table-section { border: 0; padding: 0; }
.methodology p { font-size: 13px; max-width: 1000px; color: var(--muted); }
.notice { border: 1px solid #e4c986; background: var(--amber-soft); color: #775000; border-radius: 6px; padding: 14px 18px; margin: 0 0 18px; font-size: 13px; }
.notice.error { border-color: #edb7be; background: var(--red-soft); color: #8d2531; }
.metric-label { font-size: 12px; }
.metric-strip { gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-item { border-radius: 8px; padding: 18px; }
.metric-value { font-size: 22px; }
.trade-status-strip small { font-size: 11px; }
.trade-status-strip strong { font-size: 14px; }
.state-badge { font-size: 11px; white-space: nowrap; }
.trade-tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.trade-tabs button { background: none; border: 0; cursor: pointer; padding: 12px 18px; color: var(--muted); border-bottom: 3px solid transparent; }
.trade-tabs button.active { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.trade-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; background: var(--surface); padding: 18px; border: 1px solid var(--line); border-radius: 8px; }
.trade-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.trade-filters select, .trade-filters input { max-width: 240px; min-height: 40px; border: 1px solid var(--line-strong); background: var(--surface); padding: 8px 10px; border-radius: 4px; color: var(--text); font: inherit; }
.trade-filters button, .pagination button { min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--blue); border-radius: 4px; cursor: pointer; }
.trade-filters button[type=submit] { background: var(--blue); color: white; border-color: var(--blue); }
.pagination { display: flex; gap: 16px; align-items: center; justify-content: center; padding: 18px; }
button:disabled { opacity: .45; cursor: not-allowed; }
input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.empty-state { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.table-section th { font-size: 12px; }
.table-section td { font-size: 13px; padding-top: 14px; padding-bottom: 14px; }
.account-change { flex-wrap: wrap; }
.account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.recent-grid { grid-template-columns: 1fr; }
#performance-account-select { max-width: 360px; }
@media (max-width: 1200px) {
  .main-content { padding: 24px; }
  .strategy-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .investor-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-controls { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 166px minmax(0, 1fr); }
  .strategy-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .main-content { padding: 20px 14px 40px; }
  .sidebar { padding: 8px; }
  .nav-label, .sidebar-note { display: none; }
  .nav-button { flex: 0 0 auto; padding: 8px 12px; min-width: fit-content; }
  .nav-button.active { padding: 8px 12px 5px; }
  .view-heading h1 { font-size: 25px; }
  .topbar-status { gap: 10px; }
  .status-dot { font-size: 11px; }
  .investor-summary { gap: 8px; }
  .investor-metric { padding: 16px 12px; min-height: 130px; }
  .investor-metric strong { font-size: 21px; }
  .investor-metric span, .investor-metric p { font-size: 11px; }
  .strategy-card-grid, .account-grid { grid-template-columns: 1fr; }
  .strategy-card { padding: 20px; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-value { font-size: 19px; }
  .trade-filters { display: grid; grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; }
  .trade-filters label, .trade-filters input, .trade-filters select { width: 100%; min-width: 0; max-width: 100%; }
  .performance-controls { align-items: stretch; }
  #performance-account-select { max-width: 100%; }
  .advanced-section { padding: 12px; }
}
#orders-table td:nth-child(3), #executions-table td:nth-child(3) { white-space: normal; min-width: 140px; max-width: 220px; }
#orders-table .table-secondary, #executions-table .table-secondary { font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .detail-panel { transition: none; } }
