/* Markets, sectors, short interest and companies pages (otr_biz/sections/markets.py, sectors.py,
   short_interest.py, companies.py; helpers in _mkt.py). Tokens and shared classes come from biz.css;
   this file only adds what these pages need, in On the record's manner (DESIGN.md). */

/* The dated line under the page head (On the record's .updated) */
.mk-stamp { margin-top: -28px; margin-bottom: 28px; }
.mk-stamp p { margin: 0; font-size: 14px; color: var(--quiet); max-width: 110ch; }
.mk-stamp a { color: var(--cite); }
.pg.has-rail > main .mk-stamp { padding: 0; }

/* Section links (On the record's .subnav) */
.mk-subnav { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin-bottom: 48px; }
.mk-subnav .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.mk-subnav .wrap::-webkit-scrollbar { display: none; }
.mk-subnav a { text-decoration: none; color: var(--quiet); }
.mk-subnav a:hover, .mk-subnav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.pg.has-rail > main .mk-subnav .wrap { padding-left: 0; padding-right: 0; }

/* Text tabs between sibling ranking pages (On the record's .lb-tabs) */
.mk-tabs { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 22px; font-size: 15px; font-weight: 600; }
.mk-tabs a { text-decoration: none; color: var(--quiet); }
.mk-tabs a:hover, .mk-tabs a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.mk-tabs .k { color: var(--quiet); font-weight: 400; }

/* Group label over a preview list or table */
.mk-h3 { font-size: 16px; font-weight: 800; letter-spacing: 0; margin: 0 0 8px; }
.mk-h3 a { text-decoration: none; }
.mk-h3 a:hover { text-decoration: underline; }
.mk-h3 + .note { margin: -4px 0 10px; }
.mk-see { margin: 12px 0 0; font-size: 15px; }
.mk-cols { row-gap: 40px; }

/* Ranking tools: filter, selects, count, CSV */
.mk-tools { align-items: flex-end; margin-bottom: 16px; }
.mk-tools .mk-count { margin: 0 0 8px; }
.mk-csv { margin: 0 0 8px auto; font-size: 15px; font-weight: 800; text-decoration: underline; text-decoration-thickness: 1px; }
.mk-csv:hover { text-decoration-thickness: 2px; }
.mk-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 18px 0 0; }
.mk-more .note { margin: 0; }

/* Preview tables: short, so their heads don't need to stick */
.mk-prev .tbl thead th { position: static; }
.mk-prev .tbl td { padding-top: 9px; padding-bottom: 9px; }
.tbl td .tk { font-size: 12px; }
.tbl .sm .chg { font-size: 13px; }

/* Rank numbers in ranking tables */
.tbl td.rk, .tbl .rk { font-weight: 800; }

/* Diverging bars: a return per row, centered on zero (On the record's .hbars) */
.mk-bars { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.mk-bars li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 4.6rem; gap: 4px 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rail); font-size: 15px; }
.mk-bars .nm { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-bars a.nm:hover { text-decoration: underline; }
.mk-bars .track { position: relative; height: 14px; background: var(--wash); }
.mk-bars .track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--ink); }
.mk-bars .fill { position: absolute; top: 0; bottom: 0; background: var(--up); }
.mk-bars .fill.down { background: var(--down); }
.mk-bars .val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.mk-bars .val.up { color: var(--up); }
.mk-bars .val.down { color: var(--down); }
.mk-bars-cap { margin: 8px 0 0; font-size: 13px; color: var(--quiet); }

/* The long chart */
.mk-chart { border-bottom: 1px solid var(--ink); }
.mk-chart .lc { height: 320px; }
.mk-chart-cap { margin: 8px 0 0; font-size: 13px; color: var(--quiet); }

/* Index strip: the tape's wash band */
.mk-tape { background: var(--wash); border-top: 2px solid var(--ink); }
.mk-tape .ixs { border-top: 0; gap: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mk-tape .ixs a { padding: 12px 14px 14px; border-bottom: 0; border-right: 1px solid var(--paper); }
.mk-tape .ixs .px { font-size: 18px; }
.mk-tape-note { margin: 8px 0 28px; font-size: 13px; color: var(--quiet); }

/* Feeds: one line of figures under each item */
.feed .what b { font-weight: 800; }
.feed .what .chg { font-size: 15px; }
.mk-feed-empty { margin: 0; padding: 12px 0; border-top: 2px solid var(--ink); color: var(--quiet); }

/* Ranked compact lists with a figure on the right */
.rank .v .chg { font-weight: 800; }

/* Directory of related pages at the foot of a hub (On the record's .lb-hub) */
.mk-dir { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mk-dir a b { font-size: 22px; }

/* Explanations */
.mk-explain p { margin: 6px 0 0; font-size: 16px; line-height: 1.5; max-width: 64ch; }
.mk-explain > div { border-top: 2px solid var(--ink); padding-top: 12px; }

@media (max-width: 1200px) {
  .mk-dir { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .mk-dir { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .mk-stamp { margin-top: -16px; margin-bottom: 20px; }
  .mk-stamp p { font-size: 13px; }
  .mk-subnav { margin-bottom: 36px; }
  .mk-subnav .wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mk-tools .mk-find { width: 100%; }
  .mk-csv { margin-left: 0; }
  .mk-bars li { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 4.2rem; gap: 4px 10px; font-size: 14px; }
  .mk-chart .lc { height: 240px; }
  .mk-dir { grid-template-columns: minmax(0, 1fr); }
  .mk-tape .ixs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-tape .ixs a { padding: 10px 10px 12px; }
  .tbl .rk { width: 1%; }
}

/* A percentage as the big number in a facts row (shell.stats with shell.pct) */
.facts dd > .chg:only-child { font-size: inherit; letter-spacing: inherit; margin-left: 0; font-weight: 800; }
