:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --ink: #162033;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #d9e1ec;
  --line-soft: #edf1f6;
  --blue: #1f73e8;
  --blue-soft: #e8f1ff;
  --green: #079455;
  --green-soft: #e7f7ef;
  --red: #d92d20;
  --red-soft: #ffebe8;
  --amber: #b7791f;
  --shadow: 0 14px 40px rgba(22, 32, 51, 0.08);
  --radius: 8px;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.app-workspace {
  min-width: 0;
}

.app-sidebar {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 24px);
  padding: 18px 10px 12px;
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  color: #344054;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.side-nav-item:hover,
.side-nav-item:focus-visible {
  color: var(--blue);
  background: #f2f7ff;
  outline: none;
}

.side-nav-item.active {
  color: var(--blue);
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.side-nav-item.muted {
  color: #475467;
}

.side-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.side-icon svg,
.post-open-button svg,
.article-nav-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-about {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  border-left-width: 0;
  border-radius: 0;
}

.side-chevron {
  margin-left: auto;
  color: var(--subtle);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 0 2px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  align-items: end;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(31, 115, 232, 0.12);
}

.brand-mark span {
  display: block;
  width: 8px;
  border-radius: 3px 3px 1px 1px;
  background: var(--blue);
}

.brand-mark span:nth-child(1) {
  height: 12px;
  background: #2f80ed;
}

.brand-mark span:nth-child(2) {
  height: 20px;
  background: #12b76a;
}

.brand-mark span:nth-child(3) {
  height: 16px;
  background: #f79009;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p,
.table-header p,
.summary-metric small {
  color: var(--muted);
}

.brand p {
  margin-top: 4px;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1;
}

.dashboard-info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #475467;
  background: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.dashboard-info-button span {
  color: var(--blue);
  font-size: 14px;
}

.dashboard-info-button:hover,
.dashboard-info-button:focus-visible {
  border-color: #b8d5ff;
  color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 100%);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.icon-button,
.primary-button,
.ghost-button,
.sort-button,
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}

.primary-button {
  padding: 0 14px;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(31, 115, 232, 0.18);
}

.ghost-button {
  padding: 0 12px;
  color: var(--475467, #475467);
  background: var(--surface);
  border-color: var(--line);
}

.benchmark-band,
.summary-band,
.table-shell {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.benchmark-band {
  border-radius: var(--radius) var(--radius) 0 0;
  overflow-x: auto;
}

.tabs {
  display: flex;
  gap: 2px;
  min-width: max-content;
  padding: 8px 10px 0;
}

.tab-button {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  min-width: 132px;
  min-height: 68px;
  padding: 10px 14px 12px;
  color: var(--muted);
  background: transparent;
}

.tab-button strong {
  color: inherit;
  font-size: 15px;
}

.tab-button span {
  color: var(--subtle);
  font-size: 12px;
}

.tab-button.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.tab-button.active::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
  content: "";
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: -1px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--line-soft);
  overflow: hidden;
}

.summary-metric {
  display: grid;
  gap: 7px;
  min-height: 108px;
  padding: 18px;
  background: var(--surface);
}

.summary-metric span {
  color: var(--muted);
  font-size: 13px;
}

.summary-metric strong {
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.summary-metric small {
  font-size: 12px;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-title-block {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.table-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-wrap: wrap;
}

.table-search-field {
  width: min(340px, 42vw);
  min-height: 36px;
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.table-shell {
  position: relative;
  margin-top: 14px;
  border-radius: var(--radius);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.table-header h2 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
}

.table-header p {
  font-size: 13px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1470px;
  border-collapse: collapse;
  table-layout: fixed;
}

thead {
  background: #f8fafc;
}

th,
td {
  height: 58px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--667085, #667085);
  font-size: 12px;
  font-weight: 600;
}

tbody tr {
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

tbody tr:hover {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 var(--blue);
}

tbody td {
  color: var(--ink);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.2;
}

.check-cell {
  width: 44px;
}

th:nth-child(2) {
  width: 200px;
}

th:nth-child(3) {
  width: 92px;
}

th:nth-child(4),
th:nth-child(5),
th:nth-child(6) {
  width: 120px;
}

th:nth-child(7),
th:nth-child(8) {
  width: 112px;
}

th:nth-child(9) {
  width: 136px;
}

th:nth-child(10) {
  width: 136px;
}

th:nth-child(11) {
  width: 126px;
}

th:nth-child(12) {
  width: 154px;
}

.sort-button {
  min-height: 28px;
  padding: 0;
  color: inherit;
  background: transparent;
}

.column-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.column-heading > span,
.column-heading .sort-button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-button::after {
  color: var(--subtle);
  content: "↕";
}

.sort-button.active.asc::after {
  color: var(--blue);
  content: "↑";
}

.sort-button.active.desc::after {
  color: var(--blue);
  content: "↓";
}

.filter-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--subtle);
  background: transparent;
}

.filter-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.active {
  border-color: #b8d5ff;
  color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}

.filter-popover {
  position: fixed;
  z-index: 30;
  width: 300px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filter-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-popover-header strong {
  color: var(--ink);
  font-size: 14px;
}

.filter-close-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 16px;
}

.filter-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.filter-range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filter-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: none;
}

.filter-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 115, 232, 0.12);
}

.filter-help {
  margin-top: 8px;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.filter-clear-button,
.filter-apply-button {
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 650;
}

.filter-clear-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}

.filter-apply-button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
}

.fund-name {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.fund-name strong {
  max-width: 100%;
  overflow: hidden;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-cell {
  display: inline-block;
  max-width: 108px;
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  white-space: nowrap;
  word-break: keep-all;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #1f5f3e;
  background: var(--green-soft);
  font-size: 12px;
}

.metric-positive {
  color: var(--red);
  font-weight: inherit;
}

.metric-negative {
  color: var(--green);
  font-weight: inherit;
}

.metric-neutral {
  color: var(--ink);
  font-weight: inherit;
}

.sparkline {
  display: block;
  width: 128px;
  height: 34px;
}

.sparkline-placeholder {
  display: inline-grid;
  place-items: center;
  width: 136px;
  height: 40px;
  margin: 0 auto;
  color: var(--subtle);
  font-size: 12px;
}

.sparkline-button {
  display: block;
  width: 136px;
  height: 40px;
  margin: 0 auto;
  padding: 3px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
}

.sparkline-button:hover,
.sparkline-button:focus-visible {
  border-color: #b8d5ff;
  background: var(--blue-soft);
  outline: none;
}

.sparkline path.area {
  fill: rgba(31, 115, 232, 0.08);
}

.sparkline path.line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mini-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.mini-button.active {
  color: var(--amber);
  background: #fff8e6;
  border-color: #f7d98b;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 58px 20px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line-soft);
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}

.pagination-controls,
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.page-button:hover:not(:disabled),
.page-button:focus-visible {
  border-color: #b8d5ff;
  color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}

.page-button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.page-gap {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 32px;
  color: var(--subtle);
}

.knowledge-shell {
  min-height: calc(100vh - 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.knowledge-header {
  min-height: 86px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.knowledge-header h2 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.knowledge-header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.disclosure-card {
  display: grid;
  gap: 7px;
  padding: 13px 15px;
  border: 1px solid #fedf89;
  border-radius: var(--radius);
  color: #7a2e0e;
  background: #fffbeb;
  font-size: 13px;
  line-height: 1.75;
}

.disclosure-card strong {
  color: #93370d;
  font-size: 13px;
}

.disclosure-card span,
.disclosure-card p,
.disclosure-card li {
  color: #7a2e0e;
}

.knowledge-disclaimer {
  margin: 14px 24px 0;
}

.knowledge-category-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
}

.knowledge-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #475467;
  background: #f2f5f9;
  font-size: 13px;
  white-space: nowrap;
}

.knowledge-chip.active,
.knowledge-chip:hover,
.knowledge-chip:focus-visible {
  color: var(--blue);
  border-color: #b8d5ff;
  background: var(--blue-soft);
  outline: none;
}

.knowledge-content {
  padding: 18px 24px 26px;
}

.knowledge-list-meta {
  margin-bottom: 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.knowledge-post-list {
  display: grid;
  gap: 12px;
}

.knowledge-post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 128px;
  padding: 18px 20px;
  border: 1px solid #d7e6fb;
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, #ffffff 0%, #f8fbff 58%, #f2f7ff 100%);
  box-shadow: 0 10px 26px rgba(22, 32, 51, 0.04);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.knowledge-post-card:hover {
  border-color: #b8d5ff;
  box-shadow: 0 14px 34px rgba(31, 115, 232, 0.1);
  transform: translateY(-1px);
}

.knowledge-post-main {
  min-width: 0;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.post-tag-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.post-tag-green {
  color: #087443;
  background: var(--green-soft);
}

.post-tag-orange {
  color: #b54708;
  background: #fff0e6;
}

.post-tag-purple {
  color: #6941c6;
  background: #f2efff;
}

.knowledge-post-card h3 {
  margin: 12px 0 8px;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

.knowledge-post-card p {
  max-width: 760px;
  color: #475467;
  font-size: 13px;
  line-height: 1.72;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.post-meta span + span::before {
  display: inline-block;
  margin-right: 12px;
  color: var(--line);
  content: "|";
}

.post-open-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #344054;
  background: rgba(255, 255, 255, 0.9);
}

.post-open-button:hover,
.post-open-button:focus-visible {
  color: var(--blue);
  border-color: #b8d5ff;
  background: #fff;
  outline: none;
}

.knowledge-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}

.knowledge-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.article-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 4px 0 16px;
}

.article-back-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 18px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #475467;
  background: var(--surface);
  font-size: 13px;
}

.article-back-button::before {
  margin-right: 7px;
  content: "←";
}

.article-back-button:hover,
.article-back-button:focus-visible {
  color: var(--blue);
  border-color: #b8d5ff;
  background: var(--blue-soft);
  outline: none;
}

.article-hero {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.article-hero h2 {
  margin-top: 14px;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

.article-hero p {
  margin-top: 12px;
  color: #475467;
  font-size: 15px;
  line-height: 1.8;
}

.article-body {
  padding: 24px 0 12px;
}

.article-body h3 {
  margin: 28px 0 12px;
  font-size: 19px;
  line-height: 1.45;
}

.article-body h4 {
  margin: 20px 0 8px;
  font-size: 16px;
}

.article-body p,
.article-body li {
  color: #344054;
  font-size: 15px;
  line-height: 2;
}

.article-body p + p {
  margin-top: 12px;
}

.article-body ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 20px;
}

.article-callout,
.formula-strip {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #b8d5ff;
  border-radius: var(--radius);
  color: #175cd3;
  background: var(--blue-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.8;
}

.formula-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  color: var(--ink);
  background: #f8fafc;
  border-color: var(--line-soft);
  font-size: 16px;
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.article-nav-button {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #475467;
  background: #fff;
  text-align: left;
}

.article-nav-button span {
  color: var(--muted);
  font-size: 12px;
}

.article-nav-button strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-nav-button:hover,
.article-nav-button:focus-visible {
  border-color: #b8d5ff;
  background: var(--blue-soft);
  outline: none;
}

.portfolio-shell {
  display: grid;
  gap: 14px;
}

.portfolio-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portfolio-page-header h2 {
  font-size: 22px;
  line-height: 1.2;
}

.portfolio-page-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.portfolio-config-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.2fr) minmax(120px, 0.6fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portfolio-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.portfolio-field > span,
.portfolio-panel-header p,
.portfolio-note {
  color: var(--muted);
  font-size: 12px;
}

.portfolio-field select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  outline: none;
}

.portfolio-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 115, 232, 0.12);
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.segment-button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.segment-button.active,
.segment-button:hover,
.segment-button:focus-visible {
  color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}

.portfolio-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #b8d5ff;
  border-radius: var(--radius);
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 14px;
}

.portfolio-count-pill.warning,
.portfolio-panel-header .warning {
  color: var(--red);
}

.portfolio-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.portfolio-layout {
  display: grid;
  grid-template-columns: minmax(520px, 0.95fr) minmax(520px, 1.05fr);
  gap: 14px;
  align-items: start;
}

.portfolio-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portfolio-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.portfolio-panel-header h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.portfolio-panel-header p {
  margin-top: 4px;
}

.portfolio-table-scroll {
  overflow-x: auto;
}

.portfolio-table {
  min-width: 660px;
}

.portfolio-table th,
.portfolio-table td {
  height: 52px;
  padding: 0 10px;
}

.portfolio-table th:nth-child(1) {
  width: 230px;
}

.portfolio-table th:nth-child(2) {
  width: 92px;
}

.portfolio-table th:nth-child(3),
.portfolio-table th:nth-child(4),
.portfolio-table th:nth-child(5) {
  width: 112px;
}

.portfolio-table td:first-child strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 44px 18px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line-soft);
}

.portfolio-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.portfolio-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.portfolio-kpis div {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface);
}

.portfolio-kpis span {
  color: var(--muted);
  font-size: 12px;
}

.portfolio-kpis strong {
  font-size: 20px;
  line-height: 1.1;
}

.portfolio-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.portfolio-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.portfolio-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.portfolio-chart {
  min-height: 318px;
  padding: 10px 14px 12px;
}

.portfolio-placeholder {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fbfdff;
}

.portfolio-note {
  padding: 0 18px 16px;
  line-height: 1.6;
}

.weight-input-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.weight-input {
  width: 72px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-align: center;
  outline: none;
}

.weight-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 115, 232, 0.12);
}

.compare-bar {
  position: fixed;
  right: 22px;
  bottom: 22px;
  left: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  min-height: 58px;
  margin: 0 auto;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(22, 32, 51, 0.18);
  backdrop-filter: blur(10px);
}

.compare-bar div {
  display: flex;
  gap: 8px;
}

body.modal-open {
  overflow: hidden;
}

.info-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 32, 51, 0.38);
  backdrop-filter: blur(8px);
}

.info-modal {
  width: min(640px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(22, 32, 51, 0.24);
}

.info-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.info-modal-header h2 {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.3;
}

.info-modal-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #b8d5ff;
  border-radius: var(--radius);
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 600;
}

.info-modal-content {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}

.info-modal-content h2 {
  font-size: 18px;
  line-height: 1.3;
}

.info-modal-content h3 {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.35;
}

.info-modal-content p,
.info-modal-content li {
  color: var(--475467, #475467);
  font-size: 13px;
  line-height: 1.75;
}

.info-modal-content ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.info-note {
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--muted);
  background: #f8fafc;
}

.info-error {
  color: var(--red);
}

.chart-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 32, 51, 0.36);
  backdrop-filter: blur(8px);
}

.chart-modal {
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(22, 32, 51, 0.24);
}

.chart-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.chart-modal-header h2 {
  font-size: 18px;
  line-height: 1.3;
}

.chart-modal-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.chart-modal-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.chart-modal-metrics div {
  display: grid;
  gap: 6px;
  padding: 14px 18px;
  background: var(--surface);
}

.chart-modal-metrics span,
.chart-legend {
  color: var(--muted);
  font-size: 12px;
}

.chart-modal-metrics strong {
  font-size: 20px;
  line-height: 1.1;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px 0;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.legend-fund {
  background: #1f73e8;
}

.legend-benchmark {
  background: #12b76a;
}

.legend-excess {
  background: #f79009;
}

.chart-canvas {
  padding: 10px 16px 18px;
}

.chart-modal-disclosure {
  padding: 0 20px 20px;
}

.detail-disclosure {
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  align-items: start;
}

.detail-disclosure ul {
  display: grid;
  gap: 5px;
  margin: 4px 0 0;
  padding-left: 18px;
}

.detail-disclosure p {
  margin: 0;
}

.detail-chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid line,
.chart-axis line {
  stroke: var(--line-soft);
  stroke-width: 1;
}

.chart-grid text,
.chart-axis text {
  fill: var(--muted);
  font-size: 11px;
}

.detail-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fund-line {
  stroke: #1f73e8;
}

.benchmark-line {
  stroke: #12b76a;
}

.excess-line {
  stroke: #f79009;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 168px minmax(0, 1fr);
  }

  .topbar,
  .table-header {
    align-items: stretch;
    flex-direction: column;
  }

  .table-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-info-button {
    width: fit-content;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .search-field {
    width: 100%;
  }

  .summary-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-page-header,
  .portfolio-config-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .portfolio-page-header {
    flex-direction: column;
  }

  .portfolio-actions {
    justify-content: flex-start;
  }

  .portfolio-layout {
    grid-template-columns: 1fr;
  }

  .chart-modal-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-post-card {
    min-height: 118px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .app-sidebar {
    position: static;
    min-height: auto;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    border-radius: var(--radius);
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .side-about {
    margin-top: 8px;
  }

  .topbar-actions,
  .table-tools {
    width: 100%;
  }

  .primary-button,
  .ghost-button,
  .dashboard-info-button {
    flex: 1;
  }

  .summary-band {
    grid-template-columns: 1fr;
  }

  .portfolio-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-actions,
  .portfolio-legend {
    align-items: stretch;
    flex-direction: column;
  }

  .tab-button {
    min-width: 118px;
  }

  .compare-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-controls {
    justify-content: space-between;
  }

  .pagination-pages {
    justify-content: center;
  }

  .chart-modal-backdrop {
    padding: 12px;
  }

  .info-modal-backdrop {
    padding: 12px;
  }

  .chart-modal-header,
  .chart-legend,
  .info-modal-header {
    flex-wrap: wrap;
  }

  .chart-modal-metrics {
    grid-template-columns: 1fr;
  }

  .knowledge-header,
  .knowledge-disclaimer,
  .knowledge-category-bar,
  .knowledge-content {
    padding-right: 14px;
    padding-left: 14px;
  }

  .knowledge-disclaimer {
    margin-right: 14px;
    margin-left: 14px;
  }

  .knowledge-post-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .post-open-button {
    justify-self: end;
  }

  .article-hero h2 {
    font-size: 24px;
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .detail-disclosure {
    grid-template-columns: 1fr;
  }
}
