/* Technical Trader page. Loaded after site.css and gex.css: the page wears
   .gex-page so it inherits the GEX controls, KPI cards, chart panel and guide
   cards as they are, and this file only adds what is new. Everything is scoped
   to .tt-page or a tt- class, so nothing here reaches the GEX page.
   Palette is the site's: green up, red down, amber for the price itself. No blue. */

body[data-page="trader"] {
  background:
    radial-gradient(ellipse 40% 380px at 14% 0, rgba(22, 214, 126, .10), transparent 70%),
    radial-gradient(ellipse 34% 320px at 90% 60px, rgba(255, 197, 61, .06), transparent 70%),
    var(--bg, #07090D);
  background-repeat: no-repeat;
}
.tt-page { --tt-violet: #B69CFF; --tt-orange: #FF9F5A; --tt-soft-up: #7BF0B8; --tt-soft-down: #FF8A95; }
/* nothing inside may be wider than the page: a wide table or the tape must
   scroll inside its own box, not stretch the whole layout on a phone */
.tt-page { min-width: 0; }
.tt-page > *, .tt-page section { min-width: 0; max-width: 100%; }
.tt-page [hidden] { display: none !important; }
.tt-page .pos { color: var(--gx-up); }
.tt-page .neg { color: var(--gx-down); }
.tt-page .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- market tape ---------- */
.tt-strip {
  display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin; scrollbar-color: var(--gx-line) transparent; min-height: 58px;
}
.tt-chip {
  flex: none; display: flex; flex-direction: column; gap: 1px; min-width: 104px; min-height: 52px;
  padding: 7px 12px; text-align: left; cursor: pointer;
  background: var(--gx-panel); border: 1px solid var(--gx-line); border-radius: 12px;
  color: var(--gx-text); font-family: var(--font-mono);
  transition: border-color .15s, transform .15s;
}
.tt-chip:hover { border-color: rgba(22, 214, 126, .55); transform: translateY(-1px); }
.tt-chip.active { border-color: var(--gx-up); background: rgba(22, 214, 126, .1); }
.tt-chip-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--gx-muted); }
.tt-chip-px { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-chip.is-skel { cursor: default; }
.tt-chip.is-skel .tt-chip-px { color: transparent; background: var(--gx-panel-2); border-radius: 5px; }

/* ---------- header: on wide screens the view tabs sit beside the title, which saves a
   whole row above the chart (the chart is what people come for, so it should start high) ---------- */
@media (min-width: 900px) {
  .tt-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; }
  .tt-head .gex-eyebrow { grid-column: 1; grid-row: 1; }
  .tt-head h1 { grid-column: 1; grid-row: 2; }
  .tt-head .tt-tabs { grid-column: 2; grid-row: 1 / 3; align-self: end; margin: 0; }
  .tt-head .gex-lede { grid-column: 1 / -1; grid-row: 3; }
}
@media (max-width: 899px) {
  .tt-head { display: flex; flex-direction: column; }
  .tt-head .tt-tabs { order: 1; margin: 14px 0 0; }
}

/* ---------- tabs ---------- */
.tt-tabs {
  display: flex; gap: 4px; margin: 0 0 16px; padding: 4px;
  background: var(--gx-panel); border: 1px solid var(--gx-line); border-radius: 14px; width: fit-content; max-width: 100%;
}
.tt-tabs button {
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--gx-muted);
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  transition: background .15s, color .15s;
}
.tt-tabs button:hover { color: var(--gx-text); background: var(--gx-panel-2); }
.tt-tabs button[aria-selected="true"] {
  color: var(--gx-text); background: rgba(22, 214, 126, .15); box-shadow: inset 0 0 0 1px rgba(22, 214, 126, .5);
}

/* ---------- controls ---------- */
.tt-page .input { width: 250px; }
.tt-page .input::placeholder { font-size: 14px; }
/* labels sit beside their controls, not above them: two short rows instead of two tall ones */
.tt-page .gex-controls { padding-top: 14px; padding-bottom: 14px; gap: 12px; }
.tt-page .ctl-row { align-items: center; gap: 12px 28px; }
.tt-page .ctl-row-2 { padding-top: 12px; }
.tt-page .ctl-group, .tt-page .ticker-form { flex-direction: row; align-items: center; gap: 10px; }
.tt-page .ctl-label { flex: none; }

/* Layers: one button that opens the "show on chart" toggles in a panel */
.tt-show { position: relative; }
.tt-layers-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 16px;
  background: var(--bg, #07090D); border: 1px solid var(--gx-line); border-radius: 12px; cursor: pointer;
  color: var(--gx-text); font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: .03em;
  transition: border-color .15s, background .15s;
}
.tt-layers-btn:hover, .tt-layers-btn[aria-expanded="true"] { border-color: rgba(22, 214, 126, .55); }
.tt-layers-btn[aria-expanded="true"] { background: rgba(22, 214, 126, .08); }
.tt-layers-btn:focus-visible { outline: 2px solid var(--gx-up); outline-offset: 2px; }
.tt-layers-n { color: var(--gx-up); font-variant-numeric: tabular-nums; }
.tt-layers-caret {
  width: 7px; height: 7px; margin: -3px 0 0 4px; border-right: 2px solid var(--gx-muted); border-bottom: 2px solid var(--gx-muted);
  transform: rotate(45deg); transition: transform .15s;
}
.tt-layers-btn[aria-expanded="true"] .tt-layers-caret { transform: rotate(-135deg); margin-top: 3px; }
.tt-layers-panel {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; width: 440px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--gx-panel); border: 1px solid #2F3B4D; border-radius: 14px;
  box-shadow: 0 22px 50px -18px rgba(0, 0, 0, .9);
}
.tt-layers-panel[hidden] { display: none; }
.tt-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-toggles button {
  min-height: 38px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  background: var(--bg, #07090D); border: 1px solid var(--gx-line); color: var(--gx-muted);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  transition: border-color .15s, color .15s, background .15s;
}
.tt-toggles button::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; border: 1.5px solid var(--gx-muted); vertical-align: 0;
}
.tt-toggles button:hover { color: var(--gx-text); border-color: #3A4759; }
.tt-toggles button[aria-pressed="true"] { color: var(--gx-text); border-color: rgba(22, 214, 126, .5); background: rgba(22, 214, 126, .1); }
.tt-toggles button[aria-pressed="true"]::before { background: var(--gx-up); border-color: var(--gx-up); }
.tt-toggles button:disabled { opacity: .45; cursor: default; }

/* ---------- 12px floor for text shared with gex.css / site.css ----------
   Those files set these labels at 9.5-11.5px for the GEX page too; raised
   here for this page only, with a little less letter-spacing so the
   uppercase labels keep their width. */
.tt-page .gex-eyebrow { font-size: 12px; letter-spacing: .12em; }
.tt-page .ctl-label { font-size: 12px; letter-spacing: .1em; }
.tt-page .kpi-label { font-size: 12px; letter-spacing: .1em; }
.tt-page .gex-chart-panel .chart-hint { font-size: 12px; }
.tt-page .gex-chart-panel .zoom-label { font-size: 12px; letter-spacing: .06em; }
@media (max-width: 700px) {
  .tt-page .gex-chart-panel .zoom-label { font-size: 12px; letter-spacing: .02em; }
}

/* ---------- KPI row: six cards ---------- */
.tt-kpis { grid-template-columns: 1.35fr 1.2fr repeat(4, 1fr); }
.tt-kpis .kpi .v { font-size: clamp(20px, 1.85vw, 27px); }
.tt-kpis .kpi-net .v { font-size: clamp(22px, 2.3vw, 32px); letter-spacing: -.02em; font-family: var(--font-display); }
.tt-kpis .tt-kpi-last .v { font-size: clamp(26px, 2.7vw, 36px); }
/* the six checks behind the bias, as small chips under the score */
.tt-bias-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; position: relative; z-index: 1; }
.tt-bias-chips a {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; box-sizing: border-box; padding: 2px 8px; border-radius: 999px;
  font: 600 12px/1.5 var(--font-mono); letter-spacing: .02em; text-transform: uppercase; text-decoration: none;
  color: var(--gx-muted); background: var(--gx-panel-2); border: 1px solid var(--gx-line);
}
.tt-bias-chips i { font-style: normal; font-size: 12px; line-height: 1; }
.tt-bias-chips li[data-s="1"] a { color: var(--gx-up); background: rgba(22, 214, 126, .12); border-color: rgba(22, 214, 126, .35); }
.tt-bias-chips li[data-s="-1"] a { color: var(--gx-down); background: rgba(255, 77, 94, .12); border-color: rgba(255, 77, 94, .35); }
.tt-bias-chips a:hover, .tt-bias-chips a:focus-visible { filter: brightness(1.25); }
.kpis.is-loading .tt-bias-chips { opacity: .55; }

/* ---------- chart ---------- */
.tt-chart { height: clamp(430px, 62vh, 680px); position: relative; overflow: hidden; background: #0B0F15; }
.tt-canvas { display: block; cursor: crosshair; touch-action: pan-y; }
/* on-chart price zoom (+ / −), bottom right over the empty axis column of the volume pane */
.tt-pz { position: absolute; right: 6px; bottom: 28px; display: flex; gap: 4px; z-index: 2; }
.tt-pz button {
  width: 28px; height: 28px; padding: 0; border-radius: 8px; cursor: pointer;
  background: rgba(17, 22, 30, .92); border: 1px solid #2C3748; color: var(--gx-text, #EEF2F7);
  font: 700 16px/1 var(--font-mono, monospace); display: grid; place-items: center;
  transition: border-color .15s, background .15s;
}
.tt-pz button:hover:not(:disabled) { border-color: var(--gx-amber, #FFC53D); background: #1A2230; }
.tt-pz button:focus-visible { outline: 2px solid var(--gx-amber, #FFC53D); outline-offset: 1px; }
.tt-pz button:disabled { opacity: .35; cursor: default; }
.tt-pz .tt-pz-fit { display: none; width: auto; padding: 0 8px; font-size: 12px; font-weight: 600; }
/* touch screens: 44px targets (Apple / Google guidance). Side by side they span
   ~92px, which sits inside the tag + price-axis columns (98px on a phone) and
   inside the volume pane, below the lowest price label */
@media (pointer: coarse) {
  .tt-pz { gap: 6px; bottom: 24px; right: 4px; }
  .tt-pz button { width: 44px; height: 44px; border-radius: 10px; font-size: 20px; }
  .tt-pz .tt-pz-fit { padding: 0 12px; font-size: 13px; }
}
.tt-pz.zoomed .tt-pz-fit { display: grid; }
.tt-chart-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--gx-muted); line-height: 1.5; }
.tt-chart-note:empty { display: none; }
.tt-legend .lg { height: 0; width: 18px; border-radius: 0; border-top: 2px solid; }
.tt-lg-poc { border-color: var(--gx-amber) !important; }
.tt-lg-vwap { border-color: var(--gx-text) !important; }
.tt-lg-prior { border-color: var(--gx-text) !important; border-top-style: dashed !important; }
.tt-lg-r { border-color: var(--tt-soft-down) !important; border-top-style: dashed !important; }
.tt-lg-s { border-color: var(--tt-soft-up) !important; border-top-style: dashed !important; }
.tt-lg-on { border-color: var(--tt-violet) !important; border-top-style: dashed !important; }
/* swatches drawn as a 2px strip so the dash pattern copies the chart's setLineDash
   (canvas px on : off) instead of the browser's own dashed / dotted look */
.tt-legend .lg.tt-lg-x { height: 2px; border-top: 0; }
/* Last: amber [5,4] dash on the chart; .tt-legend .lg above would otherwise turn it solid grey */
.tt-legend .lg.lg-spot { border-top: 2px dashed var(--gx-amber); }
.tt-lg-bands { background: repeating-linear-gradient(90deg, rgba(238, 242, 247, .4) 0 2px, transparent 2px 6px); }
.tt-lg-ema9 { background: rgba(255, 159, 90, .9); }
.tt-lg-ema21 { background: rgba(182, 156, 255, .9); }
.tt-lg-p { background: rgba(169, 180, 196, .7); }
.tt-lg-or { background: repeating-linear-gradient(90deg, rgba(255, 159, 90, .75) 0 6px, transparent 6px 9px); }
.tt-lg-swing { background: repeating-linear-gradient(90deg, rgba(169, 180, 196, .8) 0 1px, transparent 1px 4px); }
.tt-lg-flip { background: repeating-linear-gradient(90deg, rgba(255, 197, 61, .85) 0 1px, transparent 1px 4px); }
/* two-colour swatches: green call wall | red put wall, EM+ (soft red) | EM− (soft green) */
.tt-legend .lg.tt-lg-walls, .tt-legend .lg.tt-lg-em { width: 24px; }
.tt-lg-walls { background: linear-gradient(90deg, var(--gx-up) 0 11px, transparent 11px 13px, var(--gx-down) 13px); }
.tt-lg-em {
  background:
    repeating-linear-gradient(90deg, var(--tt-soft-down) 0 5px, transparent 5px 7px, var(--tt-soft-down) 7px 8px, transparent 8px 10px) left / 12px 100% no-repeat,
    repeating-linear-gradient(90deg, var(--tt-soft-up) 0 5px, transparent 5px 7px, var(--tt-soft-up) 7px 8px, transparent 8px 10px) right / 12px 100% no-repeat;
}
/* the GEX column: green bars for positive gamma, red for negative */
.tt-legend .lg.tt-lg-gexbar {
  width: 14px; height: 10px; border-top: 0;
  background:
    linear-gradient(rgba(22, 214, 126, .8), rgba(22, 214, 126, .8)) left top / 100% 4px no-repeat,
    linear-gradient(rgba(255, 77, 94, .8), rgba(255, 77, 94, .8)) left bottom / 60% 4px no-repeat;
}

/* ---------- cards ---------- */
.tt-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 0 0 16px; align-items: start; }
.tt-card {
  background: linear-gradient(180deg, var(--gx-panel), #0E131A);
  border: 1px solid var(--gx-line); border-radius: var(--gx-r);
  padding: 18px var(--gx-pad); min-width: 0;
}
.tt-card h2 { font-size: 20px; line-height: 1.2; margin: 0; }
.tt-card h3 { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gx-muted); margin: 0 0 10px; }
.tt-card-sub { margin: 4px 0 14px; color: var(--gx-muted); font-size: 13.5px; }
.tt-fine { margin: 14px 0 0; font-size: 12px; color: var(--gx-muted); }

.tt-factors { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.tt-factors li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-width: 0;
  background: var(--bg, #07090D); border: 1px solid var(--gx-line); border-radius: 10px; font-size: 13.5px;
}
.tt-factors li i {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 700 12px/1 var(--font-mono); font-style: normal; background: var(--gx-panel-2); color: var(--gx-muted);
}
.tt-factors li[data-s="1"] i { background: rgba(22, 214, 126, .18); color: var(--gx-up); }
.tt-factors li[data-s="-1"] i { background: rgba(255, 77, 94, .18); color: var(--gx-down); }
.tt-factors li b { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--gx-muted); font-weight: 700; }
.tt-notes { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tt-notes li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.5; }
.tt-notes li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--gx-up); }
.tt-notes li b { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- level ladder ---------- */
.tt-ladder-wrap { overflow-x: auto; }
.tt-page .gex-info { grid-template-columns: 1fr; }
.tt-ladder { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tt-ladder th {
  text-align: left; padding: 6px 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gx-muted); font-weight: 700;
  border-bottom: 1px solid var(--gx-line);
}
.tt-ladder th.num { text-align: right; }
.tt-ladder td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft, #1A2230); vertical-align: middle; }
.tt-ladder td.num { font-family: var(--font-mono); white-space: nowrap; }
.tt-ladder .tt-away { color: var(--gx-muted); font-size: 12.5px; }
.tt-tag {
  display: inline-block; min-width: 46px; margin-right: 8px; padding: 2px 6px; border-radius: 6px; text-align: center;
  font: 700 12px/1.45 var(--font-mono); border: 1px solid currentColor; background: rgba(255, 255, 255, .03);
}
.tt-ladder tr.is-stack td:first-child { box-shadow: inset 3px 0 0 var(--gx-amber); }
.tt-stack-badge {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  font: 700 12px/1.5 var(--font-mono); letter-spacing: .03em; text-transform: uppercase;
  color: #1A1300; background: var(--gx-amber);
}
.tt-ladder tr.tt-now td {
  background: rgba(255, 197, 61, .12); border-top: 1px solid rgba(255, 197, 61, .5); border-bottom: 1px solid rgba(255, 197, 61, .5);
  color: var(--gx-amber); font-weight: 700;
}
.tt-ladder tr.tt-off td { opacity: .5; }

/* ---------- breadth + industries ---------- */
.tt-asof { margin: 0 0 14px; color: var(--gx-muted); font-size: 13.5px; }
.tt-asof b { color: var(--gx-text); font-weight: 600; }
.tt-grid { display: grid; gap: 12px; margin: 0 0 16px; }
.tt-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tt-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tt-stat { background: linear-gradient(165deg, var(--gx-panel-2) 0%, var(--gx-panel) 60%); border: 1px solid var(--gx-line); border-radius: var(--gx-r); padding: 16px var(--gx-pad); min-width: 0; }
.tt-stat h3 { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gx-muted); margin: 0 0 8px; }
.tt-stat .big { font-family: var(--font-mono); font-weight: 700; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tt-stat .big small { font-size: .55em; font-weight: 600; color: var(--gx-muted); letter-spacing: 0; margin-left: 6px; }
.tt-stat p { margin: 6px 0 0; font-size: 12.5px; color: var(--gx-muted); line-height: 1.45; }
.tt-hero { grid-column: 1 / -1; }
.tt-hero-nums { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tt-hero-nums .big { font-size: clamp(28px, 3.4vw, 44px); }

/* advancers | unchanged | decliners, as one proportional bar */
.tt-ad { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--gx-panel-2); margin: 12px 0 0; }
.tt-ad i { display: block; height: 100%; }
.tt-ad .a { background: var(--gx-up); }
.tt-ad .u { background: #4A5568; }
.tt-ad .d { background: var(--gx-down); }
.tt-ad.thin { height: 8px; margin: 0; min-width: 70px; }
.tt-read { margin: 0 0 16px; padding: 14px 18px; border: 1px solid var(--gx-line); border-left: 3px solid var(--gx-amber); border-radius: 12px; background: var(--gx-panel); font-size: 15px; line-height: 1.55; }

.tt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tt-table th { text-align: left; padding: 6px 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gx-muted); font-weight: 700; border-bottom: 1px solid var(--gx-line); white-space: nowrap; }
.tt-table th.num { text-align: right; }
.tt-table td { padding: 8px; border-bottom: 1px solid var(--line-soft, #1A2230); vertical-align: middle; }
.tt-table td.num { font-family: var(--font-mono); white-space: nowrap; }
.tt-table tr:last-child td { border-bottom: 0; }
.tt-name { color: var(--gx-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; width: 60%; }
.tt-sym {
  display: inline-block; padding: 3px 8px; border-radius: 7px; cursor: pointer;
  background: var(--bg, #07090D); border: 1px solid var(--gx-line); color: var(--gx-text);
  font: 700 12.5px/1.4 var(--font-mono); text-decoration: none;
}
.tt-sym:hover { border-color: var(--gx-up); }

/* a bar that grows right for gains and left for losses, around a centre line */
.tt-div { position: relative; height: 10px; min-width: 90px; background: linear-gradient(90deg, transparent calc(50% - .5px), var(--gx-line) calc(50% - .5px), var(--gx-line) calc(50% + .5px), transparent calc(50% + .5px)); }
.tt-div i { position: absolute; top: 1px; bottom: 1px; border-radius: 2px; }
.tt-div i.p { left: 50%; background: var(--gx-up); }
.tt-div i.n { right: 50%; background: var(--gx-down); }

/* sectors: one <details> each */
.tt-sectors { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.tt-sec { background: var(--gx-panel); border: 1px solid var(--gx-line); border-radius: 14px; overflow: hidden; }
.tt-sec[open] { border-color: #2F3B4D; }
.tt-sec summary {
  display: grid; grid-template-columns: minmax(150px, 1.5fr) 74px 84px minmax(90px, 1fr) minmax(120px, 1fr) 20px;
  align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; min-height: 56px;
}
.tt-sec summary::-webkit-details-marker { display: none; }
.tt-sec summary:hover { background: var(--gx-panel-2); }
.tt-sec-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; min-width: 0; }
.tt-sec-name small { display: block; font-family: var(--font-ui); font-weight: 400; font-size: 12px; color: var(--gx-muted); }
.tt-sec-pct { font-family: var(--font-mono); font-weight: 700; font-size: 15px; text-align: right; }
.tt-sec-ad { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--gx-muted); }
.tt-sec-caret { width: 9px; height: 9px; border-right: 2px solid var(--gx-muted); border-bottom: 2px solid var(--gx-muted); transform: rotate(45deg); transition: transform .2s; justify-self: center; }
.tt-sec[open] .tt-sec-caret { transform: rotate(-135deg); }
.tt-sec-head {
  display: grid; grid-template-columns: minmax(150px, 1.5fr) 74px 84px minmax(90px, 1fr) minmax(120px, 1fr) 20px;
  gap: 14px; padding: 0 16px 6px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gx-muted); font-weight: 700;
}
.tt-sec-head span:nth-child(3) { text-align: right; }
.tt-sec-body { padding: 4px 16px 16px; border-top: 1px solid var(--line-soft, #1A2230); }
.tt-ind { display: grid; grid-template-columns: minmax(150px, 240px) 64px minmax(0, 1fr); gap: 6px 14px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft, #1A2230); }
.tt-ind:last-child { border-bottom: 0; padding-bottom: 0; }
.tt-ind-name { font-size: 13.5px; font-weight: 600; }
.tt-ind-name small { display: block; color: var(--gx-muted); font-weight: 400; font-size: 12px; }
.tt-ind-pct { font-family: var(--font-mono); font-weight: 700; font-size: 13.5px; text-align: right; }
.tt-tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.tt-tile {
  min-width: 58px; min-height: 40px; padding: 3px 7px; border: 0; border-radius: 6px; cursor: pointer; text-align: center;
  font-family: var(--font-mono); color: #fff; line-height: 1.25;
}
.tt-tile b { display: block; font-size: 12px; font-weight: 700; }
.tt-tile span { font-size: 12px; opacity: .92; }
.tt-tile:hover { outline: 2px solid var(--gx-text); outline-offset: 1px; }

.tt-etfs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.tt-etf { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-align: left; cursor: pointer; border-radius: 12px; background: var(--bg, #07090D); border: 1px solid var(--gx-line); color: var(--gx-text); font-family: var(--font-ui); min-height: 64px; }
.tt-etf:hover { border-color: var(--gx-up); }
.tt-etf-top { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.tt-etf-label { font-size: 12.5px; color: var(--gx-muted); }
.tt-section-h { font-size: 20px; margin: 22px 0 4px; }
.tt-section-sub { margin: 0 0 12px; color: var(--gx-muted); font-size: 13.5px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1020px) {
  .tt-kpis { grid-template-columns: repeat(3, 1fr); }
  .tt-kpis .kpi-net { grid-column: auto; display: block; }
  .tt-two { grid-template-columns: minmax(0, 1fr); }
  .tt-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tt-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tt-sec-head { display: none; }
  .tt-sec summary { grid-template-columns: minmax(0, 1fr) 62px 76px 16px; gap: 10px; padding: 10px 12px; }
  .tt-sec summary .tt-div, .tt-sec summary .tt-sec-ad { display: none; }
  .tt-ind { grid-template-columns: minmax(0, 1fr) 64px; }
  .tt-ind .tt-tiles { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .tt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tt-away-pct { display: none; }
  .tt-ladder td { padding: 7px 4px; }
  .tt-tag { min-width: 40px; margin-right: 6px; }
  .tt-card { padding: 16px 14px; }
  .tt-kpis .kpi { padding: 12px 14px; }
  .tt-tabs { width: 100%; }
  .tt-tabs button { flex: 1 1 0; padding: 0 8px; font-size: 15px; }
  .tt-page .input { width: auto; }
  /* phone controls: Pivots on one line, then Window and Layers side by side; the Layers
     panel drops below that line at full width */
  .tt-page .ctl-row-2 { position: relative; gap: 10px; }
  .tt-page .ctl-row-2 > .ctl-group { flex: 1 1 100%; order: 0; }
  .tt-page .ctl-row-2 > .ctl-group:first-child { flex: none; order: 1; }
  .tt-page .ctl-row-2 > .tt-show { flex: 1 1 0; order: 2; position: static; }
  .tt-page .ctl-row-2 .seg { flex: 1; display: flex; }
  .tt-page .ctl-row-2 > .ctl-group > .ctl-label { min-width: 74px; }
  .tt-page .ctl-row-2 .seg button { flex: 1 1 auto; min-width: 44px; padding: 0 10px; }
  .tt-layers-btn { width: 100%; justify-content: center; }
  .tt-layers-panel { left: 0; right: 0; width: auto; max-width: none; }
  .tt-chart { height: 440px; }
  .tt-factors { grid-template-columns: 1fr; }
  .tt-chart-panel .chart-hint { display: none; }
  .tt-legend { gap: 4px 12px; font-size: 12px; }
  .tt-hero-nums .big { font-size: 26px; }
  .tt-sec-body { padding: 4px 12px 12px; }
  .tt-name { display: none; }
  /* 12px headers ("Up / down", "Avg stock") may wrap rather than widen the page */
  .tt-table th { white-space: normal; letter-spacing: .04em; padding: 6px 4px; }
  .tt-ladder th { letter-spacing: .04em; padding: 6px 4px; }
}
