/* Historical Patterns Tools — shared styles for the 90% Trap, Is the Price Right and the hub.
   Loaded AFTER patterns.css. Prefix tx- so nothing here can collide with the older rules. */

/* ── the instrument card: controls + numbers + chart are ONE surface ─────── */
.tx-card{background:var(--bg3);border:1px solid var(--accent-border);border-radius:16px;overflow:hidden;margin:0 0 14px;
  box-shadow:0 18px 50px -24px rgba(76,29,149,.35),0 2px 6px rgba(17,24,39,.05);position:relative;}
.tx-ctl{padding:14px 20px 4px;}
.tx-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;}
.tx-lbl{font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--text3);}
.tx-val{font-family:var(--mono);font-size:clamp(24px,4vw,30px);font-weight:900;letter-spacing:-.04em;color:var(--accent);line-height:1;}
.tx-range{-webkit-appearance:none;appearance:none;width:100%;height:8px;border-radius:99px;margin:10px 0 4px;outline:none;cursor:pointer;
  background:linear-gradient(90deg,var(--accent-border),var(--accent));}
.tx-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:22px;height:22px;border-radius:50%;background:#fff;border:3px solid var(--accent);box-shadow:0 3px 10px rgba(76,29,149,.4);cursor:grab;}
.tx-range::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#fff;border:3px solid var(--accent);box-shadow:0 3px 10px rgba(76,29,149,.4);cursor:grab;}
.tx-range:focus-visible{outline:2px solid var(--accent);outline-offset:6px;}
.tx-scale{display:flex;justify-content:space-between;font-family:var(--mono);font-size:11px;color:var(--text3);padding:0 2px;margin-top:12px;margin-bottom:10px;} /* 12px clears the 22px thumb, which overhangs the 8px track */
.tx-chips{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:4px 0 14px;}
.tx-chips .tx-lbl{margin-right:2px;}
.tx-chip{appearance:none;cursor:pointer;font-family:var(--sans);font-size:12.5px;font-weight:700;color:var(--text2);background:var(--bg2);
  border:1px solid var(--border);border-radius:99px;padding:0 12px;min-height:34px;display:inline-flex;align-items:center;gap:6px;}
.tx-chip em{font-style:normal;font-family:var(--mono);font-size:11px;color:var(--text3);}
.tx-chip:hover{border-color:var(--accent-border);color:var(--accent);}
.tx-chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#fff;}
.tx-chip[aria-pressed="true"] em{color:rgba(255,255,255,.8);}
.tx-chip:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

.tx-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:0 20px 10px;}
.tx-tile{border:1px solid var(--border);border-radius:11px;padding:9px 12px;background:#fff;min-width:0;}
.tx-tile .k{display:block;font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--text3);margin-bottom:4px;}
.tx-tile b{display:block;font-family:var(--mono);font-size:clamp(18px,2.8vw,23px);font-weight:900;letter-spacing:-.04em;line-height:1.05;}
.tx-tile .s{display:block;font-size:11px;color:var(--text3);margin-top:3px;line-height:1.35;}
.tx-tile.w b{color:var(--ok);} .tx-tile.l b{color:var(--danger);} .tx-tile.e b.pos{color:var(--ok);} .tx-tile.e b.neg{color:var(--danger);}
/* time-left filter: one segmented control inside the instrument, always fully visible (no scrolling) */
.tx-timefilter{margin:12px 0 4px;}
.tx-timefilter .tx-lbl{display:block;margin-bottom:6px;}
.tx-seg{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:4px;background:var(--bg2);border:1px solid var(--border);border-radius:12px;}
.tx-seg .tx-chip{justify-content:center;min-width:0;min-height:36px;padding:0 6px;border:0;border-radius:9px;background:transparent;font-size:12.5px;text-align:center;line-height:1.15;flex-direction:column;gap:1px;}
.tx-seg .tx-chip em{font-size:10.5px;}
.tx-seg .tx-chip[aria-pressed="true"]{background:var(--accent);box-shadow:0 2px 6px -2px rgba(76,29,149,.5);}
.tx-chartbox{padding:0 12px 4px;}
.tx-chartbox .chart{width:100%;height:auto;display:block;}
.tx-legend{display:flex;flex-wrap:wrap;gap:6px 18px;padding:2px 20px 4px;font-size:11.5px;color:var(--text2);}
.tx-legend i{display:inline-block;width:18px;height:3px;border-radius:2px;vertical-align:middle;margin-right:6px;}
.tx-legend i.g{background:var(--ok);} .tx-legend i.r{background:var(--danger);}
.tx-cap{padding:2px 20px 12px;font-size:12.5px;line-height:1.5;color:var(--text2);margin:0;}
/* chart key sits in HTML, not inside the SVG, so it can never overlap circles */
.pr-key{display:flex;flex-wrap:wrap;gap:6px 16px;padding:4px 20px 6px;margin:0;font-size:11.5px;color:var(--text2);}
.pr-key span{display:inline-flex;align-items:center;gap:6px;}
.pr-key i{display:inline-block;width:9px;height:9px;border-radius:50%;}
.pr-key .k-up{background:#15803d;} .pr-key .k-dn{background:#b91c1c;} .pr-key .k-eq{background:#6b7280;}
.pr-key .k-sz{background:transparent;border:1.5px solid #6b7280;width:13px;height:13px;}
.tx-foot{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:10px 20px 14px;border-top:1px dashed var(--border);background:var(--bg2);}
.tx-foot .btn{min-height:38px;font-size:12.5px;padding:0 15px;border-radius:9px;}
.tx-foot .sp{flex:1;}
.tx-mark{position:absolute;right:16px;top:10px;font-family:var(--mono);font-size:10px;font-weight:800;color:rgba(109,40,217,.38);letter-spacing:.04em;pointer-events:none;}

.tx-aeo{max-width:720px;margin:0 auto 12px;font-size:13.5px;line-height:1.55;color:var(--text2);text-align:center;}
.tx-aeo b{color:var(--text);}
.tx-live{padding:6px 20px 8px;}
.tx-live .h{font-size:clamp(19px,3.2vw,26px);font-weight:900;letter-spacing:-.04em;line-height:1.1;margin:0 0 6px;color:var(--text);}
.tx-live .h b{color:var(--ok);}
.tx-live .s{font-size:13.5px;line-height:1.5;color:var(--text2);margin:0;}
.tx-base{padding:0 24px 14px;margin:0;font-size:12.5px;color:var(--text3);line-height:1.5;}
.tx-q{font-size:13.5px;font-weight:800;letter-spacing:-.01em;margin:12px 0 4px;color:var(--text);}
.tx-btnrow{margin:12px 0 0;display:flex;flex-wrap:wrap;gap:8px;}
.tx-trade .btn.trade,.tx-foot .btn.trade{white-space:nowrap;}
@media (max-width:760px){ .tx-base{padding:0 16px 12px;} .tx-foot .btn.trade{flex:1 1 100%;} .tx-foot .sp{display:none;} }
/* phone: the chart gets the room, the text steps back */
@media (max-width:480px){
  .tx-stage .tx-live{padding:4px 14px 6px;}
  .tx-live .h{font-size:18px;margin-bottom:4px;}
  .tx-live .s{font-size:12px;line-height:1.45;}
  .tx-legend{padding:2px 14px;font-size:10.5px;gap:4px 12px;}
  .tx-cap{padding:2px 14px 10px;font-size:11px;}
  .tx-chartbox{padding:0 6px 2px;}
  .tx-base{font-size:11.5px;}
  .tx-aeo{font-size:12.5px;padding:0 12px;}
}

/* ── the hundred squares section ─────────────────────────────────────────── */
.tx-sq{display:grid;grid-template-columns:minmax(0,230px) minmax(0,1fr);gap:22px;align-items:center;background:var(--bg3);border:1px solid var(--border);border-radius:15px;padding:16px 20px;margin:0 0 14px;}
.tx-sq .sc-waffle{max-width:190px;gap:3px;}
.tx-sq .sc-waffle i.l{background:#f4c6c6;}
.tx-sq .sc-waffle i.x{background:var(--danger);}
.tx-sq h2{font-size:clamp(17px,2.4vw,22px);letter-spacing:-.03em;line-height:1.2;margin:0 0 8px;}
.tx-sq p{font-size:13.5px;line-height:1.55;color:var(--text2);margin:0 0 10px;}
.tx-sq .ev{font-weight:700;color:var(--text);}

/* ── cards for "favourites that lost anyway" ─────────────────────────────── */
.tx-sec{margin:26px 0 12px;}
.tx-sec h2{font-size:clamp(16px,2.1vw,20px);letter-spacing:-.03em;margin:0 0 4px;}
.tx-sec p{font-size:13px;color:var(--text3);margin:0;}
.tx-losers{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 18px;}
.tx-ls{background:var(--bg3);border:1px solid var(--border);border-radius:13px;padding:12px 13px;display:flex;flex-direction:column;gap:8px;min-width:0;}
.tx-ls .q{font-size:12.5px;font-weight:700;line-height:1.35;color:var(--text);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;min-height:50px;}
.tx-ls .m{display:flex;justify-content:space-between;align-items:center;gap:6px;font-family:var(--mono);font-size:12px;font-weight:700;color:var(--text2);}
.tx-ls .no{color:var(--danger);background:var(--danger-bg);border-radius:5px;padding:2px 7px;font-size:11px;font-weight:800;}
.tx-ls a.go{font-size:12.5px;font-weight:700;color:var(--accent);padding:4px 0;min-height:32px;display:inline-flex;align-items:center;}
.tx-ls a.go:hover{text-decoration:underline;}

/* ── cross-sell band ─────────────────────────────────────────────────────── */
.tx-next{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 18px;}
.tx-nx{display:flex;flex-direction:column;gap:6px;background:linear-gradient(135deg,rgba(109,40,217,.08),rgba(109,40,217,.02));border:1px solid var(--accent-border);border-radius:14px;padding:14px 16px;color:var(--text);text-decoration:none;}
.tx-nx:hover{box-shadow:0 8px 24px -12px rgba(109,40,217,.45);}
.tx-nx .t{font-size:14.5px;font-weight:800;letter-spacing:-.02em;}
.tx-nx .d{font-size:12.5px;line-height:1.5;color:var(--text2);}
.tx-nx .a{font-size:13px;font-weight:800;color:var(--accent);}
.tx-trade{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;background:var(--ok-bg);border:1px solid rgba(21,128,61,.28);border-radius:16px;padding:16px 20px;margin:0 0 18px;}
.tx-trade p{margin:0;font-size:13px;line-height:1.5;color:var(--text2);max-width:60ch;}
.tx-trade p b{color:var(--text);}

/* ── price-right specifics ───────────────────────────────────────────────── */
.pr-head{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;justify-content:space-between;padding:14px 20px 0;}
.pr-big{padding:6px 24px 4px;}
.pr-big h2{font-size:clamp(18px,2.6vw,23px);letter-spacing:-.03em;line-height:1.2;margin:0 0 6px;}
.pr-big p{margin:0;font-size:13.5px;line-height:1.55;color:var(--text2);max-width:62ch;}
.pr-cols{display:grid;grid-template-columns:minmax(0,230px) minmax(0,1fr);gap:22px;align-items:center;padding:6px 24px 14px;}
.pr-cols .sc-waffle{max-width:230px;gap:3px;}
.pr-cols .sc-waffle i.l{background:#e5e7eb;}
.pr-chip{display:inline-block;font-family:var(--mono);font-size:12px;font-weight:800;padding:2px 8px;border-radius:6px;white-space:nowrap;}
.pr-chip.up{color:var(--ok);background:var(--ok-bg);} .pr-chip.dn{color:var(--danger);background:var(--danger-bg);} .pr-chip.eq{color:var(--text2);background:var(--bg2);}
.pr-tbl{width:100%;border-collapse:collapse;font-size:13px;}
.pr-tbl th{font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--text3);text-align:left;padding:8px 10px;border-bottom:1px solid var(--border);}
.pr-tbl th.num,.pr-tbl td.num{text-align:right;}
.pr-tbl td{padding:8px 10px;border-bottom:1px solid var(--border);white-space:nowrap;}
.pr-tbl td.em{font-weight:800;}
.pr-tbl tbody tr{cursor:pointer;} .pr-tbl tbody tr:hover{background:var(--accent-bg);}
.pr-tbl tbody tr.sel{background:rgba(109,40,217,.08);box-shadow:inset 3px 0 0 var(--accent);}
.pr-tbl tbody tr:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;}
.pr-tbl tr.thin td{color:var(--text3);}
.pr-watch{background:var(--bg3);border:1px solid var(--accent-border);border-radius:16px;padding:16px 20px;margin:0 0 18px;}
.pr-watch h2{font-size:16px;letter-spacing:-.02em;margin:0 0 4px;}
.pr-watch p{font-size:13.5px;color:var(--text2);margin:0 0 10px;line-height:1.5;}
.pr-wl{display:grid;gap:8px;margin:0;padding:0;list-style:none;}
.pr-wl li{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;justify-content:space-between;background:var(--bg2);border-radius:10px;padding:10px 12px;font-size:13.5px;}
.pr-wl button{appearance:none;background:none;border:0;color:var(--text3);cursor:pointer;font-size:12px;font-weight:700;min-height:32px;padding:0 6px;}
.pr-wl button:hover{color:var(--danger);}
.pr-since{display:flex;gap:12px;align-items:flex-start;background:var(--accent-bg);border:1px solid var(--accent-border);border-radius:14px;padding:14px 18px;margin:0 0 14px;font-size:14px;line-height:1.5;color:var(--text2);}
.pr-since b{color:var(--text);}
.pr-since[hidden]{display:none !important;}
.pr-find{display:flex;gap:8px;flex-wrap:wrap;}
.pr-find input{flex:1 1 260px;min-width:0;font-family:var(--sans);font-size:14px;padding:10px 12px;border:1px solid var(--border2);border-radius:10px;background:#fff;}
.pr-find .btn{min-height:40px;border-radius:10px;}

/* ── hub ─────────────────────────────────────────────────────────────────── */
.tx-hub{display:grid;gap:14px;margin:6px 0 24px;}
.tx-hc{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:6px 16px;align-items:center;background:var(--bg3);border:1px solid var(--border);border-radius:15px;padding:15px 18px;color:var(--text);text-decoration:none;transition:box-shadow .15s,border-color .15s,transform .15s;}
.tx-hc:hover{border-color:var(--accent-border);box-shadow:0 14px 34px -18px rgba(109,40,217,.5);transform:translateY(-1px);}
.tx-hc .n{width:52px;height:52px;border-radius:13px;background:var(--accent-bg);color:var(--accent);display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-weight:900;font-size:18px;}
.tx-hc h2{font-size:clamp(16px,2vw,19px);letter-spacing:-.03em;margin:0 0 3px;}
.tx-hc .q{font-size:13.5px;font-weight:600;color:var(--text);margin:0 0 3px;}
.tx-hc .d{font-size:12.5px;line-height:1.5;color:var(--text3);margin:0;}
.tx-hc .go{font-size:13.5px;font-weight:800;color:var(--accent);white-space:nowrap;}
.tx-faq{margin:6px 0 18px;}

@media (max-width:760px){
  .tx-ctl{padding:16px 16px 4px;}
  .tx-tiles{padding:0 16px 10px;gap:8px;grid-template-columns:repeat(3,minmax(0,1fr));}
  .tx-tile{padding:10px 10px;} .tx-tile .s{display:none;}
  .tx-chips{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;margin-right:-16px;padding-right:16px;scrollbar-width:none;}
  .tx-chips::-webkit-scrollbar{display:none;} .tx-chip{flex:0 0 auto;} .tx-chips .tx-lbl{flex:0 0 auto;}
  .tx-chartbox{padding:0 4px;} .tx-legend,.tx-cap{padding-left:16px;padding-right:16px;}
  .tx-foot{padding:12px 16px 16px;} .tx-foot .btn{flex:1 1 auto;justify-content:center;}
  .tx-sq,.pr-cols{grid-template-columns:1fr;gap:16px;padding:18px 16px;} .tx-sq .sc-waffle,.pr-cols .sc-waffle{margin:0 auto;}
  .tx-losers{grid-template-columns:repeat(2,minmax(0,1fr));}
  .tx-next{grid-template-columns:1fr;}
  .pr-head,.pr-big{padding-left:16px;padding-right:16px;}
  .pr-tbl{font-size:13px;} .pr-tbl td,.pr-tbl th{padding:10px 6px;}
  .pr-tbl .hide-m{display:none;}
  .tx-hc{grid-template-columns:48px minmax(0,1fr);padding:16px;} .tx-hc .n{width:48px;height:48px;font-size:18px;border-radius:12px;} .tx-hc .go{grid-column:1 / -1;}
  .tx-mark{display:none;}
}
@media (max-width:420px){ .tx-losers{grid-template-columns:1fr;} }

/* ── LIVE UNIT: slider + chart + headline are one block ─────────────────────
   Desktop: ordinary flow (they already sit together).
   Phone: pinned right under the site's top bar, so the chart visibly moves while
   the thumb moves, with the rest of the page scrolling underneath.
   `clip` (not `hidden`) on html/body/card: `hidden` makes them scroll containers and silently kills sticky. */
html,body{overflow-x:clip !important;}
.tx-stage{background:var(--bg3);}
.tx-live .h{margin:0;}
.tx-ctl2{padding-top:10px;}
@media (max-width:760px){
  .tx-card{overflow:clip;}
  .tx-stage{position:sticky;top:var(--shell-h,0px);z-index:70;border-bottom:1px solid var(--accent-border);
    box-shadow:0 10px 18px -14px rgba(76,29,149,.5);border-radius:20px 20px 0 0;}
  .tx-stage .tx-ctl{padding:10px 14px 0;}
  .tx-stage .tx-val{font-size:30px;}
  .tx-stage .tx-range{margin:8px 0 2px;height:14px;}
  .tx-stage .tx-range::-webkit-slider-thumb{width:34px;height:34px;}
  .tx-stage .tx-scale{font-size:10px;margin-bottom:2px;}
  .tx-stage .tx-chartbox{padding:0 2px;}
  .tx-stage .tx-live{padding:0 14px 8px;}
  .tx-stage .tx-live .h,.tx-stage .pr-big h2{font-size:18px;line-height:1.2;margin:0;}
  .tx-stage .pr-big{padding:0 14px 8px;}
  .pr-big2{padding:8px 16px 0;}
  .tx-mark{display:none;}
  /* shorter intro so the instrument starts higher */
  .sc-hero .pt-lede{display:none;}
  .sc-hero{padding:14px 16px 0 !important;}
  .sc-hero .eyebrow{margin-bottom:8px;}
  .sc-hero .pt-h1{font-size:23px;margin-bottom:8px;}
  .tx-aeo{font-size:13px;margin:0 0 10px;text-align:left;}
  .sc-arch.arch-line{margin:0 0 4px;}
  /* top crumbs bar scrolls away instead of stacking on the shell bar */
  .pt-top{position:static;}
  .pt-top-in{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;}
  .pt-top-in::-webkit-scrollbar{display:none;}
  .pt-tlinks a{white-space:nowrap;padding:10px 4px;}
}
