/* Fund detail page. Tokens come from styles.css (:root). Measurements are from the Figma frame (1440 wide, 72px gutters). */
:root {
  --ink-3: #7c7c88;
  --rule: #e8e8ec;
  --card-line: #e6e6ec;
  --tint-good: #edf4f0;
  --tint-bad: #f4dad3;
  --tint-warn: #faeeea;
  --chip: #f7f7f9;
}

.fund {
  max-width: calc(1296px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 44px var(--gutter) 96px;
}
.fund-status { padding: 80px 0; color: var(--muted); font-size: 14px; }
#status { min-height: 100vh; } /* the pre-render placeholder: keeps the footer off screen until the page renders over it */
.fund-status a { color: var(--link); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.ink { color: var(--ink); }
.mono { font-family: var(--mono); }

/* ── Identity ───────────────────────────────────────── */
.identity { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 40px; }
.fund-nav { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.fund-name { margin: 0; font-size: 34px; font-weight: 600; line-height: 1.12; letter-spacing: -0.85px; }
.wish {
  flex: none;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.wish:hover { border-color: var(--ink); }
.wish img { width: 16px; height: 16px; }
.wish.saved { border-color: var(--link); color: var(--link); font-size: 13.5px; } /* Figma 153:2832 */
.wish:disabled { opacity: 0.6; cursor: default; }
.wish:focus-visible, .pill:focus-visible, .mgr-toggle:focus-visible, .link:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 32px 0 0; }

/* ── Fold: chart + score ────────────────────────────── */
.fold { display: grid; grid-template-columns: minmax(0, 896px) 344px; column-gap: 56px; margin-top: 32px; }
.chart-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin-top: 20px; font-size: 14px; min-height: 22px; }
.chart-sum .item { display: flex; gap: 7px; align-items: baseline; white-space: nowrap; }
.chart-sum .lab { color: var(--muted); line-height: 1.55; }
.chart-sum .val { font-weight: 600; line-height: 1.4; }
.chart-sum .note { color: var(--faint); font-size: 12px; }
.chart-box { position: relative; margin-top: 20px; height: 451px; }
.chart-box svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-tip {
  position: absolute; top: 0; z-index: 2; pointer-events: none;
  min-width: 150px; padding: 8px 10px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12px; line-height: 1.5; box-shadow: 0 6px 14px rgba(12, 12, 16, 0.1);
}
.chart-tip .d { font-family: var(--mono); color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.chart-tip .r { display: flex; justify-content: space-between; gap: 16px; }
.chart-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.pills { display: flex; gap: 8px; }
.pill {
  width: 62px; height: 36px;
  border: 1px solid var(--rule); border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.pill:disabled { color: var(--faint); cursor: default; }
.legend { display: flex; gap: 28px; align-items: center; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.legend .k { display: flex; align-items: center; gap: 8px; line-height: 1.45; }
.sw { display: block; width: 26px; height: 5px; border-radius: 2px; }
.sw-fund { background: var(--link); }
.sw-cat { background: var(--ink-3); }
.sw-bench { width: 21px; height: 5px; border-radius: 0; background: repeating-linear-gradient(90deg, #b4b4be 0 7px, transparent 7px 10px); }

.caps { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.4; letter-spacing: 0.99px; text-transform: uppercase; color: var(--muted); }
.key-factors { margin-top: 36px; }
.key-factors .caps { padding-bottom: 16px; border-bottom: 1px solid var(--rule); }

/* metric card grid (label / big value / category median) */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 40px; }
.key-factors .metrics { margin-top: 16px; }
.metrics.fixed { grid-template-columns: repeat(3, 272px); gap: 26px 40px; }
.metric .lab { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.metric .val { margin-top: 10px; font-size: 28px; font-weight: 600; line-height: 1.05; letter-spacing: -0.84px; white-space: nowrap; }
.metric .med { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--faint); }

/* score rail */
.score-big { display: flex; align-items: baseline; gap: 10px; }
.score-big .n { font-size: 64px; font-weight: 600; line-height: 0.86; letter-spacing: -3.96px; }
.score-big .of { font-size: 17px; color: var(--faint); line-height: 1.5; }
.score-label { margin: 18px 0 0; font-size: 15px; font-weight: 700; letter-spacing: 0.3px; line-height: 1.4; }
.score-sum { margin: 12px 0 0; font-size: 17px; line-height: 1.5; }
.score-none { font-size: 17px; line-height: 1.5; color: var(--muted); }
.score-meta { margin: 12px 0 0; font-size: 14px; line-height: 1.55; }
.breakdown { margin-top: 34px; }
.breakdown + .score-meta { margin-top: 34px; }
.breakdown .caps { padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.pillars { margin-top: 16px; display: flex; flex-direction: column; gap: 20px; }
.pillar-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 14px; line-height: 1.4; }
.pillar-head .nm { font-weight: 600; }
.pillar-head .rt { display: flex; align-items: baseline; gap: 10px; }
.pillar-head .sc { font-weight: 600; }
.bar { height: 3px; background: var(--hair); margin-top: 14px; }
.bar i { display: block; height: 3px; background: var(--ink); }
.pillar-text { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }

/* ── Sections ───────────────────────────────────────── */
.section { margin-top: 64px; }
.section-rule { height: 1px; background: var(--rule); border: 0; margin: 64px 0 0; }
.fold + .section { margin-top: 108px; }
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.sec-title { margin: 0; font-size: 27px; font-weight: 600; line-height: 1.2; letter-spacing: -0.54px; }
.sec-sub { margin: 10px 0 0; max-width: 1144px; font-size: 17px; line-height: 1.5; }
.sec-score { flex: none; display: flex; align-items: baseline; white-space: nowrap; }
.sec-score .n { font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -0.9px; }
.sec-score .of { font-size: 15px; color: var(--faint); line-height: 1.6; }
.sec-body { margin-top: 36px; }
.sec-body.tight { margin-top: 28px; }
.sub-block { margin-top: 32px; }
.sub-block:first-child { margin-top: 0; }
.block-title { margin: 20px 0 0; display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: -0.29px; }
.block-title img { width: 14px; height: 14px; flex: none; }

/* tables in bordered cards */
.card { background: #fff; border: 1px solid var(--card-line); padding: 20px; margin-top: 20px; max-width: 100%; overflow-x: auto; }
.card.w897 { max-width: 897px; }
.card.w969 { max-width: 969px; }
.card.w1102 { max-width: 1102px; }
.tbl { min-width: 620px; }
.tr { display: grid; align-items: center; column-gap: 10px; }
.tr.head {
  padding-bottom: 11px; border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 500; line-height: 1.4; letter-spacing: 0.66px; text-transform: uppercase; color: var(--muted); align-items: start;
}
.tr.row { padding: 14px 0; border-bottom: 1px solid var(--hair); font-size: 14px; line-height: 1.55; }
.tr.row:last-child { border-bottom: 0; padding-bottom: 0; }
.r-right { text-align: right; }
.c-strong { font-weight: 600; line-height: 1.4; }
.c-soft { color: var(--ink-2); }

/* calendar-year record */
.cal { border: 1px solid var(--rule); padding: 8px 16px; max-width: 648px; overflow-x: auto; }
.cal .tr { grid-template-columns: 110px 160px 200px 120px; column-gap: 0; padding: 10px 12px; min-width: 590px; }
.cal .tr.head { border-bottom: 1px solid var(--line); font-size: 12px; padding: 10px 12px; }
.cal .tr.row { border-bottom: 0; font-size: 14px; }
.cal .tr.row:last-child { padding-bottom: 10px; }
.cal .tr.row.win { background: var(--tint-good); }
.cal .cal-body { padding-top: 2px; }
.cal .yr { font-family: var(--mono); font-size: 13px; line-height: 1.4; }
.cal .gap { font-weight: 600; line-height: 1.4; color: var(--faint); }

/* drawdown / recovery */
.dd .tr { grid-template-columns: 200px 220px 125px 114px 145px; min-width: 855px; }
.dd .tr.row { padding: 15px 0; }
.dd .depth { display: flex; align-items: center; gap: 14px; }
.dd .depth b { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--bad); white-space: nowrap; }
.dd .depth i { display: block; height: 8px; background: var(--tint-bad); flex: none; }

/* fund-size band */
.band { position: relative; width: 100%; max-width: 897px; height: 152px; margin-top: 28px; }
.band .z { position: absolute; top: 49px; height: 30px; }
.band .z.a { background: var(--tint-good); }
.band .z.b { background: var(--tint-warn); }
.band .z.c { background: var(--tint-bad); }
.band .z.t { background: var(--tint-bad); }
.band .z.s { background: var(--tint-warn); }
.band .zl { position: absolute; top: 33px; transform: translateY(-100%); font-size: 12px; font-weight: 600; line-height: 1.55; white-space: nowrap; }
.band .mark { position: absolute; top: 20px; height: 63px; width: 2px; margin-left: -1px; background: var(--ink); }
.band .mark::after { content: ''; position: absolute; left: -3px; top: 40px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.band .ml { position: absolute; top: 0; transform: translateX(-50%); font-size: 14px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.band .axis { position: absolute; top: 113px; left: 0; right: 0; height: 1px; background: var(--rule); }
.band .tick { position: absolute; top: 128px; font-family: var(--mono); font-size: 11px; line-height: 1.4; color: var(--muted); white-space: nowrap; transform: translateX(-50%); }
.band .tick.first { transform: none; }
.band .tick.last { transform: translateX(-100%); }

/* coming-soon states */
.soon { border: 1px dashed var(--line); padding: 20px 24px; max-width: 897px; margin-top: 20px; }
.soon b { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; }
.soon span { display: block; margin-top: 6px; font-size: 13px; line-height: 1.55; color: var(--muted); max-width: 640px; }

/* manager */
.mgrs { margin-top: 28px; }
.mgr { padding-top: 20px; }
.mgr + .mgr { border-top: 1px solid var(--rule); margin-top: 28px; }
.mgr-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mgr-name { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.29px; }
.mgr-name a { color: inherit; }
.mgr-name a:hover { color: var(--link); text-decoration: underline; }
.mgr-meta { margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.mgr-years { margin-top: 10px; font-family: var(--mono); font-size: 13px; line-height: 1.4; color: var(--muted); }
.mgr-toggle { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; font-weight: 500; letter-spacing: 0.99px; text-transform: uppercase; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.mgr-toggle img { width: 12px; height: 6px; }
.mgr-toggle[aria-expanded="true"] img { transform: scaleY(-1); }
.mgr-body { margin-top: 32px; }
.mgr-body[hidden] { display: none; }
.mgr-body .caps { margin-bottom: 0; }
.mgr-body .soon { margin-top: 14px; }

/* cost and tax */
.cost-tax { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.ter { width: 434px; max-width: 100%; }
.verdict { margin: 20px 0 0; font-size: 17px; font-weight: 600; line-height: 1.5; }
.ter-big { display: flex; align-items: baseline; gap: 16px; margin-top: 20px; white-space: nowrap; }
.ter-big .n { font-size: 52px; font-weight: 600; line-height: 1; letter-spacing: -2.08px; }
.ter-big .m { font-size: 14px; line-height: 1.55; color: var(--muted); }
.scale { position: relative; height: 14px; margin-top: 20px; }
.scale .base { position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--rule); }
.scale .t { position: absolute; top: 5px; width: 1px; height: 8px; background: var(--rule); }
.scale .dot { position: absolute; top: 4.5px; width: 9px; height: 9px; border-radius: 50%; background: var(--good); margin-left: -4.5px; }
.scale-labels { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--mono); font-size: 11px; line-height: 1.4; color: var(--faint); }
.tax { width: 560px; max-width: 100%; }
.tax-rows { margin-top: 20px; display: flex; flex-direction: column; gap: 20px; }
.tax-row .lab { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.tax-row .line { display: flex; align-items: center; gap: 20px; margin-top: 12px; }
.tax-row .rate { width: 85px; flex: none; font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -0.9px; }
.tax-row .vr { width: 1px; height: 42px; background: var(--line); flex: none; }
.tax-row .note { font-size: 12px; line-height: 1.55; color: var(--ink-2); }
.tax-plain { margin: 20px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); max-width: 420px; }

/* peers */
.peers .tr { grid-template-columns: 310px 110px 140px 160px 190px 150px; column-gap: 0; min-width: 1060px; }
.peers .tr.row { padding: 13px 0; }
.peers .tr.row.me { background: var(--surface); padding: 10px 12px 10px 0; }
.peers .tr.row .nm a { color: var(--ink-2); }
.peers .tr.row.me .nm a, .peers .tr.row.me .r-right { color: var(--ink); }
.peers .sc { font-size: 15px; font-weight: 600; line-height: 1.4; }
.link { color: var(--link); font-size: 13px; line-height: 1.55; display: inline-block; margin-top: 12px; }
.link:hover { text-decoration: underline; }

/* documents */
.docs-block { margin-top: 32px; }
.docs-block:first-child { margin-top: 0; }
.docs-block > .caps { margin-bottom: 16px; }
.docs-block .soon { margin-top: 0; }
.disc { background: var(--surface); padding: 24px 28px 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px; }
.disc h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.disc p { margin: 10px 0 0; font-size: 14px; line-height: 1.65; color: var(--ink-2); max-width: 360px; }
.disc p strong { color: var(--ink); font-weight: 600; }
.fund-foot { margin: 40px 0 0; max-width: 820px; font-size: 11.5px; line-height: 1.55; color: var(--faint); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1200px) {
  .fold { grid-template-columns: minmax(0, 1fr) 300px; column-gap: 40px; }
  .metrics.fixed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .fold { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .disc { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 860px) {
  .fund { padding-top: 24px; }
  .fund-name { font-size: 26px; }
  .identity { align-items: flex-start; }
  .chart-box { height: 320px; }
  .metrics, .metrics.fixed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; }
  .metric .val { font-size: 24px; }
  .section, .section-rule { margin-top: 48px; }
  .sec-title { font-size: 24px; }
  .sec-sub { font-size: 16px; }
  .cost-tax { gap: 40px; }
  .tax-row .line { align-items: flex-start; }
  .tax-row .rate { width: 72px; font-size: 26px; }
  .pills { flex-wrap: wrap; }
  .pill { width: 54px; }
  .legend { gap: 14px 18px; }
}

/* notes, stress, other-funds, portfolio mix, documents, change log */
.src-note { margin: 14px 0 0; max-width: 760px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.stress .tr { grid-template-columns: 320px 178px 178px 178px; column-gap: 0; min-width: 854px; }
.stress .tr.row { padding: 14px 0; }
.others .tr { grid-template-columns: 405px 150px 150px 150px; column-gap: 0; min-width: 855px; }
.others .tr .nm a { color: var(--ink); }
.others .tr .nm a:hover { text-decoration: underline; }
.mixbar { display: flex; height: 12px; max-width: 897px; margin-top: 16px; background: var(--hair); }
.mixbar i { display: block; height: 100%; }
.mixlegend { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.mixlegend .mk { display: inline-flex; align-items: baseline; gap: 6px; }
.mixlegend .mk i { width: 10px; height: 10px; display: inline-block; align-self: center; }
.mixlegend .mk b { color: var(--ink); font-weight: 600; }
.mixlegend .mk em { font-style: normal; color: var(--faint); font-size: 12px; }
.doc-list { border-top: 1px solid var(--hair); }
.doc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.doc-main { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.doc-link { color: var(--link); font-size: 14px; line-height: 1.55; }
.doc-link:hover { text-decoration: underline; }
.doc-tag { color: var(--muted); font-size: 12px; line-height: 1.55; }
.doc-date { font-family: var(--mono); font-size: 12px; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.log-row { display: flex; align-items: center; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--hair); }
.log-date { width: 120px; flex: none; font-family: var(--mono); font-size: 13px; line-height: 1.4; color: var(--muted); }
.log-kind { width: 100px; flex: none; padding: 4px 10px; background: var(--chip); font-size: 12px; line-height: 1.55; text-align: center; }
.log-text { font-size: 14px; line-height: 1.55; min-width: 0; }
@media (max-width: 860px) {
  .log-row { flex-wrap: wrap; gap: 8px 14px; }
  .log-date { width: auto; }
  .log-text { flex-basis: 100%; }
}

/* sector allocation + holdings */
.sectors .tr { grid-template-columns: 160px minmax(120px, 1fr) 90px 130px 80px; column-gap: 16px; min-width: 700px; }
.sectors.nomed .tr { grid-template-columns: 160px minmax(120px, 1fr) 90px; }
.sectors .tr.row { padding: 12px 0; }
.sbar { position: relative; display: block; height: 16px; }
.sbar i { position: absolute; left: 0; display: block; }
.sbar i.m { top: 0; height: 16px; background: var(--line-soft); }
.sbar i.f { top: 4px; height: 8px; background: var(--ink); }
.sbar-legend { display: flex; gap: 22px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.sbar-legend i { display: inline-block; width: 18px; height: 8px; margin-right: 8px; vertical-align: middle; }
.sbar-legend i.f { background: var(--ink); }
.sbar-legend i.m { background: var(--line-soft); height: 12px; }
.hold .tr { grid-template-columns: minmax(200px, 1fr) 200px 110px; column-gap: 16px; min-width: 620px; }
.hold .tr.row { padding: 11px 0; }
.inline-link { color: var(--link); }
.inline-link:hover { text-decoration: underline; }
/* server-rendered name + summary shown until fund.js replaces #fund (see seo.py) */
.fund-status-name { font: inherit; color: var(--ink); margin: 0 0 8px; }
.fund-status p { margin: 0 0 8px; max-width: 720px; }

/* Questions block under the fund page (server-rendered by seo_pages.fund_faq, outside the part fund.js replaces) */
.fund-faq { max-width: calc(1296px + 2 * var(--gutter)); margin: -48px auto 0; padding: 0 var(--gutter) 96px; }
.fund-faq .faq-item { margin-top: 24px; max-width: 897px; }
.fund-faq h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; }
.fund-faq p { margin: 6px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.fund-faq .faq-sub { margin-top: 40px; }
.fund-faq .pg-links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 24px; }
.fund-faq .pg-links a { font-size: 15px; color: var(--link); }
.fund-faq .pg-links a:hover, .fund-faq .inline-link:hover { text-decoration: underline; }
@media (max-width: 720px) { .fund-faq { margin-top: -64px; } }
