/* 0.52.0: /compare and /compare/side. Every class here starts with cx- and is used nowhere else (tests/test_v0520.py checks
   that no other stylesheet defines one of them). Colours and fonts come from the site's own variables. */

/* ---- account-size chips */
.cx-chips { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; min-width: 0; }
.cx-chips-l { flex: none; font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cx-chip-row { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.cx-chip-row::-webkit-scrollbar { display: none; }
.cx-chip { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2, var(--line));
  background: var(--surface); color: var(--ink-2); font-size: .85rem; font-weight: 640; text-decoration: none; white-space: nowrap; }
.cx-chip:hover { border-color: var(--accent); color: var(--ink); }
.cx-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cx-chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--night); font-weight: 750; }
.cx-nosize { margin-left: 10px; color: var(--muted); }

/* ---- the table */
.cx-wrap { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); max-width: 100%; }
.cx-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .88rem; color: var(--ink-2); }
.cx-table thead th { height: 44px; padding: 0 8px; text-align: left; white-space: normal; line-height: 1.15; overflow: hidden;
  font: 650 .66rem var(--mono); letter-spacing: .02em; text-transform: uppercase; color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--line); }
.cx-table thead th:first-child { border-top-left-radius: 13px; }
.cx-table thead th:last-child { border-top-right-radius: 13px; }
.cx-table thead th.cx-num { text-align: right; }
.cx-table thead a.cx-sort { color: inherit; text-decoration: none; padding: 0; }
.cx-table thead a.cx-sort::after { content: none; }
.cx-table td.cx-num { padding-right: 16px; }
.cx-table thead th.cx-num { padding-right: 16px; }
.cx-table td.cx-roic, .cx-table th.cx-roic, .cx-table td.cx-c-split, .cx-table th.cx-c-split { padding-right: 8px; }
.cx-table thead a.cx-sort:hover { color: var(--ink); }
.cx-table thead th[aria-sort="ascending"] a.cx-sort::after { content: " \25B2"; font-size: .6rem; }
.cx-table thead th[aria-sort="descending"] a.cx-sort::after { content: " \25BC"; font-size: .6rem; }
.cx-pick { width: 34px; padding: 0 0 0 12px !important; }
.cx-firmcol { width: 196px; }
.cx-table thead .cx-size, .cx-table td.cx-size { width: 62px; }
.cx-steps { width: 66px; }
.cx-maxcol { width: 172px; }
.cx-pricecol { width: 128px; }
.cx-actcol { width: 136px; }
.cx-table thead th.cx-c-tgt { width: 104px; } .cx-table thead th.cx-c-dly { width: 88px; }
.cx-table thead th.cx-c-split { width: 58px; }
.cx-table thead th.cx-c-days { width: 96px; }
.cx-table thead th.cx-roic { width: 84px; }
.cx-table tbody td, .cx-table tbody th { height: 62px; padding: 0 8px; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; }
.cx-table tbody td.cx-pick { padding-left: 12px; }
.cx-table td.cx-roic, .cx-table th.cx-roic { padding-right: 14px; }
.cx-table tbody tr.cx-row:hover > * { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.cx-table tbody tr.cx-open > * { border-bottom-color: transparent; }
.cx-table td.cx-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.cx-table td.cx-size, .cx-table td.cx-steps { color: var(--ink-2); }
.cx-pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); vertical-align: middle; }
.cx-pk-t { display: none; }
.cx-firm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cx-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cx-fn, .cx-pn { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-fn { color: var(--ink); font-weight: 650; text-decoration: none; }
.cx-pn { color: var(--muted); font-size: .78rem; text-decoration: none; }
.cx-fn:hover, .cx-pn:hover { text-decoration: underline; }
.cx-maxc { white-space: nowrap; }
.cx-maxv { color: var(--ink); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.cx-pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line-2, var(--line));
  background: var(--surface-2); color: var(--ink-2); font-weight: 650; font-size: .74rem; line-height: 1; font-family: inherit; cursor: help; vertical-align: middle; white-space: nowrap; }
.cx-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cx-pill-eod { color: var(--cyan, #38bdf8); border-color: color-mix(in srgb, var(--cyan, #38bdf8) 45%, transparent); background: color-mix(in srgb, var(--cyan, #38bdf8) 12%, transparent); }
.cx-pill-intraday { color: var(--pink); border-color: color-mix(in srgb, var(--pink) 45%, transparent); background: color-mix(in srgb, var(--pink) 12%, transparent); }
.cx-pill-trailing_unknown { color: var(--amber); border-color: var(--amber-line); background: var(--amber-bg); }
.cx-pill-unknown { color: var(--muted); }
.cx-px { display: inline; }
.cx-px[hidden] { display: none; }
.cx-now { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.cx-was { color: var(--muted); font-size: .78rem; margin-left: 4px; }
.cx-off { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); }
.cx-muted { color: var(--muted); font-size: .82rem; font-weight: 500; }
.cx-pricec { text-align: right !important; }
.cx-table thead th.cx-pricecol { text-align: right; }
.cx-table tr[hidden], .cx-detail[hidden] { display: none; }

/* actions: one Details button and the ... menu */
.cx-act { overflow: visible !important; text-align: right !important; position: relative; }
.cx-details { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2, var(--line));
  background: var(--surface-2); color: var(--ink); font-weight: 650; font-size: .85rem; text-decoration: none; cursor: pointer; vertical-align: middle; }
.cx-details:hover { border-color: var(--accent); }
.cx-details:focus-visible, .cx-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cx-details svg { transition: transform .15s; }
.cx-details[aria-expanded="true"] { border-color: var(--ink-2); }
.cx-details[aria-expanded="true"] svg { transform: rotate(180deg); }
.cx-menu { display: inline-block; position: relative; margin-left: 6px; vertical-align: middle; }
.cx-more { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line-2, var(--line)); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.cx-more::-webkit-details-marker { display: none; }
.cx-menu[open] .cx-more { border-color: var(--ink-2); }
.cx-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 264px; padding: 6px; text-align: left; white-space: normal;
  background: var(--surface-2); border: 1px solid var(--line-2, var(--line)); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); }
.cx-pop a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.cx-pop a:hover, .cx-pop a:focus-visible { background: var(--surface); outline: none; }
.cx-pop b { display: block; font-size: .88rem; }
.cx-pop span { display: block; margin-top: 1px; font-size: .76rem; color: var(--muted); }
.cx-pop .cx-aff { display: inline; margin: 0 0 0 4px; font-size: .68rem; color: var(--amber); }

/* the opened row */
.cx-detail > td { padding: 18px 22px 22px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: normal; overflow: visible; }
.cx-dgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.cx-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.cx-rules li { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--line-2, var(--line)); }
.cx-rl { color: var(--muted); font-size: .84rem; }
.cx-rv { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.cx-rc { grid-column: 2; margin-top: 3px; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.cx-rc a { color: var(--ink-2); }
.cx-rc + .cx-rc { margin-top: 2px; }
.cx-aside { min-width: 0; }
.cx-h { margin: 0 0 8px; font: 650 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cx-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.cx-szchip { padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line-2, var(--line)); font-size: .78rem; color: var(--ink-2); }
.cx-next { display: block; margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2, var(--line)); background: var(--surface);
  color: var(--ink); text-decoration: none; }
.cx-next:hover { border-color: var(--accent); }
.cx-next b { display: block; font-size: .88rem; }
.cx-next span { display: block; margin-top: 2px; font-size: .78rem; color: var(--muted); }
.cx-next .cx-aff { display: inline; font-size: .68rem; color: var(--amber); }
.cx-fine { margin: 8px 0 0; font-size: .74rem; color: var(--muted); }

/* the tooltip */
.cx-tip { position: fixed; z-index: 100; max-width: 300px; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--night);
  font-size: .8rem; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); pointer-events: none; }
.cx-tip[hidden] { display: none; }

/* narrower screens: the less important columns go (they are in the opened row), then cards */
@media (max-width: 1279px) { .cx-c-split, .cx-c-days { display: none; } }
@media (max-width: 1159px) { .cx-c-steps, .cx-roic { display: none; } .cx-firmcol { width: 200px; } .cx-detail > td { padding: 16px; } }

@media (max-width: 1000px) {
  .cx-dgrid { grid-template-columns: 1fr; gap: 18px; }
  .cx-wrap { border: 0; background: none; border-radius: 0; }
  .cx-table, .cx-table tbody { display: block; }
  .cx-table thead { display: none; }
  .cx-c-split, .cx-c-days, .cx-c-steps, .cx-roic { display: block; }
  .cx-table tr.cx-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 8px; row-gap: 12px; margin: 0 0 10px; padding: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    grid-template-areas: "firm firm price" "tgt dly max" "stp spl day" "siz roi ." "pick act act"; }
  .cx-table tr.cx-row.cx-open { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
  .cx-table tr.cx-row:hover > * { background: none; }
  .cx-table tbody td, .cx-table tbody th { display: block; height: auto; padding: 0; border: 0; min-width: 0; font-size: .95rem; text-align: left !important; }
  .cx-table tbody td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font: 650 .66rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .cx-firmcell { grid-area: firm; align-self: center; }
  .cx-table td.cx-pricec { grid-area: price; text-align: right !important; overflow: visible; }
  .cx-table td.cx-pricec::before { display: none; }
  .cx-pricec .cx-px { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; }
  .cx-pricec .cx-px[hidden] { display: none; }
  .cx-pricec .cx-now { flex-basis: 100%; font-size: 1.15rem; text-align: right; }
  .cx-table td[data-label="Target"] { grid-area: tgt; }
  .cx-table td[data-label="Daily loss"] { grid-area: dly; }
  .cx-table td.cx-maxc { grid-area: max; white-space: normal; overflow: visible; }
  .cx-maxc .cx-maxv { display: block; margin: 0 0 5px; }
  .cx-table td.cx-c-steps { grid-area: stp; }
  .cx-table td.cx-c-split { grid-area: spl; }
  .cx-table td.cx-c-days { grid-area: day; }
  .cx-table td.cx-size { grid-area: siz; width: auto; }
  .cx-table td.cx-roic { grid-area: roi; }
  .cx-table td.cx-pick { grid-area: pick; align-self: center; padding: 0; }
  .cx-pick .cx-pickl { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); cursor: pointer; }
  .cx-pk-t { display: inline; }
  .cx-table td.cx-act { grid-area: act; justify-self: end; }
  .cx-table tr.cx-detail:not([hidden]) { display: block; margin: 0 0 10px; background: var(--surface-2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; }
  .cx-table tr.cx-detail > td { display: block; padding: 14px; border: 0; }
  .cx-rules { grid-template-columns: 1fr; }
  .cx-rules li { grid-template-columns: 1fr; row-gap: 2px; }
  .cx-rc { grid-column: 1; }
  .cx-pop { width: min(264px, calc(100vw - 64px)); }
}
@media (max-width: 640px) {
  .cx-chips { flex-direction: column; align-items: stretch; gap: 6px; }
  .cx-nosize { display: block; margin: 4px 0 0; }
}

/* ---- side by side */
.cx-sbs-wrap { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow-x: auto; max-width: 100%; margin: 0 0 18px; }
.cx-sbs { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .92rem; color: var(--ink-2); }
.cx-sbs.cx-cols-2 { min-width: 520px; } .cx-sbs.cx-cols-3 { min-width: 720px; } .cx-sbs.cx-cols-4 { min-width: 900px; }
.cx-sbs thead th { padding: 14px 16px; text-align: left; background: var(--surface-2); border-bottom: 1px solid var(--line); vertical-align: bottom; }
.cx-sbs thead th:first-child { width: 160px; }
.cx-sbs tbody th, .cx-sbs tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.cx-sbs tbody tr:last-child > * { border-bottom: 0; }
.cx-sbs tbody th { color: var(--muted); font-weight: 600; font-size: .86rem; }
.cx-sbs td.cx-win { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); color: var(--ink); font-weight: 750; }
.cx-tag { margin-left: 6px; font: 700 .62rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.cx-sbs-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cx-sbs-head a { display: block; color: var(--ink); font-weight: 650; text-decoration: none; }
.cx-sbs-head span { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; }
.cx-sbs-note { margin: 0 0 22px; font-size: .84rem; color: var(--muted); }
.cx-sbs tr.cx-act-row td { padding: 14px 16px; }
.cx-sbs-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-sbs-h { margin: 26px 0 10px; font-size: 1.1rem; color: var(--ink); }

/* detail row: allow normal wrapping inside the expanded panel */
.cx-detail > td, .cx-detail > td * { white-space: normal; text-overflow: clip; }
.cx-detail .cx-rules li > * { min-width: 0; overflow-wrap: anywhere; }
.cx-dgrid { width: 100%; }

/* side-by-side on a phone: the rule name sits above, the firms sit next to each other, no sideways scroll */
@media (max-width: 640px) {
  .cx-sbs-wrap { overflow-x: visible; }
  .cx-sbs, .cx-sbs.cx-cols-2, .cx-sbs.cx-cols-3, .cx-sbs.cx-cols-4 { min-width: 0; display: block; }
  .cx-sbs thead, .cx-sbs tbody { display: block; }
  .cx-sbs thead tr { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
  .cx-sbs.cx-cols-3 thead tr, .cx-sbs.cx-cols-3 tbody tr { --n: 3; }
  .cx-sbs.cx-cols-4 thead tr, .cx-sbs.cx-cols-4 tbody tr { --n: 4; }
  .cx-sbs thead th:first-child { display: none; }
  .cx-sbs thead th { padding: 10px 8px; }
  .cx-sbs-head { flex-direction: column; align-items: flex-start; gap: 6px; font-size: .8rem; }
  .cx-sbs tbody tr { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
  .cx-sbs tbody tr:last-child { border-bottom: 0; }
  .cx-sbs tbody th { grid-column: 1 / -1; padding: 8px 8px 0; border: 0; font-size: .74rem; }
  .cx-sbs tbody td { padding: 4px 8px 10px; border: 0; font-size: .86rem; }
  .cx-sbs tr.cx-act-row th { display: none; }
  .cx-sbs-btns { flex-direction: column; align-items: stretch; }
  .cx-sbs-btns a { text-align: center; padding: 10px 8px; font-size: .8rem; }
}
