/* The profile uses the Index's own palette and typography in both themes. */
/* Native WebKit select controls must follow the chosen page theme too. */
html{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Keep the waiting Compare canvas within narrow viewports before it is initialised. */
#cmpChart{max-width:100%}
/* Keep PR #3's featured discovery links intact on narrow screens. */
#company-profiles .ctarow{flex-wrap:wrap}
@media(max-width:360px){header .hd{gap:10px}header .hdctrl{gap:8px}header .hd img{height:36px}}
#tiers .company-link{color:var(--ink);font-weight:650;text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:4px}
#tiers .company-link:hover{color:var(--blue);text-decoration-color:currentColor}
#tiers .profile-compare{font:600 11px 'Inter',system-ui,sans-serif;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:5px;padding:7px 10px;cursor:pointer}
#tiers tbody tr{cursor:default}
.company-link:focus-visible,.profile-compare:focus-visible,#companyProfile :focus-visible{outline:3px solid var(--blue);outline-offset:3px}
#companyProfile{box-sizing:border-box;position:fixed;inset:0 0 0 auto;margin:0;width:min(720px,94vw);height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;max-width:100vw;border:0;border-left:1px solid var(--line);padding:0;background:var(--bg);color:var(--ink);box-shadow:-14px 0 60px #0003;overflow:hidden;font-family:'Inter',system-ui,sans-serif;font-size:1rem}
#companyProfile::backdrop{background:rgb(7 25 40 / .5);backdrop-filter:blur(2px)}
#companyProfile[open]{display:flex;flex-direction:column}
#companyProfile [hidden]{display:none}
#companyProfile{overflow-wrap:anywhere}
.profile-top>.profile-eyebrow{flex:1;min-width:0}
.profile-top{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 28px;border-bottom:1px solid var(--line);flex:none}
.profile-eyebrow{font-size:.8125rem;line-height:1.5;letter-spacing:0;text-transform:none;font-weight:600;color:var(--muted)}
.profile-close{font:500 .8125rem/1.5 'Inter',system-ui,sans-serif;color:var(--ink);background:var(--bg2);border:1px solid var(--line);border-radius:5px;min-height:44px;padding:8px 12px;cursor:pointer;flex-shrink:0;white-space:nowrap}
.profile-scroll{overflow-y:auto;overscroll-behavior:contain;flex:1;min-height:0;padding:28px 30px 40px;scroll-padding-block:12px;scrollbar-gutter:stable}
#profileTitle{font:500 clamp(1.75rem,4vw,2.25rem)/1.2 'Newsreader',Georgia,serif;letter-spacing:-.02em;margin:12px 0}
.profile-subtitle{font-size:.8125rem;line-height:1.6;color:var(--muted)}
.profile-actions{display:flex;gap:8px;flex-wrap:wrap;margin:22px 0 26px}
.profile-actions button,.profile-actions a,.profile-retry{display:inline-flex;align-items:center;justify-content:center;min-height:44px;max-width:100%;box-sizing:border-box;padding:9px 14px;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--ink);font:600 .8125rem/1.5 'Inter',system-ui,sans-serif;text-decoration:none;cursor:pointer}
.profile-actions .profile-primary{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.profile-actions [hidden]{display:none}
.profile-section{margin:25px 0 0;padding:23px 0 0;border:0;border-top:1px solid var(--line)}
.profile-section h3,#companyProfile .cmp-fundhd>.k{font:500 1.5rem/1.25 'Newsreader',Georgia,serif;margin:0 0 14px;letter-spacing:-.015em;text-transform:none;color:var(--ink)}
.profile-description,#profileSecurity .profile-section>p:not(.profile-note){font-size:.9375rem;line-height:1.75;margin:0 0 12px}
.profile-note{font-size:11px;line-height:1.65;color:var(--muted);margin:12px 0 0;overflow-wrap:anywhere}
#companyProfile .profile-note{font-size:.8125rem}
.profile-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 15px;margin:0}
.profile-facts dt{font-size:.8125rem;line-height:1.5;text-transform:none;letter-spacing:0;color:var(--muted);margin-bottom:5px}
.profile-facts dd{font:500 1rem/1.5 'Inter',system-ui,sans-serif;margin:0;overflow-wrap:anywhere}
.profile-chart-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.profile-chart-head h3{margin:0}
.profile-ranges{display:flex;flex-wrap:wrap;max-width:100%;gap:3px}
.profile-ranges button{font:600 .8125rem/1.5 'Inter',system-ui,sans-serif;min-height:44px;padding:8px 12px;background:var(--bg2);color:var(--muted);border:1px solid var(--line);border-radius:4px;cursor:pointer}
.profile-ranges button[aria-pressed="true"]{color:var(--bg);background:var(--ink);border-color:var(--ink)}
.profile-chart-wrap{position:relative;height:225px;min-width:0}
.profile-performance{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:12px;margin:12px 0;font-size:.8125rem;line-height:1.5;color:var(--muted)}
.profile-performance strong{font:500 1.75rem/1.3 'Inter',system-ui,sans-serif;letter-spacing:-.03em;color:var(--ink)}
#companyProfile .cmp-fund{margin:25px 0 0;border-top:1px solid var(--line);padding-top:22px}
#companyProfile .cmp-fund .grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px}
#companyProfile .cmp-fund .grid .k{font-size:.8125rem;color:var(--muted);line-height:1.5;font-weight:400}
#companyProfile .cmp-fund .v{font-size:1rem;line-height:1.5;margin-top:4px}
#companyProfile .cmp-fundhd{display:flex;justify-content:space-between;gap:12px;align-items:baseline;flex-wrap:wrap}
#companyProfile .cmp-fundhd>.k{margin:0}
#companyProfile .cmp-fundhd .src{font-size:.8125rem;line-height:1.65;color:var(--muted)}
.profile-sources{font-size:.8125rem;padding-left:18px;line-height:1.8;overflow-wrap:anywhere}
.profile-sources a{color:var(--blue)}
#profileStatus{font-size:.8125rem;line-height:1.7;color:var(--muted)}
@media(max-width:900px){
  #tiers .tbl{display:block;min-width:0}
  #tiers .tbl thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  #tiers .tbl tbody{display:block}
  #tiers .tbl tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 12px;padding:12px 0;border-bottom:1px solid var(--line)}
  #tiers .tbl td{padding:0;border:0;white-space:normal;text-align:left;min-width:0}
  #tiers .tbl .hide-sm{display:none}
  #tiers .tbl .co{grid-column:1;grid-row:1;overflow-wrap:anywhere}
  #tiers .company-link{display:inline-flex;align-items:center;min-height:44px;line-height:1.5}
  #tiers .tbl .tk{grid-column:1;grid-row:2;color:var(--muted);font-size:11px}
  #tiers .profile-action-cell{grid-column:2;grid-row:1 / span 2;align-self:center}
  #tiers .profile-compare{min-height:44px;padding:10px 12px}
  #tiers .profile-weight{grid-column:1;grid-row:3;font-size:12px;margin-top:6px}
  #tiers .profile-return{grid-column:1;grid-row:4;font-size:12px}
  #tiers [data-label]::before{content:attr(data-label) ' ';color:var(--muted);font-size:11px}
}
@media(max-width:600px){
  #companyProfile{width:100vw;border-left:0}
  .profile-top{padding:12px 18px}
  .profile-scroll{padding:22px 20px max(28px,env(safe-area-inset-bottom))}
  .profile-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:17px}
  #companyProfile .cmp-fund .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .profile-chart-head{align-items:flex-start;flex-direction:column}
  .profile-ranges button{min-height:44px;padding:8px 14px}
  .profile-close{min-height:44px}
  .profile-actions{gap:8px}.profile-actions button,.profile-actions a{min-height:44px}
  .profile-performance{flex-wrap:wrap}.profile-chart-wrap{height:200px}
}
@media(hover:none) and (pointer:coarse){
  #tiers .profile-compare,.profile-close,.profile-ranges button,.profile-actions button,.profile-actions a,.profile-retry{min-height:44px}
  #cSearch,#cSeg,#cCtry{font-size:16px;min-height:44px}
}
@media(prefers-reduced-motion:reduce){html,#companyProfile *{scroll-behavior:auto}}
