/* AFT Trading Bots: the Strategies page. Loads after /style.css and ../bots.css and uses their tokens.
   One table at every width: on a phone it scrolls sideways inside its own frame with the Strategy column frozen.
   The filters sit behind one button: a sheet on phones, a panel above the table from 900 px. */

.bx-s-head{padding:34px 0 24px;border-bottom:1px solid var(--line);background:var(--bg2)}
.bx-s-head h1{max-width:900px;margin-bottom:12px;font-size:clamp(34px,5vw,54px)}
.bx-s-head .bx-kicker a{color:inherit}
/* Row E816: on phones the link above the title and the one in the closing line get a 30 px tap height from padding (the type is unchanged) */
@media(max-width:559.98px){.bx-s-head .bx-kicker a,.bots[data-page="strategies"] .bx-fine a{padding-top:7px;padding-bottom:7px}}
.bx-s-lead{max-width:760px;margin:0;color:var(--text);font-size:18px}
.bx-s-note{max-width:760px;margin:12px 0 0;color:var(--dim);font-size:14.5px}
@media(min-width:900px){.bx-s-head{padding:56px 0 36px}}

.bx-list{padding:20px 0 44px}
.bx-list .wrap{position:relative}

/* the search box, the Filter button, the count */
.bx-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
.bx-search{display:block;min-width:0}
.bx-search input,.bx-fld select,.bx-rng input{width:100%;min-height:46px;padding:0 12px;border:1px solid var(--line2);border-radius:8px;background:var(--panel);
  color:var(--bright);font:16px/1.2 var(--sans)}
.bx-search input::placeholder,.bx-rng input::placeholder{color:var(--faint);opacity:1}
.bx-f-btn{min-height:46px;padding:0 14px;font-size:15px;white-space:nowrap}
.bx-f-n{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;margin-left:8px;padding:0 6px;border-radius:999px;background:var(--bright);color:#0e0f16;font-size:13px;font-weight:700}
.bx-f-n[hidden]{display:none}
.bx-count{grid-column:1/-1;margin:2px 0 0;color:var(--dim);font-size:14.5px}
/* Row E827: the count keeps its one line before strategies.js writes it, so nothing under it moves when it does */
.bx-count:empty::before{content:"\00a0"}

/* the filters: a sheet on phones */
.bx-fback{position:fixed;inset:0;z-index:65;background:rgba(6,7,12,.72)}
.bx-fback[hidden]{display:none}
.bx-filters{position:fixed;left:0;right:0;bottom:0;z-index:70;display:none;flex-direction:column;max-height:88vh;max-height:88dvh;
  background:var(--bg2);border-top:1px solid var(--line2);border-radius:14px 14px 0 0}
.bx-filters.is-open{display:flex}
.bx-f-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line)}
.bx-f-head h2{margin:0;font-size:21px}
.bx-f-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px 16px;overflow-y:auto;overscroll-behavior:contain}
.bx-f-foot{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line)}
.bx-fld{display:block;min-width:0}
.bx-fld span,.bx-rng legend{display:block;margin:0 0 5px;padding:0;color:var(--dim);font-size:14px;font-weight:500}
.bx-rng{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0;margin:0;padding:0;border:0}
.bx-rng legend{float:left;grid-column:1/-1;width:100%}

@media(min-width:900px){
  .bx-tools{grid-template-columns:minmax(0,420px) auto minmax(0,1fr)}
  .bx-f-head,.bx-fback{display:none!important}
  .bx-count{grid-column:auto;margin:0;text-align:right}
  .bx-filters{position:static;z-index:auto;max-height:none;margin-top:14px;padding:14px 16px;background:var(--panel);border:1px solid var(--line);border-radius:10px}
  .bx-filters.is-open{display:block}
  .bx-f-body{grid-template-columns:repeat(20,minmax(0,1fr));padding:0;overflow:visible}
  .bx-fld{grid-column:span 10}
  .bx-rng{grid-column:span 4;align-content:start}
  .bx-rng legend{min-height:36px}
  .bx-search input,.bx-fld select,.bx-rng input{min-height:40px;background:var(--bg2);font-size:15px}
  .bx-search input{background:var(--panel)}
  .bx-rng input{padding:0 8px}
  .bx-f-foot{display:flex;justify-content:flex-end;padding:10px 0 0;border-top:0}
  .bx-f-clear,.bx-f-done{min-height:36px;padding:0 14px;font-size:14px}
}

/* the table: its own frame scrolls sideways; the page never does */
.bx-tw{position:relative;container-type:inline-size;margin:14px 0 0;border:1px solid var(--line);border-radius:10px;background:var(--panel);overflow-x:auto;-webkit-overflow-scrolling:touch}
.bx-tw[hidden]{display:none}
.bx-tw:focus-visible{outline:2px solid var(--bright);outline-offset:2px}
.bx-table{width:100%;min-width:1090px;border-collapse:separate;border-spacing:0;font-size:14.5px;font-variant-numeric:tabular-nums}
.bx-table th,.bx-table td{padding:8px 10px;border-bottom:1px solid var(--line);background:var(--panel);color:var(--bright);font-weight:500;text-align:right;white-space:nowrap;vertical-align:middle}
.bx-table tbody tr:last-child > *{border-bottom:0}

/* the headings: real buttons that sort */
.bx-table thead th{padding:0;background:var(--bg2);vertical-align:bottom}
.bx-table thead button{display:block;width:100%;min-height:48px;padding:8px 10px;border:0;background:none;color:var(--dim);font:500 13px/1.25 var(--sans);text-align:inherit;white-space:normal;cursor:pointer}
.bx-table thead button:hover,.bx-table thead th.is-on button{color:var(--bright)}
.bx-table thead button:focus-visible{outline:2px solid var(--bright);outline-offset:-2px}
.bx-table thead small{display:block;margin-top:2px;color:var(--faint);font-size:11.5px;font-weight:400;line-height:1.25}
.bx-arrow{white-space:nowrap}
.bx-table .bx-h-inst,.bx-table .bx-h-tier,.bx-table .bx-c-inst,.bx-table .bx-c-tier{text-align:left}
.bx-table thead .bx-h-fq small{white-space:nowrap}
/* row E815: "Return on drawdown" stays on one line */
.bx-table thead .bx-h-rod .bx-h-t{white-space:nowrap}
/* from 1180 px the frame stops growing and the whole table must fit in it: slightly narrower cell padding (row E815: 5 px,
   was 7, so the one-line "Return on drawdown" head fits with any column sorted) */
@media(min-width:1180px){
  .bx-table th,.bx-table td,.bx-table thead button{padding-left:5px;padding-right:5px}
  .bx-table .bx-h-name,.bx-table .bx-c-name{padding:0}
  .bx-r-open{padding-left:8px;padding-right:8px}
}

/* the Strategy column stays in place while the rest scrolls */
.bx-table .bx-h-name,.bx-table .bx-c-name{position:sticky;left:0;z-index:2;padding:0;text-align:left;box-shadow:1px 0 0 var(--line2);scroll-margin-top:84px}
.bx-r-open{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:48px;padding:6px 10px;border:0;background:none;color:inherit;text-align:left;cursor:pointer}
.bx-r-open:focus-visible{outline:2px solid var(--bright);outline-offset:-2px}
.bx-r-open .bx-sname.bx-wm{font-size:12.5px;letter-spacing:.05em}
.bx-r-chev{flex:none;color:var(--dim);font-size:18px;line-height:1;transition:transform .15s ease}
.bx-row.is-open .bx-r-chev{transform:rotate(90deg)}
@media(prefers-reduced-motion:reduce){.bx-r-chev{transition:none}}
@media(min-width:640px){.bx-r-open .bx-sname.bx-wm{font-size:14px;letter-spacing:.08em}}

.bx-row{cursor:pointer}
.bx-row:hover > *,.bx-row.is-open > *{background:var(--bg2)}
.bx-row .bx-tier{font-size:12.5px}
.bx-c-price b{font-family:var(--display);font-size:16px;font-weight:700}
.bx-c-price small{color:var(--dim);font-size:12.5px}
.bx-c-price .is-none{color:var(--dim);font-size:13.5px;font-weight:400}
/* Row E832: a released strategy's free trial, read before its price ("14 days free, then $97 a month"), and over the
   button in its open card */
.bx-c-price .bx-r-trial{display:block;margin:0 0 1px;color:var(--text);font-size:12px;font-weight:600}
.bx-c-trial{margin:0;color:var(--bright);font-size:15px;font-weight:600;line-height:1.4}

/* the card under a row: it keeps to the frame's width while the table under it is wider */
.bx-table .bx-det > td{padding:0;background:var(--bg2);text-align:left;white-space:normal}
.bx-card{position:sticky;left:0;box-sizing:border-box;display:grid;gap:12px;width:100cqw;padding:14px 12px 16px;font-weight:400}
.bx-c-rec{container-type:inline-size;min-width:0}
.bx-card .bx-first{min-height:0}
.bx-card .bx-chart{flex:none;height:clamp(190px,32cqw,340px);max-height:none}
@container (max-width:339.98px){
  .bx-card .bx-kpis,.bx-card .bx-kpis.is-long{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px}
  .bx-card .bx-months{grid-template-columns:repeat(3,minmax(0,1fr))}
}
.bx-c-none{margin:0;padding:14px;border:1px dashed var(--line2);border-radius:10px;background:var(--panel);color:var(--dim);font-size:15.5px}
.bx-c-rec .bx-note{margin:0}
.bx-c-hyp{margin:0;color:var(--dim);font-size:13.5px;line-height:1.4}
.bx-r-btn{width:100%;min-height:44px;padding:8px 12px;font-size:15px}
span.bx-r-btn{color:var(--dim);cursor:default}
@media(min-width:640px){.bx-r-btn{width:220px}}

/* the date line: on screen above the table at every width */
.bx-asof{margin:12px 0 -4px;color:var(--text);font-size:14px;line-height:1.4}
/* Row E827: until the table's heading and lines are drawn (strategies.js, with the catalog), its frame keeps a screen's
   height, so what stands under it is out of view while they arrive and does not move into view (layout shift) */
@media (scripting:enabled){.bx-tw:has(#t-head:empty){min-height:100vh}}
/* Row E827: below 1180px the dates take one line more than the words before them; the line keeps that room until
   strategies.js writes the dates */
@media (scripting:enabled) and (max-width:1179.98px){.bx-asof:has(#as-of-upd:empty)::after{content:"\00a0";display:block}}

/* the hint while the table is wider than its frame */
.bx-swipe{margin:12px 0 -6px;color:var(--dim);font-size:13.5px}
@media(min-width:1180px){.bx-swipe{display:none}}

/* under the table */
.bx-t-notes{display:grid;gap:4px;margin:10px 0 0}
.bx-t-notes[hidden]{display:none}
.bx-t-notes p{margin:0;color:var(--dim);font-size:13.5px;line-height:1.4}
.bx-t-notes p[hidden]{display:none}
.bx-empty{margin:16px 0 0;padding:26px 16px;border:1px dashed var(--line2);border-radius:10px;text-align:center}
.bx-empty[hidden]{display:none}
.bx-empty p{margin:0 0 12px;color:var(--text)}

/* the full-screen strategy view of bots.js is not used here: a strategy opens as a card in the table */
.bots[data-page="strategies"] .bx-sheet,.bots[data-page="strategies"] .bx-backdrop{display:none!important}
/* the pinned bar belongs to the tier cards and shows only while they are on screen */
.bots[data-page="strategies"] .bx-bar{display:none}
.bots[data-page="strategies"].bx-bar-on .bx-bar{display:block}

.bots[data-page="strategies"] .bx-plans{border-top:1px solid var(--line)}

/* phones: instrument and tier stand under the name, so the first stat is on screen beside the frozen column */
.bx-r-id{display:grid;gap:3px;min-width:0}
/* Row E758: in the Library the tag goes under the name when both do not fit, so the name is never cut by it */
.bx-r-open .bx-nt{flex-wrap:wrap;row-gap:3px}
.bx-r-sub,.bx-h-more{display:none}
@media(max-width:767.98px){
  .bx-table{width:max-content;min-width:100%}
  .bx-table .bx-h-inst,.bx-table .bx-h-tier,.bx-table .bx-c-inst,.bx-table .bx-c-tier{display:none}
  .bx-r-sub{display:block;color:var(--dim);font-size:12.5px;font-weight:400;white-space:nowrap}
  .bx-h-more{display:flex;gap:2px;padding:0 4px 4px}
  .bx-table thead .bx-h-more button{width:auto;min-height:36px;padding:4px 6px;font-size:12px;white-space:nowrap}
  .bx-table thead th.is-on .bx-h-more button:not(.is-on){color:var(--dim)}
  .bx-table thead .bx-h-more button.is-on{color:var(--bright)}
  /* Collin 2026-11-23 (his phone): the frozen Strategy column took two thirds of the frame, so the figures were off the
     screen. On phones it is 136 px: the name one line in smaller type, the Coming soon tag on its own line under it,
     the sort buttons for instrument and plan on two lines if they need them; the figures start beside it. */
  .bx-table .bx-h-name,.bx-table .bx-c-name{width:136px;min-width:136px;max-width:136px}
  .bx-r-open{gap:4px;padding:6px 6px 6px 8px}
  .bx-r-open .bx-sname.bx-wm{font-size:10.5px;letter-spacing:.02em}
  .bx-r-open .bx-nt{flex-direction:column;align-items:flex-start}
  .bx-r-open .bx-cs{font-size:11px;padding-top:1px;padding-bottom:1px}
  .bx-r-sub{font-size:12px}
  .bx-h-more{flex-wrap:wrap}
  .bx-r-chev{font-size:16px}
}
