/* ============ FNOTrader Mutual Funds theme ============ */
:root{
  --bg:#ffffff; --card:#ffffff; --ink:#0b1526; --ink2:#26344c; --muted:#54637d;
  --line:#e3eaf5; --line2:#f0f4fb;
  --chart-grid:rgba(15,32,60,.07);   /* subtle horizontal grid lines in charts */
  /* fnotrader brand blue */
  --brand:#1e6fd8; --brand-dark:#1657b0; --brand-weak:#e7f0fe;
  --brand-grad:linear-gradient(135deg,#1e6fd8,#3b8bff);
  --indigo:#5367ff; --indigo-weak:#eaecff;
  --pos:#16a34a; --neg:#e5484d; --amber:#f59e0b;
  --pos-weak:#e3f6ea; --neg-weak:#fde7e7; --amber-weak:#fdf0e0;   /* theme-aware chip fills */
  --shadow:0 1px 2px rgba(20,50,110,.06), 0 8px 24px rgba(20,50,110,.06);
  --shadow-h:0 2px 8px rgba(20,50,110,.10), 0 16px 40px rgba(20,50,110,.14);
  --radius:16px; --radius-sm:10px;
  /* Fixed deep-blue fill for white-text elements (buttons, active toggles, hero).
     Constant across themes so white text always contrasts — matches options app. */
  --fill:linear-gradient(180deg,#3b82f6,#2563eb); --fill-solid:#2563eb;
}
/* Light is the default for ALL apps. Blue/Dark only via explicit toggle
   (data-theme), never auto-triggered by the OS prefers-color-scheme.
   Palettes aligned with the options app (dark / blue). */
:root[data-theme="dark"]{
  --bg:#0b0e15; --card:#161b25; --ink:#d8dee6; --ink2:#aab3c0; --muted:#8590a0;
  --line:#2c3543; --line2:#1f2633; --chart-grid:rgba(255,255,255,.055);
  --brand:#7aa9f0; --brand-dark:#9cc0ff; --brand-weak:rgba(122,169,240,.13);
  --brand-grad:linear-gradient(135deg,#5a8de0,#7aa9f0);
  --indigo:#8b9bff; --indigo-weak:rgba(139,155,255,.14);
  --pos:#5eb87a; --neg:#e57373; --amber:#d4a857;
  --pos-weak:rgba(94,184,122,.16); --neg-weak:rgba(229,115,115,.16); --amber-weak:rgba(212,168,87,.16);
  --shadow:0 8px 24px rgba(0,0,0,.55),0 2px 6px rgba(0,0,0,.4);
  --shadow-h:0 16px 44px rgba(0,0,0,.7),0 4px 12px rgba(0,0,0,.5); }
:root[data-theme="blue"]{
  --bg:#0a1a2f; --card:#102745; --ink:#e8f0ff; --ink2:#c9d6ea; --muted:#a8c5e3;
  --line:#274a73; --line2:#163358; --chart-grid:rgba(255,255,255,.06);
  --brand:#3da3ff; --brand-dark:#6cb6ff; --brand-weak:rgba(61,163,255,.15);
  --brand-grad:linear-gradient(135deg,#3da3ff,#6cb6ff);
  --indigo:#8fb8ff; --indigo-weak:rgba(61,163,255,.14);
  --pos:#3ecf8e; --neg:#ff6e72; --amber:#ffcc66;
  --pos-weak:rgba(62,207,142,.15); --neg-weak:rgba(255,110,114,.16); --amber-weak:rgba(255,204,102,.15);
  --shadow:0 4px 14px rgba(0,0,0,.45); --shadow-h:0 14px 40px rgba(0,0,0,.6); }
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);
  font:14px/1.5 "Inter","Segoe UI",system-ui,-apple-system,sans-serif;
  text-rendering:optimizeLegibility}
a{color:var(--indigo);text-decoration:none}
b,strong{font-weight:600}
.num{font-variant-numeric:tabular-nums}
.pos{color:var(--pos)}.neg{color:var(--neg)}
.muted{color:var(--muted)}
.sub{color:var(--muted);font-size:12px}

/* ---- top nav ---- */
.nav{position:sticky;top:0;z-index:30;background:var(--card);border-bottom:1px solid var(--line);
  box-shadow:0 1px 0 var(--line)}
.nav-in{max-width:1600px;margin:0 auto;display:flex;align-items:center;gap:22px;padding:12px 30px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;flex:none;white-space:nowrap}
.brand .logo-img{width:30px;height:30px;border-radius:8px;background:#fff;padding:2px;
  box-shadow:0 1px 6px rgba(20,50,110,.22);object-fit:contain}
.brand .wordmark{font-weight:600;font-size:17px;letter-spacing:-.02em;color:var(--ink)}
.brand .wordmark b{color:var(--brand);font-weight:600}
.brand .wordmark sup{font-size:8px;opacity:.55;font-weight:600}
.brand .brand-sep{color:var(--line);font-weight:400;font-size:18px;margin:0 -2px}
.brand .brand-sub{color:var(--muted);font-weight:600;font-size:14px;letter-spacing:-.01em}
.nav .links{display:flex;gap:4px;margin-left:32px;flex:none}
.nav .links a{color:var(--ink2);font-weight:600;padding:7px 14px;border-radius:9px;font-size:13.5px;white-space:nowrap}
.nav .links a:hover{background:var(--line2)}
.nav .links a.active{color:var(--brand-dark);background:var(--brand-weak)}
/* nav dropdown */
.dd{position:relative}
.dd > a{display:inline-flex;align-items:center;gap:5px}
.dd-menu{position:absolute;top:calc(100% + 8px);left:0;background:var(--card);border:1px solid var(--line);
  border-radius:14px;box-shadow:var(--shadow-h);padding:8px;min-width:328px;display:none;z-index:50}
.dd:hover .dd-menu{display:block}
/* invisible bridge across the 8px gap so the menu doesn't vanish on the way to it */
.dd-menu::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:10px}
.dd-menu a{display:block;padding:9px 12px;border-radius:10px;text-decoration:none}
.dd-menu a:hover{background:var(--brand-weak)}
.dd-menu .dd-t{display:block;font-weight:600;font-size:13.5px;color:var(--ink);line-height:1.3}
.dd-menu a:hover .dd-t{color:var(--brand-dark)}
.dd-menu .dd-d{display:block;font-size:12px;color:var(--muted);line-height:1.35;margin-top:1px}
/* secondary sub-tab bar (sub-menu shown as tabs under the main nav) */
.subnav{position:sticky;top:53px;z-index:29;background:var(--card);border-bottom:1px solid var(--line)}
.subnav-in{max-width:1600px;margin:0 auto;padding:0 30px;display:flex;gap:2px;overflow-x:auto}
.subnav a{padding:11px 15px;font-size:13px;font-weight:600;color:var(--muted);
  border-bottom:2px solid transparent;white-space:nowrap}
.subnav a:hover{color:var(--ink2)}
.subnav a.on{color:var(--brand-dark);border-bottom-color:var(--brand)}
.subnav-extra{margin-left:auto;display:flex;align-items:center;gap:18px;padding-left:20px;white-space:nowrap}
.subnav-extra .mx{font-size:11.5px;color:var(--muted);letter-spacing:.2px}
.subnav-extra .mx b{color:var(--ink);font-weight:700;font-size:13px;margin-right:3px;font-variant-numeric:tabular-nums}
@media(max-width:1180px){.subnav-extra{display:none}}
.nav .spacer{flex:1}
.themebtn{border:1px solid var(--line);background:var(--card);color:var(--ink2);border-radius:999px;
  padding:7px 13px;font-weight:600;font-size:12.5px;cursor:pointer;font-family:inherit;
  display:inline-flex;align-items:center;gap:6px;white-space:nowrap;transition:.12s}
.themebtn:hover{background:var(--brand-weak);border-color:var(--brand);color:var(--brand-dark)}
/* Explore-apps button (explore.js re-styles into the shared promo pill; this is the baseline) */
.explorebtn{border:0;border-radius:999px;padding:7px 15px;font-weight:700;font-size:12.5px;cursor:pointer;
  font-family:inherit;white-space:nowrap;color:#fff;background:linear-gradient(135deg,#7c3aed,#a855f7);
  box-shadow:0 2px 8px rgba(124,58,237,.35);transition:.12s}
.explorebtn:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(124,58,237,.45)}
/* Profile avatar + dropdown */
.profwrap{position:relative}
.profbtn{border:0;background:none;cursor:pointer;padding:0}
.profav{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:12.5px;
  color:#fff;background:var(--fill);box-shadow:0 1px 4px rgba(37,99,235,.4);border:2px solid var(--card)}
.profav.big{width:40px;height:40px;font-size:15px;flex:none}
.profav svg{width:58%;height:58%;display:block;color:#fff}
.profmenu{position:absolute;top:calc(100% + 8px);right:0;width:280px;background:var(--card);border:1px solid var(--line);
  border-radius:14px;box-shadow:var(--shadow-h);padding:8px;display:none;z-index:40}
.profmenu.open{display:block}
.prof-head{display:flex;align-items:center;gap:11px;padding:8px 8px 12px}
.prof-name{font-weight:700;font-size:14px}
.prof-sec{display:flex;justify-content:space-between;align-items:center;font-size:10.5px;font-weight:700;
  text-transform:uppercase;letter-spacing:.5px;color:var(--muted);padding:8px 8px 4px;border-top:1px solid var(--line2)}
.prof-sec a{color:var(--brand-dark);text-decoration:none;font-weight:700}
.prof-plan{display:flex;align-items:center;gap:8px;padding:2px 8px 10px}
.prof-active{background:var(--pos-weak);color:var(--pos);font-weight:700;font-size:11.5px;padding:2px 9px;border-radius:999px}
.prof-item{display:block;width:100%;text-align:left;border:0;background:none;font:inherit;font-size:13.5px;font-weight:600;
  color:var(--ink2);padding:10px 8px;border-radius:8px;cursor:pointer;text-decoration:none}
.prof-item:hover{background:var(--brand-weak);color:var(--brand-dark)}
.prof-item.danger{color:var(--neg)}
.prof-item.danger:hover{background:var(--neg-weak);color:var(--neg)}
.prof-foot{border-top:1px solid var(--line2);margin-top:4px;padding:9px 8px 4px;text-align:center;font-size:12.5px;color:var(--muted)}
.prof-foot a{color:var(--brand-dark);text-decoration:none;font-weight:600}
@media(max-width:900px){.themebtn .tlbl{display:none}}
.searchbox{position:relative;flex:0 1 280px;min-width:150px}
.searchbox input{width:100%;max-width:44vw;padding:9px 13px;border:1px solid var(--line);
  border-radius:999px;background:var(--bg);color:var(--ink);font-size:13px;outline:none}
.searchbox input:focus{border-color:var(--brand);background:var(--card)}
/* Search and filter boxes are type=search so Chrome's autofill classifier skips
   them (it fills any text box it takes for a username, and ignores
   autocomplete=off when it does). Drop the UA clear button and the iOS inner
   shadow so they still look exactly like the .inp boxes around them. */
input[type="search"]{-webkit-appearance:none;appearance:none}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;appearance:none;display:none}
.results{position:absolute;top:calc(100% + 6px);left:0;right:0;background:var(--card);
  border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-h);
  max-height:340px;overflow:auto;z-index:40;display:none;padding:5px}
.results.on{display:block}
/* nav search dropdown: widen (right-anchored) so long fund names don't wrap word-by-word */
.searchbox .results{left:auto;right:0;width:520px;max-width:min(94vw,540px)}
@media(max-width:1100px){.searchbox .results{width:min(88vw,440px)}}
/* keep every nav label on one line — tighten spacing before anything wraps */
@media(max-width:1560px){
  .nav-in{gap:12px;padding:12px 18px}
  .nav .links{margin-left:10px;gap:0}
  .nav .links a{padding:7px 10px;font-size:13px}
}
@media(max-width:1320px){
  .brand .brand-sub,.brand .brand-sep{display:none}
  .themebtn .tlbl{display:none}
  .searchbox{min-width:110px}
  .nav .links a{padding:7px 8px}
}
/* ≤980px — collapse the header into two rows: brand + controls, then the links */
@media(max-width:980px){
  .nav-in{flex-wrap:wrap;gap:8px 10px;padding:10px 14px}
  .nav .links{order:10;flex:1 1 100%;margin-left:0;flex-wrap:wrap;row-gap:2px}
  .nav .links a{padding:6px 9px;font-size:12.5px}
  .searchbox{flex:1 1 150px;min-width:110px}
  .dd-menu{min-width:0;width:min(328px,92vw)}
  .subnav{position:static}  /* its sticky top assumes a 1-row nav */
}
/* ≤700px — phone-width: drop the promo button, compact everything left */
@media(max-width:700px){
  .nav-in .explorebtn{display:none!important}  /* out-specifies explore.js's .fno-xp-btn */
  .nav-in{gap:8px;padding:10px 12px}
  .themebtn{padding:6px 10px;font-size:11.5px}
  .brand .wordmark{font-size:15px}
  .brand .logo-img{width:26px;height:26px}
}
.results div{padding:9px 11px;border-radius:8px;cursor:pointer;font-size:13px}
.results div:hover{background:var(--brand-weak)}
/* ---- UNIFORM fund-search result row (nav sres-main, Compare/Portfolio sres-item):
   logo + 2-line name + fund house, tight spacing, thin separators between funds ---- */
.results .sres{display:flex;align-items:center;gap:6px;padding:0;border-top:1px solid var(--line2)}
.results .sres:first-child{border-top:0}
.results .sres:hover{background:transparent}
.results .sres-main,.results .sres-item{display:flex;align-items:center;gap:9px;flex:1;
  min-width:0;padding:6px 10px;border-radius:8px;cursor:pointer}
.results .sres-main:hover,.results .sres-item:hover{background:var(--brand-weak)}
.results .sres-item{border-top:1px solid var(--line2)}
.results .sres-item:first-child{border-top:0}
.results .flogo{width:26px;height:26px;flex:none}
.results .sr-txt{min-width:0;padding:0}
.results .sr-txt b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;line-height:1.25;font-weight:600;font-size:13px}
.results .sr-txt .sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11.5px;padding:0;margin-top:1px}
.results .sres-opt{flex:none;margin-right:8px;border:1px solid var(--line);background:var(--card);
  color:var(--ink2);border-radius:7px;padding:4px 9px;font:inherit;font-size:11px;font-weight:600;
  cursor:pointer;white-space:nowrap}
.results .sres-opt:hover{background:var(--brand-weak);color:var(--brand-dark);border-color:var(--brand)}
.results .sres-variants{padding:2px 0 4px 42px}
.results .svar{display:flex;align-items:center;gap:7px;padding:6px 11px;border-radius:7px;cursor:pointer}
.results .svar:hover{background:var(--brand-weak)}
.results .svar .chip{font-size:10px;padding:1px 7px}
.results .svar .svar-nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--ink2)}

/* ---- layout ---- */
main{max-width:1600px;margin:0 auto;padding:22px 30px 60px}
.page-h{display:flex;align-items:baseline;gap:12px;margin:4px 0 18px}
.page-h h1{font-size:22px;font-weight:600;margin:0;letter-spacing:-.4px}

/* ---- stat strip ---- */
.stats{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.stat{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:12px 16px;box-shadow:var(--shadow);min-width:150px}
.stat .v{font-size:19px;font-weight:600;letter-spacing:-.4px}
.stat .k{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-top:2px}

/* ---- tabs (pill) ---- */
.tabs{display:inline-flex;gap:4px;background:var(--card);border:1px solid var(--line);
  border-radius:999px;padding:4px;box-shadow:var(--shadow);margin-bottom:16px}
.tabs button{border:0;background:transparent;color:var(--muted);padding:8px 18px;
  border-radius:999px;cursor:pointer;font-size:13.5px;font-weight:600}
.tabs button.on{background:var(--fill);color:#fff;box-shadow:0 1px 3px rgba(37,99,235,.4),inset 0 1px 0 rgba(255,255,255,.18)}
.tabs button:disabled{opacity:.45;cursor:not-allowed}

/* ---- filter bar ---- */
.filters{display:flex;gap:12px;flex-wrap:wrap;align-items:end;
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:15px 16px;margin-bottom:18px;box-shadow:var(--shadow)}
.fld{display:flex;flex-direction:column;gap:5px}
.fld label{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px;font-weight:600}
select,.inp{padding:8px 11px;border:1px solid var(--line);border-radius:9px;background:var(--card);
  color:var(--ink);font-size:13px;min-width:130px;outline:none;font-family:inherit;
  accent-color:var(--brand);font-weight:600}
select:focus,.inp:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-weak)}
select option{background:var(--card);color:var(--ink);font-weight:600}
select option:checked,select option:hover{background:var(--fill-solid)!important;color:#fff!important}
select optgroup{color:var(--brand-dark);font-weight:600}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:9px;overflow:hidden}
.seg button{border:0;background:var(--card);padding:8px 13px;cursor:pointer;font-size:13px;
  color:var(--muted);font-weight:600}
.seg button.on{background:var(--fill);color:#fff}

/* ---- cards / grid ---- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);overflow:hidden}
.card-h{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;
  border-bottom:1px solid var(--line2)}
.card-h .t{font-size:15px;font-weight:600;display:flex;align-items:center;gap:9px}
.card-h .cnt{font-size:11px;color:var(--muted);font-weight:600}
.dotbadge{width:9px;height:9px;border-radius:3px;display:inline-block}

/* asset-class accent dots — vivid, distinct */
.ac-Equity{background:#1e6fd8}.ac-Debt{background:#0ea5e9}.ac-Thematic{background:#f59e0b}
.ac-Hybrid{background:#8b5cf6}.ac-Commodities{background:#eab308}.ac-International{background:#14b8a6}
.ac-Other{background:#94a3b8}.ac-SolutionOriented{background:#ec4899}

/* fund row inside card */
.frow{display:flex;align-items:center;gap:12px;padding:11px 16px;border-bottom:1px solid var(--line2);
  cursor:pointer;transition:background .1s}
.frow:last-child{border-bottom:0}
.frow:hover{background:var(--brand-weak)}
.frow .rk{width:22px;height:22px;border-radius:7px;background:var(--line2);color:var(--ink2);
  display:grid;place-items:center;font-size:11px;font-weight:600;flex:none}
.frow:nth-child(1) .rk,.frow .rk.top{background:var(--fill-solid);color:#fff}
.frow .nm{flex:1;min-width:0}
.frow .nm b{display:block;font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.frow .nm .s{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.frow .rt{text-align:right;flex:none}
.frow .rt .big{font-size:14.5px;font-weight:600}
.frow .rt .al{font-size:10.5px;font-weight:600;margin-top:1px}

/* chips */
.chip{display:inline-block;padding:2px 9px;border-radius:999px;font-size:11px;font-weight:600;
  background:var(--brand-weak);color:var(--brand-dark)}
.chip.idg{background:var(--indigo-weak);color:var(--indigo)}
.chip.gray{background:var(--line2);color:var(--ink2)}
/* theme-aware +/- change chips */
.chip.up{background:var(--brand-weak);color:var(--brand-dark)}
.chip.down{background:var(--neg-weak);color:var(--neg)}
.chip.pos-w{background:var(--pos-weak);color:var(--pos)}
.chip.amber-w{background:var(--amber-weak);color:var(--amber)}
/* fund page: SMA/EMA overlay chips + returns folded into cards */
.ma-bar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:11px 14px;border-bottom:1px solid var(--line2)}
.ma-chip{border:1px solid var(--line);background:var(--card);color:var(--ink2);border-radius:999px;
  padding:4px 12px;font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:.12s}
.ma-chip:hover{border-color:var(--brand);color:var(--brand-dark)}
.ma-chip.on{background:var(--fill);color:#fff;border-color:transparent;box-shadow:0 1px 3px rgba(37,99,235,.35)}
.rcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:10px;margin-top:14px}
.rcard{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;box-shadow:var(--shadow)}
.rcard .rc-w{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--muted)}
.rcard .rc-f{font-size:18px;font-weight:700;margin:5px 0 2px;font-variant-numeric:tabular-nums}
.rcard .rc-sub{font-size:11.5px;color:var(--muted)}
.rcard .rc-a{margin-top:9px}
/* category cell: main asset class (small) stacked over the coloured sub-category chip */
.catcell{display:inline-flex;flex-direction:column;gap:3px;align-items:flex-start}
.catcell .cmain{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--muted)}
/* content-coloured chips — category by asset class, risk by severity */
.chip.k-eq  {background:rgba(37,99,235,.13);color:#1d4ed8}
.chip.k-idx {background:rgba(13,148,136,.14);color:#0f766e}
.chip.k-hyb {background:rgba(139,92,246,.14);color:#6d28d9}
.chip.k-debt{background:rgba(14,165,233,.14);color:#0369a1}
.chip.k-gilt{background:rgba(99,102,241,.14);color:#4338ca}
.chip.k-comm{background:rgba(217,119,6,.16);color:#b45309}
.chip.k-fof {background:rgba(219,39,119,.13);color:#be185d}
.chip.k-ovs {background:rgba(20,184,166,.15);color:#0f766e}
.chip.k-sol {background:rgba(236,72,153,.14);color:#be185d}
.chip.k-oth {background:rgba(100,116,139,.15);color:#475569}
.chip.r-1{background:rgba(22,163,74,.14);color:#15803d}
.chip.r-2{background:rgba(132,204,22,.17);color:#4d7c0f}
.chip.r-3{background:rgba(234,179,8,.19);color:#a16207}
.chip.r-4{background:rgba(249,115,22,.16);color:#c2410c}
.chip.r-5{background:rgba(239,68,68,.15);color:#dc2626}
.chip.r-6{background:rgba(220,38,38,.17);color:#b91c1c}
/* brighten text on the dark / blue themes (light theme carries no data-theme attr) */
[data-theme] .chip.k-eq{color:#60a5fa}[data-theme] .chip.k-idx{color:#2dd4bf}
[data-theme] .chip.k-hyb{color:#a78bfa}[data-theme] .chip.k-debt{color:#38bdf8}
[data-theme] .chip.k-gilt{color:#818cf8}[data-theme] .chip.k-comm{color:#fbbf24}
[data-theme] .chip.k-fof{color:#f472b6}[data-theme] .chip.k-ovs{color:#2dd4bf}
[data-theme] .chip.k-sol{color:#f472b6}[data-theme] .chip.k-oth{color:#94a3b8}
[data-theme] .chip.r-1{color:#4ade80}[data-theme] .chip.r-2{color:#a3e635}
[data-theme] .chip.r-3{color:#fcd34d}[data-theme] .chip.r-4{color:#fb923c}
[data-theme] .chip.r-5{color:#f87171}[data-theme] .chip.r-6{color:#f87171}

/* ---- sortable table ---- */
.tablecard{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);overflow:hidden}
.tbl-top{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line2);flex-wrap:wrap}
.tbl-wrap{overflow-x:auto}
table.grid-tbl{width:100%;border-collapse:collapse;font-size:13px}
table.grid-tbl th,table.grid-tbl td{padding:11px 13px;text-align:right;white-space:nowrap;border-bottom:1px solid var(--line2)}
table.grid-tbl th.l,table.grid-tbl td.l{text-align:left}
table.grid-tbl thead th{position:sticky;top:0;background:var(--card);z-index:1;
  font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);font-weight:600;
  cursor:pointer;user-select:none}
table.grid-tbl thead th:hover{color:var(--ink)}
table.grid-tbl thead th .ar{opacity:.35;margin-left:4px;font-size:10px}
table.grid-tbl thead th.sorted{color:var(--brand-dark)}
table.grid-tbl thead th.sorted .ar{opacity:1;color:var(--brand-dark)}
table.grid-tbl tbody tr{cursor:pointer}
table.grid-tbl tbody tr:hover{background:var(--brand-weak)}
/* keep the Fund column visible while scrolling wide tables horizontally */
table.grid-tbl thead th:first-child,table.grid-tbl tbody td:first-child{
  position:sticky;left:0;background:var(--card);z-index:1;box-shadow:1px 0 0 var(--line2)}
table.grid-tbl thead th:first-child{z-index:2}
table.grid-tbl tbody tr:hover td:first-child{background:var(--brand-weak)}
table.grid-tbl tr.pinned td:first-child{background:var(--brand-weak)}
table.grid-tbl tbody tr:last-child td{border-bottom:0}
.nm-cell{min-width:0}
.nm-cell b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.nm-cell .s{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* cap the fund-name column so wide tables fit without needless horizontal scroll */
.grid-tbl td.l .nmrow, .grid-tbl td.l .nm-cell{max-width:360px}
.grid-tbl th, .grid-tbl td{padding:10px 12px}
.nmrow{display:flex;align-items:center;gap:10px;min-width:0}
.flogo{width:28px;height:28px;border-radius:7px;object-fit:contain;background:#fff;
  border:1px solid var(--line);padding:2px;flex:none}
.flogo.ph{background:var(--line2);border:1px solid var(--line)}
.milebadge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:11px;font-weight:600}
.mile-ath{background:#e6f7ee;color:#0a7d3b}.mile-52wh{background:var(--brand-weak);color:var(--brand-dark)}
.mile-52wl{background:var(--amber-weak);color:var(--amber)}.mile-atl{background:var(--neg-weak);color:var(--neg)}
.hilite{background:var(--brand-weak)!important}
.grid-tbl tr.pinned{background:var(--brand-weak)}
.grid-tbl tr.pinned td{font-weight:600}
/* fund-detail section nav + cards */
html{scroll-behavior:smooth}
.secnav{position:sticky;top:96px;z-index:20;display:flex;gap:6px;flex-wrap:wrap;
  padding:9px 0;margin:2px 0 6px;background:var(--bg)}
.secnav a{font-size:12.5px;font-weight:600;color:var(--ink2);background:var(--card);
  border:1px solid var(--line);border-radius:999px;padding:6px 13px}
.secnav a:hover{background:var(--brand-weak);color:var(--brand-dark);border-color:var(--brand)}
.sec-h{scroll-margin-top:150px}
/* fund-manager blocks */
.mgr-block{padding:12px 2px}
.mgr-sep{border-top:1px solid var(--line2);margin-top:2px}
.mgr-av{width:38px;height:38px;border-radius:50%;background:var(--brand-weak);color:var(--brand-dark);
  display:grid;place-items:center;font-weight:600;flex:none}
.mgr-toggle{background:var(--card);color:var(--brand-dark);border:1px solid var(--line);border-radius:8px;
  padding:6px 11px;font:inherit;font-weight:600;font-size:12px;cursor:pointer;display:inline-flex;
  align-items:center;gap:5px;white-space:nowrap;flex:none}
.mgr-toggle:hover{background:var(--brand-weak);border-color:var(--brand)}
.mgr-toggle .chev{font-size:10px;color:var(--muted)}
.mgr-list{margin:10px 0 2px;display:flex;flex-direction:column;gap:2px}
.mgr-fund{display:flex;align-items:center;gap:10px;padding:8px 11px;border-radius:9px;color:var(--ink)}
.mgr-fund:hover{background:var(--brand-weak)}
.mgr-fund .nm{flex:1;min-width:0;font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mgr-fund .sub{min-width:96px}
.mgr-fund .num{min-width:62px;text-align:right;font-weight:600}
.infocard{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:16px 20px;margin-bottom:6px}

/* buttons */
.btn{border:0;background:var(--fill);color:#fff;padding:9px 16px;border-radius:10px;
  font-weight:600;font-size:13px;cursor:pointer;font-family:inherit;
  box-shadow:0 2px 6px rgba(37,99,235,.32),inset 0 1px 0 rgba(255,255,255,.18);transition:filter .15s}
.btn:hover{filter:brightness(1.08)}
.btn.ghost{background:var(--card);color:var(--ink2);border:1px solid var(--line)}
.btn.ghost:hover{background:var(--line2)}
.btn:disabled{opacity:.5;cursor:not-allowed}

.empty{padding:48px;text-align:center;color:var(--muted)}
.spinner{display:inline-block;width:18px;height:18px;border:2px solid var(--line);
  border-top-color:var(--brand);border-radius:50%;animation:spin .7s linear infinite;vertical-align:-4px}
@keyframes spin{to{transform:rotate(360deg)}}

/* drawer */
.backdrop{position:fixed;inset:0;background:rgba(16,20,32,.35);opacity:0;pointer-events:none;
  transition:.2s;z-index:45}
.backdrop.on{opacity:1;pointer-events:auto}
#drawer{position:fixed;top:0;right:0;height:100%;width:min(580px,95vw);background:var(--card);
  border-left:1px solid var(--line);box-shadow:var(--shadow-h);transform:translateX(100%);
  transition:transform .24s cubic-bezier(.4,0,.2,1);overflow:auto;z-index:46}
#drawer.open{transform:none}
.drawer-pad{padding:22px}
.close{position:absolute;top:16px;right:18px;border:0;background:var(--line2);width:30px;height:30px;
  border-radius:50%;font-size:17px;cursor:pointer;color:var(--ink2)}
/* Key-value tiles. Was a 2-column list with dashed rules, which used half the
   width and left a tall column of whitespace on wide screens. Now an auto-filling
   tile grid — 4-5 across on desktop, 2 on a phone, no media queries — with the
   value carrying the visual weight instead of a divider line. */
.kv{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:9px;margin:14px 0}
.kv .cell{background:var(--line2);border:1px solid transparent;border-radius:10px;
  padding:9px 11px 10px;transition:border-color .12s,background .12s;min-width:0}
.kv .cell:hover{border-color:var(--line);background:var(--brand-weak)}
.kv .cell .k{color:var(--muted);font-size:10px;font-weight:700;text-transform:uppercase;
  letter-spacing:.45px;display:block;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kv .cell .val{font-weight:700;font-size:15.5px;color:var(--ink);font-variant-numeric:tabular-nums;
  line-height:1.25;display:block}
.kv .cell .val .sub{font-size:11px;font-weight:600}
/* .kv-list — the original two-column key/value layout, kept for sections whose
   values are SENTENCES rather than numbers (exit load, tax). Prose in a 168px
   tile wraps to four lines and leaves the rest of the row empty; a wide
   two-column list reads far better. Tiles stay the default for metrics. */
.kv.kv-list{grid-template-columns:1fr 1fr;gap:10px 22px}
.kv.kv-list .cell{background:none;border:0;border-bottom:1px dashed var(--line);
  border-radius:0;padding:0 0 7px}
.kv.kv-list .cell:hover{background:none;border-color:var(--line)}
.kv.kv-list .cell .k{font-size:11px;font-weight:600;text-transform:none;letter-spacing:0;
  white-space:normal}
.kv.kv-list .cell .val{font-size:13.5px;font-weight:600;line-height:1.5}
@media(max-width:640px){.kv.kv-list{grid-template-columns:1fr}}

/* trailing note listing the metrics that don't apply, instead of a wall of dashes */
.kv-na{font-size:11.5px;color:var(--muted);line-height:1.55;margin-top:2px}
.kv-na b{color:var(--ink2);font-weight:600}

/* A column header (or field label) that carries an explanatory tooltip. The
   dotted underline is the affordance — without it nobody hovers. */
table.grid-tbl thead th.has-help{text-decoration:underline dotted var(--line);
  text-underline-offset:3px;cursor:help}
table.grid-tbl thead th.has-help:hover{text-decoration-color:var(--brand)}
.fgrid label.has-help > span:first-child,.fgrid label.has-help{cursor:help}
.hlp{border-bottom:1px dotted var(--line);cursor:help}

/* metric tiles (fund analysis header) */
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px;margin:14px 0}
.metric{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:13px 15px;box-shadow:var(--shadow)}
.metric .mv{font-size:20px;font-weight:600;letter-spacing:-.4px}
.metric .mk{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px;margin-top:3px}
.stars{color:var(--amber);letter-spacing:1px}
.stars .off{color:var(--line)}
.hero{background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:var(--radius);padding:20px 22px;box-shadow:var(--shadow)}
.hero h1{margin:0 0 4px;font-size:20px;font-weight:600}
.hero .sub2{color:#e7f0ff;font-size:13px}
.hero .pillrow{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.hero .hp{background:rgba(255,255,255,.16);border-radius:999px;padding:4px 12px;font-size:12px;font-weight:600}

/* section heading */
.sec-h{font-size:15px;font-weight:600;margin:22px 0 12px;display:flex;align-items:center;gap:9px}
/* Accent rule on section headings — gives the long analysis page some rhythm so
   it doesn't read as one flat wall of white between cards. */
.sec-h::before{content:"";flex:none;width:4px;height:17px;border-radius:3px;
  background:var(--brand-grad)}

/* market-cap composition bar */
.capbar{display:flex;height:34px;border-radius:10px;overflow:hidden;border:1px solid var(--line);background:var(--card)}
.capbar > div{display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:600;min-width:0;overflow:hidden;white-space:nowrap}
.cap-large{background:#1e6fd8}.cap-mid{background:#f59e0b}.cap-small{background:#14b8a6}.cap-other{background:#94a3b8}
.caplegend{display:flex;gap:16px;flex-wrap:wrap;margin-top:10px;font-size:12px;font-weight:600}
.caplegend span{display:inline-flex;align-items:center;gap:6px;color:var(--ink2)}
.caplegend i{width:11px;height:11px;border-radius:3px;display:inline-block}

/* ── Fund Health score card ──────────────────────────────────────────────
   Every value here is served precomputed; the CSS only places it. */
.health{display:flex;gap:22px;align-items:flex-start;flex-wrap:wrap}
.health .hs{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:132px}
.health .hs .num{font-size:44px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums;color:var(--ink)}
.health .hs .den{font-size:12px;color:var(--muted);font-weight:600}
.health .hs .grade{margin-top:6px;font-size:13px;font-weight:800;padding:3px 12px;border-radius:999px}
.health .hdims{flex:1;min-width:260px;display:flex;flex-direction:column;gap:9px}
.hdim{display:grid;grid-template-columns:132px 1fr 42px;align-items:center;gap:10px;font-size:12px}
.hdim .lbl{color:var(--ink2);font-weight:600}
.hdim .track{height:8px;border-radius:999px;background:var(--line2);overflow:hidden}
.hdim .fill{height:100%;border-radius:999px;background:var(--brand)}
.hdim .v{text-align:right;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink2)}
.hdim.miss .lbl,.hdim.miss .v{color:var(--muted);font-weight:600}
/* grade colours: reuse the semantic tokens so dark theme follows automatically */
.g-a{background:var(--pos-weak);color:var(--pos)}
.g-b{background:var(--brand-weak);color:var(--brand-dark)}
.g-c{background:var(--amber-weak);color:var(--amber)}
.g-d{background:var(--neg-weak);color:var(--neg)}

/* ── Horizontal metric bars (sector exposure, style box) ───────────────── */
.mbars{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.mbar{display:grid;grid-template-columns:150px 1fr 54px;align-items:center;gap:10px;font-size:12.5px}
.mbar .lbl{color:var(--ink2);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mbar .track{height:10px;border-radius:999px;background:var(--line2);overflow:hidden}
.mbar .fill{height:100%;border-radius:999px;background:var(--brand)}
.mbar .v{text-align:right;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink)}

/* ── Verdict chips (server-worded, descriptive) ────────────────────────── */
.verdicts{display:flex;flex-wrap:wrap;gap:10px;margin-top:2px}
.verdict{border:1px solid var(--line);border-radius:12px;padding:10px 13px;background:var(--card);min-width:210px;flex:1 1 220px}
.verdict .vt{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--muted)}
.verdict .vl{font-size:15px;font-weight:700;margin:3px 0 2px;color:var(--ink)}
.verdict .vd{font-size:11.5px;color:var(--muted);line-height:1.45}

/* upload dropzone */
.drop{border:2px dashed var(--line);border-radius:14px;padding:34px;text-align:center;background:var(--card);
  cursor:pointer;transition:.15s}
.drop:hover,.drop.drag{border-color:var(--brand);background:var(--brand-weak)}
.drop .big{font-size:15px;font-weight:600;margin-bottom:4px}
