/* #region zone:monitor.status-ticker.style — แถบสถานะระบบวิ่งใต้แถบบน (เต็มความกว้าง บรรทัดเดียว) */
/* The system-status crawl (status-ticker.js): one line at every width, a pinned label on the left, items running
   right-to-left in an endless loop, a pause button on the right. One transform animation on a track of two identical
   copies (0 -> -50%). Monitor tokens only, so light and dark follow. State = shape + hidden word + text, never colour alone. */
.status-ticker {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
  height: var(--status-ticker-h, 40px);
  padding: 0 var(--gutter);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.status-ticker[hidden] {
  display: none;
}
.st-head {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 32px;
  padding: 0 var(--s-1);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  cursor: help;
}
.st-head svg {
  flex: none;
  color: var(--accent-text);
}
.st-head:focus-visible,
.st-link:focus-visible,
.st-pause:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.st-viewport {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-left: 1px solid var(--border-soft);
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 24px,
    #000 calc(100% - 24px),
    transparent 100%
  );
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.st-track {
  display: flex;
  flex: none;
  width: max-content;
}
.st-track.st-run {
  animation: st-crawl var(--st-seconds, 60s) linear infinite;
  will-change: transform;
}
@keyframes st-crawl {
  to {
    transform: translate3d(-50%, 0, 0);
  }
}
/* Pause: pointer over the band, keyboard focus inside it, a finger held on it, the pause button, a hidden tab. */
.status-ticker:hover .st-track,
.status-ticker:has(:focus-visible) .st-track,
.status-ticker[data-hold] .st-track,
.status-ticker[data-paused] .st-track,
.status-ticker[data-tab-hidden] .st-track {
  animation-play-state: paused;
}
.st-copy {
  display: flex;
  flex: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
.st-item {
  flex: none;
  display: flex;
  align-items: center;
}
.st-link {
  position: relative; /* contains the visually hidden state word, so the clipped band never widens the page */
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 32px;
  padding: 0 var(--s-1);
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
button.st-link {
  cursor: pointer;
}
button.st-link:hover .st-text {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.st-error .st-text {
  font-weight: var(--fw-semibold);
}
/* State shapes: circle = ok, triangle = warning, diamond = error (colour is a second cue, not the only one). */
.st-dot {
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
}
.st-warn .st-dot {
  background: var(--warning);
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.st-error .st-dot {
  background: var(--danger);
  border-radius: 0;
  transform: rotate(45deg) scale(0.8);
}
.st-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.st-sep {
  flex: none;
  width: 4px;
  height: 4px;
  margin: 0 var(--s-5);
  border-radius: 50%;
  background: var(--text-faint);
  opacity: 0.55;
}
.st-pause {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.st-pause:hover {
  background: var(--surface-hover);
  color: var(--text-1);
}
.st-pause[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-text);
}
.st-phone {
  display: none;
}
/* Reduced motion: no animation, one plain copy that scrolls by hand. */
@media (prefers-reduced-motion: reduce) {
  .st-track.st-run {
    animation: none;
  }
  .st-viewport {
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .st-pause {
    display: none;
  }
}
/* Touch and phones: still one line; the pause button grows to a touch target. */
@media (max-width: 759px), (pointer: coarse) {
  .status-ticker {
    --status-ticker-h: 52px;
    gap: var(--s-2);
  }
  .st-link {
    min-height: var(--touch-min);
  }
  .st-pause {
    width: var(--touch-min);
    height: var(--touch-min);
  }
}
@media (max-width: 600px) {
  .st-head svg {
    display: none;
  }
}
@media (max-width: 759px) {
  .status-ticker {
    height: calc(var(--u-tap) + 2px);
    margin: var(--u-space-2) var(--gutter) 0;
    padding: 0 0 0 var(--u-space-3);
    gap: var(--u-space-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--u-radius-pill);
  }
  .st-head {
    padding: 0;
  }
  .st-head svg {
    display: block;
  }
  .st-label {
    display: none;
  }
  .st-viewport {
    border: 0;
  }
  .st-pause {
    width: var(--u-tap);
    height: var(--u-tap);
    border: 0;
    border-radius: var(--u-radius-pill);
  }
}
@media (max-width: 759px) and (prefers-reduced-motion: no-preference) {
  .st-viewport {
    mask-image: none;
    -webkit-mask-image: none;
  }
  .st-track {
    display: none;
  }
  .st-phone {
    display: flex;
    width: 100%;
    min-width: 0;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .st-phone .st-item,
  .st-phone .st-link {
    width: 100%;
    min-width: 0;
  }
  .st-phone .st-link {
    padding: 0;
    font-size: var(--fs-xs);
  }
  .st-phone .st-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .st-phone .st-sep {
    display: none;
  }
}
/* #endregion */
