:root {
  color-scheme: light;
  --canvas: #f4f5f7;
  --white: #fff;
  --ink: #1a222b;
  --muted: #606c79;
  --line: #e2e6e9;
  --brand: #253c63;
  --brand-dark: #1b2c4c;
  --brand-soft: #eaf0f9;
  --gain: #ae3d39;
  --loss: #177055;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #3763a0; outline-offset: 3px; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: clamp(27px, 3.4vw, 36px); line-height: 1.26; letter-spacing: -.04em; }
h2 { font-size: 17px; line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.sidebar {
  padding: 29px 16px 22px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .05em; }
.brand-mark {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  flex: 0 0 35px;
  height: 35px;
  padding-bottom: 9px;
  border-radius: 9px;
  background: var(--brand);
}
.brand-mark i { width: 4px; border-radius: 2px; background: #dce8ff; }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 17px; }
.sidebar nav { display: grid; gap: 6px; margin-top: 43px; }
.sidebar nav a { display: flex; gap: 12px; align-items: center; padding: 11px 13px; min-height: 42px; color: #505e6d; border-radius: 8px; }
.sidebar nav a:hover { background: #f0f3f7; }
.sidebar nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav-icon { display: inline-block; width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; }
.nav-icon::before, .nav-icon::after { content: ""; position: absolute; background: currentColor; }
.grid-icon::before { width: 1px; top: 0; bottom: 0; left: calc(50% - .5px); }
.grid-icon::after { height: 1px; right: 0; left: 0; top: calc(50% - .5px); }
.list-icon::before, .list-icon::after { height: 1px; left: 3px; right: 3px; }
.list-icon::before { top: 4px; }
.list-icon::after { top: 8px; }
.sidebar-footer { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding: 17px 6px 0; margin-top: auto; color: var(--muted); font-size: 12px; }
.local-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2d856e; }
.workspace { min-width: 0; }
.topbar { min-height: 65px; padding: 10px clamp(20px, 3.2vw, 44px); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--white); border-bottom: 1px solid var(--line); }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.account-picker { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); white-space: nowrap; }
.account-picker select { min-width: 0; max-width: 180px; color: var(--brand); font-weight: 600; }
.login-settings { position: relative; }
.login-settings summary { list-style: none; cursor: pointer; }
.login-settings summary::-webkit-details-marker { display: none; }
.login-actions { position: absolute; z-index: 30; right: 0; top: calc(100% + 5px); min-width: 126px; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 6px 20px #17264020; }
.login-actions button { display: block; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: var(--ink); text-align: left; white-space: nowrap; border-radius: 4px; }
.login-actions button:hover { background: var(--canvas); }
#logout-feedback:not(:empty) { padding: 5px 8px; font-size: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }
#app { max-width: 1540px; margin-inline: auto; padding: 32px clamp(20px, 3.2vw, 44px) 32px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-heading p { color: var(--muted); margin-top: 8px; line-height: 1.6; }
.year-control { white-space: nowrap; display: flex; align-items: center; gap: 10px; color: var(--muted); }
select, .search, .button {
  min-height: 37px;
  border: 1px solid #d9dfe5;
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
}
select { padding: 6px 10px; max-width: 100%; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; white-space: nowrap; font-weight: 600; }
.button:hover:not(:disabled) { background: #f4f6fa; border-color: #bdc9d6; }
.button.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button.primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }
.button.primary > span[aria-hidden] { font-size: 17px; line-height: 1; }
.kpis { display: grid; grid-template-columns: 1.15fr repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi, .panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.kpi { padding: 16px 17px 15px; }
.kpi.featured { background: #eef3fb; border-color: #dbe4f3; }
.kpi-label { font-weight: 600; color: #4e5a6a; min-height: 20px; }
.kpi > strong {
  display: block;
  margin: 9px 0 8px;
  letter-spacing: -.04em;
  font-size: clamp(22px, 2.2vw, 33px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi > strong span { font-size: .48em; color: var(--muted); letter-spacing: normal; font-weight: 600; }
.kpi small, .panel-note, .method-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.annual-rate { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 3px; color: var(--muted); font-size: 13px; }
.annual-rate b { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.annual-rate .gain { color: var(--gain); }
.annual-rate .loss { color: var(--loss); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(245px, 1fr); gap: 16px; margin-bottom: 16px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 17px 18px 14px; }
.panel-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.legend { display: flex; gap: 11px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.gain-dot, .quarter-bar.gain, .trend-bar.gain, .scatter-point.gain { background: #c35d57; }
.loss-dot, .quarter-bar.loss, .trend-bar.loss, .scatter-point.loss { background: #329679; }
.flat-dot, .scatter-point.flat { background: #677687; }
.quarter-chart { padding: 0 18px 15px; }
.quarter-row, .quarter-head { display: grid; align-items: center; grid-template-columns: 64px minmax(20px, 1fr) minmax(96px, max-content) 62px; gap: 10px; }
.quarter-head { text-align: right; color: var(--muted); font-size: 12px; padding-bottom: 5px; }
.quarter-head > :first-child { text-align: left; }
.quarter-row { position: relative; min-height: 42px; border-top: 1px solid #edf0f2; }
.quarter-name { font-size: 13px; line-height: 1.3; }
.quarter-name small { color: var(--muted); display: block; font-size: 11px; }
.quarter-row strong { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.bar-track { position: relative; height: 9px; background: #f0f2f5; border-radius: 6px; }
.bar-track::before { position: absolute; content: ""; top: -3px; bottom: -3px; left: 50%; width: 1px; background: #b3bfcc; }
.quarter-bar { position: absolute; height: 100%; top: 0; border-radius: 3px; }
.return-trend { margin-bottom: 16px; }
.trend-scroll { position: relative; overflow: auto; }
.trend-plot {
  --trend-height: 140px;
  display: grid;
  grid-template-columns: 51px repeat(3, minmax(0, 1fr));
  min-width: 745px;
  padding: 8px 18px 15px;
  font-variant-numeric: tabular-nums;
}
.trend-axis { height: var(--trend-height); position: relative; color: var(--muted); font-size: 11px; }
.trend-axis span { position: absolute; right: 8px; transform: translateY(-50%); }
.trend-axis span:nth-child(2) { top: 50%; }
.trend-axis span:nth-child(3) { top: 100%; }
.trend-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trend-year + .trend-year { border-left: 1px solid var(--line); }
.trend-year:nth-child(3) .trend-track { background: #f7f8fa; }
.trend-quarter { min-width: 0; text-align: center; }
.trend-track { height: var(--trend-height); position: relative; border-block: 1px solid var(--line); }
.trend-track::before { content: ""; position: absolute; top: 50%; inset-inline: 0; height: 1px; background: #a0adbb; }
.trend-bar { position: absolute; left: 50%; width: 53%; max-width: 36px; min-height: 1px; transform: translateX(-50%); }
.trend-bar.gain { border-radius: 4px 4px 0 0; }
.trend-bar.loss { border-radius: 0 0 4px 4px; }
.trend-bar.flat { background: #677687; min-height: 2px; }
.trend-quarter-label { margin-top: 7px; color: var(--muted); font-size: 11px; }
.trend-value { min-height: 17px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.trend-incomplete { color: var(--muted); font-size: 10px; }
.trend-year-label { grid-column: 1 / -1; padding-top: 5px; text-align: center; color: var(--muted); font-weight: 600; }
.trend-hint { display: none; padding: 0 18px 12px; color: var(--muted); font-size: 11px; }
.exposure-panel { margin-bottom: 16px; }
.exposure-panel .panel-heading { flex-wrap: wrap; }
.exposure-body { padding: 0 18px 15px; }
.exposure-coverage { margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.exposure-frame { display: grid; grid-template-columns: 46px minmax(0, 1fr); margin: 14px 0 10px; }
.exposure-axis { position: relative; height: 154px; color: var(--muted); font-size: 11px; }
.exposure-axis span { position: absolute; right: 7px; transform: translateY(50%); }
.exposure-scroll { overflow: auto; }
.exposure-grid { min-width: var(--exposure-width); }
.exposure-plot {
  display: grid;
  grid-template-columns: repeat(var(--exposure-days), minmax(0, 1fr));
  height: 154px;
  background: repeating-linear-gradient(to top, #e1e7ef 0 1px, transparent 1px 25%);
}
.exposure-day { position: relative; background: transparent; border: 0; padding: 0; min-width: 0; }
.exposure-day span { position: absolute; bottom: 0; inset-inline: 12%; min-height: 1px; background: #5d7fae; }
.exposure-day.partial span { background: #a0b4ce; }
.exposure-day.missing span { display: none; }
.exposure-day:hover, .exposure-day[aria-current="date"] { background: #e8eef7; }
.exposure-day:hover span, .exposure-day[aria-current="date"] span { background: var(--brand-dark); }
.exposure-dates { position: relative; height: 16px; margin-top: 6px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.exposure-dates span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.exposure-dates span:first-child { transform: none; }
.exposure-dates span:last-child:not(:first-child) { transform: translateX(-100%); }
.exposure-inspector { display: flex; flex-wrap: wrap; gap: 9px 20px; align-items: center; padding-top: 9px; border-top: 1px solid var(--line); }
.exposure-inspector input { min-width: 0; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--white); }
#exposure-values { display: flex; flex-wrap: wrap; gap: 7px 18px; font-variant-numeric: tabular-nums; }
#exposure-values div { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
#exposure-values dt { color: var(--muted); font-size: 12px; }
#exposure-values dd { font-weight: 600; }
.return-distribution { margin-bottom: 16px; }
.return-distribution .panel-heading { flex-wrap: wrap; }
#distribution-count { padding: 0 18px 12px; color: var(--muted); font-size: 12px; }
.scatter-chart { padding: 0 18px 14px; }
.scatter-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.scatter-frame { display: grid; grid-template-columns: 45px minmax(0, 1fr); padding-right: 9px; }
.scatter-y-axis, .scatter-x-axis { position: relative; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.scatter-y-axis span { position: absolute; right: 7px; transform: translateY(-50%); }
.scatter-plot { position: relative; height: 280px; background: #f9fbfd; }
.scatter-horizontal, .scatter-vertical { position: absolute; background: #e2e7ed; pointer-events: none; }
.scatter-horizontal { inset-inline: 0; height: 1px; }
.scatter-vertical { inset-block: 0; width: 1px; }
.scatter-horizontal.scatter-zero { background: #9faebe; }
.scatter-point { position: absolute; display: block; transform: translate(-50%, -50%); border-radius: 50%; opacity: .83; }
.scatter-point:hover, .scatter-point:focus-visible { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--brand); }
.scatter-x-axis { grid-column: 2; height: 16px; margin-top: 8px; }
.scatter-x-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.scatter-x-axis span:first-child { transform: none; }
.scatter-x-axis span:last-child { transform: translateX(-100%); }
.scatter-x-label { grid-column: 2; margin: 6px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.scatter-detail { padding-top: 9px; margin-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.funding dl { padding: 0 18px; }
.funding dl > div { display: flex; justify-content: space-between; align-items: center; gap: 4px; min-height: 40px; }
.funding dt { color: var(--muted); }
.funding dd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; overflow-wrap: anywhere; }
.funding .net { border-top: 1px solid var(--line); }
.funding .net dt { color: var(--ink); font-weight: 600; }
.panel-note { padding: 11px 18px 16px; }
.back-link { color: var(--brand); font-weight: 600; white-space: nowrap; }
.back-link:hover { text-decoration: underline; }
.method-note { margin: 13px 1px 0; }
.table-scroll { position: relative; overflow: auto; }
.position-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 0 18px 10px; font-size: 13px; color: var(--muted); }
.position-controls p { margin: 0; }
.position-history-scroll { max-height: 410px; }
.position-history-scroll thead { position: sticky; top: 0; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: left; font-size: 13px; }
thead { background: #f7f8fa; color: #566171; }
thead th { font-size: 12px; font-weight: 600; padding: 10px 12px; border-block: 1px solid var(--line); }
tbody td, tbody th { padding: 9px 12px; border-bottom: 1px solid #edf0f2; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
tr > :first-child { padding-left: 18px; }
tr > :last-child { padding-right: 17px; }
.number { text-align: right; }
td.number { font-weight: 600; }
.stats-panel + .stats-panel { margin-top: 16px; }
.period-stats-table td, .period-stats-table tbody th { padding-block: 12px; }
.security-link { display: inline-flex; flex-direction: column; gap: 2px; }
.security-link:hover strong { color: var(--brand); text-decoration: underline; }
.security-link small { font-size: 11px; color: var(--muted); font-weight: 500; }
.trade-table time small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.row-link { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 5px; color: var(--brand); font-size: 16px; }
.row-link:hover { background: var(--brand-soft); }
.muted { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 5px; color: #3f546a; background: #eef2f6; font-size: 11px; line-height: 1.3; font-weight: 600; white-space: nowrap; }
.status i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.open { background: #eaf2ff; color: #31578f; }
.status.incomplete { background: #fff2df; color: #80510f; }
.placeholder { padding: 30px 18px; line-height: 1.6; color: var(--muted); }
.placeholder a { color: var(--brand); text-decoration: underline; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; padding: 17px 18px; }
.search { display: flex; align-items: center; gap: 9px; padding-inline: 10px; }
.search:focus-within { outline: 2px solid #3763a0; outline-offset: 2px; }
.search-icon { display: inline-block; position: relative; width: 11px; height: 11px; border: 1.5px solid var(--muted); border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 5px; height: 1px; left: 7px; top: 8px; transform: rotate(45deg); background: var(--muted); }
.search input { width: 182px; min-width: 0; padding: 5px 0; border: 0; background: transparent; outline: 0; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 12px 18px; color: var(--muted); font-size: 12px; }
.pagination { display: flex; gap: 10px; align-items: center; }
.pagination .button { min-height: 32px; }
.back-link { display: inline-block; margin-bottom: 14px; }
.trade-info { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 18px; padding: 17px 18px; margin-bottom: 16px; }
.trade-info dl { display: flex; flex-wrap: wrap; gap: 25px; }
.trade-info dt, .strategy-form > label { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.trade-info dd { font-variant-numeric: tabular-nums; }
.strategy-form { display: grid; }
.strategy-form > div { display: flex; gap: 6px; }
#strategy-message:not(:empty) { margin-top: 5px; color: var(--brand); font-size: 12px; }
.detail-scroll { padding-bottom: 5px; }
.trade-chart { margin-bottom: 16px; }
.chart-body { padding: 0 18px 16px; min-width: 0; }
.chart-legend, .chart-notice, .chart-controls { display: flex; align-items: center; gap: 7px; }
.chart-notice { color: var(--muted); font-size: 12px; min-height: 24px; margin-bottom: 6px; }
.chart-notice .button { font-size: 12px; min-height: 28px; padding-block: 3px; }
.chart-notice .button[hidden] { display: none; }
.trade-chart canvas { display: block; width: 100%; height: 290px; border-radius: 8px; background: #f9fbfd; cursor: crosshair; }
.chart-key { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chart-key.buy { color: #923a20; background: #fff0e7; }
.chart-key.sell { color: #2c5186; background: #eaf1fc; }
.chart-range:not([hidden]) { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.chart-range input { flex: 1; min-width: 0; accent-color: var(--brand); }
.chart-controls { margin-top: 10px; }
.chart-controls .button { min-height: 32px; font-size: 12px; }
.chart-readout { margin-top: 11px; font-variant-numeric: tabular-nums; font-size: 13px; }
.chart-readout > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; }
.chart-readout > div span, .chart-readout p { color: var(--muted); }
.chart-readout p { margin-top: 6px; }
.chart-fills { list-style: none; margin: 7px 0 0; padding: 0; }
.chart-fills li { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; padding: 4px 0; }
.chart-day-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; }
.chart-day-summary h3 { margin: 0; font-size: inherit; font-weight: 600; }
.chart-day-summary dl { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.chart-day-summary dl > div { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.chart-day-summary dt { color: var(--muted); }
.chart-day-difference dd { color: var(--brand); font-weight: 600; }
.detail-table td { min-width: 75px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff7eb; border: 1px solid #eddfc9; border-radius: var(--radius); padding: 13px 16px; margin-bottom: 16px; color: #6f4b21; }
.notice p { line-height: 1.6; }
dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 15px; padding: 22px; width: min(530px, calc(100vw - 28px)); box-shadow: 0 22px 86px #17264039; }
dialog::backdrop { background: #16233660; }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dialog-heading h2 { font-size: 21px; }
.dialog-heading p { color: var(--muted); margin: 6px 0 15px; line-height: 1.6; }
.account-name { display: grid; gap: 7px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.account-name input { min-height: 38px; width: 100%; border: 1px solid #d9dfe5; border-radius: 7px; padding: 7px 10px; color: var(--ink); }
#password-rule { color: var(--muted); }
#password-feedback:not(:empty) { margin-bottom: 12px; }
.login-page { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 18px; }
.login-card { width: min(100%, 380px); padding: 26px; }
.login-card .brand { padding: 0; margin-bottom: 23px; }
.login-card h1 { font-size: 24px; }
.login-card button { width: 100%; margin-top: 4px; }
#login-feedback:not(:empty) { margin-bottom: 10px; }
#account-feedback:not(:empty) { margin: 0 0 12px; }
.icon-button { border: 0; background: #f1f3f6; color: var(--ink); border-radius: 6px; width: 29px; height: 29px; font-size: 19px; }
.drop-zone { position: relative; display: grid; justify-items: center; gap: 7px; padding: 17px 10px; border: 1px dashed #a8b6c8; border-radius: 9px; cursor: pointer; text-align: center; }
.drop-zone:hover, .drop-zone.dragging { background: #f0f5fb; }
.drop-zone:focus-within { outline: 2px solid #3763a0; outline-offset: 3px; }
.drop-zone > span:not(.upload-mark) { color: var(--muted); font-size: 12px; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-mark { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-size: 24px; }
.import-feedback { margin: 12px 0; color: var(--muted); max-height: 25vh; overflow: auto; overflow-wrap: anywhere; }
.import-item { display: grid; gap: 3px; padding: 7px 1px; font-size: 13px; }
.import-item strong { color: var(--ink); }
.import-item + .import-item { border-top: 1px solid var(--line); }
.error { color: var(--gain); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 1120px) {
  .shell { grid-template-columns: 168px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .kpi { padding-inline: 12px; }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { height: 100dvh; }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 13px 15px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; justify-content: space-between; gap: 8px; align-items: center; }
  .brand { gap: 7px; font-size: 13px; padding: 0; }
  .brand-mark { height: 30px; flex-basis: 30px; padding-bottom: 6px; }
  .brand small, .sidebar-footer, .nav-icon { display: none; }
  .sidebar nav { margin-top: 0; display: flex; gap: 4px; }
  .sidebar nav a { padding: 5px 7px; font-size: 12px; min-height: 33px; white-space: nowrap; }
  .topbar { padding: 7px 15px; min-height: 49px; }
  .topbar { flex-wrap: wrap; gap: 7px; }
  .toolbar-actions { gap: 5px; max-width: 100%; }
  .account-picker { gap: 5px; }
  .account-picker select { max-width: 128px; }
  .toolbar-actions .button { padding-inline: 8px; }
  #app { padding: 20px 14px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 14px; }
  .year-control { font-size: 12px; }
  .kpis { gap: 8px; margin-bottom: 10px; }
  .overview-grid { gap: 10px; margin-bottom: 10px; }
  .kpi-label { font-size: 12px; }
  .kpi > strong { font-size: clamp(17px, 4.6vw, 25px); }
  .kpi { padding-block: 11px; }
  .quarter-row, .quarter-head { grid-template-columns: 48px minmax(8px, 1fr) minmax(88px, max-content) 55px; gap: 7px; }
  .quarter-row strong { font-size: 12px; }
  .trend-hint { display: block; }
  .return-distribution { margin-bottom: 10px; }
  .exposure-panel { margin-bottom: 10px; }
  .exposure-body { padding-inline: 12px; }
  .exposure-frame { grid-template-columns: 38px minmax(0, 1fr); }
  .scatter-chart { padding-inline: 12px; }
  .scatter-frame { grid-template-columns: 35px minmax(0, 1fr); }
  .scatter-plot { height: 235px; }
  .chart-body { padding-inline: 12px; }
  .trade-chart canvas { height: 230px; }
  .stats-panel + .stats-panel { margin-top: 10px; }
  .period-stats-table { min-width: 335px; }
  .period-stats-table th, .period-stats-table td { padding-inline: 4px; }
  .period-stats-table tr > :first-child { padding-left: 8px; }
  .period-stats-table tr > :last-child { padding-right: 8px; }
  .period-stats-table thead th:nth-last-child(-n+3) { white-space: normal; }
  .period-stats-table thead span { white-space: nowrap; }
}
