/* Tradinity shared site layer: theme tokens, page width, header, search, footer, widgets.
   Loaded on every page after the page's own <style>, so it sets the common look without rewriting each template.
   Dark theme = html[data-theme="dark"]; it re-colours the Tailwind utility classes the templates already use. */

:root {
    color-scheme: light;
    --tx-bg: #f4f6fa;
    --tx-surface: #ffffff;
    --tx-surface-2: #f1f5f9;
    --tx-text: #0f172a;
    --tx-muted: #64748b;
    --tx-border: #e2e8f0;
    --tx-brand: #0bea9a;
    --tx-brand-ink: #032b20;
    --tx-accent: #3b82f6;
    --tx-up: #059669;
    --tx-down: #e11d48;
    --tx-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .04);
    --tx-page-max: 1760px;
    --tx-gutter: clamp(12px, 2.2vw, 40px);
    --tx-header-h: 60px;          /* the header's design min-height: never written by script */
    --tx-header-live: 60px;       /* the header's measured height, kept current by site.js; sticky bars and anchors use this */
}

html[data-theme="dark"] {
    color-scheme: dark;
    --tx-bg: #0a0e15;
    --tx-surface: #111823;
    --tx-surface-2: #182131;
    --tx-text: #e6edf6;
    --tx-muted: #93a1b5;
    --tx-border: #233044;
    --tx-up: #34d399;
    --tx-down: #fb7185;
    --tx-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--tx-header-live) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; min-height: 100vh; }
img, svg, canvas, video { max-width: 100%; }
a, button, summary, select, input { touch-action: manipulation; }
a, button { transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease; }
:focus-visible { outline: 2px solid var(--tx-accent); outline-offset: 2px; border-radius: 6px; }
.tx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---- Page width: fluid with generous side gutters, like Trendlyne (~1760px content on a 1920px screen) ---- */
.mx-auto.max-w-4xl, .mx-auto.max-w-5xl, .mx-auto.max-w-6xl, .mx-auto.max-w-7xl, .mx-auto.max-w-screen-xl,
.tx-wrap {
    width: 100%; max-width: var(--tx-page-max); margin-left: auto; margin-right: auto;
    padding-left: var(--tx-gutter); padding-right: var(--tx-gutter);
}
@media (max-width: 640px) {
    .mx-auto.max-w-4xl, .mx-auto.max-w-5xl, .mx-auto.max-w-6xl, .mx-auto.max-w-7xl { padding-top: 1rem !important; padding-bottom: 1.5rem !important; }
}

/* Any table that is not already in a scroller is wrapped by site.js so it never pushes the page sideways on a phone. */
.tx-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

/* Pages have their own sticky in-page bars: sit them just under the site header instead of behind it. */
.sticky.top-0, .sticky.top-2, .sticky.top-1 { top: var(--tx-header-live); }

/* ---- Header ---- */
.tx-header { position: sticky; top: 0; z-index: 60; background: var(--tx-surface); border-bottom: 1px solid var(--tx-border); }   /* solid, no blur: cheap to scroll on very long pages */
.tx-bar { display: flex; align-items: center; gap: 14px; min-height: var(--tx-header-h); }
.tx-logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.tx-logo img, .tx-footer img { height: 36px; width: auto; display: block; }
.tx-logo img.tx-full { height: 56px; }
.tx-logo .tx-mark { display: none; height: 34px; }
img.tx-only-dark { display: none; }
html[data-theme="dark"] img.tx-only-dark { display: block; }
html[data-theme="dark"] img.tx-only-light { display: none; }
.tx-nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.tx-dd { position: relative; }
.tx-dd > button, .tx-nav > a { display: inline-flex; align-items: center; gap: 4px; padding: 8px 11px; border-radius: 8px; font-size: .875rem; font-weight: 600; color: var(--tx-text); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.tx-dd > button:hover, .tx-nav > a:hover, .tx-dd.open > button { background: var(--tx-surface-2); }
.tx-dd > button svg { width: 12px; height: 12px; opacity: .55; transition: transform .15s ease; }
.tx-dd.open > button svg { transform: rotate(180deg); }
.tx-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; background: var(--tx-surface); border: 1px solid var(--tx-border); border-radius: 12px; box-shadow: var(--tx-shadow); padding: 8px; display: none; z-index: 70; max-height: min(78vh, 640px); overflow-y: auto; }
.tx-dd.open > .tx-menu { display: block; animation: tx-pop .12s ease-out; }
@keyframes tx-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tx-menu.wide { min-width: 520px; display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
.tx-dd.open > .tx-menu.wide { display: grid; }
.tx-menu h6 { grid-column: 1 / -1; font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-muted); padding: 8px 10px 4px; margin: 0; }
.tx-menu a { display: block; padding: 8px 10px; border-radius: 8px; font-size: .8125rem; color: var(--tx-text); }
.tx-menu a small { display: block; font-size: .6875rem; color: var(--tx-muted); margin-top: 1px; }
.tx-menu a:hover { background: var(--tx-surface-2); }
.tx-spacer { flex: 1 1 auto; }

.tx-search { position: relative; flex: 0 1 420px; min-width: 200px; }
.tx-search input { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--tx-border); background: var(--tx-surface-2); color: var(--tx-text); padding: 0 44px 0 38px; font-size: .875rem; outline: none; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.tx-search input::placeholder { color: var(--tx-muted); }
.tx-search input:focus { border-color: var(--tx-accent); background: var(--tx-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tx-accent) 22%, transparent); }
.tx-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--tx-muted); pointer-events: none; }
.tx-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 .6875rem/1 ui-monospace, monospace; color: var(--tx-muted); border: 1px solid var(--tx-border); border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.tx-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: min(560px, 92vw); background: var(--tx-surface); border: 1px solid var(--tx-border); border-radius: 14px; box-shadow: var(--tx-shadow); overflow: hidden; display: none; z-index: 80; max-height: min(70vh, 520px); overflow-y: auto; }
.tx-results.open { display: block; animation: tx-pop .12s ease-out; }
.tx-results h6 { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-muted); padding: 10px 14px 4px; margin: 0; }
.tx-results a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: .875rem; color: var(--tx-text); }
.tx-results a span.sub { font-size: .75rem; color: var(--tx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.tx-results a b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-results a[aria-selected="true"], .tx-results a:hover { background: var(--tx-surface-2); }
.tx-results .empty { padding: 16px 14px; font-size: .875rem; color: var(--tx-muted); }

.tx-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--tx-border); background: var(--tx-surface); color: var(--tx-text); cursor: pointer; flex: 0 0 auto; }
.tx-iconbtn:hover { background: var(--tx-surface-2); }
.tx-iconbtn svg { width: 18px; height: 18px; }
.tx-theme .sun { display: none; }
html[data-theme="dark"] .tx-theme .sun { display: block; }
html[data-theme="dark"] .tx-theme .moon { display: none; }
.tx-burger { display: none; }
.tx-acct { display: flex; align-items: center; gap: 8px; font-size: .8125rem; }
.tx-acct a.plain { color: var(--tx-muted); font-weight: 600; padding: 8px 6px; white-space: nowrap; }
.tx-acct a.plain:hover { color: var(--tx-text); }
.tx-btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border-radius: 10px; font-size: .8125rem; font-weight: 700; background: var(--tx-brand); color: var(--tx-brand-ink); border: 0; cursor: pointer; white-space: nowrap; }
.tx-btn:hover { filter: brightness(.95); }
.tx-btn.ghost { background: transparent; color: var(--tx-text); border: 1px solid var(--tx-border); }
.tx-btn.ghost:hover { background: var(--tx-surface-2); }

.tx-m-only { display: none; }

/* Tablet / phone: hamburger drawer, mark-only logo, search on its own row. */
@media (max-width: 1100px) {
    .tx-burger { display: inline-flex; }
    .tx-bar { flex-wrap: wrap; gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; min-height: 0; }
    .tx-search { order: 10; flex: 1 1 100%; min-width: 0; }
    .tx-search kbd { display: none; }
    .tx-results { min-width: 0; }
    .tx-nav { display: none; position: fixed; inset: 0 0 0 auto; width: min(360px, 88vw); background: var(--tx-surface); border-left: 1px solid var(--tx-border); box-shadow: var(--tx-shadow); flex-direction: column; align-items: stretch; margin: 0; padding: 70px 12px 24px; overflow-y: auto; z-index: 90; gap: 2px; }
    .tx-nav.open { display: flex; animation: tx-slide .18s ease-out; }
    @keyframes tx-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
    .tx-dd > button, .tx-nav > a { width: 100%; justify-content: space-between; padding: 12px; font-size: .95rem; }
    .tx-menu, .tx-menu.wide { position: static; display: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 6px 8px; min-width: 0; max-height: none; grid-template-columns: 1fr; }
    .tx-dd.open > .tx-menu, .tx-dd.open > .tx-menu.wide { display: block; animation: none; }
    .tx-scrim { display: none; position: fixed; inset: 0; background: rgba(2, 6, 12, .5); z-index: 85; }
    .tx-scrim.open { display: block; }
    .tx-drawer-close { display: none; position: fixed; top: 12px; right: 12px; z-index: 95; }
    .tx-header.drawer-open .tx-drawer-close { display: inline-flex; }
    .tx-acct { display: none; }
    .tx-m-only { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px 4px; margin-top: 8px; border-top: 1px solid var(--tx-border); }
    .tx-m-only .tx-btn { width: 100%; height: 44px; }
    .tx-m-only form { margin: 0; }
}
@media (max-width: 340px) {
    .tx-logo img.tx-full { display: none !important; }
    .tx-logo .tx-mark { display: block; }
}
@media (min-width: 1101px) { .tx-drawer-close, .tx-scrim { display: none !important; } }

/* ---- Footer ---- */
.tx-footer { margin-top: 2.5rem; border-top: 1px solid var(--tx-border); background: var(--tx-surface); }
.tx-footer .grid { display: grid; gap: 28px; grid-template-columns: 1.4fr repeat(5, 1fr); padding-top: 32px; padding-bottom: 24px; }
.tx-footer h6 { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-muted); margin: 0 0 10px; }
.tx-footer a { display: block; font-size: .8125rem; color: var(--tx-text); padding: 4px 0; opacity: .85; }
.tx-footer a:hover { opacity: 1; text-decoration: underline; }
.tx-footer .fine { border-top: 1px solid var(--tx-border); padding-top: 14px; padding-bottom: 22px; font-size: .75rem; color: var(--tx-muted); }
.tx-footer img { height: 34px; width: auto; }
@media (max-width: 900px) { .tx-footer .grid { grid-template-columns: repeat(2, 1fr); } .tx-footer .grid > :first-child { grid-column: 1 / -1; } }

/* ---- Home widgets ---- */
.hp { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.hp > * { min-width: 0; }
/* Deliberately always-dark, regardless of the site's own light/dark theme -- a fixed "spotlight" band (the same
   idea as Tickertape's own dark Market Mood strip), not a themed surface. Every color inside it is a fixed value
   from this block, never a theme-following --tx-* token, so it can't end up dark text on a dark ground if the site
   itself is in light mode. */
.hp-hero {
    position: relative; z-index: 30; isolation: isolate; border-radius: 20px;  /* above the positioned index charts below, so the search dropdown is never painted over */ padding: clamp(28px, 4vw, 48px);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .55);
}
/* The background sits on its own layer, clipped to the card's corners, so the search dropdown
   (.tx-results, absolutely positioned inside .hp-hero) is never cut off at the card's edge. */
.hp-hero::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
    background:
        radial-gradient(900px 360px at 88% -10%, rgba(11, 234, 154, .28), transparent 60%),
        radial-gradient(700px 320px at -5% 115%, rgba(59, 130, 246, .22), transparent 60%),
        linear-gradient(180deg, #0d1420, #090d14);
}
.hp-hero h1 { font-size: clamp(1.5rem, 2.6vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 0; color: #f3f6fa; text-wrap: balance; }
.hp-hero h1 .up { color: #34d399; }
.hp-hero h1 .down { color: #fb7185; }
.hp-hero p { color: #9aa7bb; margin: 10px 0 0; font-size: .95rem; max-width: 62ch; }
.hp-hero .tx-search { flex: none; width: min(640px, 100%); margin-top: 22px; }
.hp-hero .tx-search input { height: 52px; font-size: 1rem; border-radius: 14px; padding-left: 46px; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #f3f6fa; }
.hp-hero .tx-search input::placeholder { color: #7c8aa0; }
.hp-hero .tx-search input:focus { background: rgba(255, 255, 255, .1); border-color: var(--tx-brand); box-shadow: 0 0 0 3px rgba(11, 234, 154, .22); }
.hp-hero .tx-search .ico { left: 16px; width: 18px; height: 18px; color: #7c8aa0; }
.hp-hero .hp-chip { border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: #dbe3ee; }
.hp-hero .hp-chip:hover { background: rgba(255, 255, 255, .1); border-color: color-mix(in srgb, var(--tx-brand) 65%, transparent); }
.hp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hp-chip { font-size: .8125rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--tx-border); background: var(--tx-surface); color: var(--tx-text); }
.hp-chip:hover { background: var(--tx-surface-2); border-color: color-mix(in srgb, var(--tx-brand) 60%, var(--tx-border)); }
.hp-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; scroll-snap-type: x proximity; }
.hp-index { scroll-snap-align: start; display: block; background: var(--tx-surface); border: 1px solid var(--tx-border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--tx-shadow); }
.hp-index:hover { border-color: color-mix(in srgb, var(--tx-brand) 55%, var(--tx-border)); transform: translateY(-1px); }
.hp-index .nm { font-size: .8125rem; font-weight: 700; color: var(--tx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-index .px { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; color: var(--tx-text); }
.hp-index .ch { font-size: .8125rem; font-weight: 700; }
.hp-index svg { width: 100%; height: 34px; margin-top: 8px; display: block; }
/* Chart.js's responsive resize reads the CANVAS'S PARENT'S own box, not CSS on the canvas itself -- without this
   explicitly sized, positioned wrapper, an unconstrained parent (this card sizes to its own content) lets the
   chart grow without bound. */
.hp-index-chart { position: relative; width: 100%; height: 34px; margin-top: 8px; }
.hp-index-chart canvas { display: block; width: 100% !important; height: 100% !important; }
.hp-cols { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; align-items: start; }
.hp-card { background: var(--tx-surface); border: 1px solid var(--tx-border); border-radius: 16px; padding: 16px 18px; box-shadow: var(--tx-shadow); min-width: 0; }
.hp-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hp-card > header h2 { font-size: .9375rem; font-weight: 800; margin: 0; color: var(--tx-text); }
.hp-card > header a { font-size: .75rem; font-weight: 600; color: var(--tx-accent); white-space: nowrap; }
.hp-card > header a:hover { text-decoration: underline; }
.hp-card .sub { font-size: .75rem; color: var(--tx-muted); margin: -6px 0 10px; }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; } .span-3 { grid-column: span 3; }
@media (max-width: 1280px) { .span-3 { grid-column: span 6; } .span-4 { grid-column: span 6; } .span-8 { grid-column: span 12; } }
@media (max-width: 760px) { .span-3, .span-4, .span-6, .span-8 { grid-column: span 12; } .hp-card { padding: 14px; border-radius: 14px; } }
.hp-list { list-style: none; margin: 0; padding: 0; }
.hp-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--tx-border); font-size: .875rem; }
.hp-list li:last-child { border-bottom: 0; }
.hp-list a { color: var(--tx-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hp-list a:hover { text-decoration: underline; }
.hp-list .meta { font-size: .75rem; color: var(--tx-muted); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-list .r { text-align: right; flex: 0 0 auto; }
.hp-list .l { min-width: 0; flex: 1 1 auto; }
.tx-up { color: var(--tx-up); } .tx-down { color: var(--tx-down); }
.hp-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--tx-surface-2); }
.hp-bar i { display: block; height: 100%; }
.hp-bar .adv { background: var(--tx-up); } .hp-bar .dec { background: var(--tx-down); } .hp-bar .unc { background: var(--tx-muted); opacity: .5; }
.hp-legend { display: flex; justify-content: space-between; font-size: .8125rem; margin-top: 8px; font-weight: 600; }
/* Underline-active tabs (ADR-0353): a quieter, editorial treatment over the old filled-pill segmented control --
   no container background, just a colored underline on whichever tab is active. */
.hp-tabs { display: inline-flex; gap: 16px; }
.hp-tabs button { border: 0; background: none; padding: 4px 1px 8px; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .75rem; font-weight: 700; color: var(--tx-muted); cursor: pointer; }
.hp-tabs button:hover { color: var(--tx-text); }
.hp-tabs button[aria-selected="true"] { background: none; color: var(--tx-text); box-shadow: none; border-bottom-color: var(--tx-brand); }
.hp-pane[hidden] { display: none; }
.hp-group-label { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-muted); margin: 0 0 10px; }
.hp-tile-group + .hp-tile-group { margin-top: 22px; }
.hp-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.hp-tile { display: block; border: 1px solid var(--tx-border); border-radius: 14px; padding: 14px 16px; background: var(--tx-surface); }
.hp-tile:hover { border-color: color-mix(in srgb, var(--tx-brand) 55%, var(--tx-border)); background: var(--tx-surface-2); }
.hp-tile b { display: block; font-size: .9rem; color: var(--tx-text); }
.hp-tile span { display: block; font-size: .75rem; color: var(--tx-muted); margin-top: 2px; }
.hp-asof { font-size: .75rem; color: var(--tx-muted); }
.hp-empty { font-size: .8125rem; color: var(--tx-muted); font-style: italic; padding: 8px 0; }

/* ---- Dark theme: the Tailwind utilities the templates already use ---- */
html[data-theme="dark"] body { background: var(--tx-bg); color: var(--tx-text); }
html[data-theme="dark"] .bg-white { background-color: var(--tx-surface); }
html[data-theme="dark"] .bg-slate-50 { background-color: var(--tx-bg); }
html[data-theme="dark"] .bg-slate-100 { background-color: var(--tx-surface-2); }
html[data-theme="dark"] .bg-slate-200 { background-color: #223047; }
html[data-theme="dark"] .bg-slate-800, html[data-theme="dark"] .bg-slate-900 { background-color: #1e2a3d; color: #f1f5f9; }
html[data-theme="dark"] .bg-slate-50\/90 { background-color: rgba(10, 14, 21, .9); }
html[data-theme="dark"] .bg-amber-50 { background-color: rgba(251, 191, 36, .1); }
html[data-theme="dark"] .bg-rose-50 { background-color: rgba(251, 113, 133, .1); }
html[data-theme="dark"] .bg-emerald-50 { background-color: rgba(52, 211, 153, .1); }
html[data-theme="dark"] .bg-sky-50 { background-color: rgba(56, 189, 248, .1); }
html[data-theme="dark"] .bg-indigo-50 { background-color: rgba(129, 140, 248, .1); }
html[data-theme="dark"] .text-slate-900, html[data-theme="dark"] .text-slate-800 { color: var(--tx-text); }
html[data-theme="dark"] .text-slate-700 { color: #cbd5e1; }
html[data-theme="dark"] .text-slate-600 { color: #b3bfd0; }
html[data-theme="dark"] .text-slate-500 { color: var(--tx-muted); }
html[data-theme="dark"] .text-slate-400 { color: #7a8aa0; }
html[data-theme="dark"] .text-slate-300 { color: #536178; }
html[data-theme="dark"] .text-emerald-600, html[data-theme="dark"] .text-emerald-700, html[data-theme="dark"] .text-emerald-800 { color: var(--tx-up); }
html[data-theme="dark"] .text-rose-600, html[data-theme="dark"] .text-rose-700 { color: var(--tx-down); }
html[data-theme="dark"] .text-amber-600, html[data-theme="dark"] .text-amber-700 { color: #fbbf24; }
html[data-theme="dark"] .text-sky-700 { color: #38bdf8; }
html[data-theme="dark"] .text-indigo-600 { color: #818cf8; }
html[data-theme="dark"] .ring-slate-100, html[data-theme="dark"] .ring-slate-200, html[data-theme="dark"] .ring-slate-300 { --tw-ring-color: var(--tx-border); }
html[data-theme="dark"] .ring-rose-200 { --tw-ring-color: rgba(251, 113, 133, .35); }
html[data-theme="dark"] .ring-white { --tw-ring-color: var(--tx-surface); }
html[data-theme="dark"] .border-slate-100, html[data-theme="dark"] .border-slate-200, html[data-theme="dark"] .border-slate-300 { border-color: var(--tx-border); }
html[data-theme="dark"] .divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: var(--tx-border); }
html[data-theme="dark"] .hover\:bg-white:hover, html[data-theme="dark"] .hover\:bg-slate-50:hover { background-color: var(--tx-surface-2); }
html[data-theme="dark"] .hover\:bg-slate-200:hover { background-color: #2b3b55; }
html[data-theme="dark"] .hover\:bg-slate-800:hover { background-color: #2a3a54; }
html[data-theme="dark"] .hover\:ring-slate-200:hover, html[data-theme="dark"] .hover\:ring-slate-300:hover, html[data-theme="dark"] .focus\:ring-slate-300:focus { --tw-ring-color: #3a4c68; }
html[data-theme="dark"] .hover\:text-slate-700:hover, html[data-theme="dark"] .hover\:text-slate-800:hover, html[data-theme="dark"] .hover\:text-slate-600:hover { color: #f1f5f9; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background-color: var(--tx-surface); color: var(--tx-text); border-color: var(--tx-border); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #6b7a90; }
html[data-theme="dark"] option { background: var(--tx-surface); color: var(--tx-text); }
/* the per-page <style> rules that hard-code light colours */
html[data-theme="dark"] thead th { color: var(--tx-muted); border-bottom-color: var(--tx-border); }
html[data-theme="dark"] tbody tr:not(:last-child) td { border-bottom-color: #1a2536; }
html[data-theme="dark"] tbody tr:hover td { background: var(--tx-surface-2); }
html[data-theme="dark"] .card { background: var(--tx-surface); border-color: var(--tx-border); }
html[data-theme="dark"] .chip { background: var(--tx-surface-2); color: #cbd5e1; }
html[data-theme="dark"] a.chip:hover { background: #223047; }
html[data-theme="dark"] .muted { color: #7a8aa0; }
html[data-theme="dark"] .bg-slate-900.text-white, html[data-theme="dark"] .chip.bg-slate-900 { background-color: #2a3a54; color: #fff; }
html[data-theme="dark"] hr { border-color: var(--tx-border); }
html[data-theme="dark"] canvas { color-scheme: dark; }

/* Signed-in account menu (avatar + name, hover/click dropdown: profile, portfolio, watchlists, alerts, sign out) */
.tx-user > button { padding: 4px 10px 4px 5px; gap: 8px; }
.tx-user > .tx-menu { left: auto; right: 0; min-width: 240px; }
.tx-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; }
.tx-avatar-initial { display: inline-flex; align-items: center; justify-content: center; background: var(--tx-brand); color: var(--tx-brand-ink); font-weight: 800; font-size: .8125rem; }
.tx-user-name { max-width: 140px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; }
.tx-user-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--tx-border); margin-bottom: 6px; }
.tx-user-head strong { display: block; font-size: .875rem; }
.tx-user-head small { display: block; font-size: .75rem; color: var(--tx-muted); overflow: hidden; text-overflow: ellipsis; }
.tx-signout { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--tx-border); }
.tx-signout button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: .8125rem; font-weight: 600; color: var(--tx-down); cursor: pointer; }
.tx-signout button:hover { background: var(--tx-surface-2); }
@media (max-width: 1100px) { .tx-user-name { max-width: none; } .tx-user > .tx-menu { right: auto; } }
