:root {
  /* ============ SPEC TOKENS (canonical) ============
   * The names from the design spec, each holding the only literal for that
   * colour in the codebase. The names this stylesheet already used are
   * aliased to them directly below.
   *
   * Aliased rather than renamed: --muted alone has 264 references, --text 138,
   * --accent 132 - 817 across the two stylesheets before counting the inline
   * blocks in PHP. A rename is a pure-risk edit, no visual change and one
   * missed reference is invisible text on a dark ground. Aliasing gets the
   * spec's vocabulary with none of that exposure, and new rules can use
   * either name because both resolve to the same single literal.
   */
  --void: #030303;
  --panel: #0A0A0A;
  --panel-2: #111111;
  --panel-3: #1E1E1E;
  --hair: rgba(255,255,255,.07);
  --hair-2: rgba(255,255,255,.13);
  --bone: #EDF0F6;
  --indigo: #F5A524;
  --indigo-soft: rgba(245,165,36,.14);
  --long: #22C55E;
  --short: #EF4444;
  --r: 8px;

  /* ---- aliases: the names 817 existing rules already reference ---- */
  --bg: var(--void);
  --surface: var(--panel);
  --surface2: var(--panel-2);
  --surface3: var(--panel-3);
  --border: var(--hair);
  --border-2: var(--hair-2);
  --text: var(--bone);
  --accent: var(--indigo);
  --accent-soft: var(--indigo-soft);
  --up: var(--long);
  --down: var(--short);

  /* RESTORED. These three sat between the surfaces and --down in the block
     the spec-token rewrite replaced, and went with it. --muted alone has 264
     references; on a dark ground an undefined colour token inherits, so the
     failure is not a wrong colour but body text at full --text weight and
     brass silently becoming whatever its parent was. Caught by the contrast
     audit reading the light theme's values as the dark theme's, which is
     what an empty dark block looks like from the outside. */
  --muted: #8A94A8;
  --dim: #727D95;           /* 4.54:1 on --panel; see the AA note below */
  --brass: #38BDF8;
  --warn-bg: transparent;
  --warn-border: #38BDF8;
  --warn-text: #38BDF8;

  /* ============ ROLE TINTS ============
   * These existed as literals in the old hue family - var(--bg-up) is a dark
   * GitHub-green wash, and it was still sitting behind --up after --up became
   * mint. A mint number on a green ground is a hue clash you notice without
   * being able to name, and there were four families of it.
   *
   * Derived with color-mix so they track whatever --up/--down/--brass/--accent
   * actually are, including after an operator repaints the brand and in every
   * theme. A tint that cannot drift from its own text colour is the only kind
   * worth having. */
  --bg-up:       color-mix(in srgb, var(--up) 13%, var(--surface));
  --bg-down:     color-mix(in srgb, var(--down) 13%, var(--surface));
  --bg-warn:     color-mix(in srgb, var(--brass) 13%, var(--surface));
  --bg-accent:   color-mix(in srgb, var(--accent) 13%, var(--surface));
  --line-up:     color-mix(in srgb, var(--up) 40%, transparent);
  --line-down:   color-mix(in srgb, var(--down) 40%, transparent);
  --line-warn:   color-mix(in srgb, var(--brass) 40%, transparent);
  --line-accent: color-mix(in srgb, var(--accent) 40%, transparent);
  /* Text ON those tints: the base token lightened so it clears the wash it
     sits on. var(--on-down) was doing this job for danger, by hand, in five files. */
  --on-up:       color-mix(in srgb, var(--up) 62%, #FFFFFF);
  --on-down:     color-mix(in srgb, var(--down) 62%, #FFFFFF);

  /* ============ TYPE ============
   * Self-hosting these is the right end state for an app that deliberately
   * depends on no external service (see README on the keyless data API). The
   * fallback chain is chosen so the site is still correct with no webfont at
   * all: a Palatino-class serif for display, the platform UI face for body,
   * and the platform mono for data. Nothing collapses to Times. */
  --font-display: 'DM Sans', 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'DM Sans', 'Inter Tight', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'DM Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* ============ MOTION ============
   * Three tiers, because density adapts to the surface: marketing can be
   * choreographed, the workspace should be quick, a tool should feel instant.
   * the operator pages remap --dur to --dur-fast wholesale via [data-density]. */
  --ease: cubic-bezier(.22,.68,.24,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur-fast: .12s;
  --dur: .30s;
  --dur-slow: .70s;

  /* SMALL TEXT, AS TOKENS RATHER THAN AS THIRTY LITERALS.
   *
   * The dense panels use four sizes below eleven pixels for eyebrow labels and
   * metadata. On a 1440px monitor at arm's length that reads as precision. On a
   * phone it is unreadable, and measuring it said so: 197 elements under 12px
   * on the chart page, the smallest of them nine.
   *
   * Naming the four sizes means the phone can be given bigger ones in one
   * place, and the desktop keeps the density it was designed with. Editing
   * thirty rules by hand would have worked once and drifted by the third time
   * somebody added a panel. */
  --fs-micro: 9px;      /* uppercase eyebrow labels */
  --fs-tiny: 10px;      /* dense numeric metadata */
  --fs-small: 10.5px;   /* secondary lines inside a card */
}

/* On a phone, nothing goes below eleven. The sizes step up rather than jump,
   so the visual hierarchy between an eyebrow, a metadata line and body text
   survives - it is the whole scale that moves, not one rule out of it. */
@media (max-width: 720px) {
  :root {
    --fs-micro: 11px;
    --fs-tiny: 12px;
    --fs-small: 12px;
  }
  /* A bare <small> with no rule of its own is 0.8em, which inside a 13px card
     is ten and a half pixels - the last thing under the floor once the named
     sizes moved. Lower specificity than every .x small rule above, so it only
     catches the ones nobody styled. */
  small { font-size: var(--fs-tiny); }
}

* { box-sizing: border-box; margin: 0; }

/* THE WEIGHT NORMALISATION HAD A HOLE THE SIZE OF <strong>.
 * 479 <strong> tags across the templates, none of them touched by
 * "font-weight: 700" style search: <strong> carries its own bold from the
 * browser's default stylesheet, which no CSS declaration set and so no grep
 * for "font-weight:" ever found. Every emphasised price, every trade-ticket
 * value, every badge built on <strong> has been rendering at native bold
 * this whole time regardless of the two-weight system the rest of the
 * palette was normalised to. One rule closes it for the entire site. A
 * selector written after this can still choose 500 explicitly for absolute
 * clarity, but nothing should ever need more than that. */
strong, b { font-weight: 500; }

html, body { overflow-x: hidden; max-width: calc(100vw / var(--zf, 1)); }

/* HIDDEN MEANS HIDDEN. ONE RULE, FOR EVERY ELEMENT ON THE SITE.
 *
 * The browser's own `[hidden] { display: none }` lives in the user-agent
 * stylesheet, which loses to ANY author rule that sets `display` - specificity
 * does not come into it, the origin does. So every component in this file that
 * declares `display: flex` on its own class silently cancels the `hidden`
 * attribute for itself, and the JavaScript that sets `el.hidden = true`
 * appears to do nothing.
 *
 * That is not theoretical. The Liquidity magnet row had this fault and printed an
 * em dash on every chart with no magnet, which is exactly the "reads as
 * missing data" the code comment beside it was written to prevent.
 *
 * Four components had been patched one at a time with their own
 * `.x[hidden] { display: none }` as each was caught. That is a list that only
 * ever grows, and the next component to set `display` starts the cycle again.
 * `!important` here because the point is to beat a `display` the component
 * itself declares - and nothing on this site ever wants a `hidden` element on
 * screen, so there is no case to lose. */
[hidden] { display: none !important; }

body {
  font-family: var(--font-sans);
  /* The two coloured radial washes went. A tinted glow behind a chart is the
     one place a decorative gradient actively costs something: it shifts the
     perceived colour of a mint or coral candle depending on where that candle
     happens to sit on the screen. Flat ground, and the ambient layer moved to
     the blueprint grid on ::before, which is achromatic. */
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: calc(100vh / var(--zf, 1)); min-height: calc(100dvh / var(--zf, 1));
}

::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  /* Spec: rgba(void,.72) at blur(14px). The tint was mixed from --surface,
     which is a step lighter than the page, so the bar read as a panel
     floating on the page rather than the page itself going translucent.
     color-mix against --bg (not a hardcoded dark rgba - that literal
     #030303 only exists in the dark theme) is what makes this bar go
     translucent over WHATEVER page colour is under it: light theme's
     near-white, dark theme's near-black, or contrast mode's pure black.
     The scrolled state below (.topbar.elevated) already did this
     correctly; this un-scrolled state - the one every visitor sees
     first, before they scroll a pixel - was the one instance of the
     old hardcoded value left, which is why the header read as a dark
     bar sitting on top of a light page until you scrolled past it. */
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo-img { width: 40px; height: 40px; border-radius: 8px; display: block; }
/* THE MARK: three bars, one per accent colour, pulsing out of phase - a
   live meter, not a static crest. This is the reference design's animation,
   restored. transform-origin at the bottom so each bar looks like it is
   growing up from a baseline rather than breathing from its centre, which
   reads as closer to a level meter and further from a loading spinner. */
.logo-mark { display: block; }
.logo-mark rect { transform-box: fill-box; transform-origin: 50% 100%; animation: logoBar 2.4s var(--ease) infinite; }
.logo-mark rect:nth-child(2) { animation-delay: .2s; }
.logo-mark rect:nth-child(3) { animation-delay: .4s; }
@keyframes logoBar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.45); } }
@media (prefers-reduced-motion: reduce) { .logo-mark rect { animation: none; } }
.brand strong { font-size: 17px; display: block; }
.brand small { color: var(--muted); font-size: 12px; }
/* .nav-btn styles the Log in and Register buttons in the top bar; they
   point at account.php. */
.nav-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 8px;
}
.nav-btn:hover { color: var(--text); border-color: var(--muted); transform: translateY(-1px); }
.nav-btn { transition: all 0.15s ease; }
.top-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* PUSHED TO THE RIGHT EDGE, NOT LEFT NEXT TO THE LOGO.
   .top-nav's only visible content now is the account cluster (Log in/
   Register for a guest, Go premium + the account menu for a member) - every
   destination link is .nav-tabbed and hidden above (the tab bar carries
   those). Sitting in normal flow right after .brand, that cluster read as
   glued to the wordmark with a huge gap of nothing before the theme toggle
   and the icon on the far right - three controls that belong together
   (account actions + the two utility buttons) split across the bar instead.
   margin-left:auto claims all the free space on THIS side, so the account
   buttons land next to the icon where they visually belong, not next to the
   logo where they happen to sit in the markup. Scoped to desktop: on a
   phone .top-nav is the absolutely positioned dropdown sheet (see that
   media query) and this rule must never reach into that layout. */
@media (min-width: 721px) {
  .top-nav { margin-left: auto; }
}
/* DESTINATIONS LIVE ON THE TAB BAR NOW, AT EVERY WIDTH - NOT HERE.
   .tabbar used to be a phone-only bottom dock and the header carried the
   full destination list (Home/Signals/Backtest/Track record/Pricing)
   inline above 720px, so a wide screen had two navigations answering the
   same question. .tabbar is shown at every width now (see that rule), so
   this header goes back to being brand + account controls only, same as a
   phone always had it - .nav-tabbed marks exactly the links the tab bar
   (or, for Home, the logo) already covers, computed once in View.php from
   the same $tabs the bar itself renders from, so this can never show
   something the bar does not, or hide something it does not carry. */
.top-nav .nav-btn.nav-tabbed { display: none; }
.nav-btn.accent {
  background: linear-gradient(135deg, var(--accent-fill), color-mix(in srgb, var(--accent-fill) 85%, #000));
  border-color: transparent; color: var(--on-accent, #111); font-weight: 500;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}
.nav-btn.gold { color: var(--warn-text); border-color: var(--warn-border); font-weight: 500; }
.member-link { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* USED TO DIVIDE THE DESTINATIONS FROM THE ACCOUNT CONTROLS - NOTHING LEFT
   ON ONE SIDE OF IT TO DIVIDE.
   This sat between the inline destination links (Home/Signals/Backtest...)
   and the account buttons, so the theme toggle and Log in/Register did not
   read as more destinations themselves. Those links are .nav-tabbed now and
   hidden at every width (the tab bar carries them instead - see that rule),
   which left this floating in front of Log in/Register with empty nav on
   its left: a stray vertical line for no reason anyone looking at the bar
   could tell. Hidden outright - if a future link is ever added back to this
   nav directly (unwrapped, not tab-bar-covered), this is where its divider
   would come back, scoped to :has() so it only appears when there is
   something on both sides of it again. */
.nav-sep { display: none; }

/* Account trigger - a round icon button at every width, phone or desktop,
   shown alongside whichever direct account buttons View::topbar() renders
   (Log in/Register for a guest, Go premium for a member) rather than
   standing in for them. A circle rather than a rectangle-with-label on
   purpose - it sits beside the theme toggle, which is already a bare
   circular icon button, and the two should read as one pair of utility
   controls. */
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; flex: none;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
/* The signed-in member's OWN links - view account, log out - the one part
   of this bar still genuinely hidden by default (see View::topbar(): a
   guest has nothing wrapped here at all, since Log in/Register already
   render directly and there is nothing lower-traffic left to tuck away).
   Shown as a floating dropdown only when .top-nav carries .open; the
   desktop-only rules for that live with the rest of .nav-toggle's
   siblings, below, gated to min-width:721px so they can never fire under
   the mobile breakpoint regardless of selector specificity. */
.nav-account { display: none; }
.nav-toggle-ic { width: 19px; height: 19px; }
.nav-toggle.open,
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
/* A signed-in member gets a solid ring instead of a hairline - the button
   now represents THEM, not an empty action, so it reads as occupied. */
.nav-toggle.has-account { border-color: var(--border-2); color: var(--text); }
/* Paid is the one thing on this bar earning brass, same rule as the grade
   badges and the premium plan border everywhere else in the system. */
.nav-toggle.is-paid { border-color: var(--line-warn); color: var(--brass); }
.nav-toggle.is-paid:hover, .nav-toggle.is-paid.open { border-color: var(--brass); }
/* THE ACCOUNT DROPDOWN, DESKTOP'S VERSION OF THE MOBILE PANEL.
 *
 * Below 720px .nav-account merges into .top-nav's own full-width sheet (see
 * that media query) because .top-nav itself is the thing being opened and
 * closed there. Above it the destinations (.nav-tabbed) stay inline on the
 * bar and only .nav-account should react to .open, in a small menu of its
 * own rather than the destinations sliding away too - so this is a separate
 * rule from .top-nav.open, not a wider version of it.
 *
 * Positioned against .topbar (the nearest positioned ancestor - it is
 * position:sticky) rather than against .top-nav itself, and right:22px
 * rather than pinned under .nav-toggle by measurement: an absolutely
 * positioned element's offsets resolve against its containing block's
 * PADDING edge, which for .topbar is its outer edge (right:0 would sit
 * flush with the browser edge, 22px past where .topbar's own padding
 * already keeps everything else). 22px matches that padding (see .topbar's
 * base rule) so the dropdown's edge lines up with the content inside it -
 * concretely, with .nav-toggle, since View::topbar() now renders <nav>
 * before the theme/account buttons specifically so .nav-toggle is the last
 * thing on the bar. Gated to min-width:721px, not left to the base
 * ruleset, so it can never win against the mobile sheet above regardless
 * of specificity - a plain .nav-account selector there would otherwise be
 * able to (a class beats an element, but .top-nav.open .nav-account beats
 * a bare class). */
@media (min-width: 721px) {
  .top-nav.open .nav-account {
    display: flex; flex-direction: column; gap: 6px;
    position: absolute; top: 100%; right: 22px; margin-top: 10px;
    min-width: 190px; padding: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    animation: menuDrop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .top-nav.open .nav-account .nav-btn { width: 100%; text-align: center; }
  .top-nav.open .nav-account .member-link { max-width: none; }
}
/* THE ONE LINK A FREE MEMBER IS MEANT TO PRESS.
 *
 * It was a bare 12px text link, fourteen pixels tall on a phone - the smallest
 * tappable thing on the page, and the only one on it whose job is to sell
 * something. Made a chip: same words, same restraint, but with a border and a
 * background it reads as a control rather than as a footnote, and it is big
 * enough to hit. */
.unlock-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--warn-text); text-decoration: none;
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  padding: 7px 12px; border-radius: 999px; line-height: 1.2;
}
.unlock-hint:hover { background: color-mix(in srgb, var(--warn-bg) 70%, var(--warn-border)); text-decoration: none; }

.chart-toolbar { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin: 8px 0 6px; }
.ct-group { display: inline-flex; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
/* min-width as well as padding: the toolbar buttons carrying a word are wide
   enough on their own, but the two carrying a single glyph - fullscreen, and
   the menu caret - came out 22px across, under the 24px floor, because their
   width is however wide one character happens to be. */
.ct-btn {
  background: none; border: none; color: var(--muted); font-size: 11.5px; font-weight: 500;
  padding: 5px 9px; border-radius: 6px; cursor: pointer; line-height: 1; white-space: nowrap;
  min-width: 24px; min-height: 24px;
}
.ct-btn:hover { color: var(--text); }
.ct-btn.on { background: var(--accent-fill); color: var(--on-accent, #111); }

/* Toolbar dropdown holding a grid of toggles. Fourteen controls used to sit
   in this row at all times; the ones that are settings rather than actions
   now live behind one button that reports how many are on. */
.ct-menu { position: relative; display: inline-block; }
.ct-menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 12px; cursor: pointer;
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; transition: all 0.15s ease;
}
.ct-menu-btn::after { content: "▾"; font-size: var(--fs-tiny); opacity: 0.8; }
.ct-menu-btn:hover, .ct-menu-btn.on { color: var(--text); border-color: var(--muted); }
.ct-count {
  min-width: 17px; padding: 1px 5px; border-radius: 999px;
  font-size: var(--fs-tiny); font-weight: 500; text-align: center;
  background: var(--accent-fill); color: var(--on-accent, #111);
}
.ct-menu-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  width: 264px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.ct-menu-head {
  margin: 2px 0 6px; font-size: var(--fs-micro); color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.ct-menu-head + .ct-grid { margin-bottom: 10px; }
.ct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ct-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 10px 4px; cursor: pointer;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; transition: all 0.15s ease;
}
.ct-tile b { font-size: 12px; font-weight: 500; }
.ct-tile small { font-size: var(--fs-micro); color: var(--muted); }
.ct-tile:hover { border-color: var(--muted); transform: translateY(-1px); }
.ct-tile.on {
  border-color: var(--accent); color: var(--on-accent, #111);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.ct-tile.on small { color: var(--text); }
@media (max-width: 640px) {
  /* Anchored to the button, the panel ran off the right edge of a phone as
     soon as the button sat anywhere but the far left. On small screens it
     spans the toolbar instead, so it cannot overflow whatever it opens under. */
  .chart-toolbar { position: relative; }
  .ct-menu { position: static; }
  .ct-menu-panel { left: 0; right: 0; width: auto; }
}
#ctZoomIn, #ctZoomOut, #ctReset { font-size: 14px; padding: 4px 10px; }

/* ---------- disclaimer ---------- */
/* The signal disclaimer lives in the footer (plus every signal payload);
   no top banner. */

/* ---------- layout ---------- */
.layout {
  display: grid;
  /* Panels take their own height. Stretching them to match left a couple of
     hundred pixels of empty panel under the chart whenever the signal column
     was the taller of the two. */
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  padding: 18px 22px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

/* Dead weight, not a live bug: the component layer at the end of this file
   redeclares background/border/radius/shadow for .panel and wins on source
   order, so this gradient-and-drop-shadow version was never actually
   painting - confirmed by rendering a bare .panel and reading the pixels.
   Left as layout-only properties so nothing downstream that depends on
   min-width/padding here breaks; the look these two rules gave has been dead
   since the component layer landed. */
.panel { min-width: 0; padding: 16px; }

/* ---------- chart controls ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.controls select {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
/* Coin search: type to find any coin, results drop down under the box. Its
   own full-width row rather than a 160px box wedged between the other
   controls - that width was never intentional, just what a bare <input>
   defaults to; the phone/tablet breakpoints below already corrected it and
   this base rule now matches them instead of only applying above 900px. */
.sym-pick { position: relative; flex: 1 1 100%; }
.sym-search {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; width: 100%;
}
.sym-search:focus { outline: none; border-color: var(--accent); }
.sym-results {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 45;
  min-width: 240px; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.sym-hit {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 13.5px; cursor: pointer;
}
.sym-hit:last-child { border-bottom: none; }
.sym-hit:hover, .sym-hit:focus { background: var(--surface2); }
.sym-hit.locked { color: var(--muted); }
.sym-none { padding: 10px 12px; color: var(--muted); font-size: 13px; }

/* Timeframe. Was a strip of six to nine buttons that scrolled sideways on a
   phone; as a dropdown it holds every interval the operator has enabled without
   growing, and has room to say what each one means. Keys 1-9 still jump
   straight to one. */
.tf-select {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; font-weight: 500; cursor: pointer;
  width: auto; min-width: 0;          /* sized by its content, not the row */
  transition: border-color 0.15s ease;
}
.tf-select:hover { border-color: var(--muted); }
.tf-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary {
  background: linear-gradient(135deg, var(--accent-fill), color-mix(in srgb, var(--accent-fill) 85%, #000));
  color: var(--on-accent, #111);
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 14px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
button.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 45%, transparent); }
button.primary:disabled { opacity: 0.6; cursor: wait; }

/* ---------- chart ---------- */
/* The chart is the reason the page exists, so it takes the height the screen
   can spare rather than a fixed slab with dead space under it. */
.chart-wrap { position: relative; height: clamp(320px, calc(58vh / var(--zf, 1)), 640px); }
/* Fades in once app.js's loadChart() has real candles drawn (.ready, added
 * right after the first draw() - see app.js), instead of the canvas simply
 * existing with content already on it the instant the browser paints it.
 * Every subsequent symbol/timeframe switch keeps .ready set, so this is a
 * once-per-page-load entrance, not a flash on every switch - the shimmering
 * #chartStatus already covers "still loading" for those. */
#chart { width: 100%; height: 100%; display: block; cursor: crosshair; opacity: 0; transition: opacity var(--dur-slow) var(--ease-out); }
#chart.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #chart { opacity: 1; transition: none; } }
.chart-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.chart-status.hidden { display: none; }

/* ---------- signal card ---------- */
.signal-panel h2 { font-size: 16px; margin-bottom: 10px; }
.signal-panel h3 {
  font-size: 12px; color: var(--muted); margin: 18px 0 8px;
  text-transform: uppercase; letter-spacing: 1.2px;
  display: flex; align-items: center; gap: 8px;
}
.signal-panel h3::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Collapsible sidebar sections. The panel used to render every section at
   once - alerts config, levels, plan, sizing, evidence, reasons - so the
   verdict people came for sat above a metre of scroll. Each section is a
   native <details>, so it is keyboard-operable and works with no JS. */
.sec { border-top: 1px solid var(--border); }
.sec:first-of-type { border-top: 0; }
.sec > summary {
  font-size: 12px; color: var(--muted); margin: 0; padding: 13px 0 11px;
  text-transform: uppercase; letter-spacing: 1.2px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none; user-select: none;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after {
  content: "›"; margin-left: auto; font-size: 17px; line-height: 1;
  transform: rotate(90deg); transition: transform 0.2s ease; color: var(--muted);
}
.sec[open] > summary::after { transform: rotate(-90deg); }
.sec > summary:hover { color: var(--text); }
.sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sec .sec-sub { text-transform: none; letter-spacing: 0; }
/* Panel-level sections keep a heading's weight rather than the sidebar's
   small-caps label, so collapsing news did not demote it to a footnote. */
.sec-lg { border-top: 0; }
.sec-lg > summary {
  font-size: 16px; font-weight: 500; color: var(--text);
  text-transform: none; letter-spacing: 0; padding: 0 0 10px;
}
.sec-lg > summary .news-updated { font-size: 11px; font-weight: 400; color: var(--muted); }
.sec > *:not(summary) { margin-bottom: 12px; }

/* Follow / paper-trade: review before it opens anything. */
.follow-box { margin-top: 14px; }
.follow-confirm {
  margin-top: 10px; padding: 12px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
}
.follow-lead { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.follow-facts { margin: 0 0 12px; font-size: 13px; }
.follow-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.follow-facts dt { color: var(--muted); }
.follow-facts dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.follow-actions { display: flex; gap: 8px; align-items: stretch; }
.follow-go, .follow-cancel {
  font-size: 13px; font-weight: 500; padding: 10px 14px;
  border-radius: 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); transition: all 0.15s ease;
}
.follow-go {
  flex: 1; border-color: transparent; color: var(--on-accent, #111);
  background: linear-gradient(135deg, var(--accent-fill), color-mix(in srgb, var(--accent-fill) 85%, #000));
}
.follow-go:hover { filter: brightness(1.08); }
.follow-go[disabled] { opacity: 0.6; cursor: default; }
.follow-cancel { background: var(--surface); color: var(--muted); font-weight: 500; }
.follow-cancel:hover { color: var(--text); border-color: var(--muted); }
.follow-facts dd.pos { color: var(--up); }
.follow-facts dd.neg { color: var(--down); }

/* ---------- order ticket ---------- */
.ticket-avail {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border);
}
.ticket-avail span { font-size: var(--fs-tiny); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.ticket-avail strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.ticket-label {
  display: block; font-size: var(--fs-tiny); color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin: 10px 0 6px;
}
.ticket-entry { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ticket-entry button {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; transition: all 0.15s ease;
}
.ticket-entry button b { font-size: 12px; }
.ticket-entry button small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticket-entry button:hover { border-color: var(--muted); }
.ticket-entry button.on {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.ticket-entry button.on small { color: var(--text); }
/* A target the signal never published cannot be chosen as the exit. */
.ticket-entry button:disabled { opacity: .4; cursor: not-allowed; }
.ticket-entry button:disabled:hover { border-color: var(--border); }

/* Auto-close control on an open position. */
.exit-form { margin-top: 10px; }
.exit-form label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.exit-form select { width: 100%; max-width: 100%; padding: 7px 8px; font-size: 12px; }
.exit-note { margin: 6px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }

/* First-run checklist. Ticks itself off from real state, then vanishes. */
.onboard {
  max-width: 900px; margin: 8px auto; padding: 0;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; background: var(--panel);
}
/* ONE LINE, AND ACTUALLY ONE LINE.
   It was already collapsed by default and still ate the top of a phone: the
   header wrapped onto a second row because the next-step title is a whole
   sentence, and the padding was sized for a heading rather than for a hint.
   Now it does not wrap - the title truncates with an ellipsis, which is the
   right way to shorten a line nobody is reading closely - and the whole strip
   is around half the height it was. Reported as taking too much room above
   the chart, which is the thing the reader came for. */
.onboard-head {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer; list-style: none; min-height: 0;
}
.onboard-head::-webkit-details-marker { display: none; }
.onboard-head::after {
  content: '⌄'; margin-left: auto; color: var(--muted); font-size: 14px; line-height: 1;
  transition: transform .15s; flex: 0 0 auto; padding-left: 4px;
}
.onboard[open] .onboard-head::after { transform: rotate(180deg); }
.onboard-head strong { font-size: 12.5px; color: var(--text); flex: 0 0 auto; }
/* The part that gives way. min-width:0 is what lets a flex child shrink below
   its content at all - without it the ellipsis never appears and the row
   wraps again. */
.onboard-head span {
  font-size: 11.5px; color: var(--muted); flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.onboard-steps { list-style: none; margin: 0; padding: 0 14px 4px; display: grid; gap: 10px; }
.onboard-steps li {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.onboard-steps li > div { flex: 1 1 220px; min-width: 0; }
.onboard-steps b { display: block; font-size: 14px; color: var(--text); }
.onboard-steps p { margin: 4px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted); }
.onboard-steps .btn-primary { flex: 0 0 auto; font-size: 13px; padding: 8px 14px; }
.onboard-note { margin: 10px 14px 12px; font-size: 11px; color: var(--muted); }

/* Sample-size honesty on the track record. */
.perf-confidence {
  max-width: 680px; margin: 0 auto 18px; padding: 14px 16px;
  border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px;
  background: var(--panel);
}
/* Only the heading is a block. The paragraph under it emphasises the two ends
   of the confidence interval inline, and a blanket display:block put each of
   them on its own line - "-1.232", "to", "-1.19" stacked down the box. */
.perf-confidence > strong { display: block; margin-bottom: 6px; font-size: 15px; }
.perf-confidence p strong { color: var(--text); white-space: nowrap; }
.perf-confidence p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.perf-confidence.unproven { border-left-color: var(--warn, #38BDF8); }
.perf-confidence.ok { border-left-color: var(--up, #22C55E); }
.perf-confidence.bad { border-left-color: var(--down, #EF4444); }
.ticket-pcts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 7px; }
.ticket-pcts button {
  padding: 7px 4px; font-size: 11px; font-weight: 500; cursor: pointer;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; transition: all 0.15s ease;
}
.ticket-pcts button:hover { color: var(--text); border-color: var(--muted); }
.ticket-pcts button.on { color: var(--on-accent, #111); background: var(--accent-fill); border-color: transparent; }
.ticket-amt { display: flex; align-items: center; gap: 8px; }
.ticket-amt input {
  flex: 1; min-width: 0; padding: 10px 11px; font-size: 15px; font-weight: 500;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
.ticket-amt span { font-size: 12px; color: var(--muted); }
/* The top-up, which only appears when a shortfall is the thing in the way.
   Set apart from the ticket above it so it reads as an answer to the error
   rather than as another field that was always there and got missed. */
.ticket-topup {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
}
.ticket-topup .ticket-pcts { grid-template-columns: repeat(3, 1fr); margin-top: 7px; }
/* Its own bottom margin, or it sits flush against the ticket's own action row
   and the two primary buttons read as one control split in half. */
.ticket-topup .follow-go { width: 100%; margin: 8px 0 12px; }
.ticket select {
  width: 100%; padding: 9px 10px; font-size: 13px; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
.ticket .follow-facts { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.ticket-err { margin: 8px 0 0; font-size: 12px; color: var(--down); }
.ticket .follow-lead { margin: 10px 0 0; }
.follow-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Open position, marked to the live price. */
.live-pos {
  margin-bottom: 12px; padding: 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface2);
}
.live-pos-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.live-pos-side { font-size: 11px; font-weight: 500; letter-spacing: 1px; }
.live-pos-tag { font-size: var(--fs-tiny); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.live-pos-pnl {
  font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums;
  margin-bottom: 8px; letter-spacing: -0.5px;
}
.live-pos-pnl.pos, .live-pos-side.pos { color: var(--up); }
.live-pos-pnl.neg, .live-pos-side.neg { color: var(--down); }
.live-pos .follow-facts { margin: 0; font-size: 12px; }
/* These notes carry the only links out to the portfolio, and with no colour
   set they took the browser's visited purple - unreadable on the dark panel. */
.tp-note a, .follow-lead a, .follow-facts a { color: var(--accent); }
.tp-note a:hover, .follow-lead a:hover, .follow-facts a:hover { text-decoration: underline; }

/* Set your trading funds without leaving the chart. */
.funds-form {
  margin-top: 10px; padding: 12px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
}
.funds-form label {
  display: block; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}
.funds-form input[type="number"] {
  width: 100%; padding: 9px 10px; font-size: 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
/* Square tiles, three across: a set of amounts you pick from at a glance
   rather than a row of pills that wrap unevenly. */
.funds-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin-bottom: 8px;
}
.funds-grid button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; aspect-ratio: 1 / 1; padding: 4px; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; transition: all 0.15s ease;
}
.funds-grid button b { font-size: 15px; font-weight: 500; }
.funds-grid button small { font-size: var(--fs-micro); color: var(--muted); letter-spacing: 0.3px; }
.funds-grid button:hover { border-color: var(--muted); transform: translateY(-1px); }
.funds-grid button.on {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.funds-grid button.on small { color: var(--text); }
.funds-row { display: flex; gap: 8px; margin-top: 10px; }
.funds-row > div { flex: 1; min-width: 0; }
.funds-form select {
  width: 100%; padding: 9px 10px; font-size: 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.funds-unit { font-size: 11px; color: var(--muted); }
/* ---------- portfolio wallet ---------- */
.wallet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wallet-head h2 { margin: 0; font-size: 16px; }
.wallet-figures { display: grid; grid-template-columns: minmax(190px, 1fr) 2fr; gap: 16px; align-items: center; }
.wallet-main span {
  display: block; font-size: var(--fs-tiny); color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.wallet-main strong {
  display: block; font-size: 30px; font-weight: 500; letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums; margin: 2px 0 3px;
}
.wallet-main strong.pos { color: var(--up); }
.wallet-main strong.neg { color: var(--down); }
.wallet-main small { font-size: 11px; color: var(--muted); }
.wallet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wallet-grid > div {
  padding: 9px 11px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
}
.wallet-grid span {
  display: block; font-size: var(--fs-micro); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 2px;
}
.wallet-grid strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.wallet-grid strong.pos, .wallet-main .pos { color: var(--up); }
.wallet-grid strong.neg, .wallet-main .neg { color: var(--down); }
/* Adding funds is a small, occasional action. Given the full width of the
   panel it turned into six enormous tiles above a text field a thousand
   pixels long, which read as the main thing on the page. */
.wallet-actions {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  max-width: 560px;
}
.wallet-form .funds-grid { grid-template-columns: repeat(6, 1fr); margin-bottom: 8px; }
.wallet-form .funds-grid button { aspect-ratio: auto; padding: 8px 4px; border-radius: 8px; }
.wallet-form .funds-grid button b { font-size: 13px; }
.wallet-form .funds-grid button small { display: none; }
/* One row: amount, add, withdraw. Wrapped onto its own line, Withdraw
   stretched the full width and read as the primary action. */
.wallet-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: nowrap; }
.wallet-row input {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px; font-size: 14px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
.wallet-row .btn-primary, .wallet-withdraw { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 460px) {
  .wallet-row { flex-wrap: wrap; }
  .wallet-row input { flex: 1 1 100%; }
}
/* Its own class rather than the alerts panel's clear-link: that one is a
   full-width underlined destructive link, and inheriting its width made
   Withdraw span the row and read as the primary action. */
.wallet-withdraw {
  width: auto; padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--muted); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; cursor: pointer; transition: all 0.15s ease;
}
.wallet-withdraw:hover { color: var(--text); border-color: var(--muted); }
/* The amount field opens from whichever action was chosen, rather than sitting
   on the page waiting. Radios drive it so it works with no script; they stay
   focusable (1px, transparent, not display:none) so the pair is still a
   keyboard-operable group with arrow keys, and the focus ring is drawn on the
   label that stands in for each one. */
.wallet-form { position: relative; }
.wallet-mode {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px;
  margin: 0; opacity: 0; pointer-events: none;
}
.wallet-choose { display: flex; gap: 8px; flex-wrap: wrap; }
.wallet-choose label { cursor: pointer; }
.wallet-panel { display: none; margin-top: 12px; }
#wmAdd:checked ~ .wallet-panel, #wmTake:checked ~ .wallet-panel { display: block; }
/* The chosen action steps aside once its own panel is open. Leaving it there
   put two buttons reading "Add funds" on screen at once - the one that opened
   the panel and the one that submits it - and the only question that matters
   at that point is which of them actually adds the money. The OTHER action
   stays, so switching from adding to withdrawing is still one click. */
#wmAdd:checked ~ .wallet-choose label[for="wmAdd"],
#wmTake:checked ~ .wallet-choose label[for="wmTake"] { display: none; }
#wmAdd:focus-visible ~ .wallet-choose label[for="wmAdd"],
#wmTake:focus-visible ~ .wallet-choose label[for="wmTake"],
#wmNone:focus-visible ~ .wallet-panel .wallet-cancel { outline: 2px solid var(--accent); outline-offset: 2px; }
#wmAdd:checked ~ .wallet-panel .only-take,
#wmTake:checked ~ .wallet-panel .only-add { display: none; }
.wallet-mode-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.wallet-mode-note strong { color: var(--text); font-variant-numeric: tabular-nums; }
.wallet-cancel { display: inline-flex; align-items: center; }

/* ---------- open positions as cards ---------- */
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.pos-card {
  padding: 14px; background: var(--surface2);
  border: 1px solid var(--border); border-left-width: 3px; border-radius: 8px;
}
.pos-card.buy { border-left-color: var(--up); }
.pos-card.sell { border-left-color: var(--down); }
.pos-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pos-sym { font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; }
.pos-sym:hover { color: var(--accent); }
.pos-tf { font-size: 11px; color: var(--muted); }
.pos-pnl {
  font-size: 24px; font-weight: 500; letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.pos-pnl.pos { color: var(--up); }
.pos-pnl.neg { color: var(--down); }
.pos-now { font-size: 11px; color: var(--muted); margin: 2px 0 12px; }
.pos-now strong { color: var(--text); font-variant-numeric: tabular-nums; }
.pos-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; margin: 0 0 12px; }
.pos-facts > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.pos-facts dt { color: var(--muted); }
.pos-facts dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.pos-facts dd.pos { color: var(--up); }
.pos-facts dd.neg { color: var(--down); }
/* Targets: green means REACHED, and only reached.
 *
 * Target 1 used to be painted green whether or not price had ever got near
 * it, which is the worst possible use of that colour on a page about trades -
 * green on a price reads as "done", so a position that has never moved looked
 * like one that had banked its first target. Now an unreached target is
 * ordinary text and a reached one is green with a tick, so the card can be
 * read at a glance: how far has this actually run. */
.pos-facts dd.tp-lvl { color: var(--text); }
.pos-facts dd.tp-hit { color: var(--up); }
.pos-facts dd.tp-hit span { font-weight: 500; margin-left: 2px; }
/* The reference, same six characters charts.php shows on the signal this
   position came from - mono like every other code snippet on the site,
   sized down from the browser default so it sits at the same weight as the
   other facts in this grid instead of jumping out as the biggest thing on
   the card. */
.pos-facts dd code { font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; }
/* Closed trades and the followed-vs-your-own comparison, same card language. */
.closed-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pos-card.closed { border-left-color: var(--muted); }
.pos-card.closed.win { border-left-color: var(--up); }
.pos-card.closed.loss { border-left-color: var(--down); }
.pos-card.closed .pos-pnl { font-size: 20px; display: flex; align-items: baseline; gap: 8px; }
.pos-r { font-size: 12px; font-weight: 500; }
.pos-r.pos { color: var(--up); }
.pos-r.neg { color: var(--down); }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.cmp-card {
  padding: 14px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
}
.cmp-card h3 { margin: 0 0 10px; font-size: 14px; }
.cmp-card .pos-facts { grid-template-columns: 1fr; margin: 0; }

@media (max-width: 720px) {
  .wallet-figures { grid-template-columns: 1fr; }
  .wallet-grid { grid-template-columns: repeat(2, 1fr); }
  .wallet-form .funds-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Balance / committed / available, at a glance above the sizing. */
.funds-bar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 10px; padding: 10px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
}
.funds-bar > div { min-width: 0; }
.funds-bar span {
  display: block; font-size: var(--fs-micro); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 2px;
}
.funds-bar strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.funds-bar strong.pos { color: var(--up); }
.funds-bar strong.neg { color: var(--down); }

/* Figures based on the worked-example capital, not the member's own. */
.wallet-empty {
  margin: 12px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--muted);
  border-left: 3px solid var(--warn-border); padding-left: 10px;
}
.funds-default-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: var(--fs-micro); font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--warn-text); border: 1px solid var(--warn-border); border-radius: 999px;
}
.funds-form .follow-actions { margin-top: 12px; }

.signal-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface2);
}
.signal-badge {
  font-size: 26px;
  font-weight: 500;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  letter-spacing: 2px;
  transition: all 0.3s ease;
}
.signal-card.buy .signal-badge {
  color: var(--up); background: var(--bg-up);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 35%, transparent),
              0 0 24px color-mix(in srgb, var(--up) 18%, transparent);
}
.signal-card.sell .signal-badge {
  color: var(--down); background: var(--bg-down);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down) 35%, transparent),
              0 0 24px color-mix(in srgb, var(--down) 18%, transparent);
}
/* NO SETUP. var(--bg-warn) is a hardcoded dark amber written before the light theme
   existed, so in light mode the plate stayed dark while --warn-text went dark
   with the theme - 2.16:1, on the single largest piece of type on the page.
   Tinted from the theme's own warn colour instead, so the plate follows the
   ground it is sitting on. */
.signal-card.neutral .signal-badge {
  color: var(--warn-text);
  background: color-mix(in srgb, var(--warn-border) 20%, var(--surface2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn-text) 25%, transparent);
}
/* THE SIGNAL ID ROW.
 *
 * A reference is read off the screen and typed somewhere else, so it is set in
 * a monospace face with the characters spaced: SM-MCSK6B in a proportional
 * font puts the S and the M close enough to argue about, and the alphabet
 * already went to the trouble of dropping every glyph pair people confuse.
 *
 * Its own plate rather than a colour on the panel ground, for the same reason
 * every badge on this site has one: a token that is legible on one theme and
 * marginal on the other stops being a decision anybody can check. Fixed ink on
 * a fixed ground, measured on both. */
.sig-ref {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.sig-ref > span {
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sig-ref code {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.09em;
  background: #1b2430;
  /* Was --bg-accent, a background-tint token, used as the foreground color -
     against this chip's own dark background that landed text and background
     within a hair of each other. --accent is the paired full-strength
     foreground token, same as every other --bg-X/X pairing in this file. */
  color: var(--accent);
  border: 1px solid #33455c;
  border-radius: 8px;
  padding: 3px 8px;
  /* Tapping it selects the whole thing, for the reader who would rather
     long-press than find the button. */
  user-select: all;
}
:root[data-theme="light-palette"] .sig-ref code {
  background: var(--bg-accent);
  color: #14283f;
  border-color: #b9c8db;
}
/* 24px of target, per WCAG 2.2 AA, on a control that is 11px of text. */
.sig-ref-copy {
  min-height: 24px;
  min-width: 44px;
  padding: 2px 9px;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.sig-ref-copy:hover { border-color: var(--muted); }
.sig-ref-copy.done { border-color: var(--up); color: var(--up); }

.signal-meta { display: flex; gap: 8px; margin-top: 12px; }
.signal-meta > div {
  flex: 1;
  text-align: center;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 4px;
}
.signal-meta span { display: block; font-size: 11px; color: var(--muted); }
.signal-meta strong { font-size: 14px; }

/* Four figures read as four things, not a list of label:value pairs. */
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.levels > div {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  transition: border-color 0.15s ease;
}
.levels > div:hover { border-color: var(--muted); }
.levels span {
  display: block; font-size: var(--fs-micro); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 3px;
}
.levels strong { font-size: 15px; font-variant-numeric: tabular-nums; }

.reasons { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.reasons li {
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  padding: 8px 10px;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.reasons li:hover { transform: translateX(2px); }
.reasons li.bullish { border-left-color: var(--up); }
.reasons li.bearish { border-left-color: var(--down); }
.reasons li strong { display: block; font-size: 12px; }
.reasons li em { color: var(--muted); font-style: normal; font-size: 12px; }
.reasons li .w { float: right; color: var(--muted); font-size: 11px; }
.reasons li.muted { color: var(--muted); border-left-color: var(--border); }

.small-print { margin-top: 16px; font-size: 11px; color: var(--warn-text); line-height: 1.5; }

/* ---------- trade plan ---------- */
.trade-plan { background: var(--surface2); border-radius: 8px; padding: 10px 12px; }
.tp-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.tp-row:last-of-type { border-bottom: none; }
.tp-row span { color: var(--muted); }
/* .tp-row.sl/.tp-row.tp strong colour lives once, with the trade-ticket
   component below - it repeated the exact same two declarations here. */
.tp-note { font-size: 11px; color: var(--muted); margin-top: 6px; }
/* The higher-timeframe ladder, above the plan: a grid of one tile per frame,
   so a clean trend and a disagreement that averages to the same number look
   nothing alike at a glance. */
.mtf {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  text-align: left;
}
.mtf-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  margin-bottom: 8px; font-size: var(--fs-tiny); color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.mtf-head strong { font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.mtf-head strong.up { color: var(--up); }
.mtf-head strong.down { color: var(--down); }
.mtf-head strong.flat { color: var(--muted); }
.mtf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 6px; }
.mtf-cell {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 4px; border-radius: 8px; cursor: help;
  border: 1px solid var(--border); background: var(--panel-2);
}
.mtf-cell.up { border-color: color-mix(in srgb, var(--up) 45%, var(--border)); }
.mtf-cell.down { border-color: color-mix(in srgb, var(--down) 45%, var(--border)); }
.mtf-tf { font-size: 11px; font-weight: 500; }
.mtf-dir { font-size: 12px; line-height: 1; }
.mtf-cell.up .mtf-dir { color: var(--up); }
.mtf-cell.down .mtf-dir { color: var(--down); }
.mtf-cell.flat .mtf-dir { color: var(--muted); }
.mtf-str { font-size: var(--fs-tiny); color: var(--muted); font-variant-numeric: tabular-nums; }

/* Regime: one line, because the label is trivia and the effects are the point. */
.regime {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 10px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel-2);
  font-size: 11px; cursor: help; text-align: left;
}
.rg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.rg-dot.trend { background: var(--up); }
.rg-dot.range { background: var(--muted); }
.rg-dot.hot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 30%, transparent); }
.rg-name { font-weight: 500; }
.rg-effect { color: var(--muted); font-variant-numeric: tabular-nums; }

/* The axes behind the confidence number. Collapsed by default: the summary is
   the number, the detail is for a reader who wants to argue with it. */
.conf-dims { margin-top: 10px; text-align: left; }
.conf-dims > summary {
  list-style: none; cursor: pointer; font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.conf-dims > summary::-webkit-details-marker { display: none; }
.conf-dims > summary::before { content: "▸ "; }
.conf-dims[open] > summary::before { content: "▾ "; }
.conf-dims > summary:hover { color: var(--text); }
.cd-tag {
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}
.cd-tag.measured { color: var(--up); border-color: color-mix(in srgb, var(--up) 50%, var(--border)); }
.cd-grid { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.cd-row { display: grid; grid-template-columns: 96px 1fr 26px; align-items: center; gap: 8px; cursor: help; }
.cd-name { font-size: var(--fs-small); color: var(--muted); }
.cd-track { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.cd-bar { display: block; height: 100%; border-radius: 999px; }
.cd-bar.good { background: var(--up); }
.cd-bar.mid { background: var(--warn-text, #38BDF8); }
.cd-bar.poor { background: var(--down); }
.cd-val { font-size: var(--fs-small); text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.cd-note { font-size: var(--fs-small); color: var(--muted); line-height: 1.5; margin-top: 8px; }

/* Market structure: one tile per thing found, freshest first. Shares the
   ladder's shape on purpose - both answer "where am I", not "what do I do". */
.smc {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  text-align: left;
}
.smc-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  margin-bottom: 8px; font-size: var(--fs-tiny); color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.smc-head strong { font-size: 12px; letter-spacing: 0; text-transform: capitalize; cursor: help; }
.smc-head strong.up { color: var(--up); }
.smc-head strong.down { color: var(--down); }
.smc-head strong.flat { color: var(--muted); }
.smc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.smc-cell {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 5px; border-radius: 8px; cursor: help; text-align: center;
  border: 1px solid var(--border); background: var(--panel-2);
}
.smc-cell.up { border-color: color-mix(in srgb, var(--up) 45%, var(--border)); }
.smc-cell.down { border-color: color-mix(in srgb, var(--down) 45%, var(--border)); }
.smc-name { font-size: var(--fs-small); font-weight: 500; line-height: 1.25; }
.smc-dir { font-size: 12px; line-height: 1.1; }
.smc-cell.up .smc-dir { color: var(--up); }
.smc-cell.down .smc-dir { color: var(--down); }
.smc-cell.flat .smc-dir { color: var(--muted); }
.smc-meta { font-size: var(--fs-micro); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ================= Signal detail tabs =================
   Why this signal, Structure, Evidence, Context and News & events used to
   stack as independent, mostly open-by-default blocks - three inside the
   signal sidebar, two more below the fold - which made the page very long,
   especially on a phone: .reasons (Why this signal) had NO height cap at all
   below max-width:720px (see the removed mobile override), so it was often
   the single tallest block on the page. One tab strip, one panel instead:
   every element these hold keeps its existing id, only which one is VISIBLE
   changes. A pill row, horizontally scrollable so a narrow viewport never
   forces a wrap; the active pill uses the same --accent-fill convention as
   .mode-seg button.on / .scan-pop-seg button.on elsewhere on this page. */
/* The wrapping <section> keeps .layout's own box model (centring, max-width,
   padding) but is a single full-width column rather than .layout's default
   chart/sidebar 1fr+340px split - the same override .news-layout already
   makes for its own two-column need, just collapsed to one column here since
   it sits outside .fold-grid (whose own > section.layout rule neutralises
   the grid entirely, which is not available to a section placed elsewhere). */
.rtab-wrap { grid-template-columns: 1fr; }
.rtab-panel { padding-top: 4px; }
.rtab-bar {
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 9px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.rtab-bar::-webkit-scrollbar { display: none; }
.rtab-btn {
  flex: 0 0 auto; padding: 8px 14px; min-height: 40px;
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.rtab-btn:hover { color: var(--text); border-color: var(--muted); }
.rtab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rtab-btn.on { background: var(--accent-fill); color: var(--on-accent, #111); border-color: transparent; }
.rtab-btn[hidden] { display: none; }
/* Same cap on every viewport rather than a desktop cap a mobile override then
   discarded - see the @media (max-width:720px) override below, and compare
   to the .reasons max-height:none override this replaces. */
.rtab-pane { max-height: 420px; overflow-y: auto; }
.rtab-pane-head {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 15px; font-weight: 500; color: var(--text);
}
/* .smc carries margin/border meant for sitting inline in the signal card
   below the trade plan; inside a tab pane it is the first and only thing. */
.rtab-pane .smc { margin-top: 0; padding-top: 0; border-top: 0; }
.rtab-news-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 720px) {
  .rtab-pane { max-height: 360px; }
  .rtab-bar { gap: 5px; }
  .rtab-btn { padding: 7px 11px; font-size: 12px; }
  .rtab-news-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* The plan inside the signal card: separated by a rule rather than a heading
   and a fold, because it is the same verdict written as prices. */
.signal-card .trade-plan {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  text-align: left;
}
.tp-head {
  display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px;
  font-size: var(--fs-tiny); color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
}
.tp-head span { text-transform: none; letter-spacing: 0; font-size: var(--fs-tiny); opacity: 0.75; }
/* Three fixed rules that rarely change - available, not in the way. */
.tp-exits > summary {
  list-style: none; cursor: pointer; margin-top: 8px;
  font-size: 11px; color: var(--muted);
}
.tp-exits > summary::-webkit-details-marker { display: none; }
.tp-exits > summary::before { content: "▸ "; }
.tp-exits[open] > summary::before { content: "▾ "; }
.tp-exits > summary:hover { color: var(--text); }
/* Key levels close the card: the numbers the plan was worked out from. */
.signal-card .levels {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  text-align: left;
}
.exit-rules { list-style: none; margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.exit-rules li { font-size: 11.5px; color: var(--muted); line-height: 1.5; padding-left: 16px; position: relative; }
.exit-rules li::before { content: "↩"; position: absolute; left: 0; color: var(--warn-text); }
.sig-history { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.sig-history .h-chip { padding: 3px 9px; border-radius: 999px; font-weight: 500; font-size: var(--fs-tiny); background: var(--bg); }
.sig-history .h-chip.buy { color: var(--up); }
.sig-history .h-chip.sell { color: var(--down); }
.sig-history .h-chip.neutral { color: var(--warn-text); }
.sig-history .h-arrow { color: var(--border); }

/* ---------- favourites ---------- */
.fav-btn {
  background: var(--surface2); border: 1px solid var(--border); color: var(--warn-text);
  border-radius: 8px; padding: 7px 12px; font-size: 17px; line-height: 1; cursor: pointer;
}
.fav-btn:hover { border-color: var(--warn-text); }
.fav-btn.on { background: var(--bg-warn); border-color: var(--warn-border); }
.fav-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fav-bar:empty { display: none; }
.fav-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 500; cursor: pointer;
}
.fav-chip:hover, .fav-chip.active { border-color: var(--accent); }
.fav-chip.active { background: #14263f; }
.fav-chip .star { color: var(--warn-text); font-size: 11px; }

/* ---------- live price ---------- */
.live-price {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.live-price .live-dot { width: 7px; height: 7px; }
.live-price.up-tick #livePriceVal { color: var(--up); }
.live-price.down-tick #livePriceVal { color: var(--down); }

/* ---------- signal alerts ---------- */
/* ---------- alerts behind a bell ---------- */
.signal-head { margin-bottom: 10px; }
.bell-menu { position: relative; margin-left: auto; }
.bell-btn {
  position: relative; padding: 6px 9px; font-size: 15px; line-height: 1; cursor: pointer;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; transition: all 0.15s ease;
}
.bell-btn:hover, .bell-btn.on { border-color: var(--accent); }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 16px; padding: 1px 4px;
  font-size: var(--fs-micro); font-weight: 500; line-height: 1.4; text-align: center;
  background: var(--accent); color: var(--on-accent, #111); border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
/* Longer strings get tighter padding, NOT smaller type. Anchored on its right
   edge the badge grows leftwards over the bell, so it does need to stay
   narrow - but the old rules bought that with 7.5px type, and the badge exists
   to be read. Four digits are formatted as "1.2k" in app.js instead, so
   nothing here ever has to go under the floor. */
.bell-count[data-len="3"] { padding: 1px 3px; }
.bell-count[data-len="4"] { padding: 1px 3px; letter-spacing: -0.2px; }
.bell-count[data-len="5"] { padding: 0 3px; letter-spacing: -0.3px; }
.bell-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 310px; max-height: min(calc(70vh / var(--zf, 1)), 560px); overflow-y: auto;
  padding: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.bell-head {
  font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 10px;
}
/* Inside the popover the box is the popover, so it drops its own chrome. */
.bell-panel .alerts-box { background: none; padding: 0; }
@media (max-width: 420px) {
  .bell-panel { width: calc(calc(100vw / var(--zf, 1)) - 40px); right: -8px; }
}

.alerts-box { background: var(--surface2); border-radius: 8px; padding: 12px; }
.alerts-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.alerts-enable, .alerts-watch {
  width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 9px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.alerts-enable.on { background: var(--bg-up); border-color: var(--line-up); color: var(--up); }
.alerts-watch { margin-top: 8px; }
.alerts-watch:hover, .alerts-enable:hover { border-color: var(--accent); }
.alerts-watch.bulk {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  font-weight: 500;
}
/* Watch-the-winners: a pair of choices, so they sit side by side and read as
   two ways to do one thing rather than two more buttons in a stack. They fall
   to one column when the sidebar is too narrow to give each a readable label
   - two buttons squeezed to 90px each is worse than two full-width ones. */
.top-watch { margin-top: 10px; }
.top-watch .alerts-watch.top {
  background: color-mix(in srgb, var(--up) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--up) 40%, var(--border));
  font-weight: 500; text-align: left; line-height: 1.35;
}
.top-watch .alerts-watch.top:hover { border-color: var(--up); }
.top-watch .alerts-watch.top:disabled { opacity: 0.65; cursor: default; }
.top-watch-note { color: var(--muted); font-size: 11.5px; line-height: 1.6; margin: 8px 0 0; }
@media (min-width: 1100px) {
  .top-watch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .top-watch .alerts-watch.top { margin-top: 0; }
  .top-watch-note { grid-column: 1 / -1; margin-top: 0; }
}
.alerts-clear {
  width: 100%; margin-top: 6px; background: none; border: none; color: var(--muted);
  font-size: 11.5px; cursor: pointer; text-decoration: underline; padding: 4px;
}
.alerts-clear:hover { color: var(--down); }
.tf-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0; }
.tf-checks label { font-size: 12px; color: var(--text); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.watch-list { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 5px; max-height: 280px; overflow-y: auto; }
.watch-list li {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  background: var(--bg); border-radius: 8px; padding: 6px 9px;
}
.watch-list .w-sig { margin-left: auto; font-weight: 500; }
.watch-list .w-sig.buy { color: var(--up); }
.watch-list .w-sig.sell { color: var(--down); }
.watch-list .w-sig.neutral { color: var(--warn-text); }
.watch-list button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; }
.watch-list button:hover { color: var(--down); }
.email-opt { display: block; margin-top: 10px; font-size: 12px; color: var(--text); cursor: pointer; }
.email-opt input { vertical-align: -2px; margin-right: 4px; }
.email-opt .email-note { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.email-opt.muted-note { color: var(--muted); cursor: default; }
.email-opt.muted-note a { color: var(--accent); }

/* ---------- news ---------- */
.news-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); padding-top: 0; }
@media (max-width: 980px) { .news-layout { grid-template-columns: 1fr; } }
.news-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.news-head h2 { font-size: 15px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.news-updated { color: var(--muted); font-size: 11px; margin-left: auto; }
.news-list, .events-list { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
/* Headlines as a grid of boxes: the panel is half the page on a desktop, so
   a single stacked column left most of it empty. Auto-fill keeps it one
   column wherever the panel is genuinely narrow. */
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; align-content: start; }
.news-list li, .events-list li {
  background: var(--surface2); border-radius: 8px; padding: 9px 12px; font-size: 13px;
  border: 1px solid var(--border); transition: border-color 0.15s ease, transform 0.15s ease;
}
.news-list li:hover, .events-list li:hover { border-color: var(--muted); transform: translateY(-1px); }
.news-list li.muted, .events-list li.muted { color: var(--muted); }
.news-list a { color: var(--text); text-decoration: none; font-weight: 500; display: block; line-height: 1.4; }
.news-list a:hover { color: var(--accent); }
.news-meta { display: flex; gap: 8px; margin-top: 3px; font-size: 11px; color: var(--muted); }
.news-src { color: var(--accent); }
.news-sum { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.5; }
/* The three-column event layout must not catch the empty-state line, which
   was being squeezed into the 62px time column one word at a time. */
.events-list li:not(.muted) { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; }
.ev-time { font-size: 11px; color: var(--muted); line-height: 1.4; }
.ev-title { font-weight: 500; font-size: 12.5px; line-height: 1.35; }
.ev-title small { display: block; color: var(--muted); font-weight: 400; }
.impact { font-size: var(--fs-tiny); font-weight: 500; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; }
.impact.high { background: var(--bg-down); color: var(--down); }
.impact.medium { background: var(--bg-warn); color: var(--warn-text); }
.impact.low { background: var(--bg); color: var(--muted); }
.impact.holiday, .impact.none { background: var(--bg); color: var(--muted); }
.attribution { margin-top: 10px; font-size: var(--fs-small); color: var(--muted); }
.ev-now { outline: 1px solid var(--warn-border); }

/* ---------- footer ---------- */
.footer {
  max-width: 1400px;
  margin: 12px auto 0;
  padding: 18px 22px 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.footer p { max-width: 760px; margin: 0 auto 6px; }

/* ---------- chart tooltip ---------- */
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: #030303f2;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: nowrap;
  z-index: 5;
  display: none;
}
.chart-tip .t { color: var(--muted); }
.chart-tip .up { color: var(--up); }
.chart-tip .down { color: var(--down); }

.chart-legend {
  position: absolute;
  top: 8px;
  left: 10px;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  z-index: 4;
  background: #16161b00;
}
.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 4px;
  margin-right: 5px;
  vertical-align: middle;
  /* The SWATCH carries the series colour, from the --sw the chart sets on each
     span; the LABEL is ordinary text. It used to be one colour doing both jobs
     via currentColor, which meant the words were painted in a line colour
     chosen for a dark canvas - 2.5:1 as type on a light panel. */
  background: var(--sw, currentColor);
}
.chart-legend span { color: var(--text); }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .topbar { padding: 10px 14px; }
  /* ONE RULE FOR THE PHONE HEADER, NOT TWO OVERLAPPING ONES.
     This used to set 34px/15px here and a SECOND query at 600px silently
     took the logo down again to 32px - two sources of truth for one header,
     five pixels apart, that had to be read together to know what actually
     shipped. Set once, here, at the size the header should be with the tab
     bar doing the work a Menu label used to: tight enough that the account
     icon and the theme toggle read as a pair of quiet utility controls, not
     a wordmark competing with a mark of its own. */
  .brand .logo-img { width: 30px; height: 30px; }
  .brand strong { font-size: 14.5px; }
  .brand small { font-size: 11px; }
  /* Destinations live in the always-open nav row; account links live behind
     the icon - same split as desktop now, just a full-width dropdown here
     instead of a small one. .nav-account renders as nothing of its own
     (display:contents) so the rules just below, written against .top-nav's
     direct descendants, reach its children exactly as if the wrapper were
     not there. */
  .nav-account { display: contents; }
  .top-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 12px 14px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
  .top-nav.open { display: flex; animation: menuDrop 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
  .top-nav .nav-btn { width: 100%; text-align: center; padding: 13px 14px; font-size: 14px; border-radius: 8px; }
  .top-nav .nav-btn:not(.accent) { background: var(--surface2); }
  .top-nav .member-link { max-width: none; }
  /* .nav-tabbed is hidden at every width now (see the universal rule near
     .top-nav's base style, above), and .nav-sep is hidden outright there
     too now, for the same reason - nothing ever renders on its left to
     divide from any more. Nothing extra needed here. */
  .layout { padding: 12px; gap: 12px; }
  .panel { padding: 12px; }
  /* Clean two-column control grid on phones - no overlapping/stacked buttons */
  .controls { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
  /* FOUR CONTROLS, TWO BY TWO, RATHER THAN A RAGGED WRAP.
   *
   * flex-wrap sized each group to its own content, so the row broke wherever
   * it happened to run out - chart type and indicators on one line with a hole
   * after them, compare and the zoom cluster on the next. It reads as a
   * toolbar that did not fit rather than one that was laid out. A two-column
   * grid puts them in a block, same four controls, same two rows, no hole. */
  .chart-toolbar {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px; align-items: stretch;
  }
  .chart-toolbar > * { min-width: 0; }
  .chart-toolbar .ct-select { width: 100%; }
  .ct-btn { font-size: 11px; padding: 5px 7px; }
  .controls select { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .controls .sym-pick { grid-column: 1 / -1; }
  .sym-search { width: 100%; }
  .sym-results { left: 0; right: 0; min-width: 0; }
  /* Timeframe keeps its old slot beside the favourite star rather than
     taking a full row of its own like the other selects. */
  /* FOUR SMALL CONTROLS, ONE ROW, NOT TWO.
   *
   * Timeframe and the favourite star sat on one line and the price chip and
   * the refresh button on the next, which is two rows spent on four things
   * that all fit across a phone. Part of the same 658 pixels. */
  .controls { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; }
  .controls #tfSelect { grid-column: 1; width: 100%; min-width: 0; }
  .fav-btn { grid-column: 2; width: 44px; display: flex; align-items: center; justify-content: center; }
  .live-price { grid-column: 3; justify-content: center; min-width: 0; }
  button.primary { grid-column: 4; margin-left: 0; padding: 10px 12px; white-space: nowrap; }
  .controls select:not(#tfSelect) { grid-column: 1 / -1; }
  .controls .sym-pick { grid-column: 1 / -1; }
  .unlock-hint { grid-column: 1 / -1; }
  .unlock-hint { grid-column: 1 / -1; justify-content: center; }
  /* THE CHART IS THE PRODUCT AND IT WAS THE SMALLEST THING ON THE PAGE.
   *
   * 55vw on a 375px phone is 206px, which the clamp lifted to 260 - and a
   * quarter of that is the volume pane and the date axis, so the candles had
   * about 190px. Above it sat five rows of controls, so a visitor's first
   * screen was mostly toolbar.
   *
   * Sized against the VIEWPORT HEIGHT instead: a phone held upright has height
   * to spare and width it does not, and vw was measuring the wrong one. 52vh
   * is 347px on a 667px screen and grows on a taller one, with a floor for
   * landscape and a ceiling so a tablet does not hand over a whole screen of
   * candles with the signal card pushed off the bottom. */
  .chart-wrap { height: clamp(280px, calc(52vh / var(--zf, 1)), 460px); }
  .signal-badge { font-size: 22px; }
  /* .reasons used to lose its height cap entirely here (max-height: none),
     which made it - now inside the tabbed .rtab-pane, itself capped at 360px
     on this breakpoint - often the single tallest block on the page on a
     phone. The 320px desktop cap on .reasons itself now simply carries over
     unchanged, same as every other viewport. */
  .news-list, .events-list { max-height: 340px; }
  .events-list li { grid-template-columns: 56px 1fr auto; gap: 8px; padding: 8px; }
  .footer { padding: 8px 14px 24px; }
}
@media (hover: none) {
  #chart { cursor: default; }
}
@keyframes menuDrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ================= ambient layer ================= */

/* WHY THIS IS A GRID AND NOT TWO GLOWING ORBS.
 *
 * It was two 520px radial gradients at blur(90px), opacity .55, animating on
 * a 26s and a 32s loop, forever, on every page.
 *
 * Three problems, in order of how much they cost.
 *
 * Performance first, because it is the one the reader feels. A large blurred
 * layer cannot be cached as a static texture while it is being transformed:
 * the compositor re-rasterises a 520px blur every frame for as long as the
 * page is open, whether or not anyone scrolls. On a mid-range phone that is
 * measurable battery drain and it competes for the same compositor time as
 * the scroll it is sitting behind - so the decoration makes the content it
 * decorates feel worse.
 *
 * Then the direction. Blurred gradient blobs are the house style of every
 * AI-SaaS landing page of the last three years, which is exactly the thing
 * the palette was changed to get away from. Keeping them meant the site had
 * an argument about rigour set in an editorial serif, floating on top of the
 * visual language of a growth-hack template.
 *
 * Then honesty, which is the reason to prefer a grid specifically. A ruled
 * grid is what measurement paper looks like. It says the same thing the
 * product says.
 *
 * 64px cells, one hairline, radially masked so it fades out below the fold
 * rather than tiling the whole document. It drifts one cell over a minute -
 * slow enough to read as ambient rather than as motion, and cheap because a
 * repeating linear-gradient IS cacheable as a texture and only its offset
 * changes.
 */
body::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 62%);
  animation: gridDrift 60s linear infinite;
}
@keyframes gridDrift { to { transform: translate(64px, 64px); } }

/* Phones do not get an ambient layer at all.
 *
 * There is no argument for spending compositor time on decoration on the
 * device with the least of it, behind a viewport too small to see the effect
 * the decoration was for. The grid reads as texture at 1440px; at 390px it is
 * noise behind text. */
@media (max-width: 720px) {
  body::before { display: none; }
}

/* Glass panels with a soft entrance */
.panel, .acct-box, .up-box {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.layout > .panel:nth-child(2) { animation-delay: 0.08s; }
.news-layout > .panel:nth-child(1) { animation-delay: 0.12s; }
.news-layout > .panel:nth-child(2) { animation-delay: 0.18s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* .reveal/.reveal.in live once, in the motion-tokens section below (they
   share every property this used to set, so this copy was always shadowed
   and never rendered anything different). */

/* Button shine sweep + press feedback */
button.primary, .cta-main, .nav-btn.accent {
  position: relative;
  overflow: hidden;
}
button.primary::after, .cta-main::after, .nav-btn.accent::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
button.primary:hover::after, .cta-main:hover::after, .nav-btn.accent:hover::after { transform: translateX(110%); }
button.primary:active, .cta-main:active, .tf:active, .fav-btn:active { transform: scale(0.97); }

/* Signal badge: breathing glow + update pop */
.signal-card.buy .signal-badge, .signal-card.sell .signal-badge { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
.signal-badge.pop { animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop { 0% { transform: scale(0.86); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* Live price tick pop */
.live-price.up-tick, .live-price.down-tick { animation: tickPop 0.4s ease; }
@keyframes tickPop { 0% { transform: scale(0.94); } 100% { transform: scale(1); } }

/* Skeleton shimmer while the chart loads */
.chart-status {
  background: linear-gradient(100deg, transparent 35%, color-mix(in srgb, var(--surface2) 70%, transparent) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 8px;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* Landing hero motion. index.php's own <style> block deliberately keeps the
 * em-highlighted word (.hero-copy h1 em) a single flat --brass colour, not a
 * gradient clip - that trick smears on low-DPI screens and reads as generic
 * SaaS-template polish, per the comment on .hero-copy h1 right above it in
 * that file. Respecting that: the word still gets to breathe, just through
 * filter (a brightness pulse), the same solid-colour-safe technique the
 * signal badge already uses a few rules up - not a technique this file just
 * argued against two lines away from where it would apply.
 * .hero-stats/.hstat below were a stat-pill layout .trust-row replaced and
 * are dead everywhere .trust-row's own hover (further down) now covers. */
.hero-copy h1 em { display: inline-block; animation: heroEmBreathe 4.5s ease-in-out .6s infinite; }
@keyframes heroEmBreathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.28); } }
.trust-row > div { transition: transform var(--dur) var(--ease-out); }
.trust-row > div:hover { transform: translateY(-3px); }

/* Watch/news chips micro-motion */
.fav-chip, .h-chip, .tf, .nav-btn { transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, background 0.18s ease, color 0.18s ease; }
.fav-chip:hover { transform: translateY(-2px); }

/* Smooth in-page scrolling (anchors, back-to-top) */
html { scroll-behavior: smooth; }

/* ============================================================
   ALIVE: presence, choreography, continuity between page loads.
   Everything below is additive polish on top of the motion system
   above - same tokens (--ease/--ease-out/--dur*), same reduced-motion
   and touch gating, nothing here replaces an existing effect.
   ============================================================ */

/* Cross-document view transitions: a same-origin navigation (clicking to
 * /charts, /account, back/forward) crossfades the old page into the new one
 * instead of the hard flash-to-white a full page load normally is - the
 * single highest-leverage "feels alive between pages" change available to a
 * multi-page app, and it costs zero JS. Chromium supports it today; every
 * other engine ignores the unknown at-rule and gets the old hard cut, which
 * is exactly the same progressive-enhancement contract prefers-reduced-motion
 * already uses below. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Cursor-reactive hero glow. --mx/--my are percentages written by ui.js's
 * one shared rAF-throttled pointermove listener (see "presence" there) -
 * every glow effect on the page reads those same two properties rather than
 * each wiring its own listener, which is how one nice hover effect turns
 * into five competing scroll-jank sources. Gated to fine pointers: a phone
 * has no cursor to react to, and the property is simply never written there,
 * so the fallback gradient position (center) is what phones always see. */
@media (hover: hover) and (pointer: fine) {
  .hero-split { position: relative; isolation: isolate; }
  .hero-split::after {
    content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
    background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 15%),
                color-mix(in srgb, var(--accent) 15%, transparent), transparent 65%);
    opacity: 0; transition: opacity var(--dur-slow) var(--ease);
  }
  .hero-split:hover::after, .hero-split.warm::after { opacity: 1; }

  /* Same idea, one card at a time: --card-mx/--card-my are set inline on
   * whichever card the pointer is actually over (delegated in ui.js), so a
   * grid of a dozen cards costs one listener, not a dozen. */
  .feat, .price, .step { position: relative; isolation: isolate; }
  .feat::before, .price::before, .step::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background: radial-gradient(220px circle at var(--card-mx, 50%) var(--card-my, 0%),
                color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%);
    opacity: 0; transition: opacity var(--dur) var(--ease);
  }
  .feat:hover::before, .price:hover::before, .step:hover::before { opacity: 1; }

  /* Magnetic pull: cta-main/btn-primary lean a few px toward the cursor
   * while hovered (ui.js sets --pull-x/--pull-y, clamped small so it reads
   * as "responsive material", not a jumping button) and spring back on
   * leave via the transition below. */
  .cta-main, .btn-primary { transition: transform var(--dur) var(--ease-out); }
  .cta-main:hover, .btn-primary:hover {
    transform: translate(var(--pull-x, 0px), var(--pull-y, 0px));
  }
}

/* Per-card choreography: a revealed grid steps its children in one after
 * another instead of fading as one flat rectangle - the difference between
 * "a section appeared" and "each idea arrived on its own". Ancestor-scoped
 * off .sec.reveal so no markup change was needed to opt every existing
 * feature/step/price grid in at once. */
.sec.reveal .feat-grid > .feat,
.sec.reveal .steps > .step,
.sec.reveal .price-grid > .price {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.sec.reveal.in .feat-grid > .feat,
.sec.reveal.in .steps > .step,
.sec.reveal.in .price-grid > .price { opacity: 1; transform: none; }
.feat-grid > .feat:nth-child(1), .steps > .step:nth-child(1), .price-grid > .price:nth-child(1) { transition-delay: .03s; }
.feat-grid > .feat:nth-child(2), .steps > .step:nth-child(2), .price-grid > .price:nth-child(2) { transition-delay: .10s; }
.feat-grid > .feat:nth-child(3), .steps > .step:nth-child(3), .price-grid > .price:nth-child(3) { transition-delay: .17s; }
.feat-grid > .feat:nth-child(4) { transition-delay: .24s; }
.feat-grid > .feat:nth-child(5) { transition-delay: .31s; }
.feat-grid > .feat:nth-child(6) { transition-delay: .38s; }

/* Nav-loading bar: the .scroll-progress bar ui.js already draws for scroll
 * position is reused (not duplicated) for a second job - on a same-origin
 * navigation click it races to 78% immediately, so the moment before a full
 * page unload (which nothing on the departing page can otherwise animate)
 * still reads as "in progress" rather than the page just going inert. The
 * arriving page resets and draws it normally. */
.scroll-progress { transition: transform 0.25s ease; }
.scroll-progress.navigating { transform: scaleX(0.78) !important; transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }

/* Ambient "reading the market" pulse: a slow-breathing ring behind the live
 * indicator dot(s), reinforcing that analysis keeps running with nobody
 * watching rather than only on a click - the same story the product already
 * tells in words ("keeps learning from what happens next"). */
.live-dot { position: relative; }
.live-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--up); opacity: 0; animation: livePulseRing 2.4s var(--ease) infinite;
}
@keyframes livePulseRing {
  0% { opacity: 0.55; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.9); }
}

/* Thin scroll progress bar under the topbar */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: linear-gradient(90deg, var(--accent), #F5A524, var(--up));
  transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}

/* Topbar lifts off the page once you start scrolling */
.topbar { transition: box-shadow 0.3s ease, background 0.3s ease; }
.topbar.elevated {
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Click ripple (span injected by ui.js) */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.12) 45%, transparent 70%);
  transform: scale(0); opacity: 1;
  animation: rippleGo 0.6s ease-out forwards;
}
@keyframes rippleGo { to { transform: scale(1); opacity: 0; } }

/* Accordion contents fade in when opened */
details.acc-anim > *:not(summary) { animation: accFade 0.35s ease both; }
@keyframes accFade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .scroll-progress { display: none; }
  /* Specificity has to match the conditional rule further down, or the
     no-motion preference quietly loses to it and these readers get the
     travel they asked not to have. */
  .reveal, :root[data-js="1"] .reveal { opacity: 1; transform: none; }
}

/* ================= Theme system =================
   The palette was a single hard-coded dark set with no light mode and no way
   to opt out of the ambient motion. Tokens now live behind theme attributes
   set before first paint (see View::head), so switching never flashes. */

:root[data-theme="light-palette"] {
  /* AA ON PAPER IS NOT AA ON GLASS.
     These four were carried over from the dark set and re-tuned by eye. On
     white they measured 3.41:1 to 4.46:1 - fine for a border or a heading,
     under the bar for the small text they are actually used on: a "+2.14%"
     in --up is 12px. --muted is back to its own value; a blanket sweep of
     the dark --dim had caught it here and cost it two points of contrast. */
  --void: #FAFAF8;
  --panel: #FFFFFF;
  --panel-2: #F4F5F7;
  --panel-3: #ECEEF2;
  --hair: rgba(0,0,0,.09);
  --hair-2: rgba(0,0,0,.16);
  --bone: #12161F;
  --muted: #5C6578;
  --dim: #6E7686;   /* 4.57:1 on white; #8A94A8 was 3.05:1 */
  /* Darkened for AA on white. The dark-mode values are tuned for contrast
     against near-black and are too light to read on paper - carrying them
     across unchanged is how a light mode ends up technically present and
     practically unusable. */
  --indigo: #B45309;
  --indigo-soft: rgba(180,83,9,.10);
  --brass: #0369A1;
  --long: #15803D;
  --short: #DC2626;
  --warn-bg: transparent;
  --warn-border: #0369A1;
  --warn-text: #075985;
}
:root[data-theme="light-palette"] body { background: var(--bg); }
:root[data-theme="light-palette"] .chart-tip { background: #ffffffee; }
:root[data-theme="light-palette"] body::before { opacity: 0.42; }

/* High contrast: stronger borders and text, no decorative translucency. */
:root[data-theme="contrast"] {
  --void: #000000;
  --panel: #0a0a0a;
  --panel-2: #141414;
  --panel-3: #1e1e1e;
  --hair: #7a8592;
  --hair-2: #a8b2bf;
  --bone: #ffffff;
  --muted: #cdd4dc;
  --dim: #b0b8c2;
  /* Hairlines are the whole visual system in the other two themes, and this
     theme exists precisely for people those hairlines fail. Opaque borders,
     brighter semantics, no translucency anywhere. */
  --indigo: #FFC34D;
  --indigo-soft: rgba(255,195,77,.22);
  --brass: #7DD3FC;
  --long: #4ADE80;
  --short: #F87171;
}
:root[data-theme="contrast"] .panel { backdrop-filter: none; background: var(--surface); }
:root[data-theme="contrast"] body::before { display: none; }

/* =====================================================================
   WHAT COLOUR SCHEME THIS PAGE IS, SAID OUT LOUD.
   =====================================================================
   Nothing here declared one, and a page that does not declare one is a
   page the browser is entitled to guess about. Android WebView guesses
   "light" - every Samsung Internet, in-app and Android browser with
   force-dark switched on then ran its algorithmic darkener over a design
   that was already dark, and inverted it into dark-on-dark. Chrome on
   desktop never showed it because Chrome does not force-dark by default,
   which is exactly why it survived this long: it is invisible on the one
   browser it was developed in.

   PER THEME, NOT A BLANKET "dark".
   This site is dark by DEFAULT, not dark ONLY - there are three themes
   behind the toggle (dark, light, high contrast), switched by the
   data-theme attribute the rules above are written against. Declaring a
   flat `color-scheme: dark` would therefore be a lie for a third of them,
   and not a harmless one: the scheme is what the browser styles the parts
   this stylesheet cannot reach - form controls, scrollbars, autofill
   backgrounds, the text caret - so a member on the light theme would get
   dark dropdowns and a dark scrollbar on white. So it is keyed to the
   same attribute as the palette itself, and the two cannot drift.

   Contrast is a DARKER dark (--void is #000000), so it declares dark. */
:root { color-scheme: dark; }
:root[data-theme="light-palette"] { color-scheme: light; }
:root[data-theme="contrast"] { color-scheme: dark; }

/* Calm mode: keep the layout, drop the ambience. A page traders stare at for
   hours should not be breathing at them. */
:root[data-calm="1"] body::before { display: none; }
:root[data-calm="1"] *,
:root[data-calm="1"] *::before,
:root[data-calm="1"] *::after { animation: none !important; }
:root[data-calm="1"] .ripple { display: none; }

/* One definition. The sizing half of this rule lived 270 lines further down,
   so a change to the padding here and a change to the min-width there were
   edits to the same control that never appeared on the same screen. */
.theme-toggle {
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 11px; font-size: 14px; line-height: 1; cursor: pointer;
  /* Holds a single glyph, so it needs an explicit box or it collapses to the
     width of a narrow character. */
  min-width: 38px; display: inline-flex; align-items: center; justify-content: center;
  font-family: system-ui, sans-serif;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }

/* The logo is a link home and was 32px tall on a phone - the one control every
   page has, and the one nobody could reliably hit. Padding rather than a
   bigger logo: the mark stays the size it was designed at. */
.brand-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-height: 44px; }
.brand-link:hover strong { color: var(--accent); }
h1 .brand-link { display: inline-flex; gap: 10px; }
.nav-btn.on { color: var(--text); border-color: var(--accent); }

/* Screen-reader-only text (status semantics that colour alone cannot carry). */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ================= Shared page shell ================= */
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 20px 22px 10px; }
.page-wrap.narrow { max-width: 780px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: clamp(22px, calc(3.4vw / var(--zf, 1)), 30px); letter-spacing: -0.5px; }
/* The product name beside the menu's promise - see scanner.php. Sized and
   coloured down so the heading still reads as one line of hierarchy rather
   than two competing titles, and allowed to wrap onto its own line on a phone
   where the pair does not fit. */
.page-head h1 .h1-sub {
  font-size: 0.6em; font-weight: 500; color: var(--muted);
  letter-spacing: 0; white-space: nowrap;
}
@media (max-width: 460px) {
  .page-head h1 .h1-sub { display: block; margin-top: 2px; }
}
.page-head p { color: var(--muted); font-size: 13.5px; line-height: 1.7; max-width: 760px; margin-top: 8px; }
.hint-p { color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.h2-sub { color: var(--muted); font-weight: 400; font-size: 12px; text-transform: none; letter-spacing: 0; }
.panel h2 { font-size: 15px; margin-bottom: 10px; }
.flash.ok {
  background: color-mix(in srgb, var(--up) 14%, transparent); border: 1px solid color-mix(in srgb, var(--up) 40%, transparent);
  color: var(--up); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
.empty-state { text-align: center; padding: 34px 22px; }
.empty-state h2 { font-size: 17px; }
.empty-state p { color: var(--muted); font-size: 13.5px; line-height: 1.7; max-width: 560px; margin: 8px auto 0; }
.btn-primary {
  display: inline-block; background: linear-gradient(135deg, var(--accent-fill), color-mix(in srgb, var(--accent-fill) 85%, #000));
  color: var(--on-accent, #111); border: none; border-radius: 8px; padding: 9px 18px; font-size: 13.5px;
  font-weight: 500; cursor: pointer; text-decoration: none;
}
/* .btn is the secondary button on the member side, and it had no rule here at
   all - so twelve of them across the account page, the unsubscribe page and
   the track record have been rendering as default blue underlined links. It
   looks deliberate in the markup and only shows up in a browser, which is
   where it was found. The operator pages have their own .btn and do
   not load this file, so nothing over there is touched. */
.btn, .btn-ghost {
  display: inline-block; background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 16px; font-size: 13.5px; text-decoration: none;
}
.btn:hover, .btn-ghost:hover { border-color: var(--accent); }

/* ---------- touch targets ----------
   Measured across the member pages: the chart toolbar buttons render 22px
   tall, the bell 29, the share and theme buttons 30. On a mouse that is a
   tidy dense toolbar and there is nothing wrong with it. On a phone it is a
   row of things you miss, and the chart toolbar is the control a member uses
   most.

   Grown only under pointer: coarse, so the desktop layout is untouched and
   the fix lands exactly where the problem is - a finger contact patch is
   roughly 8mm, which is where the 44px guidance in WCAG 2.5.5 comes from. 40
   is the compromise these toolbars can absorb without wrapping to two rows on
   a 375px screen, which would trade one usability problem for another.

   min-height rather than padding: padding would push the text off-centre on
   the buttons that already have their own, and inline-flex centring keeps
   every label in the middle of whatever height it ends up with. */
/* TOUCH TARGETS.
 *
 * Measured rather than assumed: at 375px the chart page had 46 controls under
 * 40px tall and the menu button was 33px on every page in the site. Forty-four
 * is the number both Apple and WCAG land on, and it is not a style preference -
 * a control smaller than a fingertip is one that gets missed, and the miss
 * lands on whatever is behind it.
 *
 * Height only. Widths stay as they are: a toolbar of forty-four-pixel-wide
 * buttons would wrap onto three rows and cost more than it bought. */
@media (pointer: coarse) {
  .btn, .btn-ghost, .btn-primary, .ct-btn, .ct-menu-btn, .bell-btn,
  .share-btn, .theme-toggle, .tabs a, .nav-toggle, .nav-btn,
  .fav-btn, .tab, .perf-tab, button.primary, .unlock-hint {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Form controls are tapped as often as buttons and were the smaller half of
     the count: a 34px search box and a 36px select on the page that is the
     product. */
  select, input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="search"] { min-height: 44px; }
  /* Radios and checkboxes are hit through their label, so the label is what
     has to be big enough - the control itself only has to stay visible. */
  .profile-opt, .alert-filters label { min-height: 44px; }
  /* Icon-only close buttons need both dimensions, not just height - a 30px
     or 34px square "x" is exactly the small-tap-target shape this whole
     block exists to fix, and it was missed here. .scan-pop-x (the Scanner
     sheet's own close button) was already sized correctly; these two
     weren't in its selector list. */
  .promo-x, .upsell-x { min-width: 44px; min-height: 44px; }
  /* The notification bell is the same icon-only shape and was missed the same
     way: 20px wide on a phone, which is half a fingertip. It sits in the
     header rather than a toolbar, so widening it cannot wrap anything. */
  .bell-btn { min-width: 44px; }
}

/* THE CHART TOOLBAR STAYS AS IT IS, AND THAT WAS CHECKED.
 *
 * The height-only rule above looks like an omission - four controls 24 to 32px
 * wide on a phone - so it was measured before being "fixed". Giving them a
 * 40px min-width needs 175px of toolbar once gaps are counted, and the bar is
 * 152px at 360, 160px at 375 and 167px at 390. It only clears at 412px, which
 * is wider than most phones, and below that the toolbar overflows and has to
 * be scrolled sideways to reach the last control - worse than the small
 * buttons it set out to fix.
 *
 * The comment above was right. This note exists so the next person measures
 * before changing it rather than repeating the attempt. */


/* THE HEADER, ON A PHONE.
 *
 * The tagline wrapped to three lines at 375px and made the header 77px tall -
 * on a 667px screen that is one line of the site's own marketing standing in
 * front of every page, for ever, on every visit. It says nothing a visitor who
 * has arrived does not already know, and it is still there for search engines
 * and for anyone on a wider screen. */
@media (max-width: 480px) {
  /* Only the tagline shrinks further, on genuinely small phones - the logo
     and wordmark size is now decided once, above, not re-decided per
     breakpoint. */
  .brand small { display: none; }
  .topbar { padding: 8px 14px; }
}

/* ================= Scanner ================= */
.breadth { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.br-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 16px; min-width: 88px; text-align: center;
}
.br-item b { display: block; font-size: 18px; }
.br-item span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
/* Capped rather than flex:1. Filling the rest of a 1440px row made a summary
   statistic the largest object on the page, and an all-red bar at 0% bullish
   read as an error banner. */
.br-bar {
  position: relative; flex: 1 1 220px; min-width: 180px; max-width: 340px;
  height: 34px; border-radius: 8px;
  background: color-mix(in srgb, var(--down) 30%, var(--surface2)); border: 1px solid var(--border); overflow: hidden;
}
.br-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--up) 55%, transparent); }
.br-bar span {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 12px; font-weight: 500;
}

.top-setups { margin-bottom: 16px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.setup-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.setup-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.setup-card.buy { border-left: 3px solid var(--up); }
.setup-card.sell { border-left: 3px solid var(--down); }
.sc-head { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.sc-tf { color: var(--muted); font-size: 11px; }
.sc-sig { font-size: 19px; font-weight: 500; letter-spacing: 1px; margin: 6px 0 4px; }
.sc-sig.buy { color: var(--up); }
.sc-sig.sell { color: var(--down); }
/* Score and R:R on one line, the age pushed to the end of it. Wrapping on
   content length meant adjacent identical cards broke onto different numbers
   of lines and sat at different heights. */
.sc-meta {
  display: flex; gap: 10px; align-items: baseline;
  color: var(--muted); font-size: 11px; white-space: nowrap;
}
/* Age used to be pushed right as ":last-child" - fine while it always was
   the last span, which stopped being true the moment the signal ID became
   an optional one after it. Its own class now, so the push stays put
   whether or not that tag is there to follow it. */
.sc-age { margin-left: auto; }
/* The reference, same six characters the chart panel shows in full -
   mono and a size down from the rest of the row, so it reads as a quiet
   identifier rather than another figure competing with the score. */
.sc-ref { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
/* This coin's own verified win rate - premium data, so it only ever appears
   once the server has actually attached it to the row (see scanner.php). Not
   colour-coded and not mono: the per-coin table on the track record treats
   win rate itself as plain text too, colouring only the R figures beside it,
   so this badge matches rather than inventing its own emphasis for the same
   number. */
.sc-winrate { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--muted); }

.scan-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.scan-winrate-upsell { margin: -6px 0 14px; }
.scan-filters input, .scan-filters select {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
.scan-filters input:focus, .scan-filters select:focus { outline: none; border-color: var(--accent); }

.table-panel { padding: 14px 14px 8px; }
/* A TABLE THAT SCROLLS SHOULD LOOK LIKE ONE.
   The scanner's board is deliberately wider than a phone - the column order is
   chosen around that, so the answer is on screen and the reference columns are
   where the dragging starts. What was missing was any sign that dragging was
   possible: the last visible column was simply cut in half at the edge, which
   reads as a broken layout rather than as an invitation.

   A background gradient was the first attempt and showed nothing, because the
   container's background paints BEHIND the table that sits on it. Masking the
   container fades the content itself, so it cannot be painted over.

   The class is put on by script only while the box overflows and taken off at
   the end of the scroll - a fade that stays after the last column has arrived
   is a promise of more that is not there. Without JavaScript there is no mask
   and the table behaves exactly as it did before. */
.tbl-scroll { overflow-x: auto; }
.tbl-scroll.can-scroll-x {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
}
@media (prefers-reduced-motion: reduce) { .tbl-scroll.can-scroll-x { transition: none; } }

/* A coin with too few settled signals to read as a percentage.
   Dimmed rather than dropped: the row is part of the record and belongs in the
   table, but nothing about it should invite a reader to lean on the number.
   The tag carries the explanation in its title, so the dimming is a hint and
   not the only thing saying so. */
.perf-table tr.thin-row td { opacity: 0.62; }
.thin-tag {
  display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  font-size: var(--fs-tiny); font-weight: 500; letter-spacing: 0.3px; text-transform: uppercase;
  vertical-align: 1px; cursor: help;
}
.scan-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.scan-table th, .scan-table td { padding: 9px 10px; text-align: left; white-space: nowrap; }
.scan-table thead th {
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 500; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--surface); z-index: 1;
}
.scan-table tbody tr { border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.scan-table tbody tr:hover { background: color-mix(in srgb, var(--surface2) 70%, transparent); }
.scan-table tbody th { font-weight: 500; }
.scan-table a { color: var(--text); text-decoration: none; }
.scan-table a:hover { color: var(--accent); }
.scan-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.scan-table .pos { color: var(--up); }
.scan-table .neg { color: var(--down); }
.scan-table .muted { color: var(--muted); }
.scan-table tr.locked { opacity: 0.65; }
/* The coin cell has white-space:nowrap on it (above) so a long symbol never
   wraps mid-word - block here so the reference still drops to its own line
   under the symbol instead of stretching the cell sideways to fit both. */
.scan-table th .sc-ref { display: block; margin-top: 2px; }
.lock { font-size: 11px; }
.unlock-mini { font-size: var(--fs-small); color: var(--warn-text) !important; margin-left: 5px; }
.sl { color: var(--down); font-size: 11.5px; }
.stale-tag {
  margin-left: 5px; font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.4px;
  background: var(--warn-bg); color: var(--warn-text); border-radius: 4px; padding: 1px 5px;
}
/* A setup past its own time stop. Dimmed rather than hidden: it is still the
   last thing the engine said about the pair, it is just no longer a call. */
.exp-tag {
  margin-left: 5px; font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.4px;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; cursor: help;
}
tr.expired td, tr.expired th { opacity: 0.55; }

/* Live setups, or what the board used to carry.
   Two links rather than a script, so the switch works with JavaScript off and
   each board is a URL somebody can send. Same segmented shape as the plan
   switch on the chart, because it is the same kind of control. */
.scan-tabs {
  display: flex; gap: 4px; margin: 0 0 14px; padding: 4px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
}
.scan-tabs a {
  flex: 1; text-align: center; padding: 9px 10px; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none;
  min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.scan-tabs a:hover { color: var(--text); }
.scan-tabs a.on { background: var(--surface); color: var(--text); }
.scan-tabs .tab-sub { color: var(--muted); font-weight: 500; font-size: var(--fs-small); }

/* The target ladder on a closed call: which of the published levels the price
   actually reached. Three marks rather than a sentence - the column has to be
   scannable down the table, and "TP1 and TP2 reached, TP3 not" said in words
   is a paragraph per row. Filled is reached; outlined is published and never
   touched, which is the fact the live board could not show. */
.tp-lad { display: flex; gap: 3px; }
.tp-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--muted); font-size: var(--fs-tiny); font-weight: 500; cursor: help;
}
.tp-mark.on { background: var(--up); border-color: var(--up); color: #04260c; }
tr.expired .sig-pill { filter: grayscale(0.8); }
.tbl-note { color: var(--muted); font-size: 11.5px; line-height: 1.6; padding: 10px 2px 4px; }

/* Signal pills and grades carry a glyph as well as a colour, so the meaning
   survives for colour-blind readers and in monochrome. */
.sig-pill {
  display: inline-block; font-weight: 500; font-size: 11px; letter-spacing: 0.4px;
  padding: 3px 9px; border-radius: 999px; background: var(--surface2);
}
.sig-pill.buy { color: var(--up); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 40%, transparent); }
.sig-pill.sell { color: var(--down); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down) 40%, transparent); }
.sig-pill.neutral { color: var(--warn-text); }
.sig-pill.buy::before { content: "▲ "; }
.sig-pill.sell::before { content: "▼ "; }
.sig-pill.neutral::before { content: "■ "; }
.grade {
  display: inline-block; min-width: 26px; text-align: center; font-weight: 500; font-size: 11px;
  padding: 2px 6px; border-radius: 6px; background: var(--surface2); color: var(--muted);
}
.grade.gAp { background: color-mix(in srgb, var(--up) 22%, transparent); color: var(--up); }
.grade.gA  { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.grade.gB  { background: var(--warn-bg); color: var(--warn-text); }

/* ================= Portfolio ================= */
/* Grid rather than wrapping flex: a wrapped flex row stretches whatever lands
   on the last line to the full width, so a six-stat row read as five tiles
   and one banner. Auto-fit collapses the empty tracks, so a four-stat row
   still fills the width evenly. */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px; margin-bottom: 8px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; text-align: center;
}
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat b.pos { color: var(--up); }
.stat b.neg { color: var(--down); }
.stat span { color: var(--muted); font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-note { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 4px 0 16px; }
.equity { width: 100%; height: 180px; color: var(--muted); display: block; }
.close-form summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.close-form form { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.close-form label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.close-form input {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; font-size: 12.5px;
}

/* ================= Status ================= */
.status-banner {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); margin-bottom: 16px; font-size: 14px;
}
.status-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status-banner.operational .dot { background: var(--up); }
.status-banner.partial .dot { background: var(--warn-text); }
.status-banner.degraded .dot { background: var(--down); }
.status-banner .muted { color: var(--muted); font-size: 12px; margin-left: auto; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.check-list li {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px;
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.check-list li:first-child { border-top: none; }
.check-mark { font-weight: 500; font-size: 14px; width: 18px; text-align: center; }
.check-list li.ok .check-mark { color: var(--up); }
.check-list li.bad .check-mark { color: var(--down); }
.check-list li.soft .check-mark { color: var(--muted); }
.check-list strong { display: block; font-size: 13.5px; }
.check-detail { color: var(--muted); font-size: 12px; }
.check-hint { display: block; color: var(--warn-text); font-size: 11.5px; margin-top: 3px; }

@media (max-width: 720px) {
  .page-wrap { padding: 14px 12px 6px; }
  .scan-table th, .scan-table td { padding: 8px 7px; font-size: 12px; }
  .stat { min-width: 96px; padding: 10px; }
  .stat b { font-size: 17px; }
}

/* Footer links inherited the browser default once the inline styles moved into
   View::footer(); give them a real rule instead of per-page attributes. */
.footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent;
  display: inline-block; padding: 6px 2px; margin: -6px 0; }
.footer a:hover { color: var(--text); border-bottom-color: var(--border); }
/* Terms, Privacy and Risk disclosure sat on one line as fifteen-pixel-tall
   targets separated by middots. They are the links a regulator, an app store
   reviewer and a cautious buyer all go looking for, and on a phone they were
   the hardest things on the site to press. Padded rather than enlarged, so the
   footer still reads as a footer. */
@media (pointer: coarse) {
  .footer a { display: inline-block; padding: 9px 4px; }
}

/* ================= Evidence balance (vote meter) =================
   The reasons list is honest but long - a dozen items to read before you know
   which way the weight falls. This shows the same evidence as a per-category
   balance, and makes the correlation cap visible: a "capped" category is
   precisely where the old scoring counted one idea several times over. */
.vote-meter { background: transparent; padding: 0; }
/* A box per category, coloured by the side it argues for. */
.vm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.vm-box {
  position: relative; padding: 9px 10px 11px;
  background: var(--surface2); border: 1px solid var(--border);
  border-left-width: 3px; border-radius: 8px;
}
.vm-box.up { border-left-color: var(--up); }
.vm-box.down { border-left-color: var(--down); }
.vm-name {
  display: block; font-size: var(--fs-micro); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vm-val { display: block; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; margin: 2px 0 5px; }
.vm-box.up .vm-val { color: var(--up); }
.vm-box.down .vm-val { color: var(--down); }
.vm-track { display: block; position: relative; height: 4px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.vm-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.vm-bar.up { background: var(--up); }
.vm-bar.down { background: var(--down); }
.vm-val.up { color: var(--up); }
.vm-val.down { color: var(--down); }
/* Eight and a half pixels, hardcoded past the scale that exists precisely so
   the phone can be given bigger type in one place - which is the drift the
   token comment at the top of this file predicted. It is an eyebrow label, so
   it takes the eyebrow size and steps up to 11px on a phone with the rest. */
.vm-clip {
  display: block; font-style: normal; font-weight: 500; font-size: var(--fs-micro);
  text-transform: uppercase; letter-spacing: 0.3px; color: var(--warn-text);
}
.vm-note { margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.vm-note .muted { color: var(--muted); opacity: 0.75; }

.risk-amt { color: var(--down); }
.risk-amt em { font-style: normal; font-weight: 400; font-size: var(--fs-small); color: var(--muted); }
.profit-amt { color: var(--up); }
.tp-warn {
  margin-top: 8px; font-size: 11px; line-height: 1.5; color: var(--warn-text);
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; padding: 7px 9px;
}
.follow-btn { margin-top: 10px; }

/* ================= Member preference forms ================= */
.prefs-form { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 6px; text-align: left; }
.prefs-head { margin-top: 20px !important; margin-bottom: 4px !important; }
.prefs-head strong { color: var(--text); }
.prefs-hint { color: var(--muted); font-size: 11.5px; line-height: 1.6; margin-bottom: 8px; }
.prefs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.prefs-grid label, .wh-label { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.prefs-grid input, .prefs-grid select, .wh-label input {
  width: 100%; margin-top: 4px; padding: 9px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 13px;
}
.prefs-grid input:focus, .prefs-grid select:focus, .wh-label input:focus {
  outline: none; border-color: var(--accent);
}
.profile-picker { display: flex; flex-direction: column; gap: 6px; }
.profile-opt {
  display: block; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: border-color 0.15s ease;
}
.profile-opt:hover { border-color: var(--muted); }
.profile-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface2)); }
/* The radio sits on the same line as the title it chooses. Stated as a grid
   rather than an inline run so the blurb underneath lines up with the title
   instead of tucking under the radio. */
.profile-opt { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; }
.profile-opt input { width: auto; margin: 0; flex: none; accent-color: var(--accent); }
.profile-opt strong { font-size: 13px; }
.profile-opt span { grid-column: 2; }
.profile-opt span { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.55; margin-top: 3px; }
.secret {
  display: inline-block; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; font-size: var(--fs-small); word-break: break-all;
}
@media (max-width: 560px) { .prefs-grid { grid-template-columns: 1fr; } }

/* Plain-language summary. Visually distinct from the rule list so it reads as
   commentary on the analysis rather than another rule. */
.ai-explain {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface2));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 8px; padding: 11px 13px; margin-top: 14px;
}
.ai-text { font-size: 13px; line-height: 1.65; }
.ai-src { color: var(--muted); font-size: var(--fs-small); line-height: 1.5; margin-top: 7px; }

/* Watchlist picker: named lists, synced to the account. */
.wl-picker { display: flex; gap: 6px; align-items: flex-end; margin-bottom: 8px; }
.wl-picker:empty { display: none; }
.wl-label { flex: 1; font-size: 11px; color: var(--muted); display: block; }
.wl-label select {
  width: 100%; margin-top: 3px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; font-size: 12.5px;
}
.wl-btn {
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; cursor: pointer; line-height: 1;
}
.wl-btn:hover { color: var(--text); border-color: var(--accent); }
.wl-sync { color: var(--muted); font-size: var(--fs-small); line-height: 1.5; margin-bottom: 8px; }
.wl-sync a { color: var(--accent); }

/* Ask-about-this-setup. Answers are grounded in the stored analysis for the
   pair on screen, so the model cannot wander to a different chart. */
.ai-ask { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 9px; }
.ai-ask form { display: flex; gap: 6px; }
.ai-ask input {
  flex: 1; min-width: 0; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 12.5px;
}
.ai-ask input:focus { outline: none; border-color: var(--accent); }
.ai-ask-btn {
  background: var(--accent); color: var(--on-accent, #111); border: none; border-radius: 8px;
  padding: 7px 13px; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.ai-answer {
  margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--text);
  background: var(--bg); border-radius: 8px; padding: 8px 10px;
}

/* Advanced per-member engine tuning. */
.adv-rules { margin-top: 18px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.adv-rules summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.cat-toggles { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.cat-toggle { font-size: 12px; color: var(--text); display: inline-flex; align-items: center; gap: 5px; margin: 0; }
.cat-toggle input { width: auto; }
.rule-weights { max-height: 300px; overflow-y: auto; margin-top: 4px; }
.rw-cat {
  font-size: var(--fs-tiny); text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted);
  margin: 10px 0 4px; border-bottom: 1px solid var(--border); padding-bottom: 3px;
}
.rw-row { display: flex; align-items: center; gap: 8px; margin: 3px 0 !important; }
.rw-row span { flex: 1; font-size: 12px; color: var(--text); }
.rw-row input { width: 74px !important; margin-top: 0 !important; padding: 5px 7px !important; font-size: 12px !important; }

/* Journal entry form. */
/* A grid rather than one long flex row: eight fields on a single line gave
   each of them about a hundred pixels and pushed the note off the end. */
.journal-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; align-items: end; margin-top: 10px;
}
.journal-form label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.journal-form .j-note { grid-column: 1 / -1; }
.journal-form input, .journal-form select {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 9px; font-size: 12.5px; width: 100%; min-width: 0;
}
.journal-form > button { align-self: end; }
.journal-form input:focus, .journal-form select:focus { outline: none; border-color: var(--accent); }
.src-tag {
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.4px; margin-left: 5px;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; white-space: nowrap;
}

/* Compare picker, fullscreen and the accessible data table. */
.ct-select {
  background: none; border: none; color: var(--muted); font-size: 11.5px;
  font-weight: 500; padding: 5px 7px; border-radius: 6px; cursor: pointer; max-width: 130px;
}
.ct-select:focus { outline: none; color: var(--text); }
/* FULLSCREEN IS THE CHART.
 *
 * It was four rows of chrome before the first candle - mode bar with its
 * explanatory sentence, coin picker, upgrade nudge, indicator toolbar,
 * drawing toolbar - on a view whose entire purpose is to make the chart
 * bigger. The chart got 610 of 800 pixels and the word "fullscreen" was
 * doing a lot of work.
 *
 * What stays: the controls you actually reach for while reading a chart -
 * coin, timeframe, indicators, drawing tools, zoom. What goes: the prose,
 * and the Automatic/Manual switch.
 *
 * The switch used to survive here, shrunk to its two buttons, on the
 * reasoning that which mode is on should stay answerable at a glance. It is
 * answerable without it: Manual is the mode with the drawing toolbar under
 * the chart and your own lines on it, and fullscreen is for reading a chart
 * rather than reconfiguring it. A row that is never pressed in this view was
 * costing forty pixels of chart on a phone. Nothing is removed from the DOM,
 * so leaving fullscreen restores every word of it.
 *
 * ONE SELECTOR, SET BY JAVASCRIPT, FOR BOTH WAYS IN. This block was written
 * twice - once under `:fullscreen` for the real thing and once under
 * `.pseudo-full` for the fallback used when a browser refuses it - and two
 * copies of eight rules is two copies to keep in step. The script adds
 * `.is-full` on either path, so there is one copy. `.pseudo-full` now carries
 * only what is specific to the fallback: putting the panel over the page,
 * which real fullscreen does for itself. */
/* THE CHART TAKES WHAT IS LEFT, RATHER THAN A NUMBER SOMEBODY GUESSED.
 *
 * This was `height: calc(100vh - 128px)`, which is a guess about how tall the
 * chrome above it is - and the chrome is a coin picker that wraps to three
 * rows on a phone and one on a desktop. The guess was wrong on both: at
 * 1280px the panel overflowed its own viewport and `overflow: hidden` ate the
 * bottom of it, and at 390px the chart came out the same size in fullscreen
 * as out of it. Hiding a row of chrome then bought the chart nothing, because
 * its height was fixed either way.
 *
 * A flex column with the chart as the growing item measures the chrome
 * instead of guessing at it. Every row removed from the top is a row the
 * chart gains, which is the whole point of the view. */
.chart-panel.is-full {
  display: flex; flex-direction: column;
  height: calc(100vh / var(--zf, 1)); height: calc(100dvh / var(--zf, 1));
  padding: 10px 14px; margin: 0; background: var(--bg);
  border: 0; border-radius: 0; overflow: hidden;
}
.chart-panel.is-full .mode-bar,
.chart-panel.is-full .mode-say,
.chart-panel.is-full .dw-hint,
.chart-panel.is-full .unlock-hint,
.chart-panel.is-full .chart-data { display: none; }
.chart-panel.is-full .controls { margin-bottom: 6px; }

/* Two more rows that are worth their pixels on the page and not in here.
 *
 * The coin SEARCH box sits directly above a dropdown listing the same coins,
 * and there is a favourites bar under it. Three ways to change coin is right
 * on a page you arrive at; in a view opened to look at one chart it is two
 * rows of chrome for a thing you already did.
 *
 * The "Draw on the chart" heading was added because "where is the add button"
 * is a fair question - and it is a question asked once, on the page, not every
 * time the chart is made bigger. The eight named tools stay exactly as they
 * are; only the label above them goes.
 *
 * Measured at 390px in Manual: the chart was 369px in fullscreen against
 * 439px out of it, so fullscreen was making the chart SMALLER than the page.
 * These two rows plus the mode bar are what turned that round. */
.chart-panel.is-full .sym-search,
.chart-panel.is-full .fav-bar,
.chart-panel.is-full .chart-h1 { display: none; }
/* And the eight tools on one line rather than four-by-two. Same buttons, same
   names, same order - the grid that keeps them readable on the page is two
   rows tall, and two rows is 45px of chart in the one view whose job is to
   have more of it. Declared with the rest of the fullscreen block so it
   applies at every width; the four-column grid stays everywhere else. */
.chart-panel.is-full .chart-wrap { flex: 1 1 auto; height: auto; min-height: 180px; }

/* The fallback, when the browser will not grant real fullscreen. Declared
   after .is-full so its overflow wins: with no browser fullscreen there is no
   guarantee the chrome fits, and a panel that clips what it cannot fit is
   worse than one that scrolls. */
.chart-panel.pseudo-full {
  position: fixed; inset: 0; z-index: 90; overflow: auto;
}

/* Belt and braces: the class is added by the fullscreenchange handler, and
   this is the one property whose absence would show as a flash of the page
   background in the frame before it lands. */
.chart-panel:fullscreen { background: var(--bg); }

/* Chart control icons are drawn SVG, so they show on every device. The
   fullscreen button swaps to an "exit" icon while the panel is full. */
.ct-btn .ct-ico { display: block; }
.ct-btn .ct-ico-off { display: none; }
.chart-panel.is-full #ctFull .ct-ico-on { display: none; }
.chart-panel.is-full #ctFull .ct-ico-off { display: block; }
#ctZoomOut, #ctZoomIn, #ctReset, #ctFull { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; }
.chart-data { margin-top: 10px; }
.chart-data summary { color: var(--muted); font-size: 11.5px; cursor: pointer; }
.chart-data table { margin-top: 8px; font-size: 11.5px; }
.chart-data caption { caption-side: top; text-align: left; color: var(--muted); font-size: 11px; padding-bottom: 6px; }

/* Public track-record equity curve. */

/* ================= Landing: comparison, FAQ ================= */
/* .demo-wrap/.demo-why (the "A real signal, right now" section's own live
   instrument recap) removed with that section - see index.php. Six more
   rules removed alongside them: .demo-card, .demo-head, .demo-tf,
   .demo-sig, .demo-meta and .demo-levels were never emitted by any markup
   on this page even before that change - leftover from an earlier version
   of the section's layout that had already moved on without them. */

.cmp-wrap { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cmp-table th, .cmp-table td { padding: 11px 14px; text-align: left; }
/* The header has to survive a phone with large text: three wrapped words in a
   cell whose height the browser has already committed to gets sliced in half,
   and a comparison whose column headings are unreadable reads as a statement
   about THIS site rather than about the alternatives. */
.cmp-table thead th {
  background: var(--surface2); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted);
  line-height: 1.35; vertical-align: bottom; overflow: visible;
  padding-top: 13px; padding-bottom: 13px;
}
.cmp-table thead th:nth-child(2), .cmp-table thead th:nth-child(3) { min-width: 108px; }
.cmp-table thead th:last-child { color: var(--accent); }
.cmp-table tbody tr { border-top: 1px solid var(--border); }
.cmp-table tbody th { font-weight: 500; color: var(--muted); }
.cmp-table td { color: var(--muted); }
.cmp-table td.yes { color: var(--text); font-weight: 500; }
.cmp-table td.yes::before { content: "✓ "; color: var(--up); }
/* Below 460px the comparison stops being a table and becomes one card per row.
   Three columns on a phone either scroll sideways - where the reader never
   reaches the column that makes the point - or get sliced. Each cell carries
   its own heading, so "rarely published" can never be mistaken for a statement
   about this site. */
@media (max-width: 460px) {
  .cmp-wrap { overflow-x: visible; }
  .cmp-table, .cmp-table tbody, .cmp-table tr, .cmp-table th, .cmp-table td { display: block; width: 100%; }
  .cmp-table thead { display: none; }
  .cmp-table { border-radius: 0; border: 0; background: none; }
  .cmp-table tbody tr {
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
    padding: 12px 14px; margin-bottom: 10px;
  }
  .cmp-table tbody th {
    padding: 0 0 9px; font-size: 13.5px; color: var(--text); font-weight: 500;
    border-bottom: 1px solid var(--border); margin-bottom: 9px;
  }
  .cmp-table td { padding: 0 0 8px; display: flex; gap: 10px; align-items: baseline; }
  .cmp-table td:last-child { padding-bottom: 0; }
  .cmp-table td::after {
    content: attr(data-lbl); order: -1; flex: 0 0 40%;
    font-size: var(--fs-small); letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted);
  }
  .cmp-table td.yes::after { color: var(--accent); }
}

.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 13px 16px; }
.faq summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.faq p { color: var(--muted); font-size: 13.5px; line-height: 1.75; margin-top: 9px; }

/* Score gauge: the verdict's distance from the thresholds it must clear. */
.score-gauge { margin-top: 10px; }
.gauge-track { position: relative; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.gauge-zone { position: absolute; top: 0; bottom: 0; }
.gauge-zone.sell { left: 0; background: color-mix(in srgb, var(--down) 22%, transparent); }
.gauge-zone.buy { background: color-mix(in srgb, var(--up) 22%, transparent); }
.gauge-tick { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--border); }
.gauge-needle {
  position: absolute; top: -3px; bottom: -3px; width: 3px; border-radius: 4px;
  background: var(--muted); transition: left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.gauge-needle.up { background: var(--up); }
.gauge-needle.down { background: var(--down); }
.gauge-needle.mid { background: var(--warn-text); }
.gauge-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--fs-micro); margin-top: 4px; }

/* Reasons grouped by evidence category. */
.reason-group { background: none !important; border-left: none !important; padding: 0 !important; }
.reason-group details { background: var(--surface2); border-radius: 8px; padding: 7px 9px; }
.reason-group summary { cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.reason-group summary em { font-style: normal; text-transform: none; letter-spacing: 0; opacity: 0.8; }
.reason-sub { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.reason-sub li {
  font-size: 12.5px; background: var(--bg); border-left: 3px solid var(--muted);
  border-radius: 6px; padding: 7px 9px;
}
.reason-sub li.bullish { border-left-color: var(--up); }
.reason-sub li.bearish { border-left-color: var(--down); }
.reason-sub li strong { display: block; font-size: 11.5px; }
.reason-sub li em { color: var(--muted); font-style: normal; font-size: 11.5px; }
.reason-sub li .w { float: right; color: var(--muted); font-size: var(--fs-small); }
.reason-foot { font-size: 11px !important; }

/* Share the signal card as an image. */
.share-btn {
  width: 100%; margin-top: 8px; background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px; font-size: 11.5px; cursor: pointer;
}
.share-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- market context panel ----------
   The reads that describe the market a pair trades in. Laid out as one column
   on a phone and two from tablet up: the gauge needs its full width to be
   readable, and the facts list is a label/value pair per row, which stacks
   without help. */
.ctx-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .ctx-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } }
.ctx-fng { display: flex; flex-direction: column; gap: 10px; }
.fng-gauge { display: flex; flex-direction: column; gap: 6px; }
/* The scale is the point: "27" says nothing to a reader who does not know the
   range runs 0-100 with fear at the bottom. */
.fng-track {
  position: relative; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, var(--down), #d9a441 45%, #d9a441 55%, var(--up));
}
.fng-needle {
  position: absolute; top: 50%; left: 50%; width: 3px; height: 20px;
  transform: translate(-50%, -50%); border-radius: 4px;
  background: var(--text); box-shadow: 0 0 0 2px var(--surface);
  transition: left 0.4s ease;
}
.fng-scale { display: flex; justify-content: space-between; font-size: var(--fs-tiny); color: var(--muted); gap: 6px; }
.fng-scale span:nth-child(2) { text-align: center; }
.ctx-fng-read { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ctx-fng-read b { font-size: 26px; font-weight: 500; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.ctx-fng-read span { font-size: 13px; color: var(--text); }
.ctx-fng-read small { font-size: 11px; color: var(--muted); }
.ctx-facts { margin: 0; display: grid; gap: 6px; }
.ctx-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; }
.ctx-facts dt { color: var(--muted); flex: 0 0 auto; }
.ctx-facts dd { margin: 0; text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.ctx-facts dd.pos { color: var(--up); }
.ctx-facts dd.neg { color: var(--down); }

/* ---------- multi-timeframe verdict strip ----------
   Scrolls sideways inside its own box on a phone rather than stretching the
   page: ten timeframes cannot fit 375px legibly, and shrinking them until they
   do makes the verdict unreadable, which is the only thing the strip is for. */
.tfv-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.tfv-cell {
  flex: 0 0 auto; min-width: 74px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; text-align: center;
}
.tfv-cell b { font-size: 12px; color: var(--muted); font-weight: 500; }
.tfv-cell span { font-size: 13px; font-weight: 500; }
.tfv-cell small { font-size: var(--fs-tiny); color: var(--muted); }
.tfv-cell.buy span { color: var(--up); }
.tfv-cell.sell span { color: var(--down); }
.tfv-cell.neutral span, .tfv-cell.none span { color: var(--muted); }
/* The frame being viewed, so the strip reads as context around a position
   rather than six equal opinions. */
.tfv-cell.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ══════════════════════════════════════════════════════════════════════════
   Two alignment faults, both reported from a phone
   ══════════════════════════════════════════════════════════════════════════ */

/* ── the dead 40px gutter down the left of six lists ──────────────────────
   Every one of these sets list-style:none and stops there. Removing the
   marker does not remove the space the browser reserves for it: a <ul> keeps
   padding-inline-start: 40px from the UA stylesheet whether or not anything
   is drawn in it. So the news list, the events list, the rule cards under
   "Why this signal?" and three more all sat 40px right of the panel that
   contains them, with an empty column beside them.

   It hid for so long because the reset at the top of this file is
   `* { box-sizing: border-box; margin: 0 }` - margin, not padding. Lists
   looked reset because their margin was.

   Scoped to these six by name rather than blanket-zeroing every ul and ol,
   which would also strip the indent from ordinary prose lists that want
   their bullets. */
.reasons, .reason-sub, .news-list, .events-list, .watch-list,
.check-list, .demo-levels { padding-inline-start: 0; }

/* ── the getting-started checklist ────────────────────────────────────────
   On charts.php it is emitted outside <main>, so it inherits no gutter: it
   ran edge to edge on a phone while every block under it was inset 12px, and
   on a desktop its 900px cap left it starting 168px right of the content.
   Either way it looked like it belonged to a different page. It now uses the
   same column as .page-wrap. Scoped to `body >` so the copy on portfolio.php,
   which sits inside the wrapper and is already correct, is untouched. */
body > .onboard { width: calc(100% - 44px); max-width: 1280px; margin: 12px auto; }
@media (max-width: 860px) { body > .onboard { width: calc(100% - 24px); margin: 10px auto; } }

/* The track record's small print: present, and out of the way. */
.perf-method { max-width: 760px; margin: 18px auto 8px; }
.perf-method > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 500;
  color: var(--muted); display: flex; align-items: center; gap: 7px; justify-content: center; }
.perf-method > summary::-webkit-details-marker { display: none; }
.perf-method > summary::before { content: '\25B8'; font-size: var(--fs-tiny); transition: transform .12s; }
.perf-method[open] > summary::before { transform: rotate(90deg); }
.perf-method .perf-note { margin-top: 10px; }

/* ---- Upgrade prompt -------------------------------------------------- */
/* Sized to be readable rather than to be unavoidable: it scrolls inside
   itself on a short screen instead of pushing its own close button off the
   bottom, which is the single most common way a modal becomes a trap. */
.upsell-wrap {
  position: fixed; inset: 0; z-index: 2000; display: flex;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}
.upsell-card {
  position: relative; width: 100%; max-width: 460px; max-height: calc(calc(100vh / var(--zf, 1)) - 36px);
  overflow-y: auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 22px 20px 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.upsell-card h2 { font-size: 19px; line-height: 1.3; margin: 0 26px 6px 0; }
.upsell-sub { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 14px; }
.upsell-x {
  position: absolute; top: 8px; right: 10px; width: 34px; height: 34px;
  background: none; border: none; color: var(--muted); font-size: 24px;
  line-height: 1; cursor: pointer; border-radius: 8px;
}
.upsell-x:hover { color: var(--text); background: var(--surface2); }
.upsell-list { list-style: none; margin: 0 0 16px; padding: 0; }
.upsell-list li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
}
.upsell-list li:first-child { border-top: none; }
.upsell-list strong { color: var(--text); font-size: 13.5px; }
.upsell-ic { flex: none; font-size: 17px; line-height: 1.4; }
.upsell-go { display: block; width: 100%; text-align: center; }
.upsell-later {
  display: block; width: 100%; margin-top: 8px; padding: 9px;
  background: none; border: none; color: var(--muted); font-size: 12.5px; cursor: pointer;
}
.upsell-later:hover { color: var(--text); }
.upsell-note { color: var(--muted); font-size: 11px; text-align: center; margin: 2px 0 0; }
/* Benefit list on the upgrade page - same shape as the prompt's, so the page
   somebody lands on after the prompt reads as the same message continued. */
.perk-list { list-style: none; margin: 0 0 14px; padding: 0; }
.perk-list li {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 0;
  border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); line-height: 1.6;
}
.perk-list li:first-child { border-top: none; }
.perk-list strong { color: var(--text); font-size: 14px; }
.perk-ic { flex: none; font-size: 18px; line-height: 1.4; }

/* ---- Discount campaign ---------------------------------------------- */
/* A strip, not a bar that pretends to be part of the navigation: it sits
   above everything, scrolls away with the page, and takes one line. */
.promo-bar {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, var(--surface)), var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  padding: 0 8px 0 14px; font-size: 13px;
}
.promo-bar-in {
  flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 9px 0; color: var(--text); text-decoration: none; min-width: 0;
}
.promo-bar-in:hover { text-decoration: underline; }
.promo-bar strong { font-weight: 500; }
.promo-code {
  border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--border));
  border-radius: 6px; padding: 1px 7px; font-size: 11.5px;
  font-family: var(--font-mono); white-space: nowrap;
}
.promo-left { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.promo-x {
  flex: none; width: 30px; height: 30px; background: none; border: none;
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 6px;
}
.promo-x:hover { color: var(--text); background: var(--surface2); }
@media (max-width: 560px) { .promo-bar { font-size: 12px; padding-left: 10px; } }

.promo-badge {
  display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent); font-size: 12px; font-weight: 500; letter-spacing: 0.6px;
}
.promo-clock {
  margin: 0 0 12px; padding: 8px; border-radius: 8px; text-align: center;
  background: var(--surface2); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 15px; font-weight: 500;
}
.promo-code-box {
  margin: 0 0 14px; padding: 10px; border-radius: 8px; text-align: center; font-size: 13px;
  color: var(--muted); border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--border));
}
.promo-code-box strong {
  color: var(--text); font-family: var(--font-mono);
  font-size: 15px; letter-spacing: 1px;
}
.promo-wrap .upsell-list li { padding: 6px 0; }

/* ---- Feature gates: nav padlock + upgrade wall ----------------------- */
.nav-btn.locked { opacity: 0.72; }
/* Was the literal padlock emoji - a different glyph shape and colour on
   every OS, in a menu built entirely from the palette otherwise. The tab bar
   already marks a locked destination with a plain brass dot; this is the
   same mark, so a gated feature reads as one language whether it is found
   through the menu or through the bar under a thumb. */
.nav-lock {
  display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 50%; background: var(--brass); vertical-align: middle;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.gate-wall { display: flex; justify-content: center; padding: 34px 16px 60px; }
.gate-card {
  width: 100%; max-width: 480px; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 28px 22px 22px;
}
.gate-ic { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.gate-card h1 { font-size: 22px; margin: 0 0 8px; }
.gate-blurb { color: var(--muted); font-size: 13.5px; line-height: 1.65; margin: 0 0 14px; }
.gate-need { font-size: 14px; margin: 0 0 14px; }
.gate-also { color: var(--muted); font-size: 12px; text-align: left; margin: 0 0 2px; }
.gate-card .perk-list { text-align: left; margin-bottom: 16px; }
.gate-go { display: block; width: 100%; text-align: center; }
/* line-height, because the card's own is tight enough that the default link
   underline lands across the middle of the words and reads as struck out. */
.gate-alt { color: var(--muted); font-size: 12.5px; line-height: 1.9; margin: 10px 0 0; }
.gate-alt a { color: var(--accent); text-decoration: none; }
.gate-alt a:hover { text-decoration: underline; }


/* The per-coin record when it is behind the gate.
   Deliberately not styled as an error or a wall: it states what is there and
   how much of it, because a locked section that reads as a dead end teaches a
   visitor the site is thin, and this one is the opposite of thin. */
.coin-lock {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px 18px;
  margin: 4px 0 10px;
}
.coin-lock p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.coin-lock p strong { color: var(--text); }
.coin-lock-act { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.coin-lock-act .btn { flex: 0 1 auto; }

/* ================= drawing tools =================
   Its own row under the chart controls. Those change what the chart shows;
   these change what the reader puts on it, and a toolbar that mixes the two
   makes both harder to find. Scrolls sideways on a phone rather than wrapping
   to three lines: eight tools in a row is a strip you flick, and flicking a
   strip is a gesture people already have. */
/* WRAPS, NEVER CLIPS.
 *
 * It scrolled sideways, which on a 900px panel meant Clear sat past the right
 * edge on a desktop and half the row was gone on a phone - a control nobody
 * can see is a control nobody has. Wrapping costs a line when the row is long
 * and costs nothing when it is not. */
#drawCount { font-weight: 500; color: var(--text); }
/* On a phone the sentence is the first thing to go - the tools and the colours
   have to stay reachable, and the count already says whether anything is
   saved. */
/* ON A PHONE IT WRAPS, IT DOES NOT SCROLL AWAY.
 *
 * The row was a horizontal scroll strip, so at 375px it showed five and a half
 * tools and hid the rest - the colours, Undo, Delete and Clear were off the
 * right-hand edge with nothing to say they existed. A control you cannot see
 * is a control you do not have, and "where is the add button" is what that
 * looks like from the outside. Everything is on screen now, over two rows. */
@media (max-width: 720px) {
}
/* ---- "trade my own levels" ticket ---- */
/* Not a fold any more: in Manual these ARE the ticket's fields. */

/* Whose plan a position followed. Colour-coded rather than only worded: a
   portfolio is scanned, not read, and "signal" and "your plan" are the same
   shape and length at a glance. */
/* "your plan" measured 3.07 in dark, 2.61 in light and 3.75 in contrast: the
   accent as ink on a 22% wash of itself is close to the same colour twice, and
   the wash is transparent so what it actually sits on changes per row. It only
   appears once an account has a manually-planned trade, which is why three
   theme sweeps had never seen it. Given a ground of its own and ink mixed
   toward the text colour, the way the other tags on this page are. */
.src-tag.src-manual {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface2));
  color: color-mix(in srgb, var(--accent) 40%, var(--text));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.src-tag.src-live { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.src-tag.src-paper { background: var(--surface2); color: var(--muted); border-color: var(--border); }

/* ---- automatic vs manual plan ---- */

/* ================= automatic / manual mode bar =================
   Above the chart, not in a form. It decides whether the entry, stop and
   targets in front of you are the site's or your own, which is the most
   consequential thing on the page - and it used to live four hundred pixels
   down the right-hand column. */
.mode-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 7px 10px; margin-bottom: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 8px;
}
/* Full width, split 50/50 between the two segments - not content-sized and
   left-aligned with the caption crammed beside it. That compact shape only
   ever got fixed for a phone (see the @media (max-width:720px) blocks below);
   anything from a tablet up through a full desktop window fell through to
   this base rule with no override at all, which is the shape it had. */
.mode-seg { display: flex; width: 100%; gap: 0; flex: 1 1 100%; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); }
.mode-seg button {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  flex: 1 1 0; padding: 7px 16px; min-height: 44px; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--muted);
  border-right: 1px solid var(--border);
}
.mode-seg button:last-child, .mode-seg .seg-link:last-child { border-right: 0; }
/* The second segment is a link now, not a state - see charts.php. It has to
   sit in the row as though it were the button it replaced, so it inherits the
   same box and only ever renders in the "off" style: it is somewhere to go,
   never something that is currently true. */
/* The scanner popup - see charts.php. Fixed rather than absolute so it covers
   the viewport on a phone regardless of where the mode bar has scrolled to,
   and the card is capped in height with its own scroll so a long list never
   pushes the close button off screen. */
.scan-pop {
  position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.55); padding: 0;
}
@media (min-width: 620px) { .scan-pop { align-items: center; padding: 24px; } }
.scan-pop-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px 14px 0 0; width: 100%; max-width: 560px;
  /* min-height as well as max-height - the setups list and the by-coin list
     that swaps in over it (see openCoins() in app.js) rarely have the same
     row count, and with only a height CEILING the card shrank to whichever
     list was shorter every time the reader swapped, a visible jump in
     height on every tap rather than one popup with two lists in it. A floor
     keeps the card the same size regardless of which is showing, so the
     swap reads as a continuous popup, not two different-sized ones. */
  max-height: calc(82vh / var(--zf, 1)); min-height: min(calc(82vh / var(--zf, 1)), 460px);
  display: flex; flex-direction: column; padding: 14px 14px 10px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.45);
}
@media (min-width: 620px) { .scan-pop-card { border-radius: 8px; } }
.scan-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scan-pop-head h2 { margin: 0; font-size: 16px; }
.scan-pop-x {
  background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1;
  cursor: pointer; padding: 0 4px; min-width: 44px; min-height: 44px;
}
.scan-pop-x:hover { color: var(--text); }
.scan-pop-note { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
/* Jumps straight to the "Already running" heading below the fresh setups -
   see the comment beside #scanPopJump in charts.php for why it exists, and
   setJump()/the click handler in app.js for the behaviour. Pill-shaped like
   the coin filter's own tag below, but a shortcut rather than a filter state,
   so it is rounded all the way rather than sharing that one's chip corners. */
.scan-pop-jump {
  display: inline-flex; align-items: center; margin: 0 0 8px; padding: 6px 10px;
  border-radius: 999px; border: 1px solid var(--accent); background: var(--surface2);
  color: var(--accent); font-size: 12px; font-weight: 500; cursor: pointer;
}
.scan-pop-jump:hover { background: var(--accent); color: var(--on-accent, #111); }
/* The coin filter's own control - see the comment beside #scanPopSymbolClear
   in charts.php for why it needs one when dir/tf/grade/type do not. Reads as
   an active filter tag, not a plain button, so it is obvious both that a
   coin is selected and that tapping it undoes that. */
.scan-pop-symbol-clear {
  display: block; width: 100%; text-align: left; margin: 8px 0 0;
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--surface2); color: var(--accent); font-size: 12.5px;
  font-weight: 500; cursor: pointer;
}
.scan-pop-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.scan-pop-filters select {
  flex: 1 1 120px; min-width: 0; font-size: 12px; padding: 7px 8px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
}
.scan-pop-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.scan-pop-seg button {
  background: none; border: 0; border-right: 1px solid var(--border); color: var(--muted);
  font-size: 12px; font-weight: 500; padding: 7px 12px; cursor: pointer; min-height: 38px;
}
.scan-pop-seg button:last-child { border-right: 0; }
.scan-pop-seg button.on { background: var(--accent-fill); color: var(--on-accent, #111); }
/* Independent toggles, not a single choice - see the comment beside this
   markup in charts.php. Each button gets its own border and a gap from its
   neighbours instead of the fused, radio-look segments above, because
   picking two of these at once is the whole point. */
.scan-pop-seg-multi { display: inline-flex; flex-wrap: wrap; gap: 6px; border: 0; }
.scan-pop-seg-multi button { border: 1px solid var(--border); border-radius: 8px; }
.scan-pop-seg-multi button.on { background: var(--accent-fill); color: var(--on-accent, #111); border-color: var(--accent-fill); }
.scan-pop-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; }
/* Direct children only. As a descendant selector this also drew a rule between
   every bullet of the locked panel's benefit list, which sits inside one of
   these rows - separators where there was nothing to separate. */
.scan-pop-list > li { border-top: 1px solid var(--border); }
.scan-pop-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 4px;
  background: none; border: 0; color: var(--text); cursor: pointer; text-align: left;
  font-size: 13px; min-height: 46px;
}
.scan-pop-row:hover { background: var(--surface2); }
.scan-pop-row .sp-sym { font-weight: 500; }
.scan-pop-row .sp-tf { color: var(--muted); font-size: 12px; }
.scan-pop-row .sp-dir { font-weight: 500; padding: 2px 7px; border-radius: 6px; font-size: 12px; }
.scan-pop-row .sp-dir.buy { color: var(--up); border: 1px solid var(--up); }
.scan-pop-row .sp-dir.sell { color: var(--down); border: 1px solid var(--down); }
.scan-pop-row .sp-right { margin-left: auto; text-align: right; color: var(--muted); font-size: 12px; }
.scan-pop-row .sp-grade { font-weight: 500; color: var(--text); }
.scan-pop-row .sp-winrate { font-weight: 500; color: var(--text); }
.scan-pop-row .sp-age { font-size: 11px; color: var(--muted); }
.scan-pop-row .sp-win { font-weight: 500; color: var(--up); }
.scan-pop-row .sp-loss { font-weight: 500; color: var(--down); }
/* Still open in the ledger, but the pair's live read has since moved past it
   - see Scanner::run()'s open-ledger pass and appendSupersededNote() in
   app.js. A <p> sibling of .scan-pop-row rather than part of it: the row is
   a single-line flex layout with no wrap, so this needs its own line below
   it, not a cramped flex item fighting sp-right for space. Colored like the
   "Levels" toggle it sits beside, but in the warning tone - not up/down,
   which would read as "this direction is winning" - because the point is
   "read this before you act on it". */
.sp-superseded {
  margin: -4px 4px 8px; font-size: 11px; color: var(--warn-text);
}
/* "Levels" - the published plan, collapsed under the row by default (see
   appendLevelsToggle() in app.js). A separate button rather than nested
   inside .scan-pop-row: a <button> cannot contain another button, and
   opening the plan is a different action from opening the chart. */
.scan-pop-lv-toggle {
  display: block; margin: -4px 4px 6px; padding: 3px 8px; background: none;
  border: 1px solid var(--border); border-radius: 7px; color: var(--muted);
  font-size: 11px; cursor: pointer; width: fit-content;
}
.scan-pop-lv-toggle:hover { color: var(--text); border-color: var(--muted); }
.scan-pop-lv { padding: 2px 4px 12px; }
/* The bar itself: a track between stop and the furthest target, with a mark
   for each level positioned by where it actually sits between them - not to
   scale against price, only against the plan's own range, so a glance says
   "close to target" or "close to stop" without reading the numbers below. */
.lv-bar { position: relative; height: 6px; margin: 6px 2px 14px; }
.lv-track { position: absolute; inset: 0; border-radius: 3px; background: var(--border); }
.lv-mark {
  position: absolute; top: 50%; width: 2px; height: 16px; transform: translate(-1px, -50%);
  border-radius: 1px;
}
.lv-mark::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: inherit;
}
.lv-stop { background: var(--down); }
.lv-entry { background: var(--text); height: 20px; }
.lv-tp { background: var(--up); }
.lv-price { background: var(--accent); width: 3px; height: 22px; border-radius: 2px; }
.lv-nums { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; }
.lv-num { color: var(--muted); }
.lv-stop-n { color: var(--down); }
.lv-tp-n { color: var(--up); }
.lv-price-n { color: var(--accent); font-weight: 500; }
/* The divider between the setups list and the "already running" rows below
   it (see renderProgress() in app.js) - a label, not a button, so it cannot
   be tapped or focused like the rows either side of it. Sits on the same
   list, styled apart from a row rather than boxed off, so it reads as a
   section of one list rather than a second list bolted on. */
.scan-pop-heading {
  padding: 10px 4px 4px; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px;
}
/* Which target a still-running call has reached - the stage a fresh setup's
   grade/score occupy on an ordinary row. Accent rather than --up: this is
   progress, not yet a settled win, and the two must not read the same. */
.scan-pop-row .sp-stage { font-weight: 500; color: var(--accent); }
.scan-pop-foot {
  text-align: center; padding: 8px 0 2px; font-size: 11.5px; color: var(--muted); margin: 0;
}
/* The icon beside "Live setups"'s own close button that swaps this SAME
   popup's body over to the by-coin win rate list - see openCoins()/
   closeCoins() in app.js. Same touch target and muted-until-hovered
   treatment as .scan-pop-x beside it, so the two read as a matched pair
   rather than one being an afterthought. Stays lit (.on) while the coin
   list is the one showing, the same way the sort toggles do, since the
   title above is the only other thing saying which list this is. */
.scan-pop-icon-btn {
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 0; min-width: 40px; min-height: 40px; margin-left: auto;
  border-radius: 8px;
}
.scan-pop-icon-btn svg { width: 18px; height: 18px; }
.scan-pop-icon-btn:hover { color: var(--text); }
.scan-pop-icon-btn.on { color: var(--accent); background: var(--surface2); }
/* .scan-pop-topcoins swaps in for .scan-pop-list within the SAME popup
   (see charts.php and openCoins() in app.js) rather than opening a second
   one - it fills the card and scrolls the same way .scan-pop-list does,
   re-using .scan-pop-row's own styling so the two lists read as one design.
   Tapping a coin filters the setups list to it and swaps back - see
   coinClick() in app.js - and stays highlighted (.on) while that filter is
   active, the same "lit while active" look the sort toggles use. */
.scan-pop-topcoins { display: flex; flex-direction: column; overflow-y: auto; flex: 1 1 auto; }
.scan-pop-topcoins .scan-pop-row { border-top: 1px solid var(--border); }
.scan-pop-topcoins .scan-pop-row.on { background: var(--surface2); }
.scan-pop-topcoins .scan-pop-row.on .sp-sym { color: var(--accent); }
.spc-loadmore {
  width: 100%; text-align: center; padding: 9px 0; background: none; border: 0;
  color: var(--accent); font-size: 12.5px; font-weight: 500; cursor: pointer;
}

.mode-seg .seg-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 7px 14px; border: 0; border-right: 1px solid var(--border);
  background: transparent; color: var(--muted); text-decoration: none; cursor: pointer;
  text-align: center; line-height: 1.15;
}
.mode-seg .seg-link:hover { color: var(--text); background: var(--surface2); }
.mode-seg .seg-link b { font-size: 13px; font-weight: 500; }
.mode-seg .seg-link small { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.4px; }
/* The ticket's row uses .ticket-entry rather than .mode-seg. */
.ticket-entry .seg-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; text-decoration: none; color: var(--muted); text-align: center;
}
.ticket-entry .seg-link:hover { color: var(--text); }
.mode-seg button b { font-size: 13px; font-weight: 500; }
.mode-seg button small { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.4px; }
.mode-seg button.on { background: var(--accent-fill); color: var(--on-accent, #111); }
/* Its own full-width line below the now-50/50 segmented control, not beside
   it - "beside" is what produced the awkward wrap the two buttons and the
   caption fought over when the buttons were left content-sized. */
.mode-say { margin: 6px 0 0; flex: 1 1 100%; width: 100%; min-width: 0; color: var(--muted);
            font-size: var(--fs-small); line-height: 1.45; }
/* ON A PHONE THE SENTENCE GOES.
 *
 * Measured: at 375px the controls above the chart came to 658 pixels, so on
 * an 800px screen you scrolled a whole viewport before seeing a candle - and
 * 126 of those were this bar, because the explanation wrapped to three lines.
 * The buttons already say it: "Automatic / our engine decides" against
 * "Manual / you decide". The paragraph is for a desktop that has the width to
 * spare, and it is still there on the wider layout and in the ticket panel. */
@media (max-width: 720px) {
  .mode-bar { gap: 8px; padding: 6px 8px; }
  .mode-seg { flex: 1 1 auto; }
  .mode-seg button { flex: 1 1 0; padding: 6px 8px; min-height: 46px; }
  .mode-say { display: none; }
}

/* The side-panel plan card, when the plan in it is the reader's own. Same
   amber as the mode bar, so the two places that can show a plan agree about
   what "yours" looks like. */

/* ---- drawing tools, named ----
   They were eight unlabelled glyphs behind title attributes, which a phone
   cannot show at all. Icon over label, in the same shape as the indicator
   tiles this site already uses, so a tool is readable rather than guessable. */

/* The strip that appears only while a tool is armed. A permanent instruction
   is wallpaper; one that arrives when you pick a tool answers the question you
   just asked, and leaves when you are finished. */

/* ================= phone: the chart comes first =================
   Measured at 375px: 658 pixels of controls stood between the top of the page
   and the first candle, on screens that are 800 tall. Trimming the bar and the
   control rows took it to 542, which is still a whole viewport of toolbar on
   the page whose entire purpose is a chart.

   So on a phone the order changes: the mode switch and the coin/timeframe
   controls stay above - they decide WHAT you are looking at - and the drawing
   tools, the indicator toolbar and the data table move below the chart, because
   they are what you reach for after looking at it, not before. Chart top goes
   to about 320px, which is on screen the moment the page opens.

   Order only. Nothing moves in the DOM, so the tab order and the screen-reader
   reading order still follow the markup, and the desktop layout is untouched. */
@media (max-width: 720px) {
  .chart-panel { display: flex; flex-direction: column; }
  /* EVERY child needs a place in this order, not just the ones I was thinking
     about. An unordered flex child defaults to 0, which puts it FIRST - so the
     favourites bar, which has no rule of its own, jumped over the mode switch
     to the very top of the page on every phone. Nothing errored; it just moved
     somewhere nobody asked it to be.
     The catch-all comes first so anything added later lands after the chart
     rather than above the lot. */
  .chart-panel > * { order: 9; }
  .chart-panel > .mode-bar { order: 1; }
  /* Forgotten by this exact rule set despite its own comment above ("every
     child needs a place... not just the ones I was thinking about") - with
     no order of its own #staleCall fell into the order:9 catch-all, landing
     after the chart, the toolbar and the data table instead of where its
     own CSS says it belongs ("between the mode bar and the chart, because
     that is where the reader's eye already is"). Same order as .mode-bar
     rather than a new number: flex items sharing one order value keep their
     source order as the tiebreak, and #staleCall already sits right after
     .mode-bar in the markup - this seats it there without renumbering
     anything else in this list. */
  .chart-panel > .stale-call { order: 1; }
  .chart-panel > .controls { order: 2; }
  .chart-panel > .fav-bar { order: 3; }
  .chart-panel > .chart-wrap { order: 4; margin-bottom: 10px; }
  .chart-panel > .dw-doing { order: 5; }
  .chart-panel > .chart-toolbar { order: 7; }
  .chart-panel > .chart-data { order: 8; }
}

/* The label on the drawing row. Small, but it is the difference between a row
   of buttons and a place you go to do something. */


/* Controls that belong to the engine's plan. Left as a class rather than
   inlined because the ticket still keys on it, and it costs nothing:
   the entry choice and the exit ladder
   three targets. */

/* The live price and Refresh, as one group on the right of the control row. */
.ctrl-live { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
/* ON A PHONE THE PAIR GETS ITS OWN ROW.
 *
 * Sharing one row with the timeframe and the star put four controls across
 * 375 pixels, and the button was clipped mid-word - "Analysi" - because its
 * label grows to "Analysing…" while the chart is working. The page did not
 * overflow, so the automated check passed; it was only visible in the
 * screenshot, which is why the screenshot is part of the check.
 *
 * A row costs 44 pixels. A button nobody can read costs the button. */
@media (max-width: 720px) {
  .ctrl-live { grid-column: 1 / -1; margin-left: 0; display: grid;
               grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  /* THE OLD PLACEMENTS HAVE TO BE UNDONE, NOT JUST OVERRIDDEN.
   *
   * The phone layout used to place these two by hand - live-price in column
   * three of the control grid, the button in column four - because they were
   * direct children of it. They are inside .ctrl-live now, and those rules
   * still matched: the pair was laid out correctly at full width while its two
   * children were sent to columns three and four of a two-column grid, so they
   * bunched against the right edge with a third of the row empty beside them.
   *
   * A selector that survives the element it was written for is the quiet kind
   * of bug: nothing errors, nothing overflows, it just looks wrong. */
  .ctrl-live .live-price { grid-column: 1; justify-content: center; }
  .ctrl-live button.primary { grid-column: 2; padding: 10px 14px; }
}


/* ===================================================================
   HIT TARGETS AND LEGIBILITY ON A PHONE
   Measured rather than guessed: a sweep of every member page at 375px
   counted 163 interactive elements smaller than 32px in either
   direction and eight pieces of text under 10.5px. The account page
   alone had 81, nearly all of them native checkboxes - which no
   stylesheet had ever touched, so they were the browser's 13x13 default.
   A 13px target is a coin-toss tap on a phone, and this page is where
   the member sets the filters that decide which alerts they get.
   =================================================================== */

/* Checkboxes and radios, sized to be hit. accent-color keeps the native
   control - and its focus ring, its keyboard behaviour and its high
   contrast mode - rather than rebuilding one out of divs, which is how
   a checkbox stops being announced as a checkbox.
   24px, not the 18 this used to be: that is the WCAG 2.2 AA minimum, and the
   alert filters on the account page are bare boxes with no wrapping label to
   borrow a bigger target from. */
input[type="checkbox"], input[type="radio"] {
  width: 24px; height: 24px; min-width: 24px; min-height: 24px;
  accent-color: var(--accent);
  flex: 0 0 auto; cursor: pointer;
}
/* A label wrapping a checkbox is the real target, so give it the height
   even when the box itself is small. */
label > input[type="checkbox"], label > input[type="radio"] { margin-right: 2px; }

@media (max-width: 640px) {
  /* The floor for anything you tap. 36px is short of the 44px ideal on
     purpose: this UI is dense with controls and 44 everywhere would push
     the content that matters off the screen, which is its own usability
     failure. 36 clears the measured problem - 13px, 14px, 23px targets -
     without turning a settings page into a scroll. */
  .btn, .btn-primary, .btn-ghost, .btn.small, button, select,
  input[type="text"], input[type="number"], input[type="search"],
  input[type="email"], input[type="password"], input[type="url"] {
    min-height: 36px;
  }
  /* A disclosure row is a tap target the size of the row; it was 15px
     tall on the track record's explainers. */
  summary { min-height: 36px; display: flex; align-items: center; }
  /* Links inside data tables - a coin name in the scanner measured
     61x14. Padding rather than min-height, because a table cell will not
     grow for it and the row is what should get taller. */
  .scan-table a, .perf-table a, .grid a { display: inline-block; padding: 6px 0; }
}

/* Nothing smaller than 11px. Ten-point uppercase on a dark background is
   decoration, and this offender was carrying real information - which
   payment methods are instant. */
.pm-row .tag { font-size: 11px; }

/* The board-versus-chart notice - see charts.php. Sits between the mode bar
   and the chart because that is where the reader's eye already is after
   tapping a row, and it is a statement of fact rather than an error: the call
   was real, it is simply no longer live. */
.stale-call {
  max-width: 900px; margin: 8px auto 0; padding: 9px 12px; font-size: 12.5px;
  line-height: 1.5; color: var(--warn-text, var(--text));
  background: var(--warn-bg, var(--surface2)); border: 1px solid var(--warn-border, var(--border));
  border-radius: 8px;
}
.stale-call strong { color: var(--text); }

/* The role picker under the drawing tools - see charts.php. Wraps on a phone
   rather than scrolling, because six short buttons in two rows are easier to
   hit than six in one row that slides. */

/* ---- the scanner sheet, locked ------------------------------------------
   A free member taps Scanner at the moment they most want it, so this is a
   sales panel rather than an error. The ghost rows behind it are a SHAPE, not
   data: no names, no numbers, nothing to recover with a screenshot and a
   filter - blurring real signals would be a paywall you can beat, and
   inventing plausible ones would be inventing signals. */
.sp-lock { border-top: 0 !important; position: relative; padding: 4px 0 2px; }
.sp-ghosts {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px;
  padding-top: 6px; opacity: 0.5; filter: blur(2.5px); pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
          mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
.sp-ghost { display: flex; align-items: center; gap: 10px; }
.sp-ghost span { height: 11px; border-radius: 6px; background: var(--surface2); display: block; }
.sp-ghost .g1 { width: 84px; }
.sp-ghost .g2 { width: 38px; }
.sp-ghost .g3 { width: 54px; margin-left: auto; }
.sp-lock-body { position: relative; text-align: center; padding: 10px 6px 4px; }
.sp-lock-badge { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.sp-lock-body h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.35; color: var(--text); }
.sp-lock-body h3 strong { color: var(--accent); }
.sp-lock-body > p { margin: 0 auto 12px; font-size: 13px; line-height: 1.55; color: var(--muted); max-width: 34em; }
.sp-lock-list {
  list-style: none; margin: 0 auto 14px; padding: 0; display: grid; gap: 7px;
  text-align: left; max-width: 21em; font-size: 13px; color: var(--text);
}
.sp-lock-list li { position: relative; padding-left: 22px; line-height: 1.45; }
.sp-lock-list li::before {
  content: '✓'; position: absolute; left: 0; top: 0; color: var(--up); font-weight: 500;
}
.sp-lock-cta { display: block; width: 100%; max-width: 22em; margin: 0 auto; text-align: center; }
.sp-lock-note { margin: 10px 0 2px; font-size: 11.5px; color: var(--muted); }


/* ===================================================================
   LINK COLOUR, WHICH THIS STYLESHEET NEVER SET
   ===================================================================
   Measured across every page: links outside a styled context were
   rendering in rgb(0,0,238) - the browser's own unstyled blue - which
   on a dark background is 1.84:1. Not "a bit dim": below the 3:1 floor
   for any text at any size, and it was carrying real destinations,
   including "portfolio wallet" on the account page and the JSON feed
   link on the status page.

   Nothing had ever gone wrong visibly because most links live inside a
   component that colours them. The ones that did not were invisible,
   which is exactly the kind of hole a component-by-component eye never
   finds and a sweep does in one pass.

   --link is lighter than --accent on purpose. The accent is a fill
   colour behind white text; a link is text on a dark ground and needs
   more lift: #8A94FF reads 6.24:1 on the page background and 5.02:1 on
   the lightest panel, where the accent itself managed 4.06:1. */
/* LINKS ARE THE ACCENT, NOT A SECOND BLUE.
 * The hover pair was still the old family - #7cb8ff, #073e8f, #8fc2ff - so a
 * link and the button beside it were different hues, and hovering a link
 * changed which palette the page appeared to be in. Derived from --accent so
 * a repainted brand takes its links with it. */
:root { --link: color-mix(in srgb, var(--accent) 78%, #FFFFFF); --link-hover: #FFFFFF; }
:root[data-theme="light-palette"] { --link: var(--accent); --link-hover: color-mix(in srgb, var(--accent) 72%, #000000); }
:root[data-theme="contrast"] { --link: color-mix(in srgb, var(--accent) 55%, #FFFFFF); --link-hover: #FFFFFF; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }
/* Anything that is a link but painted as a control keeps its own colour -
   a button is not blue text, and these already pass on their own fill. */
/* A link painted as a control keeps the control's colour, not the link blue.
   Split in two, because "inherit" is right for the ones that sit on the page
   ground and WRONG for the filled ones - an anchor styled as a primary button
   inherited --text and rendered 3.92:1 on its own fill, which is how a rule
   written to fix contrast quietly caused some. */
a.btn-ghost, a.brand-link, a.seg-link, a.nav-link, a.nav-btn,
a.pos-sym, a.setup-card, a.scan-pop-all {
  color: inherit;
}
a.btn, a.btn-primary, a.btn.small, a.sp-lock-cta { color: #fff; }

/* News source names sat at 4.06:1 - the accent used as small text on the
   lightest panel, which is the one place it does not have the room. */
.news-src { color: var(--link); }

/* WHITE ON THE ACCENT IS 3.75:1, AND THAT IS NOT ENOUGH FOR A BUTTON.
   4.5:1 is the bar for text under 18.66px bold, and every filled control
   here is 11-14px. The text cannot get lighter - there is nothing above
   white - so the FILL goes darker: #E8940F reads 4.63:1 behind white,
   and beside the unfilled controls it is close enough that nothing looks
   out of place.
   One variable rather than eight edits, so a filled control cannot drift
   back to the lighter blue later, and so the light and contrast themes
   each get a value that suits their own ground. */
:root { --accent-fill: #E8940F; }
:root[data-theme="light-palette"] { --accent-fill: #B45309; }
:root[data-theme="contrast"] { --accent-fill: color-mix(in srgb, var(--accent) 72%, #000000); }

.btn, .btn-primary, .acct-box .btn,
.mode-seg button.on, .ticket-entry button.on, .scan-pop-seg button.on,
.ct-btn.on, .ticket-pcts button.on {
  background: var(--accent-fill);
}
/* And the text on them is white, not --text. The primary button was using
   the body text colour (#EDF0F6) on that fill, which is 3.92:1 - close
   enough to look fine and still under the bar. White is 4.63:1. */
.btn, .btn-primary, .acct-box .btn { color: #fff; }

/* The theme switch on the bar rather than inside the menu - see View::topbar.
   It sits between the brand and the Menu button, so it must not stretch and
   must line up with Menu's height rather than the menu items' padding.
   The push-right job used to live here (margin-left:auto) unconditionally.
   On desktop that job moved to .top-nav (see its own rule at min-width:721px)
   since the whole right-hand cluster - account buttons included - needs to
   move together there, not just these two icons. On a phone .top-nav
   contributes nothing to push against: it is display:none until opened, so
   it takes up zero width in the flex row, and without its own auto margin
   the toggle was left stranded by justify-content:space-between - centred
   in the leftover gap between the logo and the icon instead of sitting next
   to it. It gets that margin back, but only below 721px, so the two rules
   never fight over the same width. */
.topbar .theme-toggle-bar {
  flex: 0 0 auto; margin-right: 8px; min-height: 40px; min-width: 40px;
}
@media (max-width: 720px) {
  .topbar .theme-toggle-bar { margin-left: auto; }
}
@media (min-width: 721px) {
  .topbar .theme-toggle-bar { margin-left: 10px; }
}
.topbar .theme-toggle-bar + .nav-toggle { margin-left: 0; }
/* NO ICON FOR A GUEST, ON DESKTOP.
   Log in and Register already render directly on the bar for a guest (see
   View::topbar()), so this button opens nothing for them there - the click
   handler has nowhere to send it, a fact the markup's own comment already
   admits. An icon that does nothing on click is not a quiet control, it is
   a dead button next to two live ones. A signed-in member still gets it
   (.has-account): it is the only way to reach their own account/log out
   menu. Scoped to desktop only - on a phone the icon is still how a guest
   opens the panel that holds Log in/Register in the first place (they are
   not on the bar directly there), so it must keep showing below 721px. */
@media (min-width: 721px) {
  .nav-toggle:not(.has-account) { display: none; }
}


/* ===================================================================
   THE LIGHT THEME'S OWN COLOURS
   ===================================================================
   The light theme overrode the greys and never the signal colours, so
   green, red, the accent badges and the warn tones stayed at values
   chosen to glow on near-black. Measured on white: +0.35 in green read
   2.54:1, a filled button 1.12:1, a plan name on the upgrade page
   1.20:1. Dark and high-contrast came back clean, which is exactly how
   this survived - nobody develops in light mode.

   Same hues, darkened until they clear 4.5:1 on white and on the page's
   own off-white panel. --up-dim/--down-dim keep the tinted row
   backgrounds light, because darkening those too would turn a subtle
   stripe into a block of colour. */
:root[data-theme="light-palette"] {
  --up: #0F9E72;
  --down: #D93F35;
  --good: #0F9E72;
  --bad: #D93F35;
  --warn-text: #7a4f00;
  --warn-border: #b07d0a;
}
/* Filled badges and pills: dark ink on a light tint rather than light ink
   on a light tint. */
:root[data-theme="light-palette"] .signal-badge.buy,
:root[data-theme="light-palette"] .sig-pill.buy { color: #0d5720; }
:root[data-theme="light-palette"] .signal-badge.sell,
:root[data-theme="light-palette"] .sig-pill.sell { color: #8b0a1e; }
/* NOT the badges. Tried dark ink on them and made it worse - 2.78 to 1.36 -
   because these keep a DARK tinted background in light mode, so the light ink
   they already had was right. Measured, reverted, and left alone. */

/* The chart legend is painted with the series colours, which are chosen for
   a dark canvas. */
:root[data-theme="light-palette"] .ct-legend span { color: var(--text); }

/* Hardcoded dark chips, given a light-theme twin.
   .impact.high and .impact.medium carry their own near-black backgrounds -
   written before there was a light theme - so in light mode they stayed dark
   while the ink around them went dark too. The tint follows the theme now. */
:root[data-theme="light-palette"] .impact.high { background: #ffe9e9; color: #8b0a1e; }
:root[data-theme="light-palette"] .impact.medium { background: #fff3d6; color: #7a4f00; }
:root[data-theme="light-palette"] .tier-badge { background: #fff3d6; color: #7a4f00; }

/* The quiet button: a surface, a border, and text that belongs to the theme.
   Overrides the filled .btn it sits beside in the class list. */
.btn.btn-secondary {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); text-decoration: none;
}
.btn.btn-secondary:hover { border-color: var(--muted); }

/* The last of the long tail, each measured rather than guessed.

   .chart-legend: painted in the series colours, which are picked for a dark
   canvas - fine on the chart itself, too pale as text on a light panel.

   .signal-badge with no verdict: the neutral state borrows --muted, which is
   a comment colour rather than a headline one. */
:root[data-theme="light-palette"] .chart-legend span { color: var(--text); }
/* NOT the signal badge. Forcing --text on it took 2.16 to 1.19 - the neutral
   state keeps a dark plate in light mode, so the pale ink it ships with is the
   right one. Second time this trap has been walked into on this sweep, so it is
   written down: a badge is a plate with its own ground, not text on the page. */
:root[data-theme="light-palette"] .plan-card .pr { color: #B45309; }
:root[data-theme="light-palette"] .plan-card .dy,
:root[data-theme="light-palette"] .pm-row .dy { color: #4a525e; }
.plan-card .dy { color: color-mix(in srgb, var(--muted) 70%, var(--text)); }

/* The payment-method chips read 3.68:1 with the series colour as ink on their
   own tint. Ink mixed toward the text colour; the tint stays. */
.tag.auto { color: color-mix(in srgb, var(--up) 45%, var(--text)); }
.tag.manual { color: color-mix(in srgb, var(--warn-text) 55%, var(--text)); }
.plan-card .dy, .pm-row .dy { color: color-mix(in srgb, var(--muted) 45%, var(--text)); }

/* The no-verdict plate. It keeps a dark ground in light mode while its ink is
   pale, which is 2.16:1 - and forcing the ink darker made it worse, because
   the plate is the thing that is wrong, not the text. The plate follows the
   theme; the ink it ships with then works in both. */
/* NO SETUP in light mode, 2.66:1.
   The neutral plate is tinted from --warn-border over --surface2 and its ink is
   --warn-text, and that pairing lands under 4.5 on the largest piece of type on
   the page. The idle plate right below has the same job and measures clean, so
   the neutral state is given the same treatment rather than a third variation:
   plate and ink stated together, amber kept only as the border, so neither can
   drift into the other when a token moves. */
:root[data-theme="light-palette"] .signal-card.neutral .signal-badge {
  background: var(--surface2);
  color: #6b4300;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn-border) 55%, transparent);
}
:root[data-theme="light-palette"] .signal-badge.idle,
:root[data-theme="light-palette"] #signalCard.idle .signal-badge {
  background: var(--surface2); color: #4a525e; border: 1px solid var(--border);
}

/* ------------------------------------------------------------------ signal type
   1:1, 1:2, 1:3 - what the plan pays for the risk it takes. A badge, so it
   reads as a category rather than as another number in a row of numbers, and
   with its own ground in every theme: this is a plate, not text on the page,
   which is the lesson the badge colours above were rewritten twice to learn. */
.rr-type {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  color: #fff;
  border: 1px solid transparent;
  /* FIXED PLATES, NOT THEME MIXES.
     These were mixed from --muted, --accent and --up, which put white text on
     whatever those tokens happened to be in each theme: 4.08:1 on the green in
     dark and 3.43:1 on the grey in contrast, both under the 4.5 this size
     needs. A badge is a plate with its own ground - the same lesson the signal
     and tier badges were rewritten twice to learn - so the ground is stated
     here and does not move when a theme does. White on all three clears 6:1. */
  background: #3f4654;
}
.rr-type.rr2 { background: #9A5B00; }
.rr-type.rr3 { background: #14653f; }

/* Signal-type checkboxes in the alert preferences. A row of three, wrapping on
   a phone, with the same badge the scanner and the chart use so the control and
   the thing it controls are visibly the same object. */
.pref-types {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px 4px;
  margin: 0 0 4px;
  grid-column: 1 / -1;
}
.pref-types legend { font-size: 13px; font-weight: 500; padding: 0 4px; }
.pref-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 14px 8px 0;
  min-height: 36px;
  cursor: pointer;
}
.pref-type input { width: 18px; height: 18px; }

/* ------------------------------------------------------- your open trades
   The positions panel beside the chart. A row is scannable left to right -
   coin, frame, direction, entry, live profit, close - and wraps rather than
   scrolls on a phone, because a horizontal scroller inside a panel is a place
   people lose the Close button. */
.pos-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  background: var(--surface2);
}
.pos-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.pos-wallet { font-size: 12px; color: var(--muted); }
.pos-list { list-style: none; margin: 8px 0 0; padding: 0; }
.pos-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.pos-list > li:first-child { border-top: 0; }
/* The coin you are looking at, marked - the rest of the list is context. */
.pos-row.pos-here .pos-sym { font-weight: 500; }
.pos-sym { min-width: 74px; }
.pos-tf, .pos-in { color: var(--muted); font-size: 12px; }
.pos-side {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
  color: #fff;
}
.pos-side.buy { background: #14653f; }
.pos-side.sell { background: #8c2b30; }
.pos-pnl { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.pos-pnl.up { color: var(--up); }
.pos-pnl.down { color: var(--down); }
.pos-close {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.pos-close:hover { border-color: var(--down); color: var(--down); }
.pos-close[disabled] { opacity: .6; cursor: default; }

/* ------------------------------------------------------- track-record windows
   All time / 7 / 30 / 90, as links so each period has its own address. A row
   that wraps rather than scrolls: four short labels fit two-up on the narrowest
   phone, and a horizontal scroller here would hide the period you are not on -
   which is the one you came to switch to. */
.perf-windows {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.perf-windows a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.perf-windows a:hover { border-color: var(--accent); }
/* The selected pill carries white on a FIXED plate, not on var(--accent).
   Measured at 3.75:1 against the accent in dark and light - the accent is an
   operator-set colour chosen to stand out against a page, which is not the
   same as one that carries 13px white text. Same fixed blue as the 1:2 signal
   badge, so the site has one "this one is selected" colour rather than two. */
.perf-windows a.on {
  background: #9A5B00;
  border-color: #9A5B00;
  color: #fff;
}

/* The "how do I automate this" drawer on the account page. Closed by default:
   it answers a question most members never ask, and open it would push the
   payment history off the screen for everyone who does not. */
.auto-doc { margin-top: 14px; }
.auto-doc > summary {
  cursor: pointer;
  min-height: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.auto-doc .sub { margin: 8px 0 0; }
.auto-doc code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 12px;
}

/* HOW LONG THE CALL IS STILL A CALL.
 *
 * A number and a bar, because they answer different questions: the number is
 * how long you have, the bar is how much of this setup's life has already
 * gone - and two hours left means one thing on a 4h call and another on a
 * daily one.
 *
 * Fixed ink on fixed grounds in all three states rather than theme tokens: the
 * amber and the grey have to mean the same thing on both themes, and a token
 * pair that passes on one and scrapes by on the other is not a decision
 * anybody can check. Measured at the worst of the four values in each state
 * across both themes: 6.11:1 running, 5.77:1 in the last hour, 6.93:1 once the
 * time stop is reached. */
.sig-life {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 7px 11px;
  border-radius: 8px;
  background: #16202c;
  border: 1px solid #2a3a4d;
}
:root[data-theme="light-palette"] .sig-life { background: #eef3f9; border-color: #c8d5e4; }
.sig-life .sl-lbl {
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: #93a6bd;
  flex: 0 0 auto;
}
:root[data-theme="light-palette"] .sig-life .sl-lbl { color: #4c5c72; }
.sig-life strong {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: #d9e6f5;
  flex: 0 0 auto;
}
:root[data-theme="light-palette"] .sig-life strong { color: #10233a; }
/* The bar takes what is left of the row, so the two figures never move as the
   text shortens from "18h 44m" to "9m 12s". */
.sig-life .sl-bar {
  flex: 1 1 auto;
  min-width: 40px;
  height: 5px;
  border-radius: 4px;
  background: #24313f;
  overflow: hidden;
}
:root[data-theme="light-palette"] .sig-life .sl-bar { background: #d6e0ec; }
.sig-life .sl-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--link);
  transition: width 0.9s linear;
}
@media (prefers-reduced-motion: reduce) { .sig-life .sl-bar i { transition: none; } }

/* The last hour. Amber, and the bar with it, because a reader who has scrolled
   past the number should still catch it. */
.sig-life.is-soon { background: #2a2312; border-color: #6b5416; }
.sig-life.is-soon .sl-lbl { color: #d7ae5a; }
.sig-life.is-soon strong { color: #f2d491; }
.sig-life.is-soon .sl-bar { background: #3d3316; }
.sig-life.is-soon .sl-bar i { background: #e0a83a; }
:root[data-theme="light-palette"] .sig-life.is-soon { background: #fdf3dd; border-color: #d3ab52; }
:root[data-theme="light-palette"] .sig-life.is-soon .sl-lbl { color: #7a5a12; }
:root[data-theme="light-palette"] .sig-life.is-soon strong { color: #4a3607; }

/* Finished. Not a warning - the setup simply ran out of time, which is one of
   the three ways every call on this site ends. */
.sig-life.is-done { background: #1c2026; border-color: #333b45; }
.sig-life.is-done .sl-lbl,
.sig-life.is-done strong { color: #a4aebb; }
.sig-life.is-done .sl-bar i { background: #6d7887; }
:root[data-theme="light-palette"] .sig-life.is-done { background: #eef0f3; border-color: #cdd3da; }
:root[data-theme="light-palette"] .sig-life.is-done .sl-lbl,
:root[data-theme="light-palette"] .sig-life.is-done strong { color: #4a525c; }

/* How long an open position has before its time stop. Muted while there is
   room, amber inside the last hour - the same two states the signal card's
   countdown uses, so one vocabulary covers the call and the trade taken from
   it. Measured 5.9:1 and 7.5:1 on their grounds. */
.pos-left {
  font-size: var(--fs-tiny);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}
.pos-left.soon { color: #e0a83a; font-weight: 500; }
:root[data-theme="light-palette"] .pos-left.soon { color: #8a5f08; }

/* The trade-receipt switch sits with the alert preferences and takes the same
   shape as them: the box in the margin, the label and its explanation wrapping
   freely beside it. */
.trade-mail { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 2px; }
.trade-mail input { margin-top: 2px; flex: 0 0 auto; }

/* =====================================================================
   INSTRUMENT COMPONENT LAYER
   =====================================================================
   Appended last on purpose. Every rule below targets a class that already
   exists in the markup - counted from the templates, not invented - so this
   restyles the site that is there rather than describing one that isn't.
   Equal specificity, later in the file, so it wins on order without a single
   !important.

   Three rules run through all of it:

     One accent-filled element per view. .btn-primary is filled; every other
     button is a bordered surface. Two filled buttons side by side means the
     page has not decided what it wants you to do.

     Borders move, backgrounds don't. Hover changes a border colour and lifts
     1px. A control that repaints its whole background on hover reads as a
     different control, and on a dense panel that is thirty things flickering.

     Numbers are mono and tabular everywhere. A proportional 8 beside a
     proportional 1 makes a column of figures unreadable at a glance, and this
     is a site made of columns of figures.
   ===================================================================== */

/* ------------------------------------------------------------ buttons */
.btn, .btn-ghost, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 8px;
  padding: 10px 17px; font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.btn:hover, .btn-ghost:hover, button.btn:hover, a.btn:hover {
  border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px);
}
.btn:active, .btn-primary:active { transform: translateY(0) scale(.985); }

/* The one filled button. */
.btn-primary, .cta-main, input[type="submit"], button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent-fill, var(--accent)); color: var(--on-accent, #111);
  border: 1px solid var(--accent-fill, var(--accent)); border-radius: 8px;
  padding: 11px 20px; font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-primary:hover, .cta-main:hover,
input[type="submit"]:hover, button[type="submit"]:hover {
  background: color-mix(in srgb, var(--accent) 84%, #FFFFFF);
  border-color: color-mix(in srgb, var(--accent) 84%, #FFFFFF);
  transform: translateY(-1px);
}
.btn-big { padding: 14px 26px; font-size: 15px; border-radius: 8px; }

/* Destructive is a border, never a fill. A filled red button is one people
   click by accident; a bordered one has to be aimed at. */
.btn.danger, .btn-danger {
  color: var(--down); border-color: var(--line-down); background: transparent;
}
.btn.danger:hover, .btn-danger:hover { background: var(--bg-down); border-color: var(--down); }

.btn[disabled], .btn-primary[disabled], button[disabled] {
  opacity: .45; cursor: not-allowed; transform: none;
}

/* ------------------------------------------------- cards and surfaces */
.card, .panel, .form-card, .acct-box, .empty-state {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.card, .acct-box { padding: 20px 22px; }
.form-card { padding: 0; overflow: hidden; }
.form-card > summary {
  padding: 14px 18px; font-size: 14px; font-weight: 500; cursor: pointer;
  border-bottom: 1px solid transparent; transition: border-color var(--dur) var(--ease);
}
.form-card[open] > summary { border-bottom-color: var(--border); }
.form-card > summary:hover { background: var(--surface2); }
.form-card > *:not(summary) { padding-left: 18px; padding-right: 18px; }
.form-card > *:last-child { padding-bottom: 18px; }

/* Hairline-gap grids: the rule lines come from the gap, not from borders,
   which stays sharp at any density and never doubles up at a join. */
.cards, .row2 { display: grid; gap: 12px; }
.row2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* -------------------------------------------------------- typography */
.hint, .hint-p, .muted, .tbl-note, .perf-note, .prefs-hint {
  color: var(--muted); font-size: 13px; line-height: 1.65;
}
.hint { display: block; margin-top: 6px; }
.lbl, .ticket-label, .tab-n {
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  letter-spacing: .13em; text-transform: uppercase; color: var(--dim);
}
.small { font-size: var(--fs-small); color: var(--muted); }
.num, .stat b, td.num, .mono, time, code, kbd {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.gray { color: var(--dim); }
.yes { color: var(--up); }
.danger, .no { color: var(--down); }

/* --------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: var(--fs-tiny); font-weight: 500;
  letter-spacing: .04em; padding: 3px 7px; border-radius: 6px;
  border: 1px solid var(--border-2); color: var(--muted); background: transparent;
}
/* The modifiers the templates actually emit, counted from the markup:
   on, off, neutral, buy, sell, trial. Writing .badge.up or .badge.pending
   would have produced rules that never match anything - a stylesheet that
   looks thorough and changes nothing. */
.badge.buy, .badge.on, .badge.bullish {
  color: var(--up); border-color: var(--line-up); background: var(--bg-up);
}
.badge.sell, .badge.bearish {
  color: var(--on-down); border-color: var(--line-down); background: var(--bg-down);
}
.badge.off {
  color: var(--dim); border-color: var(--border); background: var(--surface2);
}
.badge.neutral {
  color: var(--muted); border-color: var(--border-2); background: transparent;
}
/* A trial member carries tier 'paid' and has paid nothing, so the members
   list needs a third state that is neither. Accent, not brass: brass is
   spoken for by grades below and earned status gets to keep it. */
.badge.trial {
  color: var(--accent); border-color: var(--line-accent); background: var(--bg-accent);
}

/* Grades are the one place brass appears on the member pages, and the sweep
   is the only looping decorative animation in the whole system. Earned
   status gets exactly one flourish; nothing else does. */
.grade, .badge.grade {
  font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em;
  border-radius: 8px; padding: 4px 8px; position: relative; overflow: hidden;
  color: var(--muted); border: 1px solid var(--border-2);
}
.grade.gAp, .grade.gA, .badge.grade.gAp, .badge.grade.gA {
  color: var(--brass); border-color: var(--line-warn); background: var(--bg-warn);
}
.grade.gAp::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%,
              color-mix(in srgb, var(--brass) 26%, transparent) 50%, transparent 65%);
  transform: translateX(-130%); animation: gradeSweep 5s var(--ease) infinite 1.4s;
}
@keyframes gradeSweep { 0% { transform: translateX(-130%); } 55%, 100% { transform: translateX(130%); } }

/* ---------------------------------------------------------- tables */
table.grid, .perf-table, .chg-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
table.grid th, .perf-table th, .chg-table th {
  font-family: var(--font-mono); font-size: var(--fs-tiny); font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 2;
}
table.grid td, .perf-table td, .chg-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
table.grid tbody tr, .perf-table tbody tr {
  transition: background var(--dur-fast) var(--ease);
}
table.grid tbody tr:hover, .perf-table tbody tr:hover { background: var(--surface2); }
table.grid tbody tr:last-child td, .perf-table tbody tr:last-child td { border-bottom: 0; }
/* Never zebra-stripe: the hairlines already do that job, and stripes plus
   hairlines is two grids arguing. */
table.grid tbody tr:nth-child(even) { background: none; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }

/* ------------------------------------------------------------ forms */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="search"], select, textarea {
  font-family: var(--font-sans); font-size: 14px; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; width: 100%;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--border-2); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 160px; }

/* Checkbox rows are targets, not decorations: the whole row is clickable and
   clears the 44px minimum, which is what makes a settings page usable with a
   thumb rather than merely visible on a phone. */
.chk {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 4px 0; cursor: pointer; font-size: 14px;
}
.chk input[type="checkbox"], .chk input[type="radio"] {
  width: 18px; height: 18px; min-height: 0; flex: none; accent-color: var(--accent); cursor: pointer;
}

/* --------------------------------------------------------- messages */
.error, .okmsg, .note {
  border: 1px solid var(--border); border-left-width: 2px; border-radius: 0 10px 10px 0;
  padding: 12px 14px; font-size: 13.5px; background: var(--surface);
}
.error { border-left-color: var(--down); color: var(--on-down); }
.okmsg { border-left-color: var(--up); color: var(--up); }
.note  { border-left-color: var(--brass); color: var(--muted); }
/* A caveat styled as an alarm is the first thing a reader learns to ignore.
   A ruled note is still legible on the fiftieth visit. */

.empty-state { padding: 34px 22px; text-align: center; }
.empty-state h3, .empty-state h4 { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.empty-state p { color: var(--dim); font-size: 13px; max-width: 38ch; margin: 0 auto 16px; }

/* ------------------------------------------------------ stat blocks */
.stat, .hstat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
}
.stat b, .hstat b {
  display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 500;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat span, .hstat span {
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  letter-spacing: .13em; text-transform: uppercase; color: var(--dim);
}

/* ------------------------------------------------- segmented controls */
.mode-seg, .ticket-pcts, .scan-pop-seg, .tf-select {
  display: inline-flex; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--surface);
}
.mode-seg button, .ticket-pcts button, .scan-pop-seg button, .ct-btn {
  font-family: var(--font-mono); font-size: 12px; background: transparent;
  border: 0; color: var(--muted); padding: 8px 12px; min-height: 40px; cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.mode-seg button:hover, .ticket-pcts button:hover,
.scan-pop-seg button:hover, .ct-btn:hover { color: var(--text); background: var(--surface2); }
.mode-seg button.on, .ticket-pcts button.on,
.scan-pop-seg button.on, .ct-btn.on {
  background: var(--accent-soft); color: var(--text);
}

/* ----------------------------------------------------- accordions */
.acc > summary, .prefs-head {
  display: flex; align-items: center; gap: 9px; min-height: 44px;
  padding: 10px 14px; cursor: pointer; font-size: 14px; font-weight: 500;
  border-radius: 8px; transition: background var(--dur-fast) var(--ease);
}
.acc > summary:hover, .prefs-head:hover { background: var(--surface2); }
.acc > summary::marker, .acc > summary::-webkit-details-marker { content: ""; display: none; }
.acc-body { padding: 4px 14px 14px; }

/* -------------------------------------------------------- the ledger */
/* The signature component. Diverging bars from a centre axis, one row per
   evidence family, with a brass tick where the correlation cap clipped a
   family's vote. It is the product's own argument drawn as a control. */
.vote-meter .track, .evidence-track {
  position: relative; height: 22px; background: var(--surface2);
  border-radius: 6px; overflow: hidden;
}
.vote-meter .track::before, .evidence-track::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 1px; background: var(--border-2);
}
.evidence-bar {
  position: absolute; top: 4px; bottom: 4px; border-radius: 4px;
  transition: width .9s var(--ease-out);
}
.evidence-bar.pos { left: 50%; background: var(--up); }
.evidence-bar.neg { right: 50%; background: var(--down); }
.evidence-cap { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brass); }

/* ---------------------------------------------------- trade ticket */
.tp-row, .ticket-label + .ticket-amt {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.tp-row:last-child { border-bottom: 0; }
.tp-row strong { margin-left: auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tp-row.tp strong { color: var(--up); }
.tp-row.sl strong { color: var(--down); }

/* ----------------------------------------------------------- motion */
/* CONTENT IS VISIBLE UNTIL SOMETHING CAN PROVE IT WILL BRING IT BACK.
   ====================================================================
   This was a bare `.reveal { opacity: 0 }`, turned back on by a class that
   only ui.js ever adds. That is a bet that one script always arrives and
   always runs, and the forfeit is the whole page: 29 blocks across nine
   pages sit at zero opacity, the document keeps its full height, and the
   reader scrolls through a screen of nothing. Reported as exactly that -
   "scrolling but nothing showing", and only in some browsers, which is the
   signature of the bet being lost rather than of a layout bug.

   Any of these loses it: a privacy browser or extension that blocks the
   script, a 404 or a truncated upload, a data-saver proxy that mangles it,
   an early throw anywhere in the file - ui.js is one IIFE, so a failure on
   its first line takes the reveal code on line 142 with it.

   So the hiding is conditional now. data-js is set by the inline script in
   View::head(), which cannot fail to arrive because it is in the document,
   and it is REMOVED again if ui.js has not reported for duty within a few
   seconds (see that script). No JS, broken JS, blocked JS: the attribute is
   absent and this rule never applies, so the page is simply a page.
   Working JS: the attribute stays and the animation runs as before. */
:root[data-js="1"] .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
:root[data-js="1"] .reveal.in { opacity: 1; transform: none; }
.live-dot { animation: livePulse 2s var(--ease) infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
/* A ticking price tints its background and never moves. Tabular figures plus
   a background flash is zero layout shift on a number that updates every few
   seconds; recolouring or resizing the digits is a page that twitches. */
.px-flash-up { background: var(--bg-up); transition: background .2s ease; }
.px-flash-down { background: var(--bg-down); transition: background .2s ease; }

/* ------------------------------------------------------------ focus */
:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}

/* ------------------------------------------------------------ phone */
@media (max-width: 720px) {
  .btn, .btn-ghost, .btn-primary, button.btn, a.btn,
  input[type="submit"], button[type="submit"] { min-height: 44px; }
  .row2 { grid-template-columns: 1fr; }
  .card, .acct-box { padding: 16px 16px; }
  .form-card > *:not(summary) { padding-left: 14px; padding-right: 14px; }
  table.grid, .perf-table { font-size: 12.5px; }
  table.grid th, .perf-table th, table.grid td, .perf-table td { padding: 9px 10px; }
  .stat b, .hstat b { font-size: 19px; }
}

/* =====================================================================
   CHARTS TOOLBAR — STRUCTURAL PASS
   =====================================================================
   Measured on a 390px phone before this: the mode bar, the search, the coin
   select, the timeframe-and-star row and the price-and-refresh row came to
   about 330px of chrome above the chart. The chart itself got 280. A page
   whose entire purpose is a chart was spending more of the first screen
   telling you which chart than showing it.

   Done in CSS only. .sym-pick, #symbol, #tfSelect, .fav-btn and .ctrl-live
   are already direct children of .controls, so the grid can be rearranged
   without moving a single element - which matters, because ninety-odd IDs on
   this page are bound to JavaScript and the safest structural change is the
   one that doesn't touch the DOM.
   ===================================================================== */

@media (max-width: 720px) {

  /* THE MODE SELECTOR, ON ONE LINE.
     Two stacked labels per segment made a 70px control out of a two-way
     choice, and the sub-labels repeated what the bold line already said -
     "Chart signal / this coin" is one idea written twice. The accent rule
     down the left edge went too: it marked the whole bar as active when only
     one segment inside it ever is, so the page had a permanent highlight
     pointing at a container. */
  .mode-bar {
    padding: 0; margin-bottom: 8px;
    background: none; border: 0; border-left: 0;
  }
  .mode-seg { display: flex; width: 100%; }
  .mode-seg button { flex: 1; flex-direction: row; gap: 6px; padding: 0 10px; min-height: 40px; }
  .mode-seg button small { display: none; }
  .mode-seg button b { font-size: 13px; font-weight: 500; }
  .mode-say { width: 100%; margin-top: 6px; }

  /* THREE ROWS INSTEAD OF FOUR, AND EACH ONE EARNS ITS HEIGHT.
       search .............................
       coin .................  tf     star
       price ....................  refresh
     The coin picker keeps the widest column because it is the control people
     actually reach for; timeframe is four characters and never needed a full
     row beside a 44px star. */
  /* Flex rather than grid, deliberately. The three rows come out identical,
     and flex-wrap degrades to a sane stack on anything that doesn't support
     it, where a grid whose columns aren't understood collapses to one item
     per row - which is the layout this replaces. */
  .controls {
    display: flex; flex-wrap: wrap; gap: 8px;
    align-items: center; margin-bottom: 10px;
  }
  .controls .sym-pick { flex: 1 1 100%; }
  .controls #symbol   { flex: 1 1 auto; min-width: 0; width: auto; }
  .controls #tfSelect { flex: 0 0 76px; min-width: 0; width: 76px; padding-left: 10px; }
  .controls .fav-btn  { flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
                        display: flex; align-items: center; justify-content: center; }
  .controls .unlock-hint { flex: 1 1 100%; justify-content: center; }

  /* Price and refresh are one row and one idea: how current is this. The
     price takes the space because it is the number being read; the button is
     sized to its label. */
  .controls .ctrl-live {
    flex: 1 1 100%; display: flex; gap: 8px; align-items: center; margin-left: 0;
  }
  .ctrl-live .live-price {
    flex: 1 1 auto; grid-column: auto; justify-content: center;
    min-height: 44px; display: flex; align-items: center;
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  }
  .ctrl-live button.primary {
    flex: 0 0 auto; grid-column: auto; margin-left: 0;
    min-height: 44px; padding: 0 18px; white-space: nowrap;
  }

  /* Controls sit at 44px, which is the tap floor and no more. They were
     56-ish because each carried its own vertical padding on top of a
     line-height sized for prose. */
  .controls select, .sym-search {
    min-height: 44px; height: 44px; padding-top: 0; padding-bottom: 0; font-size: 14px;
  }

  /* THE RECLAIMED SPACE GOES TO THE CHART, WHICH IS THE PRODUCT.
     About 150px came back off the toolbar. calc(64vh / var(--zf, 1)) on a 390x844 phone is 540px
     against the 280 it had, so the candles roughly double and the first
     screen is a chart with a toolbar above it rather than the reverse. */
  .chart-wrap { height: calc(64vh / var(--zf, 1)); height: clamp(340px, calc(64vh / var(--zf, 1)), 620px); }
}

/* THE GAP BETWEEN "PHONE" AND "WIDE ENOUGH TO WRAP GRACEFULLY".
 *
 * The compact three-row toolbar above stops at 720px. The base .controls
 * rule (top of this file) has no explicit sizing for its children at all -
 * it relies on each element's own intrinsic width, which only wraps
 * sensibly once the viewport is generous enough that nothing NEEDS to
 * share a row. Between those two, real devices - iPad Mini at 744px, iPad
 * portrait at 768px, a great many Android tablets around 800px - fell into
 * neither: not the phone layout, not comfortably wide, just the base
 * rule's default wrapping, which put the coin picker, the timeframe and
 * the price/refresh row each on their own line. Four cramped rows on a
 * screen with room to spare.
 *
 * Same three-row shape as the phone layout, because a tablet does not need
 * MORE toolbar than a phone does - only the phone-specific trims (smaller
 * fonts, a taller chart stealing the reclaimed space) are left out, since
 * a tablet was never short on either. */
@media (min-width: 721px) and (max-width: 900px) {
  .controls {
    display: flex; flex-wrap: wrap; gap: 8px;
    align-items: center; margin-bottom: 10px;
  }
  .controls .sym-pick { flex: 1 1 100%; }
  .controls #symbol   { flex: 1 1 auto; min-width: 0; width: auto; }
  .controls #tfSelect { flex: 0 0 90px; min-width: 0; width: 90px; padding-left: 10px; }
  .controls .fav-btn  { flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
                        display: flex; align-items: center; justify-content: center; }
  .controls .ctrl-live {
    flex: 1 1 100%; display: flex; gap: 8px; align-items: center; margin-left: 0;
  }
  .ctrl-live .live-price {
    flex: 1 1 auto; justify-content: center; min-height: 44px;
    display: flex; align-items: center;
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  }
  .ctrl-live button.primary {
    flex: 0 0 auto; margin-left: 0; min-height: 44px; padding: 0 18px; white-space: nowrap;
  }
}

/* No glow on the primary action. It was the only element on the page casting
   light, which made a refresh button the visual centre of a chart. */
button.primary { box-shadow: none; }

/* =====================================================================
   EVIDENCE LEDGER — the signature component
   =====================================================================
   Spec calls for 150px / 1fr / 74px rows. Flex rather than grid, for the
   third time and the same reason: a grid whose template isn't understood
   puts one child per row, and one child per row here means the label, the
   bar and the number stack into three lines each.
   ===================================================================== */
.led { margin: 4px 0 0; }
.led-row {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--hair);
}
.led-row:last-child { border-bottom: 0; }
.led-cat { flex: 0 0 150px; font-size: 13px; color: var(--bone); min-width: 0; }
.led-track {
  position: relative; flex: 1 1 auto; height: 22px;
  background: var(--panel-2); border-radius: 6px; overflow: hidden; min-width: 0;
}
.led-axis { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--hair-2); }
.led-bar {
  position: absolute; top: 4px; bottom: 4px; border-radius: 4px;
  transition: width .9s var(--ease-out);
}
.led-bar.up   { left: 50%;  background: var(--long); }
.led-bar.down { right: 50%; background: var(--short); }
/* The cap tick sits at the RAW value. The gap between the bar's end and this
   mark is exactly the evidence the correlation cap refused to count, which
   is the one thing this component exists to show. */
.led-cap { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brass); }
.led-val {
  flex: 0 0 74px; text-align: right;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--muted);
}
.led-val.up { color: var(--long); }
.led-val.down { color: var(--short); }

.led-total {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hair-2);
  font-size: 13px; color: var(--muted);
}
.led-total strong {
  margin-left: auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 18px; font-weight: 500; color: var(--bone);
}
.led-total strong.up { color: var(--long); }
.led-total strong.down { color: var(--short); }
.led-note { margin-top: 8px; font-size: 12px; color: var(--dim); line-height: 1.6; }
.led-note b { color: var(--brass); font-weight: 500; }

/* 360px is the target, and 150px of label out of 360 leaves nothing for the
   bar the row exists for. The label takes what a two-word category needs. */
@media (max-width: 720px) {
  .led-row { gap: 10px; padding: 8px 0; }
  .led-cat { flex: 0 0 84px; font-size: 12px; }
  .led-val { flex: 0 0 46px; font-size: 12px; }
  .led-track { height: 20px; }
}
@media (prefers-reduced-motion: reduce) { .led-bar { transition: none; } }

/* The clipped span: brass ground from where the bar stops to where the raw
   vote would have reached. Hatched rather than solid so it reads as
   "withheld" rather than as more evidence. */
/* Solid tint with a dashed edge, not a hatch. A repeating-linear-gradient
   with double-position stops is newer CSS than some engines parse, and when
   it fails the whole background declaration is dropped - the annotation
   disappears silently on exactly the browsers least able to tell you why.
   A dashed border says "withheld" just as clearly and parses everywhere. */
.led-ghost {
  position: absolute; top: 4px; bottom: 4px; border-radius: 4px;
  background: rgba(216, 178, 106, .16);
  border: 1px dashed rgba(216, 178, 106, .55);
  box-sizing: border-box;
}

/* =====================================================================
   SPEC GAPS — §2 display scale, §4 load stagger, §6 sticky column
   ===================================================================== */

/* §2. The display scale existed for h1 only. Marketing h2 was inheriting a
   UI heading size, so a section title and a panel title were the same object
   at different weights. Scoped to the marketing surface: an h2 inside the app
   or a panel is a label, not a display line, and must stay small.

   SANS, NOT SERIF - same reasoning as the hero headline (see index.php's own
   inline stylesheet): these five section titles were the one remaining place
   on the landing page set in Instrument Serif while literally every other
   page on the site - scanner, charts, portfolio, account - headlines
   in Inter Tight. A visitor moving from "Everything a chart reader does" to
   the scanner one click later was reading two different products' worth of
   type in the same session. font-weight steps up to 600 to carry the same
   display sizes a lighter serif weight could - matching the hero headline,
   which made this exact trade first. */
.hero h1, .hero-copy h1, .sec > h2, .land-h2 {
  font-family: var(--font-sans); font-weight: 600;
}
.sec > h2, .land-h2 {
  font-size: clamp(30px, calc(3.6vw / var(--zf, 1)), 44px);
  line-height: 1.12; letter-spacing: -.015em;
  margin-bottom: 14px;
}
/* .hero h1 em / .hero-copy h1 em: removed. Both selectors are dead - nothing
   emits class="hero", and index.php's own inline stylesheet (loaded after
   this file) already sets .hero-copy h1 em to font-style:normal. .sec > h2
   em stays defined below for the day a section title needs the brass accent
   an em gets elsewhere, but on a sans face regular weight, not the italic
   swap a serif emphasis used - italic on Inter Tight reads as a rendering
   glitch, not emphasis. */
.sec > h2 em { font-style: normal; color: var(--brass); }

/* §4. Load stagger. .reveal handles scroll; this is for what is already on
   screen at first paint, where an observer never fires. Six elements is the
   ceiling - past that it stops reading as one movement and starts reading as
   a page that cannot settle. */
.rise { opacity: 0; transform: translateY(14px); animation: riseIn .8s var(--ease-out) forwards; }
.d1 { animation-delay: .05s } .d2 { animation-delay: .15s } .d3 { animation-delay: .25s }
.d4 { animation-delay: .35s } .d5 { animation-delay: .45s } .d6 { animation-delay: .55s }
@keyframes riseIn { to { opacity: 1; transform: none; } }

/* §6. A wide table at 360px scrolls sideways, and the moment it does you lose
   the row's identity - you are reading numbers with no idea which symbol they
   belong to. Pinning the first cell keeps the label with its row. Applied
   only where the table actually overflows, because a sticky column on a table
   that fits is a seam for no reason. */
@media (max-width: 720px) {
  .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-scroll > table.grid th:first-child,
  .tbl-scroll > table.grid td:first-child,
  .tbl-scroll > .perf-table th:first-child,
  .tbl-scroll > .perf-table td:first-child {
    position: sticky; left: 0; z-index: 3;
    background: var(--panel);
    /* The seam has to be drawn, not implied: with the row hover tint behind
       it, a transparent edge lets the scrolled content show through the gap. */
    box-shadow: 1px 0 0 var(--hair);
  }
  .tbl-scroll > table.grid thead th:first-child { z-index: 4; }
  .tbl-scroll > table.grid tbody tr:hover td:first-child { background: var(--panel-2); }
}

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; animation: none; }
}

/* §3A. Nav links: the underline sweeps in from the left and retracts to the
   right, so the motion has a direction and reads as the cursor drawing the
   line rather than a bar fading in and out under it. */
.top-nav a:not(.btn):not(.nav-btn)::after {
  content: ""; position: absolute; left: 0; bottom: 2px; height: 1px; width: 100%;
  background: var(--indigo); transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease-out);
}
.top-nav a:not(.btn):not(.nav-btn) { position: relative; }
.top-nav a:not(.btn):not(.nav-btn):hover::after,
.top-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
@media (prefers-reduced-motion: reduce) {
  .top-nav a::after { transition: none; }
}
/* Light mode needs its own tint: rgba(7,9,14,.72) over a near-white page is
   a dark bar, which is the one thing a light theme must not do. */
:root[data-theme="light-palette"] .top-nav { background: rgba(250, 250, 248, .78); }

/* =====================================================================
   TAB BAR — the shell change that reaches every page, at every width now.
   Used to be a phone-only bottom dock (the header carried the destination
   list inline instead above 720px); shown everywhere now, and the header's
   own copy of those links is hidden everywhere to match (see .top-nav's
   base rule) - one navigation, one place, regardless of width.
   ===================================================================== */
.tabbar {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(7, 9, 14, .92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--hair);
  /* The home-indicator strip on a modern phone overlaps the bottom of the
     viewport. Without this the labels sit under it and the last few pixels
     of the tap target are swallowed by the OS gesture area. Harmless at
     desktop widths - the env() resolves to 0 wherever there is no inset. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar .tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px 7px; min-height: 56px;
  color: var(--dim); text-decoration: none; position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.tabbar .tab span {
  font-size: var(--fs-tiny); letter-spacing: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tabbar .tab-ic { width: 19px; height: 19px; }
.tabbar .tab:hover { color: var(--muted); }
/* The active tab is the ONE accent-filled thing on a phone screen, which is
   what makes "where am I" answerable without reading. A hairline above it
   rather than a filled pill: the bar is chrome, not a control panel. */
.tabbar .tab.on { color: var(--indigo); }
.tabbar .tab.on::before {
  content: ""; position: absolute; top: -1px; left: 22%; right: 22%;
  height: 2px; background: var(--indigo); border-radius: 0 0 2px 2px;
}
.tabbar .tab-lock {
  position: absolute; top: 7px; right: 50%; margin-right: -16px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brass);
}
/* Content has to clear the bar, or the last row of every table and the
   final button on every form sit permanently underneath it. */
body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
/* Anything already pinned to the bottom stacks above it rather than behind.
   (.sticky-cta and .toast matched no markup anywhere in the app - neither
   component was ever built - so only the one that exists, .scan-pop,
   stays in this list.) */
.scan-pop { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

/* WIDE ENOUGH TO STOP LOOKING LIKE A PHONE BAR STRETCHED THIN.
   flex:1 1 0 on four tabs is fine when the whole row is a phone's width;
   spread across 1440px+ each tab would be several hundred pixels wide, a
   navigation element sized like nothing else on the page. Capped and
   centred instead, laid out as a row (icon beside label, not above it) so
   it reads as a compact desktop dock rather than an oversized phone bar. */
@media (min-width: 721px) {
  .tabbar { justify-content: center; gap: 4px; padding: 0 16px; }
  .tabbar .tab {
    flex: 0 1 150px; flex-direction: row; gap: 7px; min-height: 48px; padding: 0 6px;
  }
  .tabbar .tab span { font-size: 12.5px; }
  .tabbar .tab-ic { width: 17px; height: 17px; }
  .tabbar .tab.on::before {
    top: auto; bottom: -1px; border-radius: 2px 2px 0 0;
  }
  .tabbar .tab-lock { top: 50%; right: 8px; margin-right: 0; transform: translateY(-8px); }
}

:root[data-theme="light-palette"] .tabbar { background: rgba(250, 250, 248, .93); }
@media (prefers-reduced-motion: reduce) { .tabbar .tab { transition: none; } }

/* =====================================================================
   BELOW-THE-FOLD DASHBOARD
   =====================================================================
   Four sections, each still its own PHP if-block and still styled by the
   existing .panel/.sec rules untouched inside - only their PLACEMENT
   changes. The timeframe ladder is a strip, so it runs full width. Context
   and news are both dense two-column reads, so they share a row at 1.4fr/1fr.
   Events is a short list riding the last third of that same row instead of
   claiming a full width of its own underneath everything.
   ===================================================================== */
.fold-grid {
  display: flex; flex-wrap: wrap; gap: 18px;
  max-width: 1400px; margin: 0 auto; padding: 4px 22px 18px;
}
.fold-grid > .fg-mtf { flex: 1 1 100%; }
.fold-grid > .fg-context { flex: 1.4 1 460px; }
.fold-grid > .fg-news { flex: 1 1 380px; }
/* The wrapping sections still carry .layout's own centring/padding, which
   fights a flex child that should fill its slot. Neutralised only inside
   this container - .layout elsewhere on the page is untouched. */
.fold-grid > section.layout {
  display: block; max-width: none; margin: 0; padding: 0; min-width: 0;
}
@media (max-width: 980px) {
  .fold-grid { flex-direction: column; padding: 4px 16px 16px; }
  .fold-grid > .fg-context, .fold-grid > .fg-news { flex-basis: auto; }
}

/* =====================================================================
   PERFORMANCE PAGE CAROUSEL — six stacked breakdowns, one swipe strip
   =====================================================================
   Built at load by assets/ui.js from the page's own already-rendered
   markup - see the script for how the grouping works and what it verified
   against before shipping. CSS only handles how it looks once grouped.

   Mobile only. Desktop has the width to show a table without asking
   anyone to swipe for it, and a mouse-and-monitor reader scanning six
   small tables benefits more from seeing them than from paging through
   them one at a time.
   ===================================================================== */
@media (max-width: 900px) {
  .perf-carousel { margin: 4px 0 18px; }

  /* A wrapper purely so the fade can sit ON TOP of the scrolling strip
     without scrolling itself - a mask on the scroll container fades its own
     content away at the edge, which looks like the tab is disappearing
     rather than continuing off-screen. */
  .perf-tabs-wrap { position: relative; }
  .perf-tabs-wrap.at-end::after { opacity: 0; }
  .perf-tabs-wrap::after { transition: opacity var(--dur-fast, .16s) var(--ease);
    content: ""; position: absolute; top: 0; right: 0; bottom: 8px; width: 28px;
    background: linear-gradient(90deg, transparent, var(--void, var(--bg)) 85%);
    pointer-events: none;
  }
  .perf-tabs {
    display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 8px; margin-bottom: 10px; padding-right: 20px;
    scrollbar-width: none;
  }
  .perf-tabs::-webkit-scrollbar { display: none; }
  .perf-tab {
    flex: 0 0 auto; font-family: var(--font-sans, inherit); font-size: 12.5px; font-weight: 500;
    color: var(--muted); background: var(--surface2); border: 1px solid var(--border);
    border-radius: 999px; padding: 7px 13px; white-space: nowrap; cursor: pointer;
    transition: border-color var(--dur-fast, .16s) var(--ease), color var(--dur-fast, .16s) var(--ease);
  }
  .perf-tab:hover { color: var(--text); }
  /* The active tab is the one accent-filled element in this strip - every
     other tab stays a hairline outline, same rule as the rest of the
     system: one filled thing per view, everything else a border. */
  .perf-tab.on { color: var(--on-accent, #111); background: var(--accent-fill); border-color: var(--accent-fill); }

  .perf-track {
    display: flex; gap: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -16px; padding: 0 16px 4px;
    /* THE ROOT OF THE BLANK-SPACE BUG, NOT JUST ITS SYMPTOM.
       align-items defaults to stretch, so every slide - not only the
       tallest - was stretched to the row's own cross-size. That meant
       .scrollHeight on the SHORT "By grade" slide reported the STRETCHED
       height (matching the tallest sibling), not its own four rows of
       content: the JS fix below was reading an already-inflated number
       before it ever got the chance to correct anything. flex-start lets
       each slide size to what it actually contains. */
    align-items: flex-start;
    /* Set from JS to the height of whatever is actually in view - see
       ui.js. Needed now that slides no longer stretch to a shared row
       height: without it, a still-tall sibling would spill out of a track
       explicitly shortened to match a short one. Transitioned so a swipe
       between a short slide and a tall one resizes the row smoothly
       instead of snapping to a new height mid-gesture. */
    overflow-y: hidden;
    transition: height .25s var(--ease-out, ease-out);
  }
  .perf-track::-webkit-scrollbar { display: none; }
  .perf-slide {
    /* 100%, not the 88% "peek of the next card" pattern most carousels use.
       A sliver of the next table's header row read as a rendering glitch
       here - tables have their own internal grid lines, so a partial column
       poking in from the edge looks like something broke, not like an
       invitation to swipe. The tab strip above already tells the reader
       there are more; the slide itself should show exactly one, cleanly. */
    flex: 0 0 100%; scroll-snap-align: start; min-width: 0;
  }
  /* The heading now lives INSIDE the slide (moved there with its table by
     the grouping script) and would otherwise repeat what its own tab
     already says while the strip is visible. Kept for anyone who reaches
     the slide by swipe rather than by tapping a tab, and for a screen
     reader landing on the panel directly - hidden only from sighted
     pointer users who already have the tab row for the same information. */
  .perf-slide > .perf-slide-h { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
}

/* TWO SLIDES, WHEN TWO ACTUALLY FIT.
 *
 * A big phone in landscape, a small tablet, a folded-open phone - anything
 * from 640px up still narrower than the 900px this carousel's own ceiling -
 * has the width to show two of these tables side by side without either
 * one getting cramped. One slide alone at that width was leaving as much
 * air on the right as the table itself took on the left.
 *
 * The pairing is whatever scroll-snap lands on, not a fixed 1-2/3-4/5
 * grouping - swiping mid-pair slides the row by one card, not by two, so
 * the reader can align any card to the left edge and see its natural
 * neighbour beside it rather than being locked to bracketed pairs. */
@media (min-width: 640px) and (max-width: 900px) {
  .perf-slide { flex-basis: calc(50% - 7px); }
}

@media (prefers-reduced-motion: reduce) {
  .perf-track { scroll-behavior: auto; transition: none; }
}


/* ===========================================================================
   The trial invitation as a corner card - THE DEFAULT PLACEMENT.
   ===========================================================================
   It began as a strip at the top of <body>, which put it above the site
   header and pushed the whole page down: the offer was the first thing on
   the page and the masthead moved to make room for it. This sits over the
   page instead of inside it, so the header keeps its position and nothing
   reflows when the card appears or goes.

   It clears the tab bar rather than sitting on it. .tabbar is fixed to the
   bottom at every width (not just phones - see its own rule) and is 56px
   plus the phone's home-indicator inset, so anything bottom-anchored that
   ignores it covers the site's main navigation. Hence the offset below, and
   a z-index above the bar's 60 but under the 90 the header uses and the
   2000 of the blocking panel.

   Visible without JavaScript on purpose. The blocking panel ships hidden
   because an overlay nobody can close is worse than no overlay; a card in
   the corner has no such failure mode, so it renders as normal markup and
   the entrance is a CSS animation that needs no script to finish.
   ========================================================================= */
/* On a wide chart page the signal panel lives in the bottom-right corner - the
   same corner as this card - so the card sat on top of Support/Resistance and
   RSI, the numbers a visitor came to read. Swap sides there. :has() is in
   every current browser; older ones keep the right-hand placement. */
@media (min-width: 1100px) {
  body:has(#signalPanel) .trial-card { right: auto; left: 16px; }
}
.trial-card {
  position: fixed; z-index: 70;
  right: 16px; left: auto;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 14px);
  width: min(264px, calc(calc(100vw / var(--zf, 1)) - 32px));
  box-sizing: border-box;
  background: var(--surface2);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border-2));
  border-radius: 8px; padding: 11px 12px 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .32), 0 2px 6px rgba(0, 0, 0, .18);
  animation: trialCardIn .45s var(--ease-out) .9s backwards;
}
@keyframes trialCardIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.trial-card .tc-badge {
  display: inline-block; font-family: var(--font-mono); font-size: var(--fs-tiny);
  font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--bg-accent);
  border: 1px solid var(--line-accent); border-radius: 999px; padding: 3px 9px;
}
.trial-card .tc-title {
  margin: 7px 0 0; font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--text);
}
.trial-card .tc-left {
  display: block; margin: 5px 0 0; font-family: var(--font-mono);
  font-size: var(--fs-tiny); color: var(--accent);
}
.trial-card .tc-go {
  display: block; margin: 10px 0 0; text-align: center; width: 100%;
  box-sizing: border-box; padding: 8px 14px; font-size: 13px;
}
.trial-card .tc-x {
  position: absolute; top: 4px; right: 5px;
  background: none; border: 0; cursor: pointer; line-height: 1;
  font-size: 17px; padding: 3px 6px; border-radius: 6px;
  color: var(--dim);
}
.trial-card .tc-x:hover { color: var(--text); background: var(--surface3); }
/* Phones keep the corner rather than spanning the width. Full-width was the
   first instinct and it was wrong: a bar the width of a phone reads as part of
   the page and covered a fifth of the screen, where a small card in the corner
   is plainly a card and covers half that. It stays narrow enough to leave the
   page visible beside it even at 320. */
@media (max-width: 560px) {
  .trial-card {
    left: auto; right: 10px;
    width: min(248px, calc(calc(100vw / var(--zf, 1)) - 20px));
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 10px);
  }
}
/* A SHORT VIEWPORT IS THE REAL CONSTRAINT, NOT A NARROW ONE.
   At 320x568 the copy wraps enough that the card grew tall enough to reach
   the middle of the screen - measured covering the centre point, which is the
   thing this placement exists to avoid. Width alone does not catch it (a tall
   narrow phone is fine), so this keys on height and drops to the essentials:
   what it is, how many are left, and the button. The sentence about no card
   details is reassurance, and reassurance is what you cut first when there is
   no room for it. */
/* The card is compact at every size now, so the short-viewport rule that
   used to strip it down has nothing left to remove - it only tightens. */
@media (max-height: 700px) {
  .trial-card { padding: 9px 11px 10px; }
  .trial-card .tc-go { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  /* No slide, and no fill-mode either - the card must simply be there. */
  .trial-card { animation: none; }
}


/* The chart page's h1. Small by design - this is a trading screen and the
   chart is the content - but present, visible and the same words as the
   <title>. It is not hidden: a heading only a crawler can see is a
   penalty risk, not a ranking one. */
.chart-h1 {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 600; letter-spacing: .01em;
  color: var(--muted);
}
@media (max-width: 560px) { .chart-h1 { font-size: 12px; margin-bottom: 6px; } }

/* An emoji in a heading renders as whatever the visitor's OS ships - a
   different glyph on every platform, and a colour blob beside a monochrome
   design. The track record h1 now uses the same SVG as its tab. */
.h1-ic-wrap { display: inline-flex; vertical-align: -0.08em; margin-right: .35em; }
.h1-ic-wrap .h1-ic { width: .9em; height: .9em; stroke: var(--accent); }
