.workspace.fund-page {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.fund-page > .detail-panel {
  display: none;
}

.is-fund-page #marketStrip,
.is-fund-page #moduleToolbar {
  display: none;
}

.fund-desk {
  --fund-accent: #176d68;
  --fund-line: var(--border, #dce5e7);
  color: var(--text, #17302e);
  min-width: 0;
}

.fund-desk-head,
.fund-section-head,
.fund-detail-head,
.fund-tracking-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.fund-desk-head {
  margin: 8px 0 24px;
}

.fund-desk-head h2 {
  margin: 8px 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.05em;
}

.fund-desk-head p,
.fund-empty p,
.fund-tracking-entry p {
  color: var(--muted, #6a7f7d);
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.fund-mode-label {
  flex: none;
  padding: 7px 12px;
  border: 1px solid #c7dfdb;
  border-radius: 6px;
  color: var(--fund-accent);
  background: #edf7f4;
  font-size: 12px;
}

.fund-search-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 140px auto;
  align-items: end;
  gap: 14px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--fund-line);
  border-radius: 10px;
  background: var(--panel, #fff);
}

.fund-search-form label {
  display: grid;
  min-width: 0;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #6a7f7d);
}

.fund-search-form input,
.fund-search-form select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--fund-line);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: var(--text, #17302e);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
}

.fund-search-form .action-button {
  min-height: 44px;
}

.fund-desk-columns {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 24px;
}

.fund-list-column,
.fund-detail-column {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.fund-section {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--fund-line);
  border-radius: 10px;
  background: var(--panel, #fff);
}

.fund-section-head {
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.fund-section h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.02em;
}

.fund-section-head small,
.fund-section-head > span,
.fund-detail-head small {
  font-size: 11px;
  color: var(--muted, #6a7f7d);
}

.fund-list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--fund-line);
  padding: 14px 0;
}

.fund-list-card.selected {
  border-left: 3px solid var(--fund-accent);
  margin-left: -10px;
  padding-left: 7px;
}

.fund-select {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 4px 0;
  color: inherit;
  background: none;
  text-align: left;
  cursor: pointer;
}

.fund-select strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.5;
}

.fund-select span {
  color: var(--muted, #6a7f7d);
  font-size: 11px;
}

.fund-list-card .mini-button,
.fund-detail-head .mini-button {
  flex: none;
}

.fund-followed {
  color: var(--fund-accent);
}

.fund-detail-head {
  margin-bottom: 16px;
  align-items: start;
}

.fund-detail-head h3 {
  margin: 8px 0 6px;
  font-size: 22px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.fund-detail-actions {
  display: grid;
  flex: none;
  gap: 8px;
}

.fund-cache-warning {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  margin: 12px 0 0;
  border-left: 2px solid #ba8c38;
  background: #fbf6e9;
  color: #896626;
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

:root[data-theme="dark"] .fund-cache-warning {
  background: #41361e;
  color: #e8c988;
}

.fund-empty {
  padding: 24px 0;
  color: var(--muted, #6a7f7d);
  font-size: 13px;
  line-height: 1.6;
}

.fund-empty strong {
  color: var(--text, #17302e);
  font-size: 14px;
}

.fund-empty.failed,
.fund-module.failed {
  color: #ab493b;
}

.fund-empty.failed .mini-button {
  margin-top: 12px;
}

.fund-source-line,
.fund-nav-note {
  margin: 12px 0 0;
  color: var(--muted, #6a7f7d);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.fund-nav-note {
  padding: 10px 12px;
  border-left: 2px solid #99c7bd;
  background: #f2f8f6;
  color: #557c73;
}

.fund-nav-grid,
.fund-period-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fund-nav-grid > div,
.fund-period-grid > div {
  display: grid;
  gap: 8px;
}

.fund-nav-grid small,
.fund-period-grid small,
.fund-period-grid span {
  font-size: 11px;
  color: var(--muted, #6a7f7d);
}

.fund-nav-grid strong {
  font-size: clamp(18px, 2.1vw, 28px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.fund-period-grid strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.fund-profile {
  display: grid;
  margin: 0;
}

.fund-profile > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--fund-line);
  font-size: 12px;
  line-height: 1.7;
}

.fund-profile dt {
  color: var(--muted, #6a7f7d);
}

.fund-profile dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.fund-nav-chart {
  display: block;
  width: 100%;
  max-height: 170px;
  margin-top: 16px;
}

.fund-chart-line {
  stroke: var(--fund-accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.fund-chart-axis {
  stroke: var(--fund-line);
  stroke-width: 1;
}

.fund-chart-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted, #6a7f7d);
  font-size: 10px;
}

.fund-history-table {
  margin-top: 20px;
  font-size: 12px;
}

.fund-history-table summary {
  cursor: pointer;
  padding: 8px 0;
  color: var(--fund-accent);
}

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

.fund-history-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fund-history-table th,
.fund-history-table td {
  padding: 9px 4px;
  white-space: nowrap;
  border-bottom: 1px solid var(--fund-line);
}

.fund-history-table th:first-child,
.fund-history-table td:first-child {
  text-align: left;
}

.fund-tracking-entry {
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--border, #dce5e7);
  border-radius: 10px;
  background: var(--panel, #fff);
}

.fund-tracking-entry strong {
  font-size: 14px;
}

.fund-search-entry {
  margin-top: 16px;
  max-width: 100%;
  white-space: normal;
}

.fund-desk button:focus-visible,
.fund-desk input:focus-visible,
.fund-desk select:focus-visible {
  outline: 2px solid var(--fund-accent);
  outline-offset: 3px;
}

:root[data-theme="dark"] .fund-mode-label,
:root[data-theme="dark"] .fund-nav-note {
  background: #173a33;
  color: #b5d8cd;
}

:root[data-theme="dark"] .fund-desk {
  --fund-accent: #77c7b4;
}

@media (max-width: 900px) {
  .fund-desk-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .fund-detail-placeholder {
    display: none;
  }
}

@media (max-width: 760px) {
  .mobile-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  .mobile-nav .mobile-tab-button {
    min-width: 0;
    font-size: 10px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .is-fund-page .workspace {
    padding: 16px 12px 110px !important;
  }

  .fund-desk-head {
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
  }

  .fund-desk-head p {
    max-width: 250px;
    font-size: 12px;
  }

  .fund-search-form {
    grid-template-columns: minmax(0, 1fr) 100px;
    padding: 16px;
    gap: 12px;
  }

  .fund-search-form > label:first-child {
    grid-column: 1 / -1;
  }

  .fund-search-form input {
    font-size: 16px;
  }

  .fund-search-form > .action-button {
    width: 100%;
  }

  .fund-section {
    padding: 16px;
  }

  .fund-detail-head h3 {
    font-size: 20px;
  }

  .fund-nav-grid,
  .fund-period-grid {
    gap: 8px;
  }

  .fund-nav-grid strong {
    font-size: 21px;
  }

  .fund-period-grid strong {
    font-size: 16px;
  }

  .fund-tracking-entry {
    gap: 10px;
  }

  .fund-tracking-entry .mini-button {
    flex: none;
  }
}
