/* The price ticker.
 *
 * A component stylesheet rather than a page one: the strip is a partial
 * included by three different bases, so it has no page_css block of its
 * own to extend. Loaded by each base that includes it.
 *
 * The --tk-* properties are deliberately local. The ticker is dark on
 * every page, light theme included, because it is a market strip — it is
 * the one component that must NOT follow prefers-color-scheme.
 */

  /* The ticker is dark on every page, light theme included: it is a market
     strip, and the convention it borrows from is a dark one. These are its
     own properties rather than the estate's tokens, because it is the one
     component that must NOT follow prefers-color-scheme — and rather than
     reach for the old --d-* palette, which existed to hand-roll a dark
     theme the token system now does automatically, it states its own. */
  .app-ticker {
    --tk-surface: #0B0F0E;
    --tk-sunken:  #18211E;
    --tk-ink:     #E8EEEA;
    --tk-ink-2:   #A6B0AB;
    --tk-ink-3:   #6E7872;
    --tk-line:    #243029;
    --tk-accent:  #4FBBA5;
    --tk-warn:    #DDB976;
    --tk-pos:     #4ED28C;
    --tk-neg:     #F47A6A;
  }

  /* The flash takes the strip's OWN pos/neg, not the estate's. The strip
     is near-black in both themes, so a light theme's `--pos` — a dark
     green — would wash a dark green over near-black and flash nothing
     anyone can see. `--tk-pos` and `--tk-neg` exist for this.

     The duration is the shared token, because motion is not a theme: it is
     a preference, and `--t-flash` is zeroed under prefers-reduced-motion,
     which is what switches the flash off. */
  @keyframes flashUp {
    0%   { background: color-mix(in oklch, var(--tk-pos) 20%, transparent) }
    100% { background: transparent }
  }
  @keyframes flashDn {
    0%   { background: color-mix(in oklch, var(--tk-neg) 20%, transparent) }
    100% { background: transparent }
  }
  .flash-up { animation: flashUp var(--t-flash) var(--ease-exit); }
  .flash-dn { animation: flashDn var(--t-flash) var(--ease-exit); }
  /* The strip's own appearance, here rather than in app.css because the
     public site does not load app.css — which is how it came to render as a
     line of text on a cream background. An include that depends on a
     stylesheet the including page may not have is an include that works in
     one place and not the other. */
  .app-ticker {
    display: flex; align-items: center; height: 32px; overflow: hidden;
    position: relative; white-space: nowrap;
    background: var(--tk-surface, #0B0F0E);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
  }
  .app-ticker > * { flex-shrink: 0; }
  .app-ticker .item { display: inline-flex; align-items: center; gap: 6px; }
  .app-ticker .dot { width: 6px; height: 6px; border-radius: 50%; }
  @media (max-width:599px) { .app-ticker { height: 28px; } }

  /* Pinned beneath whatever sits above it, where the including page asks
     for that. The desk shell does not: its ticker is a row of a
     fixed-height grid and is already always on screen, so making it sticky
     there would be a no-op with a stacking context attached.

     `--ticker-top` is supplied by the page, because only the page knows
     what it is pinning under — and `--z-ticker` sits below `--z-nav` on
     the scale, so the strip slides beneath the nav rather than over it.
     That used to be 49 against the nav's 50, which held only as long as
     nobody touched either number. */
  .app-ticker.is-pinned {
    position: sticky; top: var(--ticker-top, 0); z-index: var(--z-ticker);
  }
