/* rail.css — the shared relationship-rail styles (used by window.MDXRail on asset · explore · country ·
   gics pages). Card + sparkline + skeleton + grow-in animation + "?" popover. See public/js/mdx-rail.js
   and docs/product/context-rail-design.md. (Asset page still carries its own copy in asset.css for now.) */
.rl-sec { margin-top: 20px; }
.rl-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--dim, #6b6b6b); margin: 0 0 10px; }
/* multiple sections stacked in ONE rail container (theme/country) → space a header off the list above it */
.rl-list + .rl-h { margin-top: 22px; }
.rl-h .rl-n { background: rgba(0,0,0,.06); border-radius: 999px; padding: 1px 8px; font-size: 11px; color: var(--black); }
.rl-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; }
.rl-tab { font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; background: transparent;
  border: 1px solid rgba(0,0,0,.12); border-radius: 999px; padding: 3px 10px; color: var(--dim, #6b6b6b);
  transition: background .15s, border-color .15s, color .15s; }
.rl-tab.on { background: var(--black); border-color: var(--black); color: #fff; }
.rl-shuf { margin-left: auto; background: transparent; border: none; cursor: pointer; font-size: 14px; opacity: .55; }
.rl-shuf:hover { opacity: 1; }
.rl-list { display: flex; flex-direction: column; gap: 6px; }
/* thin sub-group label inside a section (e.g. "Currency exposure" under Related assets) */
.rl-subh { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--dim, #6b6b6b); opacity: .8; margin: 12px 0 7px; }
.rl-card { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; background: #fff;
  border: 1px solid rgba(0,0,0,.08); text-decoration: none; color: var(--black); transition: border-color .15s, box-shadow .15s; }
.rl-card:hover { border-color: rgba(0,0,0,.22); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.rl-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.05);
  display: flex; align-items: center; justify-content: center; font-size: 14px; }
/* commodity chip (icon on a coloured disc) — shared CommodityMeta; bg set inline per symbol */
.rl-ic-chip { background: none; }
.rl-ic-chip svg { width: 62%; height: 62%; }
.rl-nm { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-sub { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim, #7a7a7a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-chan { text-transform: capitalize; }
.rl-str { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.rl-str-high { background: #1f9d57; } .rl-str-medium { background: #e0a72e; } .rl-str-low { background: #bbb; }
.rl-up { color: #1f9d57; font-size: 9px; } .rl-dn { color: #d23b3b; font-size: 9px; }
.rl-mc, .rl-spk { font-weight: 700; color: var(--black); }
.rl-q { flex: none; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.06); color: var(--dim, #888);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: help; }
.rl-q:hover { background: rgba(0,0,0,.14); color: var(--black); }
/* a rail makes the sidebar too tall to pin → let it scroll with the page (override feed.css sticky) */
.fd-side { position: static; }
/* per-card price context — sparkline + price + %chg (batch-hydrated) */
.rl-metric { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; min-height: 18px; }
.rl-metric:empty { display: none; }
.rl-spark { width: 58px; height: 18px; flex: none; display: block; overflow: visible; }
.rl-px { font-weight: 700; color: var(--black); font-variant-numeric: tabular-nums; }
.rl-metric .rl-up, .rl-metric .rl-dn { font-size: 11px; font-weight: 700; }
.rl-metric .rl-up { color: #1f9d57; } .rl-metric .rl-dn { color: #d23b3b; }
/* skeleton (warm shimmer) shown until the batch price hydrates — mirrors the real layout (no jump) */
@keyframes rl-sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.rl-skel { background: linear-gradient(90deg, #E7E4DD 25%, #F2F0EB 50%, #E7E4DD 75%); background-size: 200% 100%;
  animation: rl-sh 1.4s linear infinite; border-radius: 5px; display: inline-block; }
.rl-spark.rl-skel { height: 22px; align-self: center; border-radius: 6px; }   /* MUST equal the real .rl-spark height (22px, below) — a 12px skel grew ~10px on hydrate = the card-height jump */
.rl-px-skel { width: 54px; height: 11px; }
.rl-chg-skel { width: 30px; height: 11px; }
/* layer-1: whole placeholder card (icon · name · sub · metric all shimmer) while a section is fetching */
.rl-card-skel { pointer-events: none; cursor: default; }
.rl-ic.rl-skel { border-radius: 50%; }
.rl-nm-skel { width: 66px; height: 12px; }
.rl-sub-skel { width: 92px; height: 10px; }
/* sparkline grow-in: line starts flat on the baseline (scaleY 0) → rises to real over ~1s, staggered via --rl-d */
.rl-spark.rl-spark-anim polyline { transform-box: view-box; transform-origin: 50% 100%; transform: scaleY(0); }
.rl-spark.rl-spark-anim.rl-spark-in polyline {
  transform: scaleY(1); transition: transform 1s cubic-bezier(.22, .61, .36, 1) var(--rl-d, 0ms); }
@media (prefers-reduced-motion: reduce) {
  .rl-spark.rl-spark-anim polyline { transform: none; transition: none; } }
/* card layout: icon+name+"?" on top, wide sparkline, price bottom-right */
.rl-card { flex-direction: column; align-items: stretch; gap: 5px; padding: 9px 11px; }
.rl-top { display: flex; align-items: center; gap: 8px; }
.rl-top .rl-nm { flex: 1; min-width: 0; }
.rl-q { margin-left: auto; }
.rl-sub { flex-wrap: wrap; white-space: normal; }
.rl-metric { flex-direction: row; align-items: center; gap: 10px; margin-top: 3px; }
.rl-spark { flex: 1 1 auto; min-width: 90px; height: 22px; }
.rl-pxrow { display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; font-size: 12px;
  flex: none; width: 116px; font-variant-numeric: tabular-nums; }
.rl-pxrow .rl-px { font-weight: 700; color: var(--black); }
.rl-pxrow .rl-up { color: #1f9d57; font-weight: 700; font-size: 12px; }
.rl-pxrow .rl-dn { color: #d23b3b; font-weight: 700; font-size: 12px; }
/* "?" popover */
.rl-pop { position: absolute; z-index: 600; background: rgba(42,37,33,.97); color: #f0eee9; border-radius: 10px;
  padding: 10px 12px; font: 500 12px/1.5 'Space Grotesk', sans-serif; box-shadow: 0 10px 34px rgba(0,0,0,.34);
  white-space: pre-line; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); pointer-events: auto; }
/* leading-icon = country flag (peer/competitor): fill the same 26px circle */
.rl-ic-img { background: none; padding: 0; overflow: hidden; }
.rl-ic-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* split flag (forex pair / cross-country bond spread) — two clip-path triangles + 45° seam, benchmark
   lower-left, subject upper-right (same as the asset hero .as-splitflag). Used by MDXRail.miniSplitFlag. */
.rl-ic-split { background: none; overflow: hidden; position: relative; }
.rl-ic-split .rl-half { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rl-ic-split .rl-half.ll { clip-path: polygon(0 0, 100% 100%, 0 100%); }
.rl-ic-split .rl-half.ur { clip-path: polygon(0 0, 100% 0, 100% 100%); }
.rl-ic-split::after { content: ''; position: absolute; top: 50%; left: 50%; width: 142%; height: 1px;
  background: #fff; transform: translate(-50%, -50%) rotate(45deg); }
