/* Axiovex Signals floating widget (spec 008, WF-G6 / WF-12).
   Self-contained: styles only .sw-* classes. Loaded on every page
   except /signals/. The widget renders nothing until its script has
   data from /signals-widget.json — an empty mount leaves no trace. */

.sw-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40; /* below the sticky nav (50) and the open mobile menu */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 15px;
  line-height: 1.45;
}

.sw-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan, #00DEF6);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .sw-live-dot { animation: sw-live-pulse 2.4s ease-in-out infinite; }
  @keyframes sw-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
  }
}

/* ---------- Collapsed pill (the toggle) ---------- */
.sw-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--cyan, #00DEF6);
  background: #0B2740;
  color: var(--ink, #F7FCFF);
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.sw-pill:hover { border-color: var(--ink, #F7FCFF); }
.sw-pill .sw-chev { color: var(--cyan, #00DEF6); font-size: 12px; }

/* ---------- Expanded panel ---------- */
.sw-panel {
  width: 340px;
  max-width: calc(100vw - 24px);
  background: #0B2740;
  border: 1px solid var(--line, rgba(0, 222, 246, 0.16));
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color: var(--ink, #F7FCFF);
  overflow-y: auto;
}
.sw-panel[hidden],
.sw-pill[hidden] { display: none !important; }

.sw-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.sw-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
}
.sw-collapse {
  border: 1px solid var(--line, rgba(0, 222, 246, 0.16));
  background: transparent;
  color: var(--muted, rgba(247, 252, 255, 0.72));
  border-radius: 999px;
  padding: 2px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.sw-collapse:hover { border-color: var(--cyan, #00DEF6); color: var(--ink, #F7FCFF); }

.sw-kicker {
  color: var(--cyan, #00DEF6);
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.sw-pulse {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-top: 1px solid rgba(247, 252, 255, 0.1);
  border-bottom: 1px solid rgba(247, 252, 255, 0.1);
  padding: 10px 0;
  margin-bottom: 12px;
}
.sw-pulse p { font-size: 11px; color: var(--faint, rgba(247, 252, 255, 0.5)); line-height: 1.35; margin: 0; }
.sw-pulse b { display: block; font-size: 17px; color: var(--ink, #F7FCFF); margin-top: 2px; }

.sw-item { margin-bottom: 10px; }
.sw-lane {
  color: var(--cyan, #00DEF6);
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
}
.sw-hl { font-size: 14.5px; line-height: 1.4; margin: 2px 0 0; }
.sw-hl a { color: var(--ink, #F7FCFF); text-decoration: none; }
.sw-hl a:hover { color: var(--cyan, #00DEF6); text-decoration: underline; }
.sw-meta { color: var(--faint, rgba(247, 252, 255, 0.5)); font-size: 12px; margin: 2px 0 0; }

.sw-all {
  display: inline-block;
  margin-top: 4px;
  color: var(--cyan, #00DEF6);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}
.sw-all:hover { text-decoration: underline; }

.sw-updated {
  color: var(--faint, rgba(247, 252, 255, 0.5));
  font-size: 12px;
  margin: 8px 0 0;
}

.sw-pill:focus-visible,
.sw-collapse:focus-visible,
.sw-hl a:focus-visible,
.sw-all:focus-visible {
  outline: 2px solid var(--cyan, #00DEF6);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .sw-panel { transition: opacity 0.18s ease, transform 0.18s ease; }
}

/* ---------- Mobile (<= 660px) ---------- */
@media (max-width: 660px) {
  .sw-root {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .sw-panel {
    max-height: 70dvh;
  }
}
