/* RTJ Insider · black + yellow glass. Shell built like the MVP CRM (side menu with elastic
   indicator, glass top bar, odometer numbers), recoloured to the RTJ logo. */
:root {
  /* Calm version: warm off-black, soft ivory text, a muted logo yellow */
  --bg: #0b0a08;
  --panel: rgba(18, 17, 13, .6);
  --panel-solid: #141310;                /* sticky table heads, popovers */
  --panel-2: rgba(40, 37, 28, .6);
  --panel-3: rgba(58, 54, 40, .7);
  --line: rgba(255, 240, 200, .07);
  --line-2: rgba(255, 240, 200, .13);
  --text: #e9e4d6;
  --muted: #b3ad9c;
  --dim: #928c7b;                        /* ≥4.5:1 on the panels */

  /* Logo yellow, softened */
  --gold: #e3b53a;
  --gold-hi: #ecc65e;
  --gold-soft: rgba(227, 181, 58, .11);
  --gold-line: rgba(227, 181, 58, .4);
  --on-gold: #17120a;

  /* Price direction only */
  --up: #5cc08d;
  --down: #e0706b;
  --up-bg: rgba(92, 192, 141, .12);
  --down-bg: rgba(224, 112, 107, .12);
  --warn: #e39a55;
  --warn-bg: rgba(227, 154, 85, .1);
  --violet: #ab9ae6;

  --glass: rgba(16, 15, 11, .62);
  --glass-brd: rgba(255, 255, 255, .05);
  --glass-hi: rgba(255, 255, 255, .07);
  --spot: 227, 181, 58;                  /* cursor light colour (rgb) */

  --radius: 18px;                        /* card */
  --r-md: 12px;                          /* inner blocks: card radius − 6px padding */
  --r-sm: 10px;                          /* nav items: side 22px − 12px padding */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --display: "Roboto Flex", "Inter", system-ui, sans-serif;  /* same display family as the RTJ site, has Greek */
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(242, 194, 48, .3); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.up { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
.gold { color: var(--gold); }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: rgba(227, 181, 58, .28) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(227, 181, 58, .22); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(227, 181, 58, .45); }
::-webkit-scrollbar-corner { background: transparent; }
h1, h2, h3 { text-wrap: balance; }
p, small { text-wrap: pretty; }
@keyframes popIn { from { opacity: 0; transform: scale(.95); } }


/* Soft yellow light behind the glass */
/* Static light (no drift): the glass then re-blurs only on scroll, not every frame */
.blob { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: -1; }
.b1 { width: 520px; height: 520px; left: 30%; top: 40%; background: #e3b53a; opacity: .06; }
.b2 { width: 420px; height: 420px; right: 2%; top: -10%; background: #c98a1e; opacity: .08; }

/* ---------- Liquid glass (calm) ----------
   Quiet frosted panels at rest. The light comes from the cursor: where it passes, the rim and
   the glass light up in soft gold (--mx/--my from app.js; --glow fades in/out on hover). */
@property --glow { syntax: "<number>"; inherits: true; initial-value: 0; }
.glass, .card {
  position: relative; isolation: isolate; --glow: 0; transition: --glow .5s ease;
  background:
    radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--spot), calc(.018 * var(--glow))), transparent 65%),
    linear-gradient(155deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01) 40%, rgba(255, 255, 255, 0) 65%),
    var(--glass);
  border: 1px solid transparent;
  backdrop-filter: blur(18px) saturate(1.25); -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 18px 44px -16px rgba(0, 0, 0, .55);
}
.glass:hover, .card:hover { --glow: 1; }
/* resting rim: barely there */
.glass::before, .card::before, .glass::after, .card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
.glass::before, .card::before {
  background: linear-gradient(150deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05) 30%, rgba(255, 255, 255, .03) 65%, rgba(227, 181, 58, .14));
}
/* cursor rim: the edge nearest the pointer catches the light */
.glass::after, .card::after {
  background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--spot), calc(.14 * var(--glow))), transparent 70%);
}

/* ---------- Shell ---------- */
.shell { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 14px; padding: 14px; }
.side { border-radius: 22px; padding: 14px 12px 12px; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 16px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(242, 194, 48, .25); }
.brand b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.brand span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 550; }

#nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.grp { font-size: 11.5px; font-weight: 600; color: var(--dim); padding: 18px 12px 6px; }
.nav-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 550; color: var(--muted); background: none; border: 0; cursor: pointer; text-align: left;
  transition: background .2s, color .25s;
}
.nav-item svg { flex: none; opacity: .85; }
.nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover:not(.active) { background: rgba(255, 226, 140, .05); color: var(--text); }
.nav-item.active { color: var(--on-gold); font-weight: 650; }
.nav-item.active svg { opacity: 1; }
/* Elastic indicator: clip-path over the whole nav, tweened in app.js */
.nav-pill {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; clip-path: inset(0 0 100% 0 round 10px);
  background: radial-gradient(140% 100% at 50% -20%, rgba(255, 255, 255, .22), transparent 50%), linear-gradient(180deg, var(--gold-hi), var(--gold));
  box-shadow: 0 6px 16px rgba(227, 181, 58, .16), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.more-btn, .more-sheet { display: none; }

.side-foot { margin-top: auto; padding: 14px 6px 2px; display: grid; gap: 10px; }
.side-foot p { margin: 0; font-size: 11px; line-height: 1.45; color: var(--dim); }
.lang { display: inline-flex; justify-self: start; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.lang button {
  background: none; border: 0; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: var(--dim); cursor: pointer; transition: color .15s, background .15s;
}
.lang button:hover { color: var(--text); }
.lang button.on { background: var(--panel-3); color: var(--text); }

.main { display: grid; grid-template-rows: 58px minmax(0, 1fr) 36px; gap: 14px; min-width: 0; min-height: 0; }

/* ---------- Top bar ---------- */
.topbar { position: relative; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 12px; border-radius: 18px; }
.top-brand { display: none; }
.sp { flex: 1; }
.loadbar {
  position: absolute; left: 18px; bottom: -1px; height: 2px; width: 0; z-index: 2; border-radius: 2px;
  background: var(--gold); opacity: 0; transition: width .4s, opacity .3s;
}
body.loading .loadbar { width: 60%; opacity: 1; transition: width 4s, opacity .1s; }

.search { position: relative; flex: 1; max-width: 420px; min-width: 0; }
.search input {
  width: 100%; height: 38px; padding: 0 40px 0 38px; border-radius: 999px;
  background: rgba(255, 226, 140, .05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='none' stroke='%23aaa595' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
  border: 1px solid var(--line-2); outline: none; transition: border-color .15s, background-color .15s;
}
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--gold); background-color: rgba(255, 226, 140, .08); }
.kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 11px var(--mono);
  padding: 2px 8px; border-radius: 6px; background: var(--panel-3); color: var(--muted); pointer-events: none;
}
.search-results {
  position: absolute; top: 46px; left: 0; min-width: 100%; width: max-content; max-width: 320px; z-index: 60;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; display: none; padding: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
}
.search-results.open { display: block; transform-origin: top left; animation: popIn .18s var(--ease-out); }
.search-results a { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.search-results a:hover, .search-results a.sel { background: var(--panel-3); }

.clock { color: var(--dim); font-size: 12px; white-space: nowrap; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: rgba(255, 226, 140, .05); border: 1px solid var(--line-2); border-radius: 50%; color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--panel-3); border-color: var(--gold-line); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); display: none; box-shadow: 0 0 0 2px #14130e; }
.icon-btn .dot.on { display: block; }
.live-pill {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px; flex: none;
  border: 1px solid var(--line-2); background: rgba(255, 226, 140, .05); font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--muted);
}
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.live-pill.ok i { background: var(--up); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(76,187,130,.55); } 70% { box-shadow: 0 0 0 7px rgba(76,187,130,0); } 100% { box-shadow: 0 0 0 0 rgba(76,187,130,0); } }
.live-pill.bad i { background: var(--down); }

.alerts-menu {
  position: absolute; right: 0; top: 66px; width: min(330px, calc(100vw - 28px)); padding: 16px;
  border-radius: 18px; background: rgba(18, 17, 12, .92);
  transform-origin: top right; animation: popIn .2s var(--ease-out);
}
.alerts-menu h4 { margin: 0 0 4px; font-size: 14px; }
.alerts-menu p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.toggle-row small { display: block; color: var(--muted); font-size: 11px; }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--panel-3); cursor: pointer; transition: background .15s; }
.switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #d8d3c4;
  transition: transform .2s var(--ease-out), width .15s var(--ease-out);
}
.switch input:active + span::after { width: 18px; }
.switch input:checked:active + span::after { transform: translateX(14px); }
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--on-gold); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Page ---------- */
.view { overflow-y: auto; overflow-x: hidden; min-width: 0; min-height: 0; padding: 8px 4px 24px; scrollbar-gutter: stable; animation: fade .2s ease-out; }
.view > * { max-width: 1560px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head > div { min-width: 0; }
.page-head h1 { margin: 0; font: 800 26px/1.15 var(--display); font-stretch: 88%; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; }
.page-head h1.display { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.page-head p { margin: 5px 0 0; color: var(--muted); max-width: 720px; font-size: 13.5px; }
.page-head p.eyebrow { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--gold); text-transform: capitalize; }
.h-ico {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .045); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line);
}
.h-ico svg { width: 18px; height: 18px; }
.head-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main-side { grid-template-columns: minmax(0, 1fr) 360px; }
.cols-side-main { grid-template-columns: 340px minmax(0, 1fr); }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }

.card { border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 50px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.005em; color: var(--text); }
.card-head .sub { color: var(--dim); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 14px 18px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 11px 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
/* Rounded clip for the last row hover inside flush cards */
.card > .card-body.flush:last-child { border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }

.kpi { padding: 16px 18px; display: block; position: relative; overflow: hidden; }
.kpi .label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 550; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .label .ico { width: 18px; height: 18px; border-radius: 50%; }
.kpi .value { font: 650 clamp(19px, 1.6vw, 24px)/1.25 var(--mono); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 6px; letter-spacing: -.01em; }
.kpi .meta { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .spark-bg { display: none; }
a.card, a.kpi { cursor: pointer; transition: border-color .2s, transform .2s, background .2s; }

/* Odometer digits */
.odo { display: inline-flex; overflow: hidden; height: 1.2em; line-height: 1.2em; vertical-align: bottom; }
.odo-d { display: inline-flex; flex-direction: column; transition: transform 1.3s cubic-bezier(.2, .8, .15, 1); }
.odo-d > span { height: 1.2em; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  color: var(--dim); padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1; background: var(--panel-solid);
}
.t td { padding: 11px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t .r { text-align: right; }
.t tbody tr.click { cursor: pointer; transition: background .12s; }
.t tbody tr.click:hover { background: rgba(255, 226, 140, .04); }
.t tr.flash { animation: flash 1.5s ease-out; }
@keyframes flash { from { background: var(--gold-soft); } to { background: transparent; } }
.scroll { max-height: 560px; overflow-y: auto; }
.scroll.sm { max-height: 360px; }

.t th[data-sort] { cursor: pointer; user-select: none; }
.t th[data-sort]:hover { color: var(--text); }
.t th.sorted { color: var(--gold); }
.t th.sorted::after { content: ""; display: inline-block; margin-left: 6px; vertical-align: middle; border: 4px solid transparent; }
.t th.sorted[data-dir="desc"]::after { border-top-color: currentColor; transform: translateY(2px); }
.t th.sorted[data-dir="asc"]::after { border-bottom-color: currentColor; transform: translateY(-2px); }

.sym { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; }
.sym .ico {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 700 8.5px var(--sans); color: #15120a; flex: none;
}
.sym .ico.img { object-fit: cover; background: var(--panel-3); }
.sym small { color: var(--dim); font-weight: 400; }
.ico.img { border-radius: 50%; }

.spark { display: block; overflow: visible; }
td .spark { margin-left: auto; }

.tick-up { animation: tickUp 1s ease-out; }
.tick-down { animation: tickDown 1s ease-out; }
@keyframes tickUp { 0% { background: rgba(76,187,130,.26); color: var(--up); } 100% { background: transparent; } }
@keyframes tickDown { 0% { background: rgba(229,97,94,.26); color: var(--down); } 100% { background: transparent; } }

.live-ind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.live-ind i { width: 6px; height: 6px; border-radius: 50%; background: var(--up); }
.live-ind.stale i { background: var(--warn); animation: none; }

.rules { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rule { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 226, 140, .04); border: 1px solid var(--line-2); font-size: 12px; color: var(--muted); white-space: nowrap; }
.rule b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.info { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--dim); font-size: 11px; cursor: help; position: relative; }
.info:hover { color: var(--text); }
.info[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; top: 28px; left: 50%; transform: translateX(-50%); z-index: 30;
  width: max-content; max-width: min(320px, 80vw); white-space: normal; text-align: left;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 11px;
  color: var(--text); font-size: 12px; line-height: 1.45; box-shadow: 0 12px 28px rgba(0,0,0,.5);
}

.quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quick button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 4px; border-radius: 999px; background: rgba(255, 226, 140, .04);
  border: 1px solid var(--line-2); cursor: pointer; font-size: 12px; font-weight: 550; transition: border-color .15s; }
.quick button:hover { border-color: var(--gold-line); }
.quick button .ico { width: 18px; height: 18px; border-radius: 50%; }

.gauge-needle { transform-box: view-box; transition: transform .7s var(--ease-out); }

.chip svg { flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; background: var(--panel-3); color: var(--muted); white-space: nowrap;
}
.chip.up { background: var(--up-bg); color: var(--up); }
.chip.down { background: var(--down-bg); color: var(--down); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.accent, .chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.violet { background: rgba(173,152,240,.13); color: var(--violet); }
.chip.click { cursor: pointer; }
.chip.click:hover { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
@keyframes blink { 50% { opacity: .25; } }

.bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }

/* ---------- Controls ---------- */
.seg { display: inline-flex; background: rgba(255, 226, 140, .04); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  background: transparent; border: 0; padding: 6px 13px; border-radius: 999px; color: var(--muted); cursor: pointer;
  font-size: 12px; font-weight: 600; white-space: nowrap; transition: color .15s, background .2s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.seg.long-short button.on[data-v="long"] { background: var(--up); color: #06180e; }
.seg.long-short button.on[data-v="short"] { background: var(--down); color: #1d0605; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px;
  background: rgba(255, 226, 140, .05); border: 1px solid var(--line-2); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: border-color .15s, background .2s, transform .15s, box-shadow .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:hover { border-color: var(--gold-line); }
/* Soft liquid yellow */
.btn.primary {
  background: radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, .22), transparent 55%), linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: rgba(255, 236, 170, .3); color: var(--on-gold); font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(227, 181, 58, .16);
}
.btn.primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 24px rgba(227, 181, 58, .28); }

/* Cursor light on small controls: a gold spot sits under the pointer while hovering */
.btn:not(.primary):hover, .nav-item:not(.active):hover, .tool-row:hover, .mover:hover, .feed li:hover, .more-sheet a:not(.active):hover, .seg button:not(.on):hover {
  background-image: radial-gradient(90px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--spot), .03), transparent 70%);
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 226, 140, .05); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn.on { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-line); }
.btn:disabled { opacity: .5; cursor: progress; }
.x-btn { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 5px 7px; border-radius: 8px; }
.x-btn:hover { color: var(--down); }
.star-btn.on { color: var(--gold); border-color: var(--gold-line); }
.star-btn.on svg { fill: currentColor; }
.x-btn svg { display: block; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 550; color: var(--muted); }
.input {
  display: flex; align-items: center; gap: 8px; height: 42px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2); border-radius: 12px; padding: 0 14px;
  min-width: 0; transition: border-color .15s, box-shadow .15s;
}
.input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 194, 48, .12); }
.input input { flex: 1; min-width: 0; width: 100%; background: none; border: 0; outline: none; font-family: var(--mono); font-size: 14px; }
.input input::placeholder { color: var(--dim); }
.input span { color: var(--dim); font-size: 12px; flex: none; }
input[type=range] { width: 100%; accent-color: var(--gold); cursor: pointer; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); transition: background .12s; }
.feed li > a { min-width: 0; }
.feed li:hover { background: rgba(255, 226, 140, .04); }
.feed li:last-child { border-bottom: 0; }
.feed li.new { animation: flash 1.5s ease-out; }
.feed li.feed-empty, .feed li.feed-skel { display: block; }
.feed .chip { min-width: 52px; justify-content: center; }
.feed .t1 { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .t2 { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .when { color: var(--dim); font-size: 11px; text-align: right; white-space: nowrap; }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; font-weight: 650; }
.t td .empty { white-space: normal; position: sticky; left: 0; max-width: calc(100vw - 30px); }
.empty .spinner { margin: 0 auto 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 11px 16px; border-radius: 14px; margin-bottom: 16px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(243, 154, 61, .22); font-size: 12.5px;
}
.notice.ok { background: var(--up-bg); color: var(--up); border-color: rgba(76,187,130,.25); }
.progress { height: 5px; background: var(--line-2); border-radius: 999px; overflow: hidden; flex: 1; min-width: 80px; max-width: 220px; }
.progress i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

.chart { height: 440px; position: relative; }
.chart.tall { height: 520px; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 5px; }

.sig { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.sig:last-child { border-bottom: 0; }
.sig .pip { width: 8px; height: 8px; border-radius: 50%; }
.sig .v { font-family: var(--mono); font-size: 12.5px; text-align: right; }

.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stat-row:last-child { border-bottom: 0; }

.flow-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 78px; gap: 10px; align-items: center; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
.flow-row:hover { background: rgba(255, 226, 140, .05); }

/* ---------- Home: bento grid ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.bento > * { min-width: 0; }
.b-hero { grid-column: span 8; padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.b-btc, .b-eth { grid-column: span 3; }
.b-breadth { grid-column: span 2; }
.b-coin { grid-column: span 4; grid-row: span 2; min-height: 300px; overflow: hidden; }
.coin-stage { position: absolute; inset: 0; }
/* warm gold haze behind the mascot */
.coin-stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 214, 140, .2), rgba(201, 150, 70, .09) 55%, rgba(201, 150, 70, 0) 100%); }
/* Matrix rain of live prices behind the coin (js/matrix.js); fades out towards the card edges */
.coin-stage .coin-matrix {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .8; z-index: 0;
  mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
}
.coin-stage canvas { display: block; width: 100%; height: 100%; }
.coin-fallback { position: absolute; inset: 0; margin: auto; width: 55%; aspect-ratio: 1; border-radius: 50%; }
/* RTJ mascot (js/mascot.js): breathing glow, flaring + blinking eyes, cursor tilt */
.mascot { --mg: 227, 181, 58; position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; perspective: 700px; pointer-events: none; }
.mascot-glow { position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--mg), .30), rgba(var(--mg), .08) 60%, transparent); filter: blur(8px); animation: mascot-breathe 4.8s ease-in-out infinite; }
.mascot-fig { position: relative; width: min(88%, 92cqh, 340px); aspect-ratio: 1; transform-style: preserve-3d; will-change: transform; }
.b-coin .coin-stage { container-type: size; }
/* the image has a black background: screen blend drops it into the card */
.mascot-fig img { width: 100%; height: 100%; display: block; mix-blend-mode: screen; user-select: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 82%, transparent 100%); mask-image: radial-gradient(closest-side, #000 82%, transparent 100%);
  animation: mascot-lit 4.8s ease-in-out infinite; }
.mascot-eye, .mascot-lid { position: absolute; width: 13%; height: 8%; translate: -50% -50%; border-radius: 50%; }
.mascot-eye { background: radial-gradient(closest-side, rgba(255, 241, 196, .9), rgba(var(--mg), .55) 45%, transparent); mix-blend-mode: screen; filter: blur(3px); animation: mascot-eyes 3.2s ease-in-out infinite; }
.mascot-eye + .mascot-eye { animation-delay: .05s; }
.mascot-lid { background: #050403; transform: scaleY(0); transform-origin: 50% 0; transition: transform .07s ease-in; width: 15%; height: 11%; }
.mascot.blink .mascot-lid { transform: scaleY(1); }
.mascot.blink .mascot-eye { opacity: 0; }
@keyframes mascot-breathe { 0%, 100% { opacity: .65; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes mascot-lit { 0%, 100% { filter: brightness(.92) drop-shadow(0 0 6px rgba(var(--mg), .25)); } 50% { filter: brightness(1.08) drop-shadow(0 0 16px rgba(var(--mg), .45)); } }
@keyframes mascot-eyes { 0%, 100% { opacity: .35; transform: scale(.9); } 50% { opacity: .9; transform: scale(1.25); } 52% { opacity: 1; transform: scale(1.4); } 56% { opacity: .8; transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .mascot-glow, .mascot-fig img, .mascot-eye { animation: none; } }
.b-signals { grid-column: span 12; }

.hero-top { display: flex; gap: 20px; align-items: center; }.hero-logo { width: 76px; height: 76px; border-radius: 20px; flex: none; box-shadow: 0 0 0 1px var(--line-2); }
.b-hero h1 { margin: 0; font: 850 clamp(34px, 3vw, 46px)/1 var(--display); font-stretch: 85%; letter-spacing: -.01em; }
.b-hero .lead { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 560px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-movers { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.hero-movers .lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.mover {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 5px; border-radius: 999px; font-weight: 650; font-size: 12.5px;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px var(--line); transition: background .15s, box-shadow .15s;
}
.mover:hover { background: rgba(255, 200, 31, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), inset 0 0 0 1px var(--gold-line); }
.mover .ico { width: 20px; height: 20px; border-radius: 50%; }
.mover .up { font-family: var(--mono); font-size: 12px; }

.fng-label { text-align: center; font-size: 19px; font-weight: 750; }
.fng-deltas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fng-deltas { padding-top: 12px; border-top: 1px solid var(--line); }
.fng-deltas div { text-align: center; }
.fng-deltas span { display: block; font-size: 11.5px; color: var(--muted); }
.fng-deltas b { font: 650 16px var(--mono); }

.kpi-spark { margin: 10px -4px -4px; height: 44px; }
.kpi-spark svg { width: 100%; height: 44px; }
.kpi-spark circle { display: none; }
.b-breadth .bar { margin-top: 14px; height: 8px; }
.b-btc .value, .b-eth .value { font-size: clamp(22px, 2vw, 30px); }
.b-breadth .value { font-size: clamp(22px, 1.8vw, 28px); }

.latest {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 4px 0;
}
.latest:hover .latest-text { color: var(--text); text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 3px; }
.latest .ico { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.latest-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest .when { font-size: 12px; white-space: nowrap; }

.home-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.home-grid .scroll { max-height: 640px; }
.tool-list { display: grid; padding: 6px; }
.tool-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: 14px; min-width: 0; transition: background .15s; }
.tool-row:hover { background: rgba(255, 226, 140, .05); }
.tool-row .h-ico { width: 38px; height: 38px; border-radius: 12px; }
.tool-row .h-ico svg { width: 19px; height: 19px; }
.tool-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tool-text b { font-size: 14px; font-weight: 700; transition: color .15s; }
.tool-text small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.tool-stat { display: block; font-size: 12.5px; color: var(--text); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-foot { margin: 22px 0 0; color: var(--dim); font-size: 12px; text-align: center; }
.section-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--text); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 26px; bottom: 64px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: 330px; max-width: calc(100vw - 32px); }
.toast {
  position: relative; overflow: hidden; background: rgba(20, 19, 13, .9); border: 1px solid var(--line-2); border-radius: 16px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  padding: 11px 34px 13px 46px; box-shadow: 0 14px 34px rgba(0,0,0,.5); cursor: pointer;
  animation: tin .24s var(--ease-out); transition: transform .2s, border-color .2s;
}
.toast:hover { transform: translateY(-2px); border-color: var(--gold-line); }
/* 8s countdown bar in the alert's colour, pauses on hover (in sync with the JS timer) */
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: left; animation: life 8s linear forwards; }
.toast:hover::after { animation-play-state: paused; }
@keyframes tin { from { transform: translateY(10px) scale(.97); opacity: 0; } }
.toast-ico { position: absolute; left: 12px; top: 11px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); color: var(--gold); }
.toast.sell .toast-ico { color: var(--down); }
.toast.buy .toast-ico { color: var(--up); }
.toast.listing .toast-ico { color: var(--violet); }
@keyframes life { to { transform: scaleX(0); } }
.toast.sell::after { background: var(--down); }
.toast.buy::after { background: var(--up); }
.toast.listing::after { background: var(--violet); }
.toast b { display: block; margin-bottom: 2px; }
.toast span { color: var(--muted); font-size: 12px; }
.toast .close { position: absolute; right: 6px; top: 6px; }
.toast.out { animation: tout .19s ease-in forwards; }
@keyframes tout { to { transform: translateY(10px); opacity: 0; } }

/* ---------- Status bar (ticker tape) ---------- */
.statusbar { display: flex; align-items: center; padding: 0 6px; border-radius: 14px; font-size: 12px; white-space: nowrap; min-width: 0; }
.tape-viewport { flex: 1; overflow: hidden; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.tape { display: inline-flex; gap: 24px; padding-right: 24px; animation: marquee 60s linear infinite; }
.tape-viewport:hover .tape { animation-play-state: paused; }
.tape a { transition: color .15s; }
.tape a:hover { color: var(--gold); }
@keyframes marquee { to { transform: translateX(-50%); } }

.skeleton { background: var(--panel-3); border-radius: 8px; animation: skp 1.4s ease-in-out infinite; }
@keyframes skp { 50% { opacity: .5; } }
.gauge-wrap { display: grid; place-items: center; padding: 10px 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  .clock { display: none; }
}
@media (max-width: 1200px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .b-hero, .b-breadth, .b-signals { grid-column: span 6; }
  .b-btc, .b-eth { grid-column: span 3; }
  .b-coin { grid-column: span 6; grid-row: auto; min-height: 260px; }
  .cols-main-side, .cols-side-main, .home-grid { grid-template-columns: minmax(0, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Tablet: icon-only side menu */
@media (max-width: 1100px) and (min-width: 761px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .side { padding: 12px 10px; align-items: stretch; }
  .brand { justify-content: center; padding: 2px 0 12px; }
  .brand div, .nav-item span, .side-foot p { display: none; }
  .grp { font-size: 0; padding: 8px 0; margin: 4px 10px; border-top: 1px solid var(--line); }
  .nav-item { justify-content: center; padding: 0; }
  .side-foot { justify-items: center; padding: 10px 0 0; }
  .lang { flex-direction: column; border-radius: 14px; }
  .lang button { border-radius: 10px; }
}
/* Phone: bottom tab bar, the rest under "More" */
@media (max-width: 760px) {
  .shell { display: block; padding: 0; }
  .main { height: 100%; grid-template-rows: auto minmax(0, 1fr); gap: 0; }
  .statusbar { display: none; }
  .topbar { margin: 10px 10px 0; height: 54px; gap: 8px; padding: 0 8px; }
  .top-brand { display: block; flex: none; }
  .top-brand img { width: 36px; height: 36px; border-radius: 11px; display: block; }
  .sp { display: none; }
  .kbd { display: none; }
  .search input { padding-right: 12px; }
  .live-pill { width: 38px; padding: 0; justify-content: center; }
  .live-pill span { display: none; }
  .view { padding: 16px 12px calc(96px + env(safe-area-inset-bottom)); }

  .side {
    position: fixed; z-index: 60; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); top: auto;
    border-radius: 22px; padding: 6px; flex-direction: row; overflow: visible; background: rgba(16, 15, 10, .82);
  }
  .brand, .grp, .side-foot, .nav-pill, .nav-item.extra { display: none; }
  #nav { flex-direction: row; flex: 1; gap: 2px; }
  .nav-item, .more-btn {
    display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 3px; height: 56px; padding: 0 2px; min-width: 0;
    font-size: 10.5px; font-weight: 600; border-radius: 16px;
  }
  .nav-item svg { width: 21px; height: 21px; }
  .nav-item span { max-width: 100%; }
  .nav-item.active { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 6px 16px rgba(242, 194, 48, .28); }
  .more-btn[aria-expanded="true"] { background: var(--panel-3); color: var(--text); }

  .more-sheet:not([hidden]) {
    display: grid; position: fixed; z-index: 61; right: 10px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 220px; padding: 6px; border-radius: 18px;
    background: rgba(18, 17, 12, .94); transform-origin: bottom right; animation: popIn .2s var(--ease-out);
  }
  .more-sheet a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 12px; font-weight: 600; color: var(--muted); }
  .more-sheet a:hover { background: rgba(255, 226, 140, .05); color: var(--text); }
  .more-sheet a.active { color: var(--on-gold); background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }

  .alerts-menu { position: fixed; right: 10px; top: 72px; }
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .t th, .t td { padding: 10px 12px; }
  .hide-sm { display: none; }
  .toasts { left: 12px; right: 12px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .chart, .chart.tall { height: 360px; }
  .kpis, .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .b-hero, .b-breadth, .b-signals { grid-column: span 2; }
  .b-btc, .b-eth { grid-column: span 1; }
  .b-coin { grid-column: span 2; min-height: 220px; }
  .b-hero { padding: 18px; }
  .hero-logo { width: 54px; height: 54px; border-radius: 16px; }  .hero-actions .btn { flex: 1; }
  .b-btc .value, .b-eth .value { font-size: 18px; }
  .page-head h1 { font-size: 21px; }
  .page-head h1.display { font-size: 26px; }
  .card-head, .card-body, .feed li, .sig { padding-left: 14px; padding-right: 14px; }
  .latest { padding: 11px 14px; }
  .latest .when, .latest .ico { display: none; }
  .head-tools { width: 100%; }
  .head-tools .btn { flex: 1; }
}
