/* Company rankings (/stocks/rankings/<measure>, /stocks/sectors/<key>): only these pages load this
   file, so site.css (and every other page's address for it) stays as it is. */

/* Measures: one row of tabs; on phones it scrolls sideways. */
.rk-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 24px; }
.rk-tabs span { font-size: 13px; color: var(--muted); margin-right: 2px; }
.rk-tabs a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; text-decoration: none; color: var(--navy); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.rk-tabs a:hover { border-color: var(--gold); }
.rk-tabs a.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Filter row: the browse pages' filter box, plus a sector menu. */
.rk-tools { flex-wrap: wrap; }
.rk-sector select { font: 500 14.5px Inter, sans-serif; color: var(--ink); padding: 10px 36px 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; appearance: none; -webkit-appearance: none; cursor: pointer; box-shadow: 0 4px 16px rgba(11,17,32,.05); }
.rk-sector select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.18); }

/* The table: rank and company stay in view while the figures scroll sideways. */
.rk-board .rk-h { font-size: 24px; margin: 0 0 4px; }
.rtable { min-width: 780px; }
.rtable th.rk, .rtable td.rk { position: sticky; left: 0; z-index: 2; background: #fff; width: 46px; min-width: 46px; padding-right: 10px; color: var(--muted); font-weight: 600; }
.rtable .fund { left: 46px; }
.rtable tbody tr { scroll-margin-top: calc(var(--stick) + 80px); }
.rtable tbody tr:target td { background: var(--gold-soft); }
.rtable td small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.rk-more { text-align: center; margin-top: 16px; }
.rk-more button { font: 600 14px Inter, sans-serif; padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
.rk-more button:hover { border-color: var(--gold); }
.rk-more button[hidden] { display: none; }
.rk-more p { margin: 0; font-size: 14px; }
.rk-foot { font-size: 13px; margin: 12px 0 0; }

/* A sector's leaders: small top-five cards. */
.rk-leaders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 28px; }
.rk-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; display: flex; flex-direction: column; }
.rk-card h2 { font: 600 12.5px Inter, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.rk-card ol { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: rk; }
.rk-card li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; counter-increment: rk; }
.rk-card li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-card li > span:first-child::before { content: counter(rk); display: inline-block; width: 16px; color: var(--muted); font-size: 12px; }
.rk-card li b a { color: var(--navy); }
.rk-card li .v { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.rk-card .more { margin-top: auto; font-size: 13.5px; font-weight: 600; color: var(--gold-2); text-decoration: none; }
.rk-card .more:hover { text-decoration: underline; }
.rk-page .quick.big-chips a span { font-weight: 500; margin-left: 2px; }

@media (max-width: 960px) {
  .rk-leaders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rk-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px 20px; padding: 0 16px 6px; scrollbar-width: none; }
  .rk-tabs::-webkit-scrollbar { display: none; }
  .rk-tabs a { flex: none; }
  .rk-leaders { grid-template-columns: minmax(0, 1fr); }
  .rk-sector, .rk-sector select { width: 100%; }
  .rtable { min-width: 640px; }
  .rtable th.rk, .rtable td.rk { width: 34px; min-width: 34px; padding-left: 4px; padding-right: 6px; }
  .rtable .fund { left: 34px; min-width: 140px; }
  .rtable td small { max-width: 150px; }
  .rk-board .rk-h { font-size: 21px; }
}
