/* The figures table of a Moscow Exchange company page and /moex/compare/ (pipeline/pages/moexfig.py,
   js/moexfig.js). The table itself is .stk-table of css/stocks.css: figures in rows, years in columns,
   the first column stays in place while the years scroll. */
.mf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; }
.mf-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-left: auto; }
.mf-go { font-weight: 600; font-size: 15.5px; text-decoration: none; }
.mf-go:hover { text-decoration: underline; }
.mf-csv { font: 600 14.5px/1 var(--font); color: var(--ink); background: var(--track); border: 0; border-radius: 999px; padding: 10px 15px; cursor: pointer; }
.mf-csv:hover { background: var(--hover); }
.mf-csv:focus-visible, .mf-chip button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mf-csv[hidden], .mf-go[hidden] { display: none; }

.mf-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mf-table thead th:first-child { position: sticky; left: 0; z-index: 2; text-align: left; }
.mf-table th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); color: var(--ink); font-weight: 500;
  text-align: left; white-space: normal; min-width: var(--mf-first, 200px); max-width: 280px; line-height: 1.3; }
.mf-table thead th:first-child, .mf-table th[scope="row"] { box-shadow: 1px 0 0 var(--border); }   /* the edge the years slide under */
.mf-table tbody tr:hover th[scope="row"] { background: var(--hover); }
.mf-table th[scope="row"] a { font-weight: 600; text-decoration: none; }
.mf-table th[scope="row"] a:hover { text-decoration: underline; }
.mf-table th[scope="row"] .sw-sq { margin-right: 8px; }
.mf-table .mf-grp, .mf-table .mf-grp:hover { background: none; border-bottom: 0; }
.mf-table .mf-grp th { text-align: left; padding-top: 18px; padding-bottom: 4px;
  font: 600 12.5px/1.3 var(--font); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
/* the heading of a group stays in sight while the years scroll under it */
.mf-table .mf-grp th span { position: sticky; left: 8px; display: inline-block; }
/* a year column: at least --mf-min wide; where the years scroll, js/moexfig.js gives each the same share of
   the room beside the first column (--mf-col), and a column snaps to the edge of the first one */
.mf-table { --mf-min: 76px; }
.mf-table td, .mf-table thead th + th { min-width: var(--mf-col, var(--mf-min)); width: var(--mf-col, auto); }
.mf-wrap { scroll-snap-type: x proximity; }
.mf-table tbody td { scroll-snap-align: start; }
.mf-na, .mf-table.is-chg td[data-c="—"] { color: var(--muted); }
.mf-table:not(.is-chg) .mf-neg { color: var(--bad); }
.mf-table.is-chg td[data-s="1"] { color: var(--good); }
.mf-table.is-chg td[data-s="-1"] { color: var(--bad); }
.mf-docs td a { display: inline-block; padding: 2px; color: var(--accent-ink); }
.mf-docs td a:hover { color: var(--ink); }
.mf-doc { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* /moex/compare/: the companies picked, the field that adds one, the chart */
.mf-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 22px 0 14px; }
.mf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mf-chips:empty { display: none; }
.mf-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow);
  padding: 7px 7px 7px 15px; font: 600 15.5px/1.2 var(--font); color: var(--ink); }
.mf-chip small { color: var(--muted); font-size: 13px; font-weight: 500; }
.mf-chip button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--track); color: var(--ink-2); cursor: pointer; }
.mf-chip button:hover { background: var(--hover); color: var(--ink); }
.mf-chip button svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.mf-add { position: relative; flex: 1 1 280px; max-width: 430px; }
.mf-add .search { width: 100%; }
.mf-add .search:disabled { opacity: 0.55; }
.mf-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: min(400px, 60vh); overflow: auto; }
.mf-list[hidden] { display: none; }
.mf-list button { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 0;
  border-radius: 10px; background: none; color: var(--ink); font: 500 15.5px/1.3 var(--font); text-align: left; cursor: pointer; }
.mf-list button[aria-selected="true"], .mf-list button:hover { background: var(--hover); }
.mf-list small { color: var(--muted); font-size: 13px; }
.mf-list p { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 14.5px; }
.mf-max { margin: -4px 0 12px; }
.mf-metric[hidden] { display: none; }
.mf-metric { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.mf-metric select { min-width: 0; max-width: min(100%, 360px); font-size: 15.5px; padding: 10px 12px; text-overflow: ellipsis; }
.mf-fig { margin: 0 0 14px; }
.mf-fig[hidden] { display: none; }
.mf-fig .stk-plot { min-height: 300px; }
.mf-app > .note { margin-top: 10px; }
@media (max-width: 640px) {
  .mf-table th[scope="row"] { min-width: var(--mf-first, 132px); max-width: 168px; font-size: 13.5px; }
  .mf-table { --mf-min: 66px; }
  .mf-acts { margin-left: 0; }
}
