:root {
  --page-gutter: 5mm;
  --brand: #1677ff;
  --brand-hover: #095fcf;
  --brand-soft: #eaf3ff;
  --surface-tint: #f3f7ff;
  --surface-hover: #eef5ff;
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #1d2b2c;
  background: #f7faff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
body:has(#workspace:not([hidden])) {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#workspace:not([hidden]),
#home-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.site-header { flex: none; }

.site-header {
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #e4eae7;
}
body.logged-out .site-header {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  height: 86px;
  background: transparent;
  border: 0;
}
body.logged-out .header-inner { padding: 0 clamp(18px, 4vw, 66px); }
body.logged-out .brand { font-size: 26px; color: var(--brand); text-shadow: 0 1px 6px #ffffff88; }
body.logged-out .brand-strong { color: var(--brand); }
body.logged-out .brand-mark { display: none; }
.login-trigger { height: 34px; min-width: 68px; padding: 0 14px; border: 1px solid var(--brand); border-radius: 4px; background: var(--brand); color: #fff; font-size: 13px; cursor: pointer; }
.login-trigger:hover { background: var(--brand-hover); }
.login-trigger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.header-inner {
  height: 100%;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.brand-strong { color: #26302e; font-weight: 750; }
.environment-badge {
  padding: 4px 8px;
  border: 1px solid #9ac8ff;
  border-radius: 4px;
  background: var(--brand-soft);
  color: #0753ab;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}
.header-label {
  color: #8b9994;
  font-size: 12px;
}
.header-account { display: flex; align-items: center; gap: 16px; }
.header-navigation { display: flex; align-items: center; gap: 16px; }
.header-navigation > a:first-child { margin-right: 26px; }
.header-navigation a { color: #526761; font-size: 12px; text-decoration: none; white-space: nowrap; }
.header-navigation a:hover, .header-navigation a[aria-current="page"] { color: var(--brand); text-decoration: underline; }
.account-button {
  padding: 5px 0;
  border: 0;
  background: none;
  color: #526761;
  cursor: pointer;
  font-size: 12px;
}
.account-button:hover { color: var(--brand); }
.report-navigation { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.report-menu-toggle { border: 0; background: transparent; color: #526761; cursor: pointer; width: 24px; height: 28px; padding: 0; }
.report-menu-toggle:hover, .report-menu-toggle[aria-expanded="true"] { color: var(--brand); }
.report-menu { position: absolute; right: 0; top: 32px; z-index: 30; display: grid; min-width: 144px; padding: 6px; border: 1px solid #dce6df; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px #112c251a; }
.report-menu a { display: block; padding: 9px 12px; }
.report-menu a:hover { background: var(--brand-soft); }
.account-menu-toggle { border: 0; background: transparent; color: #526761; cursor: pointer; height: 34px; width: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.more-dots { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 18px; height: 18px; }
.more-dots i { width: 3px; height: 3px; flex: none; border-radius: 50%; background: currentColor; }
.account-menu-toggle:hover, .account-menu-toggle[aria-expanded="true"] { color: var(--brand); }
.account-menu { min-width: 136px; }
.account-menu :is(button, a) { display: block; border: 0; width: 100%; min-height: 34px; padding: 7px 12px; background: transparent; text-align: left; color: #526761; font-size: 12px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.account-menu :is(button, a):hover { background: var(--brand-soft); color: var(--brand); }
.updates-back { color: var(--brand); font-size: 13px; text-decoration: none; }
.updates-back:hover { text-decoration: underline; }
.updates-page { max-width: 1200px; margin: 0 auto; }
.updates-page h1 { margin: 24px 0 18px; font-size: 21px; }
.release-history-dialog {
  box-sizing: border-box;
  width: min(1100px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 18px 20px;
  border: 1px solid #dce6df;
  border-radius: 6px;
  background: #fff;
  color: #1d2b2c;
  box-shadow: 0 22px 70px #112c2550;
}
.release-history-dialog[open] { display: flex; flex-direction: column; }
.release-history-dialog::backdrop { background: #10282199; }
.release-history-dialog .list-dialog-heading { flex: none; }
.release-history-dialog .updates-table-scroll { min-height: 0; overflow: auto; }
.updates-table-scroll { width: 100%; overflow-x: auto; }
.updates-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; font-size: 13px; }
.updates-table th { position: sticky; top: 0; background: var(--surface-tint); color: #40534e; text-align: left; }
.updates-table :is(th, td) { padding: 15px 18px; border-bottom: 1px solid #e4eae7; vertical-align: top; }
.updates-table :is(th, td):first-child { width: 210px; font-variant-numeric: tabular-nums; }
.updates-table td:first-child { white-space: nowrap; color: #556a64; }
.updates-table time span { white-space: nowrap; }
.updates-content { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
@media (max-width: 600px) {
  .updates-table :is(th, td) { padding: 12px 10px; }
  .updates-table :is(th, td):first-child { width: 136px; white-space: normal; }
  .updates-table time span { display: block; }
}
.auth-screen {
  min-height: 100dvh;
  background: #81b2d6 url("/mountain.jpg") center center / cover no-repeat;
}
.filing-link { color: inherit; text-decoration: none; font-size: 11px; white-space: nowrap; }
.filing-link:hover, .filing-link:focus-visible { text-decoration: underline; }
.filing-login {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 2px;
  background: #152a3380;
  color: #fff;
}
.auth-dialog {
  width: min(380px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 32px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #1b323c;
  box-shadow: 0 24px 75px #081f304a;
}
.auth-dialog::backdrop { background: #08202b83; }
.auth-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: #71818a; font-size: 24px; cursor: pointer; }
.auth-close:hover { color: var(--brand); }
.auth-form, .password-dialog form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-form { width: 100%; }
.auth-form h1 { padding-right: 20px; }
.auth-form h1, .password-dialog h2 { margin: 0 0 6px; font-size: 23px; }
.auth-description { margin: 0 0 12px; color: #647570; font-size: 13px; }
.auth-form label, .password-dialog label { font-size: 13px; color: #526761; }
.auth-form input, .password-dialog input {
  width: 100%;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid #d9e2de;
  border-radius: 4px;
  background: #fff;
}
.auth-form input:focus, .password-dialog input:focus { outline: 2px solid var(--brand); }
.auth-form .refresh-button { margin-top: 10px; }
.auth-link { align-self: center; padding: 5px 10px; border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 13px; }
.auth-form .auth-link { font-size: 12px; color: #536874; }
.auth-link:hover { text-decoration: underline; }
.auth-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.auth-error { margin: 0; color: #a33a32; font-size: 12px; }
.password-code-row { display: flex; gap: 8px; margin-top: 7px; }
.password-code-row input { flex: 1; min-width: 0; }
.password-code-row button { flex: none; white-space: nowrap; }
#password-code-status, #recovery-code-status { margin: 7px 0 0; }
.password-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid #dce6df;
  border-radius: 6px;
  box-shadow: 0 18px 54px #112c2540;
}
.password-dialog::backdrop { background: #10282199; }
.password-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.page {
  padding: 20px var(--page-gutter) 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.heading-main {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 22px);
  flex: 1;
  min-width: 0;
}
h1 { font-size: 26px; line-height: 1.3; margin: 0; font-weight: 700; white-space: nowrap; }
.heading-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.icon-button { width: 26px; height: 26px; aspect-ratio: 1; flex: 0 0 26px; padding: 4px; display: inline-grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #526761; cursor: pointer; }
.icon-button:hover { background: var(--brand-soft); color: var(--brand); }
.icon-button svg { width: 19px; height: 19px; flex: none; }
.market-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: clamp(16px, 3vw, 32px); flex: 1; min-width: 0; }
.market-metric { min-width: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; align-items: start; padding: 2px 0; font-size: 12px; }
.market-metric > span { color: #334c43; font-weight: 700; text-align: left; white-space: nowrap; }
.market-metric > div { min-width: 0; text-align: left; }
.market-metric strong { display: block; line-height: 18px; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.market-metric .market-spark { display: block; width: 100%; height: 28px; margin-top: 2px; }
.market-metric .rise { color: #b73836; }
.market-metric .fall { color: #16835a; }
.list-dialog { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px; border: 1px solid #dce6df; border-radius: 6px; box-shadow: 0 20px 60px #112c2540; }
.list-dialog::backdrop, .list-subdialog::backdrop { background: #10282199; }
.list-dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.list-dialog-heading h2 { margin: 0; font-size: 18px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-toolbar strong { font-size: 13px; }
.list-toolbar-actions { display: flex; gap: 8px; }
.list-toolbar-actions button { flex: none; white-space: nowrap; }
.list-subdialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px; border: 1px solid #dce6df; border-radius: 6px; }
#list-add-form label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 400; }
#list-add-input { display: block; width: 100%; min-height: 190px; padding: 8px; resize: vertical; border: 1px solid #d9e2de; border-radius: 4px; }
.list-history-rows { display: grid; gap: 0; min-height: 100px; max-height: min(55dvh, 480px); overflow-y: auto; border: 1px solid #e1e9e4; }
.list-history-rows label { display: grid; grid-template-columns: 24px 84px minmax(0, 1fr) 72px; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid #e1e9e4; font-size: 12px; }
.list-history-rows label span { overflow-wrap: anywhere; }
.list-history-rows input { accent-color: var(--brand); }
.list-scroll { max-height: min(55dvh, 520px); overflow: auto; border: 1px solid #e1e9e4; }
.list-scroll table { width: 100%; min-width: 630px; border-collapse: collapse; font-size: 12px; }
.list-scroll th { position: sticky; top: 0; background: var(--surface-tint); text-align: left; }
.list-scroll td, .list-scroll th { padding: 7px 8px; border-bottom: 1px solid #e1e9e4; }
.list-scroll td:nth-child(4) { max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-scroll input[type="checkbox"] { accent-color: var(--brand); }
.list-scroll tr.dragging { opacity: .5; }
.list-scroll tr.drag-over { outline: 2px solid var(--brand); outline-offset: -2px; }
.list-drag { cursor: grab; border: 0; background: transparent; color: #526761; font-size: 18px; }
.list-drag:active { cursor: grabbing; }
.list-scroll select { height: 30px; padding: 3px 6px; border: 1px solid #d9e2de; border-radius: 4px; background: #fff; }
.list-order { display: inline-flex; gap: 2px; }
.list-order button { padding: 4px; border: 0; background: transparent; color: #526761; cursor: pointer; white-space: nowrap; }
.list-order button:hover:not(:disabled) { color: var(--brand); }
.list-order button:disabled { opacity: .35; cursor: default; }
.list-actions { display: flex; justify-content: space-between; margin-top: 12px; }
.list-toolbar #list-summary { font-weight: 400; }
.list-toolbar #list-summary strong { font-weight: 700; }
@media (max-width: 1400px) {
  .page-heading { flex-wrap: wrap; }
  .heading-main { flex-basis: 100%; }
}
@media (max-width: 900px) {
  .heading-main { flex-wrap: wrap; }
  .market-summary { flex-basis: 100%; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); row-gap: 12px; }
}
@media (max-width: 600px) {
  .market-summary { column-gap: 16px; }
  .list-toolbar { flex-wrap: wrap; }
  .list-toolbar strong { flex-basis: 100%; }
  .list-toolbar-actions { width: 100%; justify-content: flex-end; }
  .list-subdialog { padding: 16px; }
  .list-history-rows label { grid-template-columns: 20px 62px minmax(0, 1fr) 30px; gap: 4px; }
  body.logged-out .site-header { height: 78px; }
  body.logged-out .brand { font-size: 21px; }
  .auth-dialog { padding: 28px 23px; }
}
.count { font-size: 14px; font-weight: 650; }
.timestamps { color: #84938f; font-size: 11px; }
.refresh-button {
  height: 34px;
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--brand);
  border-radius: 5px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.refresh-button:hover:not(:disabled) { background: var(--brand-hover); }
.refresh-button:focus-visible { outline: 3px solid #9ac8ff; outline-offset: 2px; }
.refresh-button:disabled { cursor: wait; opacity: .68; }
.refresh-icon { width: 16px; height: 16px; flex: none; }
.refresh-button:disabled .refresh-icon { animation: spin 1s linear infinite; }
.clear-all-button {
  height: 34px;
  min-width: 84px;
  padding: 0 10px;
  border: 1px solid #d9e2de;
  border-radius: 5px;
  background: transparent;
  color: #526761;
  cursor: pointer;
  font-size: 13px;
}
.clear-all-button:hover:not(:disabled) { background: var(--brand-soft); }
.clear-all-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.clear-all-button:disabled { color: #aab5b0; cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice {
  border-left: 3px solid #c96a46;
  background: #fff3ed;
  color: #925139;
  padding: 9px 12px;
  font-size: 13px;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  min-width: 0;
}
.notice span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice[hidden] { display: none; }
#home-content .table-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.table-section { border: 1px solid #e1e9e4; border-radius: 6px; background: #fff; overflow: hidden; }
.table-scroll { flex: 1; overflow: auto; min-height: 0; }
#etf-table { width: max-content; min-width: 950px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
#etf-table thead { background: var(--surface-tint); }
#etf-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-tint);
  height: 42px;
  padding: 0 7px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: #647570;
  white-space: nowrap;
  border-bottom: 1px solid #e1e9e4;
}
#etf-table th.numeric, #etf-table td.numeric { text-align: right; }
.heading-text { vertical-align: middle; }
.filter-trigger { vertical-align: middle; margin-left: 3px; }
.filter-trigger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 23px;
  height: 23px;
  padding: 3px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #879990;
  cursor: pointer;
}
.filter-trigger svg { width: 17px; height: 17px; }
.filter-trigger:hover, .filter-trigger.active, .filter-trigger[aria-expanded="true"] {
  color: var(--brand);
  background: var(--brand-soft);
}
.filter-trigger.active, .filter-trigger.active:hover, .filter-trigger.active[aria-expanded="true"] {
  color: #fff;
  background: #14558e;
  box-shadow: 0 0 0 1px #0c4779;
}
.resize-handle {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
.resize-handle::after {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 8px;
  width: 1px;
  background: #d8e2dc;
}
.resize-handle:hover::after, .resize-handle:focus-visible::after, body.resizing .resize-handle.dragging::after {
  width: 2px;
  background: var(--brand);
}
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }
.filter-menu {
  position: fixed;
  z-index: 10;
  width: 232px;
  max-height: min(340px, calc(100vh - 24px));
  overflow: auto;
  padding: 12px;
  border: 1px solid #d9e5de;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 30px #243e3528;
  font-size: 13px;
}
.filter-menu[hidden] { display: none; }
.filter-title { font-weight: 650; margin-bottom: 9px; }
.filter-modes { display: flex; margin-bottom: 10px; border: 1px solid #d9e5de; border-radius: 4px; overflow: hidden; }
.filter-modes[hidden], #filter-values[hidden], #filter-actions[hidden], #type-filter-options[hidden], #holding-filter-options[hidden] { display: none; }
.filter-modes button { flex: 1; min-width: 0; padding: 6px 0; border: 0; border-right: 1px solid #d9e5de; background: #fff; color: #527267; cursor: pointer; font-size: 11px; }
.filter-modes button[hidden] { display: none; }
.filter-modes button:last-child { border-right: 0; }
.filter-modes button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.filter-modes button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.type-filter-options { display: grid; gap: 2px; }
.type-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 5px 0 5px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.type-filter-option:hover { background: var(--brand-soft); }
.type-filter-option:has(input:checked) { color: var(--brand-hover); background: var(--brand-soft); font-weight: 600; }
.type-filter-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }
.type-filter-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.filter-option {
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.filter-option input { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; }
.filter-all { border-bottom: 1px solid #edf1ee; padding-bottom: 8px; margin-bottom: 5px; }
.filter-options { max-height: 170px; overflow: auto; }
.percent-filter .filter-options { max-height: 130px; }
.filter-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-option .filter-count, .type-filter-option .filter-count {
  flex: none;
  margin-left: auto;
  color: #98a69f;
  font-size: 11px;
  font-weight: 400;
}
.filter-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid #edf1ee; }
.filter-actions button { border: 0; cursor: pointer; font-size: 12px; }
.filter-clear { color: #73877e; background: transparent; padding: 6px 0; }
.filter-apply { background: var(--brand); border-radius: 4px; color: #fff; padding: 7px 16px; }
.filter-apply[hidden] { display: none; }
.filter-apply:hover { background: var(--brand-hover); }
.unit { font-weight: 400; color: #92a09a; }
#etf-table td {
  height: 42px;
  padding: 5px 7px;
  border-bottom: 1px solid #eef2ef;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#etf-table tbody td { background: #fff; }
#etf-table tbody tr:last-child td { border-bottom: 0; }
#etf-table tbody tr:hover td { background: var(--surface-hover); }
#etf-table th:first-child, #etf-table td:first-child { position: sticky; left: 0; z-index: 3; }
#etf-table th:first-child { z-index: 7; }
#etf-table th:nth-child(2), #etf-table td:nth-child(2) { position: sticky; left: var(--id-width); z-index: 3; }
#etf-table th:nth-child(2) { z-index: 7; }
#etf-table th:nth-child(3), #etf-table td:nth-child(3) {
  position: sticky;
  left: calc(var(--id-width) + var(--name-width));
  z-index: 3;
}
#etf-table th:nth-child(3) { z-index: 7; }
#etf-table td:nth-child(3) { box-shadow: 1px 0 #dce8e1; }
.group-start { border-left: 1px solid #dfe9e3; }
.group-end { border-right: 1px solid #dfe9e3; }
.chart-ma-legend { display: flex; flex: none; align-items: center; flex-wrap: wrap; gap: 4px 16px; min-height: 25px; padding: 2px 0 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-ma-legend strong { font-weight: 600; margin-left: 6px; }
.ma30-key { color: #a36a16; }
.ma150-key { color: #317dc0; }
.nav-key { color: #c33f41; }
.fund-id, .price, .numeric { font-variant-numeric: tabular-nums; }
.fund-id { color: #758681; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.fund-name { font-weight: 550; color: #243633; }
.fund-link {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}
.fund-link:hover { color: var(--brand); text-decoration: underline; }
.fund-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.portfolio-cell-link {
  width: 100%;
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.portfolio-cell-link:hover { text-decoration: underline; }
.portfolio-cell-link:focus-visible { outline: 2px solid var(--brand); }
.fund-type { color: #527267; font-weight: 600; }
.price { color: #25322e; font-weight: 700; font-size: 14px; }
.cached-mark { color: #9b8a66; font-weight: 400; font-size: 10px; margin-left: 5px; }
#etf-table td.percent-value { color: #1d1d1d; }
#etf-table td.percent-value.rise { color: #b73836; }
#etf-table td.percent-value.fall { color: #16835a; }
#etf-table td.large-change { font-weight: 750; }
#etf-table tbody td.percent-high, #etf-table tbody tr:hover td.percent-high { background: #fff0ee; }
#etf-table tbody td.percent-low, #etf-table tbody tr:hover td.percent-low { background: #eaf6ee; }
#etf-table td.bottom-signal-low { color: #16835a; }
#etf-table tbody td.bottom-signal-low, #etf-table tbody tr:hover td.bottom-signal-low { background: #eaf6ee; }
#etf-table tbody tr.held-row td { background: #fff8d9; }
#etf-table tbody tr.held-row:hover td { background: #fff3c2; }
#etf-table tbody td.fund-type { text-align: center; }
#etf-table tbody td.holding-cell { text-align: center; }
#etf-table tbody td.fund-type.type-t0,
#etf-table tbody tr.held-row td.fund-type.type-t0,
#etf-table tbody tr:hover td.fund-type.type-t0 { background: #e7f3ff; }
#etf-table tbody td.fund-type.type-t1,
#etf-table tbody tr.held-row td.fund-type.type-t1,
#etf-table tbody tr:hover td.fund-type.type-t1 { background: #ecefee; }
.inline-edit {
  width: 100%;
  min-width: 0;
  padding: 4px 3px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font-size: 12px;
}
.numeric .inline-edit { text-align: right; font-variant-numeric: tabular-nums; }
.holding-select { cursor: pointer; }
.inline-edit:hover { border-color: #d8e4dc; }
.inline-edit:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 2px #1677ff26; }
.inline-edit:disabled { opacity: .5; }
.inline-edit::-webkit-inner-spin-button { appearance: none; }
.inline-edit[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.inline-edit[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
.empty-state { height: 180px; text-align: center; color: #879690; }
.footer {
  color: #94a19c;
  font-size: 11px;
}
.page-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 28px;
  padding: 2px 0;
  overflow: hidden;
  flex: none;
}
.page-footer .count { color: #111; }
.page-footer > :first-child { min-width: 0; text-align: left; overflow-wrap: anywhere; }
.page-footer > :nth-child(2) { min-width: 0; text-align: center; overflow-wrap: anywhere; }
.page-footer > :nth-child(3) { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.fund-dialog {
  box-sizing: border-box;
  width: calc(100vw - 2cm);
  height: calc(100dvh - 2cm);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce6df;
  border-radius: 8px;
  background: #fff;
  color: #1d2b2c;
  box-shadow: 0 22px 70px #112c2550;
}
.fund-dialog[open] { display: flex; flex-direction: column; }
.fund-dialog::backdrop { background: #10282199; }
.detail-heading {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e8eeea;
}
.detail-identity, .detail-actions { display: flex; align-items: center; gap: 11px; min-width: 0; }
.detail-actions { margin-left: auto; }
.detail-navigation { display: flex; flex: none; gap: 4px; }
.detail-nav-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d9e2de;
  border-radius: 5px;
  background: #fff;
  color: #526761;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.detail-nav-button:hover:not(:disabled) { background: var(--brand-soft); }
.detail-nav-button:disabled { color: #aab5b0; cursor: default; }
.detail-nav-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.detail-quote-time { color: #82928a; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.detail-id { font-family: Consolas, monospace; font-size: 14px; color: #71847a; flex: none; }
.detail-identity h2 { font-size: 20px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-type { font-size: 12px; color: var(--brand-hover); background: var(--brand-soft); padding: 3px 6px; border-radius: 3px; flex: none; }
.detail-actions .refresh-button { flex: none; }
.detail-close {
  width: 34px;
  height: 34px;
  border: 1px solid #d9e2de;
  border-radius: 5px;
  background: #fff;
  color: #526761;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.detail-close:hover { background: var(--brand-soft); }
.detail-close:focus-visible, .chart-tabs button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.detail-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 15px 22px 18px;
}
.detail-quote { display: flex; flex: none; align-items: flex-start; min-height: 185px; padding-bottom: 16px; overflow-x: auto; }
.detail-primary { display: inline-flex; flex: none; align-items: baseline; gap: 4px; margin-left: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#detail-price { color: #25322e; font-size: 20px; line-height: 1.2; font-weight: 700; }
#detail-change { font-size: 14px; font-weight: 600; }
#detail-change:not(:empty)::before { content: "（"; }
#detail-change:not(:empty)::after { content: "）"; }
#detail-change.rise { color: #b73836; }
#detail-change.fall { color: #16835a; }
.detail-stats {
  flex: none;
  width: 100%;
  min-width: 1400px;
  display: grid;
  grid-template-rows: repeat(4, 36px);
  grid-template-columns: repeat(6, 174px);
  justify-content: space-evenly;
  align-items: center;
  row-gap: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.detail-stats.metrics-collapsed { grid-template-rows: repeat(2, 36px); }
.detail-stats > div:not(.detail-extra-metrics):not(.detail-memo), .detail-extra-metrics > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 25px;
  min-width: 0;
}
.detail-stats span { color: #82928a; white-space: nowrap; }
.detail-stats strong { font-size: 12px; font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-stats > div:nth-child(1) { grid-area: 1 / 1; }
.detail-stats > div:nth-child(2) { grid-area: 2 / 1; }
.detail-stats > div:nth-child(3) { grid-area: 1 / 2; }
.detail-stats > div:nth-child(4) { grid-area: 2 / 2; }
.detail-stats > div:nth-child(5) { grid-area: 1 / 3; }
.detail-stats > div:nth-child(6) { grid-area: 2 / 3; }
.detail-stats .detail-turnover { grid-column: 4; grid-row: 1; }
.detail-stats .detail-holding { grid-column: 4; grid-row: 2; }
.detail-stats .detail-trade-price { grid-column: 5; grid-row: 1; }
.detail-stats .detail-trade-price { grid-template-columns: minmax(0, 1fr) 76px !important; column-gap: 10px !important; }
.detail-stats .detail-trade-change { grid-column: 5; grid-row: 2; }
.detail-extra-metrics { display: contents !important; }
.detail-extra-metrics[hidden] { display: none !important; }
.detail-extra-metrics > :nth-child(1) { grid-area: 3 / 1; }
.detail-extra-metrics > :nth-child(2) { grid-area: 3 / 2; }
.detail-extra-metrics > :nth-child(3) { grid-area: 3 / 3; }
.detail-extra-metrics > :nth-child(4) { grid-area: 3 / 4; }
.detail-extra-metrics > :nth-child(5) { grid-area: 3 / 5; }
.detail-extra-metrics > :nth-child(6) { grid-area: 4 / 1; }
.detail-extra-metrics > :nth-child(7) { grid-area: 4 / 2; }
.detail-extra-metrics > :nth-child(8) { grid-area: 4 / 3; }
.detail-extra-metrics > :nth-child(9) { grid-area: 4 / 4; }
.detail-extra-metrics > :nth-child(10) { grid-area: 4 / 5; }
.detail-stats .detail-memo {
  display: flex;
  flex-direction: column;
  grid-column: 6;
  grid-row: 1 / 5;
  align-self: stretch;
  min-width: 0;
}
.detail-stats.metrics-collapsed .detail-memo { grid-row: 1 / 3; }
.detail-memo-head { display: flex; align-items: center; justify-content: space-between; height: 36px; }
.detail-stats .detail-memo .inline-edit {
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
  flex: 1;
  padding: 6px;
  border: 1px solid #d9e5de;
  background: #fff;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  resize: none;
}
.detail-stats .detail-metrics-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid #d9e2de;
  border-radius: 4px;
  background: #fff;
  color: #526761;
  cursor: pointer;
}
.detail-metrics-toggle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(225deg);
}
.detail-metrics-toggle[aria-expanded="false"]::before { transform: rotate(45deg); }
.detail-metrics-toggle:hover { background: var(--brand-soft); }
.detail-metrics-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.detail-stats strong.rise { color: #b73836; }
.detail-stats strong.fall, .detail-stats strong.bottom-signal-low { color: #16835a; }
.detail-stats strong.percent-high { background: #fff0ee; }
.detail-stats strong.percent-low, .detail-stats strong.bottom-signal-low { background: #eaf6ee; }
.detail-stats strong.large-change { font-weight: 750; }
.detail-stats .inline-edit {
  box-sizing: border-box;
  width: 76px;
  padding: 2px 3px;
  border-color: #d9e5de;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.detail-stats .holding-select { width: 52px; text-align: left; }
.detail-warning {
  margin-bottom: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: #925139;
  background: #fff3ed;
}
.detail-warning[hidden] { display: none; }
.detail-body:has(#constituents-panel:not([hidden])) > #detail-warning { display: none; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e8eeea; padding: 12px 0; }
.chart-tabs { display: inline-flex; border: 1px solid #d9e5de; border-radius: 5px; overflow: hidden; flex: none; }
.chart-tabs button {
  min-width: 72px;
  padding: 7px 10px;
  border: 0;
  border-right: 1px solid #d9e5de;
  color: #527267;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.chart-tabs button:last-child { border-right: 0; }
.chart-tabs button[hidden] { display: none; }
.chart-tabs button:hover { background: var(--brand-soft); }
.chart-tabs button[aria-selected="true"] { color: #fff; background: var(--brand); }
.chart-time { color: #82928a; font-size: 11px; text-align: right; }
.chart-toolbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.chart-adjustment { display: inline-flex; align-items: center; gap: 6px; flex: none; color: #526761; font-size: 12px; white-space: nowrap; }
.chart-adjustment[hidden] { display: none; }
.chart-adjustment select { border: 1px solid #d9e5de; border-radius: 4px; background: #fff; color: #273d35; padding: 6px 8px; font: inherit; cursor: pointer; }
.chart-adjustment select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chart-readout {
  display: flex;
  flex: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 24px;
  min-height: 32px;
  padding: 4px 0 7px;
  color: #788780;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid #edf2ee;
}
.chart-readout span { white-space: nowrap; }
.chart-readout span[hidden] { display: none; }
.chart-readout strong { color: #273d35; font-weight: 600; margin-left: 6px; }
.chart-readout-time { color: #354b40; min-width: 134px; }
.chart-area { position: relative; flex: 1 0 260px; min-height: 260px; }
.chart-area.has-premium-study { flex-basis: 430px; min-height: 430px; }
.constituents-panel { flex: 1 0 260px; min-height: 260px; min-width: 0; display: flex; flex-direction: column; }
.constituents-panels { display: grid; grid-template-columns: repeat(2, minmax(330px, 1fr)); gap: 16px; min-height: 0; overflow: auto; flex: 1; }
.constituents-period { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.constituents-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; padding: 8px 0 12px; color: #526761; font-size: 12px; }
.constituents-meta strong { font-weight: 600; color: #254237; }
.constituents-scroll { min-height: 0; overflow: auto; border: 1px solid #e4ece7; }
.constituents-table { width: 100%; min-width: 330px; border-collapse: collapse; font-size: 12px; }
.constituents-table th { position: sticky; top: 0; background: #f2f6f4; color: #40594d; text-align: left; z-index: 1; }
.constituents-table th, .constituents-table td { padding: 9px 8px; border-bottom: 1px solid #edf1ee; }
.constituents-table th:first-child, .constituents-table td:first-child { width: 50px; text-align: center; }
.constituents-table th:last-child, .constituents-table td:last-child { width: 85px; text-align: right; font-variant-numeric: tabular-nums; }
.constituents-table tbody tr:hover { background: #f6faf7; }
.constituents-panel .detail-warning { flex: none; }
.detail-chart { width: 100%; height: 100%; }
.chart-nav-axis { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; color: #c33f41; font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-nav-axis[hidden] { display: none; }
.chart-nav-axis span { position: absolute; left: 0; display: block; padding: 1px 3px; background: #fff; transform: translateY(-50%); white-space: nowrap; }
.chart-pane-label {
  position: absolute;
  left: 10px;
  z-index: 1;
  padding: 2px 5px;
  background: #fff;
  color: #526761;
  font-size: 11px;
  pointer-events: none;
}
.chart-pane-label[hidden] { display: none; }
.intraday-end-label { display: none; }
.chart-empty {
  position: absolute;
  left: 0;
  right: 0;
  top: 45%;
  text-align: center;
  color: #82928a;
  font-size: 13px;
  pointer-events: none;
}
.chart-empty[hidden] { display: none; }
.detail-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; color: #94a19c; font-size: 11px; }
.detail-foot span { min-width: 0; }
.portfolio-dialog {
  width: min(1480px, calc(100vw - 2cm));
  max-width: none;
  height: min(820px, calc(100dvh - 2cm));
  max-height: none;
  padding: 0;
  border: 1px solid #dce6df;
  border-radius: 8px;
  color: #1d2b2c;
  background: #fff;
  box-shadow: 0 22px 70px #112c2550;
}
.portfolio-dialog[open] { display: flex; flex-direction: column; }
.portfolio-dialog::backdrop, .portfolio-form-dialog::backdrop { background: #10282199; }
.portfolio-heading, .portfolio-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portfolio-heading { flex: none; padding: 15px 20px; border-bottom: 1px solid #e8eeea; }
.portfolio-heading h2 { margin: 0; min-width: 0; font-size: 20px; overflow-wrap: anywhere; }
.portfolio-body { overflow: auto; padding: 0 20px 22px; }
.portfolio-summary-scroll { overflow-x: auto; border-bottom: 1px solid #e8eeea; }
.portfolio-summary {
  display: grid;
  grid-template-columns: 145px 188px 160px minmax(300px, 1fr);
  grid-template-rows: repeat(3, 36px);
  column-gap: 94px;
  row-gap: 8px;
  min-width: 1075px;
  width: 100%;
  padding: 16px 0;
  font-variant-numeric: tabular-nums;
}
.portfolio-summary-row { display: contents; }
.portfolio-summary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 25px;
  min-width: 0;
  white-space: nowrap;
}
.portfolio-summary-item span { font-size: 11px; color: #758681; text-align: left; }
.portfolio-summary-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-self: end;
  width: max-content;
  text-align: right;
  font-size: 12px;
  font-weight: 650;
}
.portfolio-summary-item input {
  box-sizing: border-box; width: 80px; padding: 4px 2px; border: 1px solid #d9e2de;
  border-radius: 4px; font-size: 11px; text-align: right; background: #fff;
}
.portfolio-summary-item input[type="number"] { appearance: auto; }
.portfolio-summary-memo {
  display: flex;
  flex-direction: column;
  grid-area: 1 / 4 / 4 / 5;
  min-width: 0;
}
.portfolio-summary-memo span { display: flex; align-items: center; min-height: 36px; color: #758681; font-size: 11px; }
.portfolio-summary-memo textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
  flex: 1;
  padding: 6px;
  border: 1px solid #d9e5de;
  background: #fff;
  font-size: 11px;
  line-height: 1.5;
  resize: none;
}
.portfolio-summary-item .rise { color: #b73836; }
.portfolio-summary-item .fall { color: #16835a; }
.portfolio-summary-item .percent-high { background: #fff0ee; font-weight: 750; }
.portfolio-summary-item .percent-low { background: #eaf6ee; font-weight: 750; }
.portfolio-summary-item.portfolio-negative-profit strong { background: #fff3cf; color: #795516; }
.portfolio-notice { padding: 8px 10px; background: #fff3ed; color: #925139; font-size: 12px; }
.portfolio-section { padding: 18px 0 4px; }
.portfolio-section-heading { margin-bottom: 10px; }
.portfolio-section h3 { margin: 0; font-size: 16px; }
.portfolio-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; border-bottom: 1px solid #dce6df; overflow-x: auto; }
.portfolio-toolbar .portfolio-tabs { flex: none; margin: 0; border: 0; }
.portfolio-dialog .portfolio-section { padding-top: 12px; }
.portfolio-actions { display: flex; gap: 8px; }
.portfolio-toolbar .portfolio-actions { flex: none; padding-bottom: 4px; }
.portfolio-toolbar .portfolio-actions button { white-space: nowrap; }
.portfolio-history-summary { width: min(100%, 900px); grid-template-columns: repeat(3, minmax(200px, 1fr)); padding: 10px 0; }
@media (max-width: 700px) {
  .portfolio-toolbar { gap: 6px; }
  .portfolio-toolbar .portfolio-tabs button { padding: 10px 7px; font-size: 12px; }
  .portfolio-toolbar .portfolio-actions { gap: 4px; }
  .portfolio-toolbar .portfolio-actions button { min-width: 0; padding: 5px 6px; font-size: 12px; }
}
.portfolio-table-scroll { overflow-x: auto; border: 1px solid #e1e9e4; border-radius: 5px; }
.portfolio-table { width: max-content; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.portfolio-table th { position: relative; padding: 10px 9px; background: var(--surface-tint); color: #647570; font-weight: 600; white-space: nowrap; text-align: left; }
.portfolio-table td { padding: 10px 9px; border-top: 1px solid #edf1ee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portfolio-account-filter { max-width: calc(100% - 12px); padding: 2px 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.portfolio-account-filter.active { color: var(--brand); font-weight: 750; }
.portfolio-table td.rise { color: #b73836; }
.portfolio-table td.fall { color: #16835a; }
.portfolio-table td.percent-high { background: #fff0ee; }
.portfolio-table td.percent-low { background: #eaf6ee; }
.portfolio-table td.large-change { font-weight: 750; }
.portfolio-resize-handle { position: absolute; top: 0; right: 0; height: 100%; width: 12px; cursor: col-resize; touch-action: none; }
.portfolio-resize-handle::after { content: ""; position: absolute; top: 7px; bottom: 7px; right: 3px; width: 1px; background: #cbd9d1; }
.portfolio-resize-handle:hover::after, .portfolio-resize-handle.dragging::after, .portfolio-resize-handle:focus-visible::after { width: 2px; background: var(--brand); }
.portfolio-table th:nth-child(n+4):not(:last-child), .portfolio-table td:nth-child(n+4):not(:last-child) { text-align: right; }
.portfolio-table tbody tr:hover { background: var(--surface-hover); }
.portfolio-table td.portfolio-empty { text-align: center; color: #82928a; padding: 22px; }
#portfolio-lots-table th:nth-last-child(3), #portfolio-lots-table td.portfolio-financing-flag { text-align: center; }
.portfolio-table th:last-child, .portfolio-table td.portfolio-row-actions {
  position: sticky; right: 0; z-index: 1; text-align: left;
  padding-left: 4px; padding-right: 4px; background: #fff; box-shadow: -1px 0 #e1e9e4;
}
.portfolio-table th:last-child { background: var(--surface-tint); z-index: 2; }
.portfolio-table tbody tr:hover td.portfolio-row-actions { background: var(--surface-hover); }
.portfolio-table .portfolio-spacer { padding: 0; }
.portfolio-row-actions button { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 4px 7px; }
.portfolio-row-actions button:hover { text-decoration: underline; }
.portfolio-row-actions button:last-child { padding-right: 0; }
.overview-table-scroll { overflow: auto; max-height: calc(100dvh - 154px); border: 1px solid #e1e9e4; background: #fff; }
.overview-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.overview-table th { position: sticky; top: 0; z-index: 2; padding: 10px 16px 10px 9px; background: var(--surface-tint); color: #647570; text-align: left; white-space: nowrap; font-weight: 600; border-bottom: 1px solid #dce6df; overflow: hidden; text-overflow: ellipsis; }
.overview-table td { padding: 10px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid #edf1ee; }
.overview-table .numeric { text-align: right; }
.overview-table .ordinal { text-align: center; }
.overview-table th[data-key="financed"], .overview-table td[data-key="financed"] { text-align: center; }
.overview-table .rise { color: #b73836; }
.overview-table .fall { color: #16835a; }
.overview-table .percent-high { background: #fff0ee; }
.overview-table .percent-low { background: #eaf6ee; }
.overview-table .large-change { font-weight: 750; }
.overview-table td.negative-profit { background: #fff3cf; }
.overview-table td.negative-daily { color: #b73836; background: #fff0ee; }
.daily-cash-edit { margin-left: 10px; padding: 0; border: 0; background: none; color: var(--brand); cursor: pointer; font: inherit; }
.daily-cash-edit:hover { text-decoration: underline; }
.overview-table tr:hover td:not(.percent-high):not(.percent-low):not(.negative-profit):not(.deadline-soon):not(.deadline-urgent) { background: var(--surface-hover); }
.overview-table td.deadline-soon,
.overview-table tr:hover td.deadline-soon { background: #fff0b3; color: #574400; }
.overview-table td.deadline-urgent,
.overview-table tr:hover td.deadline-urgent { background: #ffd8d5; color: #a01d1a; font-weight: 700; }
.overview-table tr:hover td.negative-daily { background: #ffe2dd; }
#overview-content[data-report="daily"] .overview-table th[data-key="day"],
#overview-content[data-report="daily"] .overview-table td:first-child,
#overview-content[data-report="holdingMonthly"] .overview-table th[data-key="month"],
#overview-content[data-report="holdingMonthly"] .overview-table td:first-child {
  position: sticky; left: 0; z-index: 3; background: #fff; box-shadow: 1px 0 #dce6df;
}
#overview-content[data-report="daily"] .overview-table th[data-key="day"],
#overview-content[data-report="holdingMonthly"] .overview-table th[data-key="month"] { background: var(--surface-tint); z-index: 4; }
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) #overview-headers th,
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) #overview-subheaders th { height: 40px; box-sizing: border-box; }
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) #overview-subheaders th { top: 40px; }
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) .overview-table th.overview-group-header { text-align: center; padding: 10px 9px; }
#overview-content[data-report="daily"] #overview-headers th[data-key="cash"] { text-align: center; }
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) #overview-headers th.overview-group-header + th.overview-group-header,
#overview-content[data-report="daily"] #overview-headers th[data-key="cash"] + th.overview-group-header,
#overview-content[data-report="daily"] #overview-headers th[data-key="cash"],
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) #overview-subheaders th[data-key="guangfaAssets"],
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) #overview-subheaders th[data-key="marginAssets"],
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) #overview-subheaders th[data-key="pinganAssets"],
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) #overview-subheaders th[data-key="zhongshanAssets"],
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) .overview-table td[data-key="guangfaAssets"],
#overview-content[data-report="daily"] .overview-table td[data-key="cash"],
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) .overview-table td[data-key="marginAssets"],
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) .overview-table td[data-key="pinganAssets"],
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) .overview-table td[data-key="zhongshanAssets"] { border-left: 1px solid #c6d5cb; }
.overview-table td.overview-empty { text-align: center; padding: 32px 12px; color: #82928a; }
.overview-fund-button { padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.overview-fund-button:hover { color: var(--brand); text-decoration: underline; }
.overview-table .overview-actions { width: 96px; text-align: left; }
.financing-history-dialog { width: min(94vw, 1420px); max-width: none; max-height: 85dvh; padding: 20px; border: 1px solid #dce6df; border-radius: 6px; }
.financing-history-dialog::backdrop { background: #10282199; }
.financing-history-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; }
.financing-history-heading h2 { margin: 0; font-size: 18px; }
.financing-history-dialog .overview-table { min-width: 1240px; }
.financing-history-dialog .overview-table-scroll { max-height: 65dvh; }
.financing-history-dialog .overview-table th, .financing-history-dialog .overview-table td { padding-right: 12px; }
.financing-link-dialog { width: min(92vw, 800px); }
.financing-link-rows { max-height: 55dvh; overflow-y: auto; border-top: 1px solid #dce6df; }
.financing-link-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid #dce6df; cursor: pointer; line-height: 1.5; }
.financing-link-row input { flex: none; margin-top: 4px; accent-color: var(--brand); }
.financing-link-row span { overflow-wrap: anywhere; }
.financing-link-count { padding-top: 12px; font-weight: 600; text-align: right; }
#overview-content[data-page="financing"] #overview-table th[data-key="actions"],
#overview-content[data-page="financing"] #overview-table td[data-key="actions"],
#overview-content[data-report="sellable"] #overview-table th[data-key="actions"],
#overview-content[data-report="sellable"] #overview-table td[data-key="actions"] {
  position: sticky; right: 0; background: #fff; box-shadow: -1px 0 #e1e9e4;
}
#overview-content[data-page="financing"] #overview-table th[data-key="actions"],
#overview-content[data-report="sellable"] #overview-table th[data-key="actions"] { z-index: 3; background: var(--surface-tint); }
#overview-content[data-page="financing"] #overview-table tbody tr:hover td[data-key="actions"],
#overview-content[data-report="sellable"] #overview-table tbody tr:hover td[data-key="actions"] { background: var(--surface-hover); }
.overview-actions button { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 4px 7px; }
.overview-actions button:hover { text-decoration: underline; }
.overview-filter { z-index: 20; }
.overview-filter-search { width: 100%; padding: 7px 8px; margin-bottom: 8px; border: 1px solid #d9e2de; border-radius: 4px; font: inherit; }
.holdings-heading-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(155px, 1fr));
  gap: 8px clamp(18px, 3vw, 42px);
  width: min(100%, 1120px);
  font-variant-numeric: tabular-nums;
}
#holdings-heading-summary { grid-template-columns: repeat(6, minmax(155px, 1fr)); width: min(100%, 1340px); }
@media (max-width: 1500px) {
  #holdings-heading-summary { grid-template-columns: repeat(3, minmax(155px, 1fr)); width: min(100%, 800px); }
}
.financing-heading-summary { grid-template-columns: repeat(3, minmax(200px, 1fr)); width: min(100%, 800px); }
#overview-content[data-report="holdings"] #overview-count + .holdings-heading-summary { margin-left: 10px; }
.holdings-heading-summary > div {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) max-content;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.holdings-heading-summary > div > span { font-size: 13px; color: #647570; }
.holdings-heading-summary strong { font-size: 16px; font-weight: 650; white-space: nowrap; }
.holdings-heading-summary .rise { color: #b73836; }
.holdings-heading-summary .fall { color: #16835a; }
.holdings-heading-summary .collateral-warning { background: #fff0b3; color: #574400; }
.holdings-heading-summary .collateral-urgent { background: #ffd8d5; color: #a01d1a; }
.holdings-heading-summary > .timestamps { grid-column: 1 / -1; }
@media (max-width: 1200px) {
  .holdings-heading-summary { grid-template-columns: repeat(2, minmax(200px, 1fr)); width: min(100%, 496px); }
  #holdings-heading-summary { grid-template-columns: repeat(2, minmax(200px, 1fr)); width: min(100%, 496px); }
  .financing-heading-summary { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
}
@media (max-width: 700px) {
  .holdings-heading-summary { grid-template-columns: minmax(0, 1fr); width: min(100%, 260px); }
  #holdings-heading-summary { grid-template-columns: minmax(0, 1fr); width: min(100%, 260px); }
  .financing-heading-summary { grid-template-columns: minmax(0, 1fr); }
  #overview-content[data-report="holdings"] #overview-count + .holdings-heading-summary { margin-left: 0; }
}
.holdings-account-filter { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 4px 0 12px; font-size: 13px; overflow-x: auto; }
.holdings-account-filter > span { flex: none; color: #647570; }
.holdings-account-options { display: flex; align-items: center; gap: 16px; flex: none; }
.holdings-account-options label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.holdings-account-options input { margin: 0; accent-color: var(--brand); }
.holdings-filtered-summary { display: flex; flex: none; align-items: center; gap: 24px; margin-left: 10px; font-variant-numeric: tabular-nums; }
.holdings-filtered-summary[hidden] { display: none; }
.holdings-filtered-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 25px; width: 195px; white-space: nowrap; }
.holdings-filtered-summary span { color: #647570; }
.holdings-filtered-summary strong { text-align: right; font-size: 15px; }
.holdings-filtered-summary strong.rise { color: #b73836; }
.holdings-filtered-summary strong.fall { color: #16835a; }
@media (max-width: 700px) {
  .holdings-account-filter { gap: 8px; font-size: 12px; }
  .holdings-account-options { gap: 8px; }
  .holdings-account-options label { gap: 3px; }
  .holdings-filtered-summary { gap: 8px; margin-left: 4px; }
  .holdings-filtered-summary > div { width: 170px; gap: 20px; font-size: 11px; }
  .holdings-filtered-summary strong { font-size: 12px; }
}
.report-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid #dce6df; margin-bottom: 12px; }
.report-tabs button { flex-shrink: 0; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #647570; font-size: 14px; font-weight: 600; cursor: pointer; }
.report-tabs button[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--brand); }
.report-tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.training-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.training-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.training-source { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.training-toolbar { display: flex; align-items: center; gap: 18px; min-height: 50px; margin-bottom: 8px; }
.training-metrics { display: grid; grid-template-columns: repeat(4, 135px); gap: 8px 100px; width: max-content; flex: none; font-variant-numeric: tabular-nums; }
.training-metrics > div { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: baseline; gap: 8px; white-space: nowrap; }
.training-metrics span { color: #647570; font-size: 13px; }
.training-metrics strong { font-size: 16px; font-weight: 650; }
.training-export { margin-left: auto; flex: none; white-space: nowrap; }
.training-table-scroll { overflow: auto; flex: 1; min-height: 0; border: 1px solid #e1e9e4; background: #fff; }
.training-table { width: max-content; min-width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.training-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-tint); color: #647570; text-align: left; height: 42px; padding: 0 16px 0 9px; border-bottom: 1px solid #e1e9e4; white-space: nowrap; font-weight: 600; }
.training-table th.numeric { text-align: right; }
.training-table td { height: 42px; padding: 5px 9px; border-bottom: 1px solid #eef2ef; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.training-table td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.training-table tbody tr:hover { background: var(--surface-hover); }
.training-table td.empty-state { text-align: center; }
.training-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 10px; cursor: col-resize; }
.training-resize::after { content: ""; position: absolute; top: 9px; bottom: 9px; right: 2px; width: 1px; background: #d8e2dc; }
.training-resize:hover::after { width: 2px; background: var(--brand); }
.training-refresh:disabled { cursor: not-allowed; }
.training-refresh:disabled .refresh-icon { animation: none; }
.training-index .training-metrics { grid-template-columns: repeat(2, 155px); column-gap: 140px; }
.training-selection .training-metrics { grid-template-columns: repeat(2, 155px); column-gap: 140px; }
.training-preferred { width: 100%; min-height: 30px; border: 1px solid #cbd9d3; border-radius: 4px; background: #fff; color: inherit; font: inherit; cursor: pointer; }
.training-preferred:disabled { cursor: wait; opacity: .55; }
.training-selection td:has(> input[type="checkbox"]) { text-align: center; }
.training-selection td > input[type="checkbox"] { accent-color: var(--brand); cursor: pointer; }
.training-selection .training-memo { width: 100%; min-width: 0; height: 30px; box-sizing: border-box; font: inherit; }
.training-selection .training-compare-button:disabled { opacity: .5; cursor: not-allowed; }
.training-package { display: flex; flex: 1; min-height: 0; }
.training-package-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 12px; flex: 1; min-width: 0; min-height: 0; }
.training-package-nav { overflow: auto; min-height: 0; border: 1px solid #e1e9e4; background: #fff; }
.training-package-list { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.training-package-list th { position: sticky; top: 0; z-index: 1; height: 42px; text-align: left; padding: 0 10px; color: #647570; background: var(--surface-tint); border-bottom: 1px solid #e1e9e4; }
.training-package-list td { height: 42px; padding: 0 8px; border-bottom: 1px solid #eef2ef; white-space: nowrap; }
.training-package-list tbody tr.selected { background: #c5e0ff; }
.training-package-list tbody tr:hover { background: var(--surface-hover); }
.training-package-list tbody tr.selected:hover { background: #c5e0ff; }
.training-package-list td.training-package-create { text-align: center; }
.training-package-name { width: 100%; max-width: 100%; display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; background: none; cursor: pointer; }
.training-package-list td:has(.training-package-action):hover .training-package-name,
.training-package-list td:has(.training-package-action):focus-within .training-package-name { width: calc(100% - 58px); }
.training-package-action { display: none; font-size: 11px; }
.training-package-list tr:hover .training-package-action, .training-package-list tr:focus-within .training-package-action { display: inline; }
.training-package-main { min-width: 0; }
.training-package-toolbar { display: flex; align-items: center; gap: 12px; min-height: 50px; margin-bottom: 8px; }
.training-package-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.training-package-import-control { position: relative; flex: none; }
.training-package-menu { position: absolute; z-index: 8; right: 0; top: calc(100% + 4px); min-width: 150px; max-height: 60dvh; overflow: auto; border: 1px solid #cbd9d3; background: #fff; box-shadow: 0 7px 18px #203b3024; }
.training-package-menu[hidden] { display: none; }
.training-package-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; text-align: left; font: inherit; color: inherit; background: #fff; cursor: pointer; }
.training-package-menu button:hover { background: var(--surface-hover); }
.training-dialog.training-package-name-dialog {
  box-sizing: border-box;
  width: min(320px, calc(100vw - 28px));
}
.training-package-name-dialog label { display: grid; gap: 8px; font-size: 13px; }
.training-package-name-dialog label[hidden] { display: none; }
.training-package-name-dialog input { box-sizing: border-box; width: 100%; height: 34px; padding: 5px 8px; border: 1px solid #cbd9d3; border-radius: 4px; font: inherit; }
.training-package-name-dialog .training-package-delete-warning { font-size: 13px; }
.training-package-import { width: min(1250px, calc(100vw - 28px)); max-width: none; display: block; }
.training-package-import:not([open]) { display: none; }
.training-package-import-table { height: min(62dvh, 610px); display: flex; flex-direction: column; }
.training-package-import-table .training-table-scroll { min-height: 0; }
.training-package-import-table td:first-child { text-align: center; }
.training-package-import-table input[type=checkbox] { accent-color: var(--brand); }
.training-package-import-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.training-package-import-actions > div { display: flex; align-items: center; gap: 8px; }
@media (max-width: 700px) {
  .training-package-layout { grid-template-columns: 135px minmax(0, 1fr); gap: 6px; }
  .training-package-toolbar { flex-wrap: wrap; gap: 6px; padding: 4px 0; }
  .training-package-toolbar .training-package-title { flex-basis: 100%; }
  .training-package-list td:has(.training-package-action):hover .training-package-name,
  .training-package-list td:has(.training-package-action):focus-within .training-package-name { width: 100%; }
  .training-package-action { display: inline; }
  .training-package-list td { white-space: normal; }
  .training-package-import-actions { flex-wrap: wrap; }
}
.training-compare-dialog {
  box-sizing: border-box;
  width: min(calc(165px + var(--comparison-count, 2) * 270px), calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #d9e3df;
  border-radius: 6px;
  color: #1d2b2c;
  background: #fff;
}
.training-compare-dialog::backdrop { background: #102c2780; }
.training-compare-dialog h2 { margin: 0; font-size: 18px; }
.training-compare-loading, .training-compare-error { margin: 8px 0; font-size: 12px; }
.training-compare-error { color: #bb3943; }
.training-compare-loading[hidden], .training-compare-error:empty { display: none; }
.training-compare-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.training-compare-table th, .training-compare-table td {
  padding: 9px 10px;
  border: 1px solid #dce6df;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.training-compare-table thead th { background: #eaf2ee; font-weight: 650; }
.training-compare-table thead th:first-child, .training-compare-table tbody th {
  width: clamp(84px, 13%, 140px);
  background: #f5f8f6;
  font-weight: 650;
}
.training-compare-table td.training-compare-common { text-align: center; }
.training-compare-table tbody td > div + div { margin-top: 4px; }
.training-compare-table .training-memo { width: 100%; box-sizing: border-box; min-width: 0; }
@media (max-width: 600px) {
  .training-compare-dialog { padding: 8px; }
  .training-compare-table { font-size: 11px; }
  .training-compare-table th, .training-compare-table td { padding: 6px 4px; }
}
.training-index td select { width: 100%; min-width: 0; height: 30px; border: 1px solid #cbd9d3; border-radius: 4px; background: #fff; color: inherit; font: inherit; }
.training-index td select:disabled { opacity: .55; }
.training-table td.binary-choice { text-align: center; }
.training-table td.binary-choice select { text-align: center; text-align-last: center; padding-left: 18px; }
.training-tag { display: inline-block; background: #e9f3ef; color: #245d48; border-radius: 3px; padding: 2px 5px; margin-right: 4px; }
.training-cell-value { display: inline-block; max-width: calc(100% - 62px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.inline-edit:not(:focus) { text-overflow: ellipsis; }
.training-link { border: 0; background: none; color: var(--brand); font: inherit; padding: 0 2px; cursor: pointer; text-decoration: underline; }
.training-table tbody tr.selected { background: #e5f2ff; }
.training-dialog { width: min(1180px, calc(100vw - 28px)); max-height: min(780px, calc(100dvh - 30px)); border: 1px solid #d9e3df; border-radius: 6px; padding: 18px; color: inherit; }
.training-dialog.training-tags-dialog { box-sizing: border-box; width: min(480px, calc(100vw - 28px)); }
.training-tags-dialog textarea { box-sizing: border-box; }
.training-dialog::backdrop { background: #102c2780; }
.training-dialog h2 { font-size: 17px; margin: 0 0 14px; }
.training-dialog-body { min-height: 80px; max-height: calc(100dvh - 190px); overflow: auto; }
.training-dialog-body .training-table-scroll { max-height: min(610px, calc(100dvh - 200px)); }
.training-dialog-body .training-table td { cursor: pointer; }
.training-dialog-body label { display: grid; gap: 8px; font-size: 13px; }
.training-dialog-body textarea { width: 100%; min-height: 90px; padding: 8px; border: 1px solid #bccbc5; font: inherit; }
.training-dialog-error { min-height: 18px; color: #bb3943; font-size: 12px; margin: 7px 0; }
.training-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.training-dialog-actions button { padding: 6px 16px; border: 1px solid #ccd9d3; border-radius: 4px; background: #fff; cursor: pointer; }
.training-dialog-actions .training-dialog-confirm { background: var(--brand); border-color: var(--brand); color: #fff; }
.training-dialog-actions .training-dialog-confirm:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1200px) {
  .training-toolbar { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 8px 10px; }
  .training-toolbar > .training-refresh { grid-column: 1; grid-row: 1; }
  .training-toolbar > .training-clear { grid-column: 2; grid-row: 1; }
  .training-selection .training-toolbar > .training-compare-button { grid-column: 2; grid-row: 1; }
  .training-selection .training-toolbar > .training-clear { grid-column: 3; grid-row: 1; justify-self: start; }
  .training-metrics { grid-column: 1 / -1; grid-row: 2; }
  .training-export { grid-column: 4; grid-row: 1; }
}
@media (max-width: 900px) {
  .training-metrics { grid-template-columns: repeat(2, 135px); column-gap: 100px; }
  .training-index .training-metrics, .training-selection .training-metrics { grid-template-columns: repeat(2, 155px); column-gap: 140px; }
}
@media (max-width: 500px) {
  .training-metrics, .training-index .training-metrics, .training-selection .training-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    width: 100%;
  }
  .training-metrics > div { white-space: normal; }
  .training-metrics span { font-size: 11px; }
  .training-metrics strong { font-size: 13px; }
}
.report-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 20px; padding: 16px 0; border-top: 1px solid #e1e9e4; border-bottom: 1px solid #e1e9e4; }
.report-toolbar { display: flex; flex-direction: column; flex: none; width: 100%; min-width: 0; }
#overview-content:is([data-report="monthly"], [data-report="ranking"], [data-report="accountIncome"], [data-report="review"]) .report-toolbar {
  flex-direction: row; align-items: center; gap: 12px; margin-bottom: 12px;
  overflow-x: auto; overflow-y: hidden; border-top: 1px solid #e1e9e4; border-bottom: 1px solid #e1e9e4;
}
#overview-content:is([data-report="monthly"], [data-report="ranking"], [data-report="accountIncome"], [data-report="review"]) .report-controls { flex: none; flex-wrap: nowrap; gap: 8px; padding: 0; white-space: nowrap; }
#overview-content:is([data-report="monthly"], [data-report="ranking"], [data-report="accountIncome"], [data-report="review"]) .report-summary {
  flex: 1 0 560px; min-width: 560px; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px; padding: 8px 0; border: 0;
}
#overview-content:is([data-report="monthly"], [data-report="ranking"], [data-report="accountIncome"], [data-report="review"]) .report-summary-item { gap: 3px; }
#overview-content:is([data-report="monthly"], [data-report="ranking"], [data-report="accountIncome"], [data-report="review"]) .report-summary-item strong { font-size: 16px; white-space: nowrap; overflow-wrap: normal; }
#overview-content[data-report="total"] .report-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.report-summary-item { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.report-summary-item span { font-size: 12px; color: #647570; }
.report-summary-item strong { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report-summary .rise { color: #b73836; }
.report-summary .fall { color: #16835a; }
.report-note { color: #647570; font-size: 12px; line-height: 1.8; margin: 12px 0; }
.overview-foot { flex: none; }
.overview-foot .report-note { margin: 0; line-height: 1.4; font-size: 11px; }
#overview-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#overview-content #overview-panel { display: flex; flex: 1; min-height: 0; flex-direction: column; overflow: auto; }
#overview-content:is([data-page="history"], [data-page="holdings"]) .overview-table-scroll { flex: 1; min-height: 0; max-height: none !important; }
#overview-content[data-page="financing"] {
  min-height: 0;
}
#overview-content[data-page="financing"] #overview-panel > .overview-table-scroll {
  flex: 1;
  min-height: 0;
  max-height: none !important;
}
.report-sort { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; vertical-align: middle; }
.sort-label { overflow: hidden; text-overflow: ellipsis; }
.report-sort:has(+ .filter-trigger) { max-width: calc(100% - 27px); }
.sort-arrows { display: inline-flex; flex-direction: column; gap: 3px; flex: 0 0 8px; }
.sort-up, .sort-down { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.sort-up { border-bottom: 4px solid #a2ada8; }
.sort-down { border-top: 4px solid #a2ada8; }
.sort-up.active { border-bottom-color: var(--brand); }
.sort-down.active { border-top-color: var(--brand); }
.report-chart { padding: 0 0 16px; display: grid; gap: 8px; }
.holding-trend { flex: none; border-top: 1px solid #dce6df; }
.holding-trend-heading { display: flex; align-items: center; justify-content: space-between; min-height: 38px; font-size: 13px; font-weight: 650; }
.holding-trend-heading .icon-button { font-size: 19px; line-height: 1; }
.holding-trend-heading .icon-button[aria-expanded="true"] { transform: rotate(180deg); }
.holding-trend-body { padding-bottom: 10px; }
.holding-trend-legend { font-size: 11px; color: #526761; white-space: pre; padding: 2px 0 7px; }
.holding-trend-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; }
.holding-trend-scroll svg { display: block; height: 190px; max-width: none; }
.holding-estimate { margin: 0 0 0 auto; font-size: 12px; color: #9a572c; text-align: right; }
.report-bar-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; gap: 12px; align-items: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.report-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track { height: 10px; background: #e8ecea; border-radius: 2px; overflow: hidden; }
.report-bar-fill { height: 100%; background: #468ab1; min-width: 0; }
.report-bar-fill.positive { background: #c25a57; }
.report-bar-fill.negative { background: #31866a; }
.report-bar-value { text-align: right; }
#report-tabs:not([hidden]) ~ #overview-panel .overview-table-scroll { max-height: 55dvh; }
@media (max-width: 1100px) { #overview-content[data-report="total"] .report-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .report-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .portfolio-history-summary { grid-template-columns: repeat(3, minmax(200px, 1fr)); min-width: 650px; }
  .report-summary, #overview-content[data-report="total"] .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .report-summary-item strong { font-size: 18px; }
  .report-bar-row { grid-template-columns: 100px minmax(0, 1fr) 90px; gap: 8px; }
}
.report-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding: 0 0 14px; font-size: 13px; }
.report-modes { display: flex; gap: 14px; align-items: center; padding: 0; border: 0; margin: 0; }
.report-modes legend { float: left; margin-right: 14px; color: #647570; }
.report-modes label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.report-modes input { accent-color: var(--brand); margin: 0; }
.report-controls > label { display: flex; align-items: center; gap: 8px; }
.report-controls select { height: 32px; padding: 4px 8px; border: 1px solid #d9e2de; border-radius: 4px; background: #fff; color: #1d2b2c; }
.report-fund-control input { width: 160px; min-width: 0; height: 32px; padding: 4px 8px; border: 1px solid #d9e2de; border-radius: 4px; background: #fff; color: #1d2b2c; }
.report-fund-control:has(#report-fund-name) input { width: 190px; }
#report-toolbar:has(#report-controls:not([hidden])) ~ #overview-panel .overview-table-scroll { max-height: calc(100dvh - 250px); }
@media (max-width: 700px) {
  .site-header:has(.header-navigation:not([hidden])) { height: auto; min-height: 84px; }
  .header-inner:has(.header-navigation:not([hidden])) { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .header-account { flex-wrap: wrap; gap: 12px; }
  .header-navigation { gap: 12px; }
  .report-modes { flex-wrap: wrap; gap: 10px; }
}
.portfolio-form-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 36px);
  padding: 22px;
  border: 1px solid #dce6df;
  border-radius: 6px;
  background: #fff;
  color: #1d2b2c;
  box-shadow: 0 18px 54px #112c2540;
}
.portfolio-form-dialog h2 { margin: 0 0 18px; font-size: 19px; }
.portfolio-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.portfolio-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; color: #526761; }
.portfolio-field input, .portfolio-field select {
  width: 100%; height: 36px; padding: 6px 8px;
  border: 1px solid #d9e2de; border-radius: 4px;
  color: #1d2b2c; background: #fff;
}
.portfolio-field input[readonly] { background: var(--surface-tint); }
.repay-amount-control { display: flex; align-items: center; gap: 6px; }
.repay-amount-control input { flex: 1; min-width: 0; }
.repay-amount-control button { flex: none; height: 36px; }
.repay-amount-control #financing-repay-reverse { min-width: 0; width: 51px; padding: 0; }
.portfolio-date-control { position: relative; display: block; min-width: 0; }
.portfolio-date-control input { width: 100%; color: transparent; }
.portfolio-date-control input::-webkit-datetime-edit { opacity: 0; }
.portfolio-date-value { position: absolute; inset: 0 32px 0 8px; display: flex; align-items: center; pointer-events: none; color: #1d2b2c; font-size: inherit; white-space: nowrap; }
.portfolio-field input:focus, .portfolio-field select:focus { outline: 2px solid var(--brand); }
.portfolio-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 20px; }
.account-settings-dialog { width: min(860px, calc(100vw - 32px)); max-height: 85dvh; padding: 22px; border: 1px solid #dce6df; border-radius: 8px; background: #fff; color: #1d2b2c; }
.account-settings-dialog h2 { margin: 0 0 16px; font-size: 19px; }
.account-settings-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.account-settings-scroll { max-height: 48dvh; overflow: auto; }
.account-settings-table { width: 100%; min-width: 560px; }
.account-settings-table td:last-child { white-space: nowrap; }
.account-settings-table td button { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 4px 7px; }
.account-settings-table td button:disabled { color: #9ba6ab; cursor: default; }
.account-settings-bottom { display: flex; align-items: end; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.account-settings-bottom > label { display: flex; flex-direction: column; gap: 6px; width: 160px; font-size: 12px; }
.account-settings-bottom select, .account-rate-input input { min-height: 34px; padding: 5px 8px; border: 1px solid #dce6df; border-radius: 4px; background: #fff; color: #1d2b2c; }
.account-rate-input { display: inline-flex; align-items: center; gap: 6px; }
.account-rate-input input { width: 110px; }
#account-edit-form .account-edit-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-edit-fields .account-rate-input { display: block; position: relative; width: 100%; }
.account-edit-fields .account-rate-input input { width: 100%; }
.account-edit-fields .account-rate-unit { position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
.account-settings-bottom select, .account-settings-bottom .account-rate-input input { width: 140px; box-sizing: border-box; }
.account-settings-bottom select:disabled { background: #f0f2f4; border-color: #d6dce0; color: #7c8990; opacity: 1; cursor: not-allowed; }
#overview-content:is([data-report="daily"], [data-report="holdingMonthly"]) .overview-table :is(th, td).account-boundary { border-left: 1px solid #c6d5cb; }
.portfolio-delete { margin-right: auto; padding: 6px 0; border: 0; background: none; color: #a33a32; cursor: pointer; text-decoration: underline; }
.portfolio-template-link { display: inline-flex; align-items: center; text-decoration: none; font-size: 12px; }
.portfolio-import-field { margin-top: 18px; }
.portfolio-import-field input { height: auto; min-height: 36px; }
@media (max-width: 1750px) {
  .detail-stats { justify-content: space-between; }
}
@media (max-width: 700px) {
  .portfolio-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .portfolio-heading { padding: 12px; }
  .portfolio-body { padding: 0 12px 16px; }
  .portfolio-heading h2 { font-size: 17px; }
  .portfolio-form-fields { grid-template-columns: 1fr; }
  .site-header { height: 52px; }
  .page { padding-top: 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .heading-meta { align-items: flex-start; }
  h1 { font-size: 23px; }
  .heading-main { gap: 10px; }
  #etf-table th, #etf-table td { padding-left: 6px; padding-right: 6px; }
  .page-footer { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .fund-dialog { width: calc(100vw - 24px); height: calc(100dvh - 24px); }
  .detail-heading { flex-wrap: wrap; padding: 12px; gap: 8px; }
  .detail-body { padding: 12px; }
  .detail-actions { width: 100%; justify-content: space-between; }
  .detail-identity { flex-wrap: wrap; gap: 4px 8px; }
  .detail-identity h2 { font-size: 17px; max-width: 170px; }
  .detail-actions { gap: 5px; }
  .detail-actions .refresh-button { min-width: 34px; width: 34px; }
  .detail-actions .refresh-button span { display: none; }
  .detail-primary { margin-left: 4px; }
  .chart-toolbar { align-items: flex-start; flex-direction: column; }
  .chart-toolbar-right { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .chart-readout { gap: 4px 12px; }
  .chart-readout-time { flex-basis: 100%; }
  .chart-tabs { display: flex; width: 100%; }
  .chart-tabs button { flex: 1; min-width: 0; padding: 8px 2px; }
  .chart-area.has-premium-study { flex-basis: 470px; min-height: 470px; }
  .intraday-end-label:not([hidden]) {
    display: block;
    position: absolute;
    bottom: 1px;
    z-index: 1;
    background: #fff;
    color: #697973;
    font-size: 11px;
    line-height: 14px;
    pointer-events: none;
  }
  .chart-time { text-align: left; }
  .detail-foot { flex-direction: column; gap: 4px; }
}
@media (max-width: 360px) {
  .detail-actions { display: grid; grid-template-columns: minmax(0, 1fr) 34px 34px; gap: 6px 5px; }
  .detail-navigation { grid-column: 1; grid-row: 1; }
  .detail-quote-time { grid-column: 1; grid-row: 2; }
  .detail-actions .refresh-button { grid-column: 2; grid-row: 2; }
  .detail-close { grid-column: 3; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .refresh-button:disabled .refresh-icon { animation: none; }
}
