/* The Swing Regime panel of the Market Regimes chapter on /how-it-works/
   (showcase/chapters/regimes/_swing.html, regime-swing.js). One app window with the two views of
   the real tool, switched by its own page tabs:
     Swing Regime Leaderboard (intrinio_stock/templates/stock_data/swing_regime_leaderboard.html):
       regime pills, symbol filter, Columns picker, the sortable table with category-coloured
       headers, heat cells, Entry Quality and Setup Type.
     Ticker Swing Market Regime (stock_data/swing_regime.html): hero and Analyze, regime banner,
       15-day and 90-day average cards, the five-zone score bar, the 90-day history chart, timeframe,
       category and indicator cards, market context, trade setup, flow, breadth and drivers.
   Colours inside the window are the tool's own (hex values from those two templates); the panel
   around it uses landing.css tokens. Everything is rgs-* and scoped under .rgs so it beats
   landing.css's element reset. Only transform and opacity animate; none of it runs under reduced
   motion (landing.css section 13, plus .rgs-still). */

.rgs {
  --rgs-bg: #1b1934; --rgs-bg2: #15132b; --rgs-card: rgba(15, 17, 35, .99); --rgs-card2: #16182a;
  --rgs-line: rgba(169, 158, 245, .12); --rgs-line2: rgba(169, 158, 245, .22);
  --rgs-text: #e2e8f0; --rgs-muted: #a3adc2; --rgs-dim: #8b95ab; --rgs-white: #fff;
  --rgs-p: #a99ef5; --rgs-p2: #c4b5fd; --rgs-p3: #6759d1;
  --rgs-sb: #00C853; --rgs-bw: #6ee7b7; --rgs-nt: #94a3b8; --rgs-brw: #fca5a5; --rgs-sbr: #FF1744;
  --rgs-up: #34d399; --rgs-dn: #f87171; --rgs-amber: #FF9800; --rgs-gold: #f59e0b;
  --rgs-mono: 'Space Grotesk', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --rgs-h: 720px;
  min-width: 0;
}
html:not(.js) .rgs-js, .rgs.rgs-nodata .rgs-js { display: none !important; }

/* ---- panel head ---- */
.rgs .rgs-head { max-width: 72ch; margin: 0 auto var(--lp-sp-5); text-align: center; }
.rgs .rgs-title { color: var(--lp-text); font: 700 var(--lp-fs-lg)/1.25 var(--lp-font-title); letter-spacing: -.01em; }
.rgs .rgs-lead { margin-top: var(--lp-sp-2); color: var(--lp-muted); font-size: var(--lp-fs-base); line-height: 1.6; }

/* ---- the window ---- */
.rgs-window {
  position: relative; overflow: hidden;
  border: 1px solid var(--lp-border-strong); border-radius: var(--lp-r-lg); background: var(--rgs-bg);
  box-shadow: var(--lp-shadow), 0 0 80px color-mix(in srgb, var(--lp-primary) 10%, transparent);
}
.rgs-bar {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px;
  background: #0c0a17; border-bottom: 1px solid rgba(255, 255, 255, .07); white-space: nowrap; overflow: hidden;
}
.rgs-lights { display: inline-flex; gap: 6px; }
.rgs-lights i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.rgs-lights i + i { background: #febc2e; }
.rgs-lights i + i + i { background: #28c840; }
.rgs-bar-tab { overflow: hidden; text-overflow: ellipsis; padding: 4px 12px; border-radius: 8px 8px 0 0; background: var(--rgs-bg); color: var(--rgs-muted); font-size: 12px; }
.rgs-bar-tab b { color: var(--rgs-white); font-weight: 800; }
.rgs-bar-url { overflow: hidden; text-overflow: ellipsis; color: #8e8ab4; font: 11.5px/1 'JetBrains Mono', ui-monospace, Menlo, monospace; }

.rgs-scroll {
  position: relative; height: var(--rgs-h); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(103, 89, 209, .4) transparent;
  background: radial-gradient(120% 60% at 90% 0%, rgba(103, 89, 209, .14), transparent 60%), var(--rgs-bg);
}
html:not(.js) .rgs-scroll, .rgs.rgs-nodata .rgs-scroll { height: auto; }
.rgs-app { container: rgs / inline-size; min-width: 0; color: var(--rgs-text); font-size: 13px; }
.rgs .rgs-app p { margin: 0; }
.rgs-pghead {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px;
  background: linear-gradient(90deg, #4c9a7c, #6cbf9b 60%, #74c6a2); color: #fff;
}
.rgs-pgname { font: 800 18px/1.2 var(--lp-font-title); letter-spacing: -.01em; text-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.rgs .rgs-pghead .lp-tier { background: rgba(12, 5, 32, .55); }
.rgs .rgs-pghead .lp-sample { margin-left: auto; background: rgba(12, 5, 32, .7); }
.rgs-body { display: flex; flex-direction: column; gap: 14px; padding: 16px; min-width: 0; }

/* page tabs (.slb-page-nav / .mr-nav) */
.rgs-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.rgs .rgs-navbtn {
  padding: 8px 18px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(169, 158, 245, .2); background: rgba(255, 255, 255, .03);
  color: #b4bdd0; font: 600 13px/1.3 var(--lp-font);
}
.rgs .rgs-navbtn:hover { border-color: rgba(169, 158, 245, .45); color: var(--rgs-p2); background: rgba(169, 158, 245, .08); }
.rgs .rgs-navbtn[aria-selected="true"], .rgs .rgs-navbtn.rgs--on {
  background: linear-gradient(135deg, rgba(103, 89, 209, .25), rgba(169, 158, 245, .15)); border-color: rgba(169, 158, 245, .5); color: #e0e7ff;
}
.rgs-view { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rgs-view[hidden] { display: none; }
.rgs-view.rgs--new { animation: rgs-in .3s var(--lp-ease) both; }
.rgs-nojs-label { margin-top: 10px; color: var(--rgs-p2); font: 800 11px/1.3 var(--lp-font); letter-spacing: .12em; text-transform: uppercase; }

/* ---- leaderboard toolbar ---- */
.rgs-toolbar, .rgs-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rgs .rgs-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); color: #b4bdd0; font: 600 12px/1.3 var(--lp-font);
}
.rgs .rgs-pill:hover { border-color: rgba(169, 158, 245, .3); color: var(--rgs-p2); }
.rgs .rgs-pill[aria-pressed="true"], .rgs .rgs-pill.rgs--on { background: rgba(103, 89, 209, .22); border-color: rgba(169, 158, 245, .45); color: #e0e7ff; }
.rgs-pill-ico { font-size: 11px; line-height: 1; }
.rgs .rgs-search {
  width: 140px; height: 30px; padding: 0 12px; border-radius: 8px; outline: none;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--rgs-text);
  font: 600 12px/1 var(--lp-font); text-transform: uppercase; letter-spacing: .04em;
}
.rgs .rgs-search::placeholder { color: var(--rgs-dim); text-transform: uppercase; }
.rgs .rgs-search:focus { border-color: rgba(169, 158, 245, .5); }
.rgs .rgs-search:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.rgs-cols { position: relative; margin-left: auto; }
.rgs .rgs-cols-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(169, 158, 245, .3); background: rgba(103, 89, 209, .1); color: var(--rgs-p); font: 600 12px/1.3 var(--lp-font);
}
.rgs .rgs-cols-btn:hover, .rgs .rgs-cols-btn[aria-expanded="true"] { background: rgba(103, 89, 209, .22); border-color: rgba(169, 158, 245, .5); color: var(--rgs-p2); }
.rgs-cols-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 6; min-width: 240px; max-width: calc(100vw - 64px);
  max-height: 420px; overflow-y: auto; padding: 14px 16px; border-radius: 12px;
  background: #0f1123; border: 1px solid rgba(169, 158, 245, .25); box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
  animation: rgs-pop .18s var(--lp-ease) both;
}
.rgs-cols-panel[hidden] { display: none; }
.rgs-cols-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--rgs-dim); font: 700 10px/1.3 var(--lp-font); letter-spacing: .07em; text-transform: uppercase; }
.rgs .rgs-cols-reset { padding: 0; border: 0; background: none; cursor: pointer; color: #8b8ff8; font: 600 11px/1.3 var(--lp-font); text-decoration: underline; text-transform: none; letter-spacing: 0; }
.rgs .rgs-cols-reset:hover { color: var(--rgs-p2); }
.rgs-cols-group + .rgs-cols-group { margin-top: 10px; }
.rgs .rgs-cols-glabel { margin-bottom: 5px; padding-bottom: 4px; border-bottom: 1px solid rgba(169, 158, 245, .1); color: #8790a6; font: 700 9.5px/1.3 var(--lp-font); letter-spacing: .07em; text-transform: uppercase; }
.rgs .rgs-cols-item { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-radius: 4px; cursor: pointer; color: #b4bdd0; font-size: 12px; user-select: none; }
.rgs .rgs-cols-item:hover { color: var(--rgs-text); }
.rgs .rgs-cols-item.rgs--tour { background: rgba(169, 158, 245, .14); }
.rgs .rgs-cols-item input { width: 14px; height: 14px; margin: 0; flex: none; cursor: pointer; accent-color: var(--rgs-p); }
.rgs-cols-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c); }

/* ---- the table ---- */
.rgs-tablewrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--rgs-line); background: var(--rgs-card); scrollbar-width: thin; scrollbar-color: rgba(103, 89, 209, .4) transparent; }
.rgs .rgs-t { width: 100%; border-collapse: collapse; font-size: 12px; }
.rgs .rgs-t caption { text-align: left; }
.rgs .rgs-t th {
  padding: 10px 12px; text-align: left; white-space: nowrap; vertical-align: middle;
  background: rgba(22, 24, 42, .96); border-bottom: 1px solid rgba(169, 158, 245, .1);
  color: #8792a8; font: 700 10px/1.2 var(--lp-font); letter-spacing: .08em; text-transform: uppercase;
}
.rgs .rgs-t th.rgs--cat { color: color-mix(in srgb, var(--c) 80%, #fff 20%); }
.rgs .rgs-t th[aria-sort] { color: var(--rgs-p2); }
.rgs .rgs-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.rgs .rgs-sort:hover { color: var(--rgs-p); }
.rgs .rgs-sort.rgs--press { transform: scale(.94); }
.rgs-sort-arrow { display: inline-block; min-width: 9px; }
.rgs .rgs-t td { padding: 9px 12px; color: #cbd5e1; white-space: nowrap; vertical-align: middle; border-bottom: 1px solid rgba(255, 255, 255, .035); }
.rgs .rgs-t tbody tr { position: relative; cursor: pointer; will-change: transform; }
.rgs .rgs-t tbody tr:hover td { background: rgba(169, 158, 245, .05); }
.rgs .rgs-t tbody tr.rgs--press td { background: rgba(169, 158, 245, .14); }
.rgs .rgs-t tbody tr.rgs--moving { transition: transform .45s var(--lp-ease); }
.rgs .rgs-t tbody tr.rgs--entering { animation: rgs-row-in .4s var(--lp-ease) both; }
.rgs .rgs-t td.rgs-empty { padding: 48px 20px; text-align: center; color: var(--rgs-dim); white-space: normal; cursor: default; }
.rgs-rank { color: #7c869c; font-size: 11px; font-weight: 600; }
.rgs .rgs-sym { padding: 0; border: 0; background: none; cursor: pointer; color: var(--rgs-p); font: 700 12.5px/1.2 var(--lp-font); letter-spacing: .02em; }
.rgs .rgs-sym:hover { color: var(--rgs-p2); text-decoration: underline; }
.rgs-scell { display: flex; align-items: center; gap: 6px; min-width: 130px; }
.rgs-sarrow { width: 10px; font-size: 10px; line-height: 1; }
.rgs-strack { flex: 1; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .07); }
.rgs-sfill { display: block; height: 100%; border-radius: 3px; transform-origin: left center; }
.rgs-snum { min-width: 46px; text-align: right; font: 800 13px/1 var(--rgs-mono); }
.rgs-heat { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; padding: 4px 8px; border-radius: 6px; font: 700 12px/1.2 var(--rgs-mono); }
/* scoreColor / scoreBg (swing_regime_leaderboard.html) at +/-35 and +/-65 */
.rgs .rgs--z-sb { color: #34d399; } .rgs .rgs--z-b { color: #6ee7b7; } .rgs .rgs--z-n { color: #94a3b8; } .rgs .rgs--z-r { color: #fca5a5; } .rgs .rgs--z-sr { color: #f87171; }
.rgs .rgs-heat.rgs--z-sb { background: rgba(16, 185, 129, .18); } .rgs .rgs-heat.rgs--z-b { background: rgba(16, 185, 129, .09); }
.rgs .rgs-heat.rgs--z-n { background: rgba(100, 116, 139, .10); }
.rgs .rgs-heat.rgs--z-r { background: rgba(239, 68, 68, .09); } .rgs .rgs-heat.rgs--z-sr { background: rgba(239, 68, 68, .18); }
.rgs-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.rgs-badge.rgs--r-STRONG_BULL { background: rgba(16, 185, 129, .18); color: #34d399; border: 1px solid rgba(16, 185, 129, .3); }
.rgs-badge.rgs--r-BULL_WATCH { background: rgba(16, 185, 129, .08); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, .15); }
.rgs-badge.rgs--r-NO_TRADE { background: rgba(100, 116, 139, .15); color: #a3adc2; border: 1px solid rgba(100, 116, 139, .25); }
.rgs-badge.rgs--r-BEAR_WATCH { background: rgba(239, 68, 68, .08); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .15); }
.rgs-badge.rgs--r-STRONG_BEAR { background: rgba(239, 68, 68, .18); color: #f87171; border: 1px solid rgba(239, 68, 68, .3); }
.rgs-setup { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; padding: 2px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 600; background: rgba(99, 102, 241, .12); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, .22); }
.rgs-fit { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: var(--rgs-p); font-size: 11px; }
.rgs-chg { font-weight: 700; }
.rgs-chg.rgs--up { color: #34d399; } .rgs-chg.rgs--dn { color: #f87171; } .rgs-chg.rgs--flat { color: #7c869c; font-weight: 400; }
.rgs-eq { font-weight: 700; font-size: 12px; cursor: help; }
.rgs-eq.rgs--hi { color: #34d399; } .rgs-eq.rgs--mid { color: #fbbf24; } .rgs-eq.rgs--lo { color: #f87171; }
.rgs-drv { display: flex; flex-direction: column; gap: 3px; min-width: 140px; }
.rgs-drvp { display: inline-flex; align-self: flex-start; padding: 2px 7px; border-radius: 20px; font-size: 10px; font-weight: 700; }
.rgs-drvp.rgs--up { background: rgba(16, 185, 129, .12); color: #34d399; border: 1px solid rgba(16, 185, 129, .2); }
.rgs-drvp.rgs--dn { background: rgba(239, 68, 68, .1); color: #f87171; border: 1px solid rgba(239, 68, 68, .2); }
.rgs .rgs-count { align-self: flex-end; color: var(--rgs-dim); font-size: 11px; }

/* ---- ticker view: hero ---- */
.rgs-hero { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 6px 4px 4px; }
.rgs-tk { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.rgs-tk-sym {
  font: 900 34px/1 var(--lp-font); letter-spacing: -1px;
  background: linear-gradient(90deg, #e0e7ff, #a99ef5, #38bdf8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #c4b5fd;
}
.rgs-tk-px { color: #fff; font: 700 26px/1 var(--lp-font); }
.rgs .rgs-tk-label { margin-top: 6px; color: #fff; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.rgs-an { display: flex; align-items: center; gap: 10px; }
.rgs .rgs-an-in {
  width: 110px; height: 40px; padding: 0 14px; border-radius: 10px; outline: none;
  border: 1px solid rgba(169, 158, 245, .3); background: rgba(255, 255, 255, .05); color: #e0e7ff;
  font: 700 14px/1 var(--lp-font); letter-spacing: .08em; text-transform: uppercase;
}
.rgs .rgs-an-in:focus { border-color: var(--rgs-p); box-shadow: 0 0 0 3px rgba(169, 158, 245, .15); }
.rgs .rgs-an-in:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.rgs .rgs-an-btn {
  height: 40px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer; color: #fff; font: 700 14px/1 var(--lp-font);
  background: linear-gradient(135deg, #6759d1, #a99ef5); box-shadow: 0 4px 16px rgba(103, 89, 209, .45); transition: transform .15s;
}
.rgs .rgs-an-btn:hover { transform: translateY(-1px); }
.rgs .rgs-an-btn.rgs--press, .rgs .rgs-pill.rgs--press, .rgs .rgs-navbtn.rgs--press, .rgs .rgs-tog.rgs--press, .rgs .rgs-cols-btn.rgs--press { transform: scale(.94); }
.rgs .rgs-an-note { flex-basis: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .08); color: #fde7b0; font-size: 12.5px; }
.rgs .rgs-an-note[hidden] { display: none; }

/* regime banner and average cards (.regime-banner / .period-avg-card) */
.rgs-row { display: flex; gap: 12px; align-items: stretch; }
.rgs-banner, .rgs-avg {
  position: relative; overflow: hidden; border-radius: 18px;
  background: linear-gradient(135deg, rgba(100, 116, 139, .14), rgba(100, 116, 139, .05)); border: 1px solid rgba(100, 116, 139, .28);
}
.rgs-banner::before, .rgs-avg::before { content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none; background: radial-gradient(circle at 85% 40%, #fff 0%, transparent 60%); }
.rgs-banner { flex: 0 0 calc(50% - 6px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 22px 24px; }
.rgs-banner-l { min-width: 0; }
.rgs .rgs-banner-label { font: 900 26px/1.1 var(--lp-font); letter-spacing: .01em; color: var(--rgs-nt); }
.rgs-big { font: 900 58px/1 var(--lp-font); letter-spacing: -3px; opacity: .92; color: var(--rgs-nt); font-variant-numeric: tabular-nums; }
.rgs-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rgs-tag { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.rgs-tag.rgs--t-setup { background: rgba(99, 102, 241, .15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, .25); }
.rgs-tag.rgs--t-strat { background: rgba(139, 92, 246, .15); color: var(--rgs-p2); border: 1px solid rgba(139, 92, 246, .25); }
.rgs-tag.rgs--t-hi { background: rgba(0, 200, 83, .15); color: #00C853; border: 1px solid rgba(0, 200, 83, .25); }
.rgs-tag.rgs--t-mid { background: rgba(255, 152, 0, .15); color: #FF9800; border: 1px solid rgba(255, 152, 0, .25); }
.rgs-tag.rgs--t-lo { background: rgba(255, 23, 68, .15); color: #ff5c7c; border: 1px solid rgba(255, 23, 68, .25); }
.rgs-tag.rgs--t-d1 { background: rgba(255, 255, 255, .05); color: #fff; border: 1px solid rgba(255, 255, 255, .08); }
.rgs-avgs { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rgs-avg { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 14px; text-align: center; }
.rgs .rgs-avg-t { margin-bottom: 10px; color: #fff; font: 700 10px/1.3 var(--lp-font); letter-spacing: .1em; text-transform: uppercase; }
.rgs-avg-v { font: 900 40px/1 var(--lp-font); letter-spacing: -2px; opacity: .92; color: var(--rgs-nt); }
.rgs .rgs--strong-bull { background: linear-gradient(135deg, rgba(0, 200, 83, .18), rgba(0, 200, 83, .06)); border-color: rgba(0, 200, 83, .38); }
.rgs .rgs--bull-watch { background: linear-gradient(135deg, rgba(110, 231, 183, .14), rgba(110, 231, 183, .05)); border-color: rgba(110, 231, 183, .32); }
.rgs .rgs--bear-watch { background: linear-gradient(135deg, rgba(252, 165, 165, .14), rgba(252, 165, 165, .05)); border-color: rgba(252, 165, 165, .32); }
.rgs .rgs--strong-bear { background: linear-gradient(135deg, rgba(255, 23, 68, .18), rgba(255, 23, 68, .06)); border-color: rgba(255, 23, 68, .38); }
.rgs .rgs--strong-bull .rgs-banner-label, .rgs .rgs--strong-bull .rgs-big, .rgs .rgs--strong-bull .rgs-avg-v { color: var(--rgs-sb); }
.rgs .rgs--bull-watch .rgs-banner-label, .rgs .rgs--bull-watch .rgs-big, .rgs .rgs--bull-watch .rgs-avg-v { color: var(--rgs-bw); }
.rgs .rgs--bear-watch .rgs-banner-label, .rgs .rgs--bear-watch .rgs-big, .rgs .rgs--bear-watch .rgs-avg-v { color: var(--rgs-brw); }
.rgs .rgs--strong-bear .rgs-banner-label, .rgs .rgs--strong-bear .rgs-big, .rgs .rgs--strong-bear .rgs-avg-v { color: #ff4d6d; }

/* the score bar (.gauge-*) */
.rgs-gauge { padding: 16px 20px; border-radius: 14px; background: linear-gradient(145deg, rgba(22, 24, 42, .95), rgba(15, 17, 35, .98)); border: 1px solid rgba(169, 158, 245, .1); }
.rgs-ghead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; color: #fff; font: 600 11px/1.3 var(--lp-font); letter-spacing: .09em; text-transform: uppercase; }
.rgs-gval { color: var(--rgs-p); font-size: 12.5px; font-weight: 700; }
.rgs-gtrack {
  position: relative; height: 12px; margin: 6px 0; border-radius: 6px;
  background: linear-gradient(90deg, #FF1744 0%, #FF1744 17.5%, #f87171 17.5%, #f87171 32.5%, #757575 32.5%, #757575 67.5%, #6ee7b7 67.5%, #6ee7b7 82.5%, #00C853 82.5%, #00C853 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .4);
}
.rgs-grail { position: absolute; inset: 0; transform: translateX(50%); will-change: transform; }
.rgs-needle { position: absolute; left: 0; top: -6px; width: 3px; height: 24px; margin-left: -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .8), 0 0 20px rgba(255, 255, 255, .3); }
.rgs-glabels { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; color: #fff; font-size: 9.5px; letter-spacing: .03em; }

/* section labels (.section-label) */
.rgs .rgs-sec { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: #fff; font: 700 10px/1.3 var(--lp-font); letter-spacing: .12em; text-transform: uppercase; }
.rgs-sec::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(169, 158, 245, .18), transparent); }
.rgs-sec small { color: #d8dcea; font-size: 9.5px; font-weight: 400; letter-spacing: 0; text-transform: none; }

/* the history chart */
.rgs-hist { position: relative; padding: 18px 18px 12px; border-radius: 18px; background: linear-gradient(145deg, rgba(22, 24, 42, .98), rgba(15, 17, 35, .99)); border: 1px solid rgba(169, 158, 245, .12); }
.rgs-hist-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.rgs .rgs-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; padding: 0; list-style: none; }
.rgs .rgs-legend li { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; }
.rgs-legend i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.rgs-legend .rgs--line i { width: 14px; height: 2px; border-radius: 1px; }
.rgs-legend .rgs--ema { transition: opacity .2s; }
.rgs-legend.rgs--ema-off .rgs--ema { opacity: .3; }
.rgs-hist-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rgs .rgs-tog { padding: 3px 10px; border-radius: 20px; cursor: pointer; font: 700 10px/1.4 var(--lp-font); letter-spacing: .03em; border: 1px solid rgba(255, 255, 255, .15); color: #9aa3b5; background: rgba(255, 255, 255, .03); }
.rgs .rgs-tog[aria-pressed="true"].rgs--avg { border-color: rgba(169, 158, 245, .5); color: rgba(169, 158, 245, .95); background: rgba(169, 158, 245, .08); }
.rgs .rgs-tog[aria-pressed="true"].rgs--ema { border-color: rgba(255, 213, 79, .5); color: rgba(255, 213, 79, .95); background: rgba(255, 213, 79, .08); }
.rgs-days { padding: 3px 10px; border-radius: 20px; background: rgba(169, 158, 245, .08); border: 1px solid rgba(169, 158, 245, .15); color: #fff; font-size: 10px; }
.rgs-axis-t { color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.rgs-stage { position: relative; height: 260px; }
.rgs-stage canvas, .rgs-stage svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.rgs-stage canvas { cursor: crosshair; touch-action: pan-y; }
.rgs-stage canvas:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.rgs-tip {
  position: absolute; left: 0; top: 0; z-index: 3; min-width: 150px; padding: 10px 12px; border-radius: 12px; pointer-events: none;
  background: rgba(10, 12, 28, .97); border: 1px solid rgba(169, 158, 245, .28); color: #fff; font-size: 11.5px; line-height: 1.55;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45); opacity: 0; transition: opacity .12s;
}
.rgs-tip.rgs--on { opacity: 1; }
.rgs-tip b { display: block; margin-bottom: 2px; font-size: 12.5px; }
.rgs-tip span { display: block; white-space: nowrap; }
.rgs .rgs-chart-foot { margin-top: 6px; color: var(--rgs-muted); font-size: 11px; }
.rgs-stage--poster { height: auto; }
.rgs .rgs-stage--poster svg { position: static; width: 100%; height: auto; }
.rgs-ax { fill: #fff; font: 600 11px var(--lp-font); }

/* card grids (.tf-grid / .cat-grid / .subscore-grid / .breadth-grid) */
.rgs-tf, .rgs-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rgs-cat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.rgs-ind { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rgs-g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rgs-card { position: relative; min-width: 0; border-radius: 14px; background: linear-gradient(145deg, rgba(22, 24, 42, .98), rgba(15, 17, 35, .99)); border: 1px solid rgba(169, 158, 245, .1); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.rgs-tfc { padding: 14px 16px; text-align: center; border-top: 2px solid var(--c40, rgba(148, 163, 184, .25)); }
.rgs .rgs-k { color: #fff; font: 700 10px/1.3 var(--lp-font); letter-spacing: .1em; text-transform: uppercase; }
.rgs-tf-r { margin-top: 6px; font: 800 18px/1.2 var(--lp-font); }
.rgs-tf-s { font-size: 13px; font-weight: 700; opacity: .85; }
.rgs .rgs-tf-sub { margin-top: 6px; color: #fff; font-size: 10px; }
.rgs-bar5 { position: relative; height: 5px; margin-top: 10px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.rgs-bar5 > i, .rgs-bar3 > i, .rgs-bar4 > i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 3px; transform-origin: left center; }
.rgs-catc { padding: 14px 8px; text-align: center; border-top: 2px solid var(--c40, rgba(148, 163, 184, .25)); }
.rgs-cat-v { margin-top: 8px; font: 900 24px/1 var(--lp-font); }
.rgs-cbar { position: relative; height: 5px; margin-top: 10px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.rgs-cbar::after { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: 100%; background: rgba(255, 255, 255, .18); }
.rgs-cbar > i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.rgs-cbar > i.rgs--pos { left: 50%; transform-origin: left center; }
.rgs-cbar > i.rgs--neg { right: 50%; transform-origin: right center; }
.rgs-indc { padding: 11px 9px; text-align: center; border-radius: 11px; }
.rgs-ind-v { min-height: 18px; margin-top: 6px; font-size: 13px; font-weight: 700; line-height: 1.25; }
.rgs .rgs-ind-sub { margin-top: 3px; color: #fff; font-size: 9.5px; }
.rgs-bar3 { position: relative; height: 3px; margin-top: 7px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.rgs-info { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 13px; }
.rgs-ico { display: flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: rgba(169, 158, 245, .08); color: var(--rgs-p); }
.rgs-info-b { flex: 1; min-width: 0; }
.rgs .rgs-info-n { margin-bottom: 4px; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.rgs-info-v { font: 800 20px/1.15 var(--lp-font); }
.rgs .rgs-info-s { margin-top: 3px; color: #fff; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.rgs-bar4 { position: relative; height: 4px; margin-top: 8px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.rgs-perf { display: flex; gap: 20px; margin-top: 8px; }
.rgs-perf-v { font: 800 21px/1.2 var(--lp-font); }
.rgs-drvg { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.rgs-drvc.rgs--up { background: rgba(0, 200, 83, .06); border-color: rgba(0, 200, 83, .22); }
.rgs-drvc.rgs--dn { background: rgba(255, 23, 68, .06); border-color: rgba(255, 23, 68, .22); }
.rgs-drvc .rgs-info-v { font-size: 25px; }
.rgs .rgs-important { margin-top: 10px; padding: 14px 18px; border-radius: 12px; text-align: center; background: rgba(169, 158, 245, .06); border: 1px solid rgba(169, 158, 245, .18); color: var(--rgs-p2); font-size: 12.5px; font-weight: 700; line-height: 1.65; }
.rgs .rgs-important strong { color: #e0e7ff; }

/* colour helpers for readings */
.rgs .rgs--c-sb { color: #00C853; } .rgs .rgs--c-bw { color: #6ee7b7; } .rgs .rgs--c-nt { color: #a3adc2; } .rgs .rgs--c-brw { color: #fca5a5; } .rgs .rgs--c-sbr { color: #ff4d6d; }
.rgs .rgs--c-up { color: #00C853; } .rgs .rgs--c-dn { color: #ff4d6d; } .rgs .rgs--c-am { color: #FF9800; } .rgs .rgs--c-gd { color: #f59e0b; } .rgs .rgs--c-w { color: #fff; } .rgs .rgs--c-bl { color: #6ee7b7; }

/* ---- below the window: autoplay pill, play controls, sample note, links ---- */
.rgs-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--lp-sp-3) var(--lp-sp-5); margin-top: var(--lp-sp-4); }
.rgs-ctl-l { display: flex; flex-wrap: wrap; align-items: center; gap: var(--lp-sp-2) var(--lp-sp-3); }
.rgs-play { display: flex; gap: var(--lp-sp-2); }
.rgs-ico-play, .rgs.rgs--paused .rgs-ico-pause { display: none; }
.rgs.rgs--paused .rgs-ico-play { display: inline; }
.rgs-auto {
  position: relative; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; height: 32px; padding: 0 14px;
  border: 1px solid var(--lp-border-strong); border-radius: var(--lp-r-pill); background: var(--lp-surface-2);
  color: var(--lp-muted); font-size: var(--lp-fs-xs); font-weight: 600; white-space: nowrap;
}
.rgs-auto-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lp-green); }
.rgs-auto.rgs--run .rgs-auto-dot { animation: rgs-blink 1.6s ease-in-out infinite; }
.rgs-auto.rgs--idle .rgs-auto-dot, .rgs-auto.rgs--off .rgs-auto-dot { background: var(--lp-amber); }
.rgs-auto-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: color-mix(in srgb, var(--lp-primary) 18%, transparent); }
.rgs-auto-bar i { position: absolute; inset: 0; background: var(--lp-primary); transform: scaleX(0); transform-origin: left center; }
.rgs .rgs-hint { color: var(--lp-muted); font-size: var(--lp-fs-xs); }
.rgs .rgs-sample-note { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--lp-sp-2); color: var(--lp-muted); font-size: var(--lp-fs-xs); }
.rgs-foot { display: flex; flex-direction: column; align-items: center; gap: var(--lp-sp-3); margin-top: var(--lp-sp-5); text-align: center; }
.rgs-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--lp-sp-3); }
.rgs .rgs-foot-note { max-width: 66ch; color: var(--lp-muted); font-size: var(--lp-fs-sm); }

/* ---- motion ---- */
@keyframes rgs-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rgs-row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rgs-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes rgs-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.rgs-still .rgs-view, .rgs-still .rgs-t tr, .rgs-still .rgs-cols-panel, .rgs-still .rgs-auto-dot { animation: none !important; transition: none !important; }
.rgs-still .rgs-auto, .rgs-still .rgs-play { display: none; }
.rgs:not(.rgs-still) .rgs-hint { display: none; }

/* ---- the window's own width (container queries on .rgs-app) ---- */
@container rgs (max-width: 1100px) {
  .rgs-cat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container rgs (max-width: 900px) {
  .rgs-row { flex-direction: column; }
  .rgs-banner { flex: none; }
  .rgs-cat, .rgs-ind { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rgs-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container rgs (max-width: 640px) {
  .rgs-body { padding: 12px; gap: 12px; }
  .rgs-cat, .rgs-ind, .rgs-g3, .rgs-drvg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rgs-tf { grid-template-columns: minmax(0, 1fr); }
  .rgs-cols { margin-left: 0; }
  .rgs-cols-panel { left: 0; right: auto; }
  .rgs-big { font-size: 44px; }
  .rgs-tk-sym { font-size: 28px; }
  .rgs-tk-px { font-size: 22px; }
  .rgs-avg-v { font-size: 32px; }
  .rgs-stage { height: 220px; }
  .rgs .rgs-search { width: 120px; }
  .rgs-hero { align-items: flex-start; }
}
@container rgs (max-width: 460px) {
  .rgs-g3, .rgs-g4, .rgs-drvg { grid-template-columns: minmax(0, 1fr); }
  .rgs-avgs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rgs-banner { padding: 18px; }
  .rgs .rgs-banner-label { font-size: 22px; }
  .rgs-glabels { font-size: 8.5px; }
  .rgs-glabels span:nth-child(2), .rgs-glabels span:nth-child(4) { visibility: hidden; }
  .rgs-an { width: 100%; }
  .rgs .rgs-an-in { flex: 1; width: auto; min-width: 0; }
}

/* ---- the page width ---- */
@media (max-width: 640px) {
  .rgs { --rgs-h: 600px; }
  .rgs-scroll { overscroll-behavior-y: auto; }   /* let a swipe at the end carry on down the page */
  .rgs-bar-url { display: none; }
  .rgs-controls { justify-content: center; }
  .rgs .rgs-sample-note { justify-content: center; text-align: center; }
}
@media (max-width: 479.98px) {
  .rgs-ctas, .rgs-ctas .lp-btn { width: 100%; }
}
