/* Sitewide Matrix Live ticker. Label is the pause/play button (v4-17c). */
.ticker{
  background:#0d1620;
  color:#faf9f5;
  border-top:1px solid rgba(255,255,255,.08);
  border-bottom:3px solid #0098c7;
  height:2.6rem;
  display:flex;
  align-items:stretch;
  overflow:hidden;
  font-size:.92rem;
  contain:layout paint;
}
/* Combined label + pause/play (Matrix Live / Latest) */
.ticker > .tk-brk-toggle{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:.28rem;
  margin:0;
  padding:0 .7rem;
  border:0;
  border-right:1px solid rgba(255,255,255,.12);
  border-radius:0;
  font:700 .72rem/1 'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
  user-select:none;
  -webkit-appearance:none;
  appearance:none;
}
.ticker > .tk-brk-toggle.tk-label-latest{
  color:#0b0b0b;
  background:#0098c7;
}
.ticker > .tk-brk-toggle.tk-label-breaking{
  color:#fff;
  background:#c62828;
}
.ticker > .tk-brk-toggle:focus-visible{
  outline:3px solid #0098C7;
  outline-offset:-3px;
}
.ticker > .tk-brk-toggle .tk-ico{
  display:inline-block;
  font-size:.62rem;
  line-height:1;
  opacity:.95;
}
.ticker > .tk-brk-toggle .tk-ico-play{display:none}
.ticker.is-latched-paused > .tk-brk-toggle .tk-ico-pause{display:none}
.ticker.is-latched-paused > .tk-brk-toggle .tk-ico-play{display:inline}
.ticker > .tk-brk-toggle .tk-lab-text{white-space:nowrap}
@media (max-width:420px){
  .ticker > .tk-brk-toggle{padding:0 .32rem;font-size:.52rem;letter-spacing:.02em;gap:.16rem}
  .ticker > .tk-brk-toggle .tk-ico{font-size:.5rem}
  .ticker .tk-pill{font-size:.55rem;letter-spacing:.02em;padding:.15rem .28rem}
}
/* Legacy checkbox Pause chrome (hidden; the label button is used) */
.ticker > .tk-ctl,
.ticker > .tk-btn{display:none !important}
/* Keep old .tk-label styles for any non-button leftovers */
.ticker .tk-label{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  padding:0 .8rem;
  font:700 .72rem/1 'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.ticker .tk-label.tk-label-latest{color:#0b0b0b;background:#0098c7}
.ticker .tk-label.tk-label-breaking{color:#fff;background:#c62828}
.ticker .tk-view{
  flex:1 1 auto;
  overflow:hidden;
  position:relative;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 1.5rem,#000 calc(100% - 1.5rem),transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0,#000 1.5rem,#000 calc(100% - 1.5rem),transparent 100%);
}
.ticker .tk-rail{
  display:flex;
  width:max-content;
  height:100%;
  animation:tk-scroll var(--tk-dur,60s) linear infinite;
}
.ticker ul{
  display:flex;
  list-style:none;
  margin:0;
  padding:0;
  height:100%;
}
.ticker li{
  display:flex;
  align-items:center;
  white-space:nowrap;
  height:100%;
}
.ticker li::after{
  content:"•";
  color:#e01484;
  margin:0 1.1rem;
  opacity:.7;
}
.ticker a{
  color:#faf9f5;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding:.25rem .15rem;
  border-radius:3px;
}
.ticker a:hover .tk-h{
  text-decoration:underline;
  text-decoration-color:#33B5E5;
}
.ticker a:focus-visible{
  outline:2px solid #0098C7;
  outline-offset:1px;
}
.ticker .tk-h{font-weight:600}
.ticker .tk-pill{
  font:700 .65rem/1 'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;
  letter-spacing:.07em;
  text-transform:uppercase;
  padding:.2rem .4rem;
  border-radius:3px;
  flex:0 0 auto;
}
.ticker .tk-pill.tk-latest{background:#0098c7;color:#0b0b0b}
.ticker .tk-pill.tk-breaking{background:#c62828;color:#fff}
/*
  Pause rules (v4-17c fix):
  - Latched pause from the label button (.is-latched-paused)
  - Temporary hover pause (.is-paused) only from JS on fine pointers
  - CSS :hover only when the device truly supports hover (not sticky touch hover)
  - Do NOT pause on :focus-within (kept the button focused after tap on phones)
*/
.ticker.is-latched-paused .tk-rail,
.ticker.is-paused .tk-rail{
  animation-play-state:paused;
}
@media (hover:hover) and (pointer:fine){
  .ticker:hover .tk-rail{animation-play-state:paused}
}
@keyframes tk-scroll{
  from{transform:translateX(0)}
  to{transform:translateX(-50%)}
}
@media (prefers-reduced-motion:reduce){
  .ticker .tk-rail{animation:none;width:auto}
  .ticker .tk-view{
    overflow-x:auto;
    scroll-snap-type:x proximity;
    -webkit-mask-image:none;
    mask-image:none;
    scrollbar-width:thin;
  }
  .ticker li{scroll-snap-align:start}
  .ticker .tk-btn,
  .ticker .tk-dup,
  .ticker .tk-ico{display:none}
}
/* Desk live rows. Appended only. Phone width keeps the badge visible. */
[data-ticker-root] .tk-live{
  font:700 .65rem/1 'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;
  letter-spacing:.06em;
  text-transform:uppercase;
  background:#c62828;
  color:#fff;
  padding:.15rem .35rem;
  border-radius:3px;
  flex:0 0 auto;
  white-space:nowrap;
  display:inline-block;
}
[data-ticker-root] .tk-practice{
  font:700 .65rem/1 'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;
  letter-spacing:.06em;
  text-transform:uppercase;
  background:#f57c00;
  color:#111;
  padding:.15rem .35rem;
  border-radius:3px;
  flex:0 0 auto;
  white-space:nowrap;
  display:inline-block;
}
[data-ticker-root] .tk-static{
  color:#faf9f5;
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding:.25rem .15rem;
  border-radius:3px;
  cursor:default;
}
@media (max-width:420px){
  [data-ticker-root] .tk-live,
  [data-ticker-root] .tk-practice{
    display:inline-block;
    visibility:visible;
    font-size:.65rem;
    line-height:1;
    padding:.12rem .3rem;
  }
}

/* Contain the ticker bar to the site column (--max, 1120px on the homepage).
   The flex track is max-content; min-width:0 lets .tk-view shrink and clip it.
   Do not hide overflow on the page. */
[data-ticker-root].ticker{
  box-sizing:border-box;
  width:calc(100% - 2rem);
  max-width:var(--max, 1120px);
  margin-left:auto;
  margin-right:auto;
  min-width:0;
}
[data-ticker-root] .tk-view{
  flex:1 1 0;
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

@media (max-width:420px){
  /* After the general 1.5rem fade: at phone width leave the left edge unfaded so MATRIX LIVE pills stay whole. */
  [data-ticker-root].ticker .tk-view{
    -webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - .7rem),transparent 100%);
    mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - .7rem),transparent 100%);
  }
}

/* t1004u: keep ticker headlines tappable while the rail animates, especially on phones. */
.ticker .tk-view,
.ticker .tk-rail,
.ticker a{
  pointer-events:auto;
  touch-action:manipulation;
}
.ticker .tk-dup a{pointer-events:auto}
