/* 911RRARI v221: desktop and laptop scanner layer (900px and up). One clean definition of the stats strip, filters and results table.
   Phone layouts are untouched. Reads tokens.css. */
@media (min-width:900px){
  /* ---- compact header: more room for the work area ---- */
  .shell{row-gap:10px!important}
  header.top{min-height:0!important}
  header.top .trow{padding:3px 8px!important;gap:2px!important}
  header.top .trow .bell{width:38px!important;height:38px!important}
  .tapewrap{margin:0!important}
  #pmBtn{height:38px!important;padding:2px 14px!important;margin:0!important}
  .bar{min-height:0!important}
  #summary .si{padding:8px 12px!important}
  #summary .si .v{font-size:18px!important}
  .ws{height:clamp(520px,calc(100dvh - 300px),1100px)!important}
  /* ---- stats strip: seven cards ---- */
  #summary{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:8px!important;padding:2px 0 12px!important;border:0!important;background:none!important;overflow:visible!important}
  #summary .si{display:flex!important;flex:1 1 auto!important;flex-direction:column;gap:4px;min-width:0;background:var(--ds-s2)!important;border-radius:var(--ds-r-m)!important;padding:10px 14px!important;box-shadow:inset 0 0 0 .5px var(--ds-line)}
  #summary .si .k{font-size:11px!important;font-weight:600!important;letter-spacing:.06em;text-transform:uppercase;color:var(--ds-t3)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #summary .si .v{font-size:20px!important;font-weight:600;letter-spacing:-.02em;color:var(--ds-t1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #summary .si .v.up{color:var(--ds-up)}#summary .si .v.down{color:var(--ds-down)}
  .summary .dist{display:flex;height:4px;border-radius:2px;overflow:hidden;gap:2px;margin-top:2px}
  .summary .dist b{display:block;min-width:0;background:var(--ds-flat)}.summary .dist b:nth-child(1){background:#8E8E93}.summary .dist b:nth-child(2){background:#C7C7CC}.summary .dist b:nth-child(3){background:#F2F2F7}

  /* ---- filters: collapsible groups ---- */
  #rail .fbody>div>.grp-t{display:flex;align-items:center;gap:8px;margin:0;padding:10px 4px;cursor:pointer;user-select:none;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ds-t2)}
  #rail .fbody>div>.grp-t::after{content:"";margin-left:auto;width:7px;height:7px;border-right:1.5px solid var(--ds-t3);border-bottom:1.5px solid var(--ds-t3);transform:rotate(45deg);transition:transform var(--ds-base) var(--ds-ease)}
  #rail .fbody>div.shut>.grp-t::after{transform:rotate(-45deg)}
  #rail .fbody>div.shut>.fields,#rail .fbody>div.shut>.chips{display:none}
  #rail .grp-n{font-size:11px;font-weight:600;letter-spacing:0;text-transform:none;background:var(--ds-accent);color:#fff;border-radius:var(--ds-r-pill);padding:1px 7px}
  #rail .fbody{gap:4px!important}
  #rail .fbody>div{border-bottom:1px solid var(--ds-line);padding-bottom:8px}

}
@media (min-width:640px){
  /* ---- results table: explicit columns, nothing clips ---- */
  html body #tbl,html body #tbl #tbody,html body #tbl #thead{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important}
  #tbl{display:block;width:100%;min-width:0!important;table-layout:auto}
  #tbl thead,#tbl tbody{display:block}
  #tbl thead{position:sticky;top:0;z-index:3;background:rgba(21,21,23,.94);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
  #tbl thead tr,#tbl tbody tr:not(.empty){display:grid;grid-template-columns:minmax(130px,1fr) 74px 72px 78px 60px 52px 66px 70px!important;align-items:center;column-gap:10px;padding:0 12px;box-sizing:border-box;width:100%}
  #tbl tbody tr.empty,#tbl tbody tr.empty td{display:block;padding:28px 14px;text-align:center;color:var(--ds-t3)}
  #tbl #tbody td,#tbl #thead th{grid-column:auto!important}
  #tbl #tbody td::before{content:none!important;display:none!important}
  #tbl th,#tbl td{display:block;min-width:0;width:auto!important;padding:0!important;border:0!important;white-space:nowrap}
  #tbl thead th{height:34px;display:flex;align-items:center;justify-content:flex-end;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ds-t3);background:none!important}
  #tbl thead th.l{justify-content:flex-start}
  #tbl thead th button{font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
  #tbl thead th[aria-sort=ascending] button,#tbl thead th[aria-sort=descending] button{color:var(--ds-t1)}
  #tbl tbody tr:not(.empty){min-height:60px;border-bottom:1px solid var(--ds-line);cursor:pointer;transition:background var(--ds-fast) var(--ds-ease)}
  #tbl tbody tr:hover{background:var(--ds-fill)!important}
  #tbl tbody tr.sel,#tbl tbody tr.sel:hover{background:var(--ds-fill2)!important;box-shadow:inset 3px 0 0 var(--ds-accent)}
  /* column order: Symbol, Trend, Price, Chg, Gap, Rel vol, Volume, Setup (then the extras on wide screens) */
  #tbl th:nth-child(1),#tbl td:nth-child(1){order:1}
  #tbl th:nth-child(12),#tbl td:nth-child(12){order:2}
  #tbl th:nth-child(3),#tbl td:nth-child(3){order:3}
  #tbl th:nth-child(4),#tbl td:nth-child(4){order:4}
  #tbl th:nth-child(5),#tbl td:nth-child(5){order:5}
  #tbl th:nth-child(7),#tbl td:nth-child(7){order:6}
  #tbl th:nth-child(6),#tbl td:nth-child(6){order:7}
  #tbl th:nth-child(2),#tbl td:nth-child(2){order:8}
  #tbl th:nth-child(8),#tbl td:nth-child(8){order:9}
  #tbl th:nth-child(9),#tbl td:nth-child(9){order:10}
  #tbl th:nth-child(10),#tbl td:nth-child(10){order:11}
  #tbl th:nth-child(11),#tbl td:nth-child(11){order:12}
  #tbl th:nth-child(n+8):nth-child(-n+11),#tbl td:nth-child(n+8):nth-child(-n+11){display:none!important}
  #tbl #tbody tr td{background:transparent!important}
  #tbl td.n{text-align:right;font-size:14px;font-weight:500;letter-spacing:-.005em;font-variant-numeric:tabular-nums}
  #tbl td:nth-child(3){font-weight:600;color:var(--ds-t1)}
  #tbl td:nth-child(2){text-align:center}
  #tbl td.spk{height:34px;opacity:.95}#tbl td.spk svg{width:100%;height:34px;display:block}
  #tbl .id b{font-size:16px;font-weight:650;letter-spacing:-.01em}
  #tbl .id small{display:block;font-size:12px;color:var(--ds-t3);overflow:hidden;text-overflow:ellipsis;max-width:100%}
  #tbl td .rng{display:none}
}
/* laptop and small desktop: three columns tighten, Rel vol moves to the stock panel */
@media (min-width:1280px) and (max-width:1399px){.ws{grid-template-columns:216px minmax(0,1fr) 380px!important}}
@media (min-width:1400px) and (max-width:1499px){.ws{grid-template-columns:216px minmax(0,1fr) 420px!important}}
@media (min-width:1500px){.ws{grid-template-columns:240px minmax(0,1fr) 440px!important}}
@media (min-width:720px) and (max-width:1499px){
  #tbl thead tr,#tbl tbody tr:not(.empty){grid-template-columns:minmax(104px,1fr) 70px 70px 78px 68px 62px 72px 62px!important;column-gap:8px}
}
@media (min-width:640px) and (max-width:719px){
  #tbl #thead th:nth-child(7),#tbl #tbody td:nth-child(7){display:none!important}
  #tbl thead tr,#tbl tbody tr:not(.empty){grid-template-columns:minmax(112px,1fr) 74px 72px 80px 72px 76px 64px!important;column-gap:8px}
}
@media (min-width:1700px){
  #tbl thead tr,#tbl tbody tr:not(.empty){grid-template-columns:minmax(170px,1fr) 74px 72px 78px 62px 56px 70px 70px 58px 56px 72px!important}
  #tbl #tbody td:nth-child(n+8):nth-child(-n+10){display:block!important}
  #tbl #thead th:nth-child(n+8):nth-child(-n+10){display:flex!important}
  #tbl #thead th:nth-child(11),#tbl #tbody td:nth-child(11){display:none!important}
}
